2013-02-21 01:44:41 +00:00
|
|
|
{ stdenv, fetchurl, pkgconfig
|
2019-11-10 16:44:34 +00:00
|
|
|
, SDL, libGLU, libGL, openal, lua
|
2013-02-21 01:44:41 +00:00
|
|
|
, libdevil, freetype, physfs
|
|
|
|
, libmodplug, mpg123, libvorbis, libogg
|
|
|
|
}:
|
2011-09-11 18:05:48 +01:00
|
|
|
|
2013-02-21 01:44:41 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-09-11 01:57:12 +01:00
|
|
|
pname = "love";
|
|
|
|
version = "0.8.0";
|
|
|
|
|
2013-02-21 01:44:41 +00:00
|
|
|
src = fetchurl {
|
2019-09-11 01:57:12 +01:00
|
|
|
url = "https://bitbucket.org/rude/love/downloads/${pname}-${version}-linux-src.tar.gz";
|
2013-02-21 01:44:41 +00:00
|
|
|
sha256 = "1k4fcsa8zzi04ja179bmj24hvqcbm3icfvrvrzyz2gw9qwfclrwi";
|
2011-09-11 18:05:48 +01:00
|
|
|
};
|
|
|
|
|
2017-09-14 20:24:37 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2013-02-21 01:44:41 +00:00
|
|
|
buildInputs = [
|
2019-11-10 16:44:34 +00:00
|
|
|
SDL libGLU libGL openal lua
|
2013-02-21 01:44:41 +00:00
|
|
|
libdevil freetype physfs libmodplug mpg123 libvorbis libogg
|
|
|
|
];
|
2011-09-11 18:05:48 +01:00
|
|
|
|
2013-11-28 19:01:05 +00:00
|
|
|
preConfigure = ''
|
|
|
|
luaoptions="${"''"} lua luajit "
|
|
|
|
for i in lua luajit-; do
|
|
|
|
for j in 5 5.0 5.1 5.2 5.3 5.4; do
|
|
|
|
luaoptions="$luaoptions $i$j "
|
|
|
|
done
|
|
|
|
done
|
|
|
|
luaso="$(echo "${lua}/lib/"lib*.so.*)"
|
|
|
|
luaso="''${luaso##*/lib}"
|
|
|
|
luaso="''${luaso%%.so*}"
|
|
|
|
luaoptions="$luaoptions $luaso"
|
|
|
|
sed -e "s/${"''"} lua lua.*;/$luaoptions;/" -i configure
|
|
|
|
|
|
|
|
luaincdir="$(echo "${lua}/include"/*/ )"
|
|
|
|
test -d "$luaincdir" && {
|
|
|
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$luaincdir"
|
|
|
|
} || true
|
|
|
|
'';
|
|
|
|
|
2019-10-30 02:23:29 +00:00
|
|
|
NIX_CFLAGS_COMPILE = toString [
|
2019-09-11 01:57:12 +01:00
|
|
|
"-I${SDL.dev}/include/SDL"
|
|
|
|
"-I${freetype.dev}include/freetype2"
|
|
|
|
"-DGL_GLEXT_PROTOTYPES" # https://community.khronos.org/t/glgenbuffers-was-not-declared-in-this-scope/59283/2
|
|
|
|
];
|
2011-09-11 18:05:48 +01:00
|
|
|
|
|
|
|
meta = {
|
2019-09-11 01:57:12 +01:00
|
|
|
homepage = "http://love2d.org";
|
2011-09-11 18:05:48 +01:00
|
|
|
description = "A Lua-based 2D game engine/scripting language";
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.zlib;
|
2013-02-21 01:44:41 +00:00
|
|
|
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2013-02-21 13:28:58 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.raskin ];
|
2011-09-11 18:05:48 +01:00
|
|
|
};
|
2013-02-21 01:44:41 +00:00
|
|
|
}
|