commit dfe27d331063520543e147329c7ffe6c7bfb184c
parent 964e799ac11563a708749ba15c3ecc426fa7f900
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date: Sun, 26 Apr 2020 21:46:50 +0300
gpxlab: fix qttranslations path
Diffstat:
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/pkgs/applications/gpxlab/default.nix b/pkgs/applications/gpxlab/default.nix
@@ -14,9 +14,19 @@ mkDerivation rec {
version = lib.substring 0 7 src.rev;
src = sources.gpxlab;
+ patches = [
+ # See https://github.com/NixOS/nixpkgs/issues/86054
+ ./fix-qttranslations-path.diff
+ ];
+
nativeBuildInputs = [ qmake ] ++ (lib.optional withI18n qttools);
buildInputs = [ qtbase ];
+ postPatch = ''
+ substituteInPlace GPXLab/main.cpp \
+ --subst-var-by qttranslations ${qttranslations}
+ '';
+
preConfigure = lib.optionalString withI18n ''
lrelease GPXLab/locale/*.ts
'';
diff --git a/pkgs/applications/gpxlab/fix-qttranslations-path.diff b/pkgs/applications/gpxlab/fix-qttranslations-path.diff
@@ -0,0 +1,13 @@
+diff --git i/GPXLab/main.cpp w/GPXLab/main.cpp
+index b12d2dd..d0c3000 100644
+--- i/GPXLab/main.cpp
++++ w/GPXLab/main.cpp
+@@ -22,7 +22,7 @@ int main(int argc, char *argv[])
+ #if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
+ qt.load(QLocale::system(), "qt", "_", TRANSLATIONS_DIR);
+ #else
+- qt.load(QLocale::system(), "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath));
++ qt.load(QLocale::system(), "qt", "_", QLatin1String("@qttranslations@/translations"));
+ #endif
+ app.installTranslator(&qt);
+