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.
727 ;; The following patches are specific to the Guix packaging of IceCat,
728 ;; and therefore we prefer to leave them out of 'source', which should be
729 ;; a tarball suitable for compilation on any system that IceCat supports.
730 ;; (Bug fixes and security fixes, however, should go in 'source').
732 ;; XXX TODO: Adapt these patches to IceCat 102.
733 ;; ("icecat-avoid-bundled-libraries.patch"
734 ;; ,(search-patch "icecat-avoid-bundled-libraries.patch"))
735 ;; ("icecat-use-system-graphite2+harfbuzz.patch"
736 ;; ,(search-patch "icecat-use-system-graphite2+harfbuzz.patch"))
737 ;; ("icecat-use-system-media-libs.patch"
738 ;; ,(search-patch "icecat-use-system-media-libs.patch"))
748 nasm ; XXX FIXME: only needed on x86_64 and i686
754 #:tests? #f ;not worth the cost
756 ;; Some dynamic lib was determined at runtime, so rpath check may fail.
757 #:validate-runpath? #f
761 "--enable-application=browser"
762 "--with-distribution-id=org.gnu"
763 "--enable-geckodriver"
764 ;; Do not require addons in the global app or system directories to
765 ;; be signed by Mozilla.
766 "--with-unsigned-addon-scopes=app,system"
767 "--allow-addon-sideload"
769 "--enable-pulseaudio"
773 "--disable-crashreporter"
776 ;; Building with debugging symbols takes ~5GiB, so disable it.
778 "--disable-debug-symbols"
786 ;; Clang is needed to build Stylo, Mozilla's new CSS engine. We must
787 ;; specify the clang paths manually, because otherwise the Mozilla
788 ;; build system looks in the directories returned by llvm-config
789 ;; --bindir and llvm-config --libdir, which return paths in the llvm
790 ;; package where clang is not found.
791 (string-append "--with-clang-path="
792 (search-input-file %build-inputs "bin/clang"))
793 (string-append "--with-libclang-path="
794 (dirname (search-input-file %build-inputs
797 ;; Hack to work around missing "unofficial" branding in icecat.
798 "--enable-official-branding"
800 ;; TODO: Add support for wasm sandboxed libraries.
801 "--without-wasm-sandboxed-libraries"
803 ;; Avoid bundled libraries.
804 "--with-system-jpeg" ;must be libjpeg-turbo
805 "--with-system-png" ;must be libpng-apng
807 ;; UNBUNDLE-ME! "--with-system-bz2"
808 ;; UNBUNDLE-ME! "--with-system-libevent"
809 ;; UNBUNDLE-ME! "--with-system-ogg"
810 ;; UNBUNDLE-ME! "--with-system-vorbis"
811 ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released
812 ;; UNBUNDLE-ME! "--with-system-libvpx"
817 ;; UNBUNDLE-ME! "--with-system-harfbuzz"
818 ;; UNBUNDLE-ME! "--with-system-graphite2"
819 "--enable-system-pixman"
820 "--enable-system-ffi"
821 ;; UNBUNDLE-ME! "--enable-system-sqlite"
824 #:imported-modules %cargo-utils-modules ;for `generate-all-checksums'
826 #:modules `((ice-9 ftw)
834 ,@%gnu-build-system-modules)
836 #~(modify-phases %standard-phases
837 (add-after 'unpack 'apply-guix-specific-patches
838 (lambda* (#:key inputs native-inputs #:allow-other-keys)
839 (let ((patch (search-input-file inputs "bin/patch")))
840 (for-each (match-lambda
842 (when (and (string-prefix? "icecat-" label)
843 (string-suffix? ".patch" label))
844 (format #t "applying '~a'...~%" file)
845 (invoke patch "--force" "--no-backup-if-mismatch"
846 "-p1" "--input" file))))
847 (or native-inputs inputs)))))
848 (add-after 'apply-guix-specific-patches 'remove-bundled-libraries
850 ;; Remove bundled libraries that we don't use, since they may
851 ;; contain unpatched security flaws, they waste disk space and
852 ;; memory, and may cause confusion.
853 (for-each (lambda (file)
854 (format #t "deleting '~a'...~%" file)
855 (delete-file-recursively file))
856 '( ;; FIXME: Removing the bundled icu breaks configure.
857 ;; * The bundled icu headers are used in some places.
858 ;; * The version number is taken from the bundled copy.
861 ;; FIXME: A script from the bundled nspr is used.
864 ;; FIXME: Some of the bundled NSS sources are used
865 ;; to build third_party/prio.
868 ;; TODO: Use more system media libraries. See:
869 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
870 ;; * libtheora: esr60 wants v1.2, not yet released.
871 ;; * soundtouch: avoiding the bundled library would
872 ;; result in some loss of functionality. There's
873 ;; also an issue with exception handling
874 ;; configuration. It seems that this is needed in
876 ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1
881 ;; "media/libjpeg" ; needed for now, because media/libjpeg/moz.build is referenced from config/external/moz.build
882 ;; UNBUNDLE-ME! "modules/zlib"
883 ;; UNBUNDLE-ME! "ipc/chromium/src/third_party/libevent"
884 ;; UNBUNDLE-ME! "media/libvpx"
885 ;; UNBUNDLE-ME! "media/libogg"
886 ;; UNBUNDLE-ME! "media/libvorbis"
887 ;; UNBUNDLE-ME! "media/libtheora" ; wants theora-1.2, not yet released
888 ;; UNBUNDLE-ME! "media/libtremor"
889 ;; UNBUNDLE-ME! "gfx/harfbuzz"
890 ;; UNBUNDLE-ME! "gfx/graphite2"
891 "js/src/ctypes/libffi"
892 ;; UNBUNDLE-ME! "db/sqlite3"
894 (add-after 'remove-bundled-libraries 'fix-ffmpeg-runtime-linker
895 (lambda* (#:key inputs #:allow-other-keys)
896 ;; Arrange to load libavcodec.so by its absolute file name.
897 (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
899 (search-input-file inputs "lib/libavcodec.so")))))
900 (add-after 'fix-ffmpeg-runtime-linker 'build-sandbox-whitelist
901 (lambda* (#:key inputs #:allow-other-keys)
902 (define (runpath-of lib)
903 (call-with-input-file lib
904 (compose elf-dynamic-info-runpath
907 get-bytevector-all)))
908 (define (runpaths-of-input label)
909 (let* ((dir (string-append (assoc-ref inputs label) "/lib"))
910 (libs (find-files dir "\\.so$")))
911 (append-map runpath-of libs)))
912 ;; Populate the sandbox read-path whitelist as needed by ffmpeg.
914 (map (cut string-append <> "/")
916 `(,(string-append (assoc-ref inputs "shared-mime-info")
918 ,(string-append (assoc-ref inputs "font-dejavu")
920 "/run/current-system/profile/share/fonts"
921 ,@(append-map runpaths-of-input
922 '("mesa" "ffmpeg"))))))
923 (whitelist-string (string-join whitelist ","))
924 (port (open-file "browser/app/profile/icecat.js" "a")))
925 (format #t "setting 'security.sandbox.content.read_path_whitelist' to '~a'~%"
927 (format port "~%pref(\"security.sandbox.content.read_path_whitelist\", ~S);~%"
929 (close-output-port port))))
930 (add-after 'patch-source-shebangs 'patch-cargo-checksums
932 (use-modules (guix build cargo-utils))
933 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
934 (for-each (lambda (file)
935 (format #t "patching checksums in ~a~%" file)
937 (("^checksum = \".*\"")
938 (string-append "checksum = \"" null-hash "\""))))
939 (find-files "." "Cargo.lock$"))
940 (for-each generate-all-checksums
952 "mozglue/static/rust"
957 "security/manager/ssl"
959 (add-after 'patch-cargo-checksums 'remove-cargo-frozen-flag
961 ;; Remove --frozen flag from cargo invokation, otherwise it'll
962 ;; complain that it's not able to change Cargo.lock.
963 ;; https://bugzilla.mozilla.org/show_bug.cgi?id=1726373
964 (substitute* "build/RunCbindgen.py"
965 (("\"--frozen\",") ""))))
968 ;; configure does not work followed by both "SHELL=..." and
969 ;; "CONFIG_SHELL=..."; set environment variables instead
970 (lambda* (#:key outputs configure-flags #:allow-other-keys)
971 (let* ((bash (which "bash"))
972 (abs-srcdir (getcwd))
973 (flags `(,(string-append "--prefix=" #$output)
974 ,(string-append "--with-l10n-base="
977 (setenv "SHELL" bash)
978 (setenv "CONFIG_SHELL" bash)
980 (setenv "AR" "llvm-ar")
981 (setenv "NM" "llvm-nm")
982 (setenv "CC" "clang")
983 (setenv "CXX" "clang++")
984 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
985 #$output "/lib/icecat"))
987 (setenv "MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE" "system")
988 (setenv "MOZ_BUILD_DATE" #$%icecat-build-id) ; avoid timestamp
990 ;; XXX TODO: Fix this to work on systems other than x86_64-linux.
991 (setenv "GUIX_PYTHONPATH"
992 (string-append (getcwd)
993 "/obj-x86_64-pc-linux-gnu/_virtualenvs/build"))
996 (setenv "MOZBUILD_STATE_PATH"
997 (string-append (getcwd) "/.mozbuild"))
999 (format #t "build directory: ~s~%" (getcwd))
1000 (format #t "configure flags: ~s~%" flags)
1002 (call-with-output-file "mozconfig"
1004 (for-each (lambda (flag)
1005 (format port "ac_add_options ~a\n" flag))
1008 (invoke "./mach" "configure"))))
1010 (lambda* (#:key (make-flags '()) (parallel-build? #t)
1012 (apply invoke "./mach" "build"
1013 ;; mach will use parallel build if possible by default
1014 `(,@(if parallel-build?
1018 (add-after 'build 'neutralise-store-references
1020 ;; Mangle the store references to compilers & other build tools in
1021 ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64.
1022 (let* ((obj-dir (match (scandir "." (cut string-prefix? "obj-" <>))
1024 (file (string-append
1026 "/dist/bin/chrome/toolkit/content/global/buildconfig.html")))
1028 (("[0-9a-df-np-sv-z]{32}" hash)
1029 (string-append (string-take hash 8)
1030 "<!-- Guix: not a runtime dependency -->"
1031 (string-drop hash 8)))))))
1033 (lambda* (#:key outputs #:allow-other-keys)
1034 (invoke "./mach" "install")
1035 ;; The geckodriver binary is not installed by the above, for some
1036 ;; reason. Use 'find-files' to avoid having to deal with the
1037 ;; system/architecture-specific file name.
1038 (install-file (first (find-files "." "geckodriver"))
1039 (string-append #$output "/bin"))))
1040 (add-after 'install 'wrap-program
1041 (lambda* (#:key inputs #:allow-other-keys)
1042 (let* ((lib (string-append #$output "/lib"))
1043 (gtk #$(this-package-input "gtk+"))
1044 (gtk-share (string-append gtk "/share"))
1045 (ld-libs '#$(map (lambda (label)
1046 (file-append (this-package-input label) "/lib"))
1054 ;; For the integration of native notifications
1056 (wrap-program (car (find-files lib "^icecat$"))
1057 `("XDG_DATA_DIRS" prefix (,gtk-share))
1058 ;; The following line is commented out because the icecat
1059 ;; package on guix has been observed to be unstable when
1060 ;; using wayland, and the bundled extensions stop working.
1061 ;; `("MOZ_ENABLE_WAYLAND" = ("1"))
1062 `("LD_LIBRARY_PATH" prefix ,ld-libs)))))
1063 (add-after 'wrap-program 'install-desktop-entry
1065 ;; Install the '.desktop' file.
1066 (let* ((desktop-file "taskcluster/docker/icecat-snap/icecat.desktop")
1067 (applications (string-append #$output "/share/applications")))
1068 (substitute* desktop-file
1069 (("^Exec=icecat") (string-append "Exec=" #$output "/bin/icecat"))
1070 (("IceCat") "GNU IceCat")
1071 (("Icon=.*") "Icon=icecat\n")
1072 (("NewWindow") "new-window")
1073 (("NewPrivateWindow") "new-private-window")
1074 (("StartupNotify=true")
1075 "StartupNotify=true\nStartupWMClass=Navigator"))
1076 (install-file desktop-file applications))))
1077 (add-after 'install-desktop-entry 'install-icons
1079 (with-directory-excursion "browser/branding/official"
1082 (let* ((size (string-filter char-numeric? file))
1083 (icons (string-append #$output "/share/icons/hicolor/"
1084 size "x" size "/apps")))
1086 (copy-file file (string-append icons "/icecat.png"))))
1087 '("default16.png" "default22.png" "default24.png"
1088 "default32.png" "default48.png" "content/icon64.png"
1089 "mozicon128.png" "default256.png"))))))))
1090 (home-page "https://www.gnu.org/software/gnuzilla/")
1091 (synopsis "Entirely free browser derived from Mozilla Firefox")
1093 "IceCat is the GNU version of the Firefox browser. It is entirely free
1094 software, which does not recommend non-free plugins and addons. It also
1095 features built-in privacy-protecting features. This package also includes the
1096 @command{geckodriver} command, which can be useful for automated web
1099 WARNING: IceCat 102 has not yet been released by the upstream IceCat project.
1100 This is a preview release, and does not currently meet the privacy-respecting
1101 standards of the IceCat project.")
1102 (license license:mpl2.0) ;and others, see toolkit/content/license.html
1104 `((ftp-directory . "/gnu/gnuzilla")
1105 (cpe-name . "firefox_esr")
1106 (cpe-version . ,(first (string-split version #\-)))))))
1108 (define %icecat-locales
1109 '("ach" "af" "an" "ar" "ast" "az" "be" "bg" "bn" "br" "bs" "ca" "cak"
1110 "ca-valencia" "cs" "cy" "da" "de" "dsb" "el" "en-CA" "en-GB" "eo" "es-AR"
1111 "es-CL" "es-ES" "es-MX" "et" "eu" "fa" "ff" "fi" "fr" "fy-NL" "ga-IE" "gd"
1112 "gl" "gn" "gu-IN" "he" "hi-IN" "hr" "hsb" "hu" "hy-AM" "ia" "id" "is" "it"
1113 "ja" "ja-JP-mac" "ka" "kab" "kk" "km" "kn" "ko" "lij" "lt" "lv" "mk" "mr" "ms"
1114 "my" "nb-NO" "ne-NP" "nl" "nn-NO" "oc" "pa-IN" "pl" "pt-BR" "pt-PT" "rm" "ro"
1115 "ru" "sco" "si" "sk" "sl" "son" "sq" "sr" "sv-SE" "szl" "ta" "te" "th" "tl"
1116 "tr" "trs" "uk" "ur" "uz" "vi" "xh" "zh-CN" "zh-TW"))
1118 (define %icedove-build-id "20230207000000") ;must be of the form YYYYMMDDhhmmss
1119 (define %icedove-version "102.7.2")
1121 ;; Provides the "comm" folder which is inserted into the icecat source.
1122 ;; Avoids the duplication of Icecat's source tarball.
1123 (define thunderbird-comm-source
1127 (url "https://hg.mozilla.org/releases/comm-esr102")
1128 (changeset "0f6deed0752b618055c34e06c268af3da9d1548d")))
1129 (file-name (string-append "thunderbird-" %icedove-version "-checkout"))
1132 "071q0pcfvfpzx741ly1sl8anlmzx02h17w4ylfnrkwrpaclq3p6p"))))
1134 (define (comm-source->locales+changeset source)
1135 "Given SOURCE, a checkout of the Thunderbird 'comm' component, return the
1136 list of languages supported as well as the currently used changeset."
1137 (match (update-mozilla-locales
1138 (string-append source "/mail/locales/l10n-changesets.json"))
1139 (((_ changeset locale) ...)
1140 (values locale (first changeset)))))
1142 ;;; Generated with comm-source->locales+changeset.
1143 (define %icedove-locales
1144 '("af" "ar" "ast" "be" "bg" "br" "ca" "cak" "cs" "cy" "da" "de" "dsb" "el"
1145 "en-CA" "en-GB" "es-AR" "es-ES" "es-MX" "et" "eu" "fi" "fr" "fy-NL" "ga-IE"
1146 "gd" "gl" "he" "hr" "hsb" "hu" "hy-AM" "id" "is" "it" "ja" "ja-JP-mac" "ka"
1147 "kab" "kk" "ko" "lt" "lv" "ms" "nb-NO" "nl" "nn-NO" "pa-IN" "pl" "pt-BR"
1148 "pt-PT" "rm" "ro" "ru" "sk" "sl" "sq" "sr" "sv-SE" "th" "tr" "uk" "uz" "vi"
1151 ;;; To find out which changeset to use for the comm-l10n repo, use the
1152 ;;; 'comm-source->locales+changeset' procedure on the thunderbird-comm-source
1153 ;;; checkout directory. The complete localization data should be released as
1154 ;;; a tarball in the next release (see:
1155 ;;; https://bugzilla.mozilla.org/show_bug.cgi?id=1817086). When this tarball
1156 ;;; is available, it should replace the complete 'l10n' directory at the root
1157 ;;; of the IceCat source, instead of only the 'calendar', chat and mail
1158 ;;; directories that it provides.
1159 (define thunderbird-comm-l10n
1160 (let* ((changeset "5b6788295358")
1161 (version (git-version %icedove-version "0" changeset)))
1165 (url "https://hg.mozilla.org/projects/comm-l10n")
1166 (changeset changeset)))
1167 (file-name (git-file-name "comm-l10n" version))
1170 "1jrsmkscjjllcfawi3788vwm53wn25inbhdis5nk4vfpr7wk5ill")))))
1172 (define icedove-source
1173 (let ((name (string-append "icedove-" %icedove-version)))
1175 (method computed-origin-method)
1176 (file-name (string-append name ".tar.xz"))
1180 (with-imported-modules (source-module-closure '((guix build utils)))
1182 (use-modules (guix build utils)
1185 (set-path-environment-variable
1187 (list #+(canonical-package tar)
1188 #+(canonical-package xz)))
1190 ;; Extract the base Icecat tarball, renaming its top-level
1192 (invoke "tar" "--transform" (string-append "s,[^/]*," #$name ",")
1193 "-xf" #$icecat-source)
1196 ;; Merge the Thunderdbird localization data.
1197 (copy-recursively #$thunderbird-comm-l10n "l10n")
1199 ;; Add the Thunderbird-specific "comm" directory..
1201 (copy-recursively #$thunderbird-comm-source "comm")
1202 (delete-file "sourcestamp.txt")
1204 ;; Adjust the application name.
1205 (substitute* "comm/mail/confvars.sh"
1206 (("MOZ_APP_NAME=thunderbird")
1207 "MOZ_APP_NAME=icedove")
1211 ;; Remove branding to comply with Mozilla's trademark policy
1212 (with-directory-excursion "comm/mail/branding/nightly"
1213 (delete-file "content/about-wordmark.svg")
1214 (call-with-output-file "content/about-wordmark.svg"
1216 (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg")
1217 (viewBox "0 0 789.1 90.78")
1221 (text (@ (x "400") (y "70")
1222 (text-anchor "middle")
1226 (substitute* '("locales/en-US/brand.properties"
1227 "locales/en-US/brand.ftl"
1228 "locales/en-US/brand.dtd"
1230 (("Thunderbird") "Icedove")
1231 (("mozilla.org") "guix.gnu.org")))
1232 ;; Remove other mentions of Thunderbird in user-visible text.
1233 (with-directory-excursion "comm/mail/base/content"
1234 (substitute* '("overrides/app-license-name.html")
1235 (("Thunderbird") "Icedove")))
1236 (with-directory-excursion "comm/mail/components/"
1237 (substitute* '("MailGlue.jsm"
1238 "extensions/schemas/addressBook.json"
1239 "extensions/schemas/tabs.json"
1240 "extensions/schemas/cloudFile.json"
1241 "extensions/schemas/chrome_settings_overrides.json"
1242 "extensions/schemas/windows.json"
1243 "extensions/parent/ext-mail.js"
1244 "im/messages/mail/Info.plist"
1245 "enterprisepolicies/moz.build"
1246 "enterprisepolicies/helpers/moz.build"
1247 "enterprisepolicies/schemas/moz.build")
1248 (("Thunderbird") "Icedove")))
1249 (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js"
1250 "comm/mail/base/content/customizeToolbar.js"
1251 "comm/suite/components/customizeToolbar.js")
1252 (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e)
1253 (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e)))
1255 ;; Override addon URLs and settings
1256 (substitute* "comm/mail/app/profile/all-thunderbird.js"
1257 (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m)
1258 (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");"))
1259 (("(pref\\(\"extensions.getAddons.search.url\").*" _ m)
1260 (string-append m ", \"https://guix.gnu.org/packages\");"))
1261 (("(pref\\(\"extensions.update.enabled\").*" _ m)
1262 (string-append m ", false);"))
1263 (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m)
1264 (string-append m ", false);"))
1265 (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m)
1266 (string-append m ", false);"))
1268 ;; XXX: The autoDisableScopes is tweaked by the makeicecat
1269 ;; script, but it doesn't know about Thunderbird. This is
1270 ;; necessary to allow picking up the extensions found in the
1271 ;; system global application directory, such as the language
1273 (("\"extensions.autoDisableScopes\", 15")
1274 "\"extensions.autoDisableScopes\", 3")
1276 ;; Set the default locale to that of the operating system.
1277 ((".*extensions.autoDisableScopes.*" anchor)
1278 (string-append anchor
1279 "pref(\"intl.locale.requested\", \"\");\n")))
1281 ;; Step out of the directory and create the tarball.
1283 (format #t "Packing Icedove source tarball...~%")
1285 (setenv "XZ_DEFAULTS" (string-join (%xz-parallel-args)))
1286 (invoke "tar" "cfa" #$output
1287 "--mtime=@315619200" ;1980-01-02 UTC
1293 (define-public icedove-minimal
1295 (name "icedove-minimal")
1296 (version %icedove-version)
1297 (source icedove-source)
1299 `((cpe-name . "thunderbird_esr")))
1300 (build-system gnu-build-system)
1303 #:tests? #f ;no check target
1304 #:imported-modules %cargo-utils-modules ;for `generate-all-checksums'
1305 #:modules `((guix build utils) ;find-files
1308 ,@%gnu-build-system-modules)
1310 #~(modify-phases %standard-phases
1311 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1313 (use-modules (guix build cargo-utils))
1314 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934\
1315 ca495991b7852b855"))
1316 (for-each (lambda (file)
1317 (format #t "patching checksums in ~a~%" file)
1319 (("^checksum = \".*\"")
1320 (string-append "checksum = \"" null-hash "\""))))
1321 (find-files "." "Cargo.lock$"))
1322 (for-each generate-all-checksums
1323 '("third_party/rust"
1324 "toolkit/library/rust")))))
1325 (add-after 'patch-cargo-checksums 'remove-cargo-frozen-flag
1327 ;; Remove --frozen flag from cargo invokation, otherwise it'll
1328 ;; complain that it's not able to change Cargo.lock.
1329 ;; https://bugzilla.mozilla.org/show_bug.cgi?id=1726373
1330 (substitute* "build/RunCbindgen.py"
1331 (("\"--frozen\",") ""))))
1332 ;; Fixes issue where each installation directory generates its own
1334 ;; https://trac.torproject.org/projects/tor/ticket/31457).
1335 (add-after 'patch-source-shebangs 'fix-profile-setting
1337 (substitute* "comm/mail/moz.configure"
1338 (("MOZ_DEDICATED_PROFILES, True")
1339 "MOZ_DEDICATED_PROFILES, False"))))
1340 (add-after 'build 'neutralize-store-references
1342 ;; Mangle the store references to compilers & other build tools in
1343 ;; about:buildconfig, reducing Icedove's closure significant.
1344 ;; The resulting files are saved in lib/thunderbird/omni.ja
1346 ;; Use find because the path "obj-x86_64-pc-linux-gnu" contains
1347 ;; the architecture and the system -> more complicated.
1348 (find-files "." "buildconfig.html")
1349 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1350 (regexp-quote (%store-directory)))
1352 (string-append store
1353 (string-take hash 8)
1354 "<!-- Guix: not a runtime dependency -->"
1355 (string-drop hash 8))))))
1358 (lambda* (#:key native-inputs inputs configure-flags
1360 (let* ((bash (which "bash"))
1361 (abs-srcdir (getcwd))
1362 (srcdir (string-append "../" (basename abs-srcdir)))
1363 (flags `(,(string-append "--prefix=" #$output)
1365 (mozconfig (string-append (getcwd) "/.mozconfig")))
1366 (setenv "SHELL" bash)
1367 (setenv "CONFIG_SHELL" bash)
1368 (setenv "QA_CONFIGURE_OPTIONS" ".*")
1369 (setenv "MOZBUILD_STATE_PATH"
1370 (string-append (getcwd) "/mach_state"))
1372 (string-append (getcwd) "/.mozconfig"))
1374 (setenv "AR" "llvm-ar")
1375 (setenv "NM" "llvm-nm")
1376 (setenv "CC" "clang")
1377 (setenv "CXX" "clang++")
1379 (setenv "MOZ_NOSPAM" "1")
1380 (setenv "MACH_USE_SYSTEM_PYTHON" "1")
1382 (search-input-file inputs "/bin/python"))
1383 (setenv "MOZ_BUILD_DATE" #$%icedove-build-id) ; avoid timestamp
1384 (setenv "MOZ_APP_NAME" "icedove")
1385 (setenv "LDFLAGS" (string-append "-Wl,-rpath=" #$output
1387 (mkdir-p (string-append (getcwd) "/builddir"))
1388 (with-output-to-file mozconfig
1392 "ac_add_options --allow-addon-sideload\n"
1393 "ac_add_options --with-unsigned-addon-scopes=app,system\n"
1394 "ac_add_options --disable-crashreporter\n"
1395 "ac_add_options --disable-debug\n"
1396 "ac_add_options --disable-debug-symbols\n"
1397 "ac_add_options --disable-elf-hack\n"
1398 "ac_add_options --disable-jit\n"
1399 "ac_add_options --disable-necko-wifi\n"
1400 "ac_add_options --disable-official-branding\n"
1401 "ac_add_options --disable-tests\n"
1402 "ac_add_options --disable-updater\n"
1403 "ac_add_options --disable-webrtc\n"
1404 "ac_add_options --enable-application=comm/mail\n"
1405 "ac_add_options --enable-default-toolkit=\"cairo-gtk3\"\n"
1406 "ac_add_options --enable-optimize\n"
1407 "ac_add_options --enable-pulseaudio\n"
1408 "ac_add_options --enable-release\n"
1409 "ac_add_options --enable-strip\n"
1410 "ac_add_options --enable-system-ffi\n"
1411 "ac_add_options --enable-system-pixman\n"
1412 "ac_add_options --prefix=" #$output "\n"
1413 "ac_add_options --with-clang-path="
1414 (search-input-file (or native-inputs inputs)
1416 "ac_add_options --with-distribution-id=org.gnu\n"
1417 "ac_add_options --with-libclang-path="
1418 #$(this-package-native-input "clang") "/lib\n"
1419 "ac_add_options --with-system-bz2\n"
1420 "ac_add_options --with-system-icu\n"
1421 "ac_add_options --with-system-jpeg\n"
1422 "ac_add_options --with-system-libevent\n"
1423 "ac_add_options --with-system-nspr\n"
1424 "ac_add_options --with-system-nss\n"
1425 "ac_add_options --with-system-zlib\n"
1426 "ac_add_options --without-wasm-sandboxed-libraries\n"
1427 "mk_add_options MOZ_MAKE_FLAGS=-j"
1428 (number->string (parallel-job-count)) "\n"))))
1431 (display "mach configure")
1432 (invoke "./mach" "configure"))))
1434 (lambda _ (invoke "./mach" "build")))
1436 (lambda _ (invoke "./mach" "install")))
1437 ;; Thunderbird doesn't provide any .desktop file.
1438 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
1439 (add-after 'install 'install-desktop-file
1441 (let ((apps (string-append #$output "/share/applications")))
1443 (with-output-to-file (string-append apps "/icedove.desktop")
1448 Exec=~a/bin/icedove~@
1450 GenericName=Mail/News Client~@
1451 Categories=Network;Email;~@
1453 StartupNotify=true~@
1454 MimeType=x-scheme-handler/mailto;~@
1456 Actions=ComposeMessage;~@
1457 [Desktop Action ComposeMessage]~@
1458 Name=Write new message~@
1459 Exec=~@*~a/bin/icedove -compose~%"
1461 (add-after 'install-desktop-file 'install-icons
1463 (with-directory-excursion "browser/branding/official"
1466 (let* ((size (string-filter char-numeric? file))
1467 (icons (string-append #$output "/share/icons/hicolor/"
1468 size "x" size "/apps")))
1470 (copy-file file (string-append icons "/icedove.png"))))
1471 '("default16.png" "default22.png" "default24.png"
1472 "default32.png" "default48.png" "content/icon64.png"
1473 "mozicon128.png" "default256.png")))))
1474 (add-after 'install 'wrap-program
1475 (lambda* (#:key inputs #:allow-other-keys)
1476 (let* ((lib (string-append #$output "/lib"))
1477 (gtk #$(this-package-input "gtk+"))
1478 (gtk-share (string-append gtk "/share"))
1479 (pulseaudio #$(this-package-input "pulseaudio"))
1480 (pulseaudio-lib (string-append pulseaudio "/lib"))
1481 (eudev #$(this-package-input "eudev"))
1482 (eudev-lib (string-append eudev "/lib")))
1483 (wrap-program (car (find-files lib "^icedove$"))
1484 `("XDG_DATA_DIRS" prefix (,gtk-share))
1485 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib ,eudev-lib)))))))))
1519 startup-notification
1525 (list `(,rust "cargo")
1538 (home-page "https://www.thunderbird.net")
1539 (synopsis "Rebranded Mozilla Thunderbird email client")
1541 "This package provides an email client built based on Mozilla
1542 Thunderbird. It supports email, news feeds, chat, calendar and contacts.")
1543 (license license:mpl2.0)))
1545 (define (make-l10n-package project version source locales)
1546 "Return a package for PROJECT, a symbol (either icecat or icedove), with
1547 their corresponding VERSION, SOURCE and LOCALES variables."
1548 (unless (member project '(icecat icedove))
1549 (error "only icecat or icedove components are currently supported"))
1551 (let ((name (if (eq? 'icecat project)
1555 (name (format #f "~a-l10n" project))
1558 (outputs (cons "out" locales))
1559 (build-system gnu-build-system)
1562 #:modules '((guix build gnu-build-system)
1568 #:tests? #f ;no tests, this is data
1570 #~(modify-phases %standard-phases
1575 ;; The following configuration is inspired by guidance at
1576 ;; https://firefox-source-docs.mozilla.org/build/buildsystem/locales.html.
1577 (call-with-output-file ".mozconfig"
1579 (format p "~{~a~%~}"
1580 (list (if (eq? 'icecat '#$project)
1581 "ac_add_options --enable-project=browser"
1582 "ac_add_options --enable-project=comm/mail")
1583 "ac_add_options --disable-compile-environment"
1585 "ac_add_options --with-l10n-base="
1587 ;; Hack, otherwise the build system throws:
1588 ;; 'RuntimeError: File "brand.dtd" not found'.
1589 "ac_add_options --enable-official-branding"
1590 "mk_add_options MOZ_OBJDIR=obj"))))
1591 (setenv "CONFIG_SHELL" (which "bash"))
1592 (setenv "MOZBUILD_STATE_PATH"
1593 (string-append (getcwd) "/mach_state"))
1594 (setenv "MOZCONFIG" (string-append (getcwd) "/.mozconfig"))
1595 (setenv "MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE" "system")
1596 (setenv "BUILD_BACKENDS" "FasterMake,RecursiveMake")))
1597 (replace 'build ;build and install data files
1598 (lambda* (#:key outputs #:allow-other-keys)
1599 (define (find-file dir name)
1600 (let ((files (find-files dir name)))
1602 (error "could not find file in dir" name dir))
1607 (let* ((out (assoc-ref outputs l))
1608 ;; The older lib/$project/distribution/extensions
1609 ;; directory is deprecated. Use the newer app-global
1610 ;; directory, which is lib/$project/extensions.
1613 #f "lib/~a/~:[~;browser/~]extensions"
1614 '#$project (eq? 'icecat '#$project)))
1615 (all-ext (string-append #$output "/" ext-dir-prefix))
1616 (ext-dir (string-append out "/" ext-dir-prefix))
1617 ;; XXX: Because Icedove doesn't have a makeicedove
1618 ;; script that substitutes all the Thunderbird
1619 ;; references to Icedove, the MOZ_LANGPACK_EID
1620 ;; defined in comm/mail/locales/Makefile.in uses
1621 ;; 'thunderbird' in its ID extension rather than
1623 (name (format #f "langpack-~a@~a.mozilla.org.xpi"
1624 l (if (eq? 'icedove '#$project)
1627 (format #t "processing locale `~a'...~%" l)
1628 (if (eq? 'icecat '#$project)
1629 ;; XXX: For some reasons, for IceCat, there are some
1630 ;; parsing errors that cause the build system to
1631 ;; return an unclean exit code; use system* to ignore
1633 (system* "./mach" "build" (string-append "langpack-" l))
1634 (invoke "./mach" "build" (string-append "langpack-" l)))
1636 (let ((xpi (find-file "obj" (string-append
1637 "\\." l "\\.langpack\\.xpi$"))))
1638 (copy-file xpi (string-append ext-dir "/" name))
1639 ;; Symlink to the main output so that a user can
1640 ;; install all of the language packs at once.
1642 (symlink (string-append ext-dir "/" name)
1643 (string-append all-ext "/" name)))))
1644 (if (eq? 'icedove '#$project)
1646 '#$%icecat-locales)))))))
1653 (home-page "https://www.mozilla.org/")
1654 (synopsis (string-append "Language localization data for " name))
1655 (description (string-append "This package contains the various language
1656 localization data files (language pack extensions) for " name ". The
1657 individual localization packages can be installed by using the output
1658 associated with their name."))
1659 (license license:mpl2.0))))
1661 (define-public icecat-l10n
1662 (make-l10n-package 'icecat %icecat-version icecat-source %icecat-locales))
1664 (define-public icedove-l10n
1665 (make-l10n-package 'icedove %icedove-version icedove-source %icedove-locales))
1667 ;;; This hack exists because there's no way to configure extra extension
1668 ;;; search paths for IceCat or Icedove. The global extensions directory is
1669 ;;; constructed relatively to the executable file name.
1670 (define (make-mozilla-with-l10n project base l10n-package)
1671 "Return a package definition for PROJECT (a symbol such as 'icecat or
1672 'icedove) that combines the BASE package with L10N-PACKAGE."
1674 (unless (member project '(icecat icedove))
1675 (error "only icecat or icedove components are currently supported"))
1677 (let ((name (symbol->string project))
1678 (icecat? (eq? 'icecat project)))
1681 (name (symbol->string project))
1682 (build-system trivial-build-system)
1685 #:modules '((guix build union)
1689 (use-modules (guix build union)
1692 (union-build #$output (list #$base #$l10n-package)
1693 #:create-all-directories? #t)
1695 (define* (expose name #:optional (proc copy-file)
1696 #:key (source #$base))
1697 (let ((dest (string-append #$output "/" name)))
1698 (mkdir-p (dirname dest))
1699 (proc (string-append source "/" name) dest)))
1701 (let ((wrapper (string-append "lib/" #$name "/" #$name))
1702 (real-binary (string-append "lib/" #$name "/." #$name
1704 (desktop-file (string-append "share/applications/"
1705 #$name ".desktop")))
1706 ;; Copy wrapper file.
1707 (delete-file (string-append #$output "/" wrapper))
1710 ;; Recreate bin symlink.
1711 (delete-file (string-append #$output "/bin/" #$name))
1712 (symlink (string-append #$output "/" wrapper)
1713 (string-append #$output "/bin/" #$name))
1715 ;; Copy actual binary.
1716 (delete-file (string-append #$output "/" real-binary))
1717 (expose real-binary)
1719 ;; Copy desktop file.
1720 (delete-file (string-append #$output "/" desktop-file))
1721 (expose desktop-file)
1723 ;; Adjust the references in the desktop file and wrapper.
1724 (substitute* (list (string-append #$output "/" desktop-file)
1725 (string-append #$output "/" wrapper))
1726 ((#$base) #$output)))))))))
1728 (define-public icecat
1729 (make-mozilla-with-l10n 'icecat icecat-minimal icecat-l10n))
1731 (define-public icedove
1732 (make-mozilla-with-l10n 'icedove icedove-minimal icedove-l10n))
1734 (define-public icedove/wayland
1737 (name "icedove-wayland")
1738 (build-system trivial-build-system)
1741 #:modules '((guix build utils))
1744 (use-modules (guix build utils))
1745 (let* ((exe (string-append #$output "/bin/icedove")))
1746 (mkdir-p (dirname exe))
1747 (call-with-output-file exe
1750 MOZ_ENABLE_WAYLAND=1 exec ~a $@"
1751 #$(file-append bash-minimal "/bin/bash")
1752 #$(file-append icedove "/bin/icedove"))))
1754 ;; Provide the manual and .desktop file.
1755 (copy-recursively (string-append #$icedove "/share")
1756 (string-append #$output "/share"))
1757 (substitute* (string-append #$output
1758 "/share/applications/icedove.desktop")
1759 ((#$icedove) #$output))))))
1763 (define-public firefox-decrypt
1765 (name "firefox-decrypt")
1770 (url "https://github.com/Unode/firefox_decrypt")
1772 (file-name (git-file-name name version))
1775 "17yyyxp47z4m8hnflcq34rc1y871515kr3f1y42j1l0yx3g0il07"))))
1776 (build-system trivial-build-system)
1780 `(#:modules ((guix build utils))
1783 (use-modules (guix build utils))
1786 (assoc-ref %build-inputs "python") "/bin"))
1787 (copy-file (string-append (assoc-ref %build-inputs "source")
1788 "/firefox_decrypt.py")
1789 "firefox_decrypt.py")
1790 (substitute* "firefox_decrypt.py"
1791 (("/usr/bin/env python") (which "python3"))
1792 (("libnss3.so") (string-append (assoc-ref %build-inputs "nss")
1793 "/lib/nss/libnss3.so")))
1794 (install-file "firefox_decrypt.py" (string-append %output "/bin"))
1796 (home-page "https://github.com/Unode/firefox_decrypt/")
1797 (synopsis "Tool to extract passwords from Mozilla profiles")
1798 (description "Firefox Decrypt is a tool to extract passwords from
1799 Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.")
1800 (license license:gpl3+)))
1802 (define-public lz4json
1811 (url "https://github.com/andikleen/lz4json")
1812 (commit (string-append "v" version))))
1813 (file-name (git-file-name name version))
1815 (base32 "1xxn8yzr6j8j6prmbj6mxspdczigarfiv3vlm9k70yxmky65ijh3"))))
1816 (build-system gnu-build-system)
1817 (native-inputs (list pkg-config))
1820 `(#:tests? #f ; no check target
1822 (modify-phases %standard-phases
1823 (delete 'configure) ; no configure script
1824 (replace 'install ; no install target
1825 (lambda* (#:key outputs #:allow-other-keys)
1826 (let* ((out (assoc-ref outputs "out"))
1827 (bin (string-append out "/bin"))
1828 (man (string-append out "/share/man/man1")))
1829 (install-file "lz4jsoncat" bin)
1830 (install-file "lz4jsoncat.1" man)))))
1831 #:make-flags `(,(string-append "CC=" ,(cc-for-target)))))
1832 (home-page "https://github.com/andikleen/lz4json")
1833 (synopsis "C decompress tool for mozilla lz4json format")
1835 "@code{lz4json} is a little utility to unpack lz4json files as generated
1836 by Firefox's bookmark backups and session restore. This is a different format
1837 from what the normal lz4 utility expects. The data is dumped to stdout.")
1838 (license license:bsd-2)))