* Thunderbird 3.0. It doesn't use the Xulrunner package, as building

against an external Xulrunner seems to be unsupported currently.

svn path=/nixpkgs/trunk/; revision=19169
This commit is contained in:
Eelco Dolstra 2010-01-02 13:21:50 +00:00
parent 0dc9f7dd4f
commit 05fce85edc
4 changed files with 52 additions and 98 deletions

View File

@ -1,10 +1,8 @@
{ stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL
, libjpeg, zlib, cairo, dbus, dbus_glib, bzip2
, freetype, fontconfig, xulrunner
, autoconf , libpng , alsaLib, sqlite, patchelf
{ stdenv, fetchurl, pkgconfig, gtk, perl, python, zip, libIDL
, dbus_glib, bzip2, alsaLib, nspr
, # If you want the resulting program to call itself "Thunderbird"
# instead of "Mail", enable this option. However, those
# instead of "Shredder", enable this option. However, those
# binaries may not be distributed without permission from the
# Mozilla Foundation, see
# http://www.mozilla.org/foundation/trademarks/.
@ -12,94 +10,56 @@
}:
let version = "3.0"; in
stdenv.mkDerivation {
name = "thunderbird-3.0beta2";
name = "thunderbird-${version}";
src = fetchurl {
url = "ftp://ftp.mozilla.org/pub/thunderbird/releases/3.0b2/source/thunderbird-3.0b2-source.tar.bz2";
sha256 = "17mlp0x6sf1v9w8vraln7mr566gvk84rxvxiwzhbdj2p0475zjqr";
url = "http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.bz2";
sha1 = "7a8a08f011901b4c0b737de2d7a226242935543d";
};
buildInputs = [
pkgconfig gtk perl zip libIDL libjpeg zlib cairo bzip2
python dbus dbus_glib pango freetype fontconfig autoconf
libpng alsaLib sqlite patchelf
];
buildInputs =
[ pkgconfig perl python zip bzip2 gtk dbus_glib alsaLib libIDL nspr ];
propagatedBuildInputs = [xulrunner];
configureFlags =
[ "--enable-application=mail"
"--enable-optimize"
"--disable-debug"
"--enable-strip"
"--with-system-jpeg"
"--with-system-zlib"
"--with-system-bz2"
"--with-system-nspr"
"--enable-system-cairo"
"--disable-crashreporter"
"--disable-tests"
"--enable-static" # required by `make install'
]
++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
preUnpack = "mkdir thunderbird; cd thunderbird;";
setSourceRoot = "export sourceRoot=.;";
preConfigure = ''
for i in $(find . -name configure.in); do echo $i; (cd $(dirname $i); autoconf || true; ); done;
XUL_SDK=$(echo ${xulrunner}/lib/xulrunner-devel-*/)
export NIX_CFLAGS_COMPILE="''${NIX_CFLAGS_COMPILE} -I$XUL_SDK/include";
export NIX_CFLAGS_COMPILE="''${NIX_CFLAGS_COMPILE} -I$(echo ${xulrunner}/include/xulrunner-*/stable)";
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE";
export NIX_LDFLAGS="''${NIX_LDFLAGS} -L$XUL_SDK/lib -L$XUL_SDK/sdk/lib";
export NIX_LDFLAGS="$NIX_LDFLAGS -L${xulrunner}/lib/xulrunner-${xulrunner.version}";
export NIX_LDFLAGS="$NIX_LDFLAGS -lxpcomglue -lxpcomglue_s -lxul -lnss -lmozjs -lsqlite3";
echo NIX_CFLAGS_COMPILE: $NIX_CFLAGS_COMPILE
echo NIX_LDFLAGS: $NIX_LDFLAGS
for i in $(find $(pwd) -wholename '*/public/*.idl' -exec dirname '{}' ';' | sort | uniq); do
export XPIDL_FLAGS="$XPIDL_FLAGS -I$i";
done;
echo $XPIDL_FLAGS
# The Thunderbird Makefiles refer to the variables LIBXUL_DIST,
# prefix, and PREFIX in some places where they are not set. In
# 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";
sed -e "s@\$(XPIDL_FLAGS)@\$(XPIDL_FLAGS) $XPIDL_FLAGS@" -i config/rules.mk
'';
postConfigure = ''
(cd mozilla/nsprpub; ./configure --prefix=$out/XUL_SDK; )
'';
preBuild = ''
for i in $(find . -name autoconf.mk); do echo $i; sed -e 's@-Wl,-rpath-link,$(PREFIX)/lib@@' -i $i; done
make -C mozilla/config nsinstall
mkdir -p $out/libexec/mozilla/nsinstall
mv mozilla/config/nsinstall $out/libexec/mozilla/nsinstall/nsinstall
cat > mozilla/config/nsinstall <<EOF
#! /bin/sh
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${sqlite}/lib:${xulrunner}/lib/xulrunner-${xulrunner.version}"
$out/libexec/mozilla/nsinstall/nsinstall "\$@"
EOF
chmod a+x mozilla/config/nsinstall
'';
configureFlags = [
"--enable-application=mail"
"--enable-optimize"
"--disable-debug"
"--with-system-jpeg"
"--with-system-zlib"
"--with-system-bz2"
#"--with-system-png" # <-- "--with-system-png won't work because the system's libpng doesn't have APNG support"
"--enable-system-cairo"
#"--enable-system-sqlite" # <-- this seems to be discouraged
"--disable-crashreporter"
"--with-libxul-sdk=${xulrunner}/lib/xulrunner-devel-${xulrunner.version}"
"--enable-extensions=default"
]
++ (if enableOfficialBranding then ["--enable-official-branding"] else []);
postInstall = ''
# Strip some more stuff.
strip -S $out/lib/*/* || true
libDir=$(cd $out/lib && ls -d thunderbird-[0-9]*)
test -n "$libDir"
# This doesn't work:
#makeFlags = "LIBXUL_DIST=$(out) prefix=$(out) PREFIX=$(out)";
ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} $out/lib/$libDir/xulrunner
# Register extensions etc. !!! is this needed anymore?
echo "running thunderbird -register..."
$out/bin/thunderbird -register
''; # */
postInstall =
''
# Fix some references to /bin paths in the Xulrunner shell script.
substituteInPlace $out/lib/thunderbird-*/thunderbird \
--replace /bin/pwd "$(type -tP pwd)" \
--replace /bin/ls "$(type -tP ls)"
'';
meta = {
description = "Mozilla Thunderbird, a full-featured email client";
homepage = http://www.mozilla.com/en-US/thunderbird/;
};
passthru = {
inherit gtk;
};
}

View File

@ -10,11 +10,11 @@ let
in
stdenv.mkDerivation {
name = "nss-3.12.4";
name = "nss-3.12.5";
src = fetchurl {
url = http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_12_4_RTM/src/nss-3.12.4.tar.gz;
sha1 = "a152bf980f3a3dcf575c2d149fb279058ef2e757";
url = http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_12_5_RTM/src/nss-3.12.5.tar.gz;
sha1 = "ec12c6eddba5fb4609a174b079095b374935d37c";
};
buildInputs = [nspr perl zlib];

View File

@ -7516,27 +7516,20 @@ let
inherit fetchurl stdenv;
};
thunderbird = import ../applications/networking/mailreaders/thunderbird/2.x.nix {
thunderbird = thunderbird2;
thunderbird2 = import ../applications/networking/mailreaders/thunderbird/2.x.nix {
inherit fetchurl stdenv pkgconfig perl zip libjpeg libpng zlib cairo;
inherit (gtkLibs) gtk;
inherit (gnome) libIDL;
inherit (xlibs) libXi;
#enableOfficialBranding = true;
};
/*
Despaired. Looks like ThunderBird-on-Firefox's-Xulrunner is non-trivial
thunderbird3 = lowPrio (import ../applications/networking/mailreaders/thunderbird/3.x.nix {
inherit fetchurl stdenv pkgconfig perl zip libjpeg zlib cairo
python dbus dbus_glib freetype fontconfig bzip2 libpng alsaLib sqlite
patchelf nspr;
inherit (gtkLibs) gtk pango;
inherit fetchurl stdenv pkgconfig perl python dbus_glib zip bzip2 alsaLib nspr;
inherit (gtkLibs) gtk;
inherit (gnome) libIDL;
#enableOfficialBranding = true;
xulrunner = xulrunner35;
autoconf = autoconf213;
});*/
});
timidity = import ../tools/misc/timidity {
inherit fetchurl stdenv lib alsaLib composableDerivation jackaudio ncurses;

View File

@ -373,7 +373,8 @@ in {
texLiveBeamer = linux;
texLiveExtra = linux;
texinfo = all;
thunderbird = linux;
thunderbird2 = linux;
thunderbird3 = linux;
tightvnc = linux;
time = linux;
tinycc = ["i686-linux"];