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 8 libGL, 9 9 openal, 10 10 luajit, 11 + lua5_1, 11 12 freetype, 12 13 physfs, 13 14 libmodplug, ··· 40 41 ]; 41 42 buildInputs = [ 42 43 SDL2 43 - xorg.libX11 # SDl2 optional depend, for SDL_syswm.h 44 - libGLU 45 - libGL 46 44 openal 47 - luajit 45 + (if stdenv.isDarwin then lua5_1 else luajit) 48 46 freetype 49 47 physfs 50 48 libmodplug ··· 54 52 libtheora 55 53 which 56 54 libtool 55 + ] 56 + ++ lib.optionals stdenv.isLinux [ 57 + xorg.libX11 # SDL2 optional depend, for SDL_syswm.h 58 + libGLU 59 + libGL 57 60 ]; 58 61 59 62 preConfigure = "$shell ./platform/unix/automagic"; 60 63 61 64 configureFlags = [ 62 - "--with-lua=luajit" 65 + (if stdenv.isDarwin then "--with-lua=lua" else "--with-lua=luajit") 63 66 ]; 64 67 65 68 env.NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 66 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 + 67 86 meta = { 68 87 homepage = "https://love2d.org"; 69 88 description = "Lua-based 2D game engine/scripting language"; 70 89 mainProgram = "love"; 71 90 license = lib.licenses.zlib; 72 - platforms = lib.platforms.linux; 91 + platforms = lib.platforms.linux ++ lib.platforms.darwin; 73 92 maintainers = [ lib.maintainers.raskin ]; 74 93 }; 75 94 }