@@ -1,37 +1,36 @@
1−{ stdenv
2−, lib
3−, fetchzip
4−, writeScript
1+{ lib
2+, stdenv
53, alsa-lib
64, autoconf213
75, cairo
8−, desktop-file-utils
96, dbus
107, dbus-glib
8+, desktop-file-utils
9+, fetchzip
1110, ffmpeg
1211, fontconfig
1312, freetype
1413, gnome2
1514, gnum4
16−, gtk2
17−, libevent
1815, libGL
1916, libGLU
17+, libevent
2018, libnotify
2119, libpulseaudio
2220, libstartup_notification
21+, pango
2322, perl
2423, pkg-config
2524, python2
2625, unzip
2726, which
2827, wrapGAppsHook
28+, writeScript
2929, xorg
3030, yasm
3131, zip
3232, zlib
33−, withGTK3 ? true
34−, gtk3
33+, withGTK3 ? true, gtk3, gtk2
3534}:
3635
3736# Only specific GCC versions are supported with branding
@@ -43,38 +42,16 @@ assert with lib.strings; (
4342 && versionOlder stdenv.cc.version "11"
4443);
4544
46−let
47− libPath = lib.makeLibraryPath [
48− ffmpeg
49− libpulseaudio
50− ];
51− gtkVersion = if withGTK3 then "3" else "2";
52−in
5345stdenv.mkDerivation rec {
5446 pname = "palemoon";
55− version = "29.4.1";
47+ version = "29.4.2.1";
5648
5749 src = fetchzip {
58− url = "http://archive.palemoon.org/source/palemoon-${version}-source.tar.xz";
59− stripRoot = false;
60− sha256 = "0kb9yn1q8rrmnlsyvxvv2gdgyyf12g6rxlyh82lmc0gysvd4qd2c";
50+ name = "${pname}-${version}";
51+ url = "http://archive.palemoon.org/source/${pname}-${version}.source.tar.xz";
52+ sha256 = "sha256-iTn1jbbsw7u+rVe/1J9yJbS0wi5Rlkcy4rO8nWcXu2I=";
6153 };
6254
63− passthru.updateScript = writeScript "update-${pname}" ''
64− #!/usr/bin/env nix-shell
65− #!nix-shell -i bash -p common-updater-scripts curl libxml2
66−
67− set -eu -o pipefail
68−
69− # Only release note announcement == finalized release
70− version="$(
71− curl -s 'http://www.palemoon.org/releasenotes.shtml' |
72− xmllint --html --xpath 'html/body/table/tbody/tr/td/h3/text()' - 2>/dev/null | head -n1 |
73− sed 's/v\(\S*\).*/\1/'
74− )"
75− update-source-version ${pname} "$version"
76− '';
77−
7855 nativeBuildInputs = [
7956 autoconf213
8057 desktop-file-utils
@@ -99,12 +76,13 @@ stdenv.mkDerivation rec {
9976 freetype
10077 gnome2.GConf
10178 gtk2
102− libevent
10379 libGL
10480 libGLU
81+ libevent
10582 libnotify
10683 libpulseaudio
10784 libstartup_notification
85+ pango
10886 zlib
10987 ]
11088 ++ (with xorg; [
@@ -118,60 +96,30 @@ stdenv.mkDerivation rec {
11896 pixman
11997 xorgproto
12098 ])
121− ++ lib.optional withGTK3 gtk3;
99+ ++ lib.optionals withGTK3 [
100+ gtk3
101+ ];
122102
123103 enableParallelBuilding = true;
124104
105+ postPatch = ''
106+ patchShebangs ./mach
107+ '';
108+
125109 configurePhase = ''
126110 runHook preConfigure
127111
128112 export MOZCONFIG=$PWD/mozconfig
129113 export MOZ_NOSPAM=1
130114
131− # Keep this similar to the official .mozconfig file,
132− # only minor changes for portability are permitted with branding.
133− # https://developer.palemoon.org/build/linux/
134− echo > $MOZCONFIG '
135− # Clear this if not a 64bit build
136− _BUILD_64=${lib.optionalString stdenv.hostPlatform.is64bit "1"}
137−
138− # Set GTK Version to 2 or 3
139− _GTK_VERSION=${gtkVersion}
140−
141− # Standard build options for Pale Moon
142− ac_add_options --enable-application=palemoon
143− ac_add_options --enable-optimize="-O2 -w"
144− ac_add_options --enable-default-toolkit=cairo-gtk$_GTK_VERSION
145− ac_add_options --enable-jemalloc
146− ac_add_options --enable-strip
147− ac_add_options --enable-devtools
148− ac_add_options --enable-av1
149−
150− ac_add_options --disable-eme
151− ac_add_options --disable-webrtc
152− ac_add_options --disable-gamepad
153− ac_add_options --disable-tests
154− ac_add_options --disable-debug
155− ac_add_options --disable-necko-wifi
156− ac_add_options --disable-updater
157−
158− ac_add_options --with-pthreads
115+ export build64=${lib.optionalString stdenv.hostPlatform.is64bit "1"}
116+ export gtkversion=${if withGTK3 then "3" else "2"}
117+ export xlibs=${lib.makeLibraryPath [ xorg.libX11 ]}
118+ export prefix=$out
119+ export mozmakeflags="-j${if enableParallelBuilding then "$NIX_BUILD_CORES" else "1"}"
120+ export autoconf=${autoconf213}/bin/autoconf
159121
160− # Please see https://www.palemoon.org/redist.shtml for restrictions when using the official branding.
161− ac_add_options --enable-official-branding
162− export MOZILLA_OFFICIAL=1
163−
164− ac_add_options --x-libraries=${lib.makeLibraryPath [ xorg.libX11 ]}
165−
166− #
167− # NixOS-specific adjustments
168− #
169−
170− ac_add_options --prefix=$out
171−
172− mk_add_options MOZ_MAKE_FLAGS="-j${if enableParallelBuilding then "$NIX_BUILD_CORES" else "1"}"
173− mk_add_options AUTOCONF=${autoconf213}/bin/autoconf
174− '
122+ substituteAll ${./mozconfig} $MOZCONFIG
175123
176124 runHook postConfigure
177125 '';
@@ -212,14 +160,22 @@ stdenv.mkDerivation rec {
212160
213161 dontWrapGApps = true;
214162
215− preFixup = ''
216− gappsWrapperArgs+=(
217− --prefix LD_LIBRARY_PATH : "${libPath}"
218− )
163+ preFixup =
164+ let
165+ libPath = lib.makeLibraryPath [
166+ ffmpeg
167+ libpulseaudio
168+ ];
169+ in
170+ ''
171+ gappsWrapperArgs+=(
172+ --prefix LD_LIBRARY_PATH : "${libPath}"
173+ )
219174 wrapGApp $out/lib/palemoon-${version}/palemoon
220175 '';
221176
222177 meta = with lib; {
178+ homepage = "https://www.palemoon.org/";
223179 description = "An Open Source, Goanna-based web browser focusing on efficiency and customization";
224180 longDescription = ''
225181 Pale Moon is an Open Source, Goanna-based web browser focusing on
@@ -232,10 +188,24 @@ stdenv.mkDerivation rec {
232188 experience, while offering full customization and a growing collection of
233189 extensions and themes to make the browser truly your own.
234190 '';
235− homepage = "https://www.palemoon.org/";
236191 changelog = "https://repo.palemoon.org/MoonchildProductions/Pale-Moon/releases/tag/${version}_Release";
237192 license = licenses.mpl20;
238193 maintainers = with maintainers; [ AndersonTorres OPNA2608 ];
239194 platforms = [ "i686-linux" "x86_64-linux" ];
240195 };
196+
197+ passthru.updateScript = writeScript "update-${pname}" ''
198+ #!/usr/bin/env nix-shell
199+ #!nix-shell -i bash -p common-updater-scripts curl libxml2
200+
201+ set -eu -o pipefail
202+
203+ # Only release note announcement == finalized release
204+ version="$(
205+ curl -s 'http://www.palemoon.org/releasenotes.shtml' |
206+ xmllint --html --xpath 'html/body/table/tbody/tr/td/h3/text()' - 2>/dev/null | head -n1 |
207+ sed 's/v\(\S*\).*/\1/'
208+ )"
209+ update-source-version ${pname} "$version"
210+ '';
241211}