birdtray: fix qttranslations path birdtray crashes not finding the translations without this fix

+24
+11
pkgs/applications/misc/birdtray/default.nix
··· 7 , qtbase 8 , qttools 9 , qtx11extras 10 }: 11 12 mkDerivation rec { ··· 19 rev = version; 20 sha256 = "15l8drdmamq1dpqpj0h9ajj2r5vcs23cx421drvhfgs6bqlzd1hl"; 21 }; 22 23 nativeBuildInputs = [ cmake pkgconfig ]; 24 buildInputs = [ 25 qtbase qttools qtx11extras 26 ]; 27 28 meta = with lib; { 29 description = "Mail system tray notification icon for Thunderbird";
··· 7 , qtbase 8 , qttools 9 , qtx11extras 10 + , qttranslations 11 }: 12 13 mkDerivation rec { ··· 20 rev = version; 21 sha256 = "15l8drdmamq1dpqpj0h9ajj2r5vcs23cx421drvhfgs6bqlzd1hl"; 22 }; 23 + 24 + patches = [ 25 + # See https://github.com/NixOS/nixpkgs/issues/86054 26 + ./fix-qttranslations-path.diff 27 + ]; 28 29 nativeBuildInputs = [ cmake pkgconfig ]; 30 buildInputs = [ 31 qtbase qttools qtx11extras 32 ]; 33 + 34 + postPatch = '' 35 + substituteInPlace src/birdtrayapp.cpp \ 36 + --subst-var-by qttranslations ${qttranslations} 37 + ''; 38 39 meta = with lib; { 40 description = "Mail system tray notification icon for Thunderbird";
+13
pkgs/applications/misc/birdtray/fix-qttranslations-path.diff
···
··· 1 + diff --git a/src/birdtrayapp.cpp b/src/birdtrayapp.cpp 2 + index 847b4d3..3a3709a 100644 3 + --- a/src/birdtrayapp.cpp 4 + +++ b/src/birdtrayapp.cpp 5 + @@ -130,7 +130,7 @@ bool BirdtrayApp::loadTranslations() { 6 + [](QString path) { return path.append("/translations"); }); 7 + QLocale locale = QLocale::system(); 8 + bool success = loadTranslation( 9 + - qtTranslator, locale, "qt", {QLibraryInfo::location(QLibraryInfo::TranslationsPath)}); 10 + + qtTranslator, locale, "qt", {QLatin1String("@qttranslations@/translations")}); 11 + success &= loadTranslation(dynamicTranslator, locale, "dynamic", locations); 12 + success &= loadTranslation(mainTranslator, locale, "main", locations); 13 + return success;