gpxlab: fix localization (#124012)

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

authored by

Nikolay Korotkiy
Guillaume Girol
and committed by
GitHub
0e4294fd 258c8825

+29 -7
+12 -7
pkgs/applications/misc/gpxlab/default.nix
··· 1 - { stdenv, mkDerivation, lib, fetchFromGitHub, qmake, qttools, qttranslations }: 1 + { stdenv, mkDerivation, lib, fetchFromGitHub, substituteAll 2 + , qmake, qttools, qttranslations 3 + }: 2 4 3 5 mkDerivation rec { 4 6 pname = "gpxlab"; ··· 11 13 sha256 = "080vnwcciqblfrbfyz9gjhl2lqw1hkdpbgr5qfrlyglkd4ynjd84"; 12 14 }; 13 15 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 ]; 16 23 17 24 preConfigure = '' 18 25 lrelease GPXLab/locale/*.ts ··· 23 30 mv GPXLab/GPXLab.app $out/Applications 24 31 wrapQtApp $out/Applications/GPXLab.app/Contents/MacOS/GPXLab 25 32 ''; 26 - 27 - enableParallelBuilding = true; 28 33 29 34 meta = with lib; { 30 35 homepage = "https://github.com/BourgeoisLab/GPXLab"; ··· 33 38 GPXLab is an application to display and manage GPS tracks 34 39 previously recorded with a GPS tracker. 35 40 ''; 36 - license = licenses.gpl3; 41 + license = licenses.gpl3Only; 37 42 maintainers = with maintainers; [ sikmir ]; 38 - platforms = with platforms; linux ++ darwin; 43 + platforms = platforms.unix; 39 44 }; 40 45 }
+17
pkgs/applications/misc/gpxlab/fix-qttranslations-path.patch
··· 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 +