commit 964e799ac11563a708749ba15c3ecc426fa7f900
parent d953b1a345d18ccf976386196d85a48642f0b9d2
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date: Sun, 26 Apr 2020 16:30:37 +0300
gpxsee: fix qttranslations path
Diffstat:
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/pkgs/applications/gpxsee/default.nix b/pkgs/applications/gpxsee/default.nix
@@ -14,11 +14,21 @@ mkDerivation rec {
version = lib.substring 0 7 src.rev;
src = sources.gpxsee;
+ patches = [
+ # See https://github.com/NixOS/nixpkgs/issues/86054
+ ./fix-qttranslations-path.diff
+ ];
+
nativeBuildInputs = [ qmake ] ++ (lib.optional withI18n qttools);
buildInputs = [ qtbase ];
+ postPatch = ''
+ substituteInPlace src/GUI/app.cpp \
+ --subst-var-by qttranslations ${qttranslations}
+ '';
+
preConfigure = lib.optionalString withI18n ''
- lrelease lang/*.ts
+ lrelease gpxsee.pro
'';
postInstall = lib.optionalString stdenv.isDarwin ''
diff --git a/pkgs/applications/gpxsee/fix-qttranslations-path.diff b/pkgs/applications/gpxsee/fix-qttranslations-path.diff
@@ -0,0 +1,14 @@
+diff --git i/src/GUI/app.cpp w/src/GUI/app.cpp
+index 10e84d5..ac9059b 100644
+--- i/src/GUI/app.cpp
++++ w/src/GUI/app.cpp
+@@ -37,8 +37,7 @@ App::App(int &argc, char **argv) : QApplication(argc, argv)
+ #if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
+ qt->load(QLocale::system(), "qt", "_", ProgramPaths::translationsDir());
+ #else // Q_OS_WIN32 || Q_OS_MAC
+- qt->load(QLocale::system(), "qt", "_", QLibraryInfo::location(
+- QLibraryInfo::TranslationsPath));
++ qt->load(QLocale::system(), "qt", "_", "@qttranslations@/translations");
+ #endif // Q_OS_WIN32 || Q_OS_MAC
+ installTranslator(qt);
+