1{ lib, stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL
2, libjpeg, zlib, dbus, dbus_glib, bzip2, xlibs
3, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
4, yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
5, hunspell, libevent, libstartup_notification, libvpx
6, cairo, gstreamer, gst_plugins_base, icu, firefox
7, debugBuild ? false
8}:
9
10assert stdenv.cc ? libc && stdenv.cc.libc != null;
11
12let version = firefox.version; in
13
14stdenv.mkDerivation rec {
15 name = "xulrunner-${version}";
16
17 src = firefox.src;
18
19 buildInputs =
20 [ pkgconfig gtk perl zip libIDL libjpeg zlib bzip2
21 python dbus dbus_glib pango freetype fontconfig xlibs.libXi
22 xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt file
23 alsaLib nspr nss libnotify xlibs.pixman yasm mesa
24 xlibs.libXScrnSaver xlibs.scrnsaverproto pysqlite
25 xlibs.libXext xlibs.xextproto sqlite unzip makeWrapper
26 hunspell libevent libstartup_notification libvpx cairo
27 gstreamer gst_plugins_base icu
28 ];
29
30 configureFlags =
31 [ "--enable-application=xulrunner"
32 "--disable-javaxpcom"
33 "--with-system-jpeg"
34 "--with-system-zlib"
35 "--with-system-bz2"
36 "--with-system-nspr"
37 "--with-system-nss"
38 "--with-system-libevent"
39 "--with-system-libvpx"
40 # "--with-system-png" # needs APNG support
41 # "--with-system-icu" # causes ‘ar: invalid option -- 'L'’ in Firefox 28.0
42 "--enable-system-ffi"
43 "--enable-system-hunspell"
44 "--enable-system-pixman"
45 "--enable-system-sqlite"
46 "--enable-system-cairo"
47 "--enable-gstreamer"
48 "--enable-startup-notification"
49 # "--enable-content-sandbox" # available since 26.0, but not much info available
50 # "--enable-content-sandbox-reporter" # keeping disabled for now
51 "--disable-crashreporter"
52 "--disable-tests"
53 "--disable-necko-wifi" # maybe we want to enable this at some point
54 "--disable-installer"
55 "--disable-updater"
56 "--disable-pulseaudio"
57 ]
58 ++ (if debugBuild
59 then [ "--enable-debug" "--enable-profiling"]
60 else [ "--disable-debug" "--enable-release" "--enable-strip"
61 "--enable-optimize${lib.optionalString (stdenv.system == "i686-linux") "=-O1"}" ]);
62
63 enableParallelBuilding = true;
64
65 preConfigure =
66 ''
67 mkdir ../objdir
68 cd ../objdir
69 configureScript=../mozilla-release/configure
70 '';
71
72 meta = {
73 description = "Mozilla Firefox XUL runner";
74 homepage = http://www.mozilla.com/en-US/firefox/;
75 maintainers = [ lib.maintainers.eelco ];
76 platforms = lib.platforms.linux;
77 };
78
79 passthru = { inherit gtk version; };
80}