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