Merge pull request #107122 from nh2/thunderbird-gpgme

thunderbird: Add gpg/gpgme dependencies to fix smartcard usage
This commit is contained in:
Niklas Hambüchen 2020-12-23 22:14:24 +01:00 committed by GitHub
commit db9a28338f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 21 deletions

View File

@ -1,22 +1,31 @@
{ stdenv, fetchurl, config, makeWrapper { stdenv, lib, fetchurl, config, makeWrapper
, alsaLib , alsaLib
, at-spi2-atk , at-spi2-atk
, atk , atk
, cairo , cairo
, coreutils
, cups , cups
, curl , curl
, dbus-glib
, dbus , dbus
, dbus-glib
, fontconfig , fontconfig
, freetype , freetype
, gdk-pixbuf , gdk-pixbuf
, glib , glib
, glibc , glibc
, gnome3
, gnugrep
, gnupg
, gnused
, gpgme
, gtk2 , gtk2
, gtk3 , gtk3
, kerberos , kerberos
, libcanberra
, libGL
, libGLU
, libX11 , libX11
, libXScrnSaver , libxcb
, libXcomposite , libXcomposite
, libXcursor , libXcursor
, libXdamage , libXdamage
@ -25,21 +34,14 @@
, libXi , libXi
, libXinerama , libXinerama
, libXrender , libXrender
, libXScrnSaver
, libXt , libXt
, libxcb
, libcanberra
, gnome3
, libGLU, libGL
, nspr , nspr
, nss , nss
, pango , pango
, runtimeShell
, writeScript , writeScript
, xidel , xidel
, coreutils
, gnused
, gnugrep
, gnupg
, runtimeShell
}: }:
# imports `version` and `sources` # imports `version` and `sources`
@ -58,9 +60,9 @@ let
systemLocale = config.i18n.defaultLocale or "en-US"; systemLocale = config.i18n.defaultLocale or "en-US";
defaultSource = stdenv.lib.findFirst (sourceMatches "en-US") {} sources; defaultSource = lib.findFirst (sourceMatches "en-US") {} sources;
source = stdenv.lib.findFirst (sourceMatches systemLocale) defaultSource sources; source = lib.findFirst (sourceMatches systemLocale) defaultSource sources;
name = "thunderbird-bin-${version}"; name = "thunderbird-bin-${version}";
in in
@ -75,7 +77,7 @@ stdenv.mkDerivation {
phases = "unpackPhase installPhase"; phases = "unpackPhase installPhase";
libPath = stdenv.lib.makeLibraryPath libPath = lib.makeLibraryPath
[ stdenv.cc.cc [ stdenv.cc.cc
alsaLib alsaLib
at-spi2-atk at-spi2-atk
@ -110,7 +112,7 @@ stdenv.mkDerivation {
nspr nspr
nss nss
pango pango
] + ":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" [ ] + ":" + lib.makeSearchPathOutput "lib" "lib64" [
stdenv.cc.cc stdenv.cc.cc
]; ];
@ -118,6 +120,9 @@ stdenv.mkDerivation {
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
# See "Note on GPG support" in `../thunderbird/default.nix` for explanations
# on adding `gnupg` and `gpgme` into PATH/LD_LIBRARY_PATH.
installPhase = installPhase =
'' ''
mkdir -p "$prefix/usr/lib/thunderbird-bin-${version}" mkdir -p "$prefix/usr/lib/thunderbird-bin-${version}"
@ -158,7 +163,9 @@ stdenv.mkDerivation {
--suffix XDG_DATA_DIRS : "$XDG_ICON_DIRS" \ --suffix XDG_DATA_DIRS : "$XDG_ICON_DIRS" \
--set SNAP_NAME "thunderbird" \ --set SNAP_NAME "thunderbird" \
--set MOZ_LEGACY_PROFILES 1 \ --set MOZ_LEGACY_PROFILES 1 \
--set MOZ_ALLOW_DOWNGRADE 1 --set MOZ_ALLOW_DOWNGRADE 1 \
--prefix PATH : "${lib.getBin gnupg}/bin" \
--prefix LD_LIBRARY_PATH : "${lib.getLib gpgme}/lib"
''; '';
passthru.updateScript = import ./../../browsers/firefox-bin/update.nix { passthru.updateScript = import ./../../browsers/firefox-bin/update.nix {
@ -168,14 +175,14 @@ stdenv.mkDerivation {
basePath = "pkgs/applications/networking/mailreaders/thunderbird-bin"; basePath = "pkgs/applications/networking/mailreaders/thunderbird-bin";
baseUrl = "http://archive.mozilla.org/pub/thunderbird/releases/"; baseUrl = "http://archive.mozilla.org/pub/thunderbird/releases/";
}; };
meta = with stdenv.lib; { meta = with lib; {
description = "Mozilla Thunderbird, a full-featured email client (binary package)"; description = "Mozilla Thunderbird, a full-featured email client (binary package)";
homepage = "http://www.mozilla.org/thunderbird/"; homepage = "http://www.mozilla.org/thunderbird/";
license = { license = {
free = false; free = false;
url = "http://www.mozilla.org/en-US/foundation/trademarks/policy/"; url = "http://www.mozilla.org/en-US/foundation/trademarks/policy/";
}; };
maintainers = with stdenv.lib.maintainers; [ ]; maintainers = with lib.maintainers; [ ];
platforms = platforms.linux; platforms = platforms.linux;
}; };
} }

View File

@ -14,13 +14,15 @@
, freetype , freetype
, glib , glib
, gnugrep , gnugrep
, gnupg
, gnused , gnused
, gpgme
, icu , icu
, jemalloc , jemalloc
, lib , lib
, libevent
, libGL , libGL
, libGLU , libGLU
, libevent
, libjpeg , libjpeg
, libnotify , libnotify
, libpng , libpng
@ -288,6 +290,15 @@ stdenv.mkDerivation rec {
rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl
''; '';
# 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 = '' preFixup = ''
# Needed to find Mozilla runtime # Needed to find Mozilla runtime
gappsWrapperArgs+=( gappsWrapperArgs+=(
@ -297,6 +308,8 @@ stdenv.mkDerivation rec {
--set SNAP_NAME "thunderbird" --set SNAP_NAME "thunderbird"
--set MOZ_LEGACY_PROFILES 1 --set MOZ_LEGACY_PROFILES 1
--set MOZ_ALLOW_DOWNGRADE 1 --set MOZ_ALLOW_DOWNGRADE 1
--prefix PATH : "${lib.getBin gnupg}/bin"
--prefix LD_LIBRARY_PATH : "${lib.getLib gpgme}/lib"
) )
''; '';
@ -325,7 +338,7 @@ stdenv.mkDerivation rec {
requiredSystemFeatures = [ "big-parallel" ]; requiredSystemFeatures = [ "big-parallel" ];
meta = with stdenv.lib; { meta = with lib; {
description = "A full-featured e-mail client"; description = "A full-featured e-mail client";
homepage = "https://www.thunderbird.net"; homepage = "https://www.thunderbird.net";
maintainers = with maintainers; [ maintainers = with maintainers; [