diff --git a/pkgs/applications/networking/mailreaders/thunderbird/3.x.nix b/pkgs/applications/networking/mailreaders/thunderbird/3.x.nix index 5381c65f516..101caa6825d 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/3.x.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird/3.x.nix @@ -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 <