1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
6 ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
8 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
9 ;;; Copyright © 2017, 2018 Nikita <nikita@n0.is>
10 ;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
13 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
14 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
15 ;;; Copyright © 2019, 2020 Adrian Malacoda <malacoda@monarch-pass.net>
16 ;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages gnuzilla)
34 #:use-module ((srfi srfi-1) #:hide (zip))
35 #:use-module (ice-9 match)
36 #:use-module (gnu packages)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix packages)
39 #:use-module (guix download)
40 #:use-module (guix git-download)
41 #:use-module (guix hg-download)
42 #:use-module (guix gexp)
43 #:use-module (guix store)
44 #:use-module (guix monads)
45 #:use-module (guix utils)
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system cargo)
48 #:use-module (guix build-system trivial)
49 #:use-module (gnu packages admin)
50 #:use-module (gnu packages audio)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages bash)
54 #:use-module (gnu packages databases)
55 #:use-module (gnu packages glib)
56 #:use-module (gnu packages gtk)
57 #:use-module (gnu packages gnome)
58 #:use-module (gnu packages libcanberra)
59 #:use-module (gnu packages cups)
60 #:use-module (gnu packages kerberos)
61 #:use-module (gnu packages linux)
62 #:use-module (gnu packages perl)
63 #:use-module (gnu packages pkg-config)
64 #:use-module (gnu packages compression)
65 #:use-module (gnu packages fontutils)
66 #:use-module (gnu packages libevent)
67 #:use-module (gnu packages libreoffice) ;for hunspell
68 #:use-module (gnu packages image)
69 #:use-module (gnu packages libffi)
70 #:use-module (gnu packages pulseaudio)
71 #:use-module (gnu packages python)
72 #:use-module (gnu packages python-xyz)
73 #:use-module (gnu packages node)
74 #:use-module (gnu packages xorg)
75 #:use-module (gnu packages gl)
76 #:use-module (gnu packages assembly)
77 #:use-module (gnu packages rust)
78 #:use-module (gnu packages rust-apps)
79 #:use-module (gnu packages llvm)
80 #:use-module (gnu packages nss)
81 #:use-module (gnu packages icu4c)
82 #:use-module (gnu packages video)
83 #:use-module (gnu packages xiph)
84 #:use-module (gnu packages xdisorg)
85 #:use-module (gnu packages readline)
86 #:use-module (gnu packages sqlite))
95 "https://ftp.mozilla.org/pub/mozilla.org/js/"
96 name version ".tar.gz"))
99 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))
100 (patches (search-patches "mozjs17-aarch64-support.patch"))
101 (modules '((guix build utils)))
103 ;; Fix incompatibility with Perl 5.22+.
105 (substitute* '("js/src/config/milestone.pl")
106 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE"))
108 (build-system gnu-build-system)
111 ("pkg-config" ,pkg-config)
112 ("python" ,python-2)))
114 `(("nspr" ,nspr))) ; in the Requires.private field of mozjs-17.0.pc
118 `(;; XXX: parallel build fails, lacking:
119 ;; mkdir -p "system_wrapper_js/"
121 #:make-flags '("CXXFLAGS=-fpermissive")
123 (modify-phases %standard-phases
124 (add-after 'unpack 'delete-timedout-test
125 ;; This test times out on slower hardware.
127 (delete-file "js/src/jit-test/tests/basic/bug698584.js")
129 (add-before 'configure 'chdir
134 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
135 (lambda* (#:key outputs #:allow-other-keys)
136 (let ((out (assoc-ref outputs "out")))
137 (setenv "SHELL" (which "sh"))
138 (setenv "CONFIG_SHELL" (which "sh"))
139 (invoke "./configure" (string-append "--prefix=" out)
140 ,@(if (string=? "aarch64-linux"
142 '("--host=aarch64-unknown-linux-gnu")
145 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey")
146 (synopsis "Mozilla javascript engine")
147 (description "SpiderMonkey is Mozilla's JavaScript engine written
149 (license license:mpl2.0))) ; and others for some files
151 (define-public mozjs-24
152 (package (inherit mozjs)
158 "https://ftp.mozilla.org/pub/mozilla.org/js/"
159 name "-" version ".tar.bz2"))
162 "1n1phk8r3l8icqrrap4czplnylawa0ddc2cc4cgdz46x3lrkybz6"))
163 (modules '((guix build utils)))
164 (patches (search-patches "mozjs24-aarch64-support.patch"))
166 ;; Fix incompatibility with Perl 5.22+.
168 (substitute* '("js/src/config/milestone.pl")
169 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE"))
172 (substitute-keyword-arguments (package-arguments mozjs)
174 `(modify-phases ,phases
176 (lambda* (#:key outputs #:allow-other-keys)
177 (let ((out (assoc-ref outputs "out")))
178 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
179 (setenv "SHELL" (which "sh"))
180 (setenv "CONFIG_SHELL" (which "sh"))
181 (invoke "./configure"
182 (string-append "--prefix=" out)
184 "--enable-system-ffi"
185 "--enable-threadsafe"
186 ,@(if (string=? "aarch64-linux"
188 '("--host=aarch64-unknown-linux-gnu")
194 (define-public mozjs-38
198 (version "38.2.1.rc0")
202 "https://anduin.linuxfromscratch.org/BLFS/mozjs/"
203 name "-" version ".tar.bz2"))
206 "0p4bmbpgkfsj54xschcny0a118jdrdgg0q29rwxigg3lh5slr681"))
209 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1269317 for
210 ;; GCC 6 compatibility.
212 "mozjs38-version-detection.patch" ; for 0ad
213 "mozjs38-tracelogger.patch"
215 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1339931.
216 "mozjs38-pkg-config-version.patch"
217 "mozjs38-shell-version.patch"))
218 (modules '((guix build utils)))
221 ;; Fix incompatibility with sed 4.4.
222 (substitute* "js/src/configure"
223 (("\\^\\[:space:\\]") "^[[:space:]]"))
225 ;; The headers are symlinks to files that are in /tmp, so they
226 ;; end up broken. Copy them instead.
228 "python/mozbuild/mozbuild/backend/recursivemake.py"
229 (("\\['dist_include'\\].add_symlink")
230 "['dist_include'].add_copy"))
232 ;; Remove bundled libraries.
233 (for-each delete-file-recursively
235 "js/src/ctypes/libffi"
236 "js/src/ctypes/libffi-patches"
240 `(;; XXX: parallel build fails, lacking:
241 ;; mkdir -p "system_wrapper_js/"
243 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1008470.
246 (modify-phases %standard-phases
248 (lambda* (#:key outputs #:allow-other-keys)
249 (let ((out (assoc-ref outputs "out")))
251 (setenv "SHELL" (which "sh"))
252 (setenv "CONFIG_SHELL" (which "sh"))
253 (invoke "./configure"
254 (string-append "--prefix=" out)
256 "--enable-gcgenerational"
261 "--enable-system-ffi"
262 "--enable-threadsafe"
263 "--enable-xterm-updates"
268 ;; Intl API requires bundled ICU.
269 "--without-intl-api")))))))
272 ("pkg-config" ,pkg-config)
273 ("python-2" ,python-2)))
276 ("readline" ,readline)
280 (define-public mozjs-52
281 ;; No releases yet at <https://archive.mozilla.org/pub/spidermonkey/releases/>.
282 ;; While we could take a snapshot of the complete mozilla-esr52 repository at
283 ;; <https://treeherder.mozilla.org/#/jobs?repo=mozilla-esr52&filter-searchStr=sm-tc>,
284 ;; we take the Debian version instead, because it is easier to work with.
285 (let ((commit "6507e63cc416fd7a3269e390efe712f8b56f374a")
287 (package (inherit mozjs-38)
288 (version (git-version "52.0" revision commit))
292 (url "https://salsa.debian.org/gnome-team/mozjs52.git")
294 (file-name (git-file-name "mozjs" version))
297 "1ny0s53r8wn4byys87h784xrq1xg767akmfm6gqrbvrz57mlm3q2"))))
299 `(#:tests? #f ; depends on repository metadata
306 "--enable-system-ffi"
311 ;; Intl API requires bundled ICU.
314 ;; Without this gnome-shell will crash at runtime.
315 "--disable-jemalloc")
317 (modify-phases %standard-phases
318 (add-after 'unpack 'patch-and-chdir
319 (lambda* (#:key inputs #:allow-other-keys)
320 ;; This patch prevents a segfault when executing JS_Init().
321 ;; The build does not fail without this patch, but the
322 ;; configure phase of the gjs package would fail.
323 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1176787
324 (make-file-writable "js/src/old-configure.in")
325 (make-file-writable "js/src/old-configure")
326 (make-file-writable "mozglue/build/moz.build")
327 (invoke "patch" "-p1" "--force"
328 "--input" "debian/patches/disable-mozglue.patch")
329 (invoke "touch" "js/src/configure")
333 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
334 ;; The configure script does not accept environment variables
336 (let ((out (assoc-ref outputs "out")))
337 (setenv "SHELL" (which "sh"))
338 (setenv "CONFIG_SHELL" (which "sh"))
339 (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf")
341 (apply invoke "./configure"
342 (cons (string-append "--prefix=" out)
343 configure-flags))))))))
345 `(("autoconf" ,autoconf-2.13)
346 ("automake" ,automake)
347 ,@(package-native-inputs mozjs-38))))))
349 (define-public mozjs-60
350 ;; No releases yet at <https://archive.mozilla.org/pub/spidermonkey/releases/>.
351 ;; While we could take a snapshot of the complete mozilla-esr60 repository at
352 ;; <https://treeherder.mozilla.org/#/jobs?repo=mozilla-esr60&filter-searchStr=sm-tc>,
353 ;; we take the Debian version instead, because it is easier to work with.
360 (url "https://salsa.debian.org/gnome-team/mozjs60.git")
361 (commit (string-append "debian/" version))))
362 (file-name (git-file-name "mozjs" version))
365 "091w050rwzrdcbgyi934k2viyccmlqxrp13sm2mql71mabb5dai6"))))
367 `(#:tests? #f ; FIXME: all tests pass, but then the check phase fails anyway.
368 #:test-target "check-jstests"
375 "--enable-system-ffi"
380 ;; This is important because without it gjs will segfault during the
381 ;; configure phase. With jemalloc only the standalone mozjs console
383 "--disable-jemalloc")
385 (modify-phases %standard-phases
387 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
388 ;; The configure script does not accept environment variables as
389 ;; arguments. It also must be run from a different directory,
390 ;; but not the root directory either.
391 (let ((out (assoc-ref outputs "out")))
392 (mkdir "run-configure-from-here")
393 (chdir "run-configure-from-here")
394 (setenv "SHELL" (which "sh"))
395 (setenv "CONFIG_SHELL" (which "sh"))
396 (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf")
398 (apply invoke "../js/src/configure"
399 (cons (string-append "--prefix=" out)
402 (add-after 'unpack 'disable-broken-tests
404 ;; This test assumes that /bin exists and contains certain
406 (delete-file "js/src/tests/shell/os.js")
409 `(("autoconf" ,autoconf)
410 ("automake" ,automake)
413 ("pkg-config" ,pkg-config)
414 ("python" ,python-2)))))
416 (define mozilla-compare-locales
420 (url "https://hg.mozilla.org/l10n/compare-locales/")
421 (changeset "RELEASE_8_0_0")))
422 (file-name "mozilla-compare-locales")
423 (sha256 (base32 "0052wq92sg4i776x407b5838jx9h3phl9xy69m2q34f31n3gdyk2"))))
425 (define (mozilla-locale locale changeset hash-string)
429 (url (string-append "https://hg.mozilla.org/l10n-central/"
431 (changeset changeset)))
432 (file-name (string-append "mozilla-locale-" locale))
433 (sha256 (base32 hash-string))))
435 (define-syntax-rule (mozilla-locales (hash-string changeset locale) ...)
436 (list (mozilla-locale locale changeset hash-string)
439 (define all-mozilla-locales
441 ;; sha256 changeset locale
442 ;;---------------------------------------------------------------------------
443 ("1q1p7nl97478hkf1msbbcdh98k6fn87xwqihbw8np00ll5gk9k4v" "97cf3c155484" "ach")
444 ("0sajpblp639l448xywx7xlybjr5dm0rfrzx511a8pa9wn7dma4mf" "46929b4dda4e" "af")
445 ("04s756aaf1yyli1dn1vfdjymgyjs1pz2n7jvz76j27x4nzdgss7l" "96ffd2b04ba3" "an")
446 ("16nw7slm7irsnjf81r6zl273kbzri8sdbimzgzxwm0vh6xr61rgs" "1c4231166ddf" "ar")
447 ("0i0qrj4j8zjv55cisbmr21dp8mz933hc9wkpn3abz5k5pn84gpry" "bc4384b8be78" "ast")
448 ("1r77mmwg9x1jfa7g5lqa31rgyfrnix1zj80ibn5rq9gyhhsdrwbd" "dd56aead51fa" "az")
449 ("1kzjpy5bnvps8di72ksynhbhc9bpw1ml6hvphm74z8dz55ai4c18" "9d2bff64ddfb" "be")
450 ("1fygvjgph3siknfm7l0fh9y4ava72z1rxkip1zgmcdgq7jz8wzpf" "3808f4fe4db6" "bg")
451 ("1x9nlqia441xh04rhkmkw6qrgpwnyqw0grrf5n2qw96939wnmgl7" "5ca8752ed8df" "bn")
452 ("18yyxqzab44bgqx7h052d5nxyhv0l5bidgr16z1b3ak2crsfyx9q" "4c5d30ca9bf2" "br")
453 ("11bschjz7pgsm4r1qan5l4s3nkzm5jb0kivpp186wd1xsjci5bjb" "cf2478a7eae1" "bs")
454 ("12bak64nl6qi092l55xv330vh38mfsicrrf4wi693nn7zqb3mbpw" "4aa2cc349211" "ca")
455 ("0p97d7pnxqs971rr5c57i6cw3mx1mp3iasa0xdmdk0zpz9pjd3s4" "806914072144" "ca-valencia")
456 ("1rligf98h9r16mw3r3n5jalzi74xn2dnh6hkiixp7s2bvhjicwa4" "db2163383129" "cak")
457 ("18y5j8ljh72mj2nbx0m64mi3fyjbwyx992i004sv3zvs4d4z18w4" "d1d09eedddde" "cs")
458 ("12i4m9q6f8sl8arm8ja4gs4sl9m59p3kddlqi68srpz9mk66rqxz" "1caf58c64227" "cy")
459 ("16wacsd23zd4j0yi6vbj033wylia8hlpswx949x5hy1h9817j4vn" "9ef3b56aa243" "da")
460 ("1ddxnqpfi1wnciwmzkvvjinb51h22bg70r0dn7db17q64p4271rk" "a050b0eaec0a" "de")
461 ("0gw5h52rw3bc2lwffnv845sjwwj22gmabchmpa1rw2y6087dc7zk" "613135cb0759" "dsb")
462 ("0v17da37w1kbs73i6xql4c9xng6rfachyylpy3w8hpibpvi7i30n" "903db7c76b31" "el")
463 ("0ky1nj4kp070nriw0igsa64l39plcv2365zl8lqpbydyp6clwc3m" "6bb74673e9aa" "en-CA")
464 ("15jck6si2l4h5lrs8zjx56y97p70njpi26nnq6xfmvj1dk5qb4g2" "c06bd83a9295" "en-GB")
465 ("1gc400n8j8qk70vdw7fkf4m9yviia35cmj6361pxnyvsjrgm4qvm" "ae0fda5114c4" "eo")
466 ("0y01lahdrd3krsh6nrr3iw36r2x4advh5qw54vf92w11l3aiyvfz" "0c294dc9ce40" "es-AR")
467 ("16jjbsfa62dxk36ccziv7nmh26c1s0b05960in6zs5nnfrv4yh35" "7c30b2981fb4" "es-CL")
468 ("0qh8c8f8dsv1v56n1mcpn84l39bpnqfl8v8iacq12zh322srr549" "ad1444f4f833" "es-ES")
469 ("1vh3hm5r4ch6mk3ymbk12b9rppwc75fmbi0i7cml82kxsi77bzw5" "0a26cdb23536" "es-MX")
470 ("159l92jxx48lgba1g8ig3mdzhwsf3jpg3nx1g9blq4majk5hqr6q" "65a38a830795" "et")
471 ("1ha8y1wbgb66dqm26x1q2xwygy7bblkjz40y9vh5d2qlpr3fn0av" "21e0930b221d" "eu")
472 ("0rq4pcw6klm0bbljm1wdfvna8bpa35cm47hh2s63i2xdax4scahf" "5a4bb020cf09" "fa")
473 ("1py2594gsvpgrxnplz278ffb7grsf384kzjskrl1zyps0jw8fb1x" "4a4f712cd4aa" "ff")
474 ("1dyd55ngsglp1w2gh0yaacwb0vsq23gdvnj76f2x6g39h1li9s0z" "9c51cd915e2b" "fi")
475 ("0kimwivpq6pr63jh1k9fszsv8bi8vns3scg76mmnvbhh2ca8q7wj" "4f9e24a696ee" "fr")
476 ("1sbbnnp12lgy5qan2kix02942830b1969bd7jxrv7piwqfch9i06" "9e21a0eeb5b1" "fy-NL")
477 ("0dsvvyfrzkx5h44gqgdci7arb8h4lq48w20cnr8fc7j17grvnkzz" "999a995bc09d" "ga-IE")
478 ("1487msbsgrfzmyijhf6a4wbqdjpd7b7ki9nwrjjjjlnbw0h0ljpb" "6a9ddcab3240" "gd")
479 ("1kzc4fwr18kgisdzba2acj1ag8mxbifqpk5p30jv68nmvqfsvl8d" "51eb5e352db9" "gl")
480 ("13gy3wn44kcxr7j3sbl69fp415875f4vb0gm91hx0fysqlvryhcs" "b9de1ffe3224" "gn")
481 ("0w5nvzpjn5vr35c1852rlff581vpy71nc096cz125852kyqkzkc3" "5b3307475ada" "gu-IN")
482 ("1ycakc4qpy9vcy50j3ricryjfnjr9v3a5ijj6bbfl4y6aks157fy" "c742df968ffd" "he")
483 ("1b2jf83c500wm5wcdnijq0b7y4m8n6271smq8pygahn5nq17f0gq" "1a3039a52b8a" "hi-IN")
484 ("19bbw8ix5m83cf4yarcmjl7jqa8xfabwqnh3nj6vi52rwvn7whk5" "8dc50e269ef3" "hr")
485 ("12rrsvgg6bb2h8fhni7jbx8pv983q8ym5fhfjim957n9q2yp5db6" "67e40f48dec7" "hsb")
486 ("0apyh713p3hrlj8041xwblcssahbmsqp9v9hbmb50ayf4z850kr1" "40073a597b1b" "hu")
487 ("0q0r076lq250d3vmnz9d92wj137c2v8i362c2avmkgp5zr3mcl0z" "2ea33335afdb" "hy-AM")
488 ("0qza33gdc1i9259dwd2f7vd78s0a6rg34aqdkhcn7f2l6ybw6xd6" "930041db15eb" "ia")
489 ("1211h0gp7gianh3qf76w04gfzk4n2bnyc9i8dviyz0vh4cjbx11m" "08811a49b41c" "id")
490 ("12lcr841g1j7453s7gb51vrvxmshx4ha3h1jx4vh8wr891xv8l6a" "2f7a8d31e0ba" "is")
491 ("1x585g0r2kcv0d3phnxx85bk5g0pi1yl0hwp4idv19yc9hslr04s" "188357cc04b4" "it")
492 ("09v35g9v7j6x0p1hggydm3a1rmq2fh4z7g1l88z3w5k6wq2nhj1b" "45cee0ba4771" "ja")
493 ("0prs3vycfvvaffjigdgyxiq41ak2rc34lnan5a6cwdqjgy7z450s" "d60a19d9bf17" "ja-JP-mac")
494 ("1nskzm8rgczrbgcxlzzq5zqdfd456ad0cylq27nf0wjiyq6kjzcm" "00cb00e78672" "ka")
495 ("0g6zznmhiam172nm7g2qzfpk415mna8kiihm73z2sdns64xb3ymg" "77a293a4bced" "kab")
496 ("17dld9lrym7rpvpvnkssivp4wx1f11zpk86wczbq1h52qgd70p55" "2c9b33a56d5d" "kk")
497 ("1nlzl8930c8ql3yq425wyqlxvq8arrjv20xpm5g7yfxd54av89ac" "9cddd42af05c" "km")
498 ("07hkrcdksvrqk816yimd036dlw15nc4sjk4gmw16ywbp093v0mqq" "e0c2969a8398" "kn")
499 ("08aqggvk3qbv5bzks9i1iba9akhkpm01d2c9k0zf41mpr2r5yfg2" "827567d0dafc" "ko")
500 ("0vagaiwy80bs1k3gkacshlzb5zchkcshx0ypwirvayc63sw4yl8l" "694b2a24e868" "lij")
501 ("1r43kp1kzahrbza0hiyavqplk9h08pzsb6rpjy79jr6l1iqb89sy" "d6728db7e060" "lt")
502 ("0sq2wbsj79xl7fi454k6q5xdhxyck1whjz315rv37vphqpx86b9b" "61e9b33f4d94" "lv")
503 ("0q8jxg1af22hs9wjdf0jd3bqk4rafxyzvsjl35k75am7l2y1fl3c" "9e482f6dd72c" "mk")
504 ("1zsfzjrzbc58d30a9yz12h5vphywgpw8xg6y6zn3677a785dvr20" "1fd2763336a4" "mr")
505 ("1rzygkkpn1a59daygd3hdaqph2np6sqvpgh68j0xr4il958ymnsm" "67ddab62dab4" "ms")
506 ("16jp6w5gizfxs7jvncg3ly13m59vqvh4rlmjd0q23m5g5ff9sklc" "3ed015b51bf3" "my")
507 ("1wfv023j67lb4iyf49fsknwm4z3xy0xqcf25b2nzanggxj26n01x" "d01801233a8f" "nb-NO")
508 ("1946vfia58vbjfippb5pfsskbjj95w7hb340smn6ry2vmza99mxp" "582defb08fb2" "ne-NP")
509 ("12w5ywh4c3s55y3zqc48cp1gcpwwjg444yfh1bghhhb9ni1xkh5i" "05f6359a29a6" "nl")
510 ("17jb076320cgkw1ypwmws2vjxsqlv2ww8aaisa3j334vbrw1m4zx" "50b41a1ddded" "nn-NO")
511 ("1y840j0v5zdgj94cbacy6j1snf44rynmzxq3yk8i26arcar62akl" "a6a138531a44" "oc")
512 ("0jq1hq4xhqxpa26r8pb1bgbaljgfkhn9l6p5pbnslkllpbh70q6l" "e70a3afaef25" "pa-IN")
513 ("1hih138skwy2gb8q10ngg6zalrk3aa3d549mg79gqzxbi5zy19fw" "e035f33389eb" "pl")
514 ("1hhif4hx4k351wm1bzykzycfzb5q8msxmiwh5r1cy32rh8wkxwhh" "54098495f37f" "pt-BR")
515 ("0gkjs12rxjml1m3mljskpz1gr6aph0c31nwpwdqybfg54w9qslib" "3fdf021f624e" "pt-PT")
516 ("0anyvwd9v6mr8y3ww33s6qnxkawqn5lz65vrxx3m3kzky63ai1xk" "794f9374eb87" "rm")
517 ("1p4drj25gsfv7lwgm5saazh38iqrh53952n8i4bmxpn0nadbm2n5" "71ce18bcf6cc" "ro")
518 ("17yssf4axd3zvncl4ka4wkfnwcn0z0arp3390vb9cps67na29p36" "3a9587227699" "ru")
519 ("0xk6rksspcw1222v4rgk5a6gzrpx64k29hm7p9qkqwd70s34yj46" "c020582a72ce" "si")
520 ("1ax5ibydyn7sj208r66zcxlcr8dxdqrw28vqyjif4jx583rp4lfp" "745a699b7f51" "sk")
521 ("13rin7hm1dv8g0hbcv8mp2hiwpk1k5bhzvkqpqajkkik4lx523mc" "8e437e2351ef" "sl")
522 ("0yh5jkl5zw3f7x1w2w6zfj3dyvcl4wj1zv4di7qsq2nl2yyizf7x" "2d99e2eff94f" "son")
523 ("0vzq7s27jsdbw5k59wfykysg1kd8w229ab5d4zjdf30l59igkahh" "69bbdf07bd80" "sq")
524 ("1mwivvs8vrk6vjq6i33kwlrlisra7dy35521ayps9p2rz2dll4rr" "215df5c5125c" "sr")
525 ("0g97yz1rg5cfflj8vvq3sqliyvm06x818z9yldfh5rjg1y6n9fjd" "8be00a1a50d4" "sv-SE")
526 ("0ii02jn3lh2i6d0s95whx9aj6w3x8axc7w1rlzj0lc2s9n52krz3" "170a84339dbe" "ta")
527 ("1ss7symad2crapxjqc0xhc0n17l79r5vf7flvkgk7npjky4vb7nv" "72a79a304f7f" "te")
528 ("11iqmg8zamgscnvs4n2xpw3g9azn6w38qs313wiwm86pyx6694ss" "8e91ce3064c5" "th")
529 ("1zgkvn9flb8by62ip9r3gmpgxwgkww1zhml5mwa0djq3ppfdgi1c" "0f914d0cda56" "tl")
530 ("1filkhdak6dbrd83q602x1qw1703nlm53nm9gcyab8s16gsx6ylz" "62ca6a8eaeba" "tr")
531 ("0cgagdy0ixprk3knczdmkqxkmx4ybmshhh0956kxbd0iab0dfcf6" "f110ccac4cde" "trs")
532 ("1f1ghk67zwnwc5x3nk82vcv94nf8glngkfya1hg074q3088sj9pa" "56c0102d5f1c" "uk")
533 ("0iyw1b2jjylkdwxv9sxvj4ikxl64sx612b2dvvmf1di8bw86w74r" "7d53bce5ae98" "ur")
534 ("1q83cp5pfgs8l03zirwi8r5qp8qyh4zvxdx1ilgaqqlyg42yql7c" "9b500e1a054d" "uz")
535 ("1d4nkybz2hk64ay04k965b9lc5nhhpmzcs5ww3b6q4n93rf9c2z7" "2a000025928a" "vi")
536 ("1cnrsfnyl3sw3sxsggmjwydvphb2diy0vzknvxdhpnvq3ln18hga" "74724087c25b" "xh")
537 ("1j6l66v1xw27z8w78mpsnmqgv8m277mf4r0hgqcrb4zx7xc2vqyy" "527e5e090608" "zh-CN")
538 ("1frwx35klpyz3sdwrkz7945ivb2dwaawhhyfnz4092h9hn7rc4ky" "6cd366ad2947" "zh-TW")))
540 (define* (computed-origin-method gexp-promise hash-algo hash
541 #:optional (name "source")
542 #:key (system (%current-system))
543 (guile (default-guile)))
544 "Return a derivation that executes the G-expression that results
545 from forcing GEXP-PROMISE."
546 (mlet %store-monad ((guile (package->derivation guile system)))
547 (gexp->derivation (or name "computed-origin")
549 #:graft? #f ;nothing to graft
551 #:guile-for-build guile)))
553 (define %icecat-version "78.3.0-guix0-preview1")
554 (define %icecat-build-id "20200921000000") ;must be of the form YYYYMMDDhhmmss
556 ;; 'icecat-source' is a "computed" origin that generates an IceCat tarball
557 ;; from the corresponding upstream Firefox ESR tarball, using the 'makeicecat'
558 ;; script from the upstream IceCat project.
559 (define icecat-source
560 (let* ((base-version (first (string-split %icecat-version #\-)))
562 (major-version (first (string-split base-version #\.)))
563 (minor-version (second (string-split base-version #\.)))
564 (sub-version (third (string-split base-version #\.)))
566 (upstream-firefox-version (string-append base-version "esr"))
567 (upstream-firefox-source
571 "https://ftp.mozilla.org/pub/firefox/releases/"
572 upstream-firefox-version "/source/"
573 "firefox-" upstream-firefox-version ".source.tar.xz"))
576 "1xvvizv84v4w3mq56vphccpwagga1i9lgbvj1l0cs763sqi3w9w5"))))
578 (upstream-icecat-base-version "78.3.0") ; maybe older than base-version
579 ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version))
580 (gnuzilla-commit "df6b2146f13fc90ad3c11136115ada077383ee2a")
585 (url "git://git.savannah.gnu.org/gnuzilla.git")
586 (commit gnuzilla-commit)))
587 (file-name (git-file-name "gnuzilla"
588 ;;upstream-icecat-base-version
589 (string-take gnuzilla-commit 8)))
592 "0nmkb2d6jpfnx081w8gdbs264j9rg9whq2gna9d4wazdpds1pyfr"))))
594 (gnuzilla-fixes-patch
595 (local-file (search-patch "icecat-use-older-reveal-hidden-html.patch")))
597 (local-file (search-patch "icecat-makeicecat.patch"))))
600 (method computed-origin-method)
601 (file-name (string-append "icecat-" %icecat-version ".tar.xz"))
605 (with-imported-modules '((guix build utils))
607 (use-modules (guix build utils))
609 (string-append "firefox-" #$base-version))
611 (string-append "icecat-" #$%icecat-version)))
614 (set-path-environment-variable
617 #+(canonical-package bash)
618 #+(canonical-package coreutils)
619 #+(canonical-package findutils)
620 #+(canonical-package patch)
621 #+(canonical-package xz)
622 #+(canonical-package sed)
623 #+(canonical-package grep)
624 #+(canonical-package bzip2)
625 #+(canonical-package gzip)
626 #+(canonical-package tar)
629 (symlink #+(file-append rename "/bin/rename")
632 ;; We copy the gnuzilla source directory because it is
633 ;; read-only in 'gnuzilla-source', and the makeicecat script
634 ;; uses "cp -a" to copy parts of it and assumes that the
635 ;; copies will be writable.
636 (copy-recursively #+gnuzilla-source "/tmp/gnuzilla"
637 #:log (%make-void-port "w"))
639 (with-directory-excursion "/tmp/gnuzilla"
640 (make-file-writable "makeicecat")
641 (invoke "patch" "--force" "--no-backup-if-mismatch"
642 "-p1" "--input" #+gnuzilla-fixes-patch)
643 (invoke "patch" "--force" "--no-backup-if-mismatch"
644 "-p1" "--input" #+makeicecat-patch)
645 (patch-shebang "makeicecat")
646 (substitute* "makeicecat"
647 (("^FFMAJOR=(.*)" all ffmajor)
648 (unless (string=? #$major-version
649 (string-trim-both ffmajor))
650 ;; The makeicecat script cannot be expected to work
651 ;; properly on a different version of Firefox, even if
652 ;; no errors occur during execution.
653 (error "makeicecat major version mismatch"))
654 (string-append "FFMAJOR=" #$major-version "\n"))
656 (string-append "FFMINOR=" #$minor-version "\n"))
658 (string-append "FFSUB=" #$sub-version "\n"))
660 "DATA=/tmp/gnuzilla/data\n")
662 #+(file-append (canonical-package sed) "/bin/sed"))))
664 (format #t "Unpacking upstream firefox tarball...~%")
666 (invoke "tar" "xf" #+upstream-firefox-source)
667 (rename-file firefox-dir icecat-dir)
669 (with-directory-excursion icecat-dir
670 (format #t "Populating l10n directory...~%")
673 (with-directory-excursion "l10n"
677 (string-drop (basename locale-dir)
678 (+ 32 ; length of hash
679 (string-length "-mozilla-locale-")))))
680 (format #t " ~a~%" locale)
682 (copy-recursively locale-dir locale
683 #:log (%make-void-port "w"))
684 (for-each make-file-writable (find-files locale))
685 (with-directory-excursion locale
686 (when (file-exists? ".hgtags")
687 (delete-file ".hgtags"))
688 (mkdir-p "browser/chrome/browser/preferences")
689 (call-with-output-file
690 "browser/chrome/browser/preferences/advanced-scripts.dtd"
691 (lambda (port) #f)))))
692 '#+all-mozilla-locales)
693 (copy-recursively #+mozilla-compare-locales
695 #:log (%make-void-port "w"))
696 (delete-file "compare-locales/.gitignore")
697 (delete-file "compare-locales/.hgignore")
698 (delete-file "compare-locales/.hgtags"))
700 (format #t "Running makeicecat script...~%")
702 (invoke "bash" "/tmp/gnuzilla/makeicecat"))
704 (format #t "Packing IceCat source tarball...~%")
706 (invoke "tar" "cfa" #$output
707 ;; Avoid non-determinism in the archive. We set the
708 ;; mtime of files in the archive to early 1980 because
709 ;; the build process fails if the mtime of source
710 ;; files is pre-1980, due to the creation of zip
712 "--mtime=@315619200" ; 1980-01-02 UTC
720 (define-public icecat
723 (version %icecat-version)
724 (source icecat-source)
725 (build-system gnu-build-system)
727 `(("alsa-lib" ,alsa-lib)
730 ("dbus-glib" ,dbus-glib)
731 ("gdk-pixbuf" ,gdk-pixbuf)
735 ;; UNBUNDLE-ME! ("graphite2" ,graphite2)
737 ("freetype" ,freetype)
738 ;; UNBUNDLE-ME! ("harfbuzz" ,harfbuzz)
739 ("libcanberra" ,libcanberra)
740 ("libgnome" ,libgnome)
741 ("libjpeg-turbo" ,libjpeg-turbo)
742 ;; UNBUNDLE-ME! ("libogg" ,libogg)
743 ;; UNBUNDLE-ME! ("libtheora" ,libtheora) ; wants theora-1.2, not yet released
744 ;; UNBUNDLE-ME! ("libvorbis" ,libvorbis)
746 ("libevent" ,libevent)
747 ("libxinerama" ,libxinerama)
748 ("libxscrnsaver" ,libxscrnsaver)
749 ("libxcomposite" ,libxcomposite)
753 ;; UNBUNDLE-ME! ("libvpx" ,libvpx)
754 ;; UNBUNDLE-ME! ("icu4c" ,icu4c)
756 ("pulseaudio" ,pulseaudio)
758 ("mit-krb5" ,mit-krb5)
759 ;; See <https://bugs.gnu.org/32833>
760 ;; and related comments in the 'remove-bundled-libraries' phase.
761 ;; UNBUNDLE-ME! ("nspr" ,nspr)
762 ;; UNBUNDLE-ME! ("nss" ,nss)
763 ("shared-mime-info" ,shared-mime-info)
764 ;; UNBUNDLE-ME! ("sqlite" ,sqlite)
767 ;; UNBUNDLE-ME! ("zlib" ,zlib)
770 ;; The following patches are specific to the Guix packaging of IceCat,
771 ;; and therefore we prefer to leave them out of 'source', which should be
772 ;; a tarball suitable for compilation on any system that IceCat supports.
773 ;; (Bug fixes and security fixes, however, should go in 'source').
774 `(;; XXX TODO: Adapt these patches to IceCat 68.
775 ;; ("icecat-avoid-bundled-libraries.patch"
776 ;; ,(search-patch "icecat-avoid-bundled-libraries.patch"))
777 ;; ("icecat-use-system-graphite2+harfbuzz.patch"
778 ;; ,(search-patch "icecat-use-system-graphite2+harfbuzz.patch"))
779 ;; ("icecat-use-system-media-libs.patch"
780 ;; ,(search-patch "icecat-use-system-media-libs.patch"))
782 ("patch" ,(canonical-package patch))
785 ("cargo" ,rust-1.41 "cargo")
786 ("rust-cbindgen" ,rust-cbindgen-0.14)
792 ("python-2" ,python-2)
793 ("python2-pysqlite" ,python2-pysqlite)
795 ("nasm" ,nasm) ; XXX FIXME: only needed on x86_64 and i686
796 ("pkg-config" ,pkg-config)
797 ("autoconf" ,autoconf-2.13)
800 `(#:tests? #f ; no check target
801 #:out-of-source? #t ; must be built outside of the source directory
803 ;; XXX: There are RUNPATH issues such as
804 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
805 ;; which is not in its RUNPATH, but they appear to be harmless in
806 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
807 #:validate-runpath? #f
809 #:configure-flags `("--enable-default-toolkit=cairo-gtk3-wayland"
811 "--with-distribution-id=org.gnu"
813 ;; Do not require addons in the global app or
814 ;; system directories to be signed by Mozilla.
815 "--with-unsigned-addon-scopes=app,system"
816 "--allow-addon-sideload"
818 "--enable-pulseaudio"
822 "--disable-crashreporter"
825 ;; Building with debugging symbols takes ~5GiB, so
828 "--disable-debug-symbols"
830 ;; Clang is needed to build Stylo, Mozilla's new
831 ;; CSS engine. We must specify the clang paths
832 ;; manually, because otherwise the Mozilla build
833 ;; system looks in the directories returned by
834 ;; llvm-config --bindir and llvm-config --libdir,
835 ;; which return paths in the llvm package where
836 ;; clang is not found.
837 ,(string-append "--with-clang-path="
838 (assoc-ref %build-inputs "clang")
840 ,(string-append "--with-libclang-path="
841 (assoc-ref %build-inputs "clang")
844 ;; Hack to work around missing
845 ;; "unofficial" branding in icecat.
846 "--enable-official-branding"
848 ;; Avoid bundled libraries.
849 "--with-system-jpeg" ; must be libjpeg-turbo
850 ;; UNBUNDLE-ME! "--with-system-zlib"
851 ;; UNBUNDLE-ME! "--with-system-bz2"
852 ;; UNBUNDLE-ME! "--with-system-libevent"
853 ;; UNBUNDLE-ME! "--with-system-ogg"
854 ;; UNBUNDLE-ME! "--with-system-vorbis"
855 ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released
856 ;; UNBUNDLE-ME! "--with-system-libvpx"
857 ;; UNBUNDLE-ME! "--with-system-icu"
859 ;; See <https://bugs.gnu.org/32833>
860 ;; and related comments in the
861 ;; 'remove-bundled-libraries' phase below.
862 ;; UNBUNDLE-ME! "--with-system-nspr"
863 ;; UNBUNDLE-ME! "--with-system-nss"
865 ;; UNBUNDLE-ME! "--with-system-harfbuzz"
866 ;; UNBUNDLE-ME! "--with-system-graphite2"
867 "--enable-system-pixman"
868 "--enable-system-ffi"
869 ;; UNBUNDLE-ME! "--enable-system-sqlite"
871 ;; Fails with "--with-system-png won't work because
872 ;; the system's libpng doesn't have APNG support".
874 ;; http://sourceforge.net/projects/libpng-apng/ ,
875 ;; "the Animated Portable Network Graphics (APNG)
876 ;; is an unofficial extension of the Portable
877 ;; Network Graphics (PNG) format";
878 ;; we probably do not wish to support it.
879 ;; "--with-system-png"
882 #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
884 #:modules ((ice-9 ftw)
894 ,@%gnu-build-system-modules)
896 (modify-phases %standard-phases
897 (add-after 'unpack 'apply-guix-specific-patches
898 (lambda* (#:key inputs native-inputs #:allow-other-keys)
899 (let ((patch (string-append (assoc-ref (or native-inputs inputs)
902 (for-each (match-lambda
904 (when (and (string-prefix? "icecat-" label)
905 (string-suffix? ".patch" label))
906 (format #t "applying '~a'...~%" file)
907 (invoke patch "--force" "--no-backup-if-mismatch"
908 "-p1" "--input" file))))
909 (or native-inputs inputs)))
911 (add-after 'apply-guix-specific-patches 'remove-bundled-libraries
913 ;; Remove bundled libraries that we don't use, since they may
914 ;; contain unpatched security flaws, they waste disk space and
915 ;; memory, and may cause confusion.
916 (for-each (lambda (file)
917 (format #t "deleting '~a'...~%" file)
918 (delete-file-recursively file))
919 '(;; FIXME: Removing the bundled icu breaks configure.
920 ;; * The bundled icu headers are used in some places.
921 ;; * The version number is taken from the bundled copy.
924 ;; FIXME: A script from the bundled nspr is used.
927 ;; FIXME: With the update to IceCat 60, using system NSS
928 ;; broke certificate validation. See
929 ;; <https://bugs.gnu.org/32833>. For now, we use
930 ;; the bundled NSPR and NSS. TODO: Investigate,
931 ;; and try to unbundle these libraries again.
932 ;; UNBUNDLE-ME! "security/nss"
934 ;; TODO: Use more system media libraries. See:
935 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
936 ;; * libtheora: esr60 wants v1.2, not yet released.
937 ;; * soundtouch: avoiding the bundled library would
938 ;; result in some loss of functionality. There's
939 ;; also an issue with exception handling
940 ;; configuration. It seems that this is needed in
942 ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1
947 ;; "media/libjpeg" ; needed for now, because media/libjpeg/moz.build is referenced from config/external/moz.build
948 ;; UNBUNDLE-ME! "modules/zlib"
949 ;; UNBUNDLE-ME! "ipc/chromium/src/third_party/libevent"
950 ;; UNBUNDLE-ME! "media/libvpx"
951 ;; UNBUNDLE-ME! "media/libogg"
952 ;; UNBUNDLE-ME! "media/libvorbis"
953 ;; UNBUNDLE-ME! "media/libtheora" ; wants theora-1.2, not yet released
954 ;; UNBUNDLE-ME! "media/libtremor"
955 ;; UNBUNDLE-ME! "gfx/harfbuzz"
956 ;; UNBUNDLE-ME! "gfx/graphite2"
957 "js/src/ctypes/libffi"
958 ;; UNBUNDLE-ME! "db/sqlite3"
961 (add-after 'remove-bundled-libraries 'link-libxul-with-libraries
963 ;; libxul.so dynamically opens libraries, so here we explicitly
964 ;; link them into libxul.so instead.
966 ;; TODO: It might be preferable to patch in absolute file names in
967 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
968 ;; work. More investigation is needed.
969 (substitute* "toolkit/library/moz.build"
970 (("^# This library needs to be last" all)
971 (string-append "OS_LIBS += [
972 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
973 'avcodec', 'avutil', 'pulse' ]\n\n"
976 (add-after 'link-libxul-with-libraries 'fix-ffmpeg-runtime-linker
977 (lambda* (#:key inputs #:allow-other-keys)
978 (let* ((ffmpeg (assoc-ref inputs "ffmpeg"))
979 (libavcodec (string-append ffmpeg "/lib/libavcodec.so")))
980 ;; Arrange to load libavcodec.so by its absolute file name.
981 (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
984 ;; Populate the sandbox read-path whitelist as needed by ffmpeg.
985 (let* ((mime-info (assoc-ref inputs "shared-mime-info"))
986 (libavcodec-runpath (call-with-input-file libavcodec
987 (compose elf-dynamic-info-runpath
990 get-bytevector-all)))
991 (whitelist (cons (string-append mime-info "/share/mime/")
993 (string-append dir "/"))
994 libavcodec-runpath)))
995 (whitelist-string (string-join whitelist ","))
996 (port (open-file "browser/app/profile/icecat.js" "a")))
997 (format #t "setting 'security.sandbox.content.read_path_whitelist' to '~a'~%"
999 (format port "~%pref(\"security.sandbox.content.read_path_whitelist\", ~S);~%"
1001 (close-output-port port))
1005 (invoke "sh" "-c" "autoconf old-configure.in > old-configure")
1006 ;; 'configure' must be newer than 'old-configure.in', or else the
1007 ;; build system will raise an alarm and abort.
1008 (invoke "touch" "configure")))
1009 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1011 (use-modules (guix build cargo-utils))
1012 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
1013 (for-each (lambda (file)
1014 (format #t "patching checksums in ~a~%" file)
1015 (substitute* (find-files "." "Cargo.lock$")
1016 (("^checksum = \".*\"")
1017 (string-append "checksum = \"" null-hash "\""))))
1018 (find-files "." "Cargo.lock$"))
1019 (for-each generate-all-checksums
1031 "mozglue/static/rust"
1036 "security/manager/ssl"
1040 ;; configure does not work followed by both "SHELL=..." and
1041 ;; "CONFIG_SHELL=..."; set environment variables instead
1042 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1043 (let* ((out (assoc-ref outputs "out"))
1044 (bash (which "bash"))
1045 (abs-srcdir (getcwd))
1046 (srcdir (string-append "../" (basename abs-srcdir)))
1047 (flags `(,(string-append "--prefix=" out)
1048 ,(string-append "--with-l10n-base="
1050 ,@configure-flags)))
1051 (setenv "SHELL" bash)
1052 (setenv "CONFIG_SHELL" bash)
1053 (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13
1054 (setenv "CC" "gcc") ; apparently needed when Stylo is enabled
1055 (setenv "MOZ_BUILD_DATE" ,%icecat-build-id) ; avoid timestamp
1058 (format #t "build directory: ~s~%" (getcwd))
1059 (format #t "configure flags: ~s~%" flags)
1061 (string-append srcdir "/configure")
1064 ;; The build system often spuriously fails. See
1065 ;; <https://bugs.gentoo.org/show_bug.cgi?id=680934>. To
1066 ;; work around this, we try the standard 'build' phase up
1069 (let ((build (assoc-ref %standard-phases 'build)))
1070 (let retry ((remaining-attempts 5))
1071 (if (= remaining-attempts 1)
1073 (guard (c ((invoke-error? c)
1074 (format #t "~%Retrying build! (~a attempts remaining)~%~%"
1075 (- remaining-attempts 1))
1077 (retry (- remaining-attempts 1))))
1078 (apply build args)))))))
1079 (add-after 'build 'neutralise-store-references
1081 ;; Mangle the store references to compilers & other build tools in
1082 ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64.
1084 "dist/bin/chrome/toolkit/content/global/buildconfig.html"
1085 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1086 (regexp-quote (%store-directory)))
1088 (string-append store
1089 (string-take hash 8)
1090 "<!-- Guix: not a runtime dependency -->"
1091 (string-drop hash 8))))
1093 (add-before 'configure 'install-desktop-entry
1094 (lambda* (#:key outputs #:allow-other-keys)
1095 ;; Install the '.desktop' file.
1096 (let* ((desktop-file "taskcluster/docker/icecat-snap/icecat.desktop")
1097 (out (assoc-ref outputs "out"))
1098 (applications (string-append out "/share/applications")))
1099 (substitute* desktop-file
1100 (("^Exec=icecat") (string-append "Exec=" out "/bin/icecat"))
1101 (("IceCat") "GNU IceCat")
1102 (("Icon=.*") "Icon=icecat\n")
1103 (("NewWindow") "new-window")
1104 (("NewPrivateWindow") "new-private-window"))
1105 (install-file desktop-file applications)
1107 (add-after 'install-desktop-entry 'install-icons
1108 (lambda* (#:key outputs #:allow-other-keys)
1109 (let ((out (assoc-ref outputs "out")))
1110 (with-directory-excursion "browser/branding/official"
1113 (let* ((size (string-filter char-numeric? file))
1114 (icons (string-append out "/share/icons/hicolor/"
1115 size "x" size "/apps")))
1117 (copy-file file (string-append icons "/icecat.png"))))
1118 '("default16.png" "default22.png" "default24.png"
1119 "default32.png" "default48.png" "content/icon64.png"
1120 "mozicon128.png" "default256.png"))
1122 ;; This fixes the file chooser crash that happens with GTK 3.
1123 (add-after 'install 'wrap-program
1124 (lambda* (#:key inputs outputs #:allow-other-keys)
1125 (let* ((out (assoc-ref outputs "out"))
1126 (lib (string-append out "/lib"))
1127 (gtk (assoc-ref inputs "gtk+"))
1128 (gtk-share (string-append gtk "/share"))
1129 (mesa (assoc-ref inputs "mesa"))
1130 (mesa-lib (string-append mesa "/lib"))
1131 (pulseaudio (assoc-ref inputs "pulseaudio"))
1132 (pulseaudio-lib (string-append pulseaudio "/lib"))
1133 (libxscrnsaver (assoc-ref inputs "libxscrnsaver"))
1134 (libxscrnsaver-lib (string-append libxscrnsaver "/lib")))
1135 (wrap-program (car (find-files lib "^icecat$"))
1136 `("XDG_DATA_DIRS" prefix (,gtk-share))
1137 ;; The following line is commented out because the icecat
1138 ;; package on guix has been observed to be unstable when
1139 ;; using wayland, and the bundled extensions stop working.
1140 ;; `("MOZ_ENABLE_WAYLAND" = ("1"))
1141 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib ,mesa-lib ,libxscrnsaver-lib)))
1143 (home-page "https://www.gnu.org/software/gnuzilla/")
1144 (synopsis "Entirely free browser derived from Mozilla Firefox")
1146 "IceCat is the GNU version of the Firefox browser. It is entirely free
1147 software, which does not recommend non-free plugins and addons. It also
1148 features built-in privacy-protecting features.
1150 WARNING: IceCat 78 has not yet been released by the upstream IceCat project.
1151 This is a preview release, and does not currently meet the privacy-respecting
1152 standards of the IceCat project.")
1153 (license license:mpl2.0) ;and others, see toolkit/content/license.html
1155 `((ftp-directory . "/gnu/gnuzilla")
1156 (cpe-name . "firefox_esr")
1157 (cpe-version . ,(first (string-split version #\-)))))))
1159 ;; Update this together with icecat!
1160 (define %icedove-build-id "20200924000000") ;must be of the form YYYYMMDDhhmmss
1161 (define-public icedove
1165 (source icecat-source)
1167 `((cpe-name . "thunderbird_esr")))
1168 (build-system gnu-build-system)
1170 `(#:tests? #f ; no check target
1171 #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
1172 #:modules ((guix build utils) ;find-files
1175 ,@%gnu-build-system-modules)
1177 (modify-phases %standard-phases
1178 (add-after 'unpack 'prepare-thunderbird-sources
1179 (lambda* (#:key inputs #:allow-other-keys)
1181 (copy-recursively (assoc-ref inputs "thunderbird-sources")
1183 (delete-file-recursively "obj-x86_64-pc-linux-gnu")
1184 (delete-file "sourcestamp.txt")
1186 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1188 (use-modules (guix build cargo-utils))
1189 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
1190 (for-each (lambda (file)
1191 (format #t "patching checksums in ~a~%" file)
1193 (("^checksum = \".*\"")
1194 (string-append "checksum = \"" null-hash "\""))))
1195 (find-files "." "Cargo.lock$"))
1196 (for-each generate-all-checksums
1197 '("third_party/rust"
1198 "toolkit/library/rust")))
1200 ;; Fixes issue where each installation directory generates its own profile.
1201 ;; See e.g. https://trac.torproject.org/projects/tor/ticket/31457
1202 (add-after 'patch-source-shebangs 'fix-profile-setting
1204 (substitute* "comm/mail/moz.configure"
1205 (("'MOZ_DEDICATED_PROFILES', True")
1206 "'MOZ_DEDICATED_PROFILES', False"))
1208 (add-after 'prepare-thunderbird-sources 'rename-to-icedove
1210 (substitute* "comm/mail/confvars.sh"
1211 (("MOZ_APP_BASENAME=Thunderbird")
1212 "MOZ_APP_BASENAME=Icedove\nMOZ_APP_DISPLAYNAME=Icedove")
1213 (("MOZ_APP_NAME=thunderbird")
1214 "MOZ_APP_NAME=icedove")
1217 ;; Remove branding to comply with Mozilla's trademark policy
1218 (with-directory-excursion "comm/mail/branding/nightly"
1219 (delete-file "content/about-wordmark.svg")
1220 (call-with-output-file "content/about-wordmark.svg"
1222 (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg")
1223 (viewBox "0 0 789.1 90.78")
1227 (text (@ (x "400") (y "70")
1228 (text-anchor "middle")
1232 (substitute* '("locales/en-US/brand.properties"
1233 "locales/en-US/brand.ftl"
1234 "locales/en-US/brand.dtd"
1236 (("Thunderbird") "Icedove")
1237 (("mozilla.org") "guix.gnu.org")))
1238 ;; Remove other mentions of Thunderbird in user-visible text.
1239 (with-directory-excursion "comm/mail/base/content"
1240 (substitute* '("overrides/app-license-name.html")
1241 (("Thunderbird") "Icedove")))
1242 (with-directory-excursion "comm/mail/components/"
1243 (substitute* '("MailGlue.jsm"
1244 "extensions/schemas/addressBook.json"
1245 "extensions/schemas/tabs.json"
1246 "extensions/schemas/cloudFile.json"
1247 "extensions/schemas/chrome_settings_overrides.json"
1248 "extensions/schemas/windows.json"
1249 "extensions/parent/ext-mail.js"
1250 "im/messages/mail/Info.plist"
1251 "enterprisepolicies/moz.build"
1252 "enterprisepolicies/helpers/moz.build"
1253 "enterprisepolicies/schemas/moz.build")
1254 (("Thunderbird") "Icedove")))
1255 (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js"
1256 "comm/common/src/customizeToolbar.js")
1257 (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e)
1258 (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e)))
1260 ;; Override addon URLs and settings
1261 (substitute* "comm/mail/app/profile/all-thunderbird.js"
1262 (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m)
1263 (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");"))
1264 (("(pref\\(\"extensions.getAddons.search.url\").*" _ m)
1265 (string-append m ", \"https://guix.gnu.org/packages\");"))
1266 (("(pref\\(\"extensions.update.enabled\").*" _ m)
1267 (string-append m ", false);"))
1268 (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m)
1269 (string-append m ", false);"))
1270 (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m)
1271 (string-append m ", false);")))
1273 (add-after 'build 'neutralize-store-references
1275 ;; Mangle the store references to compilers & other build tools in
1276 ;; about:buildconfig, reducing Icedove's closure significant.
1277 ;; The resulting files are saved in lib/thunderbird/omni.ja
1279 ;; Use find because the path "obj-x86_64-pc-linux-gnu" contains
1280 ;; the architecture and the system -> more complicated.
1281 (find-files "." "buildconfig.html")
1282 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1283 (regexp-quote (%store-directory)))
1285 (string-append store
1286 (string-take hash 8)
1287 "<!-- Guix: not a runtime dependency -->"
1288 (string-drop hash 8))))
1291 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
1292 (let* ((out (assoc-ref outputs "out"))
1293 (bash (which "bash"))
1294 (abs-srcdir (getcwd))
1295 (srcdir (string-append "../" (basename abs-srcdir)))
1296 (flags `(,(string-append "--prefix=" out)
1298 (mozconfig (string-append (getcwd) "/.mozconfig")))
1299 (setenv "SHELL" bash)
1301 (string-append (assoc-ref %build-inputs
1304 (setenv "CONFIG_SHELL" bash)
1305 (setenv "QA_CONFIGURE_OPTIONS" ".*")
1306 (setenv "MOZBUILD_STATE_PATH"
1307 (string-append (getcwd) "/mach_state"))
1309 (string-append (getcwd) "/.mozconfig"))
1311 (setenv "MOZ_NOSPAM" "1")
1313 (string-append (assoc-ref inputs "python2")
1315 (setenv "MOZ_BUILD_DATE" ,%icedove-build-id) ; avoid timestamp
1316 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1317 (assoc-ref outputs "out")
1319 (mkdir-p (string-append (getcwd) "/builddir"))
1320 (with-output-to-file mozconfig
1324 "ac_add_options --disable-crashreporter\n"
1325 "ac_add_options --disable-debug\n"
1326 "ac_add_options --disable-debug-symbols\n"
1327 "ac_add_options --disable-elf-hack\n"
1328 "ac_add_options --disable-jit\n"
1329 "ac_add_options --disable-necko-wifi\n"
1330 "ac_add_options --disable-official-branding\n"
1331 "ac_add_options --disable-tests\n"
1332 "ac_add_options --disable-updater\n"
1333 "ac_add_options --disable-webrtc\n"
1334 "ac_add_options --enable-application=comm/mail\n"
1335 "ac_add_options --enable-calendar\n"
1336 "ac_add_options --enable-default-toolkit=\"cairo-gtk3\"\n"
1337 "ac_add_options --enable-optimize\n"
1338 "ac_add_options --enable-pulseaudio\n"
1339 "ac_add_options --enable-release\n"
1340 "ac_add_options --enable-strip\n"
1341 "ac_add_options --enable-system-ffi\n"
1342 "ac_add_options --enable-system-pixman\n"
1343 "ac_add_options --prefix=" out "\n"
1344 "ac_add_options --with-clang-path=" (assoc-ref %build-inputs "clang") "/bin/clang\n"
1345 "ac_add_options --with-distribution-id=org.gnu\n"
1346 "ac_add_options --with-libclang-path=" (assoc-ref %build-inputs "clang") "/lib\n"
1347 "ac_add_options --with-system-bz2\n"
1348 "ac_add_options --with-system-icu\n"
1349 "ac_add_options --with-system-jpeg\n"
1350 "ac_add_options --with-system-libevent\n"
1351 "ac_add_options --with-system-nspr\n"
1352 "ac_add_options --with-system-nss\n"
1353 "ac_add_options --with-system-zlib\n"
1354 "ac_add_options --with-user-appdir=\\.icedove\n"))))
1357 (display "mach configure")
1358 (invoke "./mach" "configure"))))
1360 (lambda _ (invoke "./mach" "build")))
1362 (lambda _ (invoke "./mach" "install")))
1363 ;; Thunderbird doesn't provide any .desktop file.
1364 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
1365 (add-after 'install 'install-desktop-file
1366 (lambda* (#:key outputs #:allow-other-keys)
1367 (let* ((out (assoc-ref outputs "out"))
1368 (apps (string-append out "/share/applications")))
1370 (with-output-to-file (string-append apps "/icedove.desktop")
1375 Exec=~a/bin/icedove~@
1377 GenericName=Mail/News Client~@
1378 Categories=Network;Email;~@
1380 StartupNotify=true~@
1381 MimeType=x-scheme-handler/mailto;~@
1383 Actions=ComposeMessage;~@
1384 [Desktop Action ComposeMessage]~@
1385 Name=Write new message~@
1386 Exec=~@*~a/bin/icedove -compose~%"
1389 (add-after 'install 'wrap-program
1390 (lambda* (#:key inputs outputs #:allow-other-keys)
1391 (let* ((out (assoc-ref outputs "out"))
1392 (lib (string-append out "/lib"))
1393 (gtk (assoc-ref inputs "gtk+"))
1394 (gtk-share (string-append gtk "/share"))
1395 (pulseaudio (assoc-ref inputs "pulseaudio"))
1396 (pulseaudio-lib (string-append pulseaudio "/lib")))
1397 (wrap-program (car (find-files lib "^icedove$"))
1398 `("XDG_DATA_DIRS" prefix (,gtk-share))
1399 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib)))
1405 ("dbus-glib" ,dbus-glib)
1407 ("freetype" ,freetype)
1408 ("gdk-pixbuf" ,gdk-pixbuf)
1412 ("hunspell" ,hunspell)
1414 ("libcanberra" ,libcanberra)
1415 ("libevent" ,libevent)
1417 ("libgnome" ,libgnome)
1418 ("libjpeg-turbo" ,libjpeg-turbo)
1419 ("libpng-apng" ,libpng-apng)
1421 ("libxcomposite" ,libxcomposite)
1423 ("libxinerama" ,libxinerama)
1424 ("libxscrnsaver" ,libxscrnsaver)
1427 ("mit-krb5" ,mit-krb5)
1432 ("pulseaudio" ,pulseaudio)
1434 ("startup-notification" ,startup-notification)
1439 `(("thunderbird-sources"
1440 ;; The changeset identifier is taken from the file "sourcestamp.txt"
1441 ;; in the Thunderbird release tarball. We don't use the release
1442 ;; tarball because it duplicates the Icecat sources and only adds the
1443 ;; "comm" directory, which is provided by this repository.
1444 ,(let ((changeset "35e647ebd4fa09407a0fe151d3823b1b58172a2a"))
1448 (url "https://hg.mozilla.org/releases/comm-esr78")
1449 (changeset changeset)))
1450 (file-name (string-append "thunderbird-" version "-checkout"))
1453 "0g27rapn1xf19i5pl2g12hndb55shzsk4vrrc6bnj4vf2q49zcwy")))))
1454 ("autoconf" ,autoconf-2.13)
1455 ("cargo" ,rust-1.41 "cargo")
1459 ("node" ,node-10.22)
1461 ("pkg-config" ,pkg-config)
1463 ("python2" ,python-2.7)
1465 ("rust-cbindgen" ,rust-cbindgen-0.14)
1468 (home-page "https://www.thunderbird.net")
1469 (synopsis "Rebranded Mozilla Thunderbird email client")
1471 "This package provides an email client built based on Mozilla
1472 Thunderbird. It supports email, news feeds, chat, calendar and contacts.")
1473 (license license:mpl2.0)))
1475 (define-public firefox-decrypt
1477 (name "firefox-decrypt")
1482 (url "https://github.com/Unode/firefox_decrypt")
1484 (file-name (git-file-name name version))
1487 "17yyyxp47z4m8hnflcq34rc1y871515kr3f1y42j1l0yx3g0il07"))))
1488 (build-system trivial-build-system)
1491 ("python" ,python)))
1493 `(#:modules ((guix build utils))
1496 (use-modules (guix build utils))
1499 (assoc-ref %build-inputs "python") "/bin"))
1500 (copy-file (string-append (assoc-ref %build-inputs "source")
1501 "/firefox_decrypt.py")
1502 "firefox_decrypt.py")
1503 (substitute* "firefox_decrypt.py"
1504 (("/usr/bin/env python") (which "python3"))
1505 (("libnss3.so") (string-append (assoc-ref %build-inputs "nss")
1506 "/lib/nss/libnss3.so")))
1507 (install-file "firefox_decrypt.py" (string-append %output "/bin"))
1509 (home-page "https://github.com/Unode/firefox_decrypt/")
1510 (synopsis "Tool to extract passwords from Mozilla profiles")
1511 (description "Firefox Decrypt is a tool to extract passwords from
1512 Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.")
1513 (license license:gpl3+)))