eduke32: implement proper macOS support

+38 -7
+35 -6
pkgs/games/eduke32/default.nix
··· 1 { lib, stdenv, fetchurl, makeWrapper, pkg-config, nasm, makeDesktopItem 2 , alsa-lib, flac, gtk2, libvorbis, libvpx, libGLU, libGL 3 - , SDL2, SDL2_mixer }: 4 5 let 6 desktopItem = makeDesktopItem { ··· 25 sha256 = "0fdl2i465cl5x7129772ksx97lvim98m9009q5cfmf6scagj9pvz"; 26 }; 27 28 - buildInputs = [ alsa-lib flac gtk2 libvorbis libvpx libGL libGLU SDL2 SDL2_mixer ]; 29 30 nativeBuildInputs = [ makeWrapper pkg-config ] 31 ++ lib.optional (stdenv.hostPlatform.system == "i686-linux") nasm; 32 33 - postPatch = '' 34 substituteInPlace source/build/src/glbuild.cpp \ 35 --replace libGLU.so ${libGLU}/lib/libGLU.so 36 ··· 44 45 makeFlags = [ 46 "SDLCONFIG=${SDL2}/bin/sdl2-config" 47 ]; 48 49 enableParallelBuilding = true; ··· 52 runHook preInstall 53 54 install -Dm755 -t $out/bin eduke32 mapster32 55 - 56 makeWrapper $out/bin/eduke32 $out/bin/${wrapper} \ 57 --set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \ 58 --add-flags '-g "$EDUKE32_DATA_DIR/DUKE3D.GRP"' ··· 60 cp -rv ${desktopItem}/share $out 61 substituteInPlace $out/share/applications/eduke32.desktop \ 62 --subst-var out 63 64 runHook postInstall 65 ''; 66 ··· 68 description = "Enhanched port of Duke Nukem 3D for various platforms"; 69 homepage = "http://eduke32.com"; 70 license = licenses.gpl2Plus; 71 - maintainers = with maintainers; [ sander ]; 72 - # Darwin is untested (supported by upstream) 73 platforms = platforms.all; 74 }; 75 }
··· 1 { lib, stdenv, fetchurl, makeWrapper, pkg-config, nasm, makeDesktopItem 2 , alsa-lib, flac, gtk2, libvorbis, libvpx, libGLU, libGL 3 + , SDL2, SDL2_mixer 4 + , AGL, Cocoa, GLUT, OpenGL 5 + }: 6 7 let 8 desktopItem = makeDesktopItem { ··· 27 sha256 = "0fdl2i465cl5x7129772ksx97lvim98m9009q5cfmf6scagj9pvz"; 28 }; 29 30 + buildInputs = [ 31 + flac 32 + libvorbis 33 + libvpx 34 + SDL2 35 + SDL2_mixer 36 + ] ++ lib.optionals stdenv.isLinux [ 37 + alsa-lib 38 + gtk2 39 + libGL 40 + libGLU 41 + ] ++ lib.optionals stdenv.isDarwin [ 42 + AGL 43 + Cocoa 44 + GLUT 45 + OpenGL 46 + ]; 47 48 nativeBuildInputs = [ makeWrapper pkg-config ] 49 ++ lib.optional (stdenv.hostPlatform.system == "i686-linux") nasm; 50 51 + postPatch = lib.optionalString stdenv.isLinux '' 52 substituteInPlace source/build/src/glbuild.cpp \ 53 --replace libGLU.so ${libGLU}/lib/libGLU.so 54 ··· 62 63 makeFlags = [ 64 "SDLCONFIG=${SDL2}/bin/sdl2-config" 65 + ] ++ lib.optionals stdenv.isDarwin [ 66 + # broken, see: https://github.com/NixOS/nixpkgs/issues/19098 67 + "LTO=0" 68 ]; 69 70 enableParallelBuilding = true; ··· 73 runHook preInstall 74 75 install -Dm755 -t $out/bin eduke32 mapster32 76 + '' + lib.optionalString stdenv.isLinux '' 77 makeWrapper $out/bin/eduke32 $out/bin/${wrapper} \ 78 --set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \ 79 --add-flags '-g "$EDUKE32_DATA_DIR/DUKE3D.GRP"' ··· 81 cp -rv ${desktopItem}/share $out 82 substituteInPlace $out/share/applications/eduke32.desktop \ 83 --subst-var out 84 + '' + lib.optionalString stdenv.isDarwin '' 85 + mkdir -p $out/Applications/EDuke32.app/Contents/MacOS 86 + mkdir -p $out/Applications/Mapster32.app/Contents/MacOS 87 88 + cp -r platform/Apple/bundles/EDuke32.app/* $out/Applications/EDuke32.app/ 89 + cp -r platform/Apple/bundles/Mapster32.app/* $out/Applications/Mapster32.app/ 90 + 91 + ln -sf $out/bin/eduke32 $out/Applications/EDuke32.app/Contents/MacOS/eduke32 92 + ln -sf $out/bin/mapster32 $out/Applications/Mapster32.app/Contents/MacOS/mapster32 93 + '' + '' 94 runHook postInstall 95 ''; 96 ··· 98 description = "Enhanched port of Duke Nukem 3D for various platforms"; 99 homepage = "http://eduke32.com"; 100 license = licenses.gpl2Plus; 101 + maintainers = with maintainers; [ mikroskeem sander ]; 102 platforms = platforms.all; 103 }; 104 }
+3 -1
pkgs/top-level/all-packages.nix
··· 29473 29474 ecwolf = callPackage ../games/ecwolf { }; 29475 29476 - eduke32 = callPackage ../games/eduke32 { }; 29477 29478 egoboo = callPackage ../games/egoboo { }; 29479
··· 29473 29474 ecwolf = callPackage ../games/ecwolf { }; 29475 29476 + eduke32 = callPackage ../games/eduke32 { 29477 + inherit (darwin.apple_sdk.frameworks) AGL Cocoa GLUT OpenGL; 29478 + }; 29479 29480 egoboo = callPackage ../games/egoboo { }; 29481