Support LuaJIT usage when building love2d

This commit is contained in:
Michael Raskin 2013-11-28 23:01:05 +04:00
parent b921a787a0
commit 075883c218
2 changed files with 23 additions and 3 deletions

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig
, SDL, mesa, openal, lua5
, SDL, mesa, openal, lua
, libdevil, freetype, physfs
, libmodplug, mpg123, libvorbis, libogg
}:
@ -12,10 +12,29 @@ stdenv.mkDerivation rec {
};
buildInputs = [
pkgconfig SDL mesa openal lua5
pkgconfig SDL mesa openal lua
libdevil freetype physfs libmodplug mpg123 libvorbis libogg
];
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
'';
NIX_CFLAGS_COMPILE = ''
-I${SDL}/include/SDL
-I${freetype}include/freetype2

View File

@ -3192,7 +3192,8 @@ let
kona = callPackage ../development/interpreters/kona {};
love = callPackage ../development/interpreters/love {};
love = callPackage ../development/interpreters/love {lua=lua5;};
love_luajit = callPackage ../development/interpreters/love {lua=luajit;};
lua4 = callPackage ../development/interpreters/lua-4 { };
lua5_0 = callPackage ../development/interpreters/lua-5/5.0.3.nix { };