Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20.09] thunderbird: Add gpg/gpgme dependencies to fix smartcard usage #108157

Merged
merged 2 commits into from
Jan 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
, gnused
, gnugrep
, gnupg
, gpgme
, runtimeShell
}:

Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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 {
Expand Down
13 changes: 13 additions & 0 deletions pkgs/applications/networking/mailreaders/thunderbird/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
, glib
, gnugrep
, gnused
, gnupg
, gpgme
, icu
, jemalloc
, lib
Expand Down Expand Up @@ -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+=(
Expand All @@ -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"
)
'';

Expand Down