thunderbird: major update 17.* -> 31.0

- To fix build problems, I refactored the build process
  according to Mozilla recommendations.
- 31.0 should become the next ESR branch (31 released today).

CC @nbp @edolstra
This commit is contained in:
Vladimír Čunát 2014-07-22 22:18:24 +02:00
parent 27fe53e89c
commit adc2edd5cf
2 changed files with 60 additions and 41 deletions

View File

@ -1,9 +1,10 @@
{ stdenv, fetchurl, pkgconfig, gtk, perl, python, zip, unzip { stdenv, fetchurl, pkgconfig, m4, gtk, pango, perl, python, zip, libIDL
, libIDL, dbus_glib, bzip2, alsaLib, nspr, yasm, mesa, nss , libjpeg, libpng, zlib, dbus, dbus_glib, bzip2, xlibs
, libnotify, cairo, pixman, fontconfig , freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
, libjpeg , yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
, pythonPackages , hunspell, libevent, libstartup_notification, libvpx
, cairo, gstreamer, gst_plugins_base, icu
, debugBuild ? false
, # If you want the resulting program to call itself "Thunderbird" , # If you want the resulting program to call itself "Thunderbird"
# instead of "Shredder", enable this option. However, those # instead of "Shredder", enable this option. However, those
# binaries may not be distributed without permission from the # binaries may not be distributed without permission from the
@ -12,59 +13,75 @@
enableOfficialBranding ? false enableOfficialBranding ? false
}: }:
let version = "17.0.11"; in let version = "31.0"; in
let verName = "${version}esr"; in let verName = "${version}"; in
stdenv.mkDerivation { stdenv.mkDerivation rec {
name = "thunderbird-${verName}"; name = "thunderbird-${verName}";
src = fetchurl { src = fetchurl {
url = "ftp://ftp.mozilla.org/pub/thunderbird/releases/${verName}/source/thunderbird-${verName}.source.tar.bz2"; url = "ftp://ftp.mozilla.org/pub/thunderbird/releases/${verName}/source/thunderbird-${verName}.source.tar.bz2";
sha256 = "1m2lph8x82kgxqzlyaxr1l1x7s4qnqfzfnqck4b777914mrv1mdp"; sha1 = "0fe6666fddd4db82ec2e389f30c5ea11d4f72be5";
}; };
#enableParallelBuilding = true; buildInputs = # from firefox30Pkgs.xulrunner, but without gstreamer and libvpx
[ pkgconfig libpng gtk perl zip libIDL libjpeg zlib bzip2
python dbus dbus_glib pango freetype fontconfig xlibs.libXi
xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt file
alsaLib nspr nss libnotify xlibs.pixman yasm mesa
xlibs.libXScrnSaver xlibs.scrnsaverproto pysqlite
xlibs.libXext xlibs.xextproto sqlite unzip makeWrapper
hunspell libevent libstartup_notification cairo icu
] ++ [ m4 ];
buildInputs = configureFlags = [ "--enable-application=mail" ]
[ pkgconfig perl python zip unzip bzip2 gtk dbus_glib alsaLib libIDL nspr # from firefox30Pkgs.commonConfigureFlags, but without gstreamer and libvpx
libnotify cairo pixman fontconfig yasm mesa nss ++ [
libjpeg pythonPackages.sqlite3
];
configureFlags =
[ "--enable-application=mail"
"--enable-optimize"
"--with-pthreads"
"--disable-debug"
"--enable-strip"
"--with-pthreads"
"--with-system-jpeg" "--with-system-jpeg"
#"--with-system-png"
"--with-system-zlib" "--with-system-zlib"
"--with-system-bz2" "--with-system-bz2"
"--with-system-nspr" "--with-system-nspr"
"--with-system-nss" "--with-system-nss"
# Broken: https://bugzilla.mozilla.org/show_bug.cgi?id=722975 "--with-system-libevent"
#"--enable-system-cairo" #"--with-system-libvpx"
"--with-system-png"
"--with-system-icu"
"--enable-system-ffi"
"--enable-system-hunspell"
"--enable-system-pixman"
"--enable-system-sqlite"
"--enable-system-cairo"
"--disable-gstreamer"
"--enable-startup-notification"
# "--enable-content-sandbox" # available since 26.0, but not much info available
# "--enable-content-sandbox-reporter" # keeping disabled for now
"--disable-crashreporter" "--disable-crashreporter"
"--disable-necko-wifi"
"--disable-webm"
"--disable-tests" "--disable-tests"
"--enable-calendar" "--disable-necko-wifi" # maybe we want to enable this at some point
"--disable-ogg" "--disable-installer"
"--disable-updater"
"--disable-pulseaudio"
] ++ (if debugBuild then [ "--enable-debug" "--enable-profiling"]
else [ "--disable-debug" "--enable-release"
"--enable-optimize" "--enable-strip" ])
++ [
"--disable-javaxpcom"
"--enable-stdcxx-compat" # Avoid dependency on libstdc++ 4.7
] ]
++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding"; ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
# The Thunderbird Makefiles refer to the variables LIBXUL_DIST, configurePhase = ''
# prefix, and PREFIX in some places where they are not set. In patchShebangs .
# particular, there are some linker flags like
# `-rpath-link=$(LIBXUL_DIST)/bin'. Since this expands to
# `-rpath-link=/bin', the build fails due to the purity checks in
# the ld wrapper. So disable the purity check for now.
preBuild = "NIX_ENFORCE_PURITY=0";
# This doesn't work: echo '${stdenv.lib.concatMapStrings (s : "ac_add_options ${s}\n") configureFlags}' > .mozconfig
#makeFlags = "LIBXUL_DIST=$(out) prefix=$(out) PREFIX=$(out)"; echo "ac_add_options --prefix='$out'" >> .mozconfig
echo "mk_add_options MOZ_MAKE_FLAGS='-j$NIX_BUILD_CORES'" >> .mozconfig
make ${makeFlags} configure
'';
makeFlags = "-f client.mk";
buildFlags = "build";
postInstall = postInstall =
'' ''
@ -84,7 +101,7 @@ stdenv.mkDerivation {
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Mozilla Thunderbird, a full-featured email client"; description = "A full-featured e-mail client";
homepage = http://www.mozilla.org/thunderbird/; homepage = http://www.mozilla.org/thunderbird/;
license = license =
# Official branding implies thunderbird name and logo cannot be reuse, # Official branding implies thunderbird name and logo cannot be reuse,

View File

@ -9732,6 +9732,8 @@ let
thunderbird = callPackage ../applications/networking/mailreaders/thunderbird { thunderbird = callPackage ../applications/networking/mailreaders/thunderbird {
inherit (gnome) libIDL; inherit (gnome) libIDL;
inherit (pythonPackages) pysqlite;
libpng = libpng_apng;
}; };
thunderbird-bin = callPackage ../applications/networking/mailreaders/thunderbird-bin { thunderbird-bin = callPackage ../applications/networking/mailreaders/thunderbird-bin {