eduke32: implement proper macOS support

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