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