git.iko.soy/typeable/nixpkgs
on master help sign in
gpxlab: fix localization (#124012)

Co-authored-by: Guillaume Girol <symphorien@users.noreply.github.com>

commit0e4294fd3e6e2dd203dc3659ac203ba5492efa57 authorNikolay Korotkiy <sikmir@gmail.com> dateTue 1 Jun 2021, 19:04 (5 years ago) parent258c882
2 files changed+29−7
pkgs/applications/misc/gpxlab/default.nix+12−7 pkgs/applications/misc/gpxlab/fix-qttranslations-path.patch+17
pkgs/applications/misc/gpxlab/default.nix+12−7
@@ -1,4 +1,6 @@
1−{ stdenv, mkDerivation, lib, fetchFromGitHub, qmake, qttools, qttranslations }:
1+{ stdenv, mkDerivation, lib, fetchFromGitHub, substituteAll
2+, qmake, qttools, qttranslations
3+}:
24
35mkDerivation rec {
46 pname = "gpxlab";
@@ -11,8 +13,13 @@ mkDerivation rec {
1113 sha256 = "080vnwcciqblfrbfyz9gjhl2lqw1hkdpbgr5qfrlyglkd4ynjd84";
1214 };
1315
14− nativeBuildInputs = [ qmake ];
15− buildInputs = [ qttools qttranslations ];
16+ patches = (substituteAll {
17+ # See https://github.com/NixOS/nixpkgs/issues/86054
18+ src = ./fix-qttranslations-path.patch;
19+ inherit qttranslations;
20+ });
21+
22+ nativeBuildInputs = [ qmake qttools ];
1623
1724 preConfigure = ''
1825 lrelease GPXLab/locale/*.ts
@@ -24,8 +31,6 @@ mkDerivation rec {
2431 wrapQtApp $out/Applications/GPXLab.app/Contents/MacOS/GPXLab
2532 '';
2633
27− enableParallelBuilding = true;
28−
2934 meta = with lib; {
3035 homepage = "https://github.com/BourgeoisLab/GPXLab";
3136 description = "Program to show and manipulate GPS tracks";
@@ -33,8 +38,8 @@ mkDerivation rec {
3338 GPXLab is an application to display and manage GPS tracks
3439 previously recorded with a GPS tracker.
3540 '';
36− license = licenses.gpl3;
41+ license = licenses.gpl3Only;
3742 maintainers = with maintainers; [ sikmir ];
38− platforms = with platforms; linux ++ darwin;
43+ platforms = platforms.unix;
3944 };
4045}
pkgs/applications/misc/gpxlab/fix-qttranslations-path.patchnew file+17
@@ -0,0 +1,17 @@
1+diff --git i/GPXLab/main.cpp w/GPXLab/main.cpp
2+index b12d2dd..58d37c5 100644
3+--- i/GPXLab/main.cpp
4++++ w/GPXLab/main.cpp
5+@@ -19,10 +19,10 @@ int main(int argc, char *argv[])
6+ app.installTranslator(&gpxlab);
7+
8+ QTranslator qt;
9+-#if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
10++#if defined(Q_OS_WIN32)
11+ qt.load(QLocale::system(), "qt", "_", TRANSLATIONS_DIR);
12+ #else
13+- qt.load(QLocale::system(), "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath));
14++ qt.load(QLocale::system(), "qt", "_", QLatin1String("@qttranslations@/translations"));
15+ #endif
16+ app.installTranslator(&qt);
17+