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, 2020 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.5.0-guix0-preview1")
554 (define %icecat-build-id "20201117000000") ;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 "1442yjmwz69hkfcvh8kkb60jf4c9ms0pac04nc3xw2da13v4zxai"))))
578 (upstream-icecat-base-version "78.5.0") ; maybe older than base-version
579 ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version))
580 (gnuzilla-commit "bcfe407570cae32d00dd33a268de0e0593166f7b")
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 "1pg8fjjg91qyrv7za585ds1xrdvmybbkf2jmkff107fh5y23lxrg"))))
594 ;; 'search-patch' returns either a valid file name or #f, so wrap it
595 ;; in 'assume-valid-file-name' to avoid 'local-file' warnings.
596 (gnuzilla-fixes-patch
597 (local-file (assume-valid-file-name
598 (search-patch "icecat-use-older-reveal-hidden-html.patch"))))
600 (local-file (assume-valid-file-name
601 (search-patch "icecat-makeicecat.patch")))))
604 (method computed-origin-method)
605 (file-name (string-append "icecat-" %icecat-version ".tar.xz"))
609 (with-imported-modules '((guix build utils))
611 (use-modules (guix build utils))
613 (string-append "firefox-" #$base-version))
615 (string-append "icecat-" #$%icecat-version)))
618 (set-path-environment-variable
621 #+(canonical-package bash)
622 #+(canonical-package coreutils)
623 #+(canonical-package findutils)
624 #+(canonical-package patch)
625 #+(canonical-package xz)
626 #+(canonical-package sed)
627 #+(canonical-package grep)
628 #+(canonical-package bzip2)
629 #+(canonical-package gzip)
630 #+(canonical-package tar)
633 (symlink #+(file-append rename "/bin/rename")
636 ;; We copy the gnuzilla source directory because it is
637 ;; read-only in 'gnuzilla-source', and the makeicecat script
638 ;; uses "cp -a" to copy parts of it and assumes that the
639 ;; copies will be writable.
640 (copy-recursively #+gnuzilla-source "/tmp/gnuzilla"
641 #:log (%make-void-port "w"))
643 (with-directory-excursion "/tmp/gnuzilla"
644 (make-file-writable "makeicecat")
645 (invoke "patch" "--force" "--no-backup-if-mismatch"
646 "-p1" "--input" #+gnuzilla-fixes-patch)
647 (invoke "patch" "--force" "--no-backup-if-mismatch"
648 "-p1" "--input" #+makeicecat-patch)
649 (patch-shebang "makeicecat")
650 (substitute* "makeicecat"
651 (("^FFMAJOR=(.*)" all ffmajor)
652 (unless (string=? #$major-version
653 (string-trim-both ffmajor))
654 ;; The makeicecat script cannot be expected to work
655 ;; properly on a different version of Firefox, even if
656 ;; no errors occur during execution.
657 (error "makeicecat major version mismatch"))
658 (string-append "FFMAJOR=" #$major-version "\n"))
660 (string-append "FFMINOR=" #$minor-version "\n"))
662 (string-append "FFSUB=" #$sub-version "\n"))
664 "DATA=/tmp/gnuzilla/data\n")
666 #+(file-append (canonical-package sed) "/bin/sed"))))
668 (format #t "Unpacking upstream firefox tarball...~%")
670 (invoke "tar" "xf" #+upstream-firefox-source)
671 (rename-file firefox-dir icecat-dir)
673 (with-directory-excursion icecat-dir
674 (format #t "Populating l10n directory...~%")
677 (with-directory-excursion "l10n"
681 (string-drop (basename locale-dir)
682 (+ 32 ; length of hash
683 (string-length "-mozilla-locale-")))))
684 (format #t " ~a~%" locale)
686 (copy-recursively locale-dir locale
687 #:log (%make-void-port "w"))
688 (for-each make-file-writable (find-files locale))
689 (with-directory-excursion locale
690 (when (file-exists? ".hgtags")
691 (delete-file ".hgtags"))
692 (mkdir-p "browser/chrome/browser/preferences")
693 (call-with-output-file
694 "browser/chrome/browser/preferences/advanced-scripts.dtd"
695 (lambda (port) #f)))))
696 '#+all-mozilla-locales)
697 (copy-recursively #+mozilla-compare-locales
699 #:log (%make-void-port "w"))
700 (delete-file "compare-locales/.gitignore")
701 (delete-file "compare-locales/.hgignore")
702 (delete-file "compare-locales/.hgtags"))
704 (format #t "Running makeicecat script...~%")
706 (invoke "bash" "/tmp/gnuzilla/makeicecat"))
708 (format #t "Packing IceCat source tarball...~%")
710 (invoke "tar" "cfa" #$output
711 ;; Avoid non-determinism in the archive. We set the
712 ;; mtime of files in the archive to early 1980 because
713 ;; the build process fails if the mtime of source
714 ;; files is pre-1980, due to the creation of zip
716 "--mtime=@315619200" ; 1980-01-02 UTC
724 (define-public icecat
727 (version %icecat-version)
728 (source icecat-source)
729 (build-system gnu-build-system)
731 `(("alsa-lib" ,alsa-lib)
734 ("dbus-glib" ,dbus-glib)
735 ("gdk-pixbuf" ,gdk-pixbuf)
739 ;; UNBUNDLE-ME! ("graphite2" ,graphite2)
741 ("freetype" ,freetype)
742 ;; UNBUNDLE-ME! ("harfbuzz" ,harfbuzz)
743 ("libcanberra" ,libcanberra)
744 ("libgnome" ,libgnome)
745 ("libjpeg-turbo" ,libjpeg-turbo)
746 ;; UNBUNDLE-ME! ("libogg" ,libogg)
747 ;; UNBUNDLE-ME! ("libtheora" ,libtheora) ; wants theora-1.2, not yet released
748 ;; UNBUNDLE-ME! ("libvorbis" ,libvorbis)
750 ("libevent" ,libevent)
751 ("libxinerama" ,libxinerama)
752 ("libxscrnsaver" ,libxscrnsaver)
753 ("libxcomposite" ,libxcomposite)
757 ;; UNBUNDLE-ME! ("libvpx" ,libvpx)
760 ("pulseaudio" ,pulseaudio)
762 ("mit-krb5" ,mit-krb5)
763 ;; See <https://bugs.gnu.org/32833>
764 ;; and related comments in the 'remove-bundled-libraries' phase.
765 ;; UNBUNDLE-ME! ("nspr" ,nspr)
766 ;; UNBUNDLE-ME! ("nss" ,nss)
767 ("shared-mime-info" ,shared-mime-info)
768 ;; UNBUNDLE-ME! ("sqlite" ,sqlite)
771 ;; UNBUNDLE-ME! ("zlib" ,zlib)
774 ;; The following patches are specific to the Guix packaging of IceCat,
775 ;; and therefore we prefer to leave them out of 'source', which should be
776 ;; a tarball suitable for compilation on any system that IceCat supports.
777 ;; (Bug fixes and security fixes, however, should go in 'source').
778 `(;; XXX TODO: Adapt these patches to IceCat 68.
779 ;; ("icecat-avoid-bundled-libraries.patch"
780 ;; ,(search-patch "icecat-avoid-bundled-libraries.patch"))
781 ;; ("icecat-use-system-graphite2+harfbuzz.patch"
782 ;; ,(search-patch "icecat-use-system-graphite2+harfbuzz.patch"))
783 ;; ("icecat-use-system-media-libs.patch"
784 ;; ,(search-patch "icecat-use-system-media-libs.patch"))
786 ("patch" ,(canonical-package patch))
789 ("cargo" ,rust-1.41 "cargo")
790 ("rust-cbindgen" ,rust-cbindgen-0.14)
796 ("python-2" ,python-2)
797 ("python2-pysqlite" ,python2-pysqlite)
799 ("nasm" ,nasm) ; XXX FIXME: only needed on x86_64 and i686
800 ("pkg-config" ,pkg-config)
801 ("autoconf" ,autoconf-2.13)
804 `(#:tests? #f ; no check target
805 #:out-of-source? #t ; must be built outside of the source directory
807 ;; XXX: There are RUNPATH issues such as
808 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
809 ;; which is not in its RUNPATH, but they appear to be harmless in
810 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
811 #:validate-runpath? #f
813 #:configure-flags `("--enable-default-toolkit=cairo-gtk3-wayland"
815 "--with-distribution-id=org.gnu"
817 ;; Do not require addons in the global app or
818 ;; system directories to be signed by Mozilla.
819 "--with-unsigned-addon-scopes=app,system"
820 "--allow-addon-sideload"
822 "--enable-pulseaudio"
826 "--disable-crashreporter"
829 ;; Building with debugging symbols takes ~5GiB, so
832 "--disable-debug-symbols"
834 ;; Clang is needed to build Stylo, Mozilla's new
835 ;; CSS engine. We must specify the clang paths
836 ;; manually, because otherwise the Mozilla build
837 ;; system looks in the directories returned by
838 ;; llvm-config --bindir and llvm-config --libdir,
839 ;; which return paths in the llvm package where
840 ;; clang is not found.
841 ,(string-append "--with-clang-path="
842 (assoc-ref %build-inputs "clang")
844 ,(string-append "--with-libclang-path="
845 (assoc-ref %build-inputs "clang")
848 ;; Hack to work around missing
849 ;; "unofficial" branding in icecat.
850 "--enable-official-branding"
852 ;; Avoid bundled libraries.
853 "--with-system-jpeg" ; must be libjpeg-turbo
854 ;; UNBUNDLE-ME! "--with-system-zlib"
855 ;; UNBUNDLE-ME! "--with-system-bz2"
856 ;; UNBUNDLE-ME! "--with-system-libevent"
857 ;; UNBUNDLE-ME! "--with-system-ogg"
858 ;; UNBUNDLE-ME! "--with-system-vorbis"
859 ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released
860 ;; UNBUNDLE-ME! "--with-system-libvpx"
863 ;; See <https://bugs.gnu.org/32833>
864 ;; and related comments in the
865 ;; 'remove-bundled-libraries' phase below.
866 ;; UNBUNDLE-ME! "--with-system-nspr"
867 ;; UNBUNDLE-ME! "--with-system-nss"
869 ;; UNBUNDLE-ME! "--with-system-harfbuzz"
870 ;; UNBUNDLE-ME! "--with-system-graphite2"
871 "--enable-system-pixman"
872 "--enable-system-ffi"
873 ;; UNBUNDLE-ME! "--enable-system-sqlite"
875 ;; Fails with "--with-system-png won't work because
876 ;; the system's libpng doesn't have APNG support".
878 ;; http://sourceforge.net/projects/libpng-apng/ ,
879 ;; "the Animated Portable Network Graphics (APNG)
880 ;; is an unofficial extension of the Portable
881 ;; Network Graphics (PNG) format";
882 ;; we probably do not wish to support it.
883 ;; "--with-system-png"
886 #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
888 #:modules ((ice-9 ftw)
898 ,@%gnu-build-system-modules)
900 (modify-phases %standard-phases
901 (add-after 'unpack 'apply-guix-specific-patches
902 (lambda* (#:key inputs native-inputs #:allow-other-keys)
903 (let ((patch (string-append (assoc-ref (or native-inputs inputs)
906 (for-each (match-lambda
908 (when (and (string-prefix? "icecat-" label)
909 (string-suffix? ".patch" label))
910 (format #t "applying '~a'...~%" file)
911 (invoke patch "--force" "--no-backup-if-mismatch"
912 "-p1" "--input" file))))
913 (or native-inputs inputs)))
915 (add-after 'apply-guix-specific-patches 'remove-bundled-libraries
917 ;; Remove bundled libraries that we don't use, since they may
918 ;; contain unpatched security flaws, they waste disk space and
919 ;; memory, and may cause confusion.
920 (for-each (lambda (file)
921 (format #t "deleting '~a'...~%" file)
922 (delete-file-recursively file))
923 '(;; FIXME: Removing the bundled icu breaks configure.
924 ;; * The bundled icu headers are used in some places.
925 ;; * The version number is taken from the bundled copy.
928 ;; FIXME: A script from the bundled nspr is used.
931 ;; FIXME: With the update to IceCat 60, using system NSS
932 ;; broke certificate validation. See
933 ;; <https://bugs.gnu.org/32833>. For now, we use
934 ;; the bundled NSPR and NSS. TODO: Investigate,
935 ;; and try to unbundle these libraries again.
936 ;; UNBUNDLE-ME! "security/nss"
938 ;; TODO: Use more system media libraries. See:
939 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
940 ;; * libtheora: esr60 wants v1.2, not yet released.
941 ;; * soundtouch: avoiding the bundled library would
942 ;; result in some loss of functionality. There's
943 ;; also an issue with exception handling
944 ;; configuration. It seems that this is needed in
946 ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1
951 ;; "media/libjpeg" ; needed for now, because media/libjpeg/moz.build is referenced from config/external/moz.build
952 ;; UNBUNDLE-ME! "modules/zlib"
953 ;; UNBUNDLE-ME! "ipc/chromium/src/third_party/libevent"
954 ;; UNBUNDLE-ME! "media/libvpx"
955 ;; UNBUNDLE-ME! "media/libogg"
956 ;; UNBUNDLE-ME! "media/libvorbis"
957 ;; UNBUNDLE-ME! "media/libtheora" ; wants theora-1.2, not yet released
958 ;; UNBUNDLE-ME! "media/libtremor"
959 ;; UNBUNDLE-ME! "gfx/harfbuzz"
960 ;; UNBUNDLE-ME! "gfx/graphite2"
961 "js/src/ctypes/libffi"
962 ;; UNBUNDLE-ME! "db/sqlite3"
965 (add-after 'remove-bundled-libraries 'link-libxul-with-libraries
967 ;; libxul.so dynamically opens libraries, so here we explicitly
968 ;; link them into libxul.so instead.
970 ;; TODO: It might be preferable to patch in absolute file names in
971 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
972 ;; work. More investigation is needed.
973 (substitute* "toolkit/library/moz.build"
974 (("^# This library needs to be last" all)
975 (string-append "OS_LIBS += [
976 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
977 'avcodec', 'avutil', 'pulse' ]\n\n"
980 (add-after 'link-libxul-with-libraries 'fix-ffmpeg-runtime-linker
981 (lambda* (#:key inputs #:allow-other-keys)
982 (let* ((ffmpeg (assoc-ref inputs "ffmpeg"))
983 (libavcodec (string-append ffmpeg "/lib/libavcodec.so")))
984 ;; Arrange to load libavcodec.so by its absolute file name.
985 (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
988 ;; Populate the sandbox read-path whitelist as needed by ffmpeg.
989 (let* ((mime-info (assoc-ref inputs "shared-mime-info"))
990 (libavcodec-runpath (call-with-input-file libavcodec
991 (compose elf-dynamic-info-runpath
994 get-bytevector-all)))
995 (whitelist (cons (string-append mime-info "/share/mime/")
997 (string-append dir "/"))
998 libavcodec-runpath)))
999 (whitelist-string (string-join whitelist ","))
1000 (port (open-file "browser/app/profile/icecat.js" "a")))
1001 (format #t "setting 'security.sandbox.content.read_path_whitelist' to '~a'~%"
1003 (format port "~%pref(\"security.sandbox.content.read_path_whitelist\", ~S);~%"
1005 (close-output-port port))
1009 (invoke "sh" "-c" "autoconf old-configure.in > old-configure")
1010 ;; 'configure' must be newer than 'old-configure.in', or else the
1011 ;; build system will raise an alarm and abort.
1012 (invoke "touch" "configure")))
1013 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1015 (use-modules (guix build cargo-utils))
1016 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
1017 (for-each (lambda (file)
1018 (format #t "patching checksums in ~a~%" file)
1020 (("^checksum = \".*\"")
1021 (string-append "checksum = \"" null-hash "\""))))
1022 (find-files "." "Cargo.lock$"))
1023 (for-each generate-all-checksums
1035 "mozglue/static/rust"
1040 "security/manager/ssl"
1044 ;; configure does not work followed by both "SHELL=..." and
1045 ;; "CONFIG_SHELL=..."; set environment variables instead
1046 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1047 (let* ((out (assoc-ref outputs "out"))
1048 (bash (which "bash"))
1049 (abs-srcdir (getcwd))
1050 (srcdir (string-append "../" (basename abs-srcdir)))
1051 (flags `(,(string-append "--prefix=" out)
1052 ,(string-append "--with-l10n-base="
1054 ,@configure-flags)))
1055 (setenv "SHELL" bash)
1056 (setenv "CONFIG_SHELL" bash)
1057 (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13
1058 (setenv "CC" "gcc") ; apparently needed when Stylo is enabled
1059 (setenv "MOZ_BUILD_DATE" ,%icecat-build-id) ; avoid timestamp
1062 (format #t "build directory: ~s~%" (getcwd))
1063 (format #t "configure flags: ~s~%" flags)
1065 (string-append srcdir "/configure")
1068 ;; The build system often spuriously fails. See
1069 ;; <https://bugs.gentoo.org/show_bug.cgi?id=680934>. To
1070 ;; work around this, we try the standard 'build' phase up
1073 (let ((build (assoc-ref %standard-phases 'build)))
1074 (let retry ((remaining-attempts 5))
1075 (if (= remaining-attempts 1)
1077 (guard (c ((invoke-error? c)
1078 (format #t "~%Retrying build! (~a attempts remaining)~%~%"
1079 (- remaining-attempts 1))
1081 (retry (- remaining-attempts 1))))
1082 (apply build args)))))))
1083 (add-after 'build 'neutralise-store-references
1085 ;; Mangle the store references to compilers & other build tools in
1086 ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64.
1088 "dist/bin/chrome/toolkit/content/global/buildconfig.html"
1089 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1090 (regexp-quote (%store-directory)))
1092 (string-append store
1093 (string-take hash 8)
1094 "<!-- Guix: not a runtime dependency -->"
1095 (string-drop hash 8))))
1097 (add-before 'configure 'install-desktop-entry
1098 (lambda* (#:key outputs #:allow-other-keys)
1099 ;; Install the '.desktop' file.
1100 (let* ((desktop-file "taskcluster/docker/icecat-snap/icecat.desktop")
1101 (out (assoc-ref outputs "out"))
1102 (applications (string-append out "/share/applications")))
1103 (substitute* desktop-file
1104 (("^Exec=icecat") (string-append "Exec=" out "/bin/icecat"))
1105 (("IceCat") "GNU IceCat")
1106 (("Icon=.*") "Icon=icecat\n")
1107 (("NewWindow") "new-window")
1108 (("NewPrivateWindow") "new-private-window"))
1109 (install-file desktop-file applications)
1111 (add-after 'install-desktop-entry 'install-icons
1112 (lambda* (#:key outputs #:allow-other-keys)
1113 (let ((out (assoc-ref outputs "out")))
1114 (with-directory-excursion "browser/branding/official"
1117 (let* ((size (string-filter char-numeric? file))
1118 (icons (string-append out "/share/icons/hicolor/"
1119 size "x" size "/apps")))
1121 (copy-file file (string-append icons "/icecat.png"))))
1122 '("default16.png" "default22.png" "default24.png"
1123 "default32.png" "default48.png" "content/icon64.png"
1124 "mozicon128.png" "default256.png"))
1126 ;; This fixes the file chooser crash that happens with GTK 3.
1127 (add-after 'install 'wrap-program
1128 (lambda* (#:key inputs outputs #:allow-other-keys)
1129 (let* ((out (assoc-ref outputs "out"))
1130 (lib (string-append out "/lib"))
1131 (gtk (assoc-ref inputs "gtk+"))
1132 (gtk-share (string-append gtk "/share"))
1133 (mesa (assoc-ref inputs "mesa"))
1134 (mesa-lib (string-append mesa "/lib"))
1135 (pulseaudio (assoc-ref inputs "pulseaudio"))
1136 (pulseaudio-lib (string-append pulseaudio "/lib"))
1137 (libxscrnsaver (assoc-ref inputs "libxscrnsaver"))
1138 (libxscrnsaver-lib (string-append libxscrnsaver "/lib")))
1139 (wrap-program (car (find-files lib "^icecat$"))
1140 `("XDG_DATA_DIRS" prefix (,gtk-share))
1141 ;; The following line is commented out because the icecat
1142 ;; package on guix has been observed to be unstable when
1143 ;; using wayland, and the bundled extensions stop working.
1144 ;; `("MOZ_ENABLE_WAYLAND" = ("1"))
1145 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib ,mesa-lib ,libxscrnsaver-lib)))
1147 (home-page "https://www.gnu.org/software/gnuzilla/")
1148 (synopsis "Entirely free browser derived from Mozilla Firefox")
1150 "IceCat is the GNU version of the Firefox browser. It is entirely free
1151 software, which does not recommend non-free plugins and addons. It also
1152 features built-in privacy-protecting features.
1154 WARNING: IceCat 78 has not yet been released by the upstream IceCat project.
1155 This is a preview release, and does not currently meet the privacy-respecting
1156 standards of the IceCat project.")
1157 (license license:mpl2.0) ;and others, see toolkit/content/license.html
1159 `((ftp-directory . "/gnu/gnuzilla")
1160 (cpe-name . "firefox_esr")
1161 (cpe-version . ,(first (string-split version #\-)))))))
1163 ;; Update this together with icecat!
1164 (define %icedove-build-id "20201117000000") ;must be of the form YYYYMMDDhhmmss
1165 (define-public icedove
1169 (source icecat-source)
1171 `((cpe-name . "thunderbird_esr")))
1172 (build-system gnu-build-system)
1174 `(#:tests? #f ; no check target
1175 #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
1176 #:modules ((guix build utils) ;find-files
1179 ,@%gnu-build-system-modules)
1181 (modify-phases %standard-phases
1182 (add-after 'unpack 'prepare-thunderbird-sources
1183 (lambda* (#:key inputs #:allow-other-keys)
1185 (copy-recursively (assoc-ref inputs "thunderbird-sources")
1187 (delete-file-recursively "obj-x86_64-pc-linux-gnu")
1188 (delete-file "sourcestamp.txt")
1190 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1192 (use-modules (guix build cargo-utils))
1193 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
1194 (for-each (lambda (file)
1195 (format #t "patching checksums in ~a~%" file)
1197 (("^checksum = \".*\"")
1198 (string-append "checksum = \"" null-hash "\""))))
1199 (find-files "." "Cargo.lock$"))
1200 (for-each generate-all-checksums
1201 '("third_party/rust"
1202 "toolkit/library/rust")))
1204 ;; Fixes issue where each installation directory generates its own profile.
1205 ;; See e.g. https://trac.torproject.org/projects/tor/ticket/31457
1206 (add-after 'patch-source-shebangs 'fix-profile-setting
1208 (substitute* "comm/mail/moz.configure"
1209 (("'MOZ_DEDICATED_PROFILES', True")
1210 "'MOZ_DEDICATED_PROFILES', False"))
1212 (add-after 'prepare-thunderbird-sources 'rename-to-icedove
1214 (substitute* "comm/mail/confvars.sh"
1215 (("MOZ_APP_BASENAME=Thunderbird")
1216 "MOZ_APP_BASENAME=Icedove\nMOZ_APP_DISPLAYNAME=Icedove")
1217 (("MOZ_APP_NAME=thunderbird")
1218 "MOZ_APP_NAME=icedove")
1221 ;; Remove branding to comply with Mozilla's trademark policy
1222 (with-directory-excursion "comm/mail/branding/nightly"
1223 (delete-file "content/about-wordmark.svg")
1224 (call-with-output-file "content/about-wordmark.svg"
1226 (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg")
1227 (viewBox "0 0 789.1 90.78")
1231 (text (@ (x "400") (y "70")
1232 (text-anchor "middle")
1236 (substitute* '("locales/en-US/brand.properties"
1237 "locales/en-US/brand.ftl"
1238 "locales/en-US/brand.dtd"
1240 (("Thunderbird") "Icedove")
1241 (("mozilla.org") "guix.gnu.org")))
1242 ;; Remove other mentions of Thunderbird in user-visible text.
1243 (with-directory-excursion "comm/mail/base/content"
1244 (substitute* '("overrides/app-license-name.html")
1245 (("Thunderbird") "Icedove")))
1246 (with-directory-excursion "comm/mail/components/"
1247 (substitute* '("MailGlue.jsm"
1248 "extensions/schemas/addressBook.json"
1249 "extensions/schemas/tabs.json"
1250 "extensions/schemas/cloudFile.json"
1251 "extensions/schemas/chrome_settings_overrides.json"
1252 "extensions/schemas/windows.json"
1253 "extensions/parent/ext-mail.js"
1254 "im/messages/mail/Info.plist"
1255 "enterprisepolicies/moz.build"
1256 "enterprisepolicies/helpers/moz.build"
1257 "enterprisepolicies/schemas/moz.build")
1258 (("Thunderbird") "Icedove")))
1259 (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js"
1260 "comm/common/src/customizeToolbar.js")
1261 (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e)
1262 (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e)))
1264 ;; Override addon URLs and settings
1265 (substitute* "comm/mail/app/profile/all-thunderbird.js"
1266 (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m)
1267 (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");"))
1268 (("(pref\\(\"extensions.getAddons.search.url\").*" _ m)
1269 (string-append m ", \"https://guix.gnu.org/packages\");"))
1270 (("(pref\\(\"extensions.update.enabled\").*" _ m)
1271 (string-append m ", false);"))
1272 (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m)
1273 (string-append m ", false);"))
1274 (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m)
1275 (string-append m ", false);")))
1277 (add-after 'build 'neutralize-store-references
1279 ;; Mangle the store references to compilers & other build tools in
1280 ;; about:buildconfig, reducing Icedove's closure significant.
1281 ;; The resulting files are saved in lib/thunderbird/omni.ja
1283 ;; Use find because the path "obj-x86_64-pc-linux-gnu" contains
1284 ;; the architecture and the system -> more complicated.
1285 (find-files "." "buildconfig.html")
1286 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1287 (regexp-quote (%store-directory)))
1289 (string-append store
1290 (string-take hash 8)
1291 "<!-- Guix: not a runtime dependency -->"
1292 (string-drop hash 8))))
1295 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
1296 (let* ((out (assoc-ref outputs "out"))
1297 (bash (which "bash"))
1298 (abs-srcdir (getcwd))
1299 (srcdir (string-append "../" (basename abs-srcdir)))
1300 (flags `(,(string-append "--prefix=" out)
1302 (mozconfig (string-append (getcwd) "/.mozconfig")))
1303 (setenv "SHELL" bash)
1305 (string-append (assoc-ref %build-inputs
1308 (setenv "CONFIG_SHELL" bash)
1309 (setenv "QA_CONFIGURE_OPTIONS" ".*")
1310 (setenv "MOZBUILD_STATE_PATH"
1311 (string-append (getcwd) "/mach_state"))
1313 (string-append (getcwd) "/.mozconfig"))
1315 (setenv "MOZ_NOSPAM" "1")
1317 (string-append (assoc-ref inputs "python2")
1319 (setenv "MOZ_BUILD_DATE" ,%icedove-build-id) ; avoid timestamp
1320 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1321 (assoc-ref outputs "out")
1323 (mkdir-p (string-append (getcwd) "/builddir"))
1324 (with-output-to-file mozconfig
1328 "ac_add_options --disable-crashreporter\n"
1329 "ac_add_options --disable-debug\n"
1330 "ac_add_options --disable-debug-symbols\n"
1331 "ac_add_options --disable-elf-hack\n"
1332 "ac_add_options --disable-jit\n"
1333 "ac_add_options --disable-necko-wifi\n"
1334 "ac_add_options --disable-official-branding\n"
1335 "ac_add_options --disable-tests\n"
1336 "ac_add_options --disable-updater\n"
1337 "ac_add_options --disable-webrtc\n"
1338 "ac_add_options --enable-application=comm/mail\n"
1339 "ac_add_options --enable-calendar\n"
1340 "ac_add_options --enable-default-toolkit=\"cairo-gtk3\"\n"
1341 "ac_add_options --enable-optimize\n"
1342 "ac_add_options --enable-pulseaudio\n"
1343 "ac_add_options --enable-release\n"
1344 "ac_add_options --enable-strip\n"
1345 "ac_add_options --enable-system-ffi\n"
1346 "ac_add_options --enable-system-pixman\n"
1347 "ac_add_options --prefix=" out "\n"
1348 "ac_add_options --with-clang-path=" (assoc-ref %build-inputs "clang") "/bin/clang\n"
1349 "ac_add_options --with-distribution-id=org.gnu\n"
1350 "ac_add_options --with-libclang-path=" (assoc-ref %build-inputs "clang") "/lib\n"
1351 "ac_add_options --with-system-bz2\n"
1352 "ac_add_options --with-system-icu\n"
1353 "ac_add_options --with-system-jpeg\n"
1354 "ac_add_options --with-system-libevent\n"
1355 "ac_add_options --with-system-nspr\n"
1356 "ac_add_options --with-system-nss\n"
1357 "ac_add_options --with-system-zlib\n"
1358 "ac_add_options --with-user-appdir=\\.icedove\n"))))
1361 (display "mach configure")
1362 (invoke "./mach" "configure"))))
1364 (lambda _ (invoke "./mach" "build")))
1366 (lambda _ (invoke "./mach" "install")))
1367 ;; Thunderbird doesn't provide any .desktop file.
1368 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
1369 (add-after 'install 'install-desktop-file
1370 (lambda* (#:key outputs #:allow-other-keys)
1371 (let* ((out (assoc-ref outputs "out"))
1372 (apps (string-append out "/share/applications")))
1374 (with-output-to-file (string-append apps "/icedove.desktop")
1379 Exec=~a/bin/icedove~@
1381 GenericName=Mail/News Client~@
1382 Categories=Network;Email;~@
1384 StartupNotify=true~@
1385 MimeType=x-scheme-handler/mailto;~@
1387 Actions=ComposeMessage;~@
1388 [Desktop Action ComposeMessage]~@
1389 Name=Write new message~@
1390 Exec=~@*~a/bin/icedove -compose~%"
1393 (add-after 'install 'wrap-program
1394 (lambda* (#:key inputs outputs #:allow-other-keys)
1395 (let* ((out (assoc-ref outputs "out"))
1396 (lib (string-append out "/lib"))
1397 (gtk (assoc-ref inputs "gtk+"))
1398 (gtk-share (string-append gtk "/share"))
1399 (pulseaudio (assoc-ref inputs "pulseaudio"))
1400 (pulseaudio-lib (string-append pulseaudio "/lib")))
1401 (wrap-program (car (find-files lib "^icedove$"))
1402 `("XDG_DATA_DIRS" prefix (,gtk-share))
1403 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib)))
1409 ("dbus-glib" ,dbus-glib)
1411 ("freetype" ,freetype)
1412 ("gdk-pixbuf" ,gdk-pixbuf)
1416 ("hunspell" ,hunspell)
1418 ("libcanberra" ,libcanberra)
1419 ("libevent" ,libevent)
1421 ("libgnome" ,libgnome)
1422 ("libjpeg-turbo" ,libjpeg-turbo)
1423 ("libpng-apng" ,libpng-apng)
1425 ("libxcomposite" ,libxcomposite)
1427 ("libxinerama" ,libxinerama)
1428 ("libxscrnsaver" ,libxscrnsaver)
1431 ("mit-krb5" ,mit-krb5)
1436 ("pulseaudio" ,pulseaudio)
1438 ("startup-notification" ,startup-notification)
1443 `(("thunderbird-sources"
1444 ;; The changeset identifier is taken from the file "sourcestamp.txt"
1445 ;; in the Thunderbird release tarball. We don't use the release
1446 ;; tarball because it duplicates the Icecat sources and only adds the
1447 ;; "comm" directory, which is provided by this repository.
1448 ,(let ((changeset "92abc26b9c80383e974fb0234f22e06fea793be2"))
1452 (url "https://hg.mozilla.org/releases/comm-esr78")
1453 (changeset changeset)))
1454 (file-name (string-append "thunderbird-" version "-checkout"))
1457 "0468k3qrqs9w1vva2fdxvwqdsypqpsdy5iixgx58dqivchg4qlf9")))))
1458 ("autoconf" ,autoconf-2.13)
1459 ("cargo" ,rust-1.41 "cargo")
1463 ("node" ,node-10.22)
1465 ("pkg-config" ,pkg-config)
1467 ("python2" ,python-2.7)
1469 ("rust-cbindgen" ,rust-cbindgen-0.14)
1472 (home-page "https://www.thunderbird.net")
1473 (synopsis "Rebranded Mozilla Thunderbird email client")
1475 "This package provides an email client built based on Mozilla
1476 Thunderbird. It supports email, news feeds, chat, calendar and contacts.")
1477 (license license:mpl2.0)))
1479 (define-public icedove/wayland
1480 (package/inherit icedove
1481 (name "icedove-wayland")
1483 (substitute-keyword-arguments (package-arguments icedove)
1485 `(modify-phases ,phases
1486 (replace 'wrap-program
1487 (lambda* (#:key inputs outputs #:allow-other-keys)
1488 (let* ((out (assoc-ref outputs "out"))
1489 (lib (string-append out "/lib"))
1490 (gtk (assoc-ref inputs "gtk+"))
1491 (gtk-share (string-append gtk "/share"))
1492 (pulseaudio (assoc-ref inputs "pulseaudio"))
1493 (pulseaudio-lib (string-append pulseaudio "/lib")))
1494 (wrap-program (car (find-files lib "^icedove$"))
1495 `("MOZ_ENABLE_WAYLAND" = ("1"))
1496 `("XDG_DATA_DIRS" prefix (,gtk-share))
1497 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib)))
1500 (define-public firefox-decrypt
1502 (name "firefox-decrypt")
1507 (url "https://github.com/Unode/firefox_decrypt")
1509 (file-name (git-file-name name version))
1512 "17yyyxp47z4m8hnflcq34rc1y871515kr3f1y42j1l0yx3g0il07"))))
1513 (build-system trivial-build-system)
1516 ("python" ,python)))
1518 `(#:modules ((guix build utils))
1521 (use-modules (guix build utils))
1524 (assoc-ref %build-inputs "python") "/bin"))
1525 (copy-file (string-append (assoc-ref %build-inputs "source")
1526 "/firefox_decrypt.py")
1527 "firefox_decrypt.py")
1528 (substitute* "firefox_decrypt.py"
1529 (("/usr/bin/env python") (which "python3"))
1530 (("libnss3.so") (string-append (assoc-ref %build-inputs "nss")
1531 "/lib/nss/libnss3.so")))
1532 (install-file "firefox_decrypt.py" (string-append %output "/bin"))
1534 (home-page "https://github.com/Unode/firefox_decrypt/")
1535 (synopsis "Tool to extract passwords from Mozilla profiles")
1536 (description "Firefox Decrypt is a tool to extract passwords from
1537 Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.")
1538 (license license:gpl3+)))