gnu: icedove: Update to 102.4.1.
[jackhill/guix/guix.git] / gnu / packages / gnuzilla.scm
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, 2022 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, 2021, 2022 Jonathan Brielmaier <jonathan.brielmaier@web.de>
17 ;;; Copyright © 2020, 2022 Marius Bakke <marius@gnu.org>
18 ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
19 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
20 ;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
21 ;;; Copyright © 2021 Baptiste Strazzul <bstrazzull@hotmail.fr>
22 ;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
23 ;;;
24 ;;; This file is part of GNU Guix.
25 ;;;
26 ;;; GNU Guix is free software; you can redistribute it and/or modify it
27 ;;; under the terms of the GNU General Public License as published by
28 ;;; the Free Software Foundation; either version 3 of the License, or (at
29 ;;; your option) any later version.
30 ;;;
31 ;;; GNU Guix is distributed in the hope that it will be useful, but
32 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
33 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 ;;; GNU General Public License for more details.
35 ;;;
36 ;;; You should have received a copy of the GNU General Public License
37 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38
39 (define-module (gnu packages gnuzilla)
40 #:use-module ((srfi srfi-1) #:hide (zip))
41 #:use-module (ice-9 match)
42 #:use-module (gnu packages)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix packages)
45 #:use-module (guix download)
46 #:use-module (guix git-download)
47 #:use-module (guix hg-download)
48 #:use-module (guix gexp)
49 #:use-module (guix store)
50 #:use-module (guix monads)
51 #:use-module (guix utils)
52 #:use-module (guix build-system gnu)
53 #:use-module (guix build-system cargo)
54 #:use-module (guix build-system trivial)
55 #:use-module (gnu packages admin)
56 #:use-module (gnu packages audio)
57 #:use-module (gnu packages autotools)
58 #:use-module (gnu packages m4)
59 #:use-module (gnu packages base)
60 #:use-module (gnu packages bash)
61 #:use-module (gnu packages databases)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages gtk)
64 #:use-module (gnu packages gnome)
65 #:use-module (gnu packages libcanberra)
66 #:use-module (gnu packages cups)
67 #:use-module (gnu packages kerberos)
68 #:use-module (gnu packages linux)
69 #:use-module (gnu packages perl)
70 #:use-module (gnu packages pkg-config)
71 #:use-module (gnu packages compression)
72 #:use-module (gnu packages fontutils)
73 #:use-module (gnu packages fonts)
74 #:use-module (gnu packages libevent)
75 #:use-module (gnu packages libreoffice) ;for hunspell
76 #:use-module (gnu packages image)
77 #:use-module (gnu packages libffi)
78 #:use-module (gnu packages pulseaudio)
79 #:use-module (gnu packages python)
80 #:use-module (gnu packages python-xyz)
81 #:use-module (gnu packages node)
82 #:use-module (gnu packages xorg)
83 #:use-module (gnu packages gl)
84 #:use-module (gnu packages pciutils)
85 #:use-module (gnu packages assembly)
86 #:use-module (gnu packages rust)
87 #:use-module (gnu packages rust-apps)
88 #:use-module (gnu packages crates-io)
89 #:use-module (gnu packages llvm)
90 #:use-module (gnu packages nss)
91 #:use-module (gnu packages icu4c)
92 #:use-module (gnu packages video)
93 #:use-module (gnu packages xiph)
94 #:use-module (gnu packages xdisorg)
95 #:use-module (gnu packages readline)
96 #:use-module (gnu packages sqlite))
97
98 (define-public mozjs
99 (package
100 (name "mozjs")
101 (version "102.2.0")
102 (source (origin
103 (method url-fetch)
104 ;; TODO: Switch to IceCat source once available on ftp.gnu.org.
105 (uri (string-append "https://ftp.mozilla.org/pub/firefox"
106 "/releases/" version "esr/source/firefox-"
107 version "esr.source.tar.xz"))
108 (sha256
109 (base32
110 "1zwpgis7py1bf8p88pz3mpai6a02qrdb8ww2fa9kxxdl9b8r2k81"))))
111 (build-system gnu-build-system)
112 (arguments
113 (list
114 #:imported-modules %cargo-utils-modules ;for `generate-all-checksums'
115 #:modules `((guix build cargo-utils)
116 ,@%gnu-build-system-modules)
117 #:test-target "check-jstests"
118 #:configure-flags
119 #~(list
120 ;; Disable debugging symbols to save space.
121 "--disable-debug"
122 "--disable-debug-symbols"
123 ;; This is important because without it gjs will segfault during the
124 ;; configure phase. With jemalloc only the standalone mozjs console
125 ;; will work.
126 "--disable-jemalloc"
127 "--enable-tests"
128 "--enable-hardening"
129 "--enable-optimize"
130 "--enable-release"
131 "--enable-readline"
132 "--enable-shared-js"
133 "--with-system-icu"
134 "--with-system-nspr"
135 "--with-system-zlib"
136 "--with-intl-api")
137 #:phases
138 #~(modify-phases %standard-phases
139 (add-after 'patch-source-shebangs 'patch-cargo-checksums
140 (lambda _
141 (let ((null-hash
142 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
143 (for-each (lambda (file)
144 (format #t "patching checksums in ~a~%" file)
145 (substitute* file
146 (("^checksum = \".*\"")
147 (string-append "checksum = \"" null-hash "\""))))
148 (find-files "." "Cargo\\.lock$"))
149 (for-each generate-all-checksums
150 '("js" "third_party/rust")))))
151 (replace 'configure
152 (lambda* (#:key configure-flags #:allow-other-keys)
153 ;; The configure script does not accept environment variables as
154 ;; arguments. It also must be run from a different directory,
155 ;; but not the root directory either.
156 (mkdir "run-configure-from-here")
157 (chdir "run-configure-from-here")
158 (setenv "SHELL" (which "sh"))
159 (setenv "CONFIG_SHELL" (which "sh"))
160 (setenv "AUTOCONF" (which "autoconf"))
161 (apply invoke "python" "../configure.py"
162 "--enable-project=js"
163 (string-append "--prefix=" #$output)
164 configure-flags)))
165 (add-before 'check 'adjust-tests
166 (lambda _
167 (with-directory-excursion "../js/src/tests"
168 (substitute* "shell/os.js"
169 ;; FIXME: Why does the killed process have an exit status?
170 ((".*killed process should not have exitStatus.*")
171 ""))
172
173 ;; The test suite expects a lightly patched ICU. Disable tests
174 ;; that do not work with the system version. See
175 ;; "intl/icu-patches" for clues.
176
177 ;; See <https://unicode-org.atlassian.net/browse/ICU-20992> and
178 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=1636984> and
179 ;; related patch for why this is failing.
180 (delete-file "non262/Intl/DateTimeFormat/\
181 fractional-second-digits-append-item.js")
182 ;; FIXME: got "0 \u251CAM/PM: noon\u2524", expected "0 (AM/PM: noon)"
183 (delete-file "non262/Intl/DateTimeFormat/day-period-hour-cycle.js")
184 ;; FIXME: got "en-US-posix", expected "en-US-POSIX".
185 (delete-file "non262/Intl/available-locales-supported.js")
186 ;; FIXME: got "en-US", expected "en-US-POSIX"
187 (delete-file "non262/Intl/available-locales-resolved.js"))))
188 (add-before 'check 'pre-check
189 (lambda _
190 (setenv "JSTESTS_EXTRA_ARGS"
191 (string-join
192 (list
193 ;; Do not run tests marked as "random".
194 "--exclude-random"
195 ;; Exclude web platform tests.
196 "--wpt=disabled"
197 ;; Respect the daemons configured number of jobs.
198 (string-append "--worker-count="
199 (number->string (parallel-job-count)))))))))))
200 (native-inputs
201 (list autoconf
202 llvm ;for llvm-objdump
203 m4
204 perl
205 pkg-config
206 python-wrapper
207 rust
208 `(,rust "cargo")))
209 (inputs
210 (list icu4c-71 readline zlib))
211 (propagated-inputs
212 (list nspr)) ; in the Requires.private field of mozjs-*.pc
213 (home-page
214 "https://spidermonkey.dev/")
215 (synopsis "Mozilla JavaScript engine")
216 (description "SpiderMonkey is Mozilla's JavaScript engine written
217 in C/C++.")
218 (license license:mpl2.0))) ; and others for some files
219
220 (define-public mozjs-91
221 (package
222 (inherit mozjs)
223 (version "91.13.0")
224 (source (origin
225 (method url-fetch)
226 (uri (string-append "https://ftp.mozilla.org/pub/firefox"
227 "/releases/" version "esr/source/firefox-"
228 version "esr.source.tar.xz"))
229 (sha256
230 (base32
231 "0qh7j960wdp5zcfqhkj8ki47spp9i9ms12xx0v0kxvmmw36jpgjk"))))
232 (arguments
233 (substitute-keyword-arguments (package-arguments mozjs)
234 ((#:phases phases)
235 #~(modify-phases #$phases
236 (add-before 'check 'disable-timezone-tests
237 (lambda _
238 (with-directory-excursion "../js/src/tests"
239 ;; FIXME: Assertion failed: got "2021a", expected "2021a3"?
240 (delete-file "non262/Intl/DateTimeFormat/timeZone_version.js")
241 ;; XXX: Delete all tests that test time zone functionality,
242 ;; because the test suite uses /etc/localtime to figure out
243 ;; the offset from the hardware clock, which does not work
244 ;; in the build container. See <tests/non262/Date/shell.js>.
245 (delete-file-recursively "non262/Date")
246 (delete-file
247 "non262/Intl/DateTimeFormat/tz-environment-variable.js"))))))))
248 (inputs (modify-inputs (package-inputs mozjs)
249 (replace "icu4c" icu4c)))))
250
251 (define-public mozjs-78
252 (package
253 (inherit mozjs)
254 (name "mozjs")
255 (version "78.15.0")
256 (source (origin
257 (method url-fetch)
258 (uri (string-append "https://archive.mozilla.org/pub/firefox"
259 "/releases/" version "esr/source/firefox-"
260 version "esr.source.tar.xz"))
261 (sha256
262 (base32
263 "0l91cxdc5v9fps79ckb1kid4gw6v5qng1jd9zvaacwaiv628shx4"))))
264 (build-system gnu-build-system)
265 (arguments
266 (substitute-keyword-arguments (package-arguments mozjs)
267 ((#:phases phases)
268 #~(modify-phases #$phases
269 (replace 'configure
270 (lambda* (#:key configure-flags #:allow-other-keys)
271 ;; The configure script does not accept environment variables as
272 ;; arguments. It also must be run from a different directory,
273 ;; but not the root directory either.
274 (mkdir "run-configure-from-here")
275 (chdir "run-configure-from-here")
276 (setenv "SHELL" (which "sh"))
277 (setenv "CONFIG_SHELL" (which "sh"))
278 (setenv "AUTOCONF" (which "autoconf"))
279 (apply invoke "../js/src/configure"
280 (cons (string-append "--prefix=" #$output)
281 configure-flags))))
282 (replace 'adjust-tests
283 (lambda _
284 (with-directory-excursion "../js/src/tests"
285 ;; The test suite expects a lightly patched ICU 67. Since
286 ;; Guix is about to switch to ICU 68, massage the tests to
287 ;; work with that instead of patching ICU. Try removing this
288 ;; phase for newer versions of mozjs.
289
290 ;; These tests look up locale names and expects to get
291 ;; "GB" instead of "UK".
292 (substitute* "non262/Intl/DisplayNames/language.js"
293 (("Traditionell, GB")
294 "Traditionell, UK"))
295 (substitute* "non262/Intl/DisplayNames/region.js"
296 (("\"GB\": \"GB\"")
297 "\"GB\": \"UK\""))
298
299 ;; XXX: Some localized time formats have changed, and
300 ;; substitution fails for accented characters, even though
301 ;; it works in the REPL(?). Just delete these for now.
302 (delete-file "non262/Intl/Date/toLocaleString_timeZone.js")
303 (delete-file "non262/Intl/Date/toLocaleDateString_timeZone.js")
304
305 ;; Similarly, these get an unexpected "A" suffix when looking
306 ;; up a time in the "ar-MA-u-ca-islamicc" locale, which is
307 ;; tricky to substitute.
308 (delete-file "non262/Intl/DateTimeFormat/format_timeZone.js")
309 (delete-file "non262/Intl/DateTimeFormat/format.js")
310
311 ;; This file compares a generated list of ICU locale names
312 ;; with actual lookups. Some have changed slightly, i.e.
313 ;; daf-Latn-ZZ -> daf-Latn-CI, so drop it for simplicity.
314 (delete-file "non262/Intl/Locale/likely-subtags-generated.js"))))
315 (replace 'pre-check
316 (lambda _
317 (with-directory-excursion "../js/src/tests"
318 (substitute* "shell/os.js"
319 ;; FIXME: Why does the killed process have an exit status?
320 ((".*killed process should not have exitStatus.*")
321 ""))
322
323 ;; XXX: Delete all tests that test time zone functionality,
324 ;; because the test suite uses /etc/localtime to figure out
325 ;; the offset from the hardware clock, which does not work
326 ;; in the build container. See <tests/non262/Date/shell.js>.
327 (delete-file-recursively "non262/Date")
328 (delete-file "non262/Intl/DateTimeFormat/tz-environment-variable.js")
329
330 (setenv "JSTESTS_EXTRA_ARGS"
331 (string-join
332 (list
333 ;; Do not run tests marked as "random".
334 "--exclude-random"
335 ;; Exclude web platform tests.
336 "--wpt=disabled"
337 ;; Respect the daemons configured number of jobs.
338 (string-append "--worker-count="
339 (number->string
340 (parallel-job-count)))))))))))))
341 (native-inputs
342 (list autoconf-2.13
343 automake
344 llvm ;for llvm-objdump
345 perl
346 pkg-config
347 python-3
348 rust
349 `(,rust "cargo")))
350 (inputs
351 (list icu4c readline zlib))))
352
353 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
354 ;; Temporary packaging of rust-cbindgen-0.23 and its dependencies
355 ;; follow, pending their inclusion into (gnu packages rust-apps)
356 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
357
358 (define rust-textwrap-0.15-promise
359 (delay
360 (package
361 (inherit rust-textwrap-0.12)
362 (name "rust-textwrap")
363 (version "0.15.0")
364 (source (origin
365 (method url-fetch)
366 (uri (crate-uri "textwrap" version))
367 (file-name (string-append name "-" version ".tar.gz"))
368 (sha256
369 (base32
370 "1yw513k61lfiwgqrfvsjw1a5wpvm0azhpjr2kr0jhnq9c56is55i"))))
371 (arguments
372 `(#:skip-build? #t
373 #:cargo-inputs (("rust-hyphenation" ,rust-hyphenation-0.8)
374 ("rust-smawk" ,rust-smawk-0.3)
375 ("rust-terminal-size" ,rust-terminal-size-0.1)
376 ("rust-unicode-linebreak" ,rust-unicode-linebreak-0.1)
377 ("rust-unicode-width" ,rust-unicode-width-0.1)))))))
378
379 (define rust-clap-lex-0.2
380 (package
381 (name "rust-clap-lex")
382 (version "0.2.4")
383 (source (origin
384 (method url-fetch)
385 (uri (crate-uri "clap_lex" version))
386 (file-name (string-append name "-" version ".tar.gz"))
387 (sha256
388 (base32
389 "1ib1a9v55ybnaws11l63az0jgz5xiy24jkdgsmyl7grcm3sz4l18"))))
390 (build-system cargo-build-system)
391 (arguments
392 `(#:skip-build? #t
393 #:cargo-inputs (("rust-os-str-bytes" ,rust-os-str-bytes-6))))
394 (home-page "https://github.com/clap-rs/clap/tree/master/clap_lex")
395 (synopsis "Minimal, flexible command line parser")
396 (description "Minimal, flexible command line parser")
397 (license (list license:expat license:asl2.0))))
398
399 (define rust-clap-derive-3.2.15-promise
400 (delay
401 (package
402 (inherit rust-clap-derive-3)
403 (name "rust-clap-derive")
404 (version "3.2.15")
405 (source (origin
406 (method url-fetch)
407 (uri (crate-uri "clap_derive" version))
408 (file-name (string-append name "-" version ".tar.gz"))
409 (sha256
410 (base32
411 "1d2c4vs345fwihkd8cc7m6acbiydcwramkd5mnp36p0a7g6jm9cv"))))
412 (arguments
413 `(#:skip-build? #t
414 #:cargo-inputs (("rust-heck" ,rust-heck-0.4)
415 ("rust-proc-macro-error" ,rust-proc-macro-error-1)
416 ("rust-proc-macro2" ,rust-proc-macro2-1)
417 ("rust-quote" ,rust-quote-1)
418 ("rust-syn" ,rust-syn-1)))))))
419
420 (define rust-clap-3.2.16-promise
421 (delay
422 (package
423 (inherit rust-clap-3)
424 (name "rust-clap")
425 (version "3.2.16")
426 (source (origin
427 (method url-fetch)
428 (uri (crate-uri "clap" version))
429 (file-name (string-append name "-" version ".tar.gz"))
430 (sha256
431 (base32
432 "1af06z8z7m3327yz1xvzxfjanclgpvvy3lssb745rig7adkbpnx3"))))
433 (arguments
434 `(#:skip-build? #t
435 #:cargo-inputs (("rust-atty" ,rust-atty-0.2)
436 ("rust-backtrace" ,rust-backtrace-0.3)
437 ("rust-bitflags" ,rust-bitflags-1)
438 ("rust-clap-derive" ,(force rust-clap-derive-3.2.15-promise))
439 ("rust-clap-lex" ,rust-clap-lex-0.2)
440 ("rust-indexmap" ,rust-indexmap-1)
441 ("rust-once-cell" ,rust-once-cell-1)
442 ("rust-regex" ,rust-regex-1)
443 ("rust-strsim" ,rust-strsim-0.10)
444 ("rust-termcolor" ,rust-termcolor-1)
445 ("rust-terminal-size" ,rust-terminal-size-0.1)
446 ("rust-textwrap" ,(force rust-textwrap-0.15-promise))
447 ("rust-unicase" ,rust-unicase-2)
448 ("rust-yaml-rust" ,rust-yaml-rust-0.4)))))))
449
450 (define rust-cbindgen-0.24-promise
451 (delay
452 (package
453 (inherit rust-cbindgen-0.19)
454 (name "rust-cbindgen")
455 (version "0.24.3")
456 (source (origin
457 (method url-fetch)
458 (uri (crate-uri "cbindgen" version))
459 (file-name (string-append name "-" version ".tar.gz"))
460 (sha256
461 (base32
462 "1yqxqsz2d0cppd8zwihk2139g5gy38wqgl9snj6rnk8gyvnqsdd6"))))
463 (arguments
464 `(#:cargo-inputs (("rust-clap" ,(force rust-clap-3.2.16-promise))
465 ("rust-heck" ,rust-heck-0.4)
466 ("rust-indexmap" ,rust-indexmap-1)
467 ("rust-log" ,rust-log-0.4)
468 ("rust-proc-macro2" ,rust-proc-macro2-1)
469 ("rust-quote" ,rust-quote-1)
470 ("rust-serde" ,rust-serde-1)
471 ("rust-serde-json" ,rust-serde-json-1)
472 ("rust-syn" ,rust-syn-1)
473 ("rust-tempfile" ,rust-tempfile-3)
474 ("rust-toml" ,rust-toml-0.5))
475 #:cargo-development-inputs (("rust-serial-test" ,rust-serial-test-0.5)))))))
476
477 ;; Bug with IceCat 102 with cbindgen-0.24, see
478 ;; https://bugzilla.mozilla.org/show_bug.cgi?id=1773259#c5 for
479 ;; possible patch (untested)
480 (define rust-cbindgen-0.23-promise
481 (delay
482 (package
483 (inherit (force rust-cbindgen-0.24-promise))
484 (name "rust-cbindgen")
485 (version "0.23.0")
486 (source (origin
487 (method url-fetch)
488 (uri (crate-uri "cbindgen" version))
489 (file-name (string-append name "-" version ".tar.gz"))
490 (sha256
491 (base32
492 "006rn3fn4njayjxr2vd24g1awssr9i3894nbmfzkybx07j728vav")))))))
493
494
495 (define mozilla-compare-locales
496 (origin
497 (method hg-fetch)
498 (uri (hg-reference
499 (url "https://hg.mozilla.org/l10n/compare-locales/")
500 (changeset "RELEASE_8_1_0")))
501 (file-name "mozilla-compare-locales")
502 (sha256 (base32 "00bpkaqf2ng1nn9ajyb5mli0jq58q5fm2n3yy90jy0hp4q2gbs50"))))
503
504 (define (mozilla-locale locale changeset hash-string)
505 (origin
506 (method hg-fetch)
507 (uri (hg-reference
508 (url (string-append "https://hg.mozilla.org/l10n-central/"
509 locale))
510 (changeset changeset)))
511 (file-name (string-append "mozilla-locale-" locale))
512 (sha256 (base32 hash-string))))
513
514 (define-syntax-rule (mozilla-locales (hash-string changeset locale) ...)
515 (list (mozilla-locale locale changeset hash-string)
516 ...))
517
518 (define all-mozilla-locales
519 (mozilla-locales
520 ;; sha256 changeset locale
521 ;;---------------------------------------------------------------------------
522 ("1y562h0dg33vhhhwfk6jl7xbr67gng21vcf3rpm96zzcgbnf8rjj" "503a7baec899" "ach")
523 ("1cqixlk9f8p63jz20wzsvnfb7xa82ba725gzdydlwz2axgp09c26" "4e2c7d1ddbed" "af")
524 ("19r1yhmfxqasyslc8gr9as5w1scscz1xr8iqy9zi4b90fdjzs0ac" "06897e40a7ea" "an")
525 ("0nfknb1p03j9fgmkwlm1mzdyh10g0l33x34ab39kc072apziyv0n" "9272819b09e2" "ar")
526 ("11qqblqfffbmkdr5b6mxzq02i8rj1hjq3iy6xv5i5xxy311b3vpb" "f706d22e6910" "ast")
527 ("0q2p1a437qr2nshdd4934qkv2sblmykiwzir149c8p9m5sjk0dyw" "f5c2a9800add" "az")
528 ("0gxxm3lv18kj0922bw0g897azc4nkrszm5irgwdkgmkbyr97li83" "98ba7d51484f" "be")
529 ("10vrbbaabjns824ndya6c09znm815pak2xpvqgjydl3r5qvacx65" "5c79c77311cd" "bg")
530 ("1il7yyifx5xzj0v2lna315mppl5pk1vi4m9r66hdz1lzc485m1wp" "c80c87ef7193" "bn")
531 ("1p1ig4v9pczzrnnxzr20r61g7xk85k5lgnxhzgn1rx518p85xrkm" "6a1bcb9851b2" "br")
532 ("08q33bk9kdvbyc4ib58bsn2b67ki3d2yzskkf5r2n5zlglblksa2" "939779cb58d6" "bs")
533 ("1bdkywrqah85fh8kfnz163qnc02ffx0a4vlnx5pq1wg9j4f1gznf" "9a45ccf144f1" "ca")
534 ("0hhmp5dzc0rssykl0b2n9h0vfy4svwhxmhpsr3rcfpbg2s0r5h6l" "4f60e18fc248" "ca-valencia")
535 ("18phbl9raqsbys9wa8z0gq0h0pw3b55v6ngn67r4373lfc0s9cxv" "b4ef404c7de8" "cak")
536 ("0147qyw1y97mgqhkb46wblxv61lq2mvvm5n5ihwf49l5cyizi0jg" "f56ef18f05df" "cs")
537 ("08sbhnsxndlsaijnxndc367qcbrzb29m7bpkcawinz9fg6mz3573" "4f9d92f04f5e" "cy")
538 ("09cm5kk1sh2a6ws1fj185jrknhfa6n4bhj7nfnr4lsk339n0kvv9" "902503567e30" "da")
539 ("0r630bki5d4ylicq6lzh6s2mvsq225933szswmm0sap507rj75cm" "6000baf7a412" "de")
540 ("0749qjsfv3rn94rnci3ydgndw27qlr3w3w97kfwma2gmsf3m3r0p" "4a948952d1f4" "dsb")
541 ("0yc64i7mpxhs4qlyyh59i2aiz0vpap0bn8slcsk8b71wd1d7cy5m" "153a16a13733" "el")
542 ("0d4m5ji6ii10yap8y24cxx3fr60ba1jqi10hy3j1cq6ni7hzavga" "7ce17ae529ac" "en-CA")
543 ("12jzqcfbgdhfm8f2gqp15bdnin62li07jwicjc8ynn4cl9a19xiz" "a25d9eea7c23" "en-GB")
544 ("0gbb8hfc5yvjah63mapjxm53wxrf98srbrbg43b9g734zfi4n8y5" "4ed3471dad5d" "eo")
545 ("19lw7zmqx2irjmv5y6r7nncp6nysn06abf10n3dzj5nzgays6sln" "853fe7acb415" "es-AR")
546 ("0rq4pa380b77rkv6dq7sqx8a8i33jk3vs5rgcl8fv7slqvsw23kd" "921b67bf27a5" "es-CL")
547 ("1dyxzab9hln5spch66wmfagfzmfdiaxgpq7qlzvdfg98wkqdj25n" "c9a210ea496c" "es-ES")
548 ("1gwpmfl37wxl7rynqswgj41liljflgxydvljd4zdhk3jzqn605fb" "ddd35183d81c" "es-MX")
549 ("0c3blniddklapifnjbz03f2frw24jjgwgwn6swl5mwm2z0y6wa9f" "82d23ffaa7d3" "et")
550 ("05mq2df6n6fr8m5m2xwl0f6n1q3zgjrnk465ldx1nfr9agrhd36c" "13975626d549" "eu")
551 ("1l1jyqqiy551903j6yzh9ayg1pf26q2hr9h3jj4l51xzp7x4ms2q" "039e1fdb7c71" "fa")
552 ("091l05y9sggxznv0y11b9zy5qf146p0hb5faw4ix7yn5p5kca2f5" "7bd3722d82de" "ff")
553 ("1lllwjvmbl5dx44fcvsqg08fbflkc8dx5as9n6nf4xlkzydx6izm" "39808e88c9d1" "fi")
554 ("10ha955vvyf5vbciricm72kplj9j0s00g2333lmg46jiwi7aviiv" "426d373db6a7" "fr")
555 ("11zdfk8jvdy1k9z1q162cwapplcbz35l3dq4mv45brdin3v0x8kr" "96cd93d18389" "fy-NL")
556 ("1l5xr25gmssyachwmfprlnp2v2xj4b0hp8gxrf7fi5bvv9c2fynb" "de3daf7d3f9d" "ga-IE")
557 ("06h9ijfsn1cgz5fvxxbisk7fvqhgsw99id92575hgyg1p8xb1n69" "f04aea656d9e" "gd")
558 ("19913i5n8yyfhz9j21krlk7wqsyy89vggxc1m1swv94y2ix8rpaj" "1b8cdb87bf69" "gl")
559 ("0k5x31bfl2l0r9b5dkn03frm1gd8n6igai7ch2f1kj0skflynwww" "82df570c4241" "gn")
560 ("03rygnj9xhfvykark7dls117kwhid13ghvrsqiial0vp8m7ymx79" "e2e41d7beaa5" "gu-IN")
561 ("0vyraplj1x7b5im15anhzdaq03k2gqfyybgklrd4f9ry6msh5jhx" "de724e943805" "he")
562 ("1zqps586jrgxpf7xx2l3qw3ch3fr31r9a25y861fpxrpvh7ygw7g" "898598e1a5c6" "hi-IN")
563 ("0czq68l3qdhdc0mgazlrh8x83a6d5qrjwgjv8xvsmmzi7h68ww0l" "2711d1515af0" "hr")
564 ("1wwvrnm38gk2rnw4vmcranh8hk61gjcj9292pck3ckiv6mq7kd4s" "03e02f3d0676" "hsb")
565 ("0yvgdxlbyhhg3lk43hxx9gx66rcm7gaj02zzzx5zni8dhvlk2v6m" "d423ada9dc00" "hu")
566 ("1kjm7bg4990jhfbxwc38r4lqm2fbcxc82nc2d4qkqwikr4aah4b9" "06836af0bd6e" "hy-AM")
567 ("1dla7r3snvagb7m985xxqyi7gl498cr5xsz8msw0zpg6xmi05rlx" "299bd950d538" "ia")
568 ("0w8w9xn93akir7nqcp5iwr3kqvba5gbirg7gmzlzg7mgrhw8pcsa" "dee087477b99" "id")
569 ("10iakv1c1d20ihxg1s7c3zc1zfw18vr2kspcw7bk5k02rmrffgcn" "320095d063ed" "is")
570 ("1xn5pa3rc7l6k2migm3c0dx71q1hk7mjls045xpv9cy8gvirnj94" "4722680fb5bf" "it")
571 ("0va9zfj3wqh1yvbgh3x808yvdyxkg780vazjg887wbxpfk1n6hxa" "cb3cfe294621" "ja")
572 ("0qvjc3fhk6jg2c3g6mymmnslg1rkkxmv9gi3whf2bc5mzfgyc5zw" "7efe92bd7780" "ja-JP-mac")
573 ("0zfiwwz0axbd219ar32c7a6b8h816sf04ajx6jl74s5kyij79y82" "4c1fe3a18da9" "ka")
574 ("1aiik4758r5df76q2a132y5fjdjrsxshjylk7irwsr7yy0c7f63g" "acdf76048aa0" "kab")
575 ("0icxh4sgv6m1yykycb9d9c43k3r6w02f9c6jr04wm8hvqq5icfl5" "9b418ff7936b" "kk")
576 ("1cqlhggf46lr7w399k7qb7a1hc56f32w1dy26i2racpppzza5plc" "9771ada0b5f8" "km")
577 ("0p04irnb7x7y37m6lz388x9dynn8rnk000avpp296barajnhs5i8" "645aa37a2112" "kn")
578 ("1lbc1fxr5i0ccymlsd8axz3633cqggg5k8ak5yqwi704g7kvv9g2" "1cd68952d119" "ko")
579 ("11b55bxg73zqfdn5gy9nn5imab2mv0hxr603whggp7vymllgb7kb" "26bb83959bfe" "lij")
580 ("15jsijm6d26i0105gz0f7sh2yh2v4pmw4j95cwkdrb1d8m935jlz" "b9829891f153" "lt")
581 ("0liwwv13fgyw97nizhsyy53xrbf8jks5ics7qkkxfccawjrg5rlb" "e5f09d03d959" "lv")
582 ("0w420yf3hdnl7dp9mn9ghc20cq79k24fn9adn3syk723ppl6mkb0" "7884845e94f3" "mk")
583 ("13wkr7rgqsv9w3d9w7k8lnxdzgfixsq4bmc27zsyc770l6062ml6" "030db7412202" "mr")
584 ("06nsadcnxx0ssdp67x47dj9crihn1ycgd5mwvn5m7lkb97r4ch9f" "40a7703e875c" "ms")
585 ("0mlnjdzck6dp9p59ajj3sr63r36fn0qi8r9scrqrqcisgfclw9sg" "daca40056531" "my")
586 ("0z1hgx9d5i9w20f9k9azzng1y3lmm5d6hdjkj7rf6r5710bhhzh5" "664bd049e105" "nb-NO")
587 ("1466qvrs13g2iix1k35cknb2pia9b66li2ncvdyqf0jsd92z9k8x" "eaa6ae781ba0" "ne-NP")
588 ("0jgmz2lkzj0aspd9mabygzic6li5s2b25y0r6vjg8mv3jm5pi86j" "5ef8f1c9739e" "nl")
589 ("1m46x0h20vdfbzjxlz0ac43dbaq40xnyldr2yzbf7pk5di9pzxa6" "f08e15466d5d" "nn-NO")
590 ("0r3zvihqh6iya3z1qm7if0m3zfgf81s9qp7x7qc701h2q357wkgf" "6712c0e12ec2" "oc")
591 ("102j89jm28c223yhhkrj76xxj4kmy58hcs2r0jn15xa1qkqv1fdk" "8f36cc819e00" "pa-IN")
592 ("1j9za6s0i46abn8dsrlkpck3qxxw35rhfcg1xs1vp8sc4ckg8qwi" "c3b0c1c02b94" "pl")
593 ("1k9lbsvckpwl4xax8kxp5yxsfkspq2mhqm77jh5nl9aw88dsn55b" "cc32bf9630fe" "pt-BR")
594 ("0f0jyvbn2sa5m66wqdzh4607g4gd0270xq37ipd9ls52b4764bd8" "5478d7242086" "pt-PT")
595 ("19znkkialh1d4np7qcp80xkagrf1j2xah2s1xxzsh854p3d30zs7" "dd934a76fb01" "rm")
596 ("1xn26r8g8zzkb5myfgmnjbk8k4i0brkvbrvnhp7k5nkrnsin25di" "d57ab3dee73d" "ro")
597 ("04rhkxlmpp5pyzw85ldbfkmiigqr2p9y5cbns5dqs6sz1633ccxp" "7aea98f33a20" "ru")
598 ("1zzkkxl7ayxh5gx9snyvp5czflsvi77hp48li613h3c2fii4n9qk" "7c986f4b5044" "sco")
599 ("1219i0ghhqj3s1i0rm68jjkvivh6y40938wav7z4ifck527sq6r1" "bc9e55d4e3ea" "si")
600 ("05i5p3n3a6hgl6rf10yjs4vag7y3rn2jwgxsddcdcqiv6405zn81" "8814afd7f67e" "sk")
601 ("1wcqdbm1py1ldq6cj2g201m715nql79r6szr71jvrxacb711c62a" "20013dc06e96" "sl")
602 ("0g2izkaa4ipwgwyhy77ciyrxxpf4pxzj9mjqvxriy5prmkhm3zjs" "d86d5d2b6eef" "son")
603 ("1cc99m6srjg8698dkc3il70crby0mdv43v3ijwy069k4w50hyjjg" "49bb5fae5d9b" "sq")
604 ("13kfssq4fhq9mb36as6sxiaffl17qyg1wdw8kpz3ilqm86bsjrgl" "d6a0ab79b06f" "sr")
605 ("1wx9snbm0431q97i0q0nv4wbsqcv9nhllwfr88crlp7bfj5w8czw" "4bab04993da3" "sv-SE")
606 ("0laglkfl8ml0ip5vmm3z2q790hgwax9gfqwq3wm68a2nnsyck8fw" "4b3316c4aa48" "szl")
607 ("15pnlic4q7m48y0mc5yh8w5yscjwzx0mmfrbj3f2b9jxxa44nx4h" "48c7aab86db8" "ta")
608 ("16qar5y0wns75ryi8bfv7yln3mjsyn7qi4345zcniz3ydgkczh46" "7bbb3dac8f47" "te")
609 ("112g7x8h0qz16r5faam386x4a0rgwd4zy02d5agmg9m0kbficdfx" "009fd0852454" "th")
610 ("1l80kh9byqxnz5vkz357rb39g4y9sgn9pr0v29ywp6d009img1qg" "dad9caecd7a9" "tl")
611 ("1nalvjlxxsa9wldhhdb93bgfc7dl084xayh7i7mgg93yjgrym93x" "0c48082d37cd" "tr")
612 ("0wkxqcfgsra2ljws28kiwajv73w9aa8drsc4fqlg9krbicnjl2n8" "f6d105faedcc" "trs")
613 ("18jf4ysrfv3635fyxc1vwr970dr2r05bl3h8v599pwp2g7jzyjpm" "e1011388a55e" "uk")
614 ("1ihmksjsz54yii23qda5iv8cxrj9144afy75hzhvfi6m182kj4h8" "c4e927eab511" "ur")
615 ("0d42dhfa2vcw24wsvwf95pw20np0pz8c0is6p4307n981n8s207y" "7063df917cb3" "uz")
616 ("04khnkrg8css55hyna01jqay9c2ppxk5znbx2zj9i25knhvvx1lq" "1753054e6ab8" "vi")
617 ("0fi5kxn78xp7s15svkqlf4748j4pzxh941nm52n6kbbrhyi3qcqn" "93bc595dc32e" "xh")
618 ("0jg676vd37wqgzjnm0yynj7xrvm6fsgdwg296h78wnyc33zc4ads" "edd4e468bc31" "zh-CN")
619 ("1y4wldm3z95mfjlficp994jyqg0lj07wi35b79dy1s8ljy3jilil" "0bad1f7d2b2d" "zh-TW")))
620
621 ;; XXXX: Workaround 'snippet' limitations.
622 (define computed-origin-method (@@ (guix packages) computed-origin-method))
623
624 (define %icecat-version "102.4.0-guix0-preview1")
625 (define %icecat-build-id "20221019000000") ;must be of the form YYYYMMDDhhmmss
626
627 ;; 'icecat-source' is a "computed" origin that generates an IceCat tarball
628 ;; from the corresponding upstream Firefox ESR tarball, using the 'makeicecat'
629 ;; script from the upstream IceCat project.
630 (define icecat-source
631 (let* ((base-version (first (string-split %icecat-version #\-)))
632
633 (major-version (first (string-split base-version #\.)))
634 (minor-version (second (string-split base-version #\.)))
635 (sub-version (third (string-split base-version #\.)))
636
637 (upstream-firefox-version (string-append base-version "esr"))
638 (upstream-firefox-source
639 (origin
640 (method url-fetch)
641 (uri (string-append
642 "https://ftp.mozilla.org/pub/firefox/releases/"
643 upstream-firefox-version "/source/"
644 "firefox-" upstream-firefox-version ".source.tar.xz"))
645 (sha256
646 (base32
647 "0klh3lbm0zdmv90kmmpkzgn15pfjibr7zsjy3kvbzpql97fhv7z7"))))
648
649 (upstream-icecat-base-version "102.4.0") ; maybe older than base-version
650 ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version))
651 (gnuzilla-commit "8f1aa117ddca6e8cd0114265fb4ca9b5a927565a")
652 (gnuzilla-source
653 (origin
654 (method git-fetch)
655 (uri (git-reference
656 (url "git://git.savannah.gnu.org/gnuzilla.git")
657 (commit gnuzilla-commit)))
658 (file-name (git-file-name "gnuzilla"
659 ;;upstream-icecat-base-version
660 (string-take gnuzilla-commit 8)))
661 (sha256
662 (base32
663 "0ryrn8ivm763swd0qbqhlgdwc2dj4xjd81d9i2r6hb7bsb4ky3y5"))))
664
665 ;; 'search-patch' returns either a valid file name or #f, so wrap it
666 ;; in 'assume-valid-file-name' to avoid 'local-file' warnings.
667 (makeicecat-patch
668 (local-file (assume-valid-file-name
669 (search-patch "icecat-makeicecat.patch")))))
670
671 (origin
672 (method computed-origin-method)
673 (file-name (string-append "icecat-" %icecat-version ".tar.xz"))
674 (sha256 #f)
675 (uri
676 (delay
677 (with-imported-modules '((guix build utils))
678 #~(begin
679 (use-modules (guix build utils))
680 (let ((firefox-dir
681 (string-append "firefox-" #$base-version))
682 (icecat-dir
683 (string-append "icecat-" #$%icecat-version)))
684
685 (set-path-environment-variable
686 "PATH" '("bin")
687 (list #+rename
688 #+python
689 #+(canonical-package bash)
690 #+(canonical-package coreutils)
691 #+(canonical-package findutils)
692 #+(canonical-package patch)
693 #+(canonical-package xz)
694 #+(canonical-package sed)
695 #+(canonical-package grep)
696 #+(canonical-package bzip2)
697 #+(canonical-package gzip)
698 #+(canonical-package tar)))
699
700 (set-path-environment-variable
701 "PYTHONPATH"
702 (list #+(format #f "lib/python~a/site-packages"
703 (version-major+minor
704 (package-version python))))
705 '#+(cons python-jsonschema
706 (map second
707 (package-transitive-propagated-inputs
708 python-jsonschema))))
709
710 ;; Needed by the 'makeicecat' script.
711 (setenv "RENAME_CMD" "rename")
712
713 ;; We copy the gnuzilla source directory because it is
714 ;; read-only in 'gnuzilla-source', and the makeicecat script
715 ;; uses "cp -a" to copy parts of it and assumes that the
716 ;; copies will be writable.
717 (copy-recursively #+gnuzilla-source "/tmp/gnuzilla"
718 #:log (%make-void-port "w"))
719
720 (with-directory-excursion "/tmp/gnuzilla"
721 (make-file-writable "makeicecat")
722 (invoke "patch" "--force" "--no-backup-if-mismatch"
723 "-p1" "--input" #+makeicecat-patch)
724 (patch-shebang "makeicecat")
725 (substitute* "makeicecat"
726 (("^readonly FFMAJOR=(.*)" all ffmajor)
727 (unless (string=? #$major-version
728 (string-trim-both ffmajor))
729 ;; The makeicecat script cannot be expected to work
730 ;; properly on a different version of Firefox, even if
731 ;; no errors occur during execution.
732 (error "makeicecat major version mismatch"))
733 (string-append "readonly FFMAJOR=" #$major-version "\n"))
734 (("^readonly FFMINOR=.*")
735 (string-append "readonly FFMINOR=" #$minor-version "\n"))
736 (("^readonly FFSUB=.*")
737 (string-append "readonly FFSUB=" #$sub-version "\n"))
738 (("^readonly DATADIR=.*")
739 "readonly DATADIR=/tmp/gnuzilla/data\n")
740 (("^readonly SOURCEDIR=.*")
741 (string-append "readonly SOURCEDIR=" icecat-dir "\n"))
742 (("/bin/sed")
743 #+(file-append (canonical-package sed) "/bin/sed"))))
744
745 (format #t "Unpacking upstream firefox tarball...~%")
746 (force-output)
747 (invoke "tar" "xf" #+upstream-firefox-source)
748 (rename-file firefox-dir icecat-dir)
749
750 (with-directory-excursion icecat-dir
751 (format #t "Populating l10n directory...~%")
752 (force-output)
753 (mkdir "l10n")
754 (with-directory-excursion "l10n"
755 (for-each
756 (lambda (locale-dir)
757 (let ((locale
758 (string-drop (basename locale-dir)
759 (+ 32 ; length of hash
760 (string-length "-mozilla-locale-")))))
761 (format #t " ~a~%" locale)
762 (force-output)
763 (copy-recursively locale-dir locale
764 #:log (%make-void-port "w"))
765 (for-each make-file-writable (find-files locale))
766 (with-directory-excursion locale
767 (when (file-exists? ".hgtags")
768 (delete-file ".hgtags"))
769 (mkdir-p "browser/chrome/browser/preferences")
770 (call-with-output-file
771 "browser/chrome/browser/preferences/advanced-scripts.dtd"
772 (lambda (port) #f)))))
773 '#+all-mozilla-locales)
774 (copy-recursively #+mozilla-compare-locales
775 "compare-locales"
776 #:log (%make-void-port "w"))
777 (delete-file "compare-locales/.gitignore")
778 (delete-file "compare-locales/.hgignore")
779 (delete-file "compare-locales/.hgtags")))
780
781 (format #t "Running makeicecat script...~%")
782 (force-output)
783 (invoke "bash" "/tmp/gnuzilla/makeicecat")
784
785 (format #t "Packing IceCat source tarball...~%")
786 (force-output)
787 (setenv "XZ_DEFAULTS" (string-join (%xz-parallel-args)))
788 (invoke "tar" "cfa" #$output
789 ;; Avoid non-determinism in the archive. We set the
790 ;; mtime of files in the archive to early 1980 because
791 ;; the build process fails if the mtime of source
792 ;; files is pre-1980, due to the creation of zip
793 ;; archives.
794 "--mtime=@315619200" ; 1980-01-02 UTC
795 "--owner=root:0"
796 "--group=root:0"
797 "--sort=name"
798 icecat-dir)))))))))
799
800 (define-public icecat
801 (package
802 (name "icecat")
803 (version %icecat-version)
804 (source icecat-source)
805 (build-system gnu-build-system)
806 (inputs
807 (list alsa-lib
808 bzip2
809 cups
810 dbus-glib
811 gdk-pixbuf
812 glib
813 gtk+
814 gtk+-2
815 ;; UNBUNDLE-ME! graphite2
816 cairo
817 pango
818 freetype
819 font-dejavu
820 ;; UNBUNDLE-ME! harfbuzz
821 libcanberra
822 libgnome
823 libjpeg-turbo
824 libpng-apng
825 ;; UNBUNDLE-ME! libogg
826 ;; UNBUNDLE-ME! libtheora ; wants theora-1.2, not yet released
827 ;; UNBUNDLE-ME! libvorbis
828 libxft
829 libevent
830 libxinerama
831 libxscrnsaver
832 libxcomposite
833 libxt
834 libffi
835 ffmpeg
836 libvpx
837 icu4c-71 ; TODO: Change to 'icu4c' when its version is >= 71.
838 pixman
839 pulseaudio
840 mesa
841 pciutils
842 mit-krb5
843 hunspell
844 libnotify
845 ;; See <https://bugs.gnu.org/32833>
846 ;; and related comments in the 'remove-bundled-libraries' phase.
847 ;; UNBUNDLE-ME! nspr
848 ;; UNBUNDLE-ME! nss
849 shared-mime-info
850 sqlite
851 eudev
852 unzip
853 zip
854 zlib))
855 (native-inputs
856 ;; The following patches are specific to the Guix packaging of IceCat,
857 ;; and therefore we prefer to leave them out of 'source', which should be
858 ;; a tarball suitable for compilation on any system that IceCat supports.
859 ;; (Bug fixes and security fixes, however, should go in 'source').
860 (list
861 ;; XXX TODO: Adapt these patches to IceCat 102.
862 ;; ("icecat-avoid-bundled-libraries.patch"
863 ;; ,(search-patch "icecat-avoid-bundled-libraries.patch"))
864 ;; ("icecat-use-system-graphite2+harfbuzz.patch"
865 ;; ,(search-patch "icecat-use-system-graphite2+harfbuzz.patch"))
866 ;; ("icecat-use-system-media-libs.patch"
867 ;; ,(search-patch "icecat-use-system-media-libs.patch"))
868 ;; TODO: Change the following lines to use 'rust' when it's >= 1.59.
869 rust
870 `(,rust "cargo")
871 (force rust-cbindgen-0.23-promise)
872 llvm
873 clang
874 perl
875 node
876 python-wrapper
877 yasm
878 nasm ; XXX FIXME: only needed on x86_64 and i686
879 pkg-config
880 m4
881 which))
882 (arguments
883 (list
884 #:tests? #f ;not worth the cost
885
886 ;; Some dynamic lib was determined at runtime, so rpath check may fail.
887 #:validate-runpath? #f
888
889 #:configure-flags
890 #~(list
891 "--enable-application=browser"
892 "--with-distribution-id=org.gnu"
893 "--enable-geckodriver"
894 ;; Do not require addons in the global app or system directories to
895 ;; be signed by Mozilla.
896 "--with-unsigned-addon-scopes=app,system"
897 "--allow-addon-sideload"
898
899 "--enable-pulseaudio"
900
901 "--disable-tests"
902 "--disable-updater"
903 "--disable-crashreporter"
904 "--disable-eme"
905
906 ;; Building with debugging symbols takes ~5GiB, so disable it.
907 "--disable-debug"
908 "--disable-debug-symbols"
909
910 "--enable-rust-simd"
911 "--enable-release"
912 "--enable-optimize"
913 "--enable-strip"
914 "--disable-elf-hack"
915
916 ;; Clang is needed to build Stylo, Mozilla's new CSS engine. We must
917 ;; specify the clang paths manually, because otherwise the Mozilla
918 ;; build system looks in the directories returned by llvm-config
919 ;; --bindir and llvm-config --libdir, which return paths in the llvm
920 ;; package where clang is not found.
921 (string-append "--with-clang-path="
922 (search-input-file %build-inputs "bin/clang"))
923 (string-append "--with-libclang-path="
924 (dirname (search-input-file %build-inputs
925 "lib/libclang.so")))
926
927 ;; Hack to work around missing "unofficial" branding in icecat.
928 "--enable-official-branding"
929
930 ;; TODO: Add support for wasm sandboxed libraries.
931 "--without-wasm-sandboxed-libraries"
932
933 ;; Avoid bundled libraries.
934 "--with-system-jpeg" ;must be libjpeg-turbo
935 "--with-system-png" ;must be libpng-apng
936 "--with-system-zlib"
937 ;; UNBUNDLE-ME! "--with-system-bz2"
938 ;; UNBUNDLE-ME! "--with-system-libevent"
939 ;; UNBUNDLE-ME! "--with-system-ogg"
940 ;; UNBUNDLE-ME! "--with-system-vorbis"
941 ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released
942 ;; UNBUNDLE-ME! "--with-system-libvpx"
943 "--with-system-icu"
944
945 ;; See <https://bugs.gnu.org/32833>
946 ;; and related comments in the
947 ;; 'remove-bundled-libraries' phase below.
948 ;; UNBUNDLE-ME! "--with-system-nspr"
949 ;; UNBUNDLE-ME! "--with-system-nss"
950
951 ;; UNBUNDLE-ME! "--with-system-harfbuzz"
952 ;; UNBUNDLE-ME! "--with-system-graphite2"
953 "--enable-system-pixman"
954 "--enable-system-ffi"
955 ;; UNBUNDLE-ME! "--enable-system-sqlite"
956 )
957
958 #:imported-modules %cargo-utils-modules ;for `generate-all-checksums'
959
960 #:modules `((ice-9 ftw)
961 (ice-9 match)
962 (srfi srfi-1)
963 (srfi srfi-26)
964 (rnrs bytevectors)
965 (rnrs io ports)
966 (guix elf)
967 (guix build gremlin)
968 ,@%gnu-build-system-modules)
969 #:phases
970 #~(modify-phases %standard-phases
971 (add-after 'unpack 'apply-guix-specific-patches
972 (lambda* (#:key inputs native-inputs #:allow-other-keys)
973 (let ((patch (search-input-file inputs "bin/patch")))
974 (for-each (match-lambda
975 ((label . file)
976 (when (and (string-prefix? "icecat-" label)
977 (string-suffix? ".patch" label))
978 (format #t "applying '~a'...~%" file)
979 (invoke patch "--force" "--no-backup-if-mismatch"
980 "-p1" "--input" file))))
981 (or native-inputs inputs)))))
982 (add-after 'apply-guix-specific-patches 'remove-bundled-libraries
983 (lambda _
984 ;; Remove bundled libraries that we don't use, since they may
985 ;; contain unpatched security flaws, they waste disk space and
986 ;; memory, and may cause confusion.
987 (for-each (lambda (file)
988 (format #t "deleting '~a'...~%" file)
989 (delete-file-recursively file))
990 '( ;; FIXME: Removing the bundled icu breaks configure.
991 ;; * The bundled icu headers are used in some places.
992 ;; * The version number is taken from the bundled copy.
993 ;;"intl/icu"
994 ;;
995 ;; FIXME: A script from the bundled nspr is used.
996 ;;"nsprpub"
997 ;;
998 ;; FIXME: With the update to IceCat 60, using system NSS
999 ;; broke certificate validation. See
1000 ;; <https://bugs.gnu.org/32833>. For now, we use
1001 ;; the bundled NSPR and NSS. TODO: Investigate,
1002 ;; and try to unbundle these libraries again.
1003 ;; UNBUNDLE-ME! "security/nss"
1004 ;;
1005 ;; TODO: Use more system media libraries. See:
1006 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
1007 ;; * libtheora: esr60 wants v1.2, not yet released.
1008 ;; * soundtouch: avoiding the bundled library would
1009 ;; result in some loss of functionality. There's
1010 ;; also an issue with exception handling
1011 ;; configuration. It seems that this is needed in
1012 ;; some moz.build:
1013 ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1
1014 ;; * libopus
1015 ;; * speex
1016 ;;
1017 "modules/freetype2"
1018 ;; "media/libjpeg" ; needed for now, because media/libjpeg/moz.build is referenced from config/external/moz.build
1019 ;; UNBUNDLE-ME! "modules/zlib"
1020 ;; UNBUNDLE-ME! "ipc/chromium/src/third_party/libevent"
1021 ;; UNBUNDLE-ME! "media/libvpx"
1022 ;; UNBUNDLE-ME! "media/libogg"
1023 ;; UNBUNDLE-ME! "media/libvorbis"
1024 ;; UNBUNDLE-ME! "media/libtheora" ; wants theora-1.2, not yet released
1025 ;; UNBUNDLE-ME! "media/libtremor"
1026 ;; UNBUNDLE-ME! "gfx/harfbuzz"
1027 ;; UNBUNDLE-ME! "gfx/graphite2"
1028 "js/src/ctypes/libffi"
1029 ;; UNBUNDLE-ME! "db/sqlite3"
1030 ))))
1031 (add-after 'remove-bundled-libraries 'fix-ffmpeg-runtime-linker
1032 (lambda* (#:key inputs #:allow-other-keys)
1033 ;; Arrange to load libavcodec.so by its absolute file name.
1034 (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
1035 (("libavcodec\\.so")
1036 (search-input-file inputs "lib/libavcodec.so")))))
1037 (add-after 'fix-ffmpeg-runtime-linker 'build-sandbox-whitelist
1038 (lambda* (#:key inputs #:allow-other-keys)
1039 (define (runpath-of lib)
1040 (call-with-input-file lib
1041 (compose elf-dynamic-info-runpath
1042 elf-dynamic-info
1043 parse-elf
1044 get-bytevector-all)))
1045 (define (runpaths-of-input label)
1046 (let* ((dir (string-append (assoc-ref inputs label) "/lib"))
1047 (libs (find-files dir "\\.so$")))
1048 (append-map runpath-of libs)))
1049 ;; Populate the sandbox read-path whitelist as needed by ffmpeg.
1050 (let* ((whitelist
1051 (map (cut string-append <> "/")
1052 (delete-duplicates
1053 `(,(string-append (assoc-ref inputs "shared-mime-info")
1054 "/share/mime")
1055 ,(string-append (assoc-ref inputs "font-dejavu")
1056 "/share/fonts")
1057 "/run/current-system/profile/share/fonts"
1058 ,@(append-map runpaths-of-input
1059 '("mesa" "ffmpeg"))))))
1060 (whitelist-string (string-join whitelist ","))
1061 (port (open-file "browser/app/profile/icecat.js" "a")))
1062 (format #t "setting 'security.sandbox.content.read_path_whitelist' to '~a'~%"
1063 whitelist-string)
1064 (format port "~%pref(\"security.sandbox.content.read_path_whitelist\", ~S);~%"
1065 whitelist-string)
1066 (close-output-port port))))
1067 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1068 (lambda _
1069 (use-modules (guix build cargo-utils))
1070 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
1071 (for-each (lambda (file)
1072 (format #t "patching checksums in ~a~%" file)
1073 (substitute* file
1074 (("^checksum = \".*\"")
1075 (string-append "checksum = \"" null-hash "\""))))
1076 (find-files "." "Cargo.lock$"))
1077 (for-each generate-all-checksums
1078 '("services"
1079 "js"
1080 "third_party/rust"
1081 "dom/media"
1082 "dom/webauthn"
1083 "toolkit"
1084 "gfx"
1085 "storage"
1086 "modules"
1087 "xpcom/rust"
1088 "media"
1089 "mozglue/static/rust"
1090 "netwerk"
1091 "remote"
1092 "intl"
1093 "servo"
1094 "security/manager/ssl"
1095 "build")))))
1096 (add-after 'patch-cargo-checksums 'remove-cargo-frozen-flag
1097 (lambda _
1098 ;; Remove --frozen flag from cargo invokation, otherwise it'll
1099 ;; complain that it's not able to change Cargo.lock.
1100 ;; https://bugzilla.mozilla.org/show_bug.cgi?id=1726373
1101 (substitute* "build/RunCbindgen.py"
1102 (("\"--frozen\",") ""))))
1103 (delete 'bootstrap)
1104 (replace 'configure
1105 ;; configure does not work followed by both "SHELL=..." and
1106 ;; "CONFIG_SHELL=..."; set environment variables instead
1107 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1108 (let* ((bash (which "bash"))
1109 (abs-srcdir (getcwd))
1110 (flags `(,(string-append "--prefix=" #$output)
1111 ,(string-append "--with-l10n-base="
1112 abs-srcdir "/l10n")
1113 ,@configure-flags)))
1114 (setenv "SHELL" bash)
1115 (setenv "CONFIG_SHELL" bash)
1116
1117 (setenv "AR" "llvm-ar")
1118 (setenv "NM" "llvm-nm")
1119 (setenv "CC" "clang")
1120 (setenv "CXX" "clang++")
1121 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1122 #$output "/lib/icecat"))
1123
1124 (setenv "MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE" "system")
1125 (setenv "MOZ_BUILD_DATE" #$%icecat-build-id) ; avoid timestamp
1126
1127 ;; XXX TODO: Fix this to work on systems other than x86_64-linux.
1128 (setenv "GUIX_PYTHONPATH"
1129 (string-append (getcwd)
1130 "/obj-x86_64-pc-linux-gnu/_virtualenvs/build"))
1131
1132 (mkdir ".mozbuild")
1133 (setenv "MOZBUILD_STATE_PATH"
1134 (string-append (getcwd) "/.mozbuild"))
1135
1136 (format #t "build directory: ~s~%" (getcwd))
1137 (format #t "configure flags: ~s~%" flags)
1138
1139 (call-with-output-file "mozconfig"
1140 (lambda (port)
1141 (for-each (lambda (flag)
1142 (format port "ac_add_options ~a\n" flag))
1143 flags)))
1144
1145 (invoke "./mach" "configure"))))
1146 (replace 'build
1147 (lambda* (#:key (make-flags '()) (parallel-build? #t)
1148 #:allow-other-keys)
1149 (apply invoke "./mach" "build"
1150 ;; mach will use parallel build if possible by default
1151 `(,@(if parallel-build?
1152 '()
1153 '("-j1"))
1154 ,@make-flags))))
1155 (add-after 'build 'neutralise-store-references
1156 (lambda _
1157 ;; Mangle the store references to compilers & other build tools in
1158 ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64.
1159 (let* ((obj-dir (match (scandir "." (cut string-prefix? "obj-" <>))
1160 ((dir) dir)))
1161 (file (string-append
1162 obj-dir
1163 "/dist/bin/chrome/toolkit/content/global/buildconfig.html")))
1164 (substitute* file
1165 (("[0-9a-df-np-sv-z]{32}" hash)
1166 (string-append (string-take hash 8)
1167 "<!-- Guix: not a runtime dependency -->"
1168 (string-drop hash 8)))))))
1169 (replace 'install
1170 (lambda* (#:key outputs #:allow-other-keys)
1171 (invoke "./mach" "install")
1172 ;; The geckodriver binary is not installed by the above, for some
1173 ;; reason. Use 'find-files' to avoid having to deal with the
1174 ;; system/architecture-specific file name.
1175 (install-file (first (find-files "." "geckodriver"))
1176 (string-append #$output "/bin"))))
1177 (add-after 'install 'wrap-program
1178 (lambda* (#:key inputs #:allow-other-keys)
1179 (let* ((lib (string-append #$output "/lib"))
1180 (gtk #$(this-package-input "gtk+"))
1181 (gtk-share (string-append gtk "/share"))
1182 (ld-libs '#$(map (lambda (label)
1183 (file-append (this-package-input label) "/lib"))
1184 '("libpng-apng"
1185 "libxscrnsaver"
1186 "mesa"
1187 "pciutils"
1188 "mit-krb5"
1189 "eudev"
1190 "pulseaudio"
1191 ;; For the integration of native notifications
1192 "libnotify"))))
1193 (wrap-program (car (find-files lib "^icecat$"))
1194 `("XDG_DATA_DIRS" prefix (,gtk-share))
1195 ;; The following line is commented out because the icecat
1196 ;; package on guix has been observed to be unstable when
1197 ;; using wayland, and the bundled extensions stop working.
1198 ;; `("MOZ_ENABLE_WAYLAND" = ("1"))
1199 `("LD_LIBRARY_PATH" prefix ,ld-libs)))))
1200 (add-after 'wrap-program 'install-desktop-entry
1201 (lambda _
1202 ;; Install the '.desktop' file.
1203 (let* ((desktop-file "taskcluster/docker/icecat-snap/icecat.desktop")
1204 (applications (string-append #$output "/share/applications")))
1205 (substitute* desktop-file
1206 (("^Exec=icecat") (string-append "Exec=" #$output "/bin/icecat"))
1207 (("IceCat") "GNU IceCat")
1208 (("Icon=.*") "Icon=icecat\n")
1209 (("NewWindow") "new-window")
1210 (("NewPrivateWindow") "new-private-window")
1211 (("StartupNotify=true")
1212 "StartupNotify=true\nStartupWMClass=Navigator"))
1213 (install-file desktop-file applications))))
1214 (add-after 'install-desktop-entry 'install-icons
1215 (lambda _
1216 (with-directory-excursion "browser/branding/official"
1217 (for-each
1218 (lambda (file)
1219 (let* ((size (string-filter char-numeric? file))
1220 (icons (string-append #$output "/share/icons/hicolor/"
1221 size "x" size "/apps")))
1222 (mkdir-p icons)
1223 (copy-file file (string-append icons "/icecat.png"))))
1224 '("default16.png" "default22.png" "default24.png"
1225 "default32.png" "default48.png" "content/icon64.png"
1226 "mozicon128.png" "default256.png"))))))))
1227 (home-page "https://www.gnu.org/software/gnuzilla/")
1228 (synopsis "Entirely free browser derived from Mozilla Firefox")
1229 (description
1230 "IceCat is the GNU version of the Firefox browser. It is entirely free
1231 software, which does not recommend non-free plugins and addons. It also
1232 features built-in privacy-protecting features. This package also includes the
1233 @command{geckodriver} command, which can be useful for automated web
1234 testing.
1235
1236 WARNING: IceCat 102 has not yet been released by the upstream IceCat project.
1237 This is a preview release, and does not currently meet the privacy-respecting
1238 standards of the IceCat project.")
1239 (license license:mpl2.0) ;and others, see toolkit/content/license.html
1240 (properties
1241 `((ftp-directory . "/gnu/gnuzilla")
1242 (cpe-name . "firefox_esr")
1243 (cpe-version . ,(first (string-split version #\-)))))))
1244
1245 (define %icedove-build-id "20221026000000") ;must be of the form YYYYMMDDhhmmss
1246 (define %icedove-version "102.4.1")
1247
1248 ;; Provides the "comm" folder which is inserted into the icecat source.
1249 ;; Avoids the duplication of Icecat's source tarball.
1250 (define thunderbird-source
1251 (origin
1252 (method hg-fetch)
1253 (uri (hg-reference
1254 (url "https://hg.mozilla.org/releases/comm-esr102")
1255 (changeset "e572bc3cfa07492189aec439e98378b0811ae3bb")))
1256 (file-name (string-append "thunderbird-" %icedove-version "-checkout"))
1257 (sha256
1258 (base32
1259 "1qmf8j9yrc815h7j06m3id6h7cck6d5b0rhzr82wgmwf1xnngxl7"))))
1260
1261 (define-public icedove
1262 (package
1263 (name "icedove")
1264 (version %icedove-version)
1265 (source icecat-source)
1266 (properties
1267 `((cpe-name . "thunderbird_esr")))
1268 (build-system gnu-build-system)
1269 (arguments
1270 (list
1271 #:tests? #f ;no check target
1272 #:imported-modules %cargo-utils-modules ;for `generate-all-checksums'
1273 #:modules `((guix build utils) ;find-files
1274 (sxml simple)
1275 (ice-9 regex)
1276 ,@%gnu-build-system-modules)
1277 #:phases
1278 #~(modify-phases %standard-phases
1279 (add-after 'unpack 'prepare-thunderbird-sources
1280 (lambda _
1281 (mkdir "comm")
1282 (copy-recursively #$thunderbird-source "comm")
1283 (delete-file "sourcestamp.txt")))
1284 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1285 (lambda _
1286 (use-modules (guix build cargo-utils))
1287 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934\
1288 ca495991b7852b855"))
1289 (for-each (lambda (file)
1290 (format #t "patching checksums in ~a~%" file)
1291 (substitute* file
1292 (("^checksum = \".*\"")
1293 (string-append "checksum = \"" null-hash "\""))))
1294 (find-files "." "Cargo.lock$"))
1295 (for-each generate-all-checksums
1296 '("third_party/rust"
1297 "toolkit/library/rust")))))
1298 (add-after 'patch-cargo-checksums 'remove-cargo-frozen-flag
1299 (lambda _
1300 ;; Remove --frozen flag from cargo invokation, otherwise it'll
1301 ;; complain that it's not able to change Cargo.lock.
1302 ;; https://bugzilla.mozilla.org/show_bug.cgi?id=1726373
1303 (substitute* "build/RunCbindgen.py"
1304 (("\"--frozen\",") ""))))
1305 ;; Fixes issue where each installation directory generates its own
1306 ;; profile (see:
1307 ;; https://trac.torproject.org/projects/tor/ticket/31457).
1308 (add-after 'patch-source-shebangs 'fix-profile-setting
1309 (lambda _
1310 (substitute* "comm/mail/moz.configure"
1311 (("MOZ_DEDICATED_PROFILES, True")
1312 "MOZ_DEDICATED_PROFILES, False"))))
1313 (add-after 'prepare-thunderbird-sources 'rename-to-icedove
1314 (lambda _
1315 (substitute* "comm/mail/confvars.sh"
1316 (("MOZ_APP_NAME=thunderbird")
1317 "MOZ_APP_NAME=icedove")
1318 (("MOZ_UPDATER=1")
1319 "MOZ_UPDATER=0"))
1320 ;; Remove branding to comply with Mozilla's trademark policy
1321 (with-directory-excursion "comm/mail/branding/nightly"
1322 (delete-file "content/about-wordmark.svg")
1323 (call-with-output-file "content/about-wordmark.svg"
1324 (lambda (port)
1325 (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg")
1326 (viewBox "0 0 789.1 90.78")
1327 (width "333")
1328 (height "48")
1329 (fill "#fff"))
1330 (text (@ (x "400") (y "70")
1331 (text-anchor "middle")
1332 (font-size "90"))
1333 "Icedove Daily"))
1334 port)))
1335 (substitute* '("locales/en-US/brand.properties"
1336 "locales/en-US/brand.ftl"
1337 "locales/en-US/brand.dtd"
1338 "configure.sh")
1339 (("Thunderbird") "Icedove")
1340 (("mozilla.org") "guix.gnu.org")))
1341 ;; Remove other mentions of Thunderbird in user-visible text.
1342 (with-directory-excursion "comm/mail/base/content"
1343 (substitute* '("overrides/app-license-name.html")
1344 (("Thunderbird") "Icedove")))
1345 (with-directory-excursion "comm/mail/components/"
1346 (substitute* '("MailGlue.jsm"
1347 "extensions/schemas/addressBook.json"
1348 "extensions/schemas/tabs.json"
1349 "extensions/schemas/cloudFile.json"
1350 "extensions/schemas/chrome_settings_overrides.json"
1351 "extensions/schemas/windows.json"
1352 "extensions/parent/ext-mail.js"
1353 "im/messages/mail/Info.plist"
1354 "enterprisepolicies/moz.build"
1355 "enterprisepolicies/helpers/moz.build"
1356 "enterprisepolicies/schemas/moz.build")
1357 (("Thunderbird") "Icedove")))
1358 (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js"
1359 "comm/mail/base/content/customizeToolbar.js"
1360 "comm/suite/components/customizeToolbar.js")
1361 (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e)
1362 (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e)))
1363
1364 ;; Override addon URLs and settings
1365 (substitute* "comm/mail/app/profile/all-thunderbird.js"
1366 (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m)
1367 (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");"))
1368 (("(pref\\(\"extensions.getAddons.search.url\").*" _ m)
1369 (string-append m ", \"https://guix.gnu.org/packages\");"))
1370 (("(pref\\(\"extensions.update.enabled\").*" _ m)
1371 (string-append m ", false);"))
1372 (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m)
1373 (string-append m ", false);"))
1374 (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m)
1375 (string-append m ", false);")))))
1376 (add-after 'build 'neutralize-store-references
1377 (lambda _
1378 ;; Mangle the store references to compilers & other build tools in
1379 ;; about:buildconfig, reducing Icedove's closure significant.
1380 ;; The resulting files are saved in lib/thunderbird/omni.ja
1381 (substitute*
1382 ;; Use find because the path "obj-x86_64-pc-linux-gnu" contains
1383 ;; the architecture and the system -> more complicated.
1384 (find-files "." "buildconfig.html")
1385 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1386 (regexp-quote (%store-directory)))
1387 _ store hash)
1388 (string-append store
1389 (string-take hash 8)
1390 "<!-- Guix: not a runtime dependency -->"
1391 (string-drop hash 8))))))
1392 (delete 'bootstrap)
1393 (replace 'configure
1394 (lambda* (#:key inputs configure-flags #:allow-other-keys)
1395 (let* ((bash (which "bash"))
1396 (abs-srcdir (getcwd))
1397 (srcdir (string-append "../" (basename abs-srcdir)))
1398 (flags `(,(string-append "--prefix=" #$output)
1399 ,@configure-flags))
1400 (mozconfig (string-append (getcwd) "/.mozconfig")))
1401 (setenv "SHELL" bash)
1402 (setenv "CONFIG_SHELL" bash)
1403 (setenv "QA_CONFIGURE_OPTIONS" ".*")
1404 (setenv "MOZBUILD_STATE_PATH"
1405 (string-append (getcwd) "/mach_state"))
1406 (setenv "MOZCONFIG"
1407 (string-append (getcwd) "/.mozconfig"))
1408
1409 (setenv "AR" "llvm-ar")
1410 (setenv "NM" "llvm-nm")
1411 (setenv "CC" "clang")
1412 (setenv "CXX" "clang++")
1413
1414 (setenv "MOZ_NOSPAM" "1")
1415 (setenv "MACH_USE_SYSTEM_PYTHON" "1")
1416 (setenv "PYTHON"
1417 (search-input-file inputs "/bin/python"))
1418 (setenv "MOZ_BUILD_DATE" #$%icedove-build-id) ; avoid timestamp
1419 (setenv "MOZ_APP_NAME" "icedove")
1420 (setenv "LDFLAGS" (string-append "-Wl,-rpath=" #$output
1421 "/lib/icedove"))
1422 (mkdir-p (string-append (getcwd) "/builddir"))
1423 (with-output-to-file mozconfig
1424 (lambda ()
1425 (display
1426 (string-append
1427 "ac_add_options --disable-crashreporter\n"
1428 "ac_add_options --disable-debug\n"
1429 "ac_add_options --disable-debug-symbols\n"
1430 "ac_add_options --disable-elf-hack\n"
1431 "ac_add_options --disable-jit\n"
1432 "ac_add_options --disable-necko-wifi\n"
1433 "ac_add_options --disable-official-branding\n"
1434 "ac_add_options --disable-tests\n"
1435 "ac_add_options --disable-updater\n"
1436 "ac_add_options --disable-webrtc\n"
1437 "ac_add_options --enable-application=comm/mail\n"
1438 "ac_add_options --enable-default-toolkit=\"cairo-gtk3\"\n"
1439 "ac_add_options --enable-optimize\n"
1440 "ac_add_options --enable-pulseaudio\n"
1441 "ac_add_options --enable-release\n"
1442 "ac_add_options --enable-strip\n"
1443 "ac_add_options --enable-system-ffi\n"
1444 "ac_add_options --enable-system-pixman\n"
1445 "ac_add_options --prefix=" #$output "\n"
1446 "ac_add_options --with-clang-path=" (assoc-ref %build-inputs "clang") "/bin/clang\n"
1447 "ac_add_options --with-distribution-id=org.gnu\n"
1448 "ac_add_options --with-libclang-path=" (assoc-ref %build-inputs "clang") "/lib\n"
1449 "ac_add_options --with-system-bz2\n"
1450 "ac_add_options --with-system-icu\n"
1451 "ac_add_options --with-system-jpeg\n"
1452 "ac_add_options --with-system-libevent\n"
1453 "ac_add_options --with-system-nspr\n"
1454 ;"ac_add_options --with-system-nss\n"
1455 "ac_add_options --with-system-zlib\n"
1456 "ac_add_options --without-wasm-sandboxed-libraries\n"
1457 "mk_add_options MOZ_MAKE_FLAGS=-j"
1458 (number->string (parallel-job-count)) "\n"))))
1459 (display (getcwd))
1460 (newline)
1461 (display "mach configure")
1462 (invoke "./mach" "configure"))))
1463 (replace 'build
1464 (lambda _ (invoke "./mach" "build")))
1465 (replace 'install
1466 (lambda _ (invoke "./mach" "install")))
1467 ;; Thunderbird doesn't provide any .desktop file.
1468 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
1469 (add-after 'install 'install-desktop-file
1470 (lambda _
1471 (let ((apps (string-append #$output "/share/applications")))
1472 (mkdir-p apps)
1473 (with-output-to-file (string-append apps "/icedove.desktop")
1474 (lambda _
1475 (format #t
1476 "[Desktop Entry]~@
1477 Name=Icedove~@
1478 Exec=~a/bin/icedove~@
1479 Icon=icedove~@
1480 GenericName=Mail/News Client~@
1481 Categories=Network;Email;~@
1482 Terminal=false~@
1483 StartupNotify=true~@
1484 MimeType=x-scheme-handler/mailto;~@
1485 Type=Application~@
1486 Actions=ComposeMessage;~@
1487 [Desktop Action ComposeMessage]~@
1488 Name=Write new message~@
1489 Exec=~@*~a/bin/icedove -compose~%"
1490 #$output))))))
1491 (add-after 'install 'wrap-program
1492 (lambda* (#:key inputs #:allow-other-keys)
1493 (let* ((lib (string-append #$output "/lib"))
1494 (gtk #$(this-package-input "gtk+"))
1495 (gtk-share (string-append gtk "/share"))
1496 (pulseaudio #$(this-package-input "pulseaudio"))
1497 (pulseaudio-lib (string-append pulseaudio "/lib"))
1498 (eudev #$(this-package-input "eudev"))
1499 (eudev-lib (string-append eudev "/lib")))
1500 (wrap-program (car (find-files lib "^icedove$"))
1501 `("XDG_DATA_DIRS" prefix (,gtk-share))
1502 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib ,eudev-lib)))))))))
1503 (inputs
1504 (list alsa-lib
1505 bzip2
1506 cairo
1507 cups
1508 dbus-glib
1509 ffmpeg
1510 freetype
1511 gdk-pixbuf
1512 glib
1513 gtk+
1514 gtk+-2
1515 hunspell
1516 icu4c-71
1517 libcanberra
1518 libevent
1519 libffi
1520 libgnome
1521 libjpeg-turbo
1522 libpng-apng
1523 libvpx
1524 libxcomposite
1525 libxft
1526 libxinerama
1527 libxscrnsaver
1528 libxt
1529 mesa
1530 mit-krb5
1531 nspr-4.32
1532 ;; FIXME: create nss >= 3.68 after core-updates merge
1533 ;;nss
1534 pango
1535 pixman
1536 pulseaudio
1537 sqlite
1538 startup-notification
1539 eudev
1540 unzip
1541 zip
1542 zlib))
1543 (native-inputs
1544 (list `(,rust "cargo")
1545 clang
1546 llvm
1547 m4
1548 nasm
1549 node
1550 perl
1551 pkg-config
1552 python-wrapper
1553 rust
1554 (force rust-cbindgen-0.23-promise)
1555 which
1556 yasm))
1557 (home-page "https://www.thunderbird.net")
1558 (synopsis "Rebranded Mozilla Thunderbird email client")
1559 (description
1560 "This package provides an email client built based on Mozilla
1561 Thunderbird. It supports email, news feeds, chat, calendar and contacts.")
1562 (license license:mpl2.0)))
1563
1564 (define-public icedove/wayland
1565 (package
1566 (inherit icedove)
1567 (name "icedove-wayland")
1568 (native-inputs '())
1569 (inputs
1570 `(("bash" ,bash-minimal)
1571 ("icedove" ,icedove)))
1572 (build-system trivial-build-system)
1573 (arguments
1574 '(#:modules ((guix build utils))
1575 #:builder
1576 (begin
1577 (use-modules (guix build utils))
1578 (let* ((bash (assoc-ref %build-inputs "bash"))
1579 (icedove (assoc-ref %build-inputs "icedove"))
1580 (out (assoc-ref %outputs "out"))
1581 (exe (string-append out "/bin/icedove")))
1582 (mkdir-p (dirname exe))
1583
1584 (call-with-output-file exe
1585 (lambda (port)
1586 (format port "#!~a
1587 MOZ_ENABLE_WAYLAND=1 exec ~a $@"
1588 (string-append bash "/bin/bash")
1589 (string-append icedove "/bin/icedove"))))
1590 (chmod exe #o555)
1591
1592 ;; Provide the manual and .desktop file.
1593 (copy-recursively (string-append icedove "/share")
1594 (string-append out "/share"))
1595 (substitute* (string-append
1596 out "/share/applications/icedove.desktop")
1597 ((icedove) out))
1598 #t))))))
1599
1600 (define-public firefox-decrypt
1601 (package
1602 (name "firefox-decrypt")
1603 (version "0.7.0")
1604 (source (origin
1605 (method git-fetch)
1606 (uri (git-reference
1607 (url "https://github.com/Unode/firefox_decrypt")
1608 (commit version)))
1609 (file-name (git-file-name name version))
1610 (sha256
1611 (base32
1612 "17yyyxp47z4m8hnflcq34rc1y871515kr3f1y42j1l0yx3g0il07"))))
1613 (build-system trivial-build-system)
1614 (inputs
1615 (list nss python))
1616 (arguments
1617 `(#:modules ((guix build utils))
1618 #:builder
1619 (begin
1620 (use-modules (guix build utils))
1621 (setenv "PATH"
1622 (string-append
1623 (assoc-ref %build-inputs "python") "/bin"))
1624 (copy-file (string-append (assoc-ref %build-inputs "source")
1625 "/firefox_decrypt.py")
1626 "firefox_decrypt.py")
1627 (substitute* "firefox_decrypt.py"
1628 (("/usr/bin/env python") (which "python3"))
1629 (("libnss3.so") (string-append (assoc-ref %build-inputs "nss")
1630 "/lib/nss/libnss3.so")))
1631 (install-file "firefox_decrypt.py" (string-append %output "/bin"))
1632 #t)))
1633 (home-page "https://github.com/Unode/firefox_decrypt/")
1634 (synopsis "Tool to extract passwords from Mozilla profiles")
1635 (description "Firefox Decrypt is a tool to extract passwords from
1636 Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.")
1637 (license license:gpl3+)))
1638
1639 (define-public lz4json
1640 (package
1641 (name "lz4json")
1642 (version "2")
1643 (source
1644 (origin
1645 (method git-fetch)
1646 (uri
1647 (git-reference
1648 (url "https://github.com/andikleen/lz4json")
1649 (commit (string-append "v" version))))
1650 (file-name (git-file-name name version))
1651 (sha256
1652 (base32 "1xxn8yzr6j8j6prmbj6mxspdczigarfiv3vlm9k70yxmky65ijh3"))))
1653 (build-system gnu-build-system)
1654 (native-inputs (list pkg-config))
1655 (inputs (list lz4))
1656 (arguments
1657 `(#:tests? #f ; no check target
1658 #:phases
1659 (modify-phases %standard-phases
1660 (delete 'configure) ; no configure script
1661 (replace 'install ; no install target
1662 (lambda* (#:key outputs #:allow-other-keys)
1663 (let* ((out (assoc-ref outputs "out"))
1664 (bin (string-append out "/bin"))
1665 (man (string-append out "/share/man/man1")))
1666 (install-file "lz4jsoncat" bin)
1667 (install-file "lz4jsoncat.1" man)))))
1668 #:make-flags `(,(string-append "CC=" ,(cc-for-target)))))
1669 (home-page "https://github.com/andikleen/lz4json")
1670 (synopsis "C decompress tool for mozilla lz4json format")
1671 (description
1672 "@code{lz4json} is a little utility to unpack lz4json files as generated
1673 by Firefox's bookmark backups and session restore. This is a different format
1674 from what the normal lz4 utility expects. The data is dumped to stdout.")
1675 (license license:bsd-2)))