lol
1{ stdenv, fetchurl, pkgconfig
2, SDL, libGLU_combined, openal, lua
3, libdevil, freetype, physfs
4, libmodplug, mpg123, libvorbis, libogg
5}:
6
7stdenv.mkDerivation rec {
8 name = "love-0.8.0";
9 src = fetchurl {
10 url = "https://bitbucket.org/rude/love/downloads/${name}-linux-src.tar.gz";
11 sha256 = "1k4fcsa8zzi04ja179bmj24hvqcbm3icfvrvrzyz2gw9qwfclrwi";
12 };
13
14 nativeBuildInputs = [ pkgconfig ];
15 buildInputs = [
16 SDL libGLU_combined openal lua
17 libdevil freetype physfs libmodplug mpg123 libvorbis libogg
18 ];
19
20 preConfigure = ''
21 luaoptions="${"''"} lua luajit "
22 for i in lua luajit-; do
23 for j in 5 5.0 5.1 5.2 5.3 5.4; do
24 luaoptions="$luaoptions $i$j "
25 done
26 done
27 luaso="$(echo "${lua}/lib/"lib*.so.*)"
28 luaso="''${luaso##*/lib}"
29 luaso="''${luaso%%.so*}"
30 luaoptions="$luaoptions $luaso"
31 sed -e "s/${"''"} lua lua.*;/$luaoptions;/" -i configure
32
33 luaincdir="$(echo "${lua}/include"/*/ )"
34 test -d "$luaincdir" && {
35 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$luaincdir"
36 } || true
37 '';
38
39 NIX_CFLAGS_COMPILE = ''
40 -I${SDL.dev}/include/SDL
41 -I${freetype.dev}include/freetype2
42 '';
43
44 meta = {
45 homepage = http://love2d.org;
46 description = "A Lua-based 2D game engine/scripting language";
47 license = stdenv.lib.licenses.zlib;
48
49 platforms = stdenv.lib.platforms.linux;
50 maintainers = [ stdenv.lib.maintainers.raskin ];
51 };
52}