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
This commit is contained in:
Dee Anzorge
2024-12-11 20:12:42 +01:00
parent 3e4d1375c3
commit b69edc44cc
+18 -6
View File
@@ -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