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, 2023 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, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
21 ;;; Copyright © 2021 Baptiste Strazzul <bstrazzull@hotmail.fr>
23 ;;; This file is part of GNU Guix.
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38 (define-module (gnu packages gnuzilla)
39 #:use-module ((srfi srfi-1) #:hide (zip))
40 #:use-module (ice-9 format)
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 modules)
51 #:use-module (guix monads)
52 #:use-module (guix utils)
53 #:use-module (guix build-system gnu)
54 #:use-module (guix build-system cargo)
55 #:use-module (guix build-system trivial)
56 #:use-module (gnu packages admin)
57 #:use-module (gnu packages audio)
58 #:use-module (gnu packages autotools)
59 #:use-module (gnu packages m4)
60 #:use-module (gnu packages base)
61 #:use-module (gnu packages bash)
62 #:use-module (gnu packages databases)
63 #:use-module (gnu packages glib)
64 #:use-module (gnu packages gtk)
65 #:use-module (gnu packages gnome)
66 #:use-module (gnu packages libcanberra)
67 #:use-module (gnu packages cups)
68 #:use-module (gnu packages kerberos)
69 #:use-module (gnu packages linux)
70 #:use-module (gnu packages perl)
71 #:use-module (gnu packages pkg-config)
72 #:use-module (gnu packages compression)
73 #:use-module (gnu packages fontutils)
74 #:use-module (gnu packages fonts)
75 #:use-module (gnu packages hunspell)
76 #:use-module (gnu packages libevent)
77 #:use-module (gnu packages image)
78 #:use-module (gnu packages libffi)
79 #:use-module (gnu packages pulseaudio)
80 #:use-module (gnu packages python)
81 #:use-module (gnu packages python-xyz)
82 #:use-module (gnu packages node)
83 #:use-module (gnu packages xorg)
84 #:use-module (gnu packages gl)
85 #:use-module (gnu packages pciutils)
86 #:use-module (gnu packages assembly)
87 #:use-module (gnu packages rust)
88 #:use-module (gnu packages rust-apps)
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 #:autoload (json parser) (json->scm))
105 ;; TODO: Switch to IceCat source once available on ftp.gnu.org.
106 (uri (string-append "https://ftp.mozilla.org/pub/firefox"
107 "/releases/" version "esr/source/firefox-"
108 version "esr.source.tar.xz"))
111 "1zwpgis7py1bf8p88pz3mpai6a02qrdb8ww2fa9kxxdl9b8r2k81"))))
112 (build-system gnu-build-system)
115 #:imported-modules %cargo-utils-modules ;for `generate-all-checksums'
116 #:modules `((guix build cargo-utils)
117 ,@%gnu-build-system-modules)
118 #:test-target "check-jstests"
121 ;; Disable debugging symbols to save space.
123 "--disable-debug-symbols"
124 ;; This is important because without it gjs will segfault during the
125 ;; configure phase. With jemalloc only the standalone mozjs console
139 #~(modify-phases %standard-phases
140 (add-after 'patch-source-shebangs 'patch-cargo-checksums
143 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
144 (for-each (lambda (file)
145 (format #t "patching checksums in ~a~%" file)
147 (("^checksum = \".*\"")
148 (string-append "checksum = \"" null-hash "\""))))
149 (find-files "." "Cargo\\.lock$"))
150 (for-each generate-all-checksums
151 '("js" "third_party/rust")))))
153 (lambda* (#:key configure-flags #:allow-other-keys)
154 ;; The configure script does not accept environment variables as
155 ;; arguments. It also must be run from a different directory,
156 ;; but not the root directory either.
157 (mkdir "run-configure-from-here")
158 (chdir "run-configure-from-here")
159 (setenv "SHELL" (which "sh"))
160 (setenv "CONFIG_SHELL" (which "sh"))
161 (setenv "AUTOCONF" (which "autoconf"))
162 (apply invoke "python" "../configure.py"
163 "--enable-project=js"
164 (string-append "--prefix=" #$output)
166 (add-before 'check 'adjust-tests
168 (with-directory-excursion "../js/src/tests"
169 (substitute* "shell/os.js"
170 ;; FIXME: Why does the killed process have an exit status?
171 ((".*killed process should not have exitStatus.*")
174 ;; The test suite expects a lightly patched ICU. Disable tests
175 ;; that do not work with the system version. See
176 ;; "intl/icu-patches" for clues.
178 ;; See <https://unicode-org.atlassian.net/browse/ICU-20992> and
179 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=1636984> and
180 ;; related patch for why this is failing.
181 (delete-file "non262/Intl/DateTimeFormat/\
182 fractional-second-digits-append-item.js")
183 ;; FIXME: got "0 \u251CAM/PM: noon\u2524", expected "0 (AM/PM: noon)"
184 (delete-file "non262/Intl/DateTimeFormat/day-period-hour-cycle.js")
185 ;; FIXME: got "en-US-posix", expected "en-US-POSIX".
186 (delete-file "non262/Intl/available-locales-supported.js")
187 ;; FIXME: got "en-US", expected "en-US-POSIX"
188 (delete-file "non262/Intl/available-locales-resolved.js"))))
189 (add-before 'check 'pre-check
191 (setenv "JSTESTS_EXTRA_ARGS"
194 ;; Do not run tests marked as "random".
196 ;; Exclude web platform tests.
198 ;; Respect the daemons configured number of jobs.
199 (string-append "--worker-count="
200 (number->string (parallel-job-count)))))))))))
203 llvm ;for llvm-objdump
211 (list icu4c-71 readline zlib))
213 (list nspr)) ; in the Requires.private field of mozjs-*.pc
215 "https://spidermonkey.dev/")
216 (synopsis "Mozilla JavaScript engine")
217 (description "SpiderMonkey is Mozilla's JavaScript engine written
219 (license license:mpl2.0))) ; and others for some files
221 (define-public mozjs-91
227 (uri (string-append "https://ftp.mozilla.org/pub/firefox"
228 "/releases/" version "esr/source/firefox-"
229 version "esr.source.tar.xz"))
232 "0qh7j960wdp5zcfqhkj8ki47spp9i9ms12xx0v0kxvmmw36jpgjk"))))
234 (substitute-keyword-arguments (package-arguments mozjs)
236 #~(modify-phases #$phases
237 (add-before 'check 'disable-timezone-tests
239 (with-directory-excursion "../js/src/tests"
240 ;; FIXME: Assertion failed: got "2021a", expected "2021a3"?
241 (delete-file "non262/Intl/DateTimeFormat/timeZone_version.js")
242 ;; XXX: Delete all tests that test time zone functionality,
243 ;; because the test suite uses /etc/localtime to figure out
244 ;; the offset from the hardware clock, which does not work
245 ;; in the build container. See <tests/non262/Date/shell.js>.
246 (delete-file-recursively "non262/Date")
248 "non262/Intl/DateTimeFormat/tz-environment-variable.js"))))))))
249 (inputs (modify-inputs (package-inputs mozjs)
250 (replace "icu4c" icu4c)))))
252 (define-public mozjs-78
259 (uri (string-append "https://archive.mozilla.org/pub/firefox"
260 "/releases/" version "esr/source/firefox-"
261 version "esr.source.tar.xz"))
264 "0l91cxdc5v9fps79ckb1kid4gw6v5qng1jd9zvaacwaiv628shx4"))))
265 (build-system gnu-build-system)
267 (substitute-keyword-arguments (package-arguments mozjs)
269 #~(modify-phases #$phases
271 (lambda* (#:key configure-flags #:allow-other-keys)
272 ;; The configure script does not accept environment variables as
273 ;; arguments. It also must be run from a different directory,
274 ;; but not the root directory either.
275 (mkdir "run-configure-from-here")
276 (chdir "run-configure-from-here")
277 (setenv "SHELL" (which "sh"))
278 (setenv "CONFIG_SHELL" (which "sh"))
279 (setenv "AUTOCONF" (which "autoconf"))
280 (apply invoke "../js/src/configure"
281 (cons (string-append "--prefix=" #$output)
283 (replace 'adjust-tests
285 (with-directory-excursion "../js/src/tests"
286 ;; The test suite expects a lightly patched ICU 67. Since
287 ;; Guix is about to switch to ICU 68, massage the tests to
288 ;; work with that instead of patching ICU. Try removing this
289 ;; phase for newer versions of mozjs.
291 ;; These tests look up locale names and expects to get
292 ;; "GB" instead of "UK".
293 (substitute* "non262/Intl/DisplayNames/language.js"
294 (("Traditionell, GB")
296 (substitute* "non262/Intl/DisplayNames/region.js"
300 ;; XXX: Some localized time formats have changed, and
301 ;; substitution fails for accented characters, even though
302 ;; it works in the REPL(?). Just delete these for now.
303 (delete-file "non262/Intl/Date/toLocaleString_timeZone.js")
304 (delete-file "non262/Intl/Date/toLocaleDateString_timeZone.js")
306 ;; Similarly, these get an unexpected "A" suffix when looking
307 ;; up a time in the "ar-MA-u-ca-islamicc" locale, which is
308 ;; tricky to substitute.
309 (delete-file "non262/Intl/DateTimeFormat/format_timeZone.js")
310 (delete-file "non262/Intl/DateTimeFormat/format.js")
312 ;; This file compares a generated list of ICU locale names
313 ;; with actual lookups. Some have changed slightly, i.e.
314 ;; daf-Latn-ZZ -> daf-Latn-CI, so drop it for simplicity.
315 (delete-file "non262/Intl/Locale/likely-subtags-generated.js"))))
318 (with-directory-excursion "../js/src/tests"
319 (substitute* "shell/os.js"
320 ;; FIXME: Why does the killed process have an exit status?
321 ((".*killed process should not have exitStatus.*")
324 ;; XXX: Delete all tests that test time zone functionality,
325 ;; because the test suite uses /etc/localtime to figure out
326 ;; the offset from the hardware clock, which does not work
327 ;; in the build container. See <tests/non262/Date/shell.js>.
328 (delete-file-recursively "non262/Date")
329 (delete-file "non262/Intl/DateTimeFormat/tz-environment-variable.js")
331 (setenv "JSTESTS_EXTRA_ARGS"
334 ;; Do not run tests marked as "random".
336 ;; Exclude web platform tests.
338 ;; Respect the daemons configured number of jobs.
339 (string-append "--worker-count="
341 (parallel-job-count)))))))))))))
345 llvm ;for llvm-objdump
352 (list icu4c readline zlib))))
356 ;;; Localization helper procedures.
358 (define mozilla-compare-locales
362 (url "https://hg.mozilla.org/l10n/compare-locales/")
363 (changeset "RELEASE_8_1_0")))
364 (file-name "mozilla-compare-locales")
365 (sha256 (base32 "00bpkaqf2ng1nn9ajyb5mli0jq58q5fm2n3yy90jy0hp4q2gbs50"))))
367 (define (mozilla-locale locale changeset hash-string)
371 (url (string-append "https://hg.mozilla.org/l10n-central/"
373 (changeset changeset)))
374 (file-name (string-append "mozilla-locale-" locale))
375 (sha256 (base32 hash-string))))
377 (define-syntax-rule (mozilla-locales (hash-string changeset locale) ...)
378 (list (mozilla-locale locale changeset hash-string)
381 (define (update-mozilla-locales changesets.json)
382 "Output a new list of Mozilla locales, to update the ALL-MOZILLA-LOCALES
383 variable defined below. It requires guile-json to be installed."
384 (match (call-with-input-file changesets.json json->scm)
385 (((lang ("revision" . revision) platforms pin) ...)
386 (let ((data (reverse (map (lambda (rev lang)
387 `(,(list->string (make-list 40 #\0))
388 ,(string-take rev 12) ,lang))
390 (format #t "~{~s~%~}" data)
393 (define all-mozilla-locales
395 ;; sha256 changeset locale
396 ;;---------------------------------------------------------------------------
397 ("1s59ihmj8x6z0ssq4xav689jb5azrpdnay8csgjm1b9pw7wmvcli" "a6940ae1a02f" "ach")
398 ("1cqixlk9f8p63jz20wzsvnfb7xa82ba725gzdydlwz2axgp09c26" "4e2c7d1ddbed" "af")
399 ("19r1yhmfxqasyslc8gr9as5w1scscz1xr8iqy9zi4b90fdjzs0ac" "06897e40a7ea" "an")
400 ("0nfknb1p03j9fgmkwlm1mzdyh10g0l33x34ab39kc072apziyv0n" "9272819b09e2" "ar")
401 ("11qqblqfffbmkdr5b6mxzq02i8rj1hjq3iy6xv5i5xxy311b3vpb" "f706d22e6910" "ast")
402 ("0q2p1a437qr2nshdd4934qkv2sblmykiwzir149c8p9m5sjk0dyw" "f5c2a9800add" "az")
403 ("0gxxm3lv18kj0922bw0g897azc4nkrszm5irgwdkgmkbyr97li83" "98ba7d51484f" "be")
404 ("10vrbbaabjns824ndya6c09znm815pak2xpvqgjydl3r5qvacx65" "5c79c77311cd" "bg")
405 ("1il7yyifx5xzj0v2lna315mppl5pk1vi4m9r66hdz1lzc485m1wp" "c80c87ef7193" "bn")
406 ("1p1ig4v9pczzrnnxzr20r61g7xk85k5lgnxhzgn1rx518p85xrkm" "6a1bcb9851b2" "br")
407 ("08q33bk9kdvbyc4ib58bsn2b67ki3d2yzskkf5r2n5zlglblksa2" "939779cb58d6" "bs")
408 ("1bdkywrqah85fh8kfnz163qnc02ffx0a4vlnx5pq1wg9j4f1gznf" "9a45ccf144f1" "ca")
409 ("0hhmp5dzc0rssykl0b2n9h0vfy4svwhxmhpsr3rcfpbg2s0r5h6l" "4f60e18fc248" "ca-valencia")
410 ("18phbl9raqsbys9wa8z0gq0h0pw3b55v6ngn67r4373lfc0s9cxv" "b4ef404c7de8" "cak")
411 ("0147qyw1y97mgqhkb46wblxv61lq2mvvm5n5ihwf49l5cyizi0jg" "f56ef18f05df" "cs")
412 ("08sbhnsxndlsaijnxndc367qcbrzb29m7bpkcawinz9fg6mz3573" "4f9d92f04f5e" "cy")
413 ("09cm5kk1sh2a6ws1fj185jrknhfa6n4bhj7nfnr4lsk339n0kvv9" "902503567e30" "da")
414 ("0r630bki5d4ylicq6lzh6s2mvsq225933szswmm0sap507rj75cm" "6000baf7a412" "de")
415 ("0749qjsfv3rn94rnci3ydgndw27qlr3w3w97kfwma2gmsf3m3r0p" "4a948952d1f4" "dsb")
416 ("0yc64i7mpxhs4qlyyh59i2aiz0vpap0bn8slcsk8b71wd1d7cy5m" "153a16a13733" "el")
417 ("0d4m5ji6ii10yap8y24cxx3fr60ba1jqi10hy3j1cq6ni7hzavga" "7ce17ae529ac" "en-CA")
418 ("12jzqcfbgdhfm8f2gqp15bdnin62li07jwicjc8ynn4cl9a19xiz" "a25d9eea7c23" "en-GB")
419 ("0gbb8hfc5yvjah63mapjxm53wxrf98srbrbg43b9g734zfi4n8y5" "4ed3471dad5d" "eo")
420 ("19lw7zmqx2irjmv5y6r7nncp6nysn06abf10n3dzj5nzgays6sln" "853fe7acb415" "es-AR")
421 ("0rq4pa380b77rkv6dq7sqx8a8i33jk3vs5rgcl8fv7slqvsw23kd" "921b67bf27a5" "es-CL")
422 ("1dyxzab9hln5spch66wmfagfzmfdiaxgpq7qlzvdfg98wkqdj25n" "c9a210ea496c" "es-ES")
423 ("1gwpmfl37wxl7rynqswgj41liljflgxydvljd4zdhk3jzqn605fb" "ddd35183d81c" "es-MX")
424 ("0c3blniddklapifnjbz03f2frw24jjgwgwn6swl5mwm2z0y6wa9f" "82d23ffaa7d3" "et")
425 ("05mq2df6n6fr8m5m2xwl0f6n1q3zgjrnk465ldx1nfr9agrhd36c" "13975626d549" "eu")
426 ("1l1jyqqiy551903j6yzh9ayg1pf26q2hr9h3jj4l51xzp7x4ms2q" "039e1fdb7c71" "fa")
427 ("091l05y9sggxznv0y11b9zy5qf146p0hb5faw4ix7yn5p5kca2f5" "7bd3722d82de" "ff")
428 ("1lllwjvmbl5dx44fcvsqg08fbflkc8dx5as9n6nf4xlkzydx6izm" "39808e88c9d1" "fi")
429 ("10ha955vvyf5vbciricm72kplj9j0s00g2333lmg46jiwi7aviiv" "426d373db6a7" "fr")
430 ("11zdfk8jvdy1k9z1q162cwapplcbz35l3dq4mv45brdin3v0x8kr" "96cd93d18389" "fy-NL")
431 ("1l5xr25gmssyachwmfprlnp2v2xj4b0hp8gxrf7fi5bvv9c2fynb" "de3daf7d3f9d" "ga-IE")
432 ("06h9ijfsn1cgz5fvxxbisk7fvqhgsw99id92575hgyg1p8xb1n69" "f04aea656d9e" "gd")
433 ("19913i5n8yyfhz9j21krlk7wqsyy89vggxc1m1swv94y2ix8rpaj" "1b8cdb87bf69" "gl")
434 ("0k5x31bfl2l0r9b5dkn03frm1gd8n6igai7ch2f1kj0skflynwww" "82df570c4241" "gn")
435 ("03rygnj9xhfvykark7dls117kwhid13ghvrsqiial0vp8m7ymx79" "e2e41d7beaa5" "gu-IN")
436 ("0vyraplj1x7b5im15anhzdaq03k2gqfyybgklrd4f9ry6msh5jhx" "de724e943805" "he")
437 ("1zqps586jrgxpf7xx2l3qw3ch3fr31r9a25y861fpxrpvh7ygw7g" "898598e1a5c6" "hi-IN")
438 ("0czq68l3qdhdc0mgazlrh8x83a6d5qrjwgjv8xvsmmzi7h68ww0l" "2711d1515af0" "hr")
439 ("1wwvrnm38gk2rnw4vmcranh8hk61gjcj9292pck3ckiv6mq7kd4s" "03e02f3d0676" "hsb")
440 ("0yvgdxlbyhhg3lk43hxx9gx66rcm7gaj02zzzx5zni8dhvlk2v6m" "d423ada9dc00" "hu")
441 ("1kjm7bg4990jhfbxwc38r4lqm2fbcxc82nc2d4qkqwikr4aah4b9" "06836af0bd6e" "hy-AM")
442 ("1dla7r3snvagb7m985xxqyi7gl498cr5xsz8msw0zpg6xmi05rlx" "299bd950d538" "ia")
443 ("0w8w9xn93akir7nqcp5iwr3kqvba5gbirg7gmzlzg7mgrhw8pcsa" "dee087477b99" "id")
444 ("10iakv1c1d20ihxg1s7c3zc1zfw18vr2kspcw7bk5k02rmrffgcn" "320095d063ed" "is")
445 ("1xn5pa3rc7l6k2migm3c0dx71q1hk7mjls045xpv9cy8gvirnj94" "4722680fb5bf" "it")
446 ("0va9zfj3wqh1yvbgh3x808yvdyxkg780vazjg887wbxpfk1n6hxa" "cb3cfe294621" "ja")
447 ("0qvjc3fhk6jg2c3g6mymmnslg1rkkxmv9gi3whf2bc5mzfgyc5zw" "7efe92bd7780" "ja-JP-mac")
448 ("0zfiwwz0axbd219ar32c7a6b8h816sf04ajx6jl74s5kyij79y82" "4c1fe3a18da9" "ka")
449 ("1aiik4758r5df76q2a132y5fjdjrsxshjylk7irwsr7yy0c7f63g" "acdf76048aa0" "kab")
450 ("0icxh4sgv6m1yykycb9d9c43k3r6w02f9c6jr04wm8hvqq5icfl5" "9b418ff7936b" "kk")
451 ("1cqlhggf46lr7w399k7qb7a1hc56f32w1dy26i2racpppzza5plc" "9771ada0b5f8" "km")
452 ("0p04irnb7x7y37m6lz388x9dynn8rnk000avpp296barajnhs5i8" "645aa37a2112" "kn")
453 ("1lbc1fxr5i0ccymlsd8axz3633cqggg5k8ak5yqwi704g7kvv9g2" "1cd68952d119" "ko")
454 ("11b55bxg73zqfdn5gy9nn5imab2mv0hxr603whggp7vymllgb7kb" "26bb83959bfe" "lij")
455 ("15jsijm6d26i0105gz0f7sh2yh2v4pmw4j95cwkdrb1d8m935jlz" "b9829891f153" "lt")
456 ("0liwwv13fgyw97nizhsyy53xrbf8jks5ics7qkkxfccawjrg5rlb" "e5f09d03d959" "lv")
457 ("0w420yf3hdnl7dp9mn9ghc20cq79k24fn9adn3syk723ppl6mkb0" "7884845e94f3" "mk")
458 ("13wkr7rgqsv9w3d9w7k8lnxdzgfixsq4bmc27zsyc770l6062ml6" "030db7412202" "mr")
459 ("06nsadcnxx0ssdp67x47dj9crihn1ycgd5mwvn5m7lkb97r4ch9f" "40a7703e875c" "ms")
460 ("0mlnjdzck6dp9p59ajj3sr63r36fn0qi8r9scrqrqcisgfclw9sg" "daca40056531" "my")
461 ("0z1hgx9d5i9w20f9k9azzng1y3lmm5d6hdjkj7rf6r5710bhhzh5" "664bd049e105" "nb-NO")
462 ("1466qvrs13g2iix1k35cknb2pia9b66li2ncvdyqf0jsd92z9k8x" "eaa6ae781ba0" "ne-NP")
463 ("0jgmz2lkzj0aspd9mabygzic6li5s2b25y0r6vjg8mv3jm5pi86j" "5ef8f1c9739e" "nl")
464 ("1m46x0h20vdfbzjxlz0ac43dbaq40xnyldr2yzbf7pk5di9pzxa6" "f08e15466d5d" "nn-NO")
465 ("0r3zvihqh6iya3z1qm7if0m3zfgf81s9qp7x7qc701h2q357wkgf" "6712c0e12ec2" "oc")
466 ("102j89jm28c223yhhkrj76xxj4kmy58hcs2r0jn15xa1qkqv1fdk" "8f36cc819e00" "pa-IN")
467 ("1j9za6s0i46abn8dsrlkpck3qxxw35rhfcg1xs1vp8sc4ckg8qwi" "c3b0c1c02b94" "pl")
468 ("1k9lbsvckpwl4xax8kxp5yxsfkspq2mhqm77jh5nl9aw88dsn55b" "cc32bf9630fe" "pt-BR")
469 ("0f0jyvbn2sa5m66wqdzh4607g4gd0270xq37ipd9ls52b4764bd8" "5478d7242086" "pt-PT")
470 ("19znkkialh1d4np7qcp80xkagrf1j2xah2s1xxzsh854p3d30zs7" "dd934a76fb01" "rm")
471 ("1xn26r8g8zzkb5myfgmnjbk8k4i0brkvbrvnhp7k5nkrnsin25di" "d57ab3dee73d" "ro")
472 ("04rhkxlmpp5pyzw85ldbfkmiigqr2p9y5cbns5dqs6sz1633ccxp" "7aea98f33a20" "ru")
473 ("1zzkkxl7ayxh5gx9snyvp5czflsvi77hp48li613h3c2fii4n9qk" "7c986f4b5044" "sco")
474 ("1219i0ghhqj3s1i0rm68jjkvivh6y40938wav7z4ifck527sq6r1" "bc9e55d4e3ea" "si")
475 ("05i5p3n3a6hgl6rf10yjs4vag7y3rn2jwgxsddcdcqiv6405zn81" "8814afd7f67e" "sk")
476 ("1wcqdbm1py1ldq6cj2g201m715nql79r6szr71jvrxacb711c62a" "20013dc06e96" "sl")
477 ("0g2izkaa4ipwgwyhy77ciyrxxpf4pxzj9mjqvxriy5prmkhm3zjs" "d86d5d2b6eef" "son")
478 ("1cc99m6srjg8698dkc3il70crby0mdv43v3ijwy069k4w50hyjjg" "49bb5fae5d9b" "sq")
479 ("13kfssq4fhq9mb36as6sxiaffl17qyg1wdw8kpz3ilqm86bsjrgl" "d6a0ab79b06f" "sr")
480 ("1wx9snbm0431q97i0q0nv4wbsqcv9nhllwfr88crlp7bfj5w8czw" "4bab04993da3" "sv-SE")
481 ("0laglkfl8ml0ip5vmm3z2q790hgwax9gfqwq3wm68a2nnsyck8fw" "4b3316c4aa48" "szl")
482 ("15pnlic4q7m48y0mc5yh8w5yscjwzx0mmfrbj3f2b9jxxa44nx4h" "48c7aab86db8" "ta")
483 ("16qar5y0wns75ryi8bfv7yln3mjsyn7qi4345zcniz3ydgkczh46" "7bbb3dac8f47" "te")
484 ("112g7x8h0qz16r5faam386x4a0rgwd4zy02d5agmg9m0kbficdfx" "009fd0852454" "th")
485 ("1l80kh9byqxnz5vkz357rb39g4y9sgn9pr0v29ywp6d009img1qg" "dad9caecd7a9" "tl")
486 ("1nalvjlxxsa9wldhhdb93bgfc7dl084xayh7i7mgg93yjgrym93x" "0c48082d37cd" "tr")
487 ("0wkxqcfgsra2ljws28kiwajv73w9aa8drsc4fqlg9krbicnjl2n8" "f6d105faedcc" "trs")
488 ("18jf4ysrfv3635fyxc1vwr970dr2r05bl3h8v599pwp2g7jzyjpm" "e1011388a55e" "uk")
489 ("1ihmksjsz54yii23qda5iv8cxrj9144afy75hzhvfi6m182kj4h8" "c4e927eab511" "ur")
490 ("0d42dhfa2vcw24wsvwf95pw20np0pz8c0is6p4307n981n8s207y" "7063df917cb3" "uz")
491 ("04khnkrg8css55hyna01jqay9c2ppxk5znbx2zj9i25knhvvx1lq" "1753054e6ab8" "vi")
492 ("0fi5kxn78xp7s15svkqlf4748j4pzxh941nm52n6kbbrhyi3qcqn" "93bc595dc32e" "xh")
493 ("0jg676vd37wqgzjnm0yynj7xrvm6fsgdwg296h78wnyc33zc4ads" "edd4e468bc31" "zh-CN")
494 ("1y4wldm3z95mfjlficp994jyqg0lj07wi35b79dy1s8ljy3jilil" "0bad1f7d2b2d" "zh-TW")))
496 ;; XXXX: Workaround 'snippet' limitations.
497 (define computed-origin-method (@@ (guix packages) computed-origin-method))
499 (define %icecat-base-version "102.8.0")
500 (define %icecat-version (string-append %icecat-base-version "-guix0-preview1"))
501 (define %icecat-build-id "20230214000000") ;must be of the form YYYYMMDDhhmmss
503 ;; 'icecat-source' is a "computed" origin that generates an IceCat tarball
504 ;; from the corresponding upstream Firefox ESR tarball, using the 'makeicecat'
505 ;; script from the upstream IceCat project.
506 (define icecat-source
507 (let* ((major-version (first (string-split %icecat-base-version #\.)))
508 (minor-version (second (string-split %icecat-base-version #\.)))
509 (sub-version (third (string-split %icecat-base-version #\.)))
511 (upstream-firefox-version (string-append %icecat-base-version "esr"))
512 (upstream-firefox-source
516 "https://ftp.mozilla.org/pub/firefox/releases/"
517 upstream-firefox-version "/source/"
518 "firefox-" upstream-firefox-version ".source.tar.xz"))
521 "0j6afrgfsmd0adbbmffw4p1f2hznpck9d36z3bsjx36f7cjgdy27"))))
523 ;; The upstream-icecat-base-version may be older than the
524 ;; %icecat-base-version.
525 (upstream-icecat-base-version "102.8.0")
526 (gnuzilla-commit "f23f8b609ef4afcc7d8ac5fa795093f1c403f8da")
531 (url "git://git.savannah.gnu.org/gnuzilla.git")
532 (commit gnuzilla-commit)))
533 (file-name (git-file-name "gnuzilla"
534 ;;upstream-icecat-base-version
535 (string-take gnuzilla-commit 8)))
538 "1zvvgjvsj7k8753f7xmpmkq35dqzyik95943hzl84v2j5mnahhj4"))))
540 ;; 'search-patch' returns either a valid file name or #f, so wrap it
541 ;; in 'assume-valid-file-name' to avoid 'local-file' warnings.
543 (local-file (assume-valid-file-name
544 (search-patch "icecat-makeicecat.patch")))))
547 (method computed-origin-method)
548 (file-name (string-append "icecat-" %icecat-version ".tar.xz"))
552 (with-imported-modules '((guix build utils))
554 (use-modules (guix build utils))
556 (string-append "firefox-" #$%icecat-base-version))
558 (string-append "icecat-" #$%icecat-version)))
560 (set-path-environment-variable
563 #+(canonical-package bash)
564 #+(canonical-package coreutils)
565 #+(canonical-package findutils)
566 #+(canonical-package patch)
567 #+(canonical-package xz)
568 #+(canonical-package sed)
569 #+(canonical-package grep)
570 #+(canonical-package bzip2)
571 #+(canonical-package gzip)
572 #+(canonical-package tar)))
574 (set-path-environment-variable
576 (list #+(format #f "lib/python~a/site-packages"
578 (package-version python))))
579 '#+(cons python-jsonschema
581 (package-transitive-propagated-inputs
582 python-jsonschema))))
584 ;; Needed by the 'makeicecat' script.
585 (setenv "RENAME_CMD" "rename")
587 ;; We copy the gnuzilla source directory because it is
588 ;; read-only in 'gnuzilla-source', and the makeicecat script
589 ;; uses "cp -a" to copy parts of it and assumes that the
590 ;; copies will be writable.
591 (copy-recursively #+gnuzilla-source "/tmp/gnuzilla"
592 #:log (%make-void-port "w"))
594 (with-directory-excursion "/tmp/gnuzilla"
595 (make-file-writable "makeicecat")
596 (invoke "patch" "--force" "--no-backup-if-mismatch"
597 "-p1" "--input" #+makeicecat-patch)
598 (patch-shebang "makeicecat")
599 (substitute* "makeicecat"
600 (("^readonly FFMAJOR=(.*)" all ffmajor)
601 (unless (string=? #$major-version
602 (string-trim-both ffmajor))
603 ;; The makeicecat script cannot be expected to work
604 ;; properly on a different version of Firefox, even if
605 ;; no errors occur during execution.
606 (error "makeicecat major version mismatch"))
607 (string-append "readonly FFMAJOR=" #$major-version "\n"))
608 (("^readonly FFMINOR=.*")
609 (string-append "readonly FFMINOR=" #$minor-version "\n"))
610 (("^readonly FFSUB=.*")
611 (string-append "readonly FFSUB=" #$sub-version "\n"))
612 (("^readonly DATADIR=.*")
613 "readonly DATADIR=/tmp/gnuzilla/data\n")
614 (("^readonly SOURCEDIR=.*")
615 (string-append "readonly SOURCEDIR=" icecat-dir "\n"))
617 #+(file-append (canonical-package sed) "/bin/sed"))))
619 (format #t "Unpacking upstream firefox tarball...~%")
621 (invoke "tar" "xf" #+upstream-firefox-source)
622 (rename-file firefox-dir icecat-dir)
624 (with-directory-excursion icecat-dir
625 (format #t "Populating l10n directory...~%")
628 (with-directory-excursion "l10n"
632 (string-drop (basename locale-dir)
633 (+ 32 ; length of hash
634 (string-length "-mozilla-locale-")))))
635 (format #t " ~a~%" locale)
637 (copy-recursively locale-dir locale
638 #:log (%make-void-port "w"))
639 (for-each make-file-writable (find-files locale))
640 (with-directory-excursion locale
641 (when (file-exists? ".hgtags")
642 (delete-file ".hgtags"))
643 (mkdir-p "browser/chrome/browser/preferences")
644 (call-with-output-file
645 "browser/chrome/browser/preferences/advanced-scripts.dtd"
646 (lambda (port) #f)))))
647 '#+all-mozilla-locales)
648 (copy-recursively #+mozilla-compare-locales
650 #:log (%make-void-port "w"))
651 (delete-file "compare-locales/.gitignore")
652 (delete-file "compare-locales/.hgignore")
653 (delete-file "compare-locales/.hgtags")))
655 (format #t "Running makeicecat script...~%")
657 (invoke "bash" "/tmp/gnuzilla/makeicecat")
659 (format #t "Packing IceCat source tarball...~%")
661 (setenv "XZ_DEFAULTS" (string-join (%xz-parallel-args)))
662 (invoke "tar" "cfa" #$output
663 ;; Avoid non-determinism in the archive. We set the
664 ;; mtime of files in the archive to early 1980 because
665 ;; the build process fails if the mtime of source
666 ;; files is pre-1980, due to the creation of zip
668 "--mtime=@315619200" ; 1980-01-02 UTC
674 (define-public icecat-minimal
676 (name "icecat-minimal")
677 (version %icecat-version)
678 (source icecat-source)
679 (build-system gnu-build-system)
688 ;; UNBUNDLE-ME! graphite2
693 ;; UNBUNDLE-ME! harfbuzz
698 ;; UNBUNDLE-ME! libogg
699 ;; UNBUNDLE-ME! libtheora ; wants theora-1.2, not yet released
700 ;; UNBUNDLE-ME! libvorbis
710 icu4c-71 ; TODO: Change to 'icu4c' when its version is >= 71.
718 ;; See <https://bugs.gnu.org/32833>
719 ;; and related comments in the 'remove-bundled-libraries' phase.
729 ;; The following patches are specific to the Guix packaging of IceCat,
730 ;; and therefore we prefer to leave them out of 'source', which should be
731 ;; a tarball suitable for compilation on any system that IceCat supports.
732 ;; (Bug fixes and security fixes, however, should go in 'source').
734 ;; XXX TODO: Adapt these patches to IceCat 102.
735 ;; ("icecat-avoid-bundled-libraries.patch"
736 ;; ,(search-patch "icecat-avoid-bundled-libraries.patch"))
737 ;; ("icecat-use-system-graphite2+harfbuzz.patch"
738 ;; ,(search-patch "icecat-use-system-graphite2+harfbuzz.patch"))
739 ;; ("icecat-use-system-media-libs.patch"
740 ;; ,(search-patch "icecat-use-system-media-libs.patch"))
750 nasm ; XXX FIXME: only needed on x86_64 and i686
756 #:tests? #f ;not worth the cost
758 ;; Some dynamic lib was determined at runtime, so rpath check may fail.
759 #:validate-runpath? #f
763 "--enable-application=browser"
764 "--with-distribution-id=org.gnu"
765 "--enable-geckodriver"
766 ;; Do not require addons in the global app or system directories to
767 ;; be signed by Mozilla.
768 "--with-unsigned-addon-scopes=app,system"
769 "--allow-addon-sideload"
771 "--enable-pulseaudio"
775 "--disable-crashreporter"
778 ;; Building with debugging symbols takes ~5GiB, so disable it.
780 "--disable-debug-symbols"
788 ;; Clang is needed to build Stylo, Mozilla's new CSS engine. We must
789 ;; specify the clang paths manually, because otherwise the Mozilla
790 ;; build system looks in the directories returned by llvm-config
791 ;; --bindir and llvm-config --libdir, which return paths in the llvm
792 ;; package where clang is not found.
793 (string-append "--with-clang-path="
794 (search-input-file %build-inputs "bin/clang"))
795 (string-append "--with-libclang-path="
796 (dirname (search-input-file %build-inputs
799 ;; Hack to work around missing "unofficial" branding in icecat.
800 "--enable-official-branding"
802 ;; TODO: Add support for wasm sandboxed libraries.
803 "--without-wasm-sandboxed-libraries"
805 ;; Avoid bundled libraries.
806 "--with-system-jpeg" ;must be libjpeg-turbo
807 "--with-system-png" ;must be libpng-apng
809 ;; UNBUNDLE-ME! "--with-system-bz2"
810 ;; UNBUNDLE-ME! "--with-system-libevent"
811 ;; UNBUNDLE-ME! "--with-system-ogg"
812 ;; UNBUNDLE-ME! "--with-system-vorbis"
813 ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released
814 ;; UNBUNDLE-ME! "--with-system-libvpx"
817 ;; See <https://bugs.gnu.org/32833>
818 ;; and related comments in the
819 ;; 'remove-bundled-libraries' phase below.
820 ;; UNBUNDLE-ME! "--with-system-nspr"
821 ;; UNBUNDLE-ME! "--with-system-nss"
823 ;; UNBUNDLE-ME! "--with-system-harfbuzz"
824 ;; UNBUNDLE-ME! "--with-system-graphite2"
825 "--enable-system-pixman"
826 "--enable-system-ffi"
827 ;; UNBUNDLE-ME! "--enable-system-sqlite"
830 #:imported-modules %cargo-utils-modules ;for `generate-all-checksums'
832 #:modules `((ice-9 ftw)
840 ,@%gnu-build-system-modules)
842 #~(modify-phases %standard-phases
843 (add-after 'unpack 'apply-guix-specific-patches
844 (lambda* (#:key inputs native-inputs #:allow-other-keys)
845 (let ((patch (search-input-file inputs "bin/patch")))
846 (for-each (match-lambda
848 (when (and (string-prefix? "icecat-" label)
849 (string-suffix? ".patch" label))
850 (format #t "applying '~a'...~%" file)
851 (invoke patch "--force" "--no-backup-if-mismatch"
852 "-p1" "--input" file))))
853 (or native-inputs inputs)))))
854 (add-after 'apply-guix-specific-patches 'remove-bundled-libraries
856 ;; Remove bundled libraries that we don't use, since they may
857 ;; contain unpatched security flaws, they waste disk space and
858 ;; memory, and may cause confusion.
859 (for-each (lambda (file)
860 (format #t "deleting '~a'...~%" file)
861 (delete-file-recursively file))
862 '( ;; FIXME: Removing the bundled icu breaks configure.
863 ;; * The bundled icu headers are used in some places.
864 ;; * The version number is taken from the bundled copy.
867 ;; FIXME: A script from the bundled nspr is used.
870 ;; FIXME: With the update to IceCat 60, using system NSS
871 ;; broke certificate validation. See
872 ;; <https://bugs.gnu.org/32833>. For now, we use
873 ;; the bundled NSPR and NSS. TODO: Investigate,
874 ;; and try to unbundle these libraries again.
875 ;; UNBUNDLE-ME! "security/nss"
877 ;; TODO: Use more system media libraries. See:
878 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
879 ;; * libtheora: esr60 wants v1.2, not yet released.
880 ;; * soundtouch: avoiding the bundled library would
881 ;; result in some loss of functionality. There's
882 ;; also an issue with exception handling
883 ;; configuration. It seems that this is needed in
885 ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1
890 ;; "media/libjpeg" ; needed for now, because media/libjpeg/moz.build is referenced from config/external/moz.build
891 ;; UNBUNDLE-ME! "modules/zlib"
892 ;; UNBUNDLE-ME! "ipc/chromium/src/third_party/libevent"
893 ;; UNBUNDLE-ME! "media/libvpx"
894 ;; UNBUNDLE-ME! "media/libogg"
895 ;; UNBUNDLE-ME! "media/libvorbis"
896 ;; UNBUNDLE-ME! "media/libtheora" ; wants theora-1.2, not yet released
897 ;; UNBUNDLE-ME! "media/libtremor"
898 ;; UNBUNDLE-ME! "gfx/harfbuzz"
899 ;; UNBUNDLE-ME! "gfx/graphite2"
900 "js/src/ctypes/libffi"
901 ;; UNBUNDLE-ME! "db/sqlite3"
903 (add-after 'remove-bundled-libraries 'fix-ffmpeg-runtime-linker
904 (lambda* (#:key inputs #:allow-other-keys)
905 ;; Arrange to load libavcodec.so by its absolute file name.
906 (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
908 (search-input-file inputs "lib/libavcodec.so")))))
909 (add-after 'fix-ffmpeg-runtime-linker 'build-sandbox-whitelist
910 (lambda* (#:key inputs #:allow-other-keys)
911 (define (runpath-of lib)
912 (call-with-input-file lib
913 (compose elf-dynamic-info-runpath
916 get-bytevector-all)))
917 (define (runpaths-of-input label)
918 (let* ((dir (string-append (assoc-ref inputs label) "/lib"))
919 (libs (find-files dir "\\.so$")))
920 (append-map runpath-of libs)))
921 ;; Populate the sandbox read-path whitelist as needed by ffmpeg.
923 (map (cut string-append <> "/")
925 `(,(string-append (assoc-ref inputs "shared-mime-info")
927 ,(string-append (assoc-ref inputs "font-dejavu")
929 "/run/current-system/profile/share/fonts"
930 ,@(append-map runpaths-of-input
931 '("mesa" "ffmpeg"))))))
932 (whitelist-string (string-join whitelist ","))
933 (port (open-file "browser/app/profile/icecat.js" "a")))
934 (format #t "setting 'security.sandbox.content.read_path_whitelist' to '~a'~%"
936 (format port "~%pref(\"security.sandbox.content.read_path_whitelist\", ~S);~%"
938 (close-output-port port))))
939 (add-after 'patch-source-shebangs 'patch-cargo-checksums
941 (use-modules (guix build cargo-utils))
942 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
943 (for-each (lambda (file)
944 (format #t "patching checksums in ~a~%" file)
946 (("^checksum = \".*\"")
947 (string-append "checksum = \"" null-hash "\""))))
948 (find-files "." "Cargo.lock$"))
949 (for-each generate-all-checksums
961 "mozglue/static/rust"
966 "security/manager/ssl"
968 (add-after 'patch-cargo-checksums 'remove-cargo-frozen-flag
970 ;; Remove --frozen flag from cargo invokation, otherwise it'll
971 ;; complain that it's not able to change Cargo.lock.
972 ;; https://bugzilla.mozilla.org/show_bug.cgi?id=1726373
973 (substitute* "build/RunCbindgen.py"
974 (("\"--frozen\",") ""))))
977 ;; configure does not work followed by both "SHELL=..." and
978 ;; "CONFIG_SHELL=..."; set environment variables instead
979 (lambda* (#:key outputs configure-flags #:allow-other-keys)
980 (let* ((bash (which "bash"))
981 (abs-srcdir (getcwd))
982 (flags `(,(string-append "--prefix=" #$output)
983 ,(string-append "--with-l10n-base="
986 (setenv "SHELL" bash)
987 (setenv "CONFIG_SHELL" bash)
989 (setenv "AR" "llvm-ar")
990 (setenv "NM" "llvm-nm")
991 (setenv "CC" "clang")
992 (setenv "CXX" "clang++")
993 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
994 #$output "/lib/icecat"))
996 (setenv "MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE" "system")
997 (setenv "MOZ_BUILD_DATE" #$%icecat-build-id) ; avoid timestamp
999 ;; XXX TODO: Fix this to work on systems other than x86_64-linux.
1000 (setenv "GUIX_PYTHONPATH"
1001 (string-append (getcwd)
1002 "/obj-x86_64-pc-linux-gnu/_virtualenvs/build"))
1005 (setenv "MOZBUILD_STATE_PATH"
1006 (string-append (getcwd) "/.mozbuild"))
1008 (format #t "build directory: ~s~%" (getcwd))
1009 (format #t "configure flags: ~s~%" flags)
1011 (call-with-output-file "mozconfig"
1013 (for-each (lambda (flag)
1014 (format port "ac_add_options ~a\n" flag))
1017 (invoke "./mach" "configure"))))
1019 (lambda* (#:key (make-flags '()) (parallel-build? #t)
1021 (apply invoke "./mach" "build"
1022 ;; mach will use parallel build if possible by default
1023 `(,@(if parallel-build?
1027 (add-after 'build 'neutralise-store-references
1029 ;; Mangle the store references to compilers & other build tools in
1030 ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64.
1031 (let* ((obj-dir (match (scandir "." (cut string-prefix? "obj-" <>))
1033 (file (string-append
1035 "/dist/bin/chrome/toolkit/content/global/buildconfig.html")))
1037 (("[0-9a-df-np-sv-z]{32}" hash)
1038 (string-append (string-take hash 8)
1039 "<!-- Guix: not a runtime dependency -->"
1040 (string-drop hash 8)))))))
1042 (lambda* (#:key outputs #:allow-other-keys)
1043 (invoke "./mach" "install")
1044 ;; The geckodriver binary is not installed by the above, for some
1045 ;; reason. Use 'find-files' to avoid having to deal with the
1046 ;; system/architecture-specific file name.
1047 (install-file (first (find-files "." "geckodriver"))
1048 (string-append #$output "/bin"))))
1049 (add-after 'install 'wrap-program
1050 (lambda* (#:key inputs #:allow-other-keys)
1051 (let* ((lib (string-append #$output "/lib"))
1052 (gtk #$(this-package-input "gtk+"))
1053 (gtk-share (string-append gtk "/share"))
1054 (ld-libs '#$(map (lambda (label)
1055 (file-append (this-package-input label) "/lib"))
1063 ;; For the integration of native notifications
1065 (wrap-program (car (find-files lib "^icecat$"))
1066 `("XDG_DATA_DIRS" prefix (,gtk-share))
1067 ;; The following line is commented out because the icecat
1068 ;; package on guix has been observed to be unstable when
1069 ;; using wayland, and the bundled extensions stop working.
1070 ;; `("MOZ_ENABLE_WAYLAND" = ("1"))
1071 `("LD_LIBRARY_PATH" prefix ,ld-libs)))))
1072 (add-after 'wrap-program 'install-desktop-entry
1074 ;; Install the '.desktop' file.
1075 (let* ((desktop-file "taskcluster/docker/icecat-snap/icecat.desktop")
1076 (applications (string-append #$output "/share/applications")))
1077 (substitute* desktop-file
1078 (("^Exec=icecat") (string-append "Exec=" #$output "/bin/icecat"))
1079 (("IceCat") "GNU IceCat")
1080 (("Icon=.*") "Icon=icecat\n")
1081 (("NewWindow") "new-window")
1082 (("NewPrivateWindow") "new-private-window")
1083 (("StartupNotify=true")
1084 "StartupNotify=true\nStartupWMClass=Navigator"))
1085 (install-file desktop-file applications))))
1086 (add-after 'install-desktop-entry 'install-icons
1088 (with-directory-excursion "browser/branding/official"
1091 (let* ((size (string-filter char-numeric? file))
1092 (icons (string-append #$output "/share/icons/hicolor/"
1093 size "x" size "/apps")))
1095 (copy-file file (string-append icons "/icecat.png"))))
1096 '("default16.png" "default22.png" "default24.png"
1097 "default32.png" "default48.png" "content/icon64.png"
1098 "mozicon128.png" "default256.png"))))))))
1099 (home-page "https://www.gnu.org/software/gnuzilla/")
1100 (synopsis "Entirely free browser derived from Mozilla Firefox")
1102 "IceCat is the GNU version of the Firefox browser. It is entirely free
1103 software, which does not recommend non-free plugins and addons. It also
1104 features built-in privacy-protecting features. This package also includes the
1105 @command{geckodriver} command, which can be useful for automated web
1108 WARNING: IceCat 102 has not yet been released by the upstream IceCat project.
1109 This is a preview release, and does not currently meet the privacy-respecting
1110 standards of the IceCat project.")
1111 (license license:mpl2.0) ;and others, see toolkit/content/license.html
1113 `((ftp-directory . "/gnu/gnuzilla")
1114 (cpe-name . "firefox_esr")
1115 (cpe-version . ,(first (string-split version #\-)))))))
1117 (define %icecat-locales
1118 '("ach" "af" "an" "ar" "ast" "az" "be" "bg" "bn" "br" "bs" "ca" "cak"
1119 "ca-valencia" "cs" "cy" "da" "de" "dsb" "el" "en-CA" "en-GB" "eo" "es-AR"
1120 "es-CL" "es-ES" "es-MX" "et" "eu" "fa" "ff" "fi" "fr" "fy-NL" "ga-IE" "gd"
1121 "gl" "gn" "gu-IN" "he" "hi-IN" "hr" "hsb" "hu" "hy-AM" "ia" "id" "is" "it"
1122 "ja" "ja-JP-mac" "ka" "kab" "kk" "km" "kn" "ko" "lij" "lt" "lv" "mk" "mr" "ms"
1123 "my" "nb-NO" "ne-NP" "nl" "nn-NO" "oc" "pa-IN" "pl" "pt-BR" "pt-PT" "rm" "ro"
1124 "ru" "sco" "si" "sk" "sl" "son" "sq" "sr" "sv-SE" "szl" "ta" "te" "th" "tl"
1125 "tr" "trs" "uk" "ur" "uz" "vi" "xh" "zh-CN" "zh-TW"))
1127 (define %icedove-build-id "20230207000000") ;must be of the form YYYYMMDDhhmmss
1128 (define %icedove-version "102.7.2")
1130 ;; Provides the "comm" folder which is inserted into the icecat source.
1131 ;; Avoids the duplication of Icecat's source tarball.
1132 (define thunderbird-comm-source
1136 (url "https://hg.mozilla.org/releases/comm-esr102")
1137 (changeset "0f6deed0752b618055c34e06c268af3da9d1548d")))
1138 (file-name (string-append "thunderbird-" %icedove-version "-checkout"))
1141 "071q0pcfvfpzx741ly1sl8anlmzx02h17w4ylfnrkwrpaclq3p6p"))))
1143 (define (comm-source->locales+changeset source)
1144 "Given SOURCE, a checkout of the Thunderbird 'comm' component, return the
1145 list of languages supported as well as the currently used changeset."
1146 (match (update-mozilla-locales
1147 (string-append source "/mail/locales/l10n-changesets.json"))
1148 (((_ changeset locale) ...)
1149 (values locale (first changeset)))))
1151 ;;; Generated with comm-source->locales+changeset.
1152 (define %icedove-locales
1153 '("af" "ar" "ast" "be" "bg" "br" "ca" "cak" "cs" "cy" "da" "de" "dsb" "el"
1154 "en-CA" "en-GB" "es-AR" "es-ES" "es-MX" "et" "eu" "fi" "fr" "fy-NL" "ga-IE"
1155 "gd" "gl" "he" "hr" "hsb" "hu" "hy-AM" "id" "is" "it" "ja" "ja-JP-mac" "ka"
1156 "kab" "kk" "ko" "lt" "lv" "ms" "nb-NO" "nl" "nn-NO" "pa-IN" "pl" "pt-BR"
1157 "pt-PT" "rm" "ro" "ru" "sk" "sl" "sq" "sr" "sv-SE" "th" "tr" "uk" "uz" "vi"
1160 ;;; To find out which changeset to use for the comm-l10n repo, use the
1161 ;;; 'comm-source->locales+changeset' procedure on the thunderbird-comm-source
1162 ;;; checkout directory. The complete localization data should be released as
1163 ;;; a tarball in the next release (see:
1164 ;;; https://bugzilla.mozilla.org/show_bug.cgi?id=1817086). When this tarball
1165 ;;; is available, it should replace the complete 'l10n' directory at the root
1166 ;;; of the IceCat source, instead of only the 'calendar', chat and mail
1167 ;;; directories that it provides.
1168 (define thunderbird-comm-l10n
1169 (let* ((changeset "5b6788295358")
1170 (version (git-version %icedove-version "0" changeset)))
1174 (url "https://hg.mozilla.org/projects/comm-l10n")
1175 (changeset changeset)))
1176 (file-name (git-file-name "comm-l10n" version))
1179 "1jrsmkscjjllcfawi3788vwm53wn25inbhdis5nk4vfpr7wk5ill")))))
1181 (define icedove-source
1182 (let ((name (string-append "icedove-" %icedove-version)))
1184 (method computed-origin-method)
1185 (file-name (string-append name ".tar.xz"))
1189 (with-imported-modules (source-module-closure '((guix build utils)))
1191 (use-modules (guix build utils)
1194 (set-path-environment-variable
1196 (list #+(canonical-package tar)
1197 #+(canonical-package xz)))
1199 ;; Extract the base Icecat tarball, renaming its top-level
1201 (invoke "tar" "--transform" (string-append "s,[^/]*," #$name ",")
1202 "-xf" #$icecat-source)
1205 ;; Merge the Thunderdbird localization data.
1206 (copy-recursively #$thunderbird-comm-l10n "l10n")
1208 ;; Add the Thunderbird-specific "comm" directory..
1210 (copy-recursively #$thunderbird-comm-source "comm")
1211 (delete-file "sourcestamp.txt")
1213 ;; Adjust the application name.
1214 (substitute* "comm/mail/confvars.sh"
1215 (("MOZ_APP_NAME=thunderbird")
1216 "MOZ_APP_NAME=icedove")
1220 ;; Remove branding to comply with Mozilla's trademark policy
1221 (with-directory-excursion "comm/mail/branding/nightly"
1222 (delete-file "content/about-wordmark.svg")
1223 (call-with-output-file "content/about-wordmark.svg"
1225 (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg")
1226 (viewBox "0 0 789.1 90.78")
1230 (text (@ (x "400") (y "70")
1231 (text-anchor "middle")
1235 (substitute* '("locales/en-US/brand.properties"
1236 "locales/en-US/brand.ftl"
1237 "locales/en-US/brand.dtd"
1239 (("Thunderbird") "Icedove")
1240 (("mozilla.org") "guix.gnu.org")))
1241 ;; Remove other mentions of Thunderbird in user-visible text.
1242 (with-directory-excursion "comm/mail/base/content"
1243 (substitute* '("overrides/app-license-name.html")
1244 (("Thunderbird") "Icedove")))
1245 (with-directory-excursion "comm/mail/components/"
1246 (substitute* '("MailGlue.jsm"
1247 "extensions/schemas/addressBook.json"
1248 "extensions/schemas/tabs.json"
1249 "extensions/schemas/cloudFile.json"
1250 "extensions/schemas/chrome_settings_overrides.json"
1251 "extensions/schemas/windows.json"
1252 "extensions/parent/ext-mail.js"
1253 "im/messages/mail/Info.plist"
1254 "enterprisepolicies/moz.build"
1255 "enterprisepolicies/helpers/moz.build"
1256 "enterprisepolicies/schemas/moz.build")
1257 (("Thunderbird") "Icedove")))
1258 (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js"
1259 "comm/mail/base/content/customizeToolbar.js"
1260 "comm/suite/components/customizeToolbar.js")
1261 (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e)
1262 (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e)))
1264 ;; Override addon URLs and settings
1265 (substitute* "comm/mail/app/profile/all-thunderbird.js"
1266 (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m)
1267 (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");"))
1268 (("(pref\\(\"extensions.getAddons.search.url\").*" _ m)
1269 (string-append m ", \"https://guix.gnu.org/packages\");"))
1270 (("(pref\\(\"extensions.update.enabled\").*" _ m)
1271 (string-append m ", false);"))
1272 (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m)
1273 (string-append m ", false);"))
1274 (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m)
1275 (string-append m ", false);"))
1277 ;; XXX: The autoDisableScopes is tweaked by the makeicecat
1278 ;; script, but it doesn't know about Thunderbird. This is
1279 ;; necessary to allow picking up the extensions found in the
1280 ;; system global application directory, such as the language
1282 (("\"extensions.autoDisableScopes\", 15")
1283 "\"extensions.autoDisableScopes\", 3")
1285 ;; Set the default locale to that of the operating system.
1286 ((".*extensions.autoDisableScopes.*" anchor)
1287 (string-append anchor
1288 "pref(\"intl.locale.requested\", \"\");\n")))
1290 ;; Step out of the directory and create the tarball.
1292 (format #t "Packing Icedove source tarball...~%")
1294 (setenv "XZ_DEFAULTS" (string-join (%xz-parallel-args)))
1295 (invoke "tar" "cfa" #$output
1296 "--mtime=@315619200" ;1980-01-02 UTC
1302 (define-public icedove-minimal
1304 (name "icedove-minimal")
1305 (version %icedove-version)
1306 (source icedove-source)
1308 `((cpe-name . "thunderbird_esr")))
1309 (build-system gnu-build-system)
1312 #:tests? #f ;no check target
1313 #:imported-modules %cargo-utils-modules ;for `generate-all-checksums'
1314 #:modules `((guix build utils) ;find-files
1317 ,@%gnu-build-system-modules)
1319 #~(modify-phases %standard-phases
1320 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1322 (use-modules (guix build cargo-utils))
1323 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934\
1324 ca495991b7852b855"))
1325 (for-each (lambda (file)
1326 (format #t "patching checksums in ~a~%" file)
1328 (("^checksum = \".*\"")
1329 (string-append "checksum = \"" null-hash "\""))))
1330 (find-files "." "Cargo.lock$"))
1331 (for-each generate-all-checksums
1332 '("third_party/rust"
1333 "toolkit/library/rust")))))
1334 (add-after 'patch-cargo-checksums 'remove-cargo-frozen-flag
1336 ;; Remove --frozen flag from cargo invokation, otherwise it'll
1337 ;; complain that it's not able to change Cargo.lock.
1338 ;; https://bugzilla.mozilla.org/show_bug.cgi?id=1726373
1339 (substitute* "build/RunCbindgen.py"
1340 (("\"--frozen\",") ""))))
1341 ;; Fixes issue where each installation directory generates its own
1343 ;; https://trac.torproject.org/projects/tor/ticket/31457).
1344 (add-after 'patch-source-shebangs 'fix-profile-setting
1346 (substitute* "comm/mail/moz.configure"
1347 (("MOZ_DEDICATED_PROFILES, True")
1348 "MOZ_DEDICATED_PROFILES, False"))))
1349 (add-after 'build 'neutralize-store-references
1351 ;; Mangle the store references to compilers & other build tools in
1352 ;; about:buildconfig, reducing Icedove's closure significant.
1353 ;; The resulting files are saved in lib/thunderbird/omni.ja
1355 ;; Use find because the path "obj-x86_64-pc-linux-gnu" contains
1356 ;; the architecture and the system -> more complicated.
1357 (find-files "." "buildconfig.html")
1358 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1359 (regexp-quote (%store-directory)))
1361 (string-append store
1362 (string-take hash 8)
1363 "<!-- Guix: not a runtime dependency -->"
1364 (string-drop hash 8))))))
1367 (lambda* (#:key native-inputs inputs configure-flags
1369 (let* ((bash (which "bash"))
1370 (abs-srcdir (getcwd))
1371 (srcdir (string-append "../" (basename abs-srcdir)))
1372 (flags `(,(string-append "--prefix=" #$output)
1374 (mozconfig (string-append (getcwd) "/.mozconfig")))
1375 (setenv "SHELL" bash)
1376 (setenv "CONFIG_SHELL" bash)
1377 (setenv "QA_CONFIGURE_OPTIONS" ".*")
1378 (setenv "MOZBUILD_STATE_PATH"
1379 (string-append (getcwd) "/mach_state"))
1381 (string-append (getcwd) "/.mozconfig"))
1383 (setenv "AR" "llvm-ar")
1384 (setenv "NM" "llvm-nm")
1385 (setenv "CC" "clang")
1386 (setenv "CXX" "clang++")
1388 (setenv "MOZ_NOSPAM" "1")
1389 (setenv "MACH_USE_SYSTEM_PYTHON" "1")
1391 (search-input-file inputs "/bin/python"))
1392 (setenv "MOZ_BUILD_DATE" #$%icedove-build-id) ; avoid timestamp
1393 (setenv "MOZ_APP_NAME" "icedove")
1394 (setenv "LDFLAGS" (string-append "-Wl,-rpath=" #$output
1396 (mkdir-p (string-append (getcwd) "/builddir"))
1397 (with-output-to-file mozconfig
1401 "ac_add_options --allow-addon-sideload\n"
1402 "ac_add_options --with-unsigned-addon-scopes=app,system\n"
1403 "ac_add_options --disable-crashreporter\n"
1404 "ac_add_options --disable-debug\n"
1405 "ac_add_options --disable-debug-symbols\n"
1406 "ac_add_options --disable-elf-hack\n"
1407 "ac_add_options --disable-jit\n"
1408 "ac_add_options --disable-necko-wifi\n"
1409 "ac_add_options --disable-official-branding\n"
1410 "ac_add_options --disable-tests\n"
1411 "ac_add_options --disable-updater\n"
1412 "ac_add_options --disable-webrtc\n"
1413 "ac_add_options --enable-application=comm/mail\n"
1414 "ac_add_options --enable-default-toolkit=\"cairo-gtk3\"\n"
1415 "ac_add_options --enable-optimize\n"
1416 "ac_add_options --enable-pulseaudio\n"
1417 "ac_add_options --enable-release\n"
1418 "ac_add_options --enable-strip\n"
1419 "ac_add_options --enable-system-ffi\n"
1420 "ac_add_options --enable-system-pixman\n"
1421 "ac_add_options --prefix=" #$output "\n"
1422 "ac_add_options --with-clang-path="
1423 (search-input-file (or native-inputs inputs)
1425 "ac_add_options --with-distribution-id=org.gnu\n"
1426 "ac_add_options --with-libclang-path="
1427 #$(this-package-native-input "clang") "/lib\n"
1428 "ac_add_options --with-system-bz2\n"
1429 "ac_add_options --with-system-icu\n"
1430 "ac_add_options --with-system-jpeg\n"
1431 "ac_add_options --with-system-libevent\n"
1432 "ac_add_options --with-system-nspr\n"
1433 "ac_add_options --with-system-nss\n"
1434 "ac_add_options --with-system-zlib\n"
1435 "ac_add_options --without-wasm-sandboxed-libraries\n"
1436 "mk_add_options MOZ_MAKE_FLAGS=-j"
1437 (number->string (parallel-job-count)) "\n"))))
1440 (display "mach configure")
1441 (invoke "./mach" "configure"))))
1443 (lambda _ (invoke "./mach" "build")))
1445 (lambda _ (invoke "./mach" "install")))
1446 ;; Thunderbird doesn't provide any .desktop file.
1447 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
1448 (add-after 'install 'install-desktop-file
1450 (let ((apps (string-append #$output "/share/applications")))
1452 (with-output-to-file (string-append apps "/icedove.desktop")
1457 Exec=~a/bin/icedove~@
1459 GenericName=Mail/News Client~@
1460 Categories=Network;Email;~@
1462 StartupNotify=true~@
1463 MimeType=x-scheme-handler/mailto;~@
1465 Actions=ComposeMessage;~@
1466 [Desktop Action ComposeMessage]~@
1467 Name=Write new message~@
1468 Exec=~@*~a/bin/icedove -compose~%"
1470 (add-after 'install-desktop-file 'install-icons
1472 (with-directory-excursion "browser/branding/official"
1475 (let* ((size (string-filter char-numeric? file))
1476 (icons (string-append #$output "/share/icons/hicolor/"
1477 size "x" size "/apps")))
1479 (copy-file file (string-append icons "/icedove.png"))))
1480 '("default16.png" "default22.png" "default24.png"
1481 "default32.png" "default48.png" "content/icon64.png"
1482 "mozicon128.png" "default256.png")))))
1483 (add-after 'install 'wrap-program
1484 (lambda* (#:key inputs #:allow-other-keys)
1485 (let* ((lib (string-append #$output "/lib"))
1486 (gtk #$(this-package-input "gtk+"))
1487 (gtk-share (string-append gtk "/share"))
1488 (pulseaudio #$(this-package-input "pulseaudio"))
1489 (pulseaudio-lib (string-append pulseaudio "/lib"))
1490 (eudev #$(this-package-input "eudev"))
1491 (eudev-lib (string-append eudev "/lib")))
1492 (wrap-program (car (find-files lib "^icedove$"))
1493 `("XDG_DATA_DIRS" prefix (,gtk-share))
1494 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib ,eudev-lib)))))))))
1528 startup-notification
1534 (list `(,rust "cargo")
1547 (home-page "https://www.thunderbird.net")
1548 (synopsis "Rebranded Mozilla Thunderbird email client")
1550 "This package provides an email client built based on Mozilla
1551 Thunderbird. It supports email, news feeds, chat, calendar and contacts.")
1552 (license license:mpl2.0)))
1554 (define (make-l10n-package project version source locales)
1555 "Return a package for PROJECT, a symbol (either icecat or icedove), with
1556 their corresponding VERSION, SOURCE and LOCALES variables."
1557 (unless (member project '(icecat icedove))
1558 (error "only icecat or icedove components are currently supported"))
1560 (let ((name (if (eq? 'icecat project)
1564 (name (format #f "~a-l10n" project))
1567 (outputs (cons "out" locales))
1568 (build-system gnu-build-system)
1571 #:modules '((guix build gnu-build-system)
1577 #:tests? #f ;no tests, this is data
1579 #~(modify-phases %standard-phases
1584 ;; The following configuration is inspired by guidance at
1585 ;; https://firefox-source-docs.mozilla.org/build/buildsystem/locales.html.
1586 (call-with-output-file ".mozconfig"
1588 (format p "~{~a~%~}"
1589 (list (if (eq? 'icecat '#$project)
1590 "ac_add_options --enable-project=browser"
1591 "ac_add_options --enable-project=comm/mail")
1592 "ac_add_options --disable-compile-environment"
1594 "ac_add_options --with-l10n-base="
1596 ;; Hack, otherwise the build system throws:
1597 ;; 'RuntimeError: File "brand.dtd" not found'.
1598 "ac_add_options --enable-official-branding"
1599 "mk_add_options MOZ_OBJDIR=obj"))))
1600 (setenv "CONFIG_SHELL" (which "bash"))
1601 (setenv "MOZBUILD_STATE_PATH"
1602 (string-append (getcwd) "/mach_state"))
1603 (setenv "MOZCONFIG" (string-append (getcwd) "/.mozconfig"))
1604 (setenv "MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE" "system")
1605 (setenv "BUILD_BACKENDS" "FasterMake,RecursiveMake")))
1606 (replace 'build ;build and install data files
1607 (lambda* (#:key outputs #:allow-other-keys)
1608 (define (find-file dir name)
1609 (let ((files (find-files dir name)))
1611 (error "could not find file in dir" name dir))
1616 (let* ((out (assoc-ref outputs l))
1617 ;; The older lib/$project/distribution/extensions
1618 ;; directory is deprecated. Use the newer app-global
1619 ;; directory, which is lib/$project/extensions.
1622 #f "lib/~a/~:[~;browser/~]extensions"
1623 '#$project (eq? 'icecat '#$project)))
1624 (all-ext (string-append #$output "/" ext-dir-prefix))
1625 (ext-dir (string-append out "/" ext-dir-prefix))
1626 ;; XXX: Because Icedove doesn't have a makeicedove
1627 ;; script that substitutes all the Thunderbird
1628 ;; references to Icedove, the MOZ_LANGPACK_EID
1629 ;; defined in comm/mail/locales/Makefile.in uses
1630 ;; 'thunderbird' in its ID extension rather than
1632 (name (format #f "langpack-~a@~a.mozilla.org.xpi"
1633 l (if (eq? 'icedove '#$project)
1636 (format #t "processing locale `~a'...~%" l)
1637 (if (eq? 'icecat '#$project)
1638 ;; XXX: For some reasons, for IceCat, there are some
1639 ;; parsing errors that cause the build system to
1640 ;; return an unclean exit code; use system* to ignore
1642 (system* "./mach" "build" (string-append "langpack-" l))
1643 (invoke "./mach" "build" (string-append "langpack-" l)))
1645 (let ((xpi (find-file "obj" (string-append
1646 "\\." l "\\.langpack\\.xpi$"))))
1647 (copy-file xpi (string-append ext-dir "/" name))
1648 ;; Symlink to the main output so that a user can
1649 ;; install all of the language packs at once.
1651 (symlink (string-append ext-dir "/" name)
1652 (string-append all-ext "/" name)))))
1653 (if (eq? 'icedove '#$project)
1655 '#$%icecat-locales)))))))
1662 (home-page "https://www.mozilla.org/")
1663 (synopsis (string-append "Language localization data for " name))
1664 (description (string-append "This package contains the various language
1665 localization data files (language pack extensions) for " name ". The
1666 individual localization packages can be installed by using the output
1667 associated with their name."))
1668 (license license:mpl2.0))))
1670 (define-public icecat-l10n
1671 (make-l10n-package 'icecat %icecat-version icecat-source %icecat-locales))
1673 (define-public icedove-l10n
1674 (make-l10n-package 'icedove %icedove-version icedove-source %icedove-locales))
1676 ;;; This hack exists because there's no way to configure extra extension
1677 ;;; search paths for IceCat or Icedove. The global extensions directory is
1678 ;;; constructed relatively to the executable file name.
1679 (define (make-mozilla-with-l10n project base l10n-package)
1680 "Return a package definition for PROJECT (a symbol such as 'icecat or
1681 'icedove) that combines the BASE package with L10N-PACKAGE."
1683 (unless (member project '(icecat icedove))
1684 (error "only icecat or icedove components are currently supported"))
1686 (let ((name (symbol->string project))
1687 (icecat? (eq? 'icecat project)))
1690 (name (symbol->string project))
1691 (build-system trivial-build-system)
1694 #:modules '((guix build union)
1698 (use-modules (guix build union)
1701 (union-build #$output (list #$base #$l10n-package)
1702 #:create-all-directories? #t)
1704 (define* (expose name #:optional (proc copy-file)
1705 #:key (source #$base))
1706 (let ((dest (string-append #$output "/" name)))
1707 (mkdir-p (dirname dest))
1708 (proc (string-append source "/" name) dest)))
1710 (let ((wrapper (string-append "lib/" #$name "/" #$name))
1711 (real-binary (string-append "lib/" #$name "/." #$name
1713 (desktop-file (string-append "share/applications/"
1714 #$name ".desktop")))
1715 ;; Copy wrapper file.
1716 (delete-file (string-append #$output "/" wrapper))
1719 ;; Recreate bin symlink.
1720 (delete-file (string-append #$output "/bin/" #$name))
1721 (symlink (string-append #$output "/" wrapper)
1722 (string-append #$output "/bin/" #$name))
1724 ;; Copy actual binary.
1725 (delete-file (string-append #$output "/" real-binary))
1726 (expose real-binary)
1728 ;; Copy desktop file.
1729 (delete-file (string-append #$output "/" desktop-file))
1730 (expose desktop-file)
1732 ;; Adjust the references in the desktop file and wrapper.
1733 (substitute* (list (string-append #$output "/" desktop-file)
1734 (string-append #$output "/" wrapper))
1735 ((#$base) #$output)))))))))
1737 (define-public icecat
1738 (make-mozilla-with-l10n 'icecat icecat-minimal icecat-l10n))
1740 (define-public icedove
1741 (make-mozilla-with-l10n 'icedove icedove-minimal icedove-l10n))
1743 (define-public icedove/wayland
1746 (name "icedove-wayland")
1747 (build-system trivial-build-system)
1750 #:modules '((guix build utils))
1753 (use-modules (guix build utils))
1754 (let* ((exe (string-append #$output "/bin/icedove")))
1755 (mkdir-p (dirname exe))
1756 (call-with-output-file exe
1759 MOZ_ENABLE_WAYLAND=1 exec ~a $@"
1760 #$(file-append bash-minimal "/bin/bash")
1761 #$(file-append icedove "/bin/icedove"))))
1763 ;; Provide the manual and .desktop file.
1764 (copy-recursively (string-append #$icedove "/share")
1765 (string-append #$output "/share"))
1766 (substitute* (string-append #$output
1767 "/share/applications/icedove.desktop")
1768 ((#$icedove) #$output))))))
1772 (define-public firefox-decrypt
1774 (name "firefox-decrypt")
1779 (url "https://github.com/Unode/firefox_decrypt")
1781 (file-name (git-file-name name version))
1784 "17yyyxp47z4m8hnflcq34rc1y871515kr3f1y42j1l0yx3g0il07"))))
1785 (build-system trivial-build-system)
1789 `(#:modules ((guix build utils))
1792 (use-modules (guix build utils))
1795 (assoc-ref %build-inputs "python") "/bin"))
1796 (copy-file (string-append (assoc-ref %build-inputs "source")
1797 "/firefox_decrypt.py")
1798 "firefox_decrypt.py")
1799 (substitute* "firefox_decrypt.py"
1800 (("/usr/bin/env python") (which "python3"))
1801 (("libnss3.so") (string-append (assoc-ref %build-inputs "nss")
1802 "/lib/nss/libnss3.so")))
1803 (install-file "firefox_decrypt.py" (string-append %output "/bin"))
1805 (home-page "https://github.com/Unode/firefox_decrypt/")
1806 (synopsis "Tool to extract passwords from Mozilla profiles")
1807 (description "Firefox Decrypt is a tool to extract passwords from
1808 Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.")
1809 (license license:gpl3+)))
1811 (define-public lz4json
1820 (url "https://github.com/andikleen/lz4json")
1821 (commit (string-append "v" version))))
1822 (file-name (git-file-name name version))
1824 (base32 "1xxn8yzr6j8j6prmbj6mxspdczigarfiv3vlm9k70yxmky65ijh3"))))
1825 (build-system gnu-build-system)
1826 (native-inputs (list pkg-config))
1829 `(#:tests? #f ; no check target
1831 (modify-phases %standard-phases
1832 (delete 'configure) ; no configure script
1833 (replace 'install ; no install target
1834 (lambda* (#:key outputs #:allow-other-keys)
1835 (let* ((out (assoc-ref outputs "out"))
1836 (bin (string-append out "/bin"))
1837 (man (string-append out "/share/man/man1")))
1838 (install-file "lz4jsoncat" bin)
1839 (install-file "lz4jsoncat.1" man)))))
1840 #:make-flags `(,(string-append "CC=" ,(cc-for-target)))))
1841 (home-page "https://github.com/andikleen/lz4json")
1842 (synopsis "C decompress tool for mozilla lz4json format")
1844 "@code{lz4json} is a little utility to unpack lz4json files as generated
1845 by Firefox's bookmark backups and session restore. This is a different format
1846 from what the normal lz4 utility expects. The data is dumped to stdout.")
1847 (license license:bsd-2)))