Merge pull request #186521 from DeeUnderscore/fix/cataclysm-dda-locale-paths
This commit is contained in:
commit
be2b7afc99
|
@ -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 = [
|
||||
|
|
20
pkgs/games/cataclysm-dda/locale-path-stable.patch
Normal file
20
pkgs/games/cataclysm-dda/locale-path-stable.patch
Normal file
|
@ -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;
|
||||
}
|
||||
|
|
@ -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}"
|
||||
|
|
Loading…
Reference in a new issue