From 8c2bcac1832b31ad709dd4c7d12db9f180723ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Thu, 17 Dec 2020 23:29:06 +0100 Subject: [PATCH 1/2] thunderbird: Add gpg/gpgme dependencies. Fixes #98765. This enables to configure Thunderbird to use gnupg directly, which is the official upstream recommendation when using GPG with smartcards, which are not yet supported by Thunderbird's native GPG support. (cherry picked from commit 2767936180704f4fa7aab886594703985698c2cc) --- .../networking/mailreaders/thunderbird/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/applications/networking/mailreaders/thunderbird/default.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix index 2408bcaa0074..78ed7e38050e 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/default.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix @@ -14,6 +14,8 @@ , glib , gnugrep , gnused +, gnupg +, gpgme , icu , jemalloc , lib @@ -286,6 +288,15 @@ stdenv.mkDerivation rec { ${desktopItem.buildCommand} ''; + # Note on GPG support: + # Thunderbird's native GPG support does not yet support smartcards. + # The official upstream recommendation is to configure fall back to gnupg + # using the Thunderbird config `mail.openpgp.allow_external_gnupg` + # and GPG keys set up; instructions with pictures at: + # https://anweshadas.in/how-to-use-yubikey-or-any-gpg-smartcard-in-thunderbird-78/ + # For that to work out of the box, it requires `gnupg` on PATH and + # `gpgme` in `LD_LIBRARY_PATH`; we do this below. + preFixup = '' # Needed to find Mozilla runtime gappsWrapperArgs+=( @@ -295,6 +306,8 @@ stdenv.mkDerivation rec { --set SNAP_NAME "thunderbird" --set MOZ_LEGACY_PROFILES 1 --set MOZ_ALLOW_DOWNGRADE 1 + --prefix PATH : "${lib.getBin gnupg}/bin" + --prefix LD_LIBRARY_PATH : "${lib.getLib gpgme}/lib" ) ''; From 64037afd741508bfaf08a7682e9b60d922a59ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Tue, 22 Dec 2020 01:49:45 +0100 Subject: [PATCH 2/2] thunderbird-bin: Add gpg/gpgme dependencies. Fixes #98765 (cherry picked from commit e72bd9f0897123513fd382e8f93f9b3707ba7768) --- .../networking/mailreaders/thunderbird-bin/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix index 8cdd27653e23..967e2ac86a3b 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix @@ -39,6 +39,7 @@ , gnused , gnugrep , gnupg +, gpgme , runtimeShell }: @@ -118,6 +119,9 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; + # See "Note on GPG support" in `../thunderbird/default.nix` for explanations + # on adding `gnupg` and `gpgme` into PATH/LD_LIBRARY_PATH. + installPhase = '' mkdir -p "$prefix/usr/lib/thunderbird-bin-${version}" @@ -158,7 +162,9 @@ stdenv.mkDerivation { --suffix XDG_DATA_DIRS : "$XDG_ICON_DIRS" \ --set SNAP_NAME "thunderbird" \ --set MOZ_LEGACY_PROFILES 1 \ - --set MOZ_ALLOW_DOWNGRADE 1 + --set MOZ_ALLOW_DOWNGRADE 1 \ + --prefix PATH : "${stdenv.lib.getBin gnupg}/bin" \ + --prefix LD_LIBRARY_PATH : "${stdenv.lib.getLib gpgme}/lib" ''; passthru.updateScript = import ./../../browsers/firefox-bin/update.nix {