Skip to content

Commit

Permalink
thunderbird: 52.9.1 -> 60.0
Browse files Browse the repository at this point in the history
  • Loading branch information
taku0 committed Aug 8, 2018
1 parent 9f415e3 commit 4ce863e
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions pkgs/applications/networking/mailreaders/thunderbird/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
, icu, libpng, jemalloc
, autoconf213, which, m4
, writeScript, xidel, common-updater-scripts, coreutils, gnused, gnugrep, curl
, cargo, rustc, llvmPackages
, enableGTK3 ? false, gtk3, gnome3, wrapGAppsHook, makeWrapper
, enableCalendar ? true
, debugBuild ? false
Expand All @@ -20,22 +21,16 @@

let
wrapperTool = if enableGTK3 then wrapGAppsHook else makeWrapper;
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
in stdenv.mkDerivation rec {
name = "thunderbird-${version}";
version = "52.9.1";
version = "60.0";

src = fetchurl {
url = "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz";
sha512 = "0ipvhllvlkcjshf2h938d531wpgnhbvdw1k088iazqamb3vrspxpfb4dhfrxvff995nym0gs7j5wa6bjd36nm4wajlabs5i6r80ms0d";
sha512 = "1933csh6swcx1z35lbxfkxlln36mx2mny28rzxz53r480wcvar8zcj77gwb06hzn6j5cvqls7qd5n6a7x43sp7w9ykkf4kf9gmlccya";
};

# New sed no longer tolerates this mistake.
postPatch = ''
for f in mozilla/{js/src,}/configure; do
substituteInPlace "$f" --replace '[:space:]*' '[[:space:]]*'
done
'';

# from firefox, but without sound libraries
buildInputs =
[ gtk2 zip libIDL libjpeg zlib bzip2
Expand All @@ -50,11 +45,11 @@ in stdenv.mkDerivation rec {
++ lib.optionals enableGTK3 [ gtk3 gnome3.defaultIconTheme ];

# from firefox + m4 + wrapperTool
nativeBuildInputs = [ m4 autoconf213 which gnused pkgconfig perl python wrapperTool ];
nativeBuildInputs = [ m4 autoconf213 which gnused pkgconfig perl python wrapperTool cargo rustc ];

configureFlags =
[ # from firefox, but without sound libraries (alsa, libvpx, pulseaudio)
"--enable-application=mail"
"--enable-application=comm/mail"
"--disable-alsa"
"--disable-pulseaudio"

Expand All @@ -66,6 +61,7 @@ in stdenv.mkDerivation rec {
"--with-system-libevent"
"--with-system-png" # needs APNG support
"--with-system-icu"
"--enable-rust-simd"
"--enable-system-ffi"
"--enable-system-hunspell"
"--enable-system-pixman"
Expand All @@ -79,18 +75,29 @@ in stdenv.mkDerivation rec {
"--enable-jemalloc"
"--disable-gconf"
"--enable-default-toolkit=cairo-gtk${if enableGTK3 then "3" else "2"}"
"--enable-js-shell"
]
++ lib.optional enableCalendar "--enable-calendar"
++ (if debugBuild then [ "--enable-debug" "--enable-profiling"]
else [ "--disable-debug" "--enable-release"
"--disable-debug-symbols"
"--enable-optimize" "--enable-strip" ])
++ lib.optional enableOfficialBranding "--enable-official-branding";
++ lib.optional enableOfficialBranding "--enable-official-branding"
++ lib.optionals (lib.versionAtLeast version "56" && !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"
];

enableParallelBuilding = true;

preConfigure =
''
cxxLib=$( echo -n ${gcc}/include/c++/* )
archLib=$cxxLib/$( ${gcc}/bin/gcc -dumpmachine )
test -f layout/style/ServoBindings.toml && sed -i -e '/"-DRUST_BINDGEN"/ a , "-cxx-isystem", "'$cxxLib'", "-isystem", "'$archLib'"' layout/style/ServoBindings.toml
configureScript="$(realpath ./configure)"
mkdir ../objdir
cd ../objdir
Expand All @@ -106,14 +113,14 @@ in stdenv.mkDerivation rec {
postInstall =
''
# For grsecurity kernels
paxmark m $out/lib/thunderbird-[0-9]*/thunderbird
paxmark m $out/lib/thunderbird/thunderbird
# TODO: Move to a dev output?
rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl
# $binary is a symlink to $target.
# We wrap $target by replacing the $binary symlink.
local target="$out/lib/thunderbird-${version}/thunderbird"
local target="$out/lib/thunderbird/thunderbird"
local binary="$out/bin/thunderbird"
# Wrap correctly, this is needed to
Expand All @@ -139,7 +146,7 @@ in stdenv.mkDerivation rec {
name = "thunderbird";
exec = "thunderbird %U";
desktopName = "Thunderbird";
icon = "$out/lib/thunderbird-${version}/chrome/icons/default/default256.png";
icon = "$out/lib/thunderbird/chrome/icons/default/default256.png";
genericName = "Mail Reader";
categories = "Application;Network";
mimeType = stdenv.lib.concatStringsSep ";" [
Expand All @@ -163,8 +170,8 @@ in stdenv.mkDerivation rec {
# Fix notifications. LibXUL uses dlopen for this, unfortunately; see #18712.
''
patchelf --set-rpath "${lib.getLib libnotify
}/lib:$(patchelf --print-rpath "$out"/lib/thunderbird-*/libxul.so)" \
"$out"/lib/thunderbird-*/libxul.so
}/lib:$(patchelf --print-rpath "$out"/lib/thunderbird*/libxul.so)" \
"$out"/lib/thunderbird*/libxul.so
'';

doInstallCheck = true;
Expand Down

2 comments on commit 4ce863e

@edolstra
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert. This commit increases the closure size of Thunderbird by about 600 MiB by adding clang to the runtime closure:

# nix why-depends /nix/store/6i92qc2zb0079wffnz4kzd41h1mzafxd-thunderbird-60.2.1 /nix/store/vknrja4x1j1ywih5vk5kizw1r5a0qpys-clang-5.0.2 
/nix/store/6i92qc2zb0079wffnz4kzd41h1mzafxd-thunderbird-60.2.1
╚═══lib/thunderbird/omni.ja: …ib --with-clang-path=/nix/store/6r3ibciwdp7h566ln0srz7bl8sn25dyb-clang-wrapper-5.0.2/bin/clang -…
    => /nix/store/6r3ibciwdp7h566ln0srz7bl8sn25dyb-clang-wrapper-5.0.2
    ╚═══bin/clang: …k disable=SC2193.[[ "/nix/store/vknrja4x1j1ywih5vk5kizw1r5a0qpys-clang-5.0.2/bin/clang" = *++ ]]…
        => /nix/store/vknrja4x1j1ywih5vk5kizw1r5a0qpys-clang-5.0.2

Why does it need Clang? Nixpkgs on Linux is GCC-based so Clang should be avoided as a dependency.

@edolstra
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I need to apply c033264 to Thunderbird.

Please sign in to comment.