From fd474c0e0c39e5750ffb011751331d1e110f632f Mon Sep 17 00:00:00 2001 From: Yannick Markus Date: Tue, 16 Jun 2020 08:49:27 +0200 Subject: [PATCH] birdtray: fix qttranslations path birdtray crashes not finding the translations without this fix --- pkgs/applications/misc/birdtray/default.nix | 11 +++++++++++ .../misc/birdtray/fix-qttranslations-path.diff | 13 +++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/applications/misc/birdtray/fix-qttranslations-path.diff diff --git a/pkgs/applications/misc/birdtray/default.nix b/pkgs/applications/misc/birdtray/default.nix index 5385cf67884d..8eb6a168721c 100644 --- a/pkgs/applications/misc/birdtray/default.nix +++ b/pkgs/applications/misc/birdtray/default.nix @@ -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"; diff --git a/pkgs/applications/misc/birdtray/fix-qttranslations-path.diff b/pkgs/applications/misc/birdtray/fix-qttranslations-path.diff new file mode 100644 index 000000000000..2a379b5e2744 --- /dev/null +++ b/pkgs/applications/misc/birdtray/fix-qttranslations-path.diff @@ -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;