birdtray: fix qttranslations path

birdtray crashes not finding the translations without this fix
gstqt5
Yannick Markus 2020-06-16 08:49:27 +02:00
parent 5fea23b9c0
commit fd474c0e0c
2 changed files with 24 additions and 0 deletions

View File

@ -7,6 +7,7 @@
, qtbase
, qttools
, qtx11extras
, qttranslations
}:
mkDerivation rec {
@ -20,11 +21,21 @@ mkDerivation rec {
sha256 = "15l8drdmamq1dpqpj0h9ajj2r5vcs23cx421drvhfgs6bqlzd1hl";
};
patches = [
# See https://github.com/NixOS/nixpkgs/issues/86054
./fix-qttranslations-path.diff
];
nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [
qtbase qttools qtx11extras
];
postPatch = ''
substituteInPlace src/birdtrayapp.cpp \
--subst-var-by qttranslations ${qttranslations}
'';
meta = with lib; {
description = "Mail system tray notification icon for Thunderbird";
homepage = "https://github.com/gyunaev/birdtray";

View File

@ -0,0 +1,13 @@
diff --git a/src/birdtrayapp.cpp b/src/birdtrayapp.cpp
index 847b4d3..3a3709a 100644
--- a/src/birdtrayapp.cpp
+++ b/src/birdtrayapp.cpp
@@ -130,7 +130,7 @@ bool BirdtrayApp::loadTranslations() {
[](QString path) { return path.append("/translations"); });
QLocale locale = QLocale::system();
bool success = loadTranslation(
- qtTranslator, locale, "qt", {QLibraryInfo::location(QLibraryInfo::TranslationsPath)});
+ qtTranslator, locale, "qt", {QLatin1String("@qttranslations@/translations")});
success &= loadTranslation(dynamicTranslator, locale, "dynamic", locations);
success &= loadTranslation(mainTranslator, locale, "main", locations);
return success;