summary refs log tree commit diff
diff options
context:
space:
mode:
authorMitsuhiro Nakamura <m.nacamura@gmail.com>2019-05-03 01:29:07 +0900
committerMitsuhiro Nakamura <m.nacamura@gmail.com>2019-05-03 22:40:04 +0900
commitd8dec0a2332a66e940a876d44c06da044e9c5a76 (patch)
tree8558e6239bd5b8e85a5f2cc72edb521bcce28dc4
parent676d292cefd8ea4f620dd6d16f571ff9d24f292d (diff)
downloadnixpkgs-d8dec0a2332a66e940a876d44c06da044e9c5a76.tar
nixpkgs-d8dec0a2332a66e940a876d44c06da044e9c5a76.tar.gz
nixpkgs-d8dec0a2332a66e940a876d44c06da044e9c5a76.tar.bz2
nixpkgs-d8dec0a2332a66e940a876d44c06da044e9c5a76.tar.lz
nixpkgs-d8dec0a2332a66e940a876d44c06da044e9c5a76.tar.xz
nixpkgs-d8dec0a2332a66e940a876d44c06da044e9c5a76.tar.zst
nixpkgs-d8dec0a2332a66e940a876d44c06da044e9c5a76.zip
cataclysm-dda: 0.C -> 0.D
-rw-r--r--pkgs/games/cataclysm-dda/default.nix38
-rw-r--r--pkgs/games/cataclysm-dda/patches/fix_locale_dir.patch22
-rw-r--r--pkgs/top-level/all-packages.nix3
3 files changed, 26 insertions, 37 deletions
diff --git a/pkgs/games/cataclysm-dda/default.nix b/pkgs/games/cataclysm-dda/default.nix
index 3ddac8f3fc7..0fac78829c0 100644
--- a/pkgs/games/cataclysm-dda/default.nix
+++ b/pkgs/games/cataclysm-dda/default.nix
@@ -1,47 +1,37 @@
-{ stdenv, callPackage, ncurses
-, tiles ? true, Cocoa, libicns
+{ stdenv, callPackage, CoreFoundation
+, tiles ? true, Cocoa
 , debug ? false
 }:
 
 let
   inherit (stdenv.lib) optionals optionalString;
   inherit (callPackage ./common.nix { inherit tiles Cocoa debug; }) common utils;
-  inherit (utils) fetchFromCleverRaven installMacOSAppLauncher;
+  inherit (utils) fetchFromCleverRaven installXDGAppLauncher installMacOSAppLauncher;
 in
 
 stdenv.mkDerivation (common // rec {
-  version = "0.C";
+  version = "0.D";
   name = "cataclysm-dda-${version}";
 
   src = fetchFromCleverRaven {
     rev = "${version}";
-    sha256 = "03sdzsk4qdq99qckq0axbsvg1apn6xizscd8pwp5w6kq2fyj5xkv";
+    sha256 = "00zzhx1mh1qjq668cga5nbrxp2qk6b82j5ak65skhgnlr6ii4ysc";
   };
 
-  nativeBuildInputs = common.nativeBuildInputs
-    ++ optionals (tiles && stdenv.isDarwin) [ libicns ];
+  buildInputs = common.buildInputs
+    ++ optionals stdenv.isDarwin [ CoreFoundation ];
 
   patches = [ ./patches/fix_locale_dir.patch ];
 
-  makeFlags = common.makeFlags
-    ++ optionals stdenv.isDarwin [
-    "OSX_MIN=10.6"  # SDL for macOS only supports deploying on 10.6 and above
-  ] ++ optionals stdenv.cc.isGNU [
-    "WARNINGS+=-Wno-deprecated-declarations"
-    "WARNINGS+=-Wno-ignored-attributes"
-  ] ++ optionals stdenv.cc.isClang [
-    "WARNINGS+=-Wno-inconsistent-missing-override"
-  ];
-
-  NIX_CFLAGS_COMPILE = optionalString stdenv.cc.isClang "-Wno-user-defined-warnings";
-
-  postBuild = optionalString (tiles && stdenv.isDarwin) ''
-    # iconutil on macOS is not available in nixpkgs
-    png2icns data/osx/AppIcon.icns data/osx/AppIcon.iconset/*
+  postPatch = common.postPatch + ''
+    substituteInPlace lua/autoexec.lua --replace "/usr/share" "$out/share"
   '';
 
-  postInstall = optionalString (tiles && stdenv.isDarwin)
-    installMacOSAppLauncher;
+  postInstall = optionalString tiles
+  ( if !stdenv.isDarwin
+    then installXDGAppLauncher
+    else installMacOSAppLauncher
+  );
 
   # Disable, possible problems with hydra
   #enableParallelBuilding = true;
diff --git a/pkgs/games/cataclysm-dda/patches/fix_locale_dir.patch b/pkgs/games/cataclysm-dda/patches/fix_locale_dir.patch
index 775a8ec6007..60a3dc45745 100644
--- a/pkgs/games/cataclysm-dda/patches/fix_locale_dir.patch
+++ b/pkgs/games/cataclysm-dda/patches/fix_locale_dir.patch
@@ -1,20 +1,20 @@
 diff --git a/src/translations.cpp b/src/translations.cpp
-index 6520cfe..49f7b2c 100644
+index 2585b7ec56..7bb005823c 100644
 --- a/src/translations.cpp
 +++ b/src/translations.cpp
-@@ -72,15 +72,11 @@ void set_language(bool reload_options)
- 
-     // Step 2. Bind to gettext domain.
-     const char *locale_dir;
--#ifdef __linux__
-     if (!FILENAMES["base_path"].empty()) {
-         locale_dir = std::string(FILENAMES["base_path"] + "share/locale").c_str();
+@@ -195,14 +195,12 @@ void set_language()
+     auto env = getenv( "LANGUAGE" );
+     locale_dir = std::string( FILENAMES["base_path"] + "lang/mo/" + ( env ? env : "none" ) +
+                               "/LC_MESSAGES/cataclysm-dda.mo" );
+-#elif (defined __linux__ || (defined MACOSX && !defined TILES))
++#else
+     if( !FILENAMES["base_path"].empty() ) {
+         locale_dir = FILENAMES["base_path"] + "share/locale";
      } else {
          locale_dir = "lang/mo";
      }
 -#else
 -    locale_dir = "lang/mo";
--#endif // __linux__
+ #endif
  
-     bindtextdomain("cataclysm-dda", locale_dir);
-     bind_textdomain_codeset("cataclysm-dda", "UTF-8");
+     const char *locale_dir_char = locale_dir.c_str();
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index ea43db314a9..13a86b44b91 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -21008,8 +21008,7 @@ in
   };
 
   cataclysm-dda = callPackage ../games/cataclysm-dda {
-    inherit (darwin.apple_sdk.frameworks) Cocoa;
-    ncurses = ncurses5;
+    inherit (darwin.apple_sdk.frameworks) CoreFoundation Cocoa;
   };
 
   cataclysm-dda-git = callPackage ../games/cataclysm-dda/git.nix {