Merge pull request #90585 from ymarkus/master

birdtray: fix qttranslations path
This commit is contained in:
Thomas Tuegel 2020-07-13 12:41:12 -05:00 committed by GitHub
commit 64b395ec57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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;