1 { lib, stdenv, fetchurl, pkg-config
2 , SDL, libGLU, libGL, openal, lua
3 , libdevil, freetype, physfs
4 , libmodplug, mpg123, libvorbis, libogg
8 stdenv.mkDerivation rec {
11 url = "https://bitbucket.org/rude/love/downloads/${name}-linux-src.tar.gz";
12 sha256 = "0s7jywkvydlshlgy11ilzngrnybmq5xlgzp2v2dhlffwrfqdqym5";
15 # see discussion on arch linux user repository (https://aur.archlinux.org/packages/love07/?setlang=cs#comment-684696)
16 patches = [ ./0.7-gl-prototypes.patch ];
18 nativeBuildInputs = [ pkg-config ];
20 SDL libGLU libGL openal lua
21 libdevil freetype physfs libmodplug mpg123 libvorbis libogg libmng
25 luaoptions="${"''"} lua luajit "
26 for i in lua luajit-; do
27 for j in 5 5.0 5.1 5.2 5.3 5.4; do
28 luaoptions="$luaoptions $i$j "
31 luaso="$(echo "${lua}/lib/"lib*.so.*)"
32 luaso="''${luaso##*/lib}"
33 luaso="''${luaso%%.so*}"
34 luaoptions="$luaoptions $luaso"
35 sed -e "s/${"''"} lua lua.*;/$luaoptions;/" -i configure
37 luaincdir="$(echo "${lua}/include"/*/ )"
38 test -d "$luaincdir" && {
39 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$luaincdir"
43 NIX_CFLAGS_COMPILE = ''
44 -I${SDL.dev}/include/SDL
45 -I${freetype.dev}include/freetype2
49 homepage = "http://love2d.org";
50 description = "A Lua-based 2D game engine/scripting language";
51 license = lib.licenses.zlib;
53 platforms = lib.platforms.linux;
54 maintainers = [ lib.maintainers.raskin ];