love2d: add Darwin platform support (#444969)

authored by 7c6f434c and committed by GitHub f3063470 5f03e425

+25 -6
+25 -6
pkgs/development/interpreters/love/11.nix
··· 8 libGL, 9 openal, 10 luajit, 11 freetype, 12 physfs, 13 libmodplug, ··· 40 ]; 41 buildInputs = [ 42 SDL2 43 - xorg.libX11 # SDl2 optional depend, for SDL_syswm.h 44 - libGLU 45 - libGL 46 openal 47 - luajit 48 freetype 49 physfs 50 libmodplug ··· 54 libtheora 55 which 56 libtool 57 ]; 58 59 preConfigure = "$shell ./platform/unix/automagic"; 60 61 configureFlags = [ 62 - "--with-lua=luajit" 63 ]; 64 65 env.NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 66 67 meta = { 68 homepage = "https://love2d.org"; 69 description = "Lua-based 2D game engine/scripting language"; 70 mainProgram = "love"; 71 license = lib.licenses.zlib; 72 - platforms = lib.platforms.linux; 73 maintainers = [ lib.maintainers.raskin ]; 74 }; 75 }
··· 8 libGL, 9 openal, 10 luajit, 11 + lua5_1, 12 freetype, 13 physfs, 14 libmodplug, ··· 41 ]; 42 buildInputs = [ 43 SDL2 44 openal 45 + (if stdenv.isDarwin then lua5_1 else luajit) 46 freetype 47 physfs 48 libmodplug ··· 52 libtheora 53 which 54 libtool 55 + ] 56 + ++ lib.optionals stdenv.isLinux [ 57 + xorg.libX11 # SDL2 optional depend, for SDL_syswm.h 58 + libGLU 59 + libGL 60 ]; 61 62 preConfigure = "$shell ./platform/unix/automagic"; 63 64 configureFlags = [ 65 + (if stdenv.isDarwin then "--with-lua=lua" else "--with-lua=luajit") 66 ]; 67 68 env.NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 69 70 + # Fix Darwin bundle/dylib linking and macOS function calls 71 + preBuild = lib.optionalString stdenv.isDarwin '' 72 + # Fix libtool to use dynamiclib instead of bundle for Darwin 73 + substituteInPlace libtool \ 74 + --replace "-bundle" "-dynamiclib" \ 75 + --replace "-Wl,-bundle" "-Wl,-dynamiclib" 76 + 77 + substituteInPlace src/love.cpp \ 78 + --replace "love::macosx::checkDropEvents()" "std::string(\"\")" \ 79 + --replace "love::macosx::getLoveInResources()" "std::string(\"\")" 80 + ''; 81 + 82 + postFixup = lib.optionalString stdenv.isDarwin '' 83 + install_name_tool -change ".libs/liblove-11.5.so" "$out/lib/liblove-11.5.so" "$out/bin/love" 84 + ''; 85 + 86 meta = { 87 homepage = "https://love2d.org"; 88 description = "Lua-based 2D game engine/scripting language"; 89 mainProgram = "love"; 90 license = lib.licenses.zlib; 91 + platforms = lib.platforms.linux ++ lib.platforms.darwin; 92 maintainers = [ lib.maintainers.raskin ]; 93 }; 94 }