lol
1{ stdenv, fetchurl, pkgconfig
2, SDL, mesa, 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 buildInputs = [
15 pkgconfig SDL mesa openal lua
16 libdevil freetype physfs libmodplug mpg123 libvorbis libogg
17 ];
18
19 preConfigure = ''
20 luaoptions="${"''"} lua luajit "
21 for i in lua luajit-; do
22 for j in 5 5.0 5.1 5.2 5.3 5.4; do
23 luaoptions="$luaoptions $i$j "
24 done
25 done
26 luaso="$(echo "${lua}/lib/"lib*.so.*)"
27 luaso="''${luaso##*/lib}"
28 luaso="''${luaso%%.so*}"
29 luaoptions="$luaoptions $luaso"
30 sed -e "s/${"''"} lua lua.*;/$luaoptions;/" -i configure
31
32 luaincdir="$(echo "${lua}/include"/*/ )"
33 test -d "$luaincdir" && {
34 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$luaincdir"
35 } || true
36 '';
37
38 NIX_CFLAGS_COMPILE = ''
39 -I${SDL}/include/SDL
40 -I${freetype}include/freetype2
41 '';
42
43 meta = {
44 homepage = "http://love2d.org";
45 description = "A Lua-based 2D game engine/scripting language";
46 license = stdenv.lib.licenses.zlib;
47
48 platforms = stdenv.lib.platforms.linux;
49 maintainers = [ stdenv.lib.maintainers.raskin ];
50 };
51}