Skip to content

Commit

Permalink
cataclysm-dda: clean up buildInputs
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
DeeUnderscore committed Nov 3, 2024
1 parent 49e00f9 commit 0580855
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions pkgs/games/cataclysm-dda/common.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
{ 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
}:

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 = ''
Expand All @@ -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
Expand Down

0 comments on commit 0580855

Please sign in to comment.