diff --git a/pkgs/games/cataclysm-dda/common.nix b/pkgs/games/cataclysm-dda/common.nix index af20169a6e08..4e39a64c4001 100644 --- a/pkgs/games/cataclysm-dda/common.nix +++ b/pkgs/games/cataclysm-dda/common.nix @@ -40,12 +40,7 @@ stdenv.mkDerivation { buildInputs = cursesDeps ++ optionals tiles tilesDeps; postPatch = '' - patchShebangs . - - # Locale patch required for Darwin builds, see: - # https://github.com/NixOS/nixpkgs/pull/74064#issuecomment-560083970 - sed -i src/translations.cpp \ - -e 's@#elif (defined(__linux__) || (defined(MACOSX) && !defined(TILES)))@#elif 1@' + patchShebangs lang/compile_mo.sh ''; makeFlags = [ diff --git a/pkgs/games/cataclysm-dda/locale-path-stable.patch b/pkgs/games/cataclysm-dda/locale-path-stable.patch new file mode 100644 index 000000000000..db8592646f0d --- /dev/null +++ b/pkgs/games/cataclysm-dda/locale-path-stable.patch @@ -0,0 +1,20 @@ +diff --git a/src/translations.cpp b/src/translations.cpp +index fa0ee479b2..0e470098dc 100644 +--- a/src/translations.cpp ++++ b/src/translations.cpp +@@ -141,15 +141,11 @@ void select_language() + std::string locale_dir() + { + std::string loc_dir; +-#if !defined(__ANDROID__) && ((defined(__linux__) || defined(BSD) || (defined(MACOSX) && !defined(TILES)))) + if( !PATH_INFO::base_path().empty() ) { + loc_dir = PATH_INFO::base_path() + "share/locale"; + } else { + loc_dir = PATH_INFO::langdir(); + } +-#else +- loc_dir = PATH_INFO::langdir(); +-#endif + return loc_dir; + } + diff --git a/pkgs/games/cataclysm-dda/stable.nix b/pkgs/games/cataclysm-dda/stable.nix index 453f5ceacae1..52f3ca41f480 100644 --- a/pkgs/games/cataclysm-dda/stable.nix +++ b/pkgs/games/cataclysm-dda/stable.nix @@ -19,6 +19,11 @@ let sha256 = "sha256-2su1uQaWl9WG41207dRvOTdVKcQsEz/y0uTi9JX52uI="; }; + patches = [ + # Unconditionally look for translation files in $out/share/locale + ./locale-path-stable.patch + ]; + makeFlags = common.makeFlags ++ [ # Makefile declares version as 0.F, with no minor release number "VERSION=${version}"