From b69edc44cc1cbbfaa85c5c6f067499409f46d51c Mon Sep 17 00:00:00 2001 From: Dee Anzorge Date: Sun, 3 Nov 2024 06:00:37 +0100 Subject: [PATCH] cataclysm-dda: clean up buildInputs * Add zlib. This was already present in tiles as an indirect dependency, but was missing from curses builds. * Remove ncurses from tiles builds. This ends up in closure anyway, but CDDA itself does not require it as a direct dependency for tiles builds. * use --replace-fail instead of --replace --- pkgs/games/cataclysm-dda/common.nix | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/pkgs/games/cataclysm-dda/common.nix b/pkgs/games/cataclysm-dda/common.nix index 268f5d5256d2..74b4b7176bd1 100644 --- a/pkgs/games/cataclysm-dda/common.nix +++ b/pkgs/games/cataclysm-dda/common.nix @@ -1,5 +1,5 @@ { lib, stdenv, runtimeShell, pkg-config, gettext, ncurses, CoreFoundation -, tiles, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, freetype, Cocoa +, tiles, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, freetype, Cocoa, zlib , debug , useXdgDir }: @@ -7,15 +7,27 @@ let inherit (lib) optionals optionalString; - cursesDeps = [ gettext ncurses ] - ++ optionals stdenv.hostPlatform.isDarwin [ CoreFoundation ]; + commonDeps = [ + gettext + zlib + ] ++ optionals stdenv.hostPlatform.isDarwin [ CoreFoundation ]; - tilesDeps = [ SDL2 SDL2_image SDL2_mixer SDL2_ttf freetype ] + cursesDeps = commonDeps ++ [ ncurses ]; + + tilesDeps = + commonDeps + ++ [ + SDL2 + SDL2_image + SDL2_mixer + SDL2_ttf + freetype + ] ++ optionals stdenv.hostPlatform.isDarwin [ Cocoa ]; patchDesktopFile = '' substituteInPlace $out/share/applications/org.cataclysmdda.CataclysmDDA.desktop \ - --replace "Exec=cataclysm-tiles" "Exec=$out/bin/cataclysm-tiles" + --replace-fail "Exec=cataclysm-tiles" "Exec=$out/bin/cataclysm-tiles" ''; installMacOSAppLauncher = '' @@ -37,7 +49,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ pkg-config ]; - buildInputs = cursesDeps ++ optionals tiles tilesDeps; + buildInputs = if tiles then tilesDeps else cursesDeps; postPatch = '' patchShebangs lang/compile_mo.sh