perfect_dark: un-vendor gzip; refactor derivation builder; add updateScript (#440718)

authored by Fernando Rodrigues and committed by GitHub ff436949 8e7c62bd

+16 -7
+16 -7
pkgs/by-name/pe/perfect_dark/package.nix
··· 2 2 lib, 3 3 stdenv, 4 4 fetchFromGitHub, 5 - SDL2, 5 + sdl2-compat, 6 6 cmake, 7 7 libGL, 8 8 pkg-config, 9 9 python3, 10 10 zlib, 11 + unstableGitUpdater, 11 12 romID ? "ntsc-final", 12 13 }: 13 14 let ··· 27 28 owner = "fgsfdsfgs"; 28 29 repo = "perfect_dark"; 29 30 rev = "bb4fcffeb5dc382fce4c609897a2e82590d7d709"; 30 - hash = "sha256-XLmAjwEzz4fPpHuk3IBmhhDfiuudwMTnYgVe6Wcfdsg="; 31 + hash = "sha256-naWE+oWgvrd4CSoBm6W4em60baTWn4uSnKbWh8WKPDM="; 32 + 33 + postFetch = '' 34 + pushd $out 35 + rm tools/gzip 36 + rm -r tools/mkrom 37 + popd 38 + ''; 31 39 }; 32 40 33 41 enableParallelBuilding = true; 34 42 35 43 # Fails to build if not set: 36 44 hardeningDisable = [ "format" ]; 37 - hardeningEnable = [ "pie" ]; 38 45 39 46 cmakeFlags = [ 40 47 (lib.cmakeFeature "ROMID" romID) ··· 47 54 ]; 48 55 49 56 buildInputs = [ 50 - SDL2 57 + sdl2-compat 51 58 libGL 52 59 zlib 53 60 ]; ··· 72 79 ''; 73 80 74 81 preConfigure = '' 75 - patchShebangs --build . 82 + patchShebangs --build tools/assetmgr 76 83 ''; 77 84 78 85 installPhase = '' ··· 91 98 runHook postInstall 92 99 ''; 93 100 101 + passthru = { 102 + updateScript = unstableGitUpdater { hardcodeZeroVersion = true; }; 103 + }; 104 + 94 105 meta = { 95 106 description = "Modern cross-platform port of Perfect Dark"; 96 107 longDescription = '' ··· 114 125 license = with lib.licenses; [ 115 126 # perfect_dark, khrplatform.h, port/fast3d 116 127 mit 117 - # Vendored source code and binaries of 'gzip'. 118 - gpl3Plus 119 128 # Derivative work of "Perfect Dark" © 2000 Rare Ltd. 120 129 unfree 121 130 ];