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, 2021 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
6 ;;; Copyright © 2016, 2017, 2018, 2019, 2021 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>
17 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
18 ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
20 ;;; This file is part of GNU Guix.
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35 (define-module (gnu packages gnuzilla)
36 #:use-module ((srfi srfi-1) #:hide (zip))
37 #:use-module (ice-9 match)
38 #:use-module (gnu packages)
39 #:use-module ((guix licenses) #:prefix license:)
40 #:use-module (guix packages)
41 #:use-module (guix download)
42 #:use-module (guix git-download)
43 #:use-module (guix hg-download)
44 #:use-module (guix gexp)
45 #:use-module (guix store)
46 #:use-module (guix monads)
47 #:use-module (guix utils)
48 #:use-module (guix build-system gnu)
49 #:use-module (guix build-system cargo)
50 #:use-module (guix build-system trivial)
51 #:use-module (gnu packages admin)
52 #:use-module (gnu packages audio)
53 #:use-module (gnu packages autotools)
54 #:use-module (gnu packages base)
55 #:use-module (gnu packages bash)
56 #:use-module (gnu packages databases)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gtk)
59 #:use-module (gnu packages gnome)
60 #:use-module (gnu packages libcanberra)
61 #:use-module (gnu packages cups)
62 #:use-module (gnu packages kerberos)
63 #:use-module (gnu packages linux)
64 #:use-module (gnu packages perl)
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages compression)
67 #:use-module (gnu packages fontutils)
68 #:use-module (gnu packages libevent)
69 #:use-module (gnu packages libreoffice) ;for hunspell
70 #:use-module (gnu packages image)
71 #:use-module (gnu packages libffi)
72 #:use-module (gnu packages pulseaudio)
73 #:use-module (gnu packages python)
74 #:use-module (gnu packages python-xyz)
75 #:use-module (gnu packages node)
76 #:use-module (gnu packages xorg)
77 #:use-module (gnu packages gl)
78 #:use-module (gnu packages assembly)
79 #:use-module (gnu packages rust)
80 #:use-module (gnu packages rust-apps)
81 #:use-module (gnu packages llvm)
82 #:use-module (gnu packages nss)
83 #:use-module (gnu packages icu4c)
84 #:use-module (gnu packages video)
85 #:use-module (gnu packages xiph)
86 #:use-module (gnu packages xdisorg)
87 #:use-module (gnu packages readline)
88 #:use-module (gnu packages sqlite))
97 "https://ftp.mozilla.org/pub/mozilla.org/js/"
98 name version ".tar.gz"))
101 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))
102 (patches (search-patches "mozjs17-aarch64-support.patch"))
103 (modules '((guix build utils)))
105 ;; Fix incompatibility with Perl 5.22+.
107 (substitute* '("js/src/config/milestone.pl")
108 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE"))
110 (build-system gnu-build-system)
113 ("pkg-config" ,pkg-config)
114 ("python" ,python-2)))
116 `(("nspr" ,nspr))) ; in the Requires.private field of mozjs-17.0.pc
120 `(;; XXX: parallel build fails, lacking:
121 ;; mkdir -p "system_wrapper_js/"
123 #:make-flags '("CXXFLAGS=-fpermissive")
125 (modify-phases %standard-phases
126 (add-after 'unpack 'delete-timedout-test
127 ;; This test times out on slower hardware.
129 (delete-file "js/src/jit-test/tests/basic/bug698584.js")
131 (add-before 'configure 'chdir
136 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
137 (lambda* (#:key outputs #:allow-other-keys)
138 (let ((out (assoc-ref outputs "out")))
139 (setenv "SHELL" (which "sh"))
140 (setenv "CONFIG_SHELL" (which "sh"))
141 (invoke "./configure" (string-append "--prefix=" out)
142 ,@(if (string=? "aarch64-linux"
144 '("--host=aarch64-unknown-linux-gnu")
147 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey")
148 (synopsis "Mozilla javascript engine")
149 (description "SpiderMonkey is Mozilla's JavaScript engine written
151 (license license:mpl2.0))) ; and others for some files
153 (define-public mozjs-24
154 (package (inherit mozjs)
160 "https://ftp.mozilla.org/pub/mozilla.org/js/"
161 name "-" version ".tar.bz2"))
164 "1n1phk8r3l8icqrrap4czplnylawa0ddc2cc4cgdz46x3lrkybz6"))
165 (modules '((guix build utils)))
166 (patches (search-patches "mozjs24-aarch64-support.patch"))
168 ;; Fix incompatibility with Perl 5.22+.
170 (substitute* '("js/src/config/milestone.pl")
171 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE"))
174 (substitute-keyword-arguments (package-arguments mozjs)
176 `(modify-phases ,phases
178 (lambda* (#:key outputs #:allow-other-keys)
179 (let ((out (assoc-ref outputs "out")))
180 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
181 (setenv "SHELL" (which "sh"))
182 (setenv "CONFIG_SHELL" (which "sh"))
183 (invoke "./configure"
184 (string-append "--prefix=" out)
186 "--enable-system-ffi"
187 "--enable-threadsafe"
188 ,@(if (string=? "aarch64-linux"
190 '("--host=aarch64-unknown-linux-gnu")
196 (define-public mozjs-38
200 (version "38.2.1.rc0")
204 "https://anduin.linuxfromscratch.org/BLFS/mozjs/"
205 name "-" version ".tar.bz2"))
208 "0p4bmbpgkfsj54xschcny0a118jdrdgg0q29rwxigg3lh5slr681"))
211 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1269317 for
212 ;; GCC 6 compatibility.
214 "mozjs38-version-detection.patch" ; for 0ad
215 "mozjs38-tracelogger.patch"
217 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1339931.
218 "mozjs38-pkg-config-version.patch"
219 "mozjs38-shell-version.patch"))
220 (modules '((guix build utils)))
223 ;; Fix incompatibility with sed 4.4.
224 (substitute* "js/src/configure"
225 (("\\^\\[:space:\\]") "^[[:space:]]"))
227 ;; The headers are symlinks to files that are in /tmp, so they
228 ;; end up broken. Copy them instead.
230 "python/mozbuild/mozbuild/backend/recursivemake.py"
231 (("\\['dist_include'\\].add_symlink")
232 "['dist_include'].add_copy"))
234 ;; Remove bundled libraries.
235 (for-each delete-file-recursively
237 "js/src/ctypes/libffi"
238 "js/src/ctypes/libffi-patches"
242 `(;; XXX: parallel build fails, lacking:
243 ;; mkdir -p "system_wrapper_js/"
245 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1008470.
248 (modify-phases %standard-phases
250 (lambda* (#:key outputs #:allow-other-keys)
251 (let ((out (assoc-ref outputs "out")))
253 (setenv "SHELL" (which "sh"))
254 (setenv "CONFIG_SHELL" (which "sh"))
255 (invoke "./configure"
256 (string-append "--prefix=" out)
258 "--enable-gcgenerational"
263 "--enable-system-ffi"
264 "--enable-threadsafe"
265 "--enable-xterm-updates"
270 ;; Intl API requires bundled ICU.
271 "--without-intl-api")))))))
274 ("pkg-config" ,pkg-config)
275 ("python-2" ,python-2)))
278 ("readline" ,readline)
282 (define-public mozjs-52
283 ;; No releases yet at <https://archive.mozilla.org/pub/spidermonkey/releases/>.
284 ;; While we could take a snapshot of the complete mozilla-esr52 repository at
285 ;; <https://treeherder.mozilla.org/#/jobs?repo=mozilla-esr52&filter-searchStr=sm-tc>,
286 ;; we take the Debian version instead, because it is easier to work with.
287 (let ((commit "6507e63cc416fd7a3269e390efe712f8b56f374a")
289 (package (inherit mozjs-38)
290 (version (git-version "52.0" revision commit))
294 (url "https://salsa.debian.org/gnome-team/mozjs52.git")
296 (file-name (git-file-name "mozjs" version))
299 "1ny0s53r8wn4byys87h784xrq1xg767akmfm6gqrbvrz57mlm3q2"))))
301 `(#:tests? #f ; depends on repository metadata
308 "--enable-system-ffi"
313 ;; Intl API requires bundled ICU.
316 ;; Without this gnome-shell will crash at runtime.
317 "--disable-jemalloc")
319 (modify-phases %standard-phases
320 (add-after 'unpack 'patch-and-chdir
321 (lambda* (#:key inputs #:allow-other-keys)
322 ;; This patch prevents a segfault when executing JS_Init().
323 ;; The build does not fail without this patch, but the
324 ;; configure phase of the gjs package would fail.
325 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1176787
326 (make-file-writable "js/src/old-configure.in")
327 (make-file-writable "js/src/old-configure")
328 (make-file-writable "mozglue/build/moz.build")
329 (invoke "patch" "-p1" "--force"
330 "--input" "debian/patches/disable-mozglue.patch")
331 (invoke "touch" "js/src/configure")
335 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
336 ;; The configure script does not accept environment variables
338 (let ((out (assoc-ref outputs "out")))
339 (setenv "SHELL" (which "sh"))
340 (setenv "CONFIG_SHELL" (which "sh"))
341 (setenv "AUTOCONF" (which "autoconf"))
342 (apply invoke "./configure"
343 (cons (string-append "--prefix=" out)
344 configure-flags))))))))
346 `(("autoconf" ,autoconf-2.13)
347 ("automake" ,automake)
348 ,@(package-native-inputs mozjs-38))))))
350 (define-public mozjs-60
351 ;; No releases yet at <https://archive.mozilla.org/pub/spidermonkey/releases/>.
352 ;; While we could take a snapshot of the complete mozilla-esr60 repository at
353 ;; <https://treeherder.mozilla.org/#/jobs?repo=mozilla-esr60&filter-searchStr=sm-tc>,
354 ;; we take the Debian version instead, because it is easier to work with.
361 (url "https://salsa.debian.org/gnome-team/mozjs60.git")
362 (commit (string-append "debian/" version))))
363 (file-name (git-file-name "mozjs" version))
366 "1xl6avsj9gkgma71p56jzs7nasc767k3n1frnmri5pad4rj94bij"))))
368 `(#:tests? #f ; FIXME: all tests pass, but then the check phase fails anyway.
369 #:test-target "check-jstests"
376 "--enable-system-ffi"
381 ;; This is important because without it gjs will segfault during the
382 ;; configure phase. With jemalloc only the standalone mozjs console
384 "--disable-jemalloc")
386 (modify-phases %standard-phases
388 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
389 ;; The configure script does not accept environment variables as
390 ;; arguments. It also must be run from a different directory,
391 ;; but not the root directory either.
392 (let ((out (assoc-ref outputs "out")))
393 (mkdir "run-configure-from-here")
394 (chdir "run-configure-from-here")
395 (setenv "SHELL" (which "sh"))
396 (setenv "CONFIG_SHELL" (which "sh"))
397 (setenv "AUTOCONF" (which "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-public mozjs-78
422 ;; TODO: Switch to IceCat source once available on ftp.gnu.org.
423 (uri (string-append "https://archive.mozilla.org/pub/firefox"
424 "/releases/" version "esr/source/firefox-"
425 version "esr.source.tar.xz"))
428 "0gyg2p6i1wmmfghwg13pp6fj8j8xz6c14f6bbnf4pf0f5c3la7y4"))))
430 `(#:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
431 #:modules ((guix build cargo-utils)
432 ,@%gnu-build-system-modules)
433 #:test-target "check-jstests"
435 '(;; Disable debugging symbols to save space.
437 "--disable-debug-symbols"
438 ;; This is important because without it gjs will segfault during the
439 ;; configure phase. With jemalloc only the standalone mozjs console
454 (modify-phases %standard-phases
455 (add-after 'patch-source-shebangs 'patch-cargo-checksums
458 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
459 (for-each (lambda (file)
460 (format #t "patching checksums in ~a~%" file)
462 (("^checksum = \".*\"")
463 (string-append "checksum = \"" null-hash "\""))))
464 (find-files "." "Cargo\\.lock$"))
465 (for-each generate-all-checksums
466 '("js" "third_party/rust"))
469 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
470 ;; The configure script does not accept environment variables as
471 ;; arguments. It also must be run from a different directory,
472 ;; but not the root directory either.
473 (let ((out (assoc-ref outputs "out")))
474 (mkdir "run-configure-from-here")
475 (chdir "run-configure-from-here")
476 (setenv "SHELL" (which "sh"))
477 (setenv "CONFIG_SHELL" (which "sh"))
478 (setenv "AUTOCONF" (which "autoconf"))
479 (apply invoke "../js/src/configure"
480 (cons (string-append "--prefix=" out)
483 (add-after 'unpack 'adjust-for-icu-68
485 (with-directory-excursion "js/src/tests"
486 ;; The test suite expects a lightly patched ICU 67. Since
487 ;; Guix is about to switch to ICU 68, massage the tests to
488 ;; work with that instead of patching ICU. Try removing this
489 ;; phase for newer versions of mozjs.
491 ;; These tests look up locale names and expects to get
492 ;; "GB" instead of "UK".
493 (substitute* "non262/Intl/DisplayNames/language.js"
494 (("Traditionell, GB")
496 (substitute* "non262/Intl/DisplayNames/region.js"
500 ;; XXX: Some localized time formats have changed, and
501 ;; substitution fails for accented characters, even though
502 ;; it works in the REPL(?). Just delete these for now.
503 (delete-file "non262/Intl/Date/toLocaleString_timeZone.js")
504 (delete-file "non262/Intl/Date/toLocaleDateString_timeZone.js")
506 ;; Similarly, these get an unexpected "A" suffix when looking
507 ;; up a time in the "ar-MA-u-ca-islamicc" locale, which is
508 ;; tricky to substitute.
509 (delete-file "non262/Intl/DateTimeFormat/format_timeZone.js")
510 (delete-file "non262/Intl/DateTimeFormat/format.js")
512 ;; This file compares a generated list of ICU locale names
513 ;; with actual lookups. Some have changed slightly, i.e.
514 ;; daf-Latn-ZZ -> daf-Latn-CI, so drop it for simplicity.
515 (delete-file "non262/Intl/Locale/likely-subtags-generated.js"))
518 (add-before 'check 'pre-check
520 (with-directory-excursion "../js/src/tests"
521 (substitute* "shell/os.js"
522 ;; FIXME: Why does the killed process have an exit status?
523 ((".*killed process should not have exitStatus.*")
526 ;; XXX: Delete all tests that test time zone functionality,
527 ;; because the test suite uses /etc/localtime to figure out
528 ;; the offset from the hardware clock, which does not work
529 ;; in the build container. See <tests/non262/Date/shell.js>.
530 (delete-file-recursively "non262/Date")
531 (delete-file "non262/Intl/DateTimeFormat/tz-environment-variable.js")
533 (setenv "JSTESTS_EXTRA_ARGS"
536 ;; Do not run tests marked as "random".
538 ;; Exclude web platform tests.
540 ;; Respect the daemons configured number of jobs.
541 (string-append "--worker-count="
542 (number->string (parallel-job-count)))))))
545 `(("autoconf" ,autoconf-2.13)
546 ("automake" ,automake)
547 ("llvm" ,llvm) ;for llvm-objdump
549 ("pkg-config" ,pkg-config)
552 ("cargo" ,rust-1.41 "cargo")))
555 ("readline" ,readline)
558 (define mozilla-compare-locales
562 (url "https://hg.mozilla.org/l10n/compare-locales/")
563 (changeset "RELEASE_8_0_0")))
564 (file-name "mozilla-compare-locales")
565 (sha256 (base32 "0052wq92sg4i776x407b5838jx9h3phl9xy69m2q34f31n3gdyk2"))))
567 (define (mozilla-locale locale changeset hash-string)
571 (url (string-append "https://hg.mozilla.org/l10n-central/"
573 (changeset changeset)))
574 (file-name (string-append "mozilla-locale-" locale))
575 (sha256 (base32 hash-string))))
577 (define-syntax-rule (mozilla-locales (hash-string changeset locale) ...)
578 (list (mozilla-locale locale changeset hash-string)
581 (define all-mozilla-locales
583 ;; sha256 changeset locale
584 ;;---------------------------------------------------------------------------
585 ("1q1p7nl97478hkf1msbbcdh98k6fn87xwqihbw8np00ll5gk9k4v" "97cf3c155484" "ach")
586 ("0sajpblp639l448xywx7xlybjr5dm0rfrzx511a8pa9wn7dma4mf" "46929b4dda4e" "af")
587 ("04s756aaf1yyli1dn1vfdjymgyjs1pz2n7jvz76j27x4nzdgss7l" "96ffd2b04ba3" "an")
588 ("16nw7slm7irsnjf81r6zl273kbzri8sdbimzgzxwm0vh6xr61rgs" "1c4231166ddf" "ar")
589 ("0i0qrj4j8zjv55cisbmr21dp8mz933hc9wkpn3abz5k5pn84gpry" "bc4384b8be78" "ast")
590 ("1r77mmwg9x1jfa7g5lqa31rgyfrnix1zj80ibn5rq9gyhhsdrwbd" "dd56aead51fa" "az")
591 ("1kzjpy5bnvps8di72ksynhbhc9bpw1ml6hvphm74z8dz55ai4c18" "9d2bff64ddfb" "be")
592 ("1fygvjgph3siknfm7l0fh9y4ava72z1rxkip1zgmcdgq7jz8wzpf" "3808f4fe4db6" "bg")
593 ("1x9nlqia441xh04rhkmkw6qrgpwnyqw0grrf5n2qw96939wnmgl7" "5ca8752ed8df" "bn")
594 ("18yyxqzab44bgqx7h052d5nxyhv0l5bidgr16z1b3ak2crsfyx9q" "4c5d30ca9bf2" "br")
595 ("11bschjz7pgsm4r1qan5l4s3nkzm5jb0kivpp186wd1xsjci5bjb" "cf2478a7eae1" "bs")
596 ("12bak64nl6qi092l55xv330vh38mfsicrrf4wi693nn7zqb3mbpw" "4aa2cc349211" "ca")
597 ("0p97d7pnxqs971rr5c57i6cw3mx1mp3iasa0xdmdk0zpz9pjd3s4" "806914072144" "ca-valencia")
598 ("1rligf98h9r16mw3r3n5jalzi74xn2dnh6hkiixp7s2bvhjicwa4" "db2163383129" "cak")
599 ("18y5j8ljh72mj2nbx0m64mi3fyjbwyx992i004sv3zvs4d4z18w4" "d1d09eedddde" "cs")
600 ("12i4m9q6f8sl8arm8ja4gs4sl9m59p3kddlqi68srpz9mk66rqxz" "1caf58c64227" "cy")
601 ("16wacsd23zd4j0yi6vbj033wylia8hlpswx949x5hy1h9817j4vn" "9ef3b56aa243" "da")
602 ("1ddxnqpfi1wnciwmzkvvjinb51h22bg70r0dn7db17q64p4271rk" "a050b0eaec0a" "de")
603 ("0gw5h52rw3bc2lwffnv845sjwwj22gmabchmpa1rw2y6087dc7zk" "613135cb0759" "dsb")
604 ("0v17da37w1kbs73i6xql4c9xng6rfachyylpy3w8hpibpvi7i30n" "903db7c76b31" "el")
605 ("0ky1nj4kp070nriw0igsa64l39plcv2365zl8lqpbydyp6clwc3m" "6bb74673e9aa" "en-CA")
606 ("15jck6si2l4h5lrs8zjx56y97p70njpi26nnq6xfmvj1dk5qb4g2" "c06bd83a9295" "en-GB")
607 ("1gc400n8j8qk70vdw7fkf4m9yviia35cmj6361pxnyvsjrgm4qvm" "ae0fda5114c4" "eo")
608 ("0y01lahdrd3krsh6nrr3iw36r2x4advh5qw54vf92w11l3aiyvfz" "0c294dc9ce40" "es-AR")
609 ("16jjbsfa62dxk36ccziv7nmh26c1s0b05960in6zs5nnfrv4yh35" "7c30b2981fb4" "es-CL")
610 ("0qh8c8f8dsv1v56n1mcpn84l39bpnqfl8v8iacq12zh322srr549" "ad1444f4f833" "es-ES")
611 ("1vh3hm5r4ch6mk3ymbk12b9rppwc75fmbi0i7cml82kxsi77bzw5" "0a26cdb23536" "es-MX")
612 ("159l92jxx48lgba1g8ig3mdzhwsf3jpg3nx1g9blq4majk5hqr6q" "65a38a830795" "et")
613 ("1ha8y1wbgb66dqm26x1q2xwygy7bblkjz40y9vh5d2qlpr3fn0av" "21e0930b221d" "eu")
614 ("0rq4pcw6klm0bbljm1wdfvna8bpa35cm47hh2s63i2xdax4scahf" "5a4bb020cf09" "fa")
615 ("1py2594gsvpgrxnplz278ffb7grsf384kzjskrl1zyps0jw8fb1x" "4a4f712cd4aa" "ff")
616 ("1dyd55ngsglp1w2gh0yaacwb0vsq23gdvnj76f2x6g39h1li9s0z" "9c51cd915e2b" "fi")
617 ("0kimwivpq6pr63jh1k9fszsv8bi8vns3scg76mmnvbhh2ca8q7wj" "4f9e24a696ee" "fr")
618 ("1sbbnnp12lgy5qan2kix02942830b1969bd7jxrv7piwqfch9i06" "9e21a0eeb5b1" "fy-NL")
619 ("0dsvvyfrzkx5h44gqgdci7arb8h4lq48w20cnr8fc7j17grvnkzz" "999a995bc09d" "ga-IE")
620 ("1487msbsgrfzmyijhf6a4wbqdjpd7b7ki9nwrjjjjlnbw0h0ljpb" "6a9ddcab3240" "gd")
621 ("1kzc4fwr18kgisdzba2acj1ag8mxbifqpk5p30jv68nmvqfsvl8d" "51eb5e352db9" "gl")
622 ("13gy3wn44kcxr7j3sbl69fp415875f4vb0gm91hx0fysqlvryhcs" "b9de1ffe3224" "gn")
623 ("0w5nvzpjn5vr35c1852rlff581vpy71nc096cz125852kyqkzkc3" "5b3307475ada" "gu-IN")
624 ("1ycakc4qpy9vcy50j3ricryjfnjr9v3a5ijj6bbfl4y6aks157fy" "c742df968ffd" "he")
625 ("1b2jf83c500wm5wcdnijq0b7y4m8n6271smq8pygahn5nq17f0gq" "1a3039a52b8a" "hi-IN")
626 ("19bbw8ix5m83cf4yarcmjl7jqa8xfabwqnh3nj6vi52rwvn7whk5" "8dc50e269ef3" "hr")
627 ("12rrsvgg6bb2h8fhni7jbx8pv983q8ym5fhfjim957n9q2yp5db6" "67e40f48dec7" "hsb")
628 ("0apyh713p3hrlj8041xwblcssahbmsqp9v9hbmb50ayf4z850kr1" "40073a597b1b" "hu")
629 ("0q0r076lq250d3vmnz9d92wj137c2v8i362c2avmkgp5zr3mcl0z" "2ea33335afdb" "hy-AM")
630 ("0qza33gdc1i9259dwd2f7vd78s0a6rg34aqdkhcn7f2l6ybw6xd6" "930041db15eb" "ia")
631 ("1211h0gp7gianh3qf76w04gfzk4n2bnyc9i8dviyz0vh4cjbx11m" "08811a49b41c" "id")
632 ("12lcr841g1j7453s7gb51vrvxmshx4ha3h1jx4vh8wr891xv8l6a" "2f7a8d31e0ba" "is")
633 ("1x585g0r2kcv0d3phnxx85bk5g0pi1yl0hwp4idv19yc9hslr04s" "188357cc04b4" "it")
634 ("09v35g9v7j6x0p1hggydm3a1rmq2fh4z7g1l88z3w5k6wq2nhj1b" "45cee0ba4771" "ja")
635 ("0prs3vycfvvaffjigdgyxiq41ak2rc34lnan5a6cwdqjgy7z450s" "d60a19d9bf17" "ja-JP-mac")
636 ("1nskzm8rgczrbgcxlzzq5zqdfd456ad0cylq27nf0wjiyq6kjzcm" "00cb00e78672" "ka")
637 ("0g6zznmhiam172nm7g2qzfpk415mna8kiihm73z2sdns64xb3ymg" "77a293a4bced" "kab")
638 ("17dld9lrym7rpvpvnkssivp4wx1f11zpk86wczbq1h52qgd70p55" "2c9b33a56d5d" "kk")
639 ("1nlzl8930c8ql3yq425wyqlxvq8arrjv20xpm5g7yfxd54av89ac" "9cddd42af05c" "km")
640 ("07hkrcdksvrqk816yimd036dlw15nc4sjk4gmw16ywbp093v0mqq" "e0c2969a8398" "kn")
641 ("08aqggvk3qbv5bzks9i1iba9akhkpm01d2c9k0zf41mpr2r5yfg2" "827567d0dafc" "ko")
642 ("0vagaiwy80bs1k3gkacshlzb5zchkcshx0ypwirvayc63sw4yl8l" "694b2a24e868" "lij")
643 ("1r43kp1kzahrbza0hiyavqplk9h08pzsb6rpjy79jr6l1iqb89sy" "d6728db7e060" "lt")
644 ("0sq2wbsj79xl7fi454k6q5xdhxyck1whjz315rv37vphqpx86b9b" "61e9b33f4d94" "lv")
645 ("0q8jxg1af22hs9wjdf0jd3bqk4rafxyzvsjl35k75am7l2y1fl3c" "9e482f6dd72c" "mk")
646 ("1zsfzjrzbc58d30a9yz12h5vphywgpw8xg6y6zn3677a785dvr20" "1fd2763336a4" "mr")
647 ("1rzygkkpn1a59daygd3hdaqph2np6sqvpgh68j0xr4il958ymnsm" "67ddab62dab4" "ms")
648 ("16jp6w5gizfxs7jvncg3ly13m59vqvh4rlmjd0q23m5g5ff9sklc" "3ed015b51bf3" "my")
649 ("1wfv023j67lb4iyf49fsknwm4z3xy0xqcf25b2nzanggxj26n01x" "d01801233a8f" "nb-NO")
650 ("1946vfia58vbjfippb5pfsskbjj95w7hb340smn6ry2vmza99mxp" "582defb08fb2" "ne-NP")
651 ("12w5ywh4c3s55y3zqc48cp1gcpwwjg444yfh1bghhhb9ni1xkh5i" "05f6359a29a6" "nl")
652 ("17jb076320cgkw1ypwmws2vjxsqlv2ww8aaisa3j334vbrw1m4zx" "50b41a1ddded" "nn-NO")
653 ("1y840j0v5zdgj94cbacy6j1snf44rynmzxq3yk8i26arcar62akl" "a6a138531a44" "oc")
654 ("0jq1hq4xhqxpa26r8pb1bgbaljgfkhn9l6p5pbnslkllpbh70q6l" "e70a3afaef25" "pa-IN")
655 ("1hih138skwy2gb8q10ngg6zalrk3aa3d549mg79gqzxbi5zy19fw" "e035f33389eb" "pl")
656 ("1hhif4hx4k351wm1bzykzycfzb5q8msxmiwh5r1cy32rh8wkxwhh" "54098495f37f" "pt-BR")
657 ("0gkjs12rxjml1m3mljskpz1gr6aph0c31nwpwdqybfg54w9qslib" "3fdf021f624e" "pt-PT")
658 ("0anyvwd9v6mr8y3ww33s6qnxkawqn5lz65vrxx3m3kzky63ai1xk" "794f9374eb87" "rm")
659 ("1p4drj25gsfv7lwgm5saazh38iqrh53952n8i4bmxpn0nadbm2n5" "71ce18bcf6cc" "ro")
660 ("17yssf4axd3zvncl4ka4wkfnwcn0z0arp3390vb9cps67na29p36" "3a9587227699" "ru")
661 ("0xk6rksspcw1222v4rgk5a6gzrpx64k29hm7p9qkqwd70s34yj46" "c020582a72ce" "si")
662 ("1ax5ibydyn7sj208r66zcxlcr8dxdqrw28vqyjif4jx583rp4lfp" "745a699b7f51" "sk")
663 ("13rin7hm1dv8g0hbcv8mp2hiwpk1k5bhzvkqpqajkkik4lx523mc" "8e437e2351ef" "sl")
664 ("0yh5jkl5zw3f7x1w2w6zfj3dyvcl4wj1zv4di7qsq2nl2yyizf7x" "2d99e2eff94f" "son")
665 ("0vzq7s27jsdbw5k59wfykysg1kd8w229ab5d4zjdf30l59igkahh" "69bbdf07bd80" "sq")
666 ("1mwivvs8vrk6vjq6i33kwlrlisra7dy35521ayps9p2rz2dll4rr" "215df5c5125c" "sr")
667 ("0g97yz1rg5cfflj8vvq3sqliyvm06x818z9yldfh5rjg1y6n9fjd" "8be00a1a50d4" "sv-SE")
668 ("0ii02jn3lh2i6d0s95whx9aj6w3x8axc7w1rlzj0lc2s9n52krz3" "170a84339dbe" "ta")
669 ("1ss7symad2crapxjqc0xhc0n17l79r5vf7flvkgk7npjky4vb7nv" "72a79a304f7f" "te")
670 ("11iqmg8zamgscnvs4n2xpw3g9azn6w38qs313wiwm86pyx6694ss" "8e91ce3064c5" "th")
671 ("1zgkvn9flb8by62ip9r3gmpgxwgkww1zhml5mwa0djq3ppfdgi1c" "0f914d0cda56" "tl")
672 ("1filkhdak6dbrd83q602x1qw1703nlm53nm9gcyab8s16gsx6ylz" "62ca6a8eaeba" "tr")
673 ("0cgagdy0ixprk3knczdmkqxkmx4ybmshhh0956kxbd0iab0dfcf6" "f110ccac4cde" "trs")
674 ("1f1ghk67zwnwc5x3nk82vcv94nf8glngkfya1hg074q3088sj9pa" "56c0102d5f1c" "uk")
675 ("0iyw1b2jjylkdwxv9sxvj4ikxl64sx612b2dvvmf1di8bw86w74r" "7d53bce5ae98" "ur")
676 ("1q83cp5pfgs8l03zirwi8r5qp8qyh4zvxdx1ilgaqqlyg42yql7c" "9b500e1a054d" "uz")
677 ("1d4nkybz2hk64ay04k965b9lc5nhhpmzcs5ww3b6q4n93rf9c2z7" "2a000025928a" "vi")
678 ("1cnrsfnyl3sw3sxsggmjwydvphb2diy0vzknvxdhpnvq3ln18hga" "74724087c25b" "xh")
679 ("1j6l66v1xw27z8w78mpsnmqgv8m277mf4r0hgqcrb4zx7xc2vqyy" "527e5e090608" "zh-CN")
680 ("1frwx35klpyz3sdwrkz7945ivb2dwaawhhyfnz4092h9hn7rc4ky" "6cd366ad2947" "zh-TW")))
682 (define* (computed-origin-method gexp-promise hash-algo hash
683 #:optional (name "source")
684 #:key (system (%current-system))
685 (guile (default-guile)))
686 "Return a derivation that executes the G-expression that results
687 from forcing GEXP-PROMISE."
688 (mlet %store-monad ((guile (package->derivation guile system)))
689 (gexp->derivation (or name "computed-origin")
691 #:graft? #f ;nothing to graft
693 #:guile-for-build guile)))
695 (define %icecat-version "78.14.0-guix0-preview1")
696 (define %icecat-build-id "20210907000000") ;must be of the form YYYYMMDDhhmmss
698 ;; 'icecat-source' is a "computed" origin that generates an IceCat tarball
699 ;; from the corresponding upstream Firefox ESR tarball, using the 'makeicecat'
700 ;; script from the upstream IceCat project.
701 (define icecat-source
702 (let* ((base-version (first (string-split %icecat-version #\-)))
704 (major-version (first (string-split base-version #\.)))
705 (minor-version (second (string-split base-version #\.)))
706 (sub-version (third (string-split base-version #\.)))
708 (upstream-firefox-version (string-append base-version "esr"))
709 (upstream-firefox-source
713 "https://ftp.mozilla.org/pub/firefox/releases/"
714 upstream-firefox-version "/source/"
715 "firefox-" upstream-firefox-version ".source.tar.xz"))
718 "1ymjlg6p23c510m764pqr4sldrvk0c7g490a29js2cqc2nj2h3ma"))))
720 (upstream-icecat-base-version "78.7.0") ; maybe older than base-version
721 ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version))
722 (gnuzilla-commit "abfe5eebaca3c2787f1a9505669393674493c177")
727 (url "git://git.savannah.gnu.org/gnuzilla.git")
728 (commit gnuzilla-commit)))
729 (file-name (git-file-name "gnuzilla"
730 ;;upstream-icecat-base-version
731 (string-take gnuzilla-commit 8)))
734 "00ws3540x5whpicc5fx4k949ff73cqvajz6jp13ahn49wqdads47"))))
736 ;; 'search-patch' returns either a valid file name or #f, so wrap it
737 ;; in 'assume-valid-file-name' to avoid 'local-file' warnings.
738 (gnuzilla-fixes-patch
739 (local-file (assume-valid-file-name
740 (search-patch "icecat-use-older-reveal-hidden-html.patch"))))
742 (local-file (assume-valid-file-name
743 (search-patch "icecat-makeicecat.patch")))))
746 (method computed-origin-method)
747 (file-name (string-append "icecat-" %icecat-version ".tar.xz"))
751 (with-imported-modules '((guix build utils))
753 (use-modules (guix build utils))
755 (string-append "firefox-" #$base-version))
757 (string-append "icecat-" #$%icecat-version)))
760 (set-path-environment-variable
763 #+(canonical-package bash)
764 #+(canonical-package coreutils)
765 #+(canonical-package findutils)
766 #+(canonical-package patch)
767 #+(canonical-package xz)
768 #+(canonical-package sed)
769 #+(canonical-package grep)
770 #+(canonical-package bzip2)
771 #+(canonical-package gzip)
772 #+(canonical-package tar)
775 (symlink #+(file-append rename "/bin/rename")
778 ;; We copy the gnuzilla source directory because it is
779 ;; read-only in 'gnuzilla-source', and the makeicecat script
780 ;; uses "cp -a" to copy parts of it and assumes that the
781 ;; copies will be writable.
782 (copy-recursively #+gnuzilla-source "/tmp/gnuzilla"
783 #:log (%make-void-port "w"))
785 (with-directory-excursion "/tmp/gnuzilla"
786 (make-file-writable "makeicecat")
787 (invoke "patch" "--force" "--no-backup-if-mismatch"
788 "-p1" "--input" #+gnuzilla-fixes-patch)
789 (invoke "patch" "--force" "--no-backup-if-mismatch"
790 "-p1" "--input" #+makeicecat-patch)
791 (patch-shebang "makeicecat")
792 (substitute* "makeicecat"
793 (("^FFMAJOR=(.*)" all ffmajor)
794 (unless (string=? #$major-version
795 (string-trim-both ffmajor))
796 ;; The makeicecat script cannot be expected to work
797 ;; properly on a different version of Firefox, even if
798 ;; no errors occur during execution.
799 (error "makeicecat major version mismatch"))
800 (string-append "FFMAJOR=" #$major-version "\n"))
802 (string-append "FFMINOR=" #$minor-version "\n"))
804 (string-append "FFSUB=" #$sub-version "\n"))
806 "DATA=/tmp/gnuzilla/data\n")
808 #+(file-append (canonical-package sed) "/bin/sed"))))
810 (format #t "Unpacking upstream firefox tarball...~%")
812 (invoke "tar" "xf" #+upstream-firefox-source)
813 (rename-file firefox-dir icecat-dir)
815 (with-directory-excursion icecat-dir
816 (format #t "Populating l10n directory...~%")
819 (with-directory-excursion "l10n"
823 (string-drop (basename locale-dir)
824 (+ 32 ; length of hash
825 (string-length "-mozilla-locale-")))))
826 (format #t " ~a~%" locale)
828 (copy-recursively locale-dir locale
829 #:log (%make-void-port "w"))
830 (for-each make-file-writable (find-files locale))
831 (with-directory-excursion locale
832 (when (file-exists? ".hgtags")
833 (delete-file ".hgtags"))
834 (mkdir-p "browser/chrome/browser/preferences")
835 (call-with-output-file
836 "browser/chrome/browser/preferences/advanced-scripts.dtd"
837 (lambda (port) #f)))))
838 '#+all-mozilla-locales)
839 (copy-recursively #+mozilla-compare-locales
841 #:log (%make-void-port "w"))
842 (delete-file "compare-locales/.gitignore")
843 (delete-file "compare-locales/.hgignore")
844 (delete-file "compare-locales/.hgtags"))
846 (format #t "Running makeicecat script...~%")
848 (invoke "bash" "/tmp/gnuzilla/makeicecat"))
850 (format #t "Packing IceCat source tarball...~%")
852 (invoke "tar" "cfa" #$output
853 ;; Avoid non-determinism in the archive. We set the
854 ;; mtime of files in the archive to early 1980 because
855 ;; the build process fails if the mtime of source
856 ;; files is pre-1980, due to the creation of zip
858 "--mtime=@315619200" ; 1980-01-02 UTC
866 (define-public icecat
869 (version %icecat-version)
870 (source icecat-source)
871 (build-system gnu-build-system)
873 `(("alsa-lib" ,alsa-lib)
876 ("dbus-glib" ,dbus-glib)
877 ("gdk-pixbuf" ,gdk-pixbuf)
881 ;; UNBUNDLE-ME! ("graphite2" ,graphite2)
883 ("freetype" ,freetype)
884 ;; UNBUNDLE-ME! ("harfbuzz" ,harfbuzz)
885 ("libcanberra" ,libcanberra)
886 ("libgnome" ,libgnome)
887 ("libjpeg-turbo" ,libjpeg-turbo)
888 ;; UNBUNDLE-ME! ("libogg" ,libogg)
889 ;; UNBUNDLE-ME! ("libtheora" ,libtheora) ; wants theora-1.2, not yet released
890 ;; UNBUNDLE-ME! ("libvorbis" ,libvorbis)
892 ("libevent" ,libevent)
893 ("libxinerama" ,libxinerama)
894 ("libxscrnsaver" ,libxscrnsaver)
895 ("libxcomposite" ,libxcomposite)
899 ;; UNBUNDLE-ME! ("libvpx" ,libvpx)
902 ("pulseaudio" ,pulseaudio)
904 ("mit-krb5" ,mit-krb5)
905 ;; See <https://bugs.gnu.org/32833>
906 ;; and related comments in the 'remove-bundled-libraries' phase.
907 ;; UNBUNDLE-ME! ("nspr" ,nspr)
908 ;; UNBUNDLE-ME! ("nss" ,nss)
909 ("shared-mime-info" ,shared-mime-info)
910 ;; UNBUNDLE-ME! ("sqlite" ,sqlite)
914 ;; UNBUNDLE-ME! ("zlib" ,zlib)
917 ;; The following patches are specific to the Guix packaging of IceCat,
918 ;; and therefore we prefer to leave them out of 'source', which should be
919 ;; a tarball suitable for compilation on any system that IceCat supports.
920 ;; (Bug fixes and security fixes, however, should go in 'source').
921 `(;; XXX TODO: Adapt these patches to IceCat 68.
922 ;; ("icecat-avoid-bundled-libraries.patch"
923 ;; ,(search-patch "icecat-avoid-bundled-libraries.patch"))
924 ;; ("icecat-use-system-graphite2+harfbuzz.patch"
925 ;; ,(search-patch "icecat-use-system-graphite2+harfbuzz.patch"))
926 ;; ("icecat-use-system-media-libs.patch"
927 ;; ,(search-patch "icecat-use-system-media-libs.patch"))
929 ("patch" ,(canonical-package patch))
932 ("cargo" ,rust "cargo")
933 ("rust-cbindgen" ,rust-cbindgen-0.14)
939 ("python-2" ,python-2)
940 ("python2-pysqlite" ,python2-pysqlite)
942 ("nasm" ,nasm) ; XXX FIXME: only needed on x86_64 and i686
943 ("pkg-config" ,pkg-config)
944 ("autoconf" ,autoconf-2.13)
947 `(#:tests? #f ; no check target
948 #:out-of-source? #t ; must be built outside of the source directory
950 #:configure-flags `("--enable-default-toolkit=cairo-gtk3-wayland"
952 "--with-distribution-id=org.gnu"
954 ;; Do not require addons in the global app or
955 ;; system directories to be signed by Mozilla.
956 "--with-unsigned-addon-scopes=app,system"
957 "--allow-addon-sideload"
959 "--enable-pulseaudio"
963 "--disable-crashreporter"
966 ;; Building with debugging symbols takes ~5GiB, so
969 "--disable-debug-symbols"
971 ;; Clang is needed to build Stylo, Mozilla's new
972 ;; CSS engine. We must specify the clang paths
973 ;; manually, because otherwise the Mozilla build
974 ;; system looks in the directories returned by
975 ;; llvm-config --bindir and llvm-config --libdir,
976 ;; which return paths in the llvm package where
977 ;; clang is not found.
978 ,(string-append "--with-clang-path="
979 (assoc-ref %build-inputs "clang")
981 ,(string-append "--with-libclang-path="
982 (assoc-ref %build-inputs "clang")
985 ;; Hack to work around missing
986 ;; "unofficial" branding in icecat.
987 "--enable-official-branding"
989 ;; Avoid bundled libraries.
990 "--with-system-jpeg" ; must be libjpeg-turbo
991 ;; UNBUNDLE-ME! "--with-system-zlib"
992 ;; UNBUNDLE-ME! "--with-system-bz2"
993 ;; UNBUNDLE-ME! "--with-system-libevent"
994 ;; UNBUNDLE-ME! "--with-system-ogg"
995 ;; UNBUNDLE-ME! "--with-system-vorbis"
996 ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released
997 ;; UNBUNDLE-ME! "--with-system-libvpx"
1000 ;; See <https://bugs.gnu.org/32833>
1001 ;; and related comments in the
1002 ;; 'remove-bundled-libraries' phase below.
1003 ;; UNBUNDLE-ME! "--with-system-nspr"
1004 ;; UNBUNDLE-ME! "--with-system-nss"
1006 ;; UNBUNDLE-ME! "--with-system-harfbuzz"
1007 ;; UNBUNDLE-ME! "--with-system-graphite2"
1008 "--enable-system-pixman"
1009 "--enable-system-ffi"
1010 ;; UNBUNDLE-ME! "--enable-system-sqlite"
1012 ;; Fails with "--with-system-png won't work because
1013 ;; the system's libpng doesn't have APNG support".
1015 ;; http://sourceforge.net/projects/libpng-apng/ ,
1016 ;; "the Animated Portable Network Graphics (APNG)
1017 ;; is an unofficial extension of the Portable
1018 ;; Network Graphics (PNG) format";
1019 ;; we probably do not wish to support it.
1020 ;; "--with-system-png"
1023 #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
1025 #:modules ((ice-9 ftw)
1034 (guix build gremlin)
1035 ,@%gnu-build-system-modules)
1037 (modify-phases %standard-phases
1038 (add-after 'unpack 'apply-guix-specific-patches
1039 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1040 (let ((patch (string-append (assoc-ref (or native-inputs inputs)
1043 (for-each (match-lambda
1045 (when (and (string-prefix? "icecat-" label)
1046 (string-suffix? ".patch" label))
1047 (format #t "applying '~a'...~%" file)
1048 (invoke patch "--force" "--no-backup-if-mismatch"
1049 "-p1" "--input" file))))
1050 (or native-inputs inputs)))
1052 (add-after 'apply-guix-specific-patches 'remove-bundled-libraries
1054 ;; Remove bundled libraries that we don't use, since they may
1055 ;; contain unpatched security flaws, they waste disk space and
1056 ;; memory, and may cause confusion.
1057 (for-each (lambda (file)
1058 (format #t "deleting '~a'...~%" file)
1059 (delete-file-recursively file))
1060 '(;; FIXME: Removing the bundled icu breaks configure.
1061 ;; * The bundled icu headers are used in some places.
1062 ;; * The version number is taken from the bundled copy.
1065 ;; FIXME: A script from the bundled nspr is used.
1068 ;; FIXME: With the update to IceCat 60, using system NSS
1069 ;; broke certificate validation. See
1070 ;; <https://bugs.gnu.org/32833>. For now, we use
1071 ;; the bundled NSPR and NSS. TODO: Investigate,
1072 ;; and try to unbundle these libraries again.
1073 ;; UNBUNDLE-ME! "security/nss"
1075 ;; TODO: Use more system media libraries. See:
1076 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
1077 ;; * libtheora: esr60 wants v1.2, not yet released.
1078 ;; * soundtouch: avoiding the bundled library would
1079 ;; result in some loss of functionality. There's
1080 ;; also an issue with exception handling
1081 ;; configuration. It seems that this is needed in
1083 ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1
1088 ;; "media/libjpeg" ; needed for now, because media/libjpeg/moz.build is referenced from config/external/moz.build
1089 ;; UNBUNDLE-ME! "modules/zlib"
1090 ;; UNBUNDLE-ME! "ipc/chromium/src/third_party/libevent"
1091 ;; UNBUNDLE-ME! "media/libvpx"
1092 ;; UNBUNDLE-ME! "media/libogg"
1093 ;; UNBUNDLE-ME! "media/libvorbis"
1094 ;; UNBUNDLE-ME! "media/libtheora" ; wants theora-1.2, not yet released
1095 ;; UNBUNDLE-ME! "media/libtremor"
1096 ;; UNBUNDLE-ME! "gfx/harfbuzz"
1097 ;; UNBUNDLE-ME! "gfx/graphite2"
1098 "js/src/ctypes/libffi"
1099 ;; UNBUNDLE-ME! "db/sqlite3"
1102 (add-after 'remove-bundled-libraries 'link-libxul-with-libraries
1104 ;; libxul.so dynamically opens libraries, so here we explicitly
1105 ;; link them into libxul.so instead.
1107 ;; TODO: It might be preferable to patch in absolute file names in
1108 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
1109 ;; work. More investigation is needed.
1110 (substitute* "toolkit/library/moz.build"
1111 (("^# This library needs to be last" all)
1112 (string-append "OS_LIBS += [
1113 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
1114 'avcodec', 'avutil', 'pulse' ]\n\n"
1117 (add-after 'link-libxul-with-libraries 'fix-ffmpeg-runtime-linker
1118 (lambda* (#:key inputs #:allow-other-keys)
1119 (let* ((ffmpeg (assoc-ref inputs "ffmpeg"))
1120 (libavcodec (string-append ffmpeg "/lib/libavcodec.so")))
1121 ;; Arrange to load libavcodec.so by its absolute file name.
1122 (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
1123 (("libavcodec\\.so")
1125 ;; Populate the sandbox read-path whitelist as needed by ffmpeg.
1126 (let* ((mime-info (assoc-ref inputs "shared-mime-info"))
1127 (libavcodec-runpath (call-with-input-file libavcodec
1128 (compose elf-dynamic-info-runpath
1131 get-bytevector-all)))
1132 (whitelist (cons (string-append mime-info "/share/mime/")
1134 (string-append dir "/"))
1135 libavcodec-runpath)))
1136 (whitelist-string (string-join whitelist ","))
1137 (port (open-file "browser/app/profile/icecat.js" "a")))
1138 (format #t "setting 'security.sandbox.content.read_path_whitelist' to '~a'~%"
1140 (format port "~%pref(\"security.sandbox.content.read_path_whitelist\", ~S);~%"
1142 (close-output-port port))
1146 (invoke "sh" "-c" "autoconf old-configure.in > old-configure")
1147 ;; 'configure' must be newer than 'old-configure.in', or else the
1148 ;; build system will raise an alarm and abort.
1149 (invoke "touch" "configure")))
1150 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1152 (use-modules (guix build cargo-utils))
1153 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
1154 (for-each (lambda (file)
1155 (format #t "patching checksums in ~a~%" file)
1157 (("^checksum = \".*\"")
1158 (string-append "checksum = \"" null-hash "\""))))
1159 (find-files "." "Cargo.lock$"))
1160 (for-each generate-all-checksums
1172 "mozglue/static/rust"
1177 "security/manager/ssl"
1181 ;; configure does not work followed by both "SHELL=..." and
1182 ;; "CONFIG_SHELL=..."; set environment variables instead
1183 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1184 (let* ((out (assoc-ref outputs "out"))
1185 (bash (which "bash"))
1186 (abs-srcdir (getcwd))
1187 (srcdir (string-append "../" (basename abs-srcdir)))
1188 (flags `(,(string-append "--prefix=" out)
1189 ,(string-append "--with-l10n-base="
1191 ,@configure-flags)))
1192 (setenv "SHELL" bash)
1193 (setenv "CONFIG_SHELL" bash)
1194 (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13
1195 (setenv "CC" "gcc") ; apparently needed when Stylo is enabled
1196 (setenv "MOZ_BUILD_DATE" ,%icecat-build-id) ; avoid timestamp
1197 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1198 (assoc-ref outputs "out")
1202 (format #t "build directory: ~s~%" (getcwd))
1203 (format #t "configure flags: ~s~%" flags)
1205 (string-append srcdir "/configure")
1208 ;; The build system often spuriously fails. See
1209 ;; <https://bugs.gentoo.org/show_bug.cgi?id=680934>. To
1210 ;; work around this, we try the standard 'build' phase up
1213 (let ((build (assoc-ref %standard-phases 'build)))
1214 (let retry ((remaining-attempts 5))
1215 (if (= remaining-attempts 1)
1217 (guard (c ((invoke-error? c)
1218 (format #t "~%Retrying build! (~a attempts remaining)~%~%"
1219 (- remaining-attempts 1))
1221 (retry (- remaining-attempts 1))))
1222 (apply build args)))))))
1223 (add-after 'build 'neutralise-store-references
1225 ;; Mangle the store references to compilers & other build tools in
1226 ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64.
1228 "dist/bin/chrome/toolkit/content/global/buildconfig.html"
1229 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1230 (regexp-quote (%store-directory)))
1232 (string-append store
1233 (string-take hash 8)
1234 "<!-- Guix: not a runtime dependency -->"
1235 (string-drop hash 8))))
1237 (add-before 'configure 'install-desktop-entry
1238 (lambda* (#:key outputs #:allow-other-keys)
1239 ;; Install the '.desktop' file.
1240 (let* ((desktop-file "taskcluster/docker/icecat-snap/icecat.desktop")
1241 (out (assoc-ref outputs "out"))
1242 (applications (string-append out "/share/applications")))
1243 (substitute* desktop-file
1244 (("^Exec=icecat") (string-append "Exec=" out "/bin/icecat"))
1245 (("IceCat") "GNU IceCat")
1246 (("Icon=.*") "Icon=icecat\n")
1247 (("NewWindow") "new-window")
1248 (("NewPrivateWindow") "new-private-window"))
1249 (install-file desktop-file applications)
1251 (add-after 'install-desktop-entry 'install-icons
1252 (lambda* (#:key outputs #:allow-other-keys)
1253 (let ((out (assoc-ref outputs "out")))
1254 (with-directory-excursion "browser/branding/official"
1257 (let* ((size (string-filter char-numeric? file))
1258 (icons (string-append out "/share/icons/hicolor/"
1259 size "x" size "/apps")))
1261 (copy-file file (string-append icons "/icecat.png"))))
1262 '("default16.png" "default22.png" "default24.png"
1263 "default32.png" "default48.png" "content/icon64.png"
1264 "mozicon128.png" "default256.png"))
1266 ;; This fixes the file chooser crash that happens with GTK 3.
1267 (add-after 'install 'wrap-program
1268 (lambda* (#:key inputs outputs #:allow-other-keys)
1269 (let* ((out (assoc-ref outputs "out"))
1270 (lib (string-append out "/lib"))
1271 (gtk (assoc-ref inputs "gtk+"))
1272 (gtk-share (string-append gtk "/share"))
1273 (ld-libs (map (lambda (lib)
1274 (string-append (assoc-ref inputs lib)
1281 (wrap-program (car (find-files lib "^icecat$"))
1282 `("XDG_DATA_DIRS" prefix (,gtk-share))
1283 ;; The following line is commented out because the icecat
1284 ;; package on guix has been observed to be unstable when
1285 ;; using wayland, and the bundled extensions stop working.
1286 ;; `("MOZ_ENABLE_WAYLAND" = ("1"))
1287 `("LD_LIBRARY_PATH" prefix ,ld-libs))
1289 (home-page "https://www.gnu.org/software/gnuzilla/")
1290 (synopsis "Entirely free browser derived from Mozilla Firefox")
1292 "IceCat is the GNU version of the Firefox browser. It is entirely free
1293 software, which does not recommend non-free plugins and addons. It also
1294 features built-in privacy-protecting features.
1296 WARNING: IceCat 78 has not yet been released by the upstream IceCat project.
1297 This is a preview release, and does not currently meet the privacy-respecting
1298 standards of the IceCat project.")
1299 (license license:mpl2.0) ;and others, see toolkit/content/license.html
1301 `((ftp-directory . "/gnu/gnuzilla")
1302 (cpe-name . "firefox_esr")
1303 (cpe-version . ,(first (string-split version #\-)))))))
1305 ;; Update this together with icecat!
1306 (define %icedove-build-id "20210810000000") ;must be of the form YYYYMMDDhhmmss
1307 (define-public icedove
1311 (source icecat-source)
1313 `((cpe-name . "thunderbird_esr")))
1314 (build-system gnu-build-system)
1316 `(#:tests? #f ; no check target
1317 #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
1318 #:modules ((guix build utils) ;find-files
1321 ,@%gnu-build-system-modules)
1323 (modify-phases %standard-phases
1324 (add-after 'unpack 'prepare-thunderbird-sources
1325 (lambda* (#:key inputs #:allow-other-keys)
1327 (copy-recursively (assoc-ref inputs "thunderbird-sources")
1329 (delete-file-recursively "obj-x86_64-pc-linux-gnu")
1330 (delete-file "sourcestamp.txt")
1332 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1334 (use-modules (guix build cargo-utils))
1335 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
1336 (for-each (lambda (file)
1337 (format #t "patching checksums in ~a~%" file)
1339 (("^checksum = \".*\"")
1340 (string-append "checksum = \"" null-hash "\""))))
1341 (find-files "." "Cargo.lock$"))
1342 (for-each generate-all-checksums
1343 '("third_party/rust"
1344 "toolkit/library/rust")))
1346 ;; Fixes issue where each installation directory generates its own profile.
1347 ;; See e.g. https://trac.torproject.org/projects/tor/ticket/31457
1348 (add-after 'patch-source-shebangs 'fix-profile-setting
1350 (substitute* "comm/mail/moz.configure"
1351 (("'MOZ_DEDICATED_PROFILES', True")
1352 "'MOZ_DEDICATED_PROFILES', False"))
1354 (add-after 'prepare-thunderbird-sources 'rename-to-icedove
1356 (substitute* "comm/mail/confvars.sh"
1357 (("MOZ_APP_BASENAME=Thunderbird")
1358 "MOZ_APP_BASENAME=Icedove\nMOZ_APP_DISPLAYNAME=Icedove")
1359 (("MOZ_APP_NAME=thunderbird")
1360 "MOZ_APP_NAME=icedove")
1363 ;; Remove branding to comply with Mozilla's trademark policy
1364 (with-directory-excursion "comm/mail/branding/nightly"
1365 (delete-file "content/about-wordmark.svg")
1366 (call-with-output-file "content/about-wordmark.svg"
1368 (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg")
1369 (viewBox "0 0 789.1 90.78")
1373 (text (@ (x "400") (y "70")
1374 (text-anchor "middle")
1378 (substitute* '("locales/en-US/brand.properties"
1379 "locales/en-US/brand.ftl"
1380 "locales/en-US/brand.dtd"
1382 (("Thunderbird") "Icedove")
1383 (("mozilla.org") "guix.gnu.org")))
1384 ;; Remove other mentions of Thunderbird in user-visible text.
1385 (with-directory-excursion "comm/mail/base/content"
1386 (substitute* '("overrides/app-license-name.html")
1387 (("Thunderbird") "Icedove")))
1388 (with-directory-excursion "comm/mail/components/"
1389 (substitute* '("MailGlue.jsm"
1390 "extensions/schemas/addressBook.json"
1391 "extensions/schemas/tabs.json"
1392 "extensions/schemas/cloudFile.json"
1393 "extensions/schemas/chrome_settings_overrides.json"
1394 "extensions/schemas/windows.json"
1395 "extensions/parent/ext-mail.js"
1396 "im/messages/mail/Info.plist"
1397 "enterprisepolicies/moz.build"
1398 "enterprisepolicies/helpers/moz.build"
1399 "enterprisepolicies/schemas/moz.build")
1400 (("Thunderbird") "Icedove")))
1401 (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js"
1402 "comm/common/src/customizeToolbar.js")
1403 (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e)
1404 (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e)))
1406 ;; Override addon URLs and settings
1407 (substitute* "comm/mail/app/profile/all-thunderbird.js"
1408 (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m)
1409 (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");"))
1410 (("(pref\\(\"extensions.getAddons.search.url\").*" _ m)
1411 (string-append m ", \"https://guix.gnu.org/packages\");"))
1412 (("(pref\\(\"extensions.update.enabled\").*" _ m)
1413 (string-append m ", false);"))
1414 (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m)
1415 (string-append m ", false);"))
1416 (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m)
1417 (string-append m ", false);")))
1419 (add-after 'build 'neutralize-store-references
1421 ;; Mangle the store references to compilers & other build tools in
1422 ;; about:buildconfig, reducing Icedove's closure significant.
1423 ;; The resulting files are saved in lib/thunderbird/omni.ja
1425 ;; Use find because the path "obj-x86_64-pc-linux-gnu" contains
1426 ;; the architecture and the system -> more complicated.
1427 (find-files "." "buildconfig.html")
1428 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1429 (regexp-quote (%store-directory)))
1431 (string-append store
1432 (string-take hash 8)
1433 "<!-- Guix: not a runtime dependency -->"
1434 (string-drop hash 8))))
1437 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
1438 (let* ((out (assoc-ref outputs "out"))
1439 (bash (which "bash"))
1440 (abs-srcdir (getcwd))
1441 (srcdir (string-append "../" (basename abs-srcdir)))
1442 (flags `(,(string-append "--prefix=" out)
1444 (mozconfig (string-append (getcwd) "/.mozconfig")))
1445 (setenv "SHELL" bash)
1447 (string-append (assoc-ref %build-inputs
1450 (setenv "CONFIG_SHELL" bash)
1451 (setenv "QA_CONFIGURE_OPTIONS" ".*")
1452 (setenv "MOZBUILD_STATE_PATH"
1453 (string-append (getcwd) "/mach_state"))
1455 (string-append (getcwd) "/.mozconfig"))
1457 (setenv "MOZ_NOSPAM" "1")
1459 (search-input-file inputs "/bin/python"))
1460 (setenv "MOZ_BUILD_DATE" ,%icedove-build-id) ; avoid timestamp
1461 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1462 (assoc-ref outputs "out")
1464 (mkdir-p (string-append (getcwd) "/builddir"))
1465 (with-output-to-file mozconfig
1469 "ac_add_options --disable-crashreporter\n"
1470 "ac_add_options --disable-debug\n"
1471 "ac_add_options --disable-debug-symbols\n"
1472 "ac_add_options --disable-elf-hack\n"
1473 "ac_add_options --disable-jit\n"
1474 "ac_add_options --disable-necko-wifi\n"
1475 "ac_add_options --disable-official-branding\n"
1476 "ac_add_options --disable-tests\n"
1477 "ac_add_options --disable-updater\n"
1478 "ac_add_options --disable-webrtc\n"
1479 "ac_add_options --enable-application=comm/mail\n"
1480 "ac_add_options --enable-calendar\n"
1481 "ac_add_options --enable-default-toolkit=\"cairo-gtk3\"\n"
1482 "ac_add_options --enable-optimize\n"
1483 "ac_add_options --enable-pulseaudio\n"
1484 "ac_add_options --enable-release\n"
1485 "ac_add_options --enable-strip\n"
1486 "ac_add_options --enable-system-ffi\n"
1487 "ac_add_options --enable-system-pixman\n"
1488 "ac_add_options --prefix=" out "\n"
1489 "ac_add_options --with-clang-path=" (assoc-ref %build-inputs "clang") "/bin/clang\n"
1490 "ac_add_options --with-distribution-id=org.gnu\n"
1491 "ac_add_options --with-libclang-path=" (assoc-ref %build-inputs "clang") "/lib\n"
1492 "ac_add_options --with-system-bz2\n"
1493 "ac_add_options --with-system-icu\n"
1494 "ac_add_options --with-system-jpeg\n"
1495 "ac_add_options --with-system-libevent\n"
1496 "ac_add_options --with-system-nspr\n"
1497 "ac_add_options --with-system-nss\n"
1498 "ac_add_options --with-system-zlib\n"
1499 "ac_add_options --with-user-appdir=\\.icedove\n"
1500 "mk_add_options MOZ_MAKE_FLAGS=-j"
1501 (number->string (parallel-job-count)) "\n"))))
1504 (display "mach configure")
1505 (invoke "./mach" "configure"))))
1507 (lambda _ (invoke "./mach" "build")))
1509 (lambda _ (invoke "./mach" "install")))
1510 ;; Thunderbird doesn't provide any .desktop file.
1511 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
1512 (add-after 'install 'install-desktop-file
1513 (lambda* (#:key outputs #:allow-other-keys)
1514 (let* ((out (assoc-ref outputs "out"))
1515 (apps (string-append out "/share/applications")))
1517 (with-output-to-file (string-append apps "/icedove.desktop")
1522 Exec=~a/bin/icedove~@
1524 GenericName=Mail/News Client~@
1525 Categories=Network;Email;~@
1527 StartupNotify=true~@
1528 MimeType=x-scheme-handler/mailto;~@
1530 Actions=ComposeMessage;~@
1531 [Desktop Action ComposeMessage]~@
1532 Name=Write new message~@
1533 Exec=~@*~a/bin/icedove -compose~%"
1536 (add-after 'install 'wrap-program
1537 (lambda* (#:key inputs outputs #:allow-other-keys)
1538 (let* ((out (assoc-ref outputs "out"))
1539 (lib (string-append out "/lib"))
1540 (gtk (assoc-ref inputs "gtk+"))
1541 (gtk-share (string-append gtk "/share"))
1542 (pulseaudio (assoc-ref inputs "pulseaudio"))
1543 (pulseaudio-lib (string-append pulseaudio "/lib"))
1544 (eudev (assoc-ref inputs "eudev"))
1545 (eudev-lib (string-append eudev "/lib")))
1546 (wrap-program (car (find-files lib "^icedove$"))
1547 `("XDG_DATA_DIRS" prefix (,gtk-share))
1548 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib ,eudev-lib)))
1554 ("dbus-glib" ,dbus-glib)
1556 ("freetype" ,freetype)
1557 ("gdk-pixbuf" ,gdk-pixbuf)
1561 ("hunspell" ,hunspell)
1563 ("libcanberra" ,libcanberra)
1564 ("libevent" ,libevent)
1566 ("libgnome" ,libgnome)
1567 ("libjpeg-turbo" ,libjpeg-turbo)
1568 ("libpng-apng" ,libpng-apng)
1570 ("libxcomposite" ,libxcomposite)
1572 ("libxinerama" ,libxinerama)
1573 ("libxscrnsaver" ,libxscrnsaver)
1576 ("mit-krb5" ,mit-krb5)
1581 ("pulseaudio" ,pulseaudio)
1583 ("startup-notification" ,startup-notification)
1589 `(("thunderbird-sources"
1590 ;; The changeset identifier is taken from the file "sourcestamp.txt"
1591 ;; in the Thunderbird release tarball. We don't use the release
1592 ;; tarball because it duplicates the Icecat sources and only adds the
1593 ;; "comm" directory, which is provided by this repository.
1594 ,(let ((changeset "adcfedf831da719455116546865f9a5faea848a6"))
1598 (url "https://hg.mozilla.org/releases/comm-esr78")
1599 (changeset changeset)))
1600 (file-name (string-append "thunderbird-" version "-checkout"))
1603 "1dahf3y8bm3kh7amf341wnmh82a2r0ksqihc6dwiakh6x86a94cm")))))
1604 ("autoconf" ,autoconf-2.13)
1605 ("cargo" ,rust "cargo")
1611 ("pkg-config" ,pkg-config)
1613 ("python2" ,python-2.7)
1615 ("rust-cbindgen" ,rust-cbindgen-0.14)
1618 (home-page "https://www.thunderbird.net")
1619 (synopsis "Rebranded Mozilla Thunderbird email client")
1621 "This package provides an email client built based on Mozilla
1622 Thunderbird. It supports email, news feeds, chat, calendar and contacts.")
1623 (license license:mpl2.0)))
1625 (define-public icedove/wayland
1628 (name "icedove-wayland")
1631 `(("bash" ,bash-minimal)
1632 ("icedove" ,icedove)))
1633 (build-system trivial-build-system)
1635 '(#:modules ((guix build utils))
1638 (use-modules (guix build utils))
1639 (let* ((bash (assoc-ref %build-inputs "bash"))
1640 (icedove (assoc-ref %build-inputs "icedove"))
1641 (out (assoc-ref %outputs "out"))
1642 (exe (string-append out "/bin/icedove")))
1643 (mkdir-p (dirname exe))
1645 (call-with-output-file exe
1648 MOZ_ENABLE_WAYLAND=1 exec ~a $@"
1649 (string-append bash "/bin/bash")
1650 (string-append icedove "/bin/icedove"))))
1653 ;; Provide the manual and .desktop file.
1654 (copy-recursively (string-append icedove "/share")
1655 (string-append out "/share"))
1656 (substitute* (string-append
1657 out "/share/applications/icedove.desktop")
1661 (define-public firefox-decrypt
1663 (name "firefox-decrypt")
1668 (url "https://github.com/Unode/firefox_decrypt")
1670 (file-name (git-file-name name version))
1673 "17yyyxp47z4m8hnflcq34rc1y871515kr3f1y42j1l0yx3g0il07"))))
1674 (build-system trivial-build-system)
1677 ("python" ,python)))
1679 `(#:modules ((guix build utils))
1682 (use-modules (guix build utils))
1685 (assoc-ref %build-inputs "python") "/bin"))
1686 (copy-file (string-append (assoc-ref %build-inputs "source")
1687 "/firefox_decrypt.py")
1688 "firefox_decrypt.py")
1689 (substitute* "firefox_decrypt.py"
1690 (("/usr/bin/env python") (which "python3"))
1691 (("libnss3.so") (string-append (assoc-ref %build-inputs "nss")
1692 "/lib/nss/libnss3.so")))
1693 (install-file "firefox_decrypt.py" (string-append %output "/bin"))
1695 (home-page "https://github.com/Unode/firefox_decrypt/")
1696 (synopsis "Tool to extract passwords from Mozilla profiles")
1697 (description "Firefox Decrypt is a tool to extract passwords from
1698 Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.")
1699 (license license:gpl3+)))