git.iko.soy/typeable/nixpkgs
on master help sign in
zotero: use private firefox and xulrunner

Zotero breaks every time firefox is updated (about every six weeks). It is always fixed with the next zotero update, but that can take weeks. Sometimes, upstream even skips firefox releases. This will stop zotero breaking every time.

commit5c9de384886667d487a109b615901e3ede02563a authorThomas Tuegel <ttuegel@gmail.com> dateThu 4 Dec 2014, 09:35 (12 years ago) parent0377be1
4 files changed+204−2
pkgs/applications/office/zotero/default.nix+12−1 pkgs/applications/office/zotero/firefox.nix+108 pkgs/applications/office/zotero/xulrunner.nix+80 pkgs/top-level/all-packages.nix+4−1
pkgs/applications/office/zotero/default.nix+12−1
@@ -1,8 +1,19 @@
1−{ stdenv, fetchurl, bash, xulrunner }:
1+{ stdenv, fetchurl, bash, callPackage, libIDL, pysqlite }:
22
33assert (stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux");
44
5+
56let
7+ /* Zotero always has a hard upper bound on its firefox/xulrunner dependency.
8+ * Use private versions of firefox and xulrunner to prevent breakage when the
9+ * system packages are updated. Please update these dependencies whenever
10+ * zotero is updated; it should be as simple as copying the system firefox
11+ * and xulrunner Nix expressions into place.
12+ */
13+ firefox = callPackage ./firefox.nix { inherit libIDL pysqlite; };
14+ xulrunner = callPackage ./xulrunner.nix { inherit libIDL pysqlite firefox; };
15+
16+ # Please update the firefox and xulrunner dependencies when zotero is updated!
617 version = "4.0.23";
718 arch = if stdenv.system == "x86_64-linux"
819 then "linux-x86_64"
pkgs/applications/office/zotero/firefox.nixnew file+108
@@ -0,0 +1,108 @@
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
7+, debugBuild ? false
8+, # If you want the resulting program to call itself "Firefox" instead
9+ # of "Shiretoko" or whatever, enable this option. However, those
10+ # binaries may not be distributed without permission from the
11+ # Mozilla Foundation, see
12+ # http://www.mozilla.org/foundation/trademarks/.
13+ enableOfficialBranding ? false
14+}:
15+
16+assert stdenv.gcc ? libc && stdenv.gcc.libc != null;
17+
18+let version = "33.1.1"; in
19+
20+stdenv.mkDerivation rec {
21+ name = "firefox-${version}";
22+
23+ src = fetchurl {
24+ url = "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${version}/source/firefox-${version}.source.tar.bz2";
25+ sha1 = "1e9e3176e7d221c4f2ce479f37ee7c432236a0ec";
26+ };
27+
28+ buildInputs =
29+ [ pkgconfig gtk perl zip libIDL libjpeg zlib bzip2
30+ python dbus dbus_glib pango freetype fontconfig xlibs.libXi
31+ xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt file
32+ alsaLib nspr nss libnotify xlibs.pixman yasm mesa
33+ xlibs.libXScrnSaver xlibs.scrnsaverproto pysqlite
34+ xlibs.libXext xlibs.xextproto sqlite unzip makeWrapper
35+ hunspell libevent libstartup_notification libvpx cairo
36+ gstreamer gst_plugins_base icu
37+ ];
38+
39+ configureFlags =
40+ [ "--enable-application=browser"
41+ "--disable-javaxpcom"
42+ "--with-system-jpeg"
43+ "--with-system-zlib"
44+ "--with-system-bz2"
45+ "--with-system-nspr"
46+ "--with-system-nss"
47+ "--with-system-libevent"
48+ "--with-system-libvpx"
49+ # "--with-system-png" # needs APNG support
50+ # "--with-system-icu" # causes ‘ar: invalid option -- 'L'’ in Firefox 28.0
51+ "--enable-system-ffi"
52+ "--enable-system-hunspell"
53+ "--enable-system-pixman"
54+ "--enable-system-sqlite"
55+ "--enable-system-cairo"
56+ "--enable-gstreamer"
57+ "--enable-startup-notification"
58+ # "--enable-content-sandbox" # available since 26.0, but not much info available
59+ # "--enable-content-sandbox-reporter" # keeping disabled for now
60+ "--disable-crashreporter"
61+ "--disable-tests"
62+ "--disable-necko-wifi" # maybe we want to enable this at some point
63+ "--disable-installer"
64+ "--disable-updater"
65+ "--disable-pulseaudio"
66+ ]
67+ ++ (if debugBuild then [ "--enable-debug" "--enable-profiling"]
68+ else [ "--disable-debug" "--enable-release"
69+ "--enable-optimize${lib.optionalString (stdenv.system == "i686-linux") "=-O1"}"
70+ "--enable-strip" ])
71+ ++ lib.optional enableOfficialBranding "--enable-official-branding";
72+
73+ enableParallelBuilding = true;
74+
75+ preConfigure =
76+ ''
77+ mkdir ../objdir
78+ cd ../objdir
79+ configureScript=../mozilla-release/configure
80+ '';
81+
82+ preInstall =
83+ ''
84+ # The following is needed for startup cache creation on grsecurity kernels.
85+ paxmark m ../objdir/dist/bin/xpcshell
86+ '';
87+
88+ postInstall =
89+ ''
90+ # For grsecurity kernels
91+ paxmark m $out/lib/${name}/{firefox,firefox-bin,plugin-container}
92+
93+ # Remove SDK cruft. FIXME: move to a separate output?
94+ rm -rf $out/share/idl $out/include $out/lib/firefox-devel-*
95+ '';
96+
97+ meta = {
98+ description = "Web browser";
99+ homepage = http://www.mozilla.com/en-US/firefox/;
100+ maintainers = with lib.maintainers; [ eelco ];
101+ platforms = lib.platforms.linux;
102+ };
103+
104+ passthru = {
105+ inherit gtk nspr version;
106+ isFirefox3Like = true;
107+ };
108+}
pkgs/applications/office/zotero/xulrunner.nixnew file+80
@@ -0,0 +1,80 @@
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+
10+assert stdenv.gcc ? libc && stdenv.gcc.libc != null;
11+
12+let version = firefox.version; in
13+
14+stdenv.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+}
pkgs/top-level/all-packages.nix+4−1
@@ -11407,7 +11407,10 @@ let
1140711407 pygtk = pyGtkGlade;
1140811408 };
1140911409
11410− zotero = callPackage ../applications/office/zotero { };
11410+ zotero = callPackage ../applications/office/zotero {
11411+ inherit (gnome) libIDL;
11412+ inherit (pythonPackages) pysqlite;
11413+ };
1141111414
1141211415 zynaddsubfx = callPackage ../applications/audio/zynaddsubfx { };
1141311416