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

+24
+11
pkgs/applications/misc/birdtray/default.nix
··· 7 7 , qtbase 8 8 , qttools 9 9 , qtx11extras 10 + , qttranslations 10 11 }: 11 12 12 13 mkDerivation rec { ··· 19 20 rev = version; 20 21 sha256 = "15l8drdmamq1dpqpj0h9ajj2r5vcs23cx421drvhfgs6bqlzd1hl"; 21 22 }; 23 + 24 + patches = [ 25 + # See https://github.com/NixOS/nixpkgs/issues/86054 26 + ./fix-qttranslations-path.diff 27 + ]; 22 28 23 29 nativeBuildInputs = [ cmake pkgconfig ]; 24 30 buildInputs = [ 25 31 qtbase qttools qtx11extras 26 32 ]; 33 + 34 + postPatch = '' 35 + substituteInPlace src/birdtrayapp.cpp \ 36 + --subst-var-by qttranslations ${qttranslations} 37 + ''; 27 38 28 39 meta = with lib; { 29 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;