diff --git a/pkgs/games/cataclysm-dda/common.nix b/pkgs/games/cataclysm-dda/common.nix index 268f5d5256d28..74b4b7176bd13 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 ]; - - tilesDeps = [ SDL2 SDL2_image SDL2_mixer SDL2_ttf freetype ] + commonDeps = [ + gettext + zlib + ] ++ optionals stdenv.hostPlatform.isDarwin [ CoreFoundation ]; + + 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