2017-04-09 18:15:06 +01:00
|
|
|
{ lib, stdenv, fetchurl, pkgconfig, gtk2, pango, perl, python, zip, libIDL
|
|
|
|
, libjpeg, zlib, dbus, dbus_glib, bzip2, xorg
|
|
|
|
, freetype, fontconfig, file, nspr, nss, libnotify
|
|
|
|
, yasm, mesa, sqlite, unzip
|
|
|
|
, hunspell, libevent, libstartup_notification
|
|
|
|
, cairo, gstreamer, gst-plugins-base, icu, libpng, jemalloc
|
|
|
|
, autoconf213, which, m4
|
2017-01-04 22:38:55 +00:00
|
|
|
, writeScript, xidel, common-updater-scripts, coreutils, gnused, gnugrep, curl
|
2017-04-09 18:15:06 +01:00
|
|
|
, enableGTK3 ? false, gtk3, wrapGAppsHook
|
2017-04-12 17:46:07 +01:00
|
|
|
, enableCalendar ? true
|
2014-07-22 21:18:24 +01:00
|
|
|
, debugBuild ? false
|
2017-04-09 18:15:06 +01:00
|
|
|
, # If you want the resulting program to call itself "Thunderbird" instead
|
|
|
|
# of "Earlybird" or whatever, enable this option. However, those
|
2012-03-21 01:26:21 +00:00
|
|
|
# binaries may not be distributed without permission from the
|
|
|
|
# Mozilla Foundation, see
|
|
|
|
# http://www.mozilla.org/foundation/trademarks/.
|
|
|
|
enableOfficialBranding ? false
|
2017-04-15 20:11:34 +01:00
|
|
|
, makeDesktopItem
|
2012-03-21 01:26:21 +00:00
|
|
|
}:
|
|
|
|
|
2014-07-22 21:18:24 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2017-04-09 18:15:06 +01:00
|
|
|
name = "thunderbird-${version}";
|
|
|
|
version = "52.0";
|
2012-03-21 01:26:21 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-04-09 18:15:06 +01:00
|
|
|
url = "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz";
|
2017-04-04 14:03:36 +01:00
|
|
|
sha512 = "215de8ae386f6f12d7a4338bb03bac956410be0dd4de5cca218e12241e3948c8c2540756e149bfde597cd10e399b4cb4db86619a2aa50a368ba323b413c1f93c";
|
2012-03-21 01:26:21 +00:00
|
|
|
};
|
|
|
|
|
2017-01-05 21:39:47 +00:00
|
|
|
# New sed no longer tolerates this mistake.
|
|
|
|
postPatch = ''
|
|
|
|
for f in mozilla/{js/src,}/configure; do
|
|
|
|
substituteInPlace "$f" --replace '[:space:]*' '[[:space:]]*'
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2017-04-09 18:15:06 +01:00
|
|
|
# from firefox, but without sound libraries
|
|
|
|
buildInputs =
|
|
|
|
[ gtk2 zip libIDL libjpeg zlib bzip2
|
|
|
|
dbus dbus_glib pango freetype fontconfig xorg.libXi
|
2015-09-15 10:26:18 +01:00
|
|
|
xorg.libX11 xorg.libXrender xorg.libXft xorg.libXt file
|
2017-04-09 18:15:06 +01:00
|
|
|
nspr nss libnotify xorg.pixman yasm mesa
|
2016-11-18 13:16:28 +00:00
|
|
|
xorg.libXScrnSaver xorg.scrnsaverproto
|
2017-04-09 18:15:06 +01:00
|
|
|
xorg.libXext xorg.xextproto sqlite unzip
|
|
|
|
hunspell libevent libstartup_notification /* cairo */
|
|
|
|
icu libpng jemalloc
|
|
|
|
]
|
|
|
|
++ lib.optional enableGTK3 gtk3;
|
|
|
|
|
|
|
|
# from firefox + m4
|
|
|
|
nativeBuildInputs = [ m4 autoconf213 which gnused pkgconfig perl python ] ++ lib.optional enableGTK3 wrapGAppsHook;
|
|
|
|
|
|
|
|
configureFlags =
|
|
|
|
[ # from firefox, but without sound libraries (alsa, libvpx, pulseaudio)
|
|
|
|
"--enable-application=mail"
|
|
|
|
"--disable-alsa"
|
|
|
|
"--disable-pulseaudio"
|
2012-03-21 01:26:21 +00:00
|
|
|
|
|
|
|
"--with-system-jpeg"
|
|
|
|
"--with-system-zlib"
|
|
|
|
"--with-system-bz2"
|
|
|
|
"--with-system-nspr"
|
2012-10-05 21:15:56 +01:00
|
|
|
"--with-system-nss"
|
2014-07-22 21:18:24 +01:00
|
|
|
"--with-system-libevent"
|
2017-04-09 18:15:06 +01:00
|
|
|
"--with-system-png" # needs APNG support
|
2014-07-22 21:18:24 +01:00
|
|
|
"--with-system-icu"
|
|
|
|
"--enable-system-ffi"
|
|
|
|
"--enable-system-hunspell"
|
|
|
|
"--enable-system-pixman"
|
|
|
|
"--enable-system-sqlite"
|
2017-04-09 18:15:06 +01:00
|
|
|
#"--enable-system-cairo"
|
2014-07-22 21:18:24 +01:00
|
|
|
"--enable-startup-notification"
|
2017-04-09 18:15:06 +01:00
|
|
|
"--enable-content-sandbox" # available since 26.0, but not much info available
|
2012-03-21 01:26:21 +00:00
|
|
|
"--disable-crashreporter"
|
|
|
|
"--disable-tests"
|
2014-07-22 21:18:24 +01:00
|
|
|
"--disable-necko-wifi" # maybe we want to enable this at some point
|
|
|
|
"--disable-updater"
|
2017-04-09 18:15:06 +01:00
|
|
|
"--enable-jemalloc"
|
|
|
|
"--disable-gconf"
|
|
|
|
"--enable-default-toolkit=cairo-gtk${if enableGTK3 then "3" else "2"}"
|
|
|
|
]
|
2017-04-12 17:46:07 +01:00
|
|
|
++ lib.optional enableCalendar "--enable-calendar"
|
2017-04-09 18:15:06 +01:00
|
|
|
++ (if debugBuild then [ "--enable-debug" "--enable-profiling"]
|
2014-07-22 21:18:24 +01:00
|
|
|
else [ "--disable-debug" "--enable-release"
|
2015-01-13 20:45:47 +00:00
|
|
|
"--disable-debug-symbols"
|
2014-07-22 21:18:24 +01:00
|
|
|
"--enable-optimize" "--enable-strip" ])
|
2017-04-09 18:15:06 +01:00
|
|
|
++ lib.optional enableOfficialBranding "--enable-official-branding";
|
2012-03-21 01:26:21 +00:00
|
|
|
|
2015-05-21 13:00:42 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-04-09 18:15:06 +01:00
|
|
|
preConfigure =
|
|
|
|
''
|
|
|
|
configureScript="$(realpath ./configure)"
|
|
|
|
mkdir ../objdir
|
|
|
|
cd ../objdir
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall =
|
|
|
|
''
|
|
|
|
# The following is needed for startup cache creation on grsecurity kernels.
|
|
|
|
paxmark m ../objdir/dist/bin/xpcshell
|
|
|
|
'';
|
2012-03-21 01:26:21 +00:00
|
|
|
|
2017-04-09 18:15:06 +01:00
|
|
|
postInstall =
|
2012-03-21 01:26:21 +00:00
|
|
|
''
|
2017-04-09 18:15:06 +01:00
|
|
|
# For grsecurity kernels
|
|
|
|
paxmark m $out/lib/thunderbird-[0-9]*/thunderbird
|
|
|
|
|
|
|
|
# Needed to find Mozilla runtime
|
|
|
|
gappsWrapperArgs+=(--argv0 "$out/bin/.thunderbird-wrapped")
|
2017-04-15 20:11:34 +01:00
|
|
|
|
|
|
|
# TODO: Move to a dev output?
|
|
|
|
rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl
|
|
|
|
|
|
|
|
${ let desktopItem = makeDesktopItem {
|
|
|
|
name = "thunderbird";
|
|
|
|
exec = "$out/bin/thunderbird %U";
|
|
|
|
desktopName = "Thunderbird";
|
|
|
|
icon = "$out/lib/thunderbird-${version}/chrome/icons/default/default256.png";
|
|
|
|
genericName = "Main Reader";
|
|
|
|
categories = "Application;Network";
|
|
|
|
mimeType = stdenv.lib.concatStringsSep ";" [
|
|
|
|
# Email
|
|
|
|
"x-scheme-handler/mailto"
|
|
|
|
"message/rfc822"
|
|
|
|
# Newsgroup
|
|
|
|
"x-scheme-handler/news"
|
|
|
|
"x-scheme-handler/snews"
|
|
|
|
"x-scheme-handler/nntp"
|
|
|
|
# Feed
|
|
|
|
"x-scheme-handler/feed"
|
|
|
|
"application/rss+xml"
|
|
|
|
"application/x-extension-rss"
|
|
|
|
];
|
|
|
|
}; in desktopItem.buildCommand
|
|
|
|
}
|
2012-03-21 01:26:21 +00:00
|
|
|
'';
|
|
|
|
|
2017-04-09 18:15:06 +01:00
|
|
|
postFixup =
|
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase =
|
|
|
|
''
|
|
|
|
# Some basic testing
|
|
|
|
"$out/bin/thunderbird" --version
|
|
|
|
'';
|
2016-10-13 13:26:29 +01:00
|
|
|
|
2012-03-21 01:26:21 +00:00
|
|
|
meta = with stdenv.lib; {
|
2014-07-22 21:18:24 +01:00
|
|
|
description = "A full-featured e-mail client";
|
2012-03-21 01:26:21 +00: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 13:55:06 +01:00
|
|
|
maintainers = [ maintainers.pierron maintainers.eelco ];
|
2012-10-05 21:15:56 +01:00
|
|
|
platforms = platforms.linux;
|
2012-03-21 01:26:21 +00:00
|
|
|
};
|
2016-12-25 08:35:20 +00:00
|
|
|
|
|
|
|
passthru.updateScript = import ./../../browsers/firefox/update.nix {
|
2017-01-04 22:38:55 +00:00
|
|
|
attrPath = "thunderbird";
|
2016-12-25 08:35:20 +00:00
|
|
|
baseUrl = "http://archive.mozilla.org/pub/thunderbird/releases/";
|
2017-01-04 22:38:55 +00:00
|
|
|
inherit writeScript lib common-updater-scripts xidel coreutils gnused gnugrep curl;
|
2016-12-25 08:35:20 +00:00
|
|
|
};
|
2012-03-21 01:26:21 +00:00
|
|
|
}
|