lol

toppler: modernize derivation

+37 -13
+37 -13
pkgs/by-name/to/toppler/package.nix
··· 2 2 lib, 3 3 stdenv, 4 4 fetchFromGitLab, 5 + nix-update-script, 6 + writableTmpDirAsHomeHook, 5 7 8 + buildPackages, 6 9 pkg-config, 7 10 gettext, 8 11 povray, 9 12 imagemagick, 10 13 gimp, 11 14 12 - SDL2, 15 + sdl2-compat, 13 16 SDL2_mixer, 14 17 SDL2_image, 15 18 libpng, ··· 27 30 hash = "sha256-ecEaELu52Nmov/BD9VzcUw6wyWeHJcsKQkEzTnaW330="; 28 31 }; 29 32 33 + strictDeps = true; 34 + enableParallelBuilding = true; 35 + 36 + depsBuildBuild = [ 37 + buildPackages.stdenv.cc 38 + pkg-config 39 + sdl2-compat 40 + SDL2_image 41 + libpng 42 + zlib 43 + ]; 44 + 30 45 nativeBuildInputs = [ 31 46 pkg-config 32 47 gettext 33 48 povray 34 49 imagemagick 35 50 gimp 51 + # GIMP needs a writable home 52 + writableTmpDirAsHomeHook 36 53 ]; 37 54 38 55 buildInputs = [ 39 - SDL2 56 + sdl2-compat 40 57 SDL2_mixer 41 - SDL2_image 42 - libpng 43 58 zlib 44 59 ]; 45 60 ··· 48 63 ./gcc14.patch 49 64 ]; 50 65 51 - # GIMP needs a writable home 66 + makeFlags = [ 67 + "CXX_NATIVE=$(CXX_FOR_BUILD)" 68 + "PKG_CONFIG_NATIVE=$(PKG_CONFIG_FOR_BUILD)" 69 + "PREFIX=${placeholder "out"}" 70 + ]; 71 + 52 72 preBuild = '' 53 - export HOME=$(mktemp -d) 73 + # The `$` is escaped in `makeFlags` so using it for these parameters results in infinite recursion 74 + makeFlagsArray+=(CXX=$CXX PKG_CONFIG=$PKG_CONFIG); 54 75 ''; 55 76 56 - makeFlags = [ "PREFIX=$(out)" ]; 57 - 58 - hardeningDisable = [ "format" ]; 77 + passthru.updateScript = nix-update-script { }; 59 78 60 - meta = with lib; { 79 + meta = { 61 80 description = "Jump and run game, reimplementation of Tower Toppler/Nebulus"; 62 81 homepage = "https://gitlab.com/roever/toppler"; 63 - license = licenses.gpl2Plus; 64 - maintainers = with maintainers; [ fgaz ]; 65 - platforms = platforms.all; 82 + license = with lib.licenses; [ 83 + gpl2Plus 84 + # Makefile 85 + gpl3Plus 86 + ]; 87 + maintainers = with lib.maintainers; [ fgaz ]; 88 + platforms = lib.platforms.all; 89 + mainProgram = "toppler"; 66 90 }; 67 91 })