summary refs log tree commit diff
path: root/pkgs/games/cataclysm-dda/common.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
committerAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
commit62614cbef7da005c1eda8c9400160f6bcd6546b8 (patch)
treec2630f69080637987b68acb1ee8676d2681fe304 /pkgs/games/cataclysm-dda/common.nix
parentd9c82ed3044c72cecf01c6ea042489d30914577c (diff)
parente24069138dfec3ef94f211f1da005bb5395adc11 (diff)
downloadnixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.gz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.bz2
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.lz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.xz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.zst
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.zip
Merge branch 'nixpkgs-update' into master
Diffstat (limited to 'pkgs/games/cataclysm-dda/common.nix')
-rw-r--r--pkgs/games/cataclysm-dda/common.nix31
1 files changed, 13 insertions, 18 deletions
diff --git a/pkgs/games/cataclysm-dda/common.nix b/pkgs/games/cataclysm-dda/common.nix
index 9ec73cdebe0..d91db073ff6 100644
--- a/pkgs/games/cataclysm-dda/common.nix
+++ b/pkgs/games/cataclysm-dda/common.nix
@@ -1,11 +1,11 @@
-{ stdenv, runtimeShell, pkgconfig, gettext, ncurses, CoreFoundation
+{ lib, stdenv, runtimeShell, pkg-config, gettext, ncurses, CoreFoundation
 , tiles, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, freetype, Cocoa
 , debug
 , useXdgDir
 }:
 
 let
-  inherit (stdenv.lib) optionals optionalString;
+  inherit (lib) optionals optionalString;
 
   cursesDeps = [ gettext ncurses ]
     ++ optionals stdenv.isDarwin [ CoreFoundation ];
@@ -13,17 +13,15 @@ let
   tilesDeps = [ SDL2 SDL2_image SDL2_mixer SDL2_ttf freetype ]
     ++ optionals stdenv.isDarwin [ Cocoa ];
 
-  installXDGAppLauncher = ''
-    launcher="$out/share/applications/cataclysm-dda.desktop"
-    install -D -m 444 data/xdg/*cataclysm-dda.desktop -T "$launcher"
-    sed -i "$launcher" -e "s,\(Exec=\)\(cataclysm-tiles\),\1$out/bin/\2,"
-    install -D -m 444 data/xdg/cataclysm-dda.svg -t $out/share/icons/hicolor/scalable/apps
+  patchDesktopFile = ''
+    substituteInPlace $out/share/applications/org.cataclysmdda.CataclysmDDA.desktop \
+      --replace "Exec=cataclysm-tiles" "Exec=$out/bin/cataclysm-tiles"
   '';
 
   installMacOSAppLauncher = ''
     app=$out/Applications/Cataclysm.app
-    install -D -m 444 data/osx/Info.plist -t $app/Contents
-    install -D -m 444 data/osx/AppIcon.icns -t $app/Contents/Resources
+    install -D -m 444 build-data/osx/Info.plist -t $app/Contents
+    install -D -m 444 build-data/osx/AppIcon.icns -t $app/Contents/Resources
     mkdir $app/Contents/MacOS
     launcher=$app/Contents/MacOS/Cataclysm.sh
     cat << EOF > $launcher
@@ -37,7 +35,7 @@ in
 stdenv.mkDerivation {
   pname = "cataclysm-dda";
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = cursesDeps ++ optionals tiles tilesDeps;
 
@@ -58,28 +56,25 @@ stdenv.mkDerivation {
   ] ++ optionals tiles [
     "TILES=1" "SOUND=1"
   ] ++ optionals stdenv.isDarwin [
-    "NATIVE=osx" "CLANG=1"
+    "NATIVE=osx"
+    "CLANG=1"
+    "OSX_MIN=${stdenv.targetPlatform.darwinMinVersion}"
   ];
 
   postInstall = optionalString tiles
   ( if !stdenv.isDarwin
-    then installXDGAppLauncher
+    then patchDesktopFile
     else installMacOSAppLauncher
   );
 
   dontStrip = debug;
 
-  # https://hydra.nixos.org/build/65193254
-  # src/weather_data.cpp:203:1: fatal error: opening dependency file obj/tiles/weather_data.d: No such file or directory
-  # make: *** [Makefile:687: obj/tiles/weather_data.o] Error 1
-  enableParallelBuilding = false;
-
   passthru = {
     isTiles = tiles;
     isCurses = !tiles;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A free, post apocalyptic, zombie infested rogue-like";
     longDescription = ''
       Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world.