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 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
6 ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
8 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
9 ;;; Copyright © 2017, 2018 Nikita <nikita@n0.is>
10 ;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
13 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
14 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
15 ;;; Copyright © 2019, 2020 Adrian Malacoda <malacoda@monarch-pass.net>
16 ;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages gnuzilla)
34 #:use-module ((srfi srfi-1) #:hide (zip))
35 #:use-module (ice-9 match)
36 #:use-module (gnu packages)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix packages)
39 #:use-module (guix download)
40 #:use-module (guix git-download)
41 #:use-module (guix hg-download)
42 #:use-module (guix gexp)
43 #:use-module (guix store)
44 #:use-module (guix monads)
45 #:use-module (guix utils)
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system cargo)
48 #:use-module (guix build-system trivial)
49 #:use-module (gnu packages admin)
50 #:use-module (gnu packages audio)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages bash)
54 #:use-module (gnu packages databases)
55 #:use-module (gnu packages glib)
56 #:use-module (gnu packages gtk)
57 #:use-module (gnu packages gnome)
58 #:use-module (gnu packages libcanberra)
59 #:use-module (gnu packages cups)
60 #:use-module (gnu packages kerberos)
61 #:use-module (gnu packages linux)
62 #:use-module (gnu packages perl)
63 #:use-module (gnu packages pkg-config)
64 #:use-module (gnu packages compression)
65 #:use-module (gnu packages fontutils)
66 #:use-module (gnu packages libevent)
67 #:use-module (gnu packages libreoffice) ;for hunspell
68 #:use-module (gnu packages image)
69 #:use-module (gnu packages libffi)
70 #:use-module (gnu packages pulseaudio)
71 #:use-module (gnu packages python)
72 #:use-module (gnu packages python-xyz)
73 #:use-module (gnu packages node)
74 #:use-module (gnu packages xorg)
75 #:use-module (gnu packages gl)
76 #:use-module (gnu packages assembly)
77 #:use-module (gnu packages rust)
78 #:use-module (gnu packages rust-apps)
79 #:use-module (gnu packages llvm)
80 #:use-module (gnu packages nss)
81 #:use-module (gnu packages icu4c)
82 #:use-module (gnu packages video)
83 #:use-module (gnu packages xiph)
84 #:use-module (gnu packages xdisorg)
85 #:use-module (gnu packages readline)
86 #:use-module (gnu packages sqlite))
95 "https://ftp.mozilla.org/pub/mozilla.org/js/"
96 name version ".tar.gz"))
99 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))
100 (patches (search-patches "mozjs17-aarch64-support.patch"))
101 (modules '((guix build utils)))
103 ;; Fix incompatibility with Perl 5.22+.
105 (substitute* '("js/src/config/milestone.pl")
106 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE"))
108 (build-system gnu-build-system)
111 ("pkg-config" ,pkg-config)
112 ("python" ,python-2)))
114 `(("nspr" ,nspr))) ; in the Requires.private field of mozjs-17.0.pc
118 `(;; XXX: parallel build fails, lacking:
119 ;; mkdir -p "system_wrapper_js/"
121 #:make-flags '("CXXFLAGS=-fpermissive")
123 (modify-phases %standard-phases
124 (add-after 'unpack 'delete-timedout-test
125 ;; This test times out on slower hardware.
127 (delete-file "js/src/jit-test/tests/basic/bug698584.js")
129 (add-before 'configure 'chdir
134 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
135 (lambda* (#:key outputs #:allow-other-keys)
136 (let ((out (assoc-ref outputs "out")))
137 (setenv "SHELL" (which "sh"))
138 (setenv "CONFIG_SHELL" (which "sh"))
139 (invoke "./configure" (string-append "--prefix=" out)
140 ,@(if (string=? "aarch64-linux"
142 '("--host=aarch64-unknown-linux-gnu")
145 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey")
146 (synopsis "Mozilla javascript engine")
147 (description "SpiderMonkey is Mozilla's JavaScript engine written
149 (license license:mpl2.0))) ; and others for some files
151 (define-public mozjs-24
152 (package (inherit mozjs)
158 "https://ftp.mozilla.org/pub/mozilla.org/js/"
159 name "-" version ".tar.bz2"))
162 "1n1phk8r3l8icqrrap4czplnylawa0ddc2cc4cgdz46x3lrkybz6"))
163 (modules '((guix build utils)))
164 (patches (search-patches "mozjs24-aarch64-support.patch"))
166 ;; Fix incompatibility with Perl 5.22+.
168 (substitute* '("js/src/config/milestone.pl")
169 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE"))
172 (substitute-keyword-arguments (package-arguments mozjs)
174 `(modify-phases ,phases
176 (lambda* (#:key outputs #:allow-other-keys)
177 (let ((out (assoc-ref outputs "out")))
178 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
179 (setenv "SHELL" (which "sh"))
180 (setenv "CONFIG_SHELL" (which "sh"))
181 (invoke "./configure"
182 (string-append "--prefix=" out)
184 "--enable-system-ffi"
185 "--enable-threadsafe"
186 ,@(if (string=? "aarch64-linux"
188 '("--host=aarch64-unknown-linux-gnu")
194 (define-public mozjs-38
198 (version "38.2.1.rc0")
202 "https://anduin.linuxfromscratch.org/BLFS/mozjs/"
203 name "-" version ".tar.bz2"))
206 "0p4bmbpgkfsj54xschcny0a118jdrdgg0q29rwxigg3lh5slr681"))
209 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1269317 for
210 ;; GCC 6 compatibility.
212 "mozjs38-version-detection.patch" ; for 0ad
213 "mozjs38-tracelogger.patch"
215 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1339931.
216 "mozjs38-pkg-config-version.patch"
217 "mozjs38-shell-version.patch"))
218 (modules '((guix build utils)))
221 ;; Fix incompatibility with sed 4.4.
222 (substitute* "js/src/configure"
223 (("\\^\\[:space:\\]") "^[[:space:]]"))
225 ;; The headers are symlinks to files that are in /tmp, so they
226 ;; end up broken. Copy them instead.
228 "python/mozbuild/mozbuild/backend/recursivemake.py"
229 (("\\['dist_include'\\].add_symlink")
230 "['dist_include'].add_copy"))
232 ;; Remove bundled libraries.
233 (for-each delete-file-recursively
235 "js/src/ctypes/libffi"
236 "js/src/ctypes/libffi-patches"
240 `(;; XXX: parallel build fails, lacking:
241 ;; mkdir -p "system_wrapper_js/"
243 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1008470.
246 (modify-phases %standard-phases
248 (lambda* (#:key outputs #:allow-other-keys)
249 (let ((out (assoc-ref outputs "out")))
251 (setenv "SHELL" (which "sh"))
252 (setenv "CONFIG_SHELL" (which "sh"))
253 (invoke "./configure"
254 (string-append "--prefix=" out)
256 "--enable-gcgenerational"
261 "--enable-system-ffi"
262 "--enable-threadsafe"
263 "--enable-xterm-updates"
268 ;; Intl API requires bundled ICU.
269 "--without-intl-api")))))))
272 ("pkg-config" ,pkg-config)
273 ("python-2" ,python-2)))
276 ("readline" ,readline)
280 (define-public mozjs-52
281 ;; No releases yet at <https://archive.mozilla.org/pub/spidermonkey/releases/>.
282 ;; While we could take a snapshot of the complete mozilla-esr52 repository at
283 ;; <https://treeherder.mozilla.org/#/jobs?repo=mozilla-esr52&filter-searchStr=sm-tc>,
284 ;; we take the Debian version instead, because it is easier to work with.
285 (let ((commit "6507e63cc416fd7a3269e390efe712f8b56f374a")
287 (package (inherit mozjs-38)
288 (version (git-version "52.0" revision commit))
292 (url "https://salsa.debian.org/gnome-team/mozjs52.git")
294 (file-name (git-file-name "mozjs" version))
297 "1ny0s53r8wn4byys87h784xrq1xg767akmfm6gqrbvrz57mlm3q2"))))
299 `(#:tests? #f ; depends on repository metadata
306 "--enable-system-ffi"
311 ;; Intl API requires bundled ICU.
314 ;; Without this gnome-shell will crash at runtime.
315 "--disable-jemalloc")
317 (modify-phases %standard-phases
318 (add-after 'unpack 'patch-and-chdir
319 (lambda* (#:key inputs #:allow-other-keys)
320 ;; This patch prevents a segfault when executing JS_Init().
321 ;; The build does not fail without this patch, but the
322 ;; configure phase of the gjs package would fail.
323 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1176787
324 (make-file-writable "js/src/old-configure.in")
325 (make-file-writable "js/src/old-configure")
326 (make-file-writable "mozglue/build/moz.build")
327 (invoke "patch" "-p1" "--force"
328 "--input" "debian/patches/disable-mozglue.patch")
329 (invoke "touch" "js/src/configure")
333 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
334 ;; The configure script does not accept environment variables
336 (let ((out (assoc-ref outputs "out")))
337 (setenv "SHELL" (which "sh"))
338 (setenv "CONFIG_SHELL" (which "sh"))
339 (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf")
341 (apply invoke "./configure"
342 (cons (string-append "--prefix=" out)
343 configure-flags))))))))
345 `(("autoconf" ,autoconf-2.13)
346 ("automake" ,automake)
347 ,@(package-native-inputs mozjs-38))))))
349 (define-public mozjs-60
350 ;; No releases yet at <https://archive.mozilla.org/pub/spidermonkey/releases/>.
351 ;; While we could take a snapshot of the complete mozilla-esr60 repository at
352 ;; <https://treeherder.mozilla.org/#/jobs?repo=mozilla-esr60&filter-searchStr=sm-tc>,
353 ;; we take the Debian version instead, because it is easier to work with.
360 (url "https://salsa.debian.org/gnome-team/mozjs60.git")
361 (commit (string-append "debian/" version))))
362 (file-name (git-file-name "mozjs" version))
365 "091w050rwzrdcbgyi934k2viyccmlqxrp13sm2mql71mabb5dai6"))))
367 `(#:tests? #f ; FIXME: all tests pass, but then the check phase fails anyway.
368 #:test-target "check-jstests"
375 "--enable-system-ffi"
380 ;; This is important because without it gjs will segfault during the
381 ;; configure phase. With jemalloc only the standalone mozjs console
383 "--disable-jemalloc")
385 (modify-phases %standard-phases
387 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
388 ;; The configure script does not accept environment variables as
389 ;; arguments. It also must be run from a different directory,
390 ;; but not the root directory either.
391 (let ((out (assoc-ref outputs "out")))
392 (mkdir "run-configure-from-here")
393 (chdir "run-configure-from-here")
394 (setenv "SHELL" (which "sh"))
395 (setenv "CONFIG_SHELL" (which "sh"))
396 (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf")
398 (apply invoke "../js/src/configure"
399 (cons (string-append "--prefix=" out)
402 (add-after 'unpack 'disable-broken-tests
404 ;; This test assumes that /bin exists and contains certain
406 (delete-file "js/src/tests/shell/os.js")
409 `(("autoconf" ,autoconf)
410 ("automake" ,automake)
413 ("pkg-config" ,pkg-config)
414 ("python" ,python-2)))))
416 (define mozilla-compare-locales
420 (url "https://hg.mozilla.org/l10n/compare-locales/")
421 (changeset "RELEASE_3_3_0")))
422 (file-name "mozilla-compare-locales")
423 (sha256 (base32 "0biazbq7vbi99b99rfn4szwyx032dkpi09c9z4zs6f1br0f86iy1"))))
425 (define (mozilla-locale locale changeset hash-string)
429 (url (string-append "https://hg.mozilla.org/l10n-central/"
431 (changeset changeset)))
432 (file-name (string-append "mozilla-locale-" locale))
433 (sha256 (base32 hash-string))))
435 (define-syntax-rule (mozilla-locales (hash-string changeset locale) ...)
436 (list (mozilla-locale locale changeset hash-string)
439 (define all-mozilla-locales
441 ;; sha256 changeset locale
442 ;;---------------------------------------------------------------------------
443 ("0pybx6j2ycbrr1xmv0spv19sd8a1dyzcs8kf6pzn71w8y6kiagcf" "35959cf2343c" "ach")
444 ("0dixmkha738w7fkx20nx95xkfyrqb9vczpy6m03qnqfvb76xaxj5" "e8dc1010f909" "af")
445 ("124j09va25gwfxdzyfixrli0skxv53c7niagjyp7g3a3kcv2lbhc" "4c67f6b96a7b" "an")
446 ("0flgqll3xx0ym0zj0w9j2jw3fmhs6h9m4l5da6m0bpnk5ff80r06" "34cbea5f44a5" "ar")
447 ("0kdb1yqfbfz508f4p77z3p1v6fwy190vs5ipj58hgdixjgbxkqay" "b4790b27633c" "ast")
448 ("1vm5xw6wg12pygswd3p0qpkaxyryah6nif5n15chb4sb42c1gqcm" "96d341bf49d4" "az")
449 ("1j2qrrws51qij6haz5b77n5vzqhsxgs1ppqqw4mdrkacwvz4ciwh" "4adaede00646" "be")
450 ("0ydr8f9lbd51prgcbjb5yacb461j8va0s5bqfs0rnglkvhmk6ard" "d1140972aefe" "bg")
451 ("0wyw90zjp8kpd1gljng00in9wr2cf59ww6z002lgx5k4gibnqcfd" "2b3ce92c2310" "bn")
452 ("0kkq621h1qdmimyrmms9g5p70m54z2ddw4cd962nqbkrnmabq9vn" "426896350893" "br")
453 ("0vibhnb3cbpbgf10db04g6vm372kb9i27p0jkwif019f7qprswd8" "7463f339ce07" "bs")
454 ("1l8cn2fqfvx7bswzfy9vavv8cd32ha9ygdxxdbxi64wcgw0f80bf" "dab3f05125e4" "ca")
455 ("0fik17y8zyg9w82lq501ic73a53c0q9r8v4zgn9bnzgsygig8qpq" "ebb9d989275a" "cak")
456 ("0sj29v6144h39wzb4rvxph3cwgvs4gzkgpr0463d3fcs6jdi0kjs" "522352780348" "cs")
457 ("1nz8jlx62l69jcdi59hlk8jysm15sh3d1cxqginjmx7w351wsidm" "0791b954c333" "cy")
458 ("1vc01q1vlq26xm1vm1x0119jawxxp975p9k8ashmiwncl1bvqb48" "121f5f876f4c" "da")
459 ("1iqny61rg57banfbbskc2y3pr6d35fabnxmynv7vxm9jd86pndz3" "95fb3e99a2bc" "de")
460 ("06v9j8acx5h8za7m65v6qm0wjbkx6vm46m8sigcp69phyg3fjc96" "90e681b74587" "dsb")
461 ("0lbk90x2dxdbh63fycqxspx6jqq2zlzys6grg45balw8yyvzqrkz" "58ba4c13fd42" "el")
462 ("0c2ypvy0z8g78s5158v6h9khckq1xps34r5wbiiciix289m43dgl" "8953d8c98a30" "en-CA")
463 ("0z3riz3w2z6p710p90ridmwwam4snnz5mn90gd4jc1h2n7vc9mr0" "5a2b9bca3f52" "en-GB")
464 ("102gn3h4ap8c3x1p7vfc88vapkfiz6264y6byhxy1axxjk3x3a77" "e87cb1c61d6e" "eo")
465 ("148wj6wsx0aq7cpaxk8njj7cb1wfjr2m96dgxq6b3qcv781ldvjn" "5db15fdf95d5" "es-AR")
466 ("0r11d8vzvbyz17n371byvkrnszcv1zhr7rg64i58xra3y6d7is7n" "ce2ee0e51a92" "es-CL")
467 ("1xmqa8p7lpqvkgg879hfnmf6kxcpawjk8z31cdzfp1hrdlmxg8n7" "7346617620f3" "es-ES")
468 ("0jxv3jh2018lnybr9mzqrffvwmr87yab9bh8lxqjj294fxw1hrxm" "687f05eb0c58" "es-MX")
469 ("1rpgv7pajv4xldsn1xxsia5j72vn3x8zl5wmbzkyw56lvn9fckvf" "839a5029c496" "et")
470 ("0hxp4fr3y05rkpamdb1hlmybn6d3bv3rcawjm3axbpqxbyfdpfzc" "54e8d87230c9" "eu")
471 ("1y50knymnmcihw8bhvahicc386mjm6dx4hx0j6fv8sl23wzx2h9m" "c5ffca960f9c" "fa")
472 ("0pj9zgi0c3yl3myhvb5afiijayp2lqzhlk630ahxn5hgjgkz0lx7" "75c000a8538d" "ff")
473 ("199jg0zv7wp1cq0ik2hf84j99jx5vq2jwac0gaayvjzkh2z83jqr" "f11b2e689e7b" "fi")
474 ("1vxkiwwni7470ywy99arxxa56ljkhjrhxslsp1l1l61g6gdbbspr" "49ec4f791806" "fr")
475 ("0d8gwdcj0jpjv03nhjds8jrg86pg371xpylaibwri76wlyl7m54i" "faa761a5cfdc" "fy-NL")
476 ("0nipbxx11a2sjadzhbi88vgknw5hzr4nqy2722q3kc1212jbi754" "5bd9466f9f9d" "ga-IE")
477 ("0bay8mrm65cvmnvqpwqgzr0h3cb18ifzg5kbsbxcvdfm9xv0zi9g" "a4f6a47e82dd" "gd")
478 ("00kn5w3nnpw1pxg6hhrn9asf9hgpjd6ia4038iwzcqs68w887qcy" "6c2aa01ada4e" "gl")
479 ("0jj13i0ach85c975vaz2rr83mibs29ipssa7qsjkb0y2ch6xya1k" "c2d607e36cb5" "gn")
480 ("1nhqbgzilcb0pr7941dxkhg079bf8v7ldikp1s5xli34wf9sabm2" "f34465d6ac1c" "gu-IN")
481 ("11bh0541d996cfin1zy72l66753q94i4idgv2waf0h40h9g3z1bm" "c2ecb2762274" "he")
482 ("1lslji7hh5lx5ig1xgfjh4cdindsgh3n2a7qlvzwz96gda43lvv4" "94d2bb10ee03" "hi-IN")
483 ("1nx5yw00l25i3m3grdm29mi9mi7h0cy5qx02pypir754pk3hiwcc" "08df0d94edd5" "hr")
484 ("19yc9dk2pwqycynmx58d1ik6x4mnyfxscgr6sg676dpl613xd7nq" "21b614e77025" "hsb")
485 ("0l3z64jlx6b6ivk1b5hwqyx9hm1m5721ywnb2m4zmg3g9fw4vn7f" "f82cad7170af" "hu")
486 ("1sn0dxbbf2zwcpybwcw77qb4p0hf6fxapnsnn4avaab5g55dlgz4" "d94c30920396" "hy-AM")
487 ("0c92cqxrhv4317kirmhpjk7mrq44yn6fp3v6syxnhz7xwxnhshjm" "6a5f176b0626" "ia")
488 ("03gyg9gqsd6pwb9nydglhm46fi2wk2p2qygmhmrf8hnav3ba7n0r" "94e4302e0f85" "id")
489 ("0ky8aaps92mn56rvkwn0i13wg8av8hzi1fvr0ahqhjcpj5sfgdwq" "eca348a59888" "is")
490 ("01py0sfg7nljcsgpivryrvai4p4wzbcvhgc2ymr19r579nv1vw7g" "d541a6197359" "it")
491 ("0iv7vmj43njmi7g1gjzsv68ax4j502d2wnkvbfz1rx11lrqs7yw1" "a5ab3a1d95b7" "ja")
492 ("1sr9ccshcw6agbj4hbnpblxixb1jz0m36glas6f9ahxmi7m605si" "63763ffa5a94" "ja-JP-mac")
493 ("1as33pzcsdkynrj16dv7w642vl6plbhk650am4l5djwm64f2rgms" "aa83e8555ddc" "ka")
494 ("1jwaqb5qps3i5y9iw8l2hrwa0n8lfnx1k9x0p54y3jkh6p3q3fzc" "0e0e25c26247" "kab")
495 ("0cjfiwv0q5i8d7fpwb4m2w5ahq687dqjlwlicgpa443yi2zsxr4s" "33117723ceb1" "kk")
496 ("0k5b56cv39aaxf9r0p9c27f3fp6yq2ffd4w6qmd0ibpl69sm629d" "aff7b2a7825e" "km")
497 ("1a0zg96jgq4zn9cz0h2qwc0vv1fbkfzs5qrgabg62wqgz286jvvv" "ea91638cb1dd" "kn")
498 ("0jhmv2n3yx55r6fg3myg7j1c1nhsv25g016m6lh2j023xbr723gp" "88821009b5b3" "ko")
499 ("06bybgv4m4i7r9p0qld65j31vbrnljhsdj649dl93msv2r69ilif" "88685d5f07b3" "lij")
500 ("1bzjf8smw6ngi88j5g3fawrg54m8fifbhshwjbgkpj7rnrpjgh4w" "e046c7ffa7d0" "lt")
501 ("18dmzmpavijb7fwzffas0j5nb6byqp8h6ki7hhf6qb35diqgfq6n" "c520ef4f576c" "lv")
502 ("055zf7xj5h1h8mzxj1cjzhngpcvg2p5vs2dmffsa5zfprj02d0dm" "9e43723f18ad" "mk")
503 ("1496fbyyzcl075gzcd3xy50h9jyhnzgb544k1scji56yhyfajacb" "ce615fef92c1" "mr")
504 ("1wc1q8ksry181pvnysqsq4dhhsg5adw5vgqafmmq5sf6i2bwn2z0" "4fefe88cfaee" "ms")
505 ("0awf6mrdwdhy2yvxynssvp1zg1nc2fqbmg2d2bhjcib69zx944xw" "3987a06866fd" "my")
506 ("1hycvz7i4jd40hfs5abx6sgfdkafg0jhdgqih9b7lb08aqcl35pj" "2b3b8997d9a1" "nb-NO")
507 ("048z1ib46izwryyy8l1x71kq4775n7l2ilbskhsyrbxqryma13k8" "f25324281615" "ne-NP")
508 ("1qkxqpyr4la9bn1bqsgc2h9869arglh9n2kwpkq6722jzdbynkz2" "04c7d32c57f6" "nl")
509 ("08gnmdll55dbqj7qs63gq1kljbvg24nzns6q4m0av3sszsic0jv5" "5587520e5019" "nn-NO")
510 ("1yh2p4ipj5p2b7gh0xxj0n7ndvwn5bw2773ibrh7vz932mkzhhjn" "499386b02695" "oc")
511 ("0kjbnixjzv9hvyba4ll20gs76vx84pviy134fvpjp9lfjpnpib55" "31c01c325675" "pa-IN")
512 ("0g61imvr4639bbydyi0kwc1il7l1gzlfij4ywx7hdcmq2x6vgb9v" "fb5f3b8dea09" "pl")
513 ("13n68d7z94d7943m6fwl4kizbqm3wp82xz69vng4w9vyqlvv7d41" "9a541cbdc748" "pt-BR")
514 ("1j8afvrl1afmj2zixrp91rrhag5w4xw90raca1ic6mxyih9kvdi4" "edc959a685c2" "pt-PT")
515 ("0wf4a6q9nvcmam2g8ksbymjdnrz59pdr5nirfpjprfhifjmxx4nn" "d2699db715cd" "rm")
516 ("1k9qalir5pbh490w1mxyq31yhy9hbxsyrrk11hwlwlgn6syp9nvp" "b5460a9017bc" "ro")
517 ("1avy6wyfa5lbvy36wai6mwhhh6x1y8a0jyjk8hvjn52yfxj1gypk" "59ffa8ad047a" "ru")
518 ("1cakhm4jxcw1ij0l1vhxw74hsp5wg68i3319dkdncyyc5a2s1qv9" "8b3c8a7ebdfa" "si")
519 ("0s534r09bqdfvw3q17y9b1035kzzlafjv656v73mqhyz3fkffsx5" "cb39dc77980e" "sk")
520 ("1s58vgmnb9aiaiaqwwcivq3iyzpzj527w2aqh2nrh6xmaw7f43sr" "17d7969b1d9a" "sl")
521 ("147qm7x5z8rkf24jpqvkdlqg0fjz1l3zwnaxvkh9y2jpzv7m0x7z" "c55b0e9ff99d" "son")
522 ("0nn4r1rxi8cy7x9nmn5ljd8gcsn2rjl2ma2j7waxkafkm4rs6n20" "2bb3808072da" "sq")
523 ("0jsb01b94z7qbm59yaj56nb7yx7a6hpgw8v6nzwhbvmnmcsird4p" "c323c0d02d61" "sr")
524 ("1n7vv9y4sk3gig56rgfd2jk8jr2160grxk31bd1wkm7fvbndd259" "4220ce487cbc" "sv-SE")
525 ("06270mq7gajxfrsb8gqd25v2dac68ask5vvlh6kkkp3hrgy02vid" "6a1dbc2fe1d3" "ta")
526 ("10az7pd3npa7n8wq0qywvsj2qrx9592i2wffs3rnc1fviv1i1q0y" "028505b5ecd1" "te")
527 ("0yj0c3iyibb3jyypvyiyhbr9asxa48v0nq21kcf9gphi8fnyp5if" "e44d38b6a67b" "th")
528 ("1qc4nvhw834lx7p304fxma0fjdr4xfj4lf69dhh6biqz795lx45p" "1e0771d95708" "tr")
529 ("1g4y2yq5xp61ncy7c08j7fqqr1jc0m1hjxmbg5659wzif3b3dkg4" "e3c96943e98f" "uk")
530 ("1zbi28z1c3p5il7ndixyjsv4nrimzq36zjvlmq10am38ycqr9df8" "f35da1b02691" "ur")
531 ("1jrxjjj8k771y0wljqbadxdj4pasg0771jmg4l3hvpgs929i3j9g" "6fd2084b3efe" "uz")
532 ("1f8sqgxzgqmw6vzjv3f49lg43q09i3j62f471864vr71815agl8n" "33b5dfd0cd63" "vi")
533 ("0ssnsbxw3q5k88fa081gkn1mbqn4j7bm6vb7yvz6h44j214xkz9x" "2d87c0740715" "xh")
534 ("0kd3mrvvgczhsmw4rvpxxxc71bb469ayr8r4azf7gc0y5nmlm950" "a2b6625688d3" "zh-CN")
535 ("0qy1asyfplkyc89z3g3gfm7b32aka92350b3ayv9d9dcgwxmfdwz" "4d6e959a13d1" "zh-TW")))
537 (define (mozilla-patch file-name changeset hash)
538 "Return an origin for CHANGESET from the mozilla-esr60 repository."
541 (uri (string-append "https://hg.mozilla.org/releases/mozilla-esr60/raw-rev/"
543 (sha256 (base32 hash))
544 (file-name file-name)))
546 (define* (computed-origin-method gexp-promise hash-algo hash
547 #:optional (name "source")
548 #:key (system (%current-system))
549 (guile (default-guile)))
550 "Return a derivation that executes the G-expression that results
551 from forcing GEXP-PROMISE."
552 (mlet %store-monad ((guile (package->derivation guile system)))
553 (gexp->derivation (or name "computed-origin")
555 #:graft? #f ;nothing to graft
557 #:guile-for-build guile)))
559 (define %icecat-version "68.12.0-guix0-preview1")
560 (define %icecat-build-id "20200825000000") ;must be of the form YYYYMMDDhhmmss
562 ;; 'icecat-source' is a "computed" origin that generates an IceCat tarball
563 ;; from the corresponding upstream Firefox ESR tarball, using the 'makeicecat'
564 ;; script from the upstream IceCat project.
565 (define icecat-source
566 (let* ((base-version (first (string-split %icecat-version #\-)))
568 (major-version (first (string-split base-version #\.)))
569 (minor-version (second (string-split base-version #\.)))
570 (sub-version (third (string-split base-version #\.)))
572 (upstream-firefox-version (string-append base-version "esr"))
573 (upstream-firefox-source
577 "https://ftp.mozilla.org/pub/firefox/releases/"
578 upstream-firefox-version "/source/"
579 "firefox-" upstream-firefox-version ".source.tar.xz"))
582 "1k17pi4zh9hrvkzbw4rzzw879a15hpvwriylp75wl22rl7r2nsdf"))))
584 (upstream-icecat-base-version "68.12.0") ; maybe older than base-version
585 ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version))
586 (gnuzilla-commit "15a7c3d991a670b6489d4f432b52a188358f4ca5")
591 (url "git://git.savannah.gnu.org/gnuzilla.git")
592 (commit gnuzilla-commit)))
593 (file-name (git-file-name "gnuzilla"
594 ;;upstream-icecat-base-version
595 (string-take gnuzilla-commit 8)))
598 "0n7p067yay413iy0gzprz0xrdkcxj5f8ywhkcghhhzw1nwajckba"))))
601 (local-file (search-patch "icecat-makeicecat.patch")))
602 (gnuzilla-fixes-patch
603 (local-file (search-patch "icecat-use-older-reveal-hidden-html.patch"))))
606 (method computed-origin-method)
607 (file-name (string-append "icecat-" %icecat-version ".tar.xz"))
611 (with-imported-modules '((guix build utils))
613 (use-modules (guix build utils))
615 (string-append "firefox-" #$base-version))
617 (string-append "icecat-" #$%icecat-version)))
620 (set-path-environment-variable
623 #+(canonical-package bash)
624 #+(canonical-package coreutils)
625 #+(canonical-package findutils)
626 #+(canonical-package patch)
627 #+(canonical-package xz)
628 #+(canonical-package sed)
629 #+(canonical-package grep)
630 #+(canonical-package bzip2)
631 #+(canonical-package gzip)
632 #+(canonical-package tar)
635 (symlink #+(file-append rename "/bin/rename")
638 ;; We copy the gnuzilla source directory because it is
639 ;; read-only in 'gnuzilla-source', and the makeicecat script
640 ;; uses "cp -a" to copy parts of it and assumes that the
641 ;; copies will be writable.
642 (copy-recursively #+gnuzilla-source "/tmp/gnuzilla"
643 #:log (%make-void-port "w"))
645 (with-directory-excursion "/tmp/gnuzilla"
646 (make-file-writable "makeicecat")
647 (invoke "patch" "--force" "--no-backup-if-mismatch"
648 "-p1" "--input" #+makeicecat-patch)
649 (invoke "patch" "--force" "--no-backup-if-mismatch"
650 "-p1" "--input" #+gnuzilla-fixes-patch)
651 (patch-shebang "makeicecat")
652 (substitute* "makeicecat"
653 (("^FFMAJOR=(.*)" all ffmajor)
654 (unless (string=? #$major-version
655 (string-trim-both ffmajor))
656 ;; The makeicecat script cannot be expected to work
657 ;; properly on a different version of Firefox, even if
658 ;; no errors occur during execution.
659 (error "makeicecat major version mismatch"))
660 (string-append "FFMAJOR=" #$major-version "\n"))
662 (string-append "FFMINOR=" #$minor-version "\n"))
664 (string-append "FFSUB=" #$sub-version "\n"))
666 "DATA=/tmp/gnuzilla/data\n")
668 #+(file-append (canonical-package sed) "/bin/sed"))))
670 (format #t "Unpacking upstream firefox tarball...~%")
672 (invoke "tar" "xf" #+upstream-firefox-source)
673 (rename-file firefox-dir icecat-dir)
675 (with-directory-excursion icecat-dir
676 (format #t "Populating l10n directory...~%")
679 (with-directory-excursion "l10n"
683 (string-drop (basename locale-dir)
684 (+ 32 ; length of hash
685 (string-length "-mozilla-locale-")))))
686 (format #t " ~a~%" locale)
688 (copy-recursively locale-dir locale
689 #:log (%make-void-port "w"))
690 (for-each make-file-writable (find-files locale))
691 (with-directory-excursion locale
692 (when (file-exists? ".hgtags")
693 (delete-file ".hgtags"))
694 (mkdir-p "browser/chrome/browser/preferences")
695 (call-with-output-file
696 "browser/chrome/browser/preferences/advanced-scripts.dtd"
697 (lambda (port) #f)))))
698 '#+all-mozilla-locales)
699 (copy-recursively #+mozilla-compare-locales
701 #:log (%make-void-port "w"))
702 (delete-file "compare-locales/.gitignore")
703 (delete-file "compare-locales/.hgignore")
704 (delete-file "compare-locales/.hgtags"))
706 (format #t "Running makeicecat script...~%")
708 (invoke "bash" "/tmp/gnuzilla/makeicecat"))
710 (format #t "Packing IceCat source tarball...~%")
712 (invoke "tar" "cfa" #$output
713 ;; Avoid non-determinism in the archive. We set the
714 ;; mtime of files in the archive to early 1980 because
715 ;; the build process fails if the mtime of source
716 ;; files is pre-1980, due to the creation of zip
718 "--mtime=@315619200" ; 1980-01-02 UTC
726 (define-public icecat
729 (version %icecat-version)
730 (source icecat-source)
731 (build-system gnu-build-system)
733 `(("alsa-lib" ,alsa-lib)
736 ("dbus-glib" ,dbus-glib)
737 ("gdk-pixbuf" ,gdk-pixbuf)
741 ("graphite2" ,graphite2)
743 ("freetype" ,freetype)
744 ("harfbuzz" ,harfbuzz)
745 ("libcanberra" ,libcanberra)
746 ("libgnome" ,libgnome)
747 ("libjpeg-turbo" ,libjpeg-turbo)
749 ;; ("libtheora" ,libtheora) ; wants theora-1.2, not yet released
750 ("libvorbis" ,libvorbis)
752 ("libevent" ,libevent)
753 ("libxinerama" ,libxinerama)
754 ("libxscrnsaver" ,libxscrnsaver)
755 ("libxcomposite" ,libxcomposite)
762 ("pulseaudio" ,pulseaudio)
764 ("mit-krb5" ,mit-krb5)
765 ;; See <https://bugs.gnu.org/32833>
766 ;; and related comments in the 'remove-bundled-libraries' phase.
767 ;; UNBUNDLE-ME! ("nspr" ,nspr)
768 ;; UNBUNDLE-ME! ("nss" ,nss)
769 ("shared-mime-info" ,shared-mime-info)
771 ("startup-notification" ,startup-notification)
776 ;; The following patches are specific to the Guix packaging of IceCat,
777 ;; and therefore we prefer to leave them out of 'source', which should be
778 ;; a tarball suitable for compilation on any system that IceCat supports.
779 ;; (Bug fixes and security fixes, however, should go in 'source').
780 `(;; XXX TODO: Adapt these patches to IceCat 68.
781 ;; ("icecat-avoid-bundled-libraries.patch"
782 ;; ,(search-patch "icecat-avoid-bundled-libraries.patch"))
783 ;; ("icecat-use-system-graphite2+harfbuzz.patch"
784 ;; ,(search-patch "icecat-use-system-graphite2+harfbuzz.patch"))
785 ;; ("icecat-use-system-media-libs.patch"
786 ;; ,(search-patch "icecat-use-system-media-libs.patch"))
788 ("patch" ,(canonical-package patch))
791 ("cargo" ,rust "cargo")
792 ("rust-cbindgen" ,rust-cbindgen)
798 ("python-2" ,python-2)
799 ("python2-pysqlite" ,python2-pysqlite)
801 ("nasm" ,nasm) ; XXX FIXME: only needed on x86_64 and i686
802 ("pkg-config" ,pkg-config)
803 ("autoconf" ,autoconf-2.13)
806 `(#:tests? #f ; no check target
807 #:out-of-source? #t ; must be built outside of the source directory
809 ;; XXX: There are RUNPATH issues such as
810 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
811 ;; which is not in its RUNPATH, but they appear to be harmless in
812 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
813 #:validate-runpath? #f
815 #:configure-flags `("--enable-default-toolkit=cairo-gtk3"
817 "--with-distribution-id=org.gnu"
819 ;; Do not require addons in the global app
820 ;; directory to be signed by Mozilla.
821 "--with-unsigned-addon-scopes=app"
823 "--enable-startup-notification"
824 "--enable-pulseaudio"
828 "--disable-crashreporter"
832 ;; Building with debugging symbols takes ~5GiB, so
835 "--disable-debug-symbols"
837 ;; Clang is needed to build Stylo, Mozilla's new
838 ;; CSS engine. We must specify the clang paths
839 ;; manually, because otherwise the Mozilla build
840 ;; system looks in the directories returned by
841 ;; llvm-config --bindir and llvm-config --libdir,
842 ;; which return paths in the llvm package where
843 ;; clang is not found.
844 ,(string-append "--with-clang-path="
845 (assoc-ref %build-inputs "clang")
847 ,(string-append "--with-libclang-path="
848 (assoc-ref %build-inputs "clang")
851 ;; Hack to work around missing
852 ;; "unofficial" branding in icecat.
853 "--enable-official-branding"
855 ;; Avoid bundled libraries.
858 "--with-system-jpeg" ; must be libjpeg-turbo
859 ;; UNBUNDLE-ME! "--with-system-libevent"
860 ;; UNBUNDLE-ME! "--with-system-ogg"
861 ;; UNBUNDLE-ME! "--with-system-vorbis"
862 ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released
863 ;; UNBUNDLE-ME! "--with-system-libvpx"
866 ;; See <https://bugs.gnu.org/32833>
867 ;; and related comments in the
868 ;; 'remove-bundled-libraries' phase below.
869 ;; UNBUNDLE-ME! "--with-system-nspr"
870 ;; UNBUNDLE-ME! "--with-system-nss"
872 ;; UNBUNDLE-ME! "--with-system-harfbuzz"
873 ;; UNBUNDLE-ME! "--with-system-graphite2"
874 "--enable-system-pixman"
875 "--enable-system-ffi"
876 ;; UNBUNDLE-ME! "--enable-system-sqlite"
878 ;; Fails with "--with-system-png won't work because
879 ;; the system's libpng doesn't have APNG support".
881 ;; http://sourceforge.net/projects/libpng-apng/ ,
882 ;; "the Animated Portable Network Graphics (APNG)
883 ;; is an unofficial extension of the Portable
884 ;; Network Graphics (PNG) format";
885 ;; we probably do not wish to support it.
886 ;; "--with-system-png"
889 #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
891 #:modules ((ice-9 ftw)
901 ,@%gnu-build-system-modules)
903 (modify-phases %standard-phases
904 (add-after 'unpack 'apply-guix-specific-patches
905 (lambda* (#:key inputs native-inputs #:allow-other-keys)
906 (let ((patch (string-append (assoc-ref (or native-inputs inputs)
909 (for-each (match-lambda
911 (when (and (string-prefix? "icecat-" label)
912 (string-suffix? ".patch" label))
913 (format #t "applying '~a'...~%" file)
914 (invoke patch "--force" "--no-backup-if-mismatch"
915 "-p1" "--input" file))))
916 (or native-inputs inputs)))
918 (add-after 'apply-guix-specific-patches 'remove-bundled-libraries
920 ;; Remove bundled libraries that we don't use, since they may
921 ;; contain unpatched security flaws, they waste disk space and
922 ;; memory, and may cause confusion.
923 (for-each (lambda (file)
924 (format #t "deleting '~a'...~%" file)
925 (delete-file-recursively file))
926 '(;; FIXME: Removing the bundled icu breaks configure.
927 ;; * The bundled icu headers are used in some places.
928 ;; * The version number is taken from the bundled copy.
931 ;; FIXME: A script from the bundled nspr is used.
934 ;; FIXME: With the update to IceCat 60, using system NSS
935 ;; broke certificate validation. See
936 ;; <https://bugs.gnu.org/32833>. For now, we use
937 ;; the bundled NSPR and NSS. TODO: Investigate,
938 ;; and try to unbundle these libraries again.
939 ;; UNBUNDLE-ME! "security/nss"
941 ;; TODO: Use more system media libraries. See:
942 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
943 ;; * libtheora: esr60 wants v1.2, not yet released.
944 ;; * soundtouch: avoiding the bundled library would
945 ;; result in some loss of functionality. There's
946 ;; also an issue with exception handling
947 ;; configuration. It seems that this is needed in
949 ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1
955 ;; "media/libjpeg" ; needed for now, because media/libjpeg/moz.build is referenced from config/external/moz.build
956 ;; UNBUNDLE-ME! "ipc/chromium/src/third_party/libevent"
957 ;; UNBUNDLE-ME! "media/libvpx"
958 ;; UNBUNDLE-ME! "media/libogg"
959 ;; UNBUNDLE-ME! "media/libvorbis"
960 ;; UNBUNDLE-ME! "media/libtheora" ; wants theora-1.2, not yet released
961 ;; UNBUNDLE-ME! "media/libtremor"
962 ;; UNBUNDLE-ME! "gfx/harfbuzz"
963 ;; UNBUNDLE-ME! "gfx/graphite2"
964 "js/src/ctypes/libffi"
965 ;; UNBUNDLE-ME! "db/sqlite3"
968 (add-after 'remove-bundled-libraries 'link-libxul-with-libraries
970 ;; libxul.so dynamically opens libraries, so here we explicitly
971 ;; link them into libxul.so instead.
973 ;; TODO: It might be preferable to patch in absolute file names in
974 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
975 ;; work. More investigation is needed.
976 (substitute* "toolkit/library/moz.build"
977 (("^# This library needs to be last" all)
978 (string-append "OS_LIBS += [
979 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
980 'avcodec', 'avutil', 'pulse' ]\n\n"
983 (add-after 'link-libxul-with-libraries 'fix-ffmpeg-runtime-linker
984 (lambda* (#:key inputs #:allow-other-keys)
985 (let* ((ffmpeg (assoc-ref inputs "ffmpeg"))
986 (libavcodec (string-append ffmpeg "/lib/libavcodec.so")))
987 ;; Arrange to load libavcodec.so by its absolute file name.
988 (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
991 ;; Populate the sandbox read-path whitelist as needed by ffmpeg.
992 (let* ((mime-info (assoc-ref inputs "shared-mime-info"))
993 (libavcodec-runpath (call-with-input-file libavcodec
994 (compose elf-dynamic-info-runpath
997 get-bytevector-all)))
998 (whitelist (cons (string-append mime-info "/share/mime/")
1000 (string-append dir "/"))
1001 libavcodec-runpath)))
1002 (whitelist-string (string-join whitelist ","))
1003 (port (open-file "browser/app/profile/icecat.js" "a")))
1004 (format #t "setting 'security.sandbox.content.read_path_whitelist' to '~a'~%"
1006 (format port "~%pref(\"security.sandbox.content.read_path_whitelist\", ~S);~%"
1008 (close-output-port port))
1012 (invoke "sh" "-c" "autoconf old-configure.in > old-configure")
1013 ;; 'configure' must be newer than 'old-configure.in', or else the
1014 ;; build system will raise an alarm and abort.
1015 (invoke "touch" "configure")))
1016 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1018 (use-modules (guix build cargo-utils))
1019 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
1020 (substitute* '("Cargo.lock" "gfx/wr/Cargo.lock")
1021 (("(\"checksum .* = )\".*\"" all name)
1022 (string-append name "\"" null-hash "\"")))
1023 (generate-all-checksums "third_party/rust"))
1026 ;; configure does not work followed by both "SHELL=..." and
1027 ;; "CONFIG_SHELL=..."; set environment variables instead
1028 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1029 (let* ((out (assoc-ref outputs "out"))
1030 (bash (which "bash"))
1031 (abs-srcdir (getcwd))
1032 (srcdir (string-append "../" (basename abs-srcdir)))
1033 (flags `(,(string-append "--prefix=" out)
1034 ,(string-append "--with-l10n-base="
1036 ,@configure-flags)))
1037 (setenv "SHELL" bash)
1038 (setenv "CONFIG_SHELL" bash)
1039 (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13
1040 (setenv "CC" "gcc") ; apparently needed when Stylo is enabled
1041 (setenv "MOZ_BUILD_DATE" ,%icecat-build-id) ; avoid timestamp
1044 (format #t "build directory: ~s~%" (getcwd))
1045 (format #t "configure flags: ~s~%" flags)
1047 (string-append srcdir "/configure")
1050 ;; The build system often spuriously fails. See
1051 ;; <https://bugs.gentoo.org/show_bug.cgi?id=680934>. To
1052 ;; work around this, we try the standard 'build' phase up
1055 (let ((build (assoc-ref %standard-phases 'build)))
1056 (let retry ((remaining-attempts 5))
1057 (if (= remaining-attempts 1)
1059 (guard (c ((invoke-error? c)
1060 (format #t "~%Retrying build! (~a attempts remaining)~%~%"
1061 (- remaining-attempts 1))
1063 (retry (- remaining-attempts 1))))
1064 (apply build args)))))))
1065 (add-after 'build 'neutralise-store-references
1067 ;; Mangle the store references to compilers & other build tools in
1068 ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64.
1070 "dist/bin/chrome/toolkit/content/global/buildconfig.html"
1071 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1072 (regexp-quote (%store-directory)))
1074 (string-append store
1075 (string-take hash 8)
1076 "<!-- Guix: not a runtime dependency -->"
1077 (string-drop hash 8))))
1079 (add-before 'configure 'install-desktop-entry
1080 (lambda* (#:key outputs #:allow-other-keys)
1081 ;; Install the '.desktop' file.
1082 (let* ((desktop-file "taskcluster/docker/icecat-snap/icecat.desktop")
1083 (out (assoc-ref outputs "out"))
1084 (applications (string-append out "/share/applications")))
1085 (substitute* desktop-file
1086 (("^Exec=icecat") (string-append "Exec=" out "/bin/icecat"))
1087 (("IceCat") "GNU IceCat")
1088 (("Icon=.*") "Icon=icecat\n")
1089 (("NewWindow") "new-window")
1090 (("NewPrivateWindow") "new-private-window"))
1091 (install-file desktop-file applications)
1093 (add-after 'install-desktop-entry 'install-icons
1094 (lambda* (#:key outputs #:allow-other-keys)
1095 (let ((out (assoc-ref outputs "out")))
1096 (with-directory-excursion "browser/branding/official"
1099 (let* ((size (string-filter char-numeric? file))
1100 (icons (string-append out "/share/icons/hicolor/"
1101 size "x" size "/apps")))
1103 (copy-file file (string-append icons "/icecat.png"))))
1104 '("default16.png" "default22.png" "default24.png"
1105 "default32.png" "default48.png" "content/icon64.png"
1106 "mozicon128.png" "default256.png"))
1108 ;; This fixes the file chooser crash that happens with GTK 3.
1109 (add-after 'install 'wrap-program
1110 (lambda* (#:key inputs outputs #:allow-other-keys)
1111 (let* ((out (assoc-ref outputs "out"))
1112 (lib (string-append out "/lib"))
1113 (gtk (assoc-ref inputs "gtk+"))
1114 (gtk-share (string-append gtk "/share"))
1115 (mesa (assoc-ref inputs "mesa"))
1116 (mesa-lib (string-append mesa "/lib"))
1117 (pulseaudio (assoc-ref inputs "pulseaudio"))
1118 (pulseaudio-lib (string-append pulseaudio "/lib"))
1119 (libxscrnsaver (assoc-ref inputs "libxscrnsaver"))
1120 (libxscrnsaver-lib (string-append libxscrnsaver "/lib")))
1121 (wrap-program (car (find-files lib "^icecat$"))
1122 `("XDG_DATA_DIRS" prefix (,gtk-share))
1123 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib ,mesa-lib ,libxscrnsaver-lib)))
1125 (home-page "https://www.gnu.org/software/gnuzilla/")
1126 (synopsis "Entirely free browser derived from Mozilla Firefox")
1128 "IceCat is the GNU version of the Firefox browser. It is entirely free
1129 software, which does not recommend non-free plugins and addons. It also
1130 features built-in privacy-protecting features.
1132 WARNING: IceCat 68 has not yet been released by the upstream IceCat project.
1133 This is a preview release, and does not currently meet the privacy-respecting
1134 standards of the IceCat project.")
1135 (license license:mpl2.0) ;and others, see toolkit/content/license.html
1137 `((ftp-directory . "/gnu/gnuzilla")
1138 (cpe-name . "firefox_esr")
1139 (cpe-version . ,(first (string-split version #\-)))))))
1141 ;; Update this together with icecat!
1142 (define %icedove-build-id "20200825000000") ;must be of the form YYYYMMDDhhmmss
1143 (define-public icedove
1147 (source icecat-source)
1149 `((cpe-name . "thunderbird_esr")))
1150 (build-system gnu-build-system)
1152 `(#:tests? #f ; no check target
1153 #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
1154 #:modules ((guix build utils) ;find-files
1157 ,@%gnu-build-system-modules)
1159 (modify-phases %standard-phases
1160 (add-after 'unpack 'prepare-thunderbird-sources
1161 (lambda* (#:key inputs #:allow-other-keys)
1163 (copy-recursively (assoc-ref inputs "thunderbird-sources")
1165 (delete-file-recursively "obj-x86_64-pc-linux-gnu")
1166 (delete-file "sourcestamp.txt")
1168 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1170 (use-modules (guix build cargo-utils))
1171 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
1172 (substitute* '("Cargo.lock" "gfx/wr/Cargo.lock")
1173 (("(\"checksum .* = )\".*\"" all name)
1174 (string-append name "\"" null-hash "\"")))
1175 (generate-all-checksums "third_party/rust"))
1177 ;; Fixes issue where each installation directory generates its own profile.
1178 ;; See e.g. https://trac.torproject.org/projects/tor/ticket/31457
1179 (add-after 'patch-source-shebangs 'fix-profile-setting
1181 (substitute* "comm/mail/moz.configure"
1182 (("'MOZ_DEDICATED_PROFILES', True")
1183 "'MOZ_DEDICATED_PROFILES', False"))
1185 (add-after 'prepare-thunderbird-sources 'rename-to-icedove
1187 (substitute* "comm/mail/confvars.sh"
1188 (("MOZ_APP_BASENAME=Thunderbird")
1189 "MOZ_APP_BASENAME=Icedove\nMOZ_APP_DISPLAYNAME=Icedove")
1190 (("MOZ_APP_NAME=thunderbird")
1191 "MOZ_APP_NAME=icedove")
1194 ;; Remove branding to comply with Mozilla's trademark policy
1195 (with-directory-excursion "comm/mail/branding/nightly"
1196 (delete-file "content/about-wordmark.svg")
1197 (call-with-output-file "content/about-wordmark.svg"
1199 (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg")
1200 (viewBox "0 0 789.1 90.78")
1204 (text (@ (x "400") (y "70")
1205 (text-anchor "middle")
1209 (substitute* '("locales/en-US/brand.properties"
1210 "locales/en-US/brand.ftl"
1211 "locales/en-US/brand.dtd"
1213 (("Thunderbird") "Icedove")
1214 (("mozilla.org") "guix.gnu.org")))
1215 ;; Remove other mentions of Thunderbird in user-visible text.
1216 (with-directory-excursion "comm/mail/base/content"
1217 (substitute* '("newInstallPage.xhtml"
1218 "overrides/app-license-name.html"
1220 (("Thunderbird") "Icedove")))
1221 (with-directory-excursion "comm/mail/components/"
1222 (substitute* '("mailGlue.js"
1223 "extensions/schemas/addressBook.json"
1224 "extensions/schemas/tabs.json"
1225 "extensions/schemas/cloudFile.json"
1226 "extensions/schemas/chrome_settings_overrides.json"
1227 "extensions/schemas/windows.json"
1228 "extensions/parent/ext-mail.js"
1229 "im/messages/mail/Info.plist"
1230 "enterprisepolicies/moz.build"
1231 "enterprisepolicies/helpers/moz.build"
1232 "enterprisepolicies/schemas/moz.build"
1233 "preferences/chat.inc.xul")
1234 (("Thunderbird") "Icedove")))
1235 (substitute* "comm/calendar/lightning/lightning-packager.mk"
1236 (("ifeq \\(thunderbird")
1238 (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js"
1239 "comm/mailnews/extensions/newsblog/content/feed-subscriptions.js"
1240 "comm/common/src/customizeToolbar.js")
1241 (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e)
1242 (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e)))
1244 ;; Override addon URLs and settings
1245 (substitute* "comm/mail/app/profile/all-thunderbird.js"
1246 (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m)
1247 (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");"))
1248 (("(pref\\(\"extensions.getAddons.search.url\").*" _ m)
1249 (string-append m ", \"https://guix.gnu.org/packages\");"))
1250 (("(pref\\(\"extensions.update.enabled\").*" _ m)
1251 (string-append m ", false);"))
1252 (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m)
1253 (string-append m ", false);"))
1254 (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m)
1255 (string-append m ", false);")))
1257 (add-after 'build 'neutralize-store-references
1259 ;; Mangle the store references to compilers & other build tools in
1260 ;; about:buildconfig, reducing Icedove's closure significant.
1261 ;; The resulting files are saved in lib/thunderbird/omni.ja
1263 ;; Use find because the path "obj-x86_64-pc-linux-gnu" contains
1264 ;; the architecture and the system -> more complicated.
1265 (find-files "." "buildconfig.html")
1266 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1267 (regexp-quote (%store-directory)))
1269 (string-append store
1270 (string-take hash 8)
1271 "<!-- Guix: not a runtime dependency -->"
1272 (string-drop hash 8))))
1275 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
1276 (let* ((out (assoc-ref outputs "out"))
1277 (bash (which "bash"))
1278 (abs-srcdir (getcwd))
1279 (srcdir (string-append "../" (basename abs-srcdir)))
1280 (flags `(,(string-append "--prefix=" out)
1282 (mozconfig (string-append (getcwd) "/.mozconfig")))
1283 (setenv "SHELL" bash)
1285 (string-append (assoc-ref %build-inputs
1288 (setenv "CONFIG_SHELL" bash)
1289 (setenv "QA_CONFIGURE_OPTIONS" ".*")
1290 (setenv "MOZBUILD_STATE_PATH"
1291 (string-append (getcwd) "/mach_state"))
1293 (string-append (getcwd) "/.mozconfig"))
1295 (setenv "MOZ_NOSPAM" "1")
1297 (string-append (assoc-ref inputs "python2")
1299 (setenv "MOZ_BUILD_DATE" ,%icedove-build-id) ; avoid timestamp
1300 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1301 (assoc-ref outputs "out")
1303 (mkdir-p (string-append (getcwd) "/builddir"))
1304 (with-output-to-file mozconfig
1308 "ac_add_options --disable-crashreporter\n"
1309 "ac_add_options --disable-debug\n"
1310 "ac_add_options --disable-debug-symbols\n"
1311 "ac_add_options --disable-elf-hack\n"
1312 "ac_add_options --disable-gconf\n"
1313 "ac_add_options --disable-ion\n"
1314 "ac_add_options --disable-necko-wifi\n"
1315 "ac_add_options --disable-official-branding\n"
1316 "ac_add_options --disable-tests\n"
1317 "ac_add_options --disable-updater\n"
1318 "ac_add_options --disable-webrtc\n"
1319 "ac_add_options --enable-application=comm/mail\n"
1320 "ac_add_options --enable-calendar\n"
1321 "ac_add_options --enable-content-sandbox\n"
1322 "ac_add_options --enable-default-toolkit=\"cairo-gtk3\"\n"
1323 "ac_add_options --enable-optimize\n"
1324 "ac_add_options --enable-pulseaudio\n"
1325 "ac_add_options --enable-release\n"
1326 "ac_add_options --enable-startup-notification\n"
1327 "ac_add_options --enable-strip\n"
1328 "ac_add_options --enable-system-ffi\n"
1329 "ac_add_options --enable-system-pixman\n"
1330 "ac_add_options --enable-system-sqlite\n"
1331 "ac_add_options --prefix=" out "\n"
1332 "ac_add_options --with-clang-path=" (assoc-ref %build-inputs "clang") "/bin/clang\n"
1333 "ac_add_options --with-distribution-id=org.gnu\n"
1334 "ac_add_options --with-libclang-path=" (assoc-ref %build-inputs "clang") "/lib\n"
1335 "ac_add_options --with-system-bz2\n"
1336 "ac_add_options --with-system-icu\n"
1337 "ac_add_options --with-system-jpeg\n"
1338 "ac_add_options --with-system-libevent\n"
1339 "ac_add_options --with-system-nspr\n"
1340 "ac_add_options --with-system-nss\n"
1341 "ac_add_options --with-system-zlib\n"
1342 "ac_add_options --with-user-appdir=\\.icedove\n"))))
1345 (display "mach configure")
1346 (invoke "./mach" "configure"))))
1348 (lambda _ (invoke "./mach" "build")))
1350 (lambda _ (invoke "./mach" "install")))
1351 ;; Thunderbird doesn't provide any .desktop file.
1352 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
1353 (add-after 'install 'install-desktop-file
1354 (lambda* (#:key outputs #:allow-other-keys)
1355 (let* ((out (assoc-ref outputs "out"))
1356 (apps (string-append out "/share/applications")))
1358 (with-output-to-file (string-append apps "/icedove.desktop")
1363 Exec=~a/bin/icedove~@
1365 GenericName=Mail/News Client~@
1366 Categories=Network;Email;~@
1368 StartupNotify=true~@
1369 MimeType=x-scheme-handler/mailto;~@
1371 Actions=ComposeMessage;~@
1372 [Desktop Action ComposeMessage]~@
1373 Name=Write new message~@
1374 Exec=~@*~a/bin/icedove -compose~%"
1377 (add-after 'install 'wrap-program
1378 (lambda* (#:key inputs outputs #:allow-other-keys)
1379 (let* ((out (assoc-ref outputs "out"))
1380 (lib (string-append out "/lib"))
1381 (gtk (assoc-ref inputs "gtk+"))
1382 (gtk-share (string-append gtk "/share"))
1383 (pulseaudio (assoc-ref inputs "pulseaudio"))
1384 (pulseaudio-lib (string-append pulseaudio "/lib")))
1385 (wrap-program (car (find-files lib "^icedove$"))
1386 `("XDG_DATA_DIRS" prefix (,gtk-share))
1387 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib)))
1393 ("dbus-glib" ,dbus-glib)
1395 ("freetype" ,freetype)
1396 ("gdk-pixbuf" ,gdk-pixbuf)
1400 ("hunspell" ,hunspell)
1402 ("libcanberra" ,libcanberra)
1403 ("libevent" ,libevent)
1405 ("libgnome" ,libgnome)
1406 ("libjpeg-turbo" ,libjpeg-turbo)
1407 ("libpng-apng" ,libpng-apng)
1409 ("libxcomposite" ,libxcomposite)
1411 ("libxinerama" ,libxinerama)
1412 ("libxscrnsaver" ,libxscrnsaver)
1415 ("mit-krb5" ,mit-krb5)
1420 ("pulseaudio" ,pulseaudio)
1422 ("startup-notification" ,startup-notification)
1427 `(("thunderbird-sources"
1428 ;; The changeset identifier is taken from the file "sourcestamp.txt"
1429 ;; in the Thunderbird release tarball. We don't use the release
1430 ;; tarball because it duplicates the Icecat sources and only adds the
1431 ;; "comm" directory, which is provided by this repository.
1432 ,(let ((changeset "b41cdff70b185358d9c4c1d4a36cfad15a24f001"))
1436 (url "https://hg.mozilla.org/releases/comm-esr68")
1437 (changeset changeset)))
1438 (file-name (string-append "thunderbird-" version "-checkout"))
1441 "1xvky8p5r41mxdyg9amydy94p51wmmdwdz0zq2vzspr9viixf7xm")))))
1442 ("autoconf" ,autoconf-2.13)
1443 ("cargo" ,rust "cargo")
1449 ("pkg-config" ,pkg-config)
1451 ("python2" ,python-2.7)
1453 ("rust-cbindgen" ,rust-cbindgen)
1456 (home-page "https://www.thunderbird.net")
1457 (synopsis "Rebranded Mozilla Thunderbird email client")
1459 "This package provides an email client built based on Mozilla
1460 Thunderbird. It supports email, news feeds, chat, calendar and contacts.")
1461 (license license:mpl2.0)))
1463 (define-public firefox-decrypt
1465 (name "firefox-decrypt")
1470 (url "https://github.com/Unode/firefox_decrypt")
1472 (file-name (git-file-name name version))
1475 "17yyyxp47z4m8hnflcq34rc1y871515kr3f1y42j1l0yx3g0il07"))))
1476 (build-system trivial-build-system)
1479 ("python" ,python)))
1481 `(#:modules ((guix build utils))
1484 (use-modules (guix build utils))
1487 (assoc-ref %build-inputs "python") "/bin"))
1488 (copy-file (string-append (assoc-ref %build-inputs "source")
1489 "/firefox_decrypt.py")
1490 "firefox_decrypt.py")
1491 (substitute* "firefox_decrypt.py"
1492 (("/usr/bin/env python") (which "python3"))
1493 (("libnss3.so") (string-append (assoc-ref %build-inputs "nss")
1494 "/lib/nss/libnss3.so")))
1495 (install-file "firefox_decrypt.py" (string-append %output "/bin"))
1497 (home-page "https://github.com/Unode/firefox_decrypt/")
1498 (synopsis "Tool to extract passwords from Mozilla profiles")
1499 (description "Firefox Decrypt is a tool to extract passwords from
1500 Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.")
1501 (license license:gpl3+)))