gnu: go: Update to 1.14.4.
[jackhill/guix/guix.git] / gnu / packages / gnuzilla.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 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>
17 ;;;
18 ;;; This file is part of GNU Guix.
19 ;;;
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.
24 ;;;
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.
29 ;;;
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/>.
32
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))
87
88 (define-public mozjs
89 (package
90 (name "mozjs")
91 (version "17.0.0")
92 (source (origin
93 (method url-fetch)
94 (uri (string-append
95 "https://ftp.mozilla.org/pub/mozilla.org/js/"
96 name version ".tar.gz"))
97 (sha256
98 (base32
99 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))
100 (patches (search-patches "mozjs17-aarch64-support.patch"))
101 (modules '((guix build utils)))
102 (snippet
103 ;; Fix incompatibility with Perl 5.22+.
104 '(begin
105 (substitute* '("js/src/config/milestone.pl")
106 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE"))
107 #t))))
108 (build-system gnu-build-system)
109 (native-inputs
110 `(("perl" ,perl)
111 ("pkg-config" ,pkg-config)
112 ("python" ,python-2)))
113 (propagated-inputs
114 `(("nspr" ,nspr))) ; in the Requires.private field of mozjs-17.0.pc
115 (inputs
116 `(("zlib" ,zlib)))
117 (arguments
118 `(;; XXX: parallel build fails, lacking:
119 ;; mkdir -p "system_wrapper_js/"
120 #:parallel-build? #f
121 #:make-flags '("CXXFLAGS=-fpermissive")
122 #:phases
123 (modify-phases %standard-phases
124 (add-after 'unpack 'delete-timedout-test
125 ;; This test times out on slower hardware.
126 (lambda _
127 (delete-file "js/src/jit-test/tests/basic/bug698584.js")
128 #t))
129 (add-before 'configure 'chdir
130 (lambda _
131 (chdir "js/src")
132 #t))
133 (replace 'configure
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"
141 (%current-system))
142 '("--host=aarch64-unknown-linux-gnu")
143 '()))))))))
144 (home-page
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
148 in C/C++.")
149 (license license:mpl2.0))) ; and others for some files
150
151 (define-public mozjs-24
152 (package (inherit mozjs)
153 (name "mozjs")
154 (version "24.2.0")
155 (source (origin
156 (method url-fetch)
157 (uri (string-append
158 "https://ftp.mozilla.org/pub/mozilla.org/js/"
159 name "-" version ".tar.bz2"))
160 (sha256
161 (base32
162 "1n1phk8r3l8icqrrap4czplnylawa0ddc2cc4cgdz46x3lrkybz6"))
163 (modules '((guix build utils)))
164 (patches (search-patches "mozjs24-aarch64-support.patch"))
165 (snippet
166 ;; Fix incompatibility with Perl 5.22+.
167 '(begin
168 (substitute* '("js/src/config/milestone.pl")
169 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE"))
170 #t))))
171 (arguments
172 (substitute-keyword-arguments (package-arguments mozjs)
173 ((#:phases phases)
174 `(modify-phases ,phases
175 (replace 'configure
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)
183 "--with-system-nspr"
184 "--enable-system-ffi"
185 "--enable-threadsafe"
186 ,@(if (string=? "aarch64-linux"
187 (%current-system))
188 '("--host=aarch64-unknown-linux-gnu")
189 '())))))))))
190 (inputs
191 `(("libffi" ,libffi)
192 ("zlib" ,zlib)))))
193
194 (define-public mozjs-38
195 (package
196 (inherit mozjs)
197 (name "mozjs")
198 (version "38.2.1.rc0")
199 (source (origin
200 (method url-fetch)
201 (uri (string-append
202 "https://anduin.linuxfromscratch.org/BLFS/mozjs/"
203 name "-" version ".tar.bz2"))
204 (sha256
205 (base32
206 "0p4bmbpgkfsj54xschcny0a118jdrdgg0q29rwxigg3lh5slr681"))
207 (patches
208 (search-patches
209 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1269317 for
210 ;; GCC 6 compatibility.
211
212 "mozjs38-version-detection.patch" ; for 0ad
213 "mozjs38-tracelogger.patch"
214
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)))
219 (snippet
220 '(begin
221 ;; Fix incompatibility with sed 4.4.
222 (substitute* "js/src/configure"
223 (("\\^\\[:space:\\]") "^[[:space:]]"))
224
225 ;; The headers are symlinks to files that are in /tmp, so they
226 ;; end up broken. Copy them instead.
227 (substitute*
228 "python/mozbuild/mozbuild/backend/recursivemake.py"
229 (("\\['dist_include'\\].add_symlink")
230 "['dist_include'].add_copy"))
231
232 ;; Remove bundled libraries.
233 (for-each delete-file-recursively
234 '("intl"
235 "js/src/ctypes/libffi"
236 "js/src/ctypes/libffi-patches"
237 "modules/zlib"))
238 #t))))
239 (arguments
240 `(;; XXX: parallel build fails, lacking:
241 ;; mkdir -p "system_wrapper_js/"
242 #:parallel-build? #f
243 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1008470.
244 #:tests? #f
245 #:phases
246 (modify-phases %standard-phases
247 (replace 'configure
248 (lambda* (#:key outputs #:allow-other-keys)
249 (let ((out (assoc-ref outputs "out")))
250 (chdir "js/src")
251 (setenv "SHELL" (which "sh"))
252 (setenv "CONFIG_SHELL" (which "sh"))
253 (invoke "./configure"
254 (string-append "--prefix=" out)
255 "--enable-ctypes"
256 "--enable-gcgenerational"
257 "--enable-optimize"
258 "--enable-pie"
259 "--enable-readline"
260 "--enable-shared-js"
261 "--enable-system-ffi"
262 "--enable-threadsafe"
263 "--enable-xterm-updates"
264 "--with-system-icu"
265 "--with-system-nspr"
266 "--with-system-zlib"
267
268 ;; Intl API requires bundled ICU.
269 "--without-intl-api")))))))
270 (native-inputs
271 `(("perl" ,perl)
272 ("pkg-config" ,pkg-config)
273 ("python-2" ,python-2)))
274 (inputs
275 `(("libffi" ,libffi)
276 ("readline" ,readline)
277 ("icu4c" ,icu4c)
278 ("zlib" ,zlib)))))
279
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")
286 (revision "1"))
287 (package (inherit mozjs-38)
288 (version (git-version "52.0" revision commit))
289 (source (origin
290 (method git-fetch)
291 (uri (git-reference
292 (url "https://salsa.debian.org/gnome-team/mozjs52.git")
293 (commit commit)))
294 (file-name (git-file-name "mozjs" version))
295 (sha256
296 (base32
297 "1ny0s53r8wn4byys87h784xrq1xg767akmfm6gqrbvrz57mlm3q2"))))
298 (arguments
299 `(#:tests? #f ; depends on repository metadata
300 #:configure-flags
301 '("--enable-ctypes"
302 "--enable-optimize"
303 "--enable-pie"
304 "--enable-readline"
305 "--enable-shared-js"
306 "--enable-system-ffi"
307 "--with-system-icu"
308 "--with-system-nspr"
309 "--with-system-zlib"
310
311 ;; Intl API requires bundled ICU.
312 "--without-intl-api"
313
314 ;; Without this gnome-shell will crash at runtime.
315 "--disable-jemalloc")
316 #:phases
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")
330 (chdir "js/src")
331 #t))
332 (replace 'configure
333 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
334 ;; The configure script does not accept environment variables
335 ;; as arguments.
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")
340 "/bin/autoconf"))
341 (apply invoke "./configure"
342 (cons (string-append "--prefix=" out)
343 configure-flags))))))))
344 (native-inputs
345 `(("autoconf" ,autoconf-2.13)
346 ("automake" ,automake)
347 ,@(package-native-inputs mozjs-38))))))
348
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.
354 (package
355 (inherit mozjs-38)
356 (version "60.2.3-2")
357 (source (origin
358 (method git-fetch)
359 (uri (git-reference
360 (url "https://salsa.debian.org/gnome-team/mozjs60.git")
361 (commit (string-append "debian/" version))))
362 (file-name (git-file-name "mozjs" version))
363 (sha256
364 (base32
365 "091w050rwzrdcbgyi934k2viyccmlqxrp13sm2mql71mabb5dai6"))))
366 (arguments
367 `(#:tests? #f ; FIXME: all tests pass, but then the check phase fails anyway.
368 #:test-target "check-jstests"
369 #:configure-flags
370 '("--enable-ctypes"
371 "--enable-optimize"
372 "--enable-pie"
373 "--enable-readline"
374 "--enable-shared-js"
375 "--enable-system-ffi"
376 "--with-system-nspr"
377 "--with-system-zlib"
378 "--with-system-icu"
379 "--with-intl-api"
380 ;; This is important because without it gjs will segfault during the
381 ;; configure phase. With jemalloc only the standalone mozjs console
382 ;; will work.
383 "--disable-jemalloc")
384 #:phases
385 (modify-phases %standard-phases
386 (replace 'configure
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")
397 "/bin/autoconf"))
398 (apply invoke "../js/src/configure"
399 (cons (string-append "--prefix=" out)
400 configure-flags))
401 #t)))
402 (add-after 'unpack 'disable-broken-tests
403 (lambda _
404 ;; This test assumes that /bin exists and contains certain
405 ;; executables.
406 (delete-file "js/src/tests/shell/os.js")
407 #t)))))
408 (native-inputs
409 `(("autoconf" ,autoconf)
410 ("automake" ,automake)
411 ("which" ,which)
412 ("perl" ,perl)
413 ("pkg-config" ,pkg-config)
414 ("python" ,python-2)))))
415
416 (define mozilla-compare-locales
417 (origin
418 (method hg-fetch)
419 (uri (hg-reference
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"))))
424
425 (define (mozilla-locale locale changeset hash-string)
426 (origin
427 (method hg-fetch)
428 (uri (hg-reference
429 (url (string-append "https://hg.mozilla.org/l10n-central/"
430 locale))
431 (changeset changeset)))
432 (file-name (string-append "mozilla-locale-" locale))
433 (sha256 (base32 hash-string))))
434
435 (define-syntax-rule (mozilla-locales (hash-string changeset locale) ...)
436 (list (mozilla-locale locale changeset hash-string)
437 ...))
438
439 (define all-mozilla-locales
440 (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")))
536
537 (define (mozilla-patch file-name changeset hash)
538 "Return an origin for CHANGESET from the mozilla-esr60 repository."
539 (origin
540 (method url-fetch)
541 (uri (string-append "https://hg.mozilla.org/releases/mozilla-esr60/raw-rev/"
542 changeset))
543 (sha256 (base32 hash))
544 (file-name file-name)))
545
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")
554 (force gexp-promise)
555 #:graft? #f ;nothing to graft
556 #:system system
557 #:guile-for-build guile)))
558
559 (define %icecat-version "68.9.0-guix0-preview1")
560 (define %icecat-build-id "20200602000000") ;must be of the form YYYYMMDDhhmmss
561
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 #\-)))
567
568 (major-version (first (string-split base-version #\.)))
569 (minor-version (second (string-split base-version #\.)))
570 (sub-version (third (string-split base-version #\.)))
571
572 (upstream-firefox-version (string-append base-version "esr"))
573 (upstream-firefox-source
574 (origin
575 (method url-fetch)
576 (uri (string-append
577 "https://ftp.mozilla.org/pub/firefox/releases/"
578 upstream-firefox-version "/source/"
579 "firefox-" upstream-firefox-version ".source.tar.xz"))
580 (sha256
581 (base32
582 "01s41p985g6v544lf08zch3myssn5c76jwmkzzd68zd9m3hhalck"))))
583
584 (upstream-icecat-base-version "68.9.0") ; maybe older than base-version
585 ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version))
586 (gnuzilla-commit "d7acf32ad905a3382cb2353577a96d29aa58f589")
587 (gnuzilla-source
588 (origin
589 (method git-fetch)
590 (uri (git-reference
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)))
596 (sha256
597 (base32
598 "0m49zm05m3n95diij2zyvpm74q66zxjhv9rp8zvaab0h7v2s09n9"))))
599
600 (makeicecat-patch
601 (local-file (search-patch "icecat-makeicecat.patch")))
602 (gnuzilla-fixes-patch
603 (local-file (search-patch "icecat-use-older-reveal-hidden-html.patch"))))
604
605 (origin
606 (method computed-origin-method)
607 (file-name (string-append "icecat-" %icecat-version ".tar.xz"))
608 (sha256 #f)
609 (uri
610 (delay
611 (with-imported-modules '((guix build utils))
612 #~(begin
613 (use-modules (guix build utils))
614 (let ((firefox-dir
615 (string-append "firefox-" #$base-version))
616 (icecat-dir
617 (string-append "icecat-" #$%icecat-version)))
618
619 (mkdir "/tmp/bin")
620 (set-path-environment-variable
621 "PATH" '("bin")
622 (list "/tmp"
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)
633 #+rename))
634
635 (symlink #+(file-append rename "/bin/rename")
636 "/tmp/bin/prename")
637
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"))
644
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
652 ;; Remove the bundled tortm-browser-button extension,
653 ;; which doesn't seem to be working properly.
654 (delete-file-recursively
655 "data/extensions/tortm-browser-button@jeremybenthum")
656
657 (patch-shebang "makeicecat")
658 (substitute* "makeicecat"
659 (("^FFMAJOR=(.*)" all ffmajor)
660 (unless (string=? #$major-version
661 (string-trim-both ffmajor))
662 ;; The makeicecat script cannot be expected to work
663 ;; properly on a different version of Firefox, even if
664 ;; no errors occur during execution.
665 (error "makeicecat major version mismatch"))
666 (string-append "FFMAJOR=" #$major-version "\n"))
667 (("^FFMINOR=.*")
668 (string-append "FFMINOR=" #$minor-version "\n"))
669 (("^FFSUB=.*")
670 (string-append "FFSUB=" #$sub-version "\n"))
671 (("^DATA=.*")
672 "DATA=/tmp/gnuzilla/data\n")
673 (("/bin/sed")
674 #+(file-append (canonical-package sed) "/bin/sed"))))
675
676 (format #t "Unpacking upstream firefox tarball...~%")
677 (force-output)
678 (invoke "tar" "xf" #+upstream-firefox-source)
679 (rename-file firefox-dir icecat-dir)
680
681 (with-directory-excursion icecat-dir
682 (format #t "Populating l10n directory...~%")
683 (force-output)
684 (mkdir "l10n")
685 (with-directory-excursion "l10n"
686 (for-each
687 (lambda (locale-dir)
688 (let ((locale
689 (string-drop (basename locale-dir)
690 (+ 32 ; length of hash
691 (string-length "-mozilla-locale-")))))
692 (format #t " ~a~%" locale)
693 (force-output)
694 (copy-recursively locale-dir locale
695 #:log (%make-void-port "w"))
696 (for-each make-file-writable (find-files locale))
697 (with-directory-excursion locale
698 (when (file-exists? ".hgtags")
699 (delete-file ".hgtags"))
700 (mkdir-p "browser/chrome/browser/preferences")
701 (call-with-output-file
702 "browser/chrome/browser/preferences/advanced-scripts.dtd"
703 (lambda (port) #f)))))
704 '#+all-mozilla-locales)
705 (copy-recursively #+mozilla-compare-locales
706 "compare-locales"
707 #:log (%make-void-port "w"))
708 (delete-file "compare-locales/.gitignore")
709 (delete-file "compare-locales/.hgignore")
710 (delete-file "compare-locales/.hgtags"))
711
712 (format #t "Running makeicecat script...~%")
713 (force-output)
714 (invoke "bash" "/tmp/gnuzilla/makeicecat"))
715
716 (format #t "Packing IceCat source tarball...~%")
717 (force-output)
718 (invoke "tar" "cfa" #$output
719 ;; Avoid non-determinism in the archive. We set the
720 ;; mtime of files in the archive to early 1980 because
721 ;; the build process fails if the mtime of source
722 ;; files is pre-1980, due to the creation of zip
723 ;; archives.
724 "--mtime=@315619200" ; 1980-01-02 UTC
725 "--owner=root:0"
726 "--group=root:0"
727 "--sort=name"
728 icecat-dir)
729
730 #t))))))))
731
732 (define-public icecat
733 (package
734 (name "icecat")
735 (version %icecat-version)
736 (source icecat-source)
737 (build-system gnu-build-system)
738 (inputs
739 `(("alsa-lib" ,alsa-lib)
740 ("bzip2" ,bzip2)
741 ("cups" ,cups)
742 ("dbus-glib" ,dbus-glib)
743 ("gdk-pixbuf" ,gdk-pixbuf)
744 ("glib" ,glib)
745 ("gtk+" ,gtk+)
746 ("gtk+-2" ,gtk+-2)
747 ("graphite2" ,graphite2)
748 ("pango" ,pango)
749 ("freetype" ,freetype)
750 ("harfbuzz" ,harfbuzz)
751 ("libcanberra" ,libcanberra)
752 ("libgnome" ,libgnome)
753 ("libjpeg-turbo" ,libjpeg-turbo)
754 ("libogg" ,libogg)
755 ;; ("libtheora" ,libtheora) ; wants theora-1.2, not yet released
756 ("libvorbis" ,libvorbis)
757 ("libxft" ,libxft)
758 ("libevent" ,libevent)
759 ("libxinerama" ,libxinerama)
760 ("libxscrnsaver" ,libxscrnsaver)
761 ("libxcomposite" ,libxcomposite)
762 ("libxt" ,libxt)
763 ("libffi" ,libffi)
764 ("ffmpeg" ,ffmpeg)
765 ("libvpx" ,libvpx)
766 ("icu4c" ,icu4c)
767 ("pixman" ,pixman)
768 ("pulseaudio" ,pulseaudio)
769 ("mesa" ,mesa)
770 ("mit-krb5" ,mit-krb5)
771 ;; See <https://bugs.gnu.org/32833>
772 ;; and related comments in the 'remove-bundled-libraries' phase.
773 ;; UNBUNDLE-ME! ("nspr" ,nspr)
774 ;; UNBUNDLE-ME! ("nss" ,nss)
775 ("shared-mime-info" ,shared-mime-info)
776 ("sqlite" ,sqlite)
777 ("startup-notification" ,startup-notification)
778 ("unzip" ,unzip)
779 ("zip" ,zip)
780 ("zlib" ,zlib)))
781 (native-inputs
782 ;; The following patches are specific to the Guix packaging of IceCat,
783 ;; and therefore we prefer to leave them out of 'source', which should be
784 ;; a tarball suitable for compilation on any system that IceCat supports.
785 ;; (Bug fixes and security fixes, however, should go in 'source').
786 `(;; XXX TODO: Adapt these patches to IceCat 68.
787 ;; ("icecat-avoid-bundled-libraries.patch"
788 ;; ,(search-patch "icecat-avoid-bundled-libraries.patch"))
789 ;; ("icecat-use-system-graphite2+harfbuzz.patch"
790 ;; ,(search-patch "icecat-use-system-graphite2+harfbuzz.patch"))
791 ;; ("icecat-use-system-media-libs.patch"
792 ;; ,(search-patch "icecat-use-system-media-libs.patch"))
793
794 ("patch" ,(canonical-package patch))
795
796 ("rust" ,rust)
797 ("cargo" ,rust "cargo")
798 ("rust-cbindgen" ,rust-cbindgen)
799 ("llvm" ,llvm)
800 ("clang" ,clang)
801 ("perl" ,perl)
802 ("node" ,node)
803 ("python" ,python)
804 ("python-2" ,python-2)
805 ("python2-pysqlite" ,python2-pysqlite)
806 ("yasm" ,yasm)
807 ("nasm" ,nasm) ; XXX FIXME: only needed on x86_64 and i686
808 ("pkg-config" ,pkg-config)
809 ("autoconf" ,autoconf-2.13)
810 ("which" ,which)))
811 (arguments
812 `(#:tests? #f ; no check target
813 #:out-of-source? #t ; must be built outside of the source directory
814
815 ;; XXX: There are RUNPATH issues such as
816 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
817 ;; which is not in its RUNPATH, but they appear to be harmless in
818 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
819 #:validate-runpath? #f
820
821 #:configure-flags `("--enable-default-toolkit=cairo-gtk3"
822
823 "--with-distribution-id=org.gnu"
824
825 ;; Do not require addons in the global app
826 ;; directory to be signed by Mozilla.
827 "--with-unsigned-addon-scopes=app"
828
829 "--enable-startup-notification"
830 "--enable-pulseaudio"
831
832 "--disable-tests"
833 "--disable-updater"
834 "--disable-crashreporter"
835 "--disable-eme"
836 "--disable-gconf"
837
838 ;; Building with debugging symbols takes ~5GiB, so
839 ;; disable it.
840 "--disable-debug"
841 "--disable-debug-symbols"
842
843 ;; Clang is needed to build Stylo, Mozilla's new
844 ;; CSS engine. We must specify the clang paths
845 ;; manually, because otherwise the Mozilla build
846 ;; system looks in the directories returned by
847 ;; llvm-config --bindir and llvm-config --libdir,
848 ;; which return paths in the llvm package where
849 ;; clang is not found.
850 ,(string-append "--with-clang-path="
851 (assoc-ref %build-inputs "clang")
852 "/bin/clang")
853 ,(string-append "--with-libclang-path="
854 (assoc-ref %build-inputs "clang")
855 "/lib")
856
857 ;; Hack to work around missing
858 ;; "unofficial" branding in icecat.
859 "--enable-official-branding"
860
861 ;; Avoid bundled libraries.
862 "--with-system-zlib"
863 "--with-system-bz2"
864 "--with-system-jpeg" ; must be libjpeg-turbo
865 ;; UNBUNDLE-ME! "--with-system-libevent"
866 ;; UNBUNDLE-ME! "--with-system-ogg"
867 ;; UNBUNDLE-ME! "--with-system-vorbis"
868 ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released
869 ;; UNBUNDLE-ME! "--with-system-libvpx"
870 "--with-system-icu"
871
872 ;; See <https://bugs.gnu.org/32833>
873 ;; and related comments in the
874 ;; 'remove-bundled-libraries' phase below.
875 ;; UNBUNDLE-ME! "--with-system-nspr"
876 ;; UNBUNDLE-ME! "--with-system-nss"
877
878 ;; UNBUNDLE-ME! "--with-system-harfbuzz"
879 ;; UNBUNDLE-ME! "--with-system-graphite2"
880 "--enable-system-pixman"
881 "--enable-system-ffi"
882 ;; UNBUNDLE-ME! "--enable-system-sqlite"
883
884 ;; Fails with "--with-system-png won't work because
885 ;; the system's libpng doesn't have APNG support".
886 ;; According to
887 ;; http://sourceforge.net/projects/libpng-apng/ ,
888 ;; "the Animated Portable Network Graphics (APNG)
889 ;; is an unofficial extension of the Portable
890 ;; Network Graphics (PNG) format";
891 ;; we probably do not wish to support it.
892 ;; "--with-system-png"
893 )
894
895 #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
896
897 #:modules ((ice-9 ftw)
898 (ice-9 rdelim)
899 (ice-9 regex)
900 (ice-9 match)
901 (srfi srfi-34)
902 (srfi srfi-35)
903 (rnrs bytevectors)
904 (rnrs io ports)
905 (guix elf)
906 (guix build gremlin)
907 ,@%gnu-build-system-modules)
908 #:phases
909 (modify-phases %standard-phases
910 (add-after 'unpack 'apply-guix-specific-patches
911 (lambda* (#:key inputs native-inputs #:allow-other-keys)
912 (let ((patch (string-append (assoc-ref (or native-inputs inputs)
913 "patch")
914 "/bin/patch")))
915 (for-each (match-lambda
916 ((label . file)
917 (when (and (string-prefix? "icecat-" label)
918 (string-suffix? ".patch" label))
919 (format #t "applying '~a'...~%" file)
920 (invoke patch "--force" "--no-backup-if-mismatch"
921 "-p1" "--input" file))))
922 (or native-inputs inputs)))
923 #t))
924 (add-after 'apply-guix-specific-patches 'remove-bundled-libraries
925 (lambda _
926 ;; Remove bundled libraries that we don't use, since they may
927 ;; contain unpatched security flaws, they waste disk space and
928 ;; memory, and may cause confusion.
929 (for-each (lambda (file)
930 (format #t "deleting '~a'...~%" file)
931 (delete-file-recursively file))
932 '(;; FIXME: Removing the bundled icu breaks configure.
933 ;; * The bundled icu headers are used in some places.
934 ;; * The version number is taken from the bundled copy.
935 ;;"intl/icu"
936 ;;
937 ;; FIXME: A script from the bundled nspr is used.
938 ;;"nsprpub"
939 ;;
940 ;; FIXME: With the update to IceCat 60, using system NSS
941 ;; broke certificate validation. See
942 ;; <https://bugs.gnu.org/32833>. For now, we use
943 ;; the bundled NSPR and NSS. TODO: Investigate,
944 ;; and try to unbundle these libraries again.
945 ;; UNBUNDLE-ME! "security/nss"
946 ;;
947 ;; TODO: Use more system media libraries. See:
948 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
949 ;; * libtheora: esr60 wants v1.2, not yet released.
950 ;; * soundtouch: avoiding the bundled library would
951 ;; result in some loss of functionality. There's
952 ;; also an issue with exception handling
953 ;; configuration. It seems that this is needed in
954 ;; some moz.build:
955 ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1
956 ;; * libopus
957 ;; * speex
958 ;;
959 "modules/freetype2"
960 "modules/zlib"
961 ;; "media/libjpeg" ; needed for now, because media/libjpeg/moz.build is referenced from config/external/moz.build
962 ;; UNBUNDLE-ME! "ipc/chromium/src/third_party/libevent"
963 ;; UNBUNDLE-ME! "media/libvpx"
964 ;; UNBUNDLE-ME! "media/libogg"
965 ;; UNBUNDLE-ME! "media/libvorbis"
966 ;; UNBUNDLE-ME! "media/libtheora" ; wants theora-1.2, not yet released
967 ;; UNBUNDLE-ME! "media/libtremor"
968 ;; UNBUNDLE-ME! "gfx/harfbuzz"
969 ;; UNBUNDLE-ME! "gfx/graphite2"
970 "js/src/ctypes/libffi"
971 ;; UNBUNDLE-ME! "db/sqlite3"
972 ))
973 #t))
974 (add-after 'remove-bundled-libraries 'link-libxul-with-libraries
975 (lambda _
976 ;; libxul.so dynamically opens libraries, so here we explicitly
977 ;; link them into libxul.so instead.
978 ;;
979 ;; TODO: It might be preferable to patch in absolute file names in
980 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
981 ;; work. More investigation is needed.
982 (substitute* "toolkit/library/moz.build"
983 (("^# This library needs to be last" all)
984 (string-append "OS_LIBS += [
985 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
986 'avcodec', 'avutil', 'pulse' ]\n\n"
987 all)))
988 #t))
989 (add-after 'link-libxul-with-libraries 'fix-ffmpeg-runtime-linker
990 (lambda* (#:key inputs #:allow-other-keys)
991 (let* ((ffmpeg (assoc-ref inputs "ffmpeg"))
992 (libavcodec (string-append ffmpeg "/lib/libavcodec.so")))
993 ;; Arrange to load libavcodec.so by its absolute file name.
994 (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
995 (("libavcodec\\.so")
996 libavcodec))
997 ;; Populate the sandbox read-path whitelist as needed by ffmpeg.
998 (let* ((mime-info (assoc-ref inputs "shared-mime-info"))
999 (libavcodec-runpath (call-with-input-file libavcodec
1000 (compose elf-dynamic-info-runpath
1001 elf-dynamic-info
1002 parse-elf
1003 get-bytevector-all)))
1004 (whitelist (cons (string-append mime-info "/share/mime/")
1005 (map (lambda (dir)
1006 (string-append dir "/"))
1007 libavcodec-runpath)))
1008 (whitelist-string (string-join whitelist ","))
1009 (port (open-file "browser/app/profile/icecat.js" "a")))
1010 (format #t "setting 'security.sandbox.content.read_path_whitelist' to '~a'~%"
1011 whitelist-string)
1012 (format port "~%pref(\"security.sandbox.content.read_path_whitelist\", ~S);~%"
1013 whitelist-string)
1014 (close-output-port port))
1015 #t)))
1016 (replace 'bootstrap
1017 (lambda _
1018 (invoke "sh" "-c" "autoconf old-configure.in > old-configure")
1019 ;; 'configure' must be newer than 'old-configure.in', or else the
1020 ;; build system will raise an alarm and abort.
1021 (invoke "touch" "configure")))
1022 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1023 (lambda _
1024 (use-modules (guix build cargo-utils))
1025 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
1026 (substitute* '("Cargo.lock" "gfx/wr/Cargo.lock")
1027 (("(\"checksum .* = )\".*\"" all name)
1028 (string-append name "\"" null-hash "\"")))
1029 (generate-all-checksums "third_party/rust"))
1030 #t))
1031 (replace 'configure
1032 ;; configure does not work followed by both "SHELL=..." and
1033 ;; "CONFIG_SHELL=..."; set environment variables instead
1034 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1035 (let* ((out (assoc-ref outputs "out"))
1036 (bash (which "bash"))
1037 (abs-srcdir (getcwd))
1038 (srcdir (string-append "../" (basename abs-srcdir)))
1039 (flags `(,(string-append "--prefix=" out)
1040 ,(string-append "--with-l10n-base="
1041 abs-srcdir "/l10n")
1042 ,@configure-flags)))
1043 (setenv "SHELL" bash)
1044 (setenv "CONFIG_SHELL" bash)
1045 (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13
1046 (setenv "CC" "gcc") ; apparently needed when Stylo is enabled
1047 (setenv "MOZ_BUILD_DATE" ,%icecat-build-id) ; avoid timestamp
1048 (mkdir "../build")
1049 (chdir "../build")
1050 (format #t "build directory: ~s~%" (getcwd))
1051 (format #t "configure flags: ~s~%" flags)
1052 (apply invoke bash
1053 (string-append srcdir "/configure")
1054 flags))))
1055 (replace 'build
1056 ;; The build system often spuriously fails. See
1057 ;; <https://bugs.gentoo.org/show_bug.cgi?id=680934>. To
1058 ;; work around this, we try the standard 'build' phase up
1059 ;; to 5 times.
1060 (lambda args
1061 (let ((build (assoc-ref %standard-phases 'build)))
1062 (let retry ((remaining-attempts 5))
1063 (if (= remaining-attempts 1)
1064 (apply build args)
1065 (guard (c ((invoke-error? c)
1066 (format #t "~%Retrying build! (~a attempts remaining)~%~%"
1067 (- remaining-attempts 1))
1068 (force-output)
1069 (retry (- remaining-attempts 1))))
1070 (apply build args)))))))
1071 (add-after 'build 'neutralise-store-references
1072 (lambda _
1073 ;; Mangle the store references to compilers & other build tools in
1074 ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64.
1075 (substitute*
1076 "dist/bin/chrome/toolkit/content/global/buildconfig.html"
1077 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1078 (regexp-quote (%store-directory)))
1079 _ store hash)
1080 (string-append store
1081 (string-take hash 8)
1082 "<!-- Guix: not a runtime dependency -->"
1083 (string-drop hash 8))))
1084 #t))
1085 (add-before 'configure 'install-desktop-entry
1086 (lambda* (#:key outputs #:allow-other-keys)
1087 ;; Install the '.desktop' file.
1088 (let* ((desktop-file "taskcluster/docker/icecat-snap/icecat.desktop")
1089 (out (assoc-ref outputs "out"))
1090 (applications (string-append out "/share/applications")))
1091 (substitute* desktop-file
1092 (("^Exec=icecat") (string-append "Exec=" out "/bin/icecat"))
1093 (("IceCat") "GNU IceCat")
1094 (("Icon=.*") "Icon=icecat\n")
1095 (("NewWindow") "new-window")
1096 (("NewPrivateWindow") "new-private-window"))
1097 (install-file desktop-file applications)
1098 #t)))
1099 (add-after 'install-desktop-entry 'install-icons
1100 (lambda* (#:key outputs #:allow-other-keys)
1101 (let ((out (assoc-ref outputs "out")))
1102 (with-directory-excursion "browser/branding/official"
1103 (for-each
1104 (lambda (file)
1105 (let* ((size (string-filter char-numeric? file))
1106 (icons (string-append out "/share/icons/hicolor/"
1107 size "x" size "/apps")))
1108 (mkdir-p icons)
1109 (copy-file file (string-append icons "/icecat.png"))))
1110 '("default16.png" "default22.png" "default24.png"
1111 "default32.png" "default48.png" "content/icon64.png"
1112 "mozicon128.png" "default256.png"))
1113 #t))))
1114 ;; This fixes the file chooser crash that happens with GTK 3.
1115 (add-after 'install 'wrap-program
1116 (lambda* (#:key inputs outputs #:allow-other-keys)
1117 (let* ((out (assoc-ref outputs "out"))
1118 (lib (string-append out "/lib"))
1119 (gtk (assoc-ref inputs "gtk+"))
1120 (gtk-share (string-append gtk "/share"))
1121 (mesa (assoc-ref inputs "mesa"))
1122 (mesa-lib (string-append mesa "/lib"))
1123 (pulseaudio (assoc-ref inputs "pulseaudio"))
1124 (pulseaudio-lib (string-append pulseaudio "/lib")))
1125 (wrap-program (car (find-files lib "^icecat$"))
1126 `("XDG_DATA_DIRS" prefix (,gtk-share))
1127 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib ,mesa-lib)))
1128 #t))))))
1129 (home-page "https://www.gnu.org/software/gnuzilla/")
1130 (synopsis "Entirely free browser derived from Mozilla Firefox")
1131 (description
1132 "IceCat is the GNU version of the Firefox browser. It is entirely free
1133 software, which does not recommend non-free plugins and addons. It also
1134 features built-in privacy-protecting features.
1135
1136 WARNING: IceCat 68 has not yet been released by the upstream IceCat project.
1137 This is a preview release, and does not currently meet the privacy-respecting
1138 standards of the IceCat project.")
1139 (license license:mpl2.0) ;and others, see toolkit/content/license.html
1140 (properties
1141 `((ftp-directory . "/gnu/gnuzilla")
1142 (cpe-name . "firefox_esr")
1143 (cpe-version . ,(first (string-split version #\-)))))))
1144
1145 ;; Update this together with icecat!
1146 (define %icedove-build-id "20200602000000") ;must be of the form YYYYMMDDhhmmss
1147 (define-public icedove
1148 (package
1149 (name "icedove")
1150 (version "68.9.0")
1151 (source icecat-source)
1152 (properties
1153 `((cpe-name . "thunderbird_esr")))
1154 (build-system gnu-build-system)
1155 (arguments
1156 `(#:tests? #f ; no check target
1157 #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
1158 #:modules ((guix build utils) ;find-files
1159 (sxml simple)
1160 (ice-9 regex)
1161 ,@%gnu-build-system-modules)
1162 #:phases
1163 (modify-phases %standard-phases
1164 (add-after 'unpack 'prepare-thunderbird-sources
1165 (lambda* (#:key inputs #:allow-other-keys)
1166 (mkdir "comm")
1167 (copy-recursively (assoc-ref inputs "thunderbird-sources")
1168 "comm")
1169 (delete-file-recursively "obj-x86_64-pc-linux-gnu")
1170 (delete-file "sourcestamp.txt")
1171 #t))
1172 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1173 (lambda _
1174 (use-modules (guix build cargo-utils))
1175 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
1176 (substitute* '("Cargo.lock" "gfx/wr/Cargo.lock")
1177 (("(\"checksum .* = )\".*\"" all name)
1178 (string-append name "\"" null-hash "\"")))
1179 (generate-all-checksums "third_party/rust"))
1180 #t))
1181 ;; Fixes issue where each installation directory generates its own profile.
1182 ;; See e.g. https://trac.torproject.org/projects/tor/ticket/31457
1183 (add-after 'patch-source-shebangs 'fix-profile-setting
1184 (lambda _
1185 (substitute* "comm/mail/moz.configure"
1186 (("'MOZ_DEDICATED_PROFILES', True")
1187 "'MOZ_DEDICATED_PROFILES', False"))
1188 #t))
1189 (add-after 'prepare-thunderbird-sources 'rename-to-icedove
1190 (lambda _
1191 (substitute* "comm/mail/confvars.sh"
1192 (("MOZ_APP_BASENAME=Thunderbird")
1193 "MOZ_APP_BASENAME=Icedove\nMOZ_APP_DISPLAYNAME=Icedove")
1194 (("MOZ_APP_NAME=thunderbird")
1195 "MOZ_APP_NAME=icedove")
1196 (("MOZ_UPDATER=1")
1197 "MOZ_UPDATER=0"))
1198 ;; Remove branding to comply with Mozilla's trademark policy
1199 (with-directory-excursion "comm/mail/branding/nightly"
1200 (delete-file "content/about-wordmark.svg")
1201 (call-with-output-file "content/about-wordmark.svg"
1202 (lambda (port)
1203 (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg")
1204 (viewBox "0 0 789.1 90.78")
1205 (width "333")
1206 (height "48")
1207 (fill "#fff"))
1208 (text (@ (x "400") (y "70")
1209 (text-anchor "middle")
1210 (font-size "90"))
1211 "Icedove Daily"))
1212 port)))
1213 (substitute* '("locales/en-US/brand.properties"
1214 "locales/en-US/brand.ftl"
1215 "locales/en-US/brand.dtd"
1216 "configure.sh")
1217 (("Thunderbird") "Icedove")
1218 (("mozilla.org") "guix.gnu.org")))
1219 ;; Remove other mentions of Thunderbird in user-visible text.
1220 (with-directory-excursion "comm/mail/base/content"
1221 (substitute* '("newInstallPage.xhtml"
1222 "overrides/app-license-name.html"
1223 "newInstall.xul")
1224 (("Thunderbird") "Icedove")))
1225 (with-directory-excursion "comm/mail/components/"
1226 (substitute* '("mailGlue.js"
1227 "extensions/schemas/addressBook.json"
1228 "extensions/schemas/tabs.json"
1229 "extensions/schemas/cloudFile.json"
1230 "extensions/schemas/chrome_settings_overrides.json"
1231 "extensions/schemas/windows.json"
1232 "extensions/parent/ext-mail.js"
1233 "im/messages/mail/Info.plist"
1234 "enterprisepolicies/moz.build"
1235 "enterprisepolicies/helpers/moz.build"
1236 "enterprisepolicies/schemas/moz.build"
1237 "preferences/chat.inc.xul")
1238 (("Thunderbird") "Icedove")))
1239 (substitute* "comm/calendar/lightning/lightning-packager.mk"
1240 (("ifeq \\(thunderbird")
1241 "ifeq (icedove"))
1242 (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js"
1243 "comm/mailnews/extensions/newsblog/content/feed-subscriptions.js"
1244 "comm/common/src/customizeToolbar.js")
1245 (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e)
1246 (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e)))
1247
1248 ;; Override addon URLs and settings
1249 (substitute* "comm/mail/app/profile/all-thunderbird.js"
1250 (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m)
1251 (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");"))
1252 (("(pref\\(\"extensions.getAddons.search.url\").*" _ m)
1253 (string-append m ", \"https://guix.gnu.org/packages\");"))
1254 (("(pref\\(\"extensions.update.enabled\").*" _ m)
1255 (string-append m ", false);"))
1256 (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m)
1257 (string-append m ", false);"))
1258 (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m)
1259 (string-append m ", false);")))
1260 #t))
1261 (add-after 'build 'neutralize-store-references
1262 (lambda _
1263 ;; Mangle the store references to compilers & other build tools in
1264 ;; about:buildconfig, reducing Icedove's closure significant.
1265 ;; The resulting files are saved in lib/thunderbird/omni.ja
1266 (substitute*
1267 ;; Use find because the path "obj-x86_64-pc-linux-gnu" contains
1268 ;; the architecture and the system -> more complicated.
1269 (find-files "." "buildconfig.html")
1270 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1271 (regexp-quote (%store-directory)))
1272 _ store hash)
1273 (string-append store
1274 (string-take hash 8)
1275 "<!-- Guix: not a runtime dependency -->"
1276 (string-drop hash 8))))
1277 #t))
1278 (replace 'configure
1279 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
1280 (let* ((out (assoc-ref outputs "out"))
1281 (bash (which "bash"))
1282 (abs-srcdir (getcwd))
1283 (srcdir (string-append "../" (basename abs-srcdir)))
1284 (flags `(,(string-append "--prefix=" out)
1285 ,@configure-flags))
1286 (mozconfig (string-append (getcwd) "/.mozconfig")))
1287 (setenv "SHELL" bash)
1288 (setenv "AUTOCONF"
1289 (string-append (assoc-ref %build-inputs
1290 "autoconf")
1291 "/bin/autoconf"))
1292 (setenv "CONFIG_SHELL" bash)
1293 (setenv "QA_CONFIGURE_OPTIONS" ".*")
1294 (setenv "MOZBUILD_STATE_PATH"
1295 (string-append (getcwd) "/mach_state"))
1296 (setenv "MOZCONFIG"
1297 (string-append (getcwd) "/.mozconfig"))
1298 (setenv "CC" "gcc")
1299 (setenv "MOZ_NOSPAM" "1")
1300 (setenv "PYTHON"
1301 (string-append (assoc-ref inputs "python2")
1302 "/bin/python"))
1303 (setenv "MOZ_BUILD_DATE" ,%icedove-build-id) ; avoid timestamp
1304 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1305 (assoc-ref outputs "out")
1306 "/lib/icedove"))
1307 (mkdir-p (string-append (getcwd) "/builddir"))
1308 (with-output-to-file mozconfig
1309 (lambda ()
1310 (display
1311 (string-append
1312 "ac_add_options --disable-crashreporter\n"
1313 "ac_add_options --disable-debug\n"
1314 "ac_add_options --disable-debug-symbols\n"
1315 "ac_add_options --disable-elf-hack\n"
1316 "ac_add_options --disable-gconf\n"
1317 "ac_add_options --disable-ion\n"
1318 "ac_add_options --disable-necko-wifi\n"
1319 "ac_add_options --disable-official-branding\n"
1320 "ac_add_options --disable-tests\n"
1321 "ac_add_options --disable-updater\n"
1322 "ac_add_options --disable-webrtc\n"
1323 "ac_add_options --enable-application=comm/mail\n"
1324 "ac_add_options --enable-calendar\n"
1325 "ac_add_options --enable-content-sandbox\n"
1326 "ac_add_options --enable-default-toolkit=\"cairo-gtk3\"\n"
1327 "ac_add_options --enable-optimize\n"
1328 "ac_add_options --enable-pulseaudio\n"
1329 "ac_add_options --enable-release\n"
1330 "ac_add_options --enable-startup-notification\n"
1331 "ac_add_options --enable-strip\n"
1332 "ac_add_options --enable-system-ffi\n"
1333 "ac_add_options --enable-system-pixman\n"
1334 "ac_add_options --enable-system-sqlite\n"
1335 "ac_add_options --prefix=" out "\n"
1336 "ac_add_options --with-clang-path=" (assoc-ref %build-inputs "clang") "/bin/clang\n"
1337 "ac_add_options --with-distribution-id=org.gnu\n"
1338 "ac_add_options --with-libclang-path=" (assoc-ref %build-inputs "clang") "/lib\n"
1339 "ac_add_options --with-system-bz2\n"
1340 "ac_add_options --with-system-icu\n"
1341 "ac_add_options --with-system-jpeg\n"
1342 "ac_add_options --with-system-libevent\n"
1343 "ac_add_options --with-system-nspr\n"
1344 "ac_add_options --with-system-nss\n"
1345 "ac_add_options --with-system-zlib\n"
1346 "ac_add_options --with-user-appdir=\\.icedove\n"))))
1347 (display (getcwd))
1348 (newline)
1349 (display "mach configure")
1350 (invoke "./mach" "configure"))))
1351 (replace 'build
1352 (lambda _ (invoke "./mach" "build")))
1353 (replace 'install
1354 (lambda _ (invoke "./mach" "install")))
1355 ;; Thunderbird doesn't provide any .desktop file.
1356 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
1357 (add-after 'install 'install-desktop-file
1358 (lambda* (#:key outputs #:allow-other-keys)
1359 (let* ((out (assoc-ref outputs "out"))
1360 (apps (string-append out "/share/applications")))
1361 (mkdir-p apps)
1362 (with-output-to-file (string-append apps "/icedove.desktop")
1363 (lambda _
1364 (format #t
1365 "[Desktop Entry]~@
1366 Name=Icedove~@
1367 Exec=~a/bin/icedove~@
1368 Icon=icedove~@
1369 GenericName=Mail/News Client~@
1370 Categories=Network;Email;~@
1371 Terminal=false~@
1372 StartupNotify=true~@
1373 MimeType=x-scheme-handler/mailto;~@
1374 Type=Application~@
1375 Actions=ComposeMessage;~@
1376 [Desktop Action ComposeMessage]~@
1377 Name=Write new message~@
1378 Exec=~@*~a/bin/icedove -compose~%"
1379 out))))
1380 #t))
1381 (add-after 'install 'wrap-program
1382 (lambda* (#:key inputs outputs #:allow-other-keys)
1383 (let* ((out (assoc-ref outputs "out"))
1384 (lib (string-append out "/lib"))
1385 (gtk (assoc-ref inputs "gtk+"))
1386 (gtk-share (string-append gtk "/share"))
1387 (pulseaudio (assoc-ref inputs "pulseaudio"))
1388 (pulseaudio-lib (string-append pulseaudio "/lib")))
1389 (wrap-program (car (find-files lib "^icedove$"))
1390 `("XDG_DATA_DIRS" prefix (,gtk-share))
1391 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib)))
1392 #t))))))
1393 (inputs
1394 `(("bzip2" ,bzip2)
1395 ("cairo" ,cairo)
1396 ("cups" ,cups)
1397 ("dbus-glib" ,dbus-glib)
1398 ("ffmpeg" ,ffmpeg)
1399 ("freetype" ,freetype)
1400 ("gdk-pixbuf" ,gdk-pixbuf)
1401 ("glib" ,glib)
1402 ("gtk+" ,gtk+)
1403 ("gtk+-2" ,gtk+-2)
1404 ("hunspell" ,hunspell)
1405 ("icu4c" ,icu4c)
1406 ("libcanberra" ,libcanberra)
1407 ("libevent" ,libevent)
1408 ("libffi" ,libffi)
1409 ("libgnome" ,libgnome)
1410 ("libjpeg-turbo" ,libjpeg-turbo)
1411 ("libpng-apng" ,libpng-apng)
1412 ("libvpx" ,libvpx)
1413 ("libxcomposite" ,libxcomposite)
1414 ("libxft" ,libxft)
1415 ("libxinerama" ,libxinerama)
1416 ("libxscrnsaver" ,libxscrnsaver)
1417 ("libxt" ,libxt)
1418 ("mesa" ,mesa)
1419 ("mit-krb5" ,mit-krb5)
1420 ("nspr" ,nspr)
1421 ("nss" ,nss)
1422 ("pango" ,pango)
1423 ("pixman" ,pixman)
1424 ("pulseaudio" ,pulseaudio)
1425 ("sqlite" ,sqlite)
1426 ("startup-notification" ,startup-notification)
1427 ("unzip" ,unzip)
1428 ("zip" ,zip)
1429 ("zlib" ,zlib)))
1430 (native-inputs
1431 `(("thunderbird-sources"
1432 ;; The changeset identifier is taken from the file "sourcestamp.txt"
1433 ;; in the Thunderbird release tarball. We don't use the release
1434 ;; tarball because it duplicates the Icecat sources and only adds the
1435 ;; "comm" directory, which is provided by this repository.
1436 ,(let ((changeset "787d887f43fcbfe254ff0c9650c5517710071b74"))
1437 (origin
1438 (method hg-fetch)
1439 (uri (hg-reference
1440 (url "https://hg.mozilla.org/releases/comm-esr68")
1441 (changeset changeset)))
1442 (file-name (string-append "thunderbird-" version "-checkout"))
1443 (sha256
1444 (base32
1445 "1z1k3r1jilwmsywiyp8gh49f61cl9n085k95x7ihyld3rvgcjm9f")))))
1446 ("autoconf" ,autoconf-2.13)
1447 ("cargo" ,rust "cargo")
1448 ("clang" ,clang)
1449 ("llvm" ,llvm)
1450 ("nasm" ,nasm)
1451 ("node" ,node)
1452 ("perl" ,perl)
1453 ("pkg-config" ,pkg-config)
1454 ("python" ,python)
1455 ("python2" ,python-2.7)
1456 ("rust" ,rust)
1457 ("rust-cbindgen" ,rust-cbindgen)
1458 ("which" ,which)
1459 ("yasm" ,yasm)))
1460 (home-page "https://www.thunderbird.net")
1461 (synopsis "Rebranded Mozilla Thunderbird email client")
1462 (description
1463 "This package provides an email client built based on Mozilla
1464 Thunderbird. It supports email, news feeds, chat, calendar and contacts.")
1465 (license license:mpl2.0)))
1466
1467 (define-public firefox-decrypt
1468 (package
1469 (name "firefox-decrypt")
1470 (version "0.7.0")
1471 (source (origin
1472 (method git-fetch)
1473 (uri (git-reference
1474 (url "https://github.com/Unode/firefox_decrypt.git")
1475 (commit version)))
1476 (file-name (git-file-name name version))
1477 (sha256
1478 (base32
1479 "17yyyxp47z4m8hnflcq34rc1y871515kr3f1y42j1l0yx3g0il07"))))
1480 (build-system trivial-build-system)
1481 (inputs
1482 `(("nss" ,nss)
1483 ("python" ,python)))
1484 (arguments
1485 `(#:modules ((guix build utils))
1486 #:builder
1487 (begin
1488 (use-modules (guix build utils))
1489 (setenv "PATH"
1490 (string-append
1491 (assoc-ref %build-inputs "python") "/bin"))
1492 (copy-file (string-append (assoc-ref %build-inputs "source")
1493 "/firefox_decrypt.py")
1494 "firefox_decrypt.py")
1495 (substitute* "firefox_decrypt.py"
1496 (("/usr/bin/env python") (which "python3"))
1497 (("libnss3.so") (string-append (assoc-ref %build-inputs "nss")
1498 "/lib/nss/libnss3.so")))
1499 (install-file "firefox_decrypt.py" (string-append %output "/bin"))
1500 #t)))
1501 (home-page "https://github.com/Unode/firefox_decrypt/")
1502 (synopsis "Tool to extract passwords from Mozilla profiles")
1503 (description "Firefox Decrypt is a tool to extract passwords from
1504 Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.")
1505 (license license:gpl3+)))