summaryrefslogtreecommitdiffstats
path: root/pkgs/development/interpreters/love
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2013-11-28 23:01:05 +0400
committerMichael Raskin <7c6f434c@mail.ru>2013-11-28 23:01:05 +0400
commit075883c218f9bf7ae60d7d69cc7cdad024c06847 (patch)
treed63d92396ebc8dd43c01a7166d3209437c20101f /pkgs/development/interpreters/love
parentb921a787a067028c2342176e6ef7afaa542e4c3a (diff)
Support LuaJIT usage when building love2d
Diffstat (limited to 'pkgs/development/interpreters/love')
-rw-r--r--pkgs/development/interpreters/love/default.nix23
1 files changed, 21 insertions, 2 deletions
diff --git a/pkgs/development/interpreters/love/default.nix b/pkgs/development/interpreters/love/default.nix
index 318a336faa66..8e7914afb616 100644
--- a/pkgs/development/interpreters/love/default.nix
+++ b/pkgs/development/interpreters/love/default.nix
@@ -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