2020-07-27 16:39:25 +02:00
|
|
|
# This pakcage is keeped until Thunderbird 78 supports OpenPGP.
|
|
|
|
# https://www.thunderbird.net/en-US/thunderbird/78.0.1/releasenotes/
|
|
|
|
{ autoconf213
|
|
|
|
, bzip2
|
|
|
|
, cargo
|
|
|
|
, common-updater-scripts
|
2020-11-27 13:42:09 +01:00
|
|
|
, copyDesktopItems
|
2020-07-27 16:39:25 +02:00
|
|
|
, coreutils
|
|
|
|
, curl
|
|
|
|
, dbus
|
|
|
|
, dbus-glib
|
|
|
|
, fetchurl
|
|
|
|
, file
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, glib
|
|
|
|
, gnugrep
|
|
|
|
, gnused
|
|
|
|
, icu
|
|
|
|
, jemalloc
|
|
|
|
, lib
|
|
|
|
, libGL
|
|
|
|
, libGLU
|
|
|
|
, libevent
|
|
|
|
, libjpeg
|
|
|
|
, libnotify
|
|
|
|
, libpng
|
|
|
|
, libstartup_notification
|
|
|
|
, libvpx
|
|
|
|
, libwebp
|
|
|
|
, llvmPackages
|
|
|
|
, m4
|
|
|
|
, makeDesktopItem
|
|
|
|
, nasm
|
|
|
|
, nodejs
|
|
|
|
, nspr
|
|
|
|
, nss
|
|
|
|
, pango
|
|
|
|
, perl
|
2021-01-17 03:09:27 +01:00
|
|
|
, pkg-config
|
2020-07-27 16:39:25 +02:00
|
|
|
, python2
|
|
|
|
, python3
|
|
|
|
, runtimeShell
|
|
|
|
, rust-cbindgen
|
|
|
|
, rustc
|
|
|
|
, sqlite
|
|
|
|
, stdenv
|
|
|
|
, systemd
|
|
|
|
, unzip
|
|
|
|
, which
|
|
|
|
, writeScript
|
|
|
|
, xidel
|
|
|
|
, xorg
|
|
|
|
, yasm
|
|
|
|
, zip
|
|
|
|
, zlib
|
|
|
|
|
|
|
|
, debugBuild ? false
|
|
|
|
|
|
|
|
, alsaSupport ? stdenv.isLinux, alsaLib
|
|
|
|
, pulseaudioSupport ? stdenv.isLinux, libpulseaudio
|
|
|
|
, gtk3Support ? true, gtk2, gtk3, wrapGAppsHook
|
|
|
|
, waylandSupport ? true
|
|
|
|
, libxkbcommon, calendarSupport ? true
|
|
|
|
|
2020-08-19 19:49:16 +02:00
|
|
|
# Use official trademarked branding. Permission obtained at:
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/94880#issuecomment-675907971
|
|
|
|
, enableOfficialBranding ? true
|
2020-07-27 16:39:25 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert waylandSupport -> gtk3Support == true;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "thunderbird";
|
2020-08-27 12:52:06 +02:00
|
|
|
version = "68.12.0";
|
2020-07-27 16:39:25 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url =
|
|
|
|
"mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz";
|
|
|
|
sha512 =
|
2020-08-27 12:52:06 +02:00
|
|
|
"33350vjgzvsg6sdhdld92z75k1xcf1wmngdcvzsj4f3y3aal73pyw03mlvgg6y36bm0j8fhaxvgbbg5zm7hxhn779z78970m4v9amg7";
|
2020-07-27 16:39:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoconf213
|
|
|
|
cargo
|
2020-11-27 13:42:09 +01:00
|
|
|
copyDesktopItems
|
2020-07-27 16:39:25 +02:00
|
|
|
gnused
|
|
|
|
llvmPackages.llvm
|
|
|
|
m4
|
|
|
|
nasm
|
|
|
|
nodejs
|
|
|
|
perl
|
2021-01-17 03:09:27 +01:00
|
|
|
pkg-config
|
2020-07-27 16:39:25 +02:00
|
|
|
python2
|
|
|
|
python3
|
|
|
|
rust-cbindgen
|
|
|
|
rustc
|
|
|
|
which
|
|
|
|
yasm
|
|
|
|
] ++ lib.optional gtk3Support wrapGAppsHook;
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
bzip2
|
|
|
|
dbus
|
|
|
|
dbus-glib
|
|
|
|
file
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
glib
|
|
|
|
gtk2
|
|
|
|
icu
|
|
|
|
jemalloc
|
|
|
|
libGL
|
|
|
|
libGLU
|
|
|
|
libevent
|
|
|
|
libjpeg
|
|
|
|
libnotify
|
|
|
|
libpng
|
|
|
|
libstartup_notification
|
|
|
|
libvpx
|
|
|
|
libwebp
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
pango
|
|
|
|
perl
|
|
|
|
sqlite
|
|
|
|
unzip
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXScrnSaver
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXft
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXt
|
|
|
|
xorg.pixman
|
|
|
|
xorg.xorgproto
|
|
|
|
zip
|
|
|
|
zlib
|
|
|
|
] ++ lib.optional alsaSupport alsaLib
|
|
|
|
++ lib.optional gtk3Support gtk3
|
|
|
|
++ lib.optional pulseaudioSupport libpulseaudio
|
|
|
|
++ lib.optional waylandSupport libxkbcommon;
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE =[
|
|
|
|
"-I${glib.dev}/include/gio-unix-2.0"
|
|
|
|
"-I${nss.dev}/include/nss"
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./no-buildconfig-68.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
rm -rf obj-x86_64-pc-linux-gnu
|
|
|
|
'';
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# remove distributed configuration files
|
|
|
|
rm -f configure
|
|
|
|
rm -f js/src/configure
|
|
|
|
rm -f .mozconfig*
|
|
|
|
|
|
|
|
configureScript="$(realpath ./mach) configure"
|
|
|
|
# AS=as in the environment causes build failure https://bugzilla.mozilla.org/show_bug.cgi?id=1497286
|
|
|
|
unset AS
|
|
|
|
|
|
|
|
export MOZCONFIG=$(pwd)/mozconfig
|
|
|
|
|
|
|
|
# Set C flags for Rust's bindgen program. Unlike ordinary C
|
|
|
|
# compilation, bindgen does not invoke $CC directly. Instead it
|
|
|
|
# uses LLVM's libclang. To make sure all necessary flags are
|
|
|
|
# included we need to look in a few places.
|
|
|
|
# TODO: generalize this process for other use-cases.
|
|
|
|
|
|
|
|
BINDGEN_CFLAGS="$(< ${stdenv.cc}/nix-support/libc-cflags) \
|
|
|
|
$(< ${stdenv.cc}/nix-support/cc-cflags) \
|
|
|
|
$(< ${stdenv.cc}/nix-support/libcxx-cxxflags) \
|
|
|
|
${
|
|
|
|
lib.optionalString stdenv.cc.isClang
|
|
|
|
"-idirafter ${stdenv.cc.cc}/lib/clang/${
|
|
|
|
lib.getVersion stdenv.cc.cc
|
|
|
|
}/include"
|
|
|
|
} \
|
|
|
|
${
|
|
|
|
lib.optionalString stdenv.cc.isGNU
|
|
|
|
"-isystem ${stdenv.cc.cc}/include/c++/${
|
|
|
|
lib.getVersion stdenv.cc.cc
|
|
|
|
} -isystem ${stdenv.cc.cc}/include/c++/${
|
|
|
|
lib.getVersion stdenv.cc.cc
|
|
|
|
}/${stdenv.hostPlatform.config}"
|
|
|
|
} \
|
|
|
|
$NIX_CFLAGS_COMPILE"
|
|
|
|
|
|
|
|
echo "ac_add_options BINDGEN_CFLAGS='$BINDGEN_CFLAGS'" >> $MOZCONFIG
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = let
|
|
|
|
toolkitSlug = if gtk3Support then
|
|
|
|
"3${lib.optionalString waylandSupport "-wayland"}"
|
|
|
|
else
|
|
|
|
"2";
|
|
|
|
toolkitValue = "cairo-gtk${toolkitSlug}";
|
|
|
|
in [
|
|
|
|
"--enable-application=comm/mail"
|
|
|
|
|
|
|
|
"--with-system-bz2"
|
|
|
|
"--with-system-icu"
|
|
|
|
"--with-system-jpeg"
|
|
|
|
"--with-system-libevent"
|
|
|
|
"--with-system-nspr"
|
|
|
|
"--with-system-nss"
|
|
|
|
"--with-system-png" # needs APNG support
|
|
|
|
"--with-system-icu"
|
|
|
|
"--with-system-zlib"
|
|
|
|
"--with-system-webp"
|
|
|
|
"--with-system-libvpx"
|
|
|
|
|
|
|
|
"--enable-rust-simd"
|
|
|
|
"--enable-crashreporter"
|
|
|
|
"--enable-default-toolkit=${toolkitValue}"
|
|
|
|
"--enable-js-shell"
|
|
|
|
"--enable-necko-wifi"
|
|
|
|
"--enable-startup-notification"
|
|
|
|
"--enable-system-ffi"
|
|
|
|
"--enable-system-pixman"
|
|
|
|
"--enable-system-sqlite"
|
|
|
|
|
|
|
|
"--disable-gconf"
|
|
|
|
"--disable-tests"
|
|
|
|
"--disable-updater"
|
|
|
|
"--enable-jemalloc"
|
|
|
|
] ++ (if debugBuild then [
|
|
|
|
"--enable-debug"
|
|
|
|
"--enable-profiling"
|
|
|
|
] else [
|
|
|
|
"--disable-debug"
|
|
|
|
"--enable-release"
|
|
|
|
"--disable-debug-symbols"
|
|
|
|
"--enable-optimize"
|
|
|
|
"--enable-strip"
|
|
|
|
]) ++ lib.optionals (!stdenv.hostPlatform.isi686) [
|
|
|
|
# on i686-linux: --with-libclang-path is not available in this configuration
|
|
|
|
"--with-libclang-path=${llvmPackages.libclang}/lib"
|
|
|
|
"--with-clang-path=${llvmPackages.clang}/bin/clang"
|
|
|
|
] ++ lib.optional alsaSupport "--enable-alsa"
|
|
|
|
++ lib.optional calendarSupport "--enable-calendar"
|
|
|
|
++ lib.optional enableOfficialBranding "--enable-official-branding"
|
|
|
|
++ lib.optional pulseaudioSupport "--enable-pulseaudio";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
cd obj-*
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = lib.optionals enableOfficialBranding [
|
|
|
|
"MOZILLA_OFFICIAL=1"
|
|
|
|
"BUILD_OFFICIAL=1"
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2020-11-27 13:42:09 +01:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
2020-07-27 16:39:25 +02:00
|
|
|
categories = lib.concatStringsSep ";" [ "Application" "Network" ];
|
|
|
|
desktopName = "Thunderbird";
|
|
|
|
genericName = "Mail Reader";
|
|
|
|
name = "thunderbird";
|
|
|
|
exec = "thunderbird %U";
|
|
|
|
icon = "$out/lib/thunderbird/chrome/icons/default/default256.png";
|
|
|
|
mimeType = lib.concatStringsSep ";" [
|
|
|
|
# Email
|
|
|
|
"x-scheme-handler/mailto"
|
|
|
|
"message/rfc822"
|
|
|
|
# Feeds
|
|
|
|
"x-scheme-handler/feed"
|
|
|
|
"application/rss+xml"
|
|
|
|
"application/x-extension-rss"
|
|
|
|
# Newsgroups
|
|
|
|
"x-scheme-handler/news"
|
|
|
|
"x-scheme-handler/snews"
|
|
|
|
"x-scheme-handler/nntp"
|
|
|
|
];
|
2020-11-27 13:42:09 +01:00
|
|
|
})
|
|
|
|
];
|
|
|
|
postInstall = ''
|
2020-07-27 16:39:25 +02:00
|
|
|
# TODO: Move to a dev output?
|
|
|
|
rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
# Needed to find Mozilla runtime
|
|
|
|
gappsWrapperArgs+=(
|
|
|
|
--argv0 "$out/bin/thunderbird"
|
|
|
|
--set MOZ_APP_LAUNCHER thunderbird
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/61980
|
|
|
|
--set SNAP_NAME "thunderbird"
|
|
|
|
--set MOZ_LEGACY_PROFILES 1
|
|
|
|
--set MOZ_ALLOW_DOWNGRADE 1
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
# FIXME: The XUL portion of this can probably be removed as soon as we
|
|
|
|
# package a Thunderbird >=71.0 since XUL shouldn't be anymore (in use)?
|
|
|
|
postFixup = ''
|
|
|
|
local xul="$out/lib/thunderbird/libxul.so"
|
2020-08-12 20:14:08 +02:00
|
|
|
patchelf --set-rpath "${libnotify}/lib:${lib.getLib systemd}/lib:$(patchelf --print-rpath $xul)" $xul
|
2020-07-27 16:39:25 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
"$out/bin/thunderbird" --version
|
|
|
|
'';
|
|
|
|
|
|
|
|
disallowedRequisites = [
|
|
|
|
stdenv.cc
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru.updateScript = import ./../../browsers/firefox/update.nix {
|
|
|
|
attrPath = "thunderbird";
|
|
|
|
baseUrl = "http://archive.mozilla.org/pub/thunderbird/releases/";
|
|
|
|
inherit writeScript lib common-updater-scripts xidel coreutils gnused
|
|
|
|
gnugrep curl runtimeShell;
|
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-07-27 16:39:25 +02:00
|
|
|
description = "A full-featured e-mail client";
|
|
|
|
homepage = "https://www.thunderbird.net";
|
|
|
|
maintainers = with maintainers; [
|
|
|
|
eelco
|
|
|
|
lovesegfault
|
|
|
|
pierron
|
2020-09-21 11:53:20 +02:00
|
|
|
vcunat
|
2020-07-27 16:39:25 +02:00
|
|
|
];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.mpl20;
|
2020-10-11 11:15:50 +02:00
|
|
|
knownVulnerabilities = [ "Support ended around Semptember 2020." ];
|
2020-07-27 16:39:25 +02:00
|
|
|
};
|
|
|
|
}
|