summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2010-01-02 13:21:50 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2010-01-02 13:21:50 +0000
commit05fce85edcd789ce5d77460fbf5f0dc687738287 (patch)
tree7246852c9b992f905ad87c7020863b9a68a734dc /pkgs/applications
parent0dc9f7dd4fa529426e9f03d5c833b0fdf8bcea2f (diff)
downloadnixlib-05fce85edcd789ce5d77460fbf5f0dc687738287.tar
nixlib-05fce85edcd789ce5d77460fbf5f0dc687738287.tar.gz
nixlib-05fce85edcd789ce5d77460fbf5f0dc687738287.tar.bz2
nixlib-05fce85edcd789ce5d77460fbf5f0dc687738287.tar.lz
nixlib-05fce85edcd789ce5d77460fbf5f0dc687738287.tar.xz
nixlib-05fce85edcd789ce5d77460fbf5f0dc687738287.tar.zst
nixlib-05fce85edcd789ce5d77460fbf5f0dc687738287.zip
* 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
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/3.x.nix122
1 files changed, 41 insertions, 81 deletions
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/3.x.nix b/pkgs/applications/networking/mailreaders/thunderbird/3.x.nix
index 5381c65f5160..101caa6825d2 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
-  ];
-
-  propagatedBuildInputs = [xulrunner];
-
-  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
-
-    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
-  '';
+  buildInputs =
+    [ pkgconfig perl python zip bzip2 gtk dbus_glib alsaLib libIDL nspr ];
 
-  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 []);
+  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";
 
-  postInstall = ''
-    # Strip some more stuff.
-    strip -S $out/lib/*/* || true
+  # 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";
 
-    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;
-  };
 }