2016-11-18 14:16:28 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, which, m4, gtk2, pango, perl, python2, zip, libIDL
|
2015-09-15 11:26:18 +02:00
|
|
|
, libjpeg, libpng, zlib, dbus, dbus_glib, bzip2, xorg
|
2014-07-22 22:18:24 +02:00
|
|
|
, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
|
2016-11-18 14:16:28 +01:00
|
|
|
, yasm, mesa, sqlite, unzip, makeWrapper
|
2014-07-22 22:18:24 +02:00
|
|
|
, hunspell, libevent, libstartup_notification, libvpx
|
|
|
|
, cairo, gstreamer, gst_plugins_base, icu
|
2016-12-25 09:35:20 +01:00
|
|
|
, writeScript, xidel, coreutils, gnused, gnugrep, curl, ed
|
2014-07-22 22:18:24 +02:00
|
|
|
, debugBuild ? false
|
2012-03-21 02:26:21 +01:00
|
|
|
, # If you want the resulting program to call itself "Thunderbird"
|
2016-05-05 02:14:19 +02:00
|
|
|
# instead of "Earlybird", enable this option. However, those
|
2012-03-21 02:26:21 +01:00
|
|
|
# binaries may not be distributed without permission from the
|
|
|
|
# Mozilla Foundation, see
|
|
|
|
# http://www.mozilla.org/foundation/trademarks/.
|
|
|
|
enableOfficialBranding ? false
|
|
|
|
}:
|
|
|
|
|
2016-12-29 03:07:10 +01:00
|
|
|
let version = "45.6.0"; in
|
2014-07-22 22:18:24 +02:00
|
|
|
let verName = "${version}"; in
|
2012-03-21 02:26:21 +01:00
|
|
|
|
2014-07-22 22:18:24 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2014-06-16 05:24:24 +02:00
|
|
|
name = "thunderbird-${verName}";
|
2012-03-21 02:26:21 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-05-09 15:49:44 +02:00
|
|
|
url = "mirror://mozilla/thunderbird/releases/${verName}/source/thunderbird-${verName}.source.tar.xz";
|
2016-12-29 03:07:10 +01:00
|
|
|
sha512 = "1f4579ac37b8ab98c91fe2e3e6742ba1b005ca9346d23f467d19e6af45eb457cab749bf91ed2a79f2058bd66f54da661da3ea5d5786f8c4b472d8a2a6c34db4b";
|
2012-03-21 02:26:21 +01:00
|
|
|
};
|
|
|
|
|
2017-01-19 15:48:29 +01:00
|
|
|
patches = [ ./gcc6.patch ];
|
|
|
|
|
2017-01-05 22:39:47 +01:00
|
|
|
# New sed no longer tolerates this mistake.
|
|
|
|
postPatch = ''
|
|
|
|
for f in mozilla/{js/src,}/configure; do
|
|
|
|
substituteInPlace "$f" --replace '[:space:]*' '[[:space:]]*'
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2016-05-05 02:14:19 +02:00
|
|
|
buildInputs = # from firefox30Pkgs.xulrunner, without gstreamer and libvpx
|
2016-09-11 23:24:51 +02:00
|
|
|
[ pkgconfig which libpng gtk2 perl zip libIDL libjpeg zlib bzip2
|
2016-11-18 14:16:28 +01:00
|
|
|
python2 dbus dbus_glib pango freetype fontconfig xorg.libXi
|
2015-09-15 11:26:18 +02:00
|
|
|
xorg.libX11 xorg.libXrender xorg.libXft xorg.libXt file
|
|
|
|
alsaLib nspr nss libnotify xorg.pixman yasm mesa
|
2016-11-18 14:16:28 +01:00
|
|
|
xorg.libXScrnSaver xorg.scrnsaverproto
|
2015-09-15 11:26:18 +02:00
|
|
|
xorg.libXext xorg.xextproto sqlite unzip makeWrapper
|
2014-07-22 22:18:24 +02:00
|
|
|
hunspell libevent libstartup_notification cairo icu
|
|
|
|
] ++ [ m4 ];
|
2012-03-21 02:26:21 +01:00
|
|
|
|
2015-01-13 21:45:47 +01:00
|
|
|
configurePhase = let configureFlags = [ "--enable-application=mail" ]
|
2014-07-22 22:18:24 +02:00
|
|
|
# from firefox30Pkgs.commonConfigureFlags, but without gstreamer and libvpx
|
|
|
|
++ [
|
2012-03-21 02:26:21 +01:00
|
|
|
"--with-system-jpeg"
|
|
|
|
"--with-system-zlib"
|
|
|
|
"--with-system-bz2"
|
|
|
|
"--with-system-nspr"
|
2012-10-05 22:15:56 +02:00
|
|
|
"--with-system-nss"
|
2014-07-22 22:18:24 +02:00
|
|
|
"--with-system-libevent"
|
|
|
|
#"--with-system-libvpx"
|
|
|
|
"--with-system-png"
|
|
|
|
"--with-system-icu"
|
|
|
|
"--enable-system-ffi"
|
|
|
|
"--enable-system-hunspell"
|
|
|
|
"--enable-system-pixman"
|
|
|
|
"--enable-system-sqlite"
|
|
|
|
"--enable-system-cairo"
|
2016-05-05 02:14:19 +02:00
|
|
|
"--disable-gconf"
|
2014-07-22 22:18:24 +02:00
|
|
|
"--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
|
2012-03-21 02:26:21 +01:00
|
|
|
"--disable-crashreporter"
|
|
|
|
"--disable-tests"
|
2014-07-22 22:18:24 +02:00
|
|
|
"--disable-necko-wifi" # maybe we want to enable this at some point
|
|
|
|
"--disable-installer"
|
|
|
|
"--disable-updater"
|
|
|
|
"--disable-pulseaudio"
|
|
|
|
] ++ (if debugBuild then [ "--enable-debug" "--enable-profiling"]
|
|
|
|
else [ "--disable-debug" "--enable-release"
|
2015-01-13 21:45:47 +01:00
|
|
|
"--disable-debug-symbols"
|
2014-07-22 22:18:24 +02:00
|
|
|
"--enable-optimize" "--enable-strip" ])
|
|
|
|
++ [
|
|
|
|
"--disable-javaxpcom"
|
2016-03-11 13:46:27 +01:00
|
|
|
#"--enable-stdcxx-compat" # Avoid dependency on libstdc++ 4.7
|
2012-03-21 02:26:21 +01:00
|
|
|
]
|
|
|
|
++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
|
2015-01-13 21:45:47 +01:00
|
|
|
in ''
|
|
|
|
mkdir -p objdir/mozilla
|
|
|
|
cd objdir
|
2014-07-22 22:18:24 +02:00
|
|
|
echo '${stdenv.lib.concatMapStrings (s : "ac_add_options ${s}\n") configureFlags}' > .mozconfig
|
2015-01-13 21:45:47 +01:00
|
|
|
echo 'ac_add_options --prefix="'"$out"'"' >> .mozconfig
|
2015-08-08 03:16:32 +02:00
|
|
|
# From version 38, we need to specify the source directory to build
|
|
|
|
# Thunderbird. Refer to mozilla/configure and search a line with
|
|
|
|
# "checking for application to build" and "# Support comm-central".
|
|
|
|
echo 'ac_add_options --with-external-source-dir="'`realpath ..`'"' >> .mozconfig
|
2015-01-13 21:45:47 +01:00
|
|
|
echo 'mk_add_options MOZ_MAKE_FLAGS="-j'"$NIX_BUILD_CORES"'"' >> .mozconfig
|
|
|
|
echo 'mk_add_options MOZ_OBJDIR="'`pwd`'"' >> .mozconfig
|
2014-07-22 22:18:24 +02:00
|
|
|
|
2015-01-13 21:45:47 +01:00
|
|
|
export MOZCONFIG=`realpath ./.mozconfig`
|
|
|
|
|
|
|
|
patchShebangs ../mozilla/mach
|
|
|
|
../mozilla/mach configure
|
2014-07-22 22:18:24 +02:00
|
|
|
'';
|
2012-03-21 02:26:21 +01:00
|
|
|
|
2015-05-21 14:00:42 +02:00
|
|
|
enableParallelBuilding = true;
|
2016-05-12 11:10:53 +02:00
|
|
|
requiredSystemFeatures = [ "big-parallel" ];
|
2015-05-21 14:00:42 +02:00
|
|
|
|
2015-01-13 21:45:47 +01:00
|
|
|
buildPhase = "../mozilla/mach build";
|
2012-03-21 02:26:21 +01:00
|
|
|
|
2015-01-13 21:45:47 +01:00
|
|
|
installPhase =
|
2012-03-21 02:26:21 +01:00
|
|
|
''
|
2015-01-13 21:45:47 +01:00
|
|
|
../mozilla/mach install
|
|
|
|
|
2012-10-05 22:15:56 +02:00
|
|
|
rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl
|
2012-03-21 02:26:21 +01:00
|
|
|
|
|
|
|
# Create a desktop item.
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cat > $out/share/applications/thunderbird.desktop <<EOF
|
|
|
|
[Desktop Entry]
|
|
|
|
Type=Application
|
|
|
|
Exec=$out/bin/thunderbird
|
|
|
|
Icon=$out/lib/thunderbird-${version}/chrome/icons/default/default256.png
|
|
|
|
Name=Thunderbird
|
|
|
|
GenericName=Mail Reader
|
|
|
|
Categories=Application;Network;
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
2016-10-13 14:26:29 +02:00
|
|
|
postFixup =
|
|
|
|
''
|
|
|
|
paxmark m $out/lib/thunderbird-${version}/thunderbird
|
|
|
|
'';
|
|
|
|
|
2012-03-21 02:26:21 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-07-22 22:18:24 +02:00
|
|
|
description = "A full-featured e-mail client";
|
2012-03-21 02:26:21 +01:00
|
|
|
homepage = http://www.mozilla.org/thunderbird/;
|
|
|
|
license =
|
|
|
|
# Official branding implies thunderbird name and logo cannot be reuse,
|
|
|
|
# see http://www.mozilla.org/foundation/licensing.html
|
|
|
|
if enableOfficialBranding then licenses.proprietary else licenses.mpl11;
|
2013-05-17 14:55:06 +02:00
|
|
|
maintainers = [ maintainers.pierron maintainers.eelco ];
|
2012-10-05 22:15:56 +02:00
|
|
|
platforms = platforms.linux;
|
2012-03-21 02:26:21 +01:00
|
|
|
};
|
2016-12-25 09:35:20 +01:00
|
|
|
|
|
|
|
passthru.updateScript = import ./../../browsers/firefox/update.nix {
|
|
|
|
name = "thunderbird";
|
|
|
|
sourceSectionRegex = ".";
|
|
|
|
basePath = "pkgs/applications/networking/mailreaders/thunderbird";
|
|
|
|
baseUrl = "http://archive.mozilla.org/pub/thunderbird/releases/";
|
|
|
|
inherit writeScript xidel coreutils gnused gnugrep curl ed;
|
|
|
|
};
|
2012-03-21 02:26:21 +01:00
|
|
|
}
|