gnu: NSPR: Update to 4.29.
[jackhill/guix/guix.git] / gnu / packages / gnuzilla.scm
CommitLineData
be0f6112 1;;; GNU Guix --- Functional package management for GNU
5deea4fc 2;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
aff0cce9 3;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
429c8284 4;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
1aaaff1a 5;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
e80a4479 6;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
88a8ce87 7;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
8db94716 8;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
b14aab67 9;;; Copyright © 2017, 2018 Nikita <nikita@n0.is>
37db2370 10;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
b14aab67 11;;; Copyright © 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
7d141788 12;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
167a0ce0 13;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
37db2370 14;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
b14aab67
JB
15;;; Copyright © 2019, 2020 Adrian Malacoda <malacoda@monarch-pass.net>
16;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
be0f6112
AE
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)
07d4d9b7 34 #:use-module ((srfi srfi-1) #:hide (zip))
1461dd24 35 #:use-module (ice-9 match)
be0f6112 36 #:use-module (gnu packages)
b5b73a82 37 #:use-module ((guix licenses) #:prefix license:)
be0f6112
AE
38 #:use-module (guix packages)
39 #:use-module (guix download)
192a59d0 40 #:use-module (guix git-download)
ad21d767 41 #:use-module (guix hg-download)
948879ee
MW
42 #:use-module (guix gexp)
43 #:use-module (guix store)
44 #:use-module (guix monads)
aaac423c 45 #:use-module (guix utils)
be0f6112 46 #:use-module (guix build-system gnu)
e67ad553 47 #:use-module (guix build-system cargo)
167a0ce0 48 #:use-module (guix build-system trivial)
948879ee 49 #:use-module (gnu packages admin)
94e96f7f 50 #:use-module (gnu packages audio)
002c3e6d 51 #:use-module (gnu packages autotools)
bfb48f4f 52 #:use-module (gnu packages base)
948879ee 53 #:use-module (gnu packages bash)
1aaaff1a 54 #:use-module (gnu packages databases)
be0f6112 55 #:use-module (gnu packages glib)
be0f6112 56 #:use-module (gnu packages gtk)
90e1cdae
MW
57 #:use-module (gnu packages gnome)
58 #:use-module (gnu packages libcanberra)
59 #:use-module (gnu packages cups)
89e34644 60 #:use-module (gnu packages kerberos)
be0f6112
AE
61 #:use-module (gnu packages linux)
62 #:use-module (gnu packages perl)
63 #:use-module (gnu packages pkg-config)
1ae6df81 64 #:use-module (gnu packages compression)
74c7af9f 65 #:use-module (gnu packages fontutils)
1ae6df81 66 #:use-module (gnu packages libevent)
90e1cdae 67 #:use-module (gnu packages libreoffice) ;for hunspell
e55354b8 68 #:use-module (gnu packages image)
1ae6df81 69 #:use-module (gnu packages libffi)
74c7af9f 70 #:use-module (gnu packages pulseaudio)
be0f6112 71 #:use-module (gnu packages python)
44d10b1f 72 #:use-module (gnu packages python-xyz)
ad21d767 73 #:use-module (gnu packages node)
be0f6112 74 #:use-module (gnu packages xorg)
200726ed 75 #:use-module (gnu packages gl)
01497dfe 76 #:use-module (gnu packages assembly)
e67ad553 77 #:use-module (gnu packages rust)
c5c48761 78 #:use-module (gnu packages rust-apps)
8d956d86 79 #:use-module (gnu packages llvm)
aff0cce9 80 #:use-module (gnu packages nss)
13b284d9
MW
81 #:use-module (gnu packages icu4c)
82 #:use-module (gnu packages video)
94e96f7f 83 #:use-module (gnu packages xiph)
13b284d9 84 #:use-module (gnu packages xdisorg)
cd0322a3
RW
85 #:use-module (gnu packages readline)
86 #:use-module (gnu packages sqlite))
be0f6112 87
4923e06f
SB
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
68716289 99 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))
a64b7da5 100 (patches (search-patches "mozjs17-aarch64-support.patch"))
68716289
SB
101 (modules '((guix build utils)))
102 (snippet
103 ;; Fix incompatibility with Perl 5.22+.
6cbee49d
MW
104 '(begin
105 (substitute* '("js/src/config/milestone.pl")
106 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE"))
107 #t))))
4923e06f
SB
108 (build-system gnu-build-system)
109 (native-inputs
f403c676
EF
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)))
4923e06f 117 (arguments
56486b3a
EF
118 `(;; XXX: parallel build fails, lacking:
119 ;; mkdir -p "system_wrapper_js/"
120 #:parallel-build? #f
87eeeeb0 121 #:make-flags '("CXXFLAGS=-fpermissive")
56486b3a
EF
122 #:phases
123 (modify-phases %standard-phases
124 (add-after 'unpack 'delete-timedout-test
a64b7da5 125 ;; This test times out on slower hardware.
e15793c8
MW
126 (lambda _
127 (delete-file "js/src/jit-test/tests/basic/bug698584.js")
128 #t))
56486b3a 129 (add-before 'configure 'chdir
4923e06f 130 (lambda _
56486b3a
EF
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"))
e15793c8
MW
139 (invoke "./configure" (string-append "--prefix=" out)
140 ,@(if (string=? "aarch64-linux"
141 (%current-system))
142 '("--host=aarch64-unknown-linux-gnu")
143 '()))))))))
4923e06f
SB
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
148in C/C++.")
87158e85 149 (license license:mpl2.0))) ; and others for some files
4923e06f 150
cefdcb38
SB
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
68716289
SB
162 "1n1phk8r3l8icqrrap4czplnylawa0ddc2cc4cgdz46x3lrkybz6"))
163 (modules '((guix build utils)))
26f38d31 164 (patches (search-patches "mozjs24-aarch64-support.patch"))
68716289
SB
165 (snippet
166 ;; Fix incompatibility with Perl 5.22+.
6cbee49d
MW
167 '(begin
168 (substitute* '("js/src/config/milestone.pl")
169 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE"))
170 #t))))
cefdcb38 171 (arguments
aaac423c
EF
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"))
6073ef75
MW
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 '())))))))))
cefdcb38
SB
190 (inputs
191 `(("libffi" ,libffi)
192 ("zlib" ,zlib)))))
193
29f381ba
CL
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
747c8f2a 202 "https://anduin.linuxfromscratch.org/BLFS/mozjs/"
29f381ba
CL
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"))
5f70b6d4
MW
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"
29f381ba 267
5f70b6d4
MW
268 ;; Intl API requires bundled ICU.
269 "--without-intl-api")))))))
29f381ba
CL
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
192a59d0
RW
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.
6cc147a3
RW
312 "--without-intl-api"
313
314 ;; Without this gnome-shell will crash at runtime.
315 "--disable-jemalloc")
192a59d0
RW
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
204cfbe1
RW
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
ad21d767
MW
416(define mozilla-compare-locales
417 (origin
418 (method hg-fetch)
419 (uri (hg-reference
420 (url "https://hg.mozilla.org/l10n/compare-locales/")
c7011ff8 421 (changeset "RELEASE_8_0_0")))
ad21d767 422 (file-name "mozilla-compare-locales")
c7011ff8 423 (sha256 (base32 "0052wq92sg4i776x407b5838jx9h3phl9xy69m2q34f31n3gdyk2"))))
ad21d767
MW
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 ;;---------------------------------------------------------------------------
c7011ff8
MW
443 ("1q1p7nl97478hkf1msbbcdh98k6fn87xwqihbw8np00ll5gk9k4v" "97cf3c155484" "ach")
444 ("0sajpblp639l448xywx7xlybjr5dm0rfrzx511a8pa9wn7dma4mf" "46929b4dda4e" "af")
445 ("04s756aaf1yyli1dn1vfdjymgyjs1pz2n7jvz76j27x4nzdgss7l" "96ffd2b04ba3" "an")
446 ("16nw7slm7irsnjf81r6zl273kbzri8sdbimzgzxwm0vh6xr61rgs" "1c4231166ddf" "ar")
447 ("0i0qrj4j8zjv55cisbmr21dp8mz933hc9wkpn3abz5k5pn84gpry" "bc4384b8be78" "ast")
448 ("1r77mmwg9x1jfa7g5lqa31rgyfrnix1zj80ibn5rq9gyhhsdrwbd" "dd56aead51fa" "az")
449 ("1kzjpy5bnvps8di72ksynhbhc9bpw1ml6hvphm74z8dz55ai4c18" "9d2bff64ddfb" "be")
450 ("1fygvjgph3siknfm7l0fh9y4ava72z1rxkip1zgmcdgq7jz8wzpf" "3808f4fe4db6" "bg")
451 ("1x9nlqia441xh04rhkmkw6qrgpwnyqw0grrf5n2qw96939wnmgl7" "5ca8752ed8df" "bn")
452 ("18yyxqzab44bgqx7h052d5nxyhv0l5bidgr16z1b3ak2crsfyx9q" "4c5d30ca9bf2" "br")
453 ("11bschjz7pgsm4r1qan5l4s3nkzm5jb0kivpp186wd1xsjci5bjb" "cf2478a7eae1" "bs")
454 ("12bak64nl6qi092l55xv330vh38mfsicrrf4wi693nn7zqb3mbpw" "4aa2cc349211" "ca")
455 ("0p97d7pnxqs971rr5c57i6cw3mx1mp3iasa0xdmdk0zpz9pjd3s4" "806914072144" "ca-valencia")
456 ("1rligf98h9r16mw3r3n5jalzi74xn2dnh6hkiixp7s2bvhjicwa4" "db2163383129" "cak")
457 ("18y5j8ljh72mj2nbx0m64mi3fyjbwyx992i004sv3zvs4d4z18w4" "d1d09eedddde" "cs")
458 ("12i4m9q6f8sl8arm8ja4gs4sl9m59p3kddlqi68srpz9mk66rqxz" "1caf58c64227" "cy")
459 ("16wacsd23zd4j0yi6vbj033wylia8hlpswx949x5hy1h9817j4vn" "9ef3b56aa243" "da")
460 ("1ddxnqpfi1wnciwmzkvvjinb51h22bg70r0dn7db17q64p4271rk" "a050b0eaec0a" "de")
461 ("0gw5h52rw3bc2lwffnv845sjwwj22gmabchmpa1rw2y6087dc7zk" "613135cb0759" "dsb")
462 ("0v17da37w1kbs73i6xql4c9xng6rfachyylpy3w8hpibpvi7i30n" "903db7c76b31" "el")
463 ("0ky1nj4kp070nriw0igsa64l39plcv2365zl8lqpbydyp6clwc3m" "6bb74673e9aa" "en-CA")
464 ("15jck6si2l4h5lrs8zjx56y97p70njpi26nnq6xfmvj1dk5qb4g2" "c06bd83a9295" "en-GB")
465 ("1gc400n8j8qk70vdw7fkf4m9yviia35cmj6361pxnyvsjrgm4qvm" "ae0fda5114c4" "eo")
466 ("0y01lahdrd3krsh6nrr3iw36r2x4advh5qw54vf92w11l3aiyvfz" "0c294dc9ce40" "es-AR")
467 ("16jjbsfa62dxk36ccziv7nmh26c1s0b05960in6zs5nnfrv4yh35" "7c30b2981fb4" "es-CL")
468 ("0qh8c8f8dsv1v56n1mcpn84l39bpnqfl8v8iacq12zh322srr549" "ad1444f4f833" "es-ES")
469 ("1vh3hm5r4ch6mk3ymbk12b9rppwc75fmbi0i7cml82kxsi77bzw5" "0a26cdb23536" "es-MX")
470 ("159l92jxx48lgba1g8ig3mdzhwsf3jpg3nx1g9blq4majk5hqr6q" "65a38a830795" "et")
471 ("1ha8y1wbgb66dqm26x1q2xwygy7bblkjz40y9vh5d2qlpr3fn0av" "21e0930b221d" "eu")
472 ("0rq4pcw6klm0bbljm1wdfvna8bpa35cm47hh2s63i2xdax4scahf" "5a4bb020cf09" "fa")
473 ("1py2594gsvpgrxnplz278ffb7grsf384kzjskrl1zyps0jw8fb1x" "4a4f712cd4aa" "ff")
474 ("1dyd55ngsglp1w2gh0yaacwb0vsq23gdvnj76f2x6g39h1li9s0z" "9c51cd915e2b" "fi")
475 ("0kimwivpq6pr63jh1k9fszsv8bi8vns3scg76mmnvbhh2ca8q7wj" "4f9e24a696ee" "fr")
476 ("1sbbnnp12lgy5qan2kix02942830b1969bd7jxrv7piwqfch9i06" "9e21a0eeb5b1" "fy-NL")
477 ("0dsvvyfrzkx5h44gqgdci7arb8h4lq48w20cnr8fc7j17grvnkzz" "999a995bc09d" "ga-IE")
478 ("1487msbsgrfzmyijhf6a4wbqdjpd7b7ki9nwrjjjjlnbw0h0ljpb" "6a9ddcab3240" "gd")
479 ("1kzc4fwr18kgisdzba2acj1ag8mxbifqpk5p30jv68nmvqfsvl8d" "51eb5e352db9" "gl")
480 ("13gy3wn44kcxr7j3sbl69fp415875f4vb0gm91hx0fysqlvryhcs" "b9de1ffe3224" "gn")
481 ("0w5nvzpjn5vr35c1852rlff581vpy71nc096cz125852kyqkzkc3" "5b3307475ada" "gu-IN")
482 ("1ycakc4qpy9vcy50j3ricryjfnjr9v3a5ijj6bbfl4y6aks157fy" "c742df968ffd" "he")
483 ("1b2jf83c500wm5wcdnijq0b7y4m8n6271smq8pygahn5nq17f0gq" "1a3039a52b8a" "hi-IN")
484 ("19bbw8ix5m83cf4yarcmjl7jqa8xfabwqnh3nj6vi52rwvn7whk5" "8dc50e269ef3" "hr")
485 ("12rrsvgg6bb2h8fhni7jbx8pv983q8ym5fhfjim957n9q2yp5db6" "67e40f48dec7" "hsb")
486 ("0apyh713p3hrlj8041xwblcssahbmsqp9v9hbmb50ayf4z850kr1" "40073a597b1b" "hu")
487 ("0q0r076lq250d3vmnz9d92wj137c2v8i362c2avmkgp5zr3mcl0z" "2ea33335afdb" "hy-AM")
488 ("0qza33gdc1i9259dwd2f7vd78s0a6rg34aqdkhcn7f2l6ybw6xd6" "930041db15eb" "ia")
489 ("1211h0gp7gianh3qf76w04gfzk4n2bnyc9i8dviyz0vh4cjbx11m" "08811a49b41c" "id")
490 ("12lcr841g1j7453s7gb51vrvxmshx4ha3h1jx4vh8wr891xv8l6a" "2f7a8d31e0ba" "is")
491 ("1x585g0r2kcv0d3phnxx85bk5g0pi1yl0hwp4idv19yc9hslr04s" "188357cc04b4" "it")
492 ("09v35g9v7j6x0p1hggydm3a1rmq2fh4z7g1l88z3w5k6wq2nhj1b" "45cee0ba4771" "ja")
493 ("0prs3vycfvvaffjigdgyxiq41ak2rc34lnan5a6cwdqjgy7z450s" "d60a19d9bf17" "ja-JP-mac")
494 ("1nskzm8rgczrbgcxlzzq5zqdfd456ad0cylq27nf0wjiyq6kjzcm" "00cb00e78672" "ka")
495 ("0g6zznmhiam172nm7g2qzfpk415mna8kiihm73z2sdns64xb3ymg" "77a293a4bced" "kab")
496 ("17dld9lrym7rpvpvnkssivp4wx1f11zpk86wczbq1h52qgd70p55" "2c9b33a56d5d" "kk")
497 ("1nlzl8930c8ql3yq425wyqlxvq8arrjv20xpm5g7yfxd54av89ac" "9cddd42af05c" "km")
498 ("07hkrcdksvrqk816yimd036dlw15nc4sjk4gmw16ywbp093v0mqq" "e0c2969a8398" "kn")
499 ("08aqggvk3qbv5bzks9i1iba9akhkpm01d2c9k0zf41mpr2r5yfg2" "827567d0dafc" "ko")
500 ("0vagaiwy80bs1k3gkacshlzb5zchkcshx0ypwirvayc63sw4yl8l" "694b2a24e868" "lij")
501 ("1r43kp1kzahrbza0hiyavqplk9h08pzsb6rpjy79jr6l1iqb89sy" "d6728db7e060" "lt")
502 ("0sq2wbsj79xl7fi454k6q5xdhxyck1whjz315rv37vphqpx86b9b" "61e9b33f4d94" "lv")
503 ("0q8jxg1af22hs9wjdf0jd3bqk4rafxyzvsjl35k75am7l2y1fl3c" "9e482f6dd72c" "mk")
504 ("1zsfzjrzbc58d30a9yz12h5vphywgpw8xg6y6zn3677a785dvr20" "1fd2763336a4" "mr")
505 ("1rzygkkpn1a59daygd3hdaqph2np6sqvpgh68j0xr4il958ymnsm" "67ddab62dab4" "ms")
506 ("16jp6w5gizfxs7jvncg3ly13m59vqvh4rlmjd0q23m5g5ff9sklc" "3ed015b51bf3" "my")
507 ("1wfv023j67lb4iyf49fsknwm4z3xy0xqcf25b2nzanggxj26n01x" "d01801233a8f" "nb-NO")
508 ("1946vfia58vbjfippb5pfsskbjj95w7hb340smn6ry2vmza99mxp" "582defb08fb2" "ne-NP")
509 ("12w5ywh4c3s55y3zqc48cp1gcpwwjg444yfh1bghhhb9ni1xkh5i" "05f6359a29a6" "nl")
510 ("17jb076320cgkw1ypwmws2vjxsqlv2ww8aaisa3j334vbrw1m4zx" "50b41a1ddded" "nn-NO")
511 ("1y840j0v5zdgj94cbacy6j1snf44rynmzxq3yk8i26arcar62akl" "a6a138531a44" "oc")
512 ("0jq1hq4xhqxpa26r8pb1bgbaljgfkhn9l6p5pbnslkllpbh70q6l" "e70a3afaef25" "pa-IN")
513 ("1hih138skwy2gb8q10ngg6zalrk3aa3d549mg79gqzxbi5zy19fw" "e035f33389eb" "pl")
514 ("1hhif4hx4k351wm1bzykzycfzb5q8msxmiwh5r1cy32rh8wkxwhh" "54098495f37f" "pt-BR")
515 ("0gkjs12rxjml1m3mljskpz1gr6aph0c31nwpwdqybfg54w9qslib" "3fdf021f624e" "pt-PT")
516 ("0anyvwd9v6mr8y3ww33s6qnxkawqn5lz65vrxx3m3kzky63ai1xk" "794f9374eb87" "rm")
517 ("1p4drj25gsfv7lwgm5saazh38iqrh53952n8i4bmxpn0nadbm2n5" "71ce18bcf6cc" "ro")
518 ("17yssf4axd3zvncl4ka4wkfnwcn0z0arp3390vb9cps67na29p36" "3a9587227699" "ru")
519 ("0xk6rksspcw1222v4rgk5a6gzrpx64k29hm7p9qkqwd70s34yj46" "c020582a72ce" "si")
520 ("1ax5ibydyn7sj208r66zcxlcr8dxdqrw28vqyjif4jx583rp4lfp" "745a699b7f51" "sk")
521 ("13rin7hm1dv8g0hbcv8mp2hiwpk1k5bhzvkqpqajkkik4lx523mc" "8e437e2351ef" "sl")
522 ("0yh5jkl5zw3f7x1w2w6zfj3dyvcl4wj1zv4di7qsq2nl2yyizf7x" "2d99e2eff94f" "son")
523 ("0vzq7s27jsdbw5k59wfykysg1kd8w229ab5d4zjdf30l59igkahh" "69bbdf07bd80" "sq")
524 ("1mwivvs8vrk6vjq6i33kwlrlisra7dy35521ayps9p2rz2dll4rr" "215df5c5125c" "sr")
525 ("0g97yz1rg5cfflj8vvq3sqliyvm06x818z9yldfh5rjg1y6n9fjd" "8be00a1a50d4" "sv-SE")
526 ("0ii02jn3lh2i6d0s95whx9aj6w3x8axc7w1rlzj0lc2s9n52krz3" "170a84339dbe" "ta")
527 ("1ss7symad2crapxjqc0xhc0n17l79r5vf7flvkgk7npjky4vb7nv" "72a79a304f7f" "te")
528 ("11iqmg8zamgscnvs4n2xpw3g9azn6w38qs313wiwm86pyx6694ss" "8e91ce3064c5" "th")
529 ("1zgkvn9flb8by62ip9r3gmpgxwgkww1zhml5mwa0djq3ppfdgi1c" "0f914d0cda56" "tl")
530 ("1filkhdak6dbrd83q602x1qw1703nlm53nm9gcyab8s16gsx6ylz" "62ca6a8eaeba" "tr")
531 ("0cgagdy0ixprk3knczdmkqxkmx4ybmshhh0956kxbd0iab0dfcf6" "f110ccac4cde" "trs")
532 ("1f1ghk67zwnwc5x3nk82vcv94nf8glngkfya1hg074q3088sj9pa" "56c0102d5f1c" "uk")
533 ("0iyw1b2jjylkdwxv9sxvj4ikxl64sx612b2dvvmf1di8bw86w74r" "7d53bce5ae98" "ur")
534 ("1q83cp5pfgs8l03zirwi8r5qp8qyh4zvxdx1ilgaqqlyg42yql7c" "9b500e1a054d" "uz")
535 ("1d4nkybz2hk64ay04k965b9lc5nhhpmzcs5ww3b6q4n93rf9c2z7" "2a000025928a" "vi")
536 ("1cnrsfnyl3sw3sxsggmjwydvphb2diy0vzknvxdhpnvq3ln18hga" "74724087c25b" "xh")
537 ("1j6l66v1xw27z8w78mpsnmqgv8m277mf4r0hgqcrb4zx7xc2vqyy" "527e5e090608" "zh-CN")
538 ("1frwx35klpyz3sdwrkz7945ivb2dwaawhhyfnz4092h9hn7rc4ky" "6cd366ad2947" "zh-TW")))
bfb48f4f 539
948879ee
MW
540(define* (computed-origin-method gexp-promise hash-algo hash
541 #:optional (name "source")
542 #:key (system (%current-system))
543 (guile (default-guile)))
544 "Return a derivation that executes the G-expression that results
545from forcing GEXP-PROMISE."
546 (mlet %store-monad ((guile (package->derivation guile system)))
547 (gexp->derivation (or name "computed-origin")
548 (force gexp-promise)
2a1ec7bc 549 #:graft? #f ;nothing to graft
948879ee
MW
550 #:system system
551 #:guile-for-build guile)))
552
cdcbb42a
MW
553(define %icecat-version "78.3.1-guix0-preview1")
554(define %icecat-build-id "20200926000000") ;must be of the form YYYYMMDDhhmmss
948879ee
MW
555
556;; 'icecat-source' is a "computed" origin that generates an IceCat tarball
557;; from the corresponding upstream Firefox ESR tarball, using the 'makeicecat'
558;; script from the upstream IceCat project.
559(define icecat-source
560 (let* ((base-version (first (string-split %icecat-version #\-)))
561
562 (major-version (first (string-split base-version #\.)))
563 (minor-version (second (string-split base-version #\.)))
564 (sub-version (third (string-split base-version #\.)))
565
566 (upstream-firefox-version (string-append base-version "esr"))
567 (upstream-firefox-source
568 (origin
569 (method url-fetch)
570 (uri (string-append
571 "https://ftp.mozilla.org/pub/firefox/releases/"
572 upstream-firefox-version "/source/"
573 "firefox-" upstream-firefox-version ".source.tar.xz"))
574 (sha256
575 (base32
cdcbb42a 576 "1savwk91vhvg096w289xwpjvqbbd2ibfad90081hirlzd1kpvljz"))))
948879ee 577
cdcbb42a 578 (upstream-icecat-base-version "78.3.1") ; maybe older than base-version
ad21d767 579 ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version))
cdcbb42a 580 (gnuzilla-commit "cd2af837fce69145effef83def6993d244887b03")
948879ee
MW
581 (gnuzilla-source
582 (origin
583 (method git-fetch)
584 (uri (git-reference
585 (url "git://git.savannah.gnu.org/gnuzilla.git")
586 (commit gnuzilla-commit)))
9b096517
MW
587 (file-name (git-file-name "gnuzilla"
588 ;;upstream-icecat-base-version
589 (string-take gnuzilla-commit 8)))
948879ee
MW
590 (sha256
591 (base32
cdcbb42a 592 "0266gp8vs4avlfdnr8dj7b47msxv1vkd0xpnifp04v4scvgj0yaj"))))
948879ee 593
c2614688 594 (gnuzilla-fixes-patch
c7011ff8
MW
595 (local-file (search-patch "icecat-use-older-reveal-hidden-html.patch")))
596 (makeicecat-patch
597 (local-file (search-patch "icecat-makeicecat.patch"))))
948879ee
MW
598
599 (origin
600 (method computed-origin-method)
601 (file-name (string-append "icecat-" %icecat-version ".tar.xz"))
602 (sha256 #f)
603 (uri
604 (delay
605 (with-imported-modules '((guix build utils))
606 #~(begin
607 (use-modules (guix build utils))
608 (let ((firefox-dir
609 (string-append "firefox-" #$base-version))
610 (icecat-dir
ad21d767 611 (string-append "icecat-" #$%icecat-version)))
948879ee
MW
612
613 (mkdir "/tmp/bin")
614 (set-path-environment-variable
615 "PATH" '("bin")
616 (list "/tmp"
617 #+(canonical-package bash)
618 #+(canonical-package coreutils)
619 #+(canonical-package findutils)
620 #+(canonical-package patch)
621 #+(canonical-package xz)
622 #+(canonical-package sed)
623 #+(canonical-package grep)
624 #+(canonical-package bzip2)
625 #+(canonical-package gzip)
626 #+(canonical-package tar)
627 #+rename))
628
629 (symlink #+(file-append rename "/bin/rename")
630 "/tmp/bin/prename")
631
632 ;; We copy the gnuzilla source directory because it is
633 ;; read-only in 'gnuzilla-source', and the makeicecat script
634 ;; uses "cp -a" to copy parts of it and assumes that the
635 ;; copies will be writable.
636 (copy-recursively #+gnuzilla-source "/tmp/gnuzilla"
637 #:log (%make-void-port "w"))
638
639 (with-directory-excursion "/tmp/gnuzilla"
640 (make-file-writable "makeicecat")
c2614688
MW
641 (invoke "patch" "--force" "--no-backup-if-mismatch"
642 "-p1" "--input" #+gnuzilla-fixes-patch)
c7011ff8
MW
643 (invoke "patch" "--force" "--no-backup-if-mismatch"
644 "-p1" "--input" #+makeicecat-patch)
948879ee
MW
645 (patch-shebang "makeicecat")
646 (substitute* "makeicecat"
3e605b69
MW
647 (("^FFMAJOR=(.*)" all ffmajor)
648 (unless (string=? #$major-version
649 (string-trim-both ffmajor))
650 ;; The makeicecat script cannot be expected to work
651 ;; properly on a different version of Firefox, even if
652 ;; no errors occur during execution.
653 (error "makeicecat major version mismatch"))
948879ee
MW
654 (string-append "FFMAJOR=" #$major-version "\n"))
655 (("^FFMINOR=.*")
656 (string-append "FFMINOR=" #$minor-version "\n"))
657 (("^FFSUB=.*")
658 (string-append "FFSUB=" #$sub-version "\n"))
948879ee
MW
659 (("^DATA=.*")
660 "DATA=/tmp/gnuzilla/data\n")
948879ee
MW
661 (("/bin/sed")
662 #+(file-append (canonical-package sed) "/bin/sed"))))
663
664 (format #t "Unpacking upstream firefox tarball...~%")
665 (force-output)
666 (invoke "tar" "xf" #+upstream-firefox-source)
667 (rename-file firefox-dir icecat-dir)
668
669 (with-directory-excursion icecat-dir
ad21d767
MW
670 (format #t "Populating l10n directory...~%")
671 (force-output)
05947d92 672 (mkdir "l10n")
ad21d767
MW
673 (with-directory-excursion "l10n"
674 (for-each
675 (lambda (locale-dir)
676 (let ((locale
677 (string-drop (basename locale-dir)
678 (+ 32 ; length of hash
679 (string-length "-mozilla-locale-")))))
680 (format #t " ~a~%" locale)
681 (force-output)
682 (copy-recursively locale-dir locale
683 #:log (%make-void-port "w"))
684 (for-each make-file-writable (find-files locale))
685 (with-directory-excursion locale
686 (when (file-exists? ".hgtags")
687 (delete-file ".hgtags"))
688 (mkdir-p "browser/chrome/browser/preferences")
689 (call-with-output-file
690 "browser/chrome/browser/preferences/advanced-scripts.dtd"
691 (lambda (port) #f)))))
692 '#+all-mozilla-locales)
693 (copy-recursively #+mozilla-compare-locales
694 "compare-locales"
695 #:log (%make-void-port "w"))
696 (delete-file "compare-locales/.gitignore")
697 (delete-file "compare-locales/.hgignore")
698 (delete-file "compare-locales/.hgtags"))
699
948879ee
MW
700 (format #t "Running makeicecat script...~%")
701 (force-output)
ad21d767 702 (invoke "bash" "/tmp/gnuzilla/makeicecat"))
948879ee 703
34369f31 704 (format #t "Packing IceCat source tarball...~%")
948879ee
MW
705 (force-output)
706 (invoke "tar" "cfa" #$output
8cf160e1
MW
707 ;; Avoid non-determinism in the archive. We set the
708 ;; mtime of files in the archive to early 1980 because
709 ;; the build process fails if the mtime of source
710 ;; files is pre-1980, due to the creation of zip
711 ;; archives.
712 "--mtime=@315619200" ; 1980-01-02 UTC
948879ee
MW
713 "--owner=root:0"
714 "--group=root:0"
715 "--sort=name"
716 icecat-dir)
717
718 #t))))))))
719
be0f6112
AE
720(define-public icecat
721 (package
722 (name "icecat")
24886c13 723 (version %icecat-version)
46ce12d0 724 (source icecat-source)
be0f6112
AE
725 (build-system gnu-build-system)
726 (inputs
727 `(("alsa-lib" ,alsa-lib)
1ae6df81 728 ("bzip2" ,bzip2)
90e1cdae 729 ("cups" ,cups)
be0f6112 730 ("dbus-glib" ,dbus-glib)
90e1cdae
MW
731 ("gdk-pixbuf" ,gdk-pixbuf)
732 ("glib" ,glib)
002c3e6d
MW
733 ("gtk+" ,gtk+)
734 ("gtk+-2" ,gtk+-2)
c7011ff8 735 ;; UNBUNDLE-ME! ("graphite2" ,graphite2)
74c7af9f
MW
736 ("pango" ,pango)
737 ("freetype" ,freetype)
c7011ff8 738 ;; UNBUNDLE-ME! ("harfbuzz" ,harfbuzz)
90e1cdae
MW
739 ("libcanberra" ,libcanberra)
740 ("libgnome" ,libgnome)
7cba7647 741 ("libjpeg-turbo" ,libjpeg-turbo)
c7011ff8
MW
742 ;; UNBUNDLE-ME! ("libogg" ,libogg)
743 ;; UNBUNDLE-ME! ("libtheora" ,libtheora) ; wants theora-1.2, not yet released
744 ;; UNBUNDLE-ME! ("libvorbis" ,libvorbis)
74c7af9f 745 ("libxft" ,libxft)
94e96f7f 746 ("libevent" ,libevent)
90e1cdae
MW
747 ("libxinerama" ,libxinerama)
748 ("libxscrnsaver" ,libxscrnsaver)
9f7ae77f 749 ("libxcomposite" ,libxcomposite)
be0f6112 750 ("libxt" ,libxt)
1ae6df81 751 ("libffi" ,libffi)
e67ad553 752 ("ffmpeg" ,ffmpeg)
c7011ff8 753 ;; UNBUNDLE-ME! ("libvpx" ,libvpx)
f0648a4b 754 ("icu4c" ,icu4c-67)
13b284d9 755 ("pixman" ,pixman)
74c7af9f 756 ("pulseaudio" ,pulseaudio)
be0f6112 757 ("mesa" ,mesa)
90e1cdae 758 ("mit-krb5" ,mit-krb5)
6d328879 759 ;; See <https://bugs.gnu.org/32833>
6c83c483 760 ;; and related comments in the 'remove-bundled-libraries' phase.
6d328879
MW
761 ;; UNBUNDLE-ME! ("nspr" ,nspr)
762 ;; UNBUNDLE-ME! ("nss" ,nss)
429c8284 763 ("shared-mime-info" ,shared-mime-info)
c7011ff8 764 ;; UNBUNDLE-ME! ("sqlite" ,sqlite)
be0f6112 765 ("unzip" ,unzip)
1ae6df81 766 ("zip" ,zip)
c7011ff8
MW
767 ;; UNBUNDLE-ME! ("zlib" ,zlib)
768 ))
c4c4cc05 769 (native-inputs
46ce12d0
MW
770 ;; The following patches are specific to the Guix packaging of IceCat,
771 ;; and therefore we prefer to leave them out of 'source', which should be
772 ;; a tarball suitable for compilation on any system that IceCat supports.
773 ;; (Bug fixes and security fixes, however, should go in 'source').
ad21d767
MW
774 `(;; XXX TODO: Adapt these patches to IceCat 68.
775 ;; ("icecat-avoid-bundled-libraries.patch"
776 ;; ,(search-patch "icecat-avoid-bundled-libraries.patch"))
777 ;; ("icecat-use-system-graphite2+harfbuzz.patch"
778 ;; ,(search-patch "icecat-use-system-graphite2+harfbuzz.patch"))
779 ;; ("icecat-use-system-media-libs.patch"
780 ;; ,(search-patch "icecat-use-system-media-libs.patch"))
46ce12d0
MW
781
782 ("patch" ,(canonical-package patch))
783
c7011ff8
MW
784 ("rust" ,rust-1.41)
785 ("cargo" ,rust-1.41 "cargo")
786 ("rust-cbindgen" ,rust-cbindgen-0.14)
ad21d767
MW
787 ("llvm" ,llvm)
788 ("clang" ,clang)
e67ad553 789 ("perl" ,perl)
c7011ff8 790 ("node" ,node-10.22)
ad21d767
MW
791 ("python" ,python)
792 ("python-2" ,python-2)
c4c4cc05 793 ("python2-pysqlite" ,python2-pysqlite)
002c3e6d 794 ("yasm" ,yasm)
ad21d767 795 ("nasm" ,nasm) ; XXX FIXME: only needed on x86_64 and i686
bfb48f4f 796 ("pkg-config" ,pkg-config)
002c3e6d 797 ("autoconf" ,autoconf-2.13)
bfb48f4f 798 ("which" ,which)))
be0f6112 799 (arguments
74c7af9f
MW
800 `(#:tests? #f ; no check target
801 #:out-of-source? #t ; must be built outside of the source directory
73b1b4eb
LC
802
803 ;; XXX: There are RUNPATH issues such as
804 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
805 ;; which is not in its RUNPATH, but they appear to be harmless in
806 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
807 #:validate-runpath? #f
808
c7011ff8 809 #:configure-flags `("--enable-default-toolkit=cairo-gtk3-wayland"
9502ea3e
MW
810
811 "--with-distribution-id=org.gnu"
812
c7011ff8
MW
813 ;; Do not require addons in the global app or
814 ;; system directories to be signed by Mozilla.
815 "--with-unsigned-addon-scopes=app,system"
816 "--allow-addon-sideload"
34369f31 817
90e1cdae 818 "--enable-pulseaudio"
90e1cdae 819
9502ea3e
MW
820 "--disable-tests"
821 "--disable-updater"
822 "--disable-crashreporter"
9502ea3e 823 "--disable-eme"
e67ad553 824
90e1cdae 825 ;; Building with debugging symbols takes ~5GiB, so
1ae6df81
LC
826 ;; disable it.
827 "--disable-debug"
828 "--disable-debug-symbols"
829
8d956d86
MW
830 ;; Clang is needed to build Stylo, Mozilla's new
831 ;; CSS engine. We must specify the clang paths
832 ;; manually, because otherwise the Mozilla build
833 ;; system looks in the directories returned by
834 ;; llvm-config --bindir and llvm-config --libdir,
835 ;; which return paths in the llvm package where
836 ;; clang is not found.
837 ,(string-append "--with-clang-path="
838 (assoc-ref %build-inputs "clang")
839 "/bin/clang")
840 ,(string-append "--with-libclang-path="
841 (assoc-ref %build-inputs "clang")
842 "/lib")
843
5bdec7d6
MW
844 ;; Hack to work around missing
845 ;; "unofficial" branding in icecat.
bfb48f4f
MW
846 "--enable-official-branding"
847
90e1cdae 848 ;; Avoid bundled libraries.
7cba7647 849 "--with-system-jpeg" ; must be libjpeg-turbo
c7011ff8
MW
850 ;; UNBUNDLE-ME! "--with-system-zlib"
851 ;; UNBUNDLE-ME! "--with-system-bz2"
ad21d767
MW
852 ;; UNBUNDLE-ME! "--with-system-libevent"
853 ;; UNBUNDLE-ME! "--with-system-ogg"
854 ;; UNBUNDLE-ME! "--with-system-vorbis"
855 ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released
856 ;; UNBUNDLE-ME! "--with-system-libvpx"
f0648a4b
ZZ
857 "--with-system-icu"
858
6d328879 859 ;; See <https://bugs.gnu.org/32833>
6c83c483
MW
860 ;; and related comments in the
861 ;; 'remove-bundled-libraries' phase below.
6d328879
MW
862 ;; UNBUNDLE-ME! "--with-system-nspr"
863 ;; UNBUNDLE-ME! "--with-system-nss"
c7011ff8 864
ad21d767
MW
865 ;; UNBUNDLE-ME! "--with-system-harfbuzz"
866 ;; UNBUNDLE-ME! "--with-system-graphite2"
13b284d9 867 "--enable-system-pixman"
5b17fabc 868 "--enable-system-ffi"
ad21d767 869 ;; UNBUNDLE-ME! "--enable-system-sqlite"
1ae6df81 870
98a046cd
AE
871 ;; Fails with "--with-system-png won't work because
872 ;; the system's libpng doesn't have APNG support".
873 ;; According to
874 ;; http://sourceforge.net/projects/libpng-apng/ ,
875 ;; "the Animated Portable Network Graphics (APNG)
876 ;; is an unofficial extension of the Portable
877 ;; Network Graphics (PNG) format";
878 ;; we probably do not wish to support it.
1ae6df81 879 ;; "--with-system-png"
5b17fabc 880 )
1ae6df81 881
e80a4479 882 #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
7d141788 883
9f7ae77f 884 #:modules ((ice-9 ftw)
6cde5c34 885 (ice-9 rdelim)
37db2370 886 (ice-9 regex)
6cde5c34 887 (ice-9 match)
ad21d767
MW
888 (srfi srfi-34)
889 (srfi srfi-35)
429c8284
MW
890 (rnrs bytevectors)
891 (rnrs io ports)
892 (guix elf)
893 (guix build gremlin)
9f7ae77f 894 ,@%gnu-build-system-modules)
be0f6112 895 #:phases
90e1cdae 896 (modify-phases %standard-phases
46ce12d0
MW
897 (add-after 'unpack 'apply-guix-specific-patches
898 (lambda* (#:key inputs native-inputs #:allow-other-keys)
899 (let ((patch (string-append (assoc-ref (or native-inputs inputs)
900 "patch")
901 "/bin/patch")))
902 (for-each (match-lambda
903 ((label . file)
904 (when (and (string-prefix? "icecat-" label)
905 (string-suffix? ".patch" label))
906 (format #t "applying '~a'...~%" file)
907 (invoke patch "--force" "--no-backup-if-mismatch"
908 "-p1" "--input" file))))
909 (or native-inputs inputs)))
910 #t))
911 (add-after 'apply-guix-specific-patches 'remove-bundled-libraries
912 (lambda _
913 ;; Remove bundled libraries that we don't use, since they may
914 ;; contain unpatched security flaws, they waste disk space and
915 ;; memory, and may cause confusion.
916 (for-each (lambda (file)
917 (format #t "deleting '~a'...~%" file)
918 (delete-file-recursively file))
919 '(;; FIXME: Removing the bundled icu breaks configure.
920 ;; * The bundled icu headers are used in some places.
921 ;; * The version number is taken from the bundled copy.
922 ;;"intl/icu"
923 ;;
924 ;; FIXME: A script from the bundled nspr is used.
925 ;;"nsprpub"
926 ;;
927 ;; FIXME: With the update to IceCat 60, using system NSS
928 ;; broke certificate validation. See
929 ;; <https://bugs.gnu.org/32833>. For now, we use
930 ;; the bundled NSPR and NSS. TODO: Investigate,
931 ;; and try to unbundle these libraries again.
932 ;; UNBUNDLE-ME! "security/nss"
933 ;;
934 ;; TODO: Use more system media libraries. See:
935 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
936 ;; * libtheora: esr60 wants v1.2, not yet released.
937 ;; * soundtouch: avoiding the bundled library would
938 ;; result in some loss of functionality. There's
939 ;; also an issue with exception handling
940 ;; configuration. It seems that this is needed in
941 ;; some moz.build:
942 ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1
943 ;; * libopus
944 ;; * speex
945 ;;
946 "modules/freetype2"
ad21d767 947 ;; "media/libjpeg" ; needed for now, because media/libjpeg/moz.build is referenced from config/external/moz.build
c7011ff8 948 ;; UNBUNDLE-ME! "modules/zlib"
ad21d767
MW
949 ;; UNBUNDLE-ME! "ipc/chromium/src/third_party/libevent"
950 ;; UNBUNDLE-ME! "media/libvpx"
951 ;; UNBUNDLE-ME! "media/libogg"
952 ;; UNBUNDLE-ME! "media/libvorbis"
953 ;; UNBUNDLE-ME! "media/libtheora" ; wants theora-1.2, not yet released
954 ;; UNBUNDLE-ME! "media/libtremor"
955 ;; UNBUNDLE-ME! "gfx/harfbuzz"
956 ;; UNBUNDLE-ME! "gfx/graphite2"
46ce12d0 957 "js/src/ctypes/libffi"
ad21d767
MW
958 ;; UNBUNDLE-ME! "db/sqlite3"
959 ))
46ce12d0
MW
960 #t))
961 (add-after 'remove-bundled-libraries 'link-libxul-with-libraries
962 (lambda _
963 ;; libxul.so dynamically opens libraries, so here we explicitly
964 ;; link them into libxul.so instead.
965 ;;
966 ;; TODO: It might be preferable to patch in absolute file names in
967 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
968 ;; work. More investigation is needed.
969 (substitute* "toolkit/library/moz.build"
970 (("^# This library needs to be last" all)
971 (string-append "OS_LIBS += [
9f7ae77f 972 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
002c3e6d 973 'avcodec', 'avutil', 'pulse' ]\n\n"
46ce12d0
MW
974 all)))
975 #t))
8e556719
JL
976 (add-after 'link-libxul-with-libraries 'fix-ffmpeg-runtime-linker
977 (lambda* (#:key inputs #:allow-other-keys)
429c8284
MW
978 (let* ((ffmpeg (assoc-ref inputs "ffmpeg"))
979 (libavcodec (string-append ffmpeg "/lib/libavcodec.so")))
980 ;; Arrange to load libavcodec.so by its absolute file name.
981 (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
982 (("libavcodec\\.so")
983 libavcodec))
984 ;; Populate the sandbox read-path whitelist as needed by ffmpeg.
985 (let* ((mime-info (assoc-ref inputs "shared-mime-info"))
986 (libavcodec-runpath (call-with-input-file libavcodec
987 (compose elf-dynamic-info-runpath
988 elf-dynamic-info
989 parse-elf
990 get-bytevector-all)))
991 (whitelist (cons (string-append mime-info "/share/mime/")
992 (map (lambda (dir)
993 (string-append dir "/"))
994 libavcodec-runpath)))
995 (whitelist-string (string-join whitelist ","))
996 (port (open-file "browser/app/profile/icecat.js" "a")))
997 (format #t "setting 'security.sandbox.content.read_path_whitelist' to '~a'~%"
998 whitelist-string)
999 (format port "~%pref(\"security.sandbox.content.read_path_whitelist\", ~S);~%"
1000 whitelist-string)
1001 (close-output-port port))
1002 #t)))
94e96f7f
MW
1003 (replace 'bootstrap
1004 (lambda _
46ce12d0
MW
1005 (invoke "sh" "-c" "autoconf old-configure.in > old-configure")
1006 ;; 'configure' must be newer than 'old-configure.in', or else the
1007 ;; build system will raise an alarm and abort.
1008 (invoke "touch" "configure")))
e67ad553 1009 (add-after 'patch-source-shebangs 'patch-cargo-checksums
257e3247 1010 (lambda _
7d141788 1011 (use-modules (guix build cargo-utils))
e88735b4 1012 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
c7011ff8
MW
1013 (for-each (lambda (file)
1014 (format #t "patching checksums in ~a~%" file)
981cdc90 1015 (substitute* file
c7011ff8
MW
1016 (("^checksum = \".*\"")
1017 (string-append "checksum = \"" null-hash "\""))))
1018 (find-files "." "Cargo.lock$"))
1019 (for-each generate-all-checksums
1020 '("services"
1021 "js"
1022 "third_party/rust"
1023 "dom/media"
1024 "dom/webauthn"
1025 "toolkit"
1026 "gfx"
1027 "storage"
1028 "modules"
1029 "xpcom/rust"
1030 "media"
1031 "mozglue/static/rust"
1032 "netwerk"
1033 "remote"
1034 "intl"
1035 "servo"
1036 "security/manager/ssl"
1037 "build")))
e67ad553 1038 #t))
46ce12d0
MW
1039 (replace 'configure
1040 ;; configure does not work followed by both "SHELL=..." and
1041 ;; "CONFIG_SHELL=..."; set environment variables instead
1042 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1043 (let* ((out (assoc-ref outputs "out"))
1044 (bash (which "bash"))
1045 (abs-srcdir (getcwd))
1046 (srcdir (string-append "../" (basename abs-srcdir)))
1047 (flags `(,(string-append "--prefix=" out)
1048 ,(string-append "--with-l10n-base="
1049 abs-srcdir "/l10n")
1050 ,@configure-flags)))
1051 (setenv "SHELL" bash)
1052 (setenv "CONFIG_SHELL" bash)
1053 (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13
1054 (setenv "CC" "gcc") ; apparently needed when Stylo is enabled
7a1b2ba5 1055 (setenv "MOZ_BUILD_DATE" ,%icecat-build-id) ; avoid timestamp
46ce12d0
MW
1056 (mkdir "../build")
1057 (chdir "../build")
1058 (format #t "build directory: ~s~%" (getcwd))
1059 (format #t "configure flags: ~s~%" flags)
1060 (apply invoke bash
1061 (string-append srcdir "/configure")
1062 flags))))
ad21d767
MW
1063 (replace 'build
1064 ;; The build system often spuriously fails. See
1065 ;; <https://bugs.gentoo.org/show_bug.cgi?id=680934>. To
1066 ;; work around this, we try the standard 'build' phase up
1067 ;; to 5 times.
1068 (lambda args
1069 (let ((build (assoc-ref %standard-phases 'build)))
1070 (let retry ((remaining-attempts 5))
1071 (if (= remaining-attempts 1)
1072 (apply build args)
1073 (guard (c ((invoke-error? c)
1074 (format #t "~%Retrying build! (~a attempts remaining)~%~%"
1075 (- remaining-attempts 1))
1076 (force-output)
1077 (retry (- remaining-attempts 1))))
1078 (apply build args)))))))
37db2370
JK
1079 (add-after 'build 'neutralise-store-references
1080 (lambda _
1081 ;; Mangle the store references to compilers & other build tools in
1082 ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64.
1083 (substitute*
1084 "dist/bin/chrome/toolkit/content/global/buildconfig.html"
1085 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1086 (regexp-quote (%store-directory)))
1087 _ store hash)
1088 (string-append store
1089 (string-take hash 8)
1090 "<!-- Guix: not a runtime dependency -->"
1091 (string-drop hash 8))))
1092 #t))
6cde5c34
LC
1093 (add-before 'configure 'install-desktop-entry
1094 (lambda* (#:key outputs #:allow-other-keys)
1095 ;; Install the '.desktop' file.
05947d92
MW
1096 (let* ((desktop-file "taskcluster/docker/icecat-snap/icecat.desktop")
1097 (out (assoc-ref outputs "out"))
6cde5c34 1098 (applications (string-append out "/share/applications")))
05947d92
MW
1099 (substitute* desktop-file
1100 (("^Exec=icecat") (string-append "Exec=" out "/bin/icecat"))
1101 (("IceCat") "GNU IceCat")
1102 (("Icon=.*") "Icon=icecat\n")
1103 (("NewWindow") "new-window")
1104 (("NewPrivateWindow") "new-private-window"))
1105 (install-file desktop-file applications)
88a8ce87
AG
1106 #t)))
1107 (add-after 'install-desktop-entry 'install-icons
1108 (lambda* (#:key outputs #:allow-other-keys)
1109 (let ((out (assoc-ref outputs "out")))
1110 (with-directory-excursion "browser/branding/official"
1111 (for-each
1112 (lambda (file)
1113 (let* ((size (string-filter char-numeric? file))
1114 (icons (string-append out "/share/icons/hicolor/"
1115 size "x" size "/apps")))
1116 (mkdir-p icons)
1117 (copy-file file (string-append icons "/icecat.png"))))
1118 '("default16.png" "default22.png" "default24.png"
1119 "default32.png" "default48.png" "content/icon64.png"
3f27124e
MW
1120 "mozicon128.png" "default256.png"))
1121 #t))))
6e75740f
CL
1122 ;; This fixes the file chooser crash that happens with GTK 3.
1123 (add-after 'install 'wrap-program
1124 (lambda* (#:key inputs outputs #:allow-other-keys)
1125 (let* ((out (assoc-ref outputs "out"))
1126 (lib (string-append out "/lib"))
1127 (gtk (assoc-ref inputs "gtk+"))
ad21d767 1128 (gtk-share (string-append gtk "/share"))
9c6ea3cb
EZ
1129 (mesa (assoc-ref inputs "mesa"))
1130 (mesa-lib (string-append mesa "/lib"))
ad21d767 1131 (pulseaudio (assoc-ref inputs "pulseaudio"))
f11d4290
IK
1132 (pulseaudio-lib (string-append pulseaudio "/lib"))
1133 (libxscrnsaver (assoc-ref inputs "libxscrnsaver"))
1134 (libxscrnsaver-lib (string-append libxscrnsaver "/lib")))
6e75740f 1135 (wrap-program (car (find-files lib "^icecat$"))
ad21d767 1136 `("XDG_DATA_DIRS" prefix (,gtk-share))
c7011ff8
MW
1137 ;; The following line is commented out because the icecat
1138 ;; package on guix has been observed to be unstable when
1139 ;; using wayland, and the bundled extensions stop working.
1140 ;; `("MOZ_ENABLE_WAYLAND" = ("1"))
f11d4290 1141 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib ,mesa-lib ,libxscrnsaver-lib)))
3f27124e 1142 #t))))))
6fd52309 1143 (home-page "https://www.gnu.org/software/gnuzilla/")
be0f6112
AE
1144 (synopsis "Entirely free browser derived from Mozilla Firefox")
1145 (description
1146 "IceCat is the GNU version of the Firefox browser. It is entirely free
c5779c93 1147software, which does not recommend non-free plugins and addons. It also
ad21d767
MW
1148features built-in privacy-protecting features.
1149
c7011ff8 1150WARNING: IceCat 78 has not yet been released by the upstream IceCat project.
ad21d767
MW
1151This is a preview release, and does not currently meet the privacy-respecting
1152standards of the IceCat project.")
63e8bb12 1153 (license license:mpl2.0) ;and others, see toolkit/content/license.html
99effc8f
LC
1154 (properties
1155 `((ftp-directory . "/gnu/gnuzilla")
1156 (cpe-name . "firefox_esr")
bfb48f4f 1157 (cpe-version . ,(first (string-split version #\-)))))))
f5301f00 1158
b14aab67 1159;; Update this together with icecat!
9dc27bc3 1160(define %icedove-build-id "20200926000000") ;must be of the form YYYYMMDDhhmmss
b14aab67
JB
1161(define-public icedove
1162 (package
1163 (name "icedove")
9dc27bc3 1164 (version "78.3.1")
597aa644 1165 (source icecat-source)
b14aab67
JB
1166 (properties
1167 `((cpe-name . "thunderbird_esr")))
1168 (build-system gnu-build-system)
1169 (arguments
1170 `(#:tests? #f ; no check target
1171 #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
1172 #:modules ((guix build utils) ;find-files
1173 (sxml simple)
1174 (ice-9 regex)
1175 ,@%gnu-build-system-modules)
1176 #:phases
1177 (modify-phases %standard-phases
1178 (add-after 'unpack 'prepare-thunderbird-sources
1179 (lambda* (#:key inputs #:allow-other-keys)
1180 (mkdir "comm")
1181 (copy-recursively (assoc-ref inputs "thunderbird-sources")
1182 "comm")
1183 (delete-file-recursively "obj-x86_64-pc-linux-gnu")
1184 (delete-file "sourcestamp.txt")
1185 #t))
1186 (add-after 'patch-source-shebangs 'patch-cargo-checksums
1187 (lambda _
1188 (use-modules (guix build cargo-utils))
1189 (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
597aa644
JB
1190 (for-each (lambda (file)
1191 (format #t "patching checksums in ~a~%" file)
1192 (substitute* file
1193 (("^checksum = \".*\"")
1194 (string-append "checksum = \"" null-hash "\""))))
1195 (find-files "." "Cargo.lock$"))
1196 (for-each generate-all-checksums
1197 '("third_party/rust"
1198 "toolkit/library/rust")))
b14aab67
JB
1199 #t))
1200 ;; Fixes issue where each installation directory generates its own profile.
1201 ;; See e.g. https://trac.torproject.org/projects/tor/ticket/31457
1202 (add-after 'patch-source-shebangs 'fix-profile-setting
1203 (lambda _
1204 (substitute* "comm/mail/moz.configure"
1205 (("'MOZ_DEDICATED_PROFILES', True")
1206 "'MOZ_DEDICATED_PROFILES', False"))
1207 #t))
1208 (add-after 'prepare-thunderbird-sources 'rename-to-icedove
1209 (lambda _
1210 (substitute* "comm/mail/confvars.sh"
1211 (("MOZ_APP_BASENAME=Thunderbird")
1212 "MOZ_APP_BASENAME=Icedove\nMOZ_APP_DISPLAYNAME=Icedove")
1213 (("MOZ_APP_NAME=thunderbird")
1214 "MOZ_APP_NAME=icedove")
1215 (("MOZ_UPDATER=1")
1216 "MOZ_UPDATER=0"))
1217 ;; Remove branding to comply with Mozilla's trademark policy
1218 (with-directory-excursion "comm/mail/branding/nightly"
1219 (delete-file "content/about-wordmark.svg")
1220 (call-with-output-file "content/about-wordmark.svg"
1221 (lambda (port)
1222 (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg")
1223 (viewBox "0 0 789.1 90.78")
1224 (width "333")
1225 (height "48")
1226 (fill "#fff"))
1227 (text (@ (x "400") (y "70")
1228 (text-anchor "middle")
1229 (font-size "90"))
1230 "Icedove Daily"))
1231 port)))
1232 (substitute* '("locales/en-US/brand.properties"
1233 "locales/en-US/brand.ftl"
1234 "locales/en-US/brand.dtd"
1235 "configure.sh")
1236 (("Thunderbird") "Icedove")
1237 (("mozilla.org") "guix.gnu.org")))
1238 ;; Remove other mentions of Thunderbird in user-visible text.
1239 (with-directory-excursion "comm/mail/base/content"
597aa644 1240 (substitute* '("overrides/app-license-name.html")
b14aab67
JB
1241 (("Thunderbird") "Icedove")))
1242 (with-directory-excursion "comm/mail/components/"
597aa644 1243 (substitute* '("MailGlue.jsm"
b14aab67
JB
1244 "extensions/schemas/addressBook.json"
1245 "extensions/schemas/tabs.json"
1246 "extensions/schemas/cloudFile.json"
1247 "extensions/schemas/chrome_settings_overrides.json"
1248 "extensions/schemas/windows.json"
1249 "extensions/parent/ext-mail.js"
1250 "im/messages/mail/Info.plist"
1251 "enterprisepolicies/moz.build"
1252 "enterprisepolicies/helpers/moz.build"
597aa644 1253 "enterprisepolicies/schemas/moz.build")
b14aab67 1254 (("Thunderbird") "Icedove")))
b14aab67 1255 (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js"
b14aab67
JB
1256 "comm/common/src/customizeToolbar.js")
1257 (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e)
1258 (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e)))
1259
1260 ;; Override addon URLs and settings
1261 (substitute* "comm/mail/app/profile/all-thunderbird.js"
1262 (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m)
1263 (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");"))
1264 (("(pref\\(\"extensions.getAddons.search.url\").*" _ m)
1265 (string-append m ", \"https://guix.gnu.org/packages\");"))
1266 (("(pref\\(\"extensions.update.enabled\").*" _ m)
1267 (string-append m ", false);"))
1268 (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m)
1269 (string-append m ", false);"))
1270 (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m)
1271 (string-append m ", false);")))
1272 #t))
1273 (add-after 'build 'neutralize-store-references
1274 (lambda _
1275 ;; Mangle the store references to compilers & other build tools in
1276 ;; about:buildconfig, reducing Icedove's closure significant.
1277 ;; The resulting files are saved in lib/thunderbird/omni.ja
1278 (substitute*
1279 ;; Use find because the path "obj-x86_64-pc-linux-gnu" contains
1280 ;; the architecture and the system -> more complicated.
1281 (find-files "." "buildconfig.html")
1282 (((format #f "(~a/)([0-9a-df-np-sv-z]{32})"
1283 (regexp-quote (%store-directory)))
1284 _ store hash)
1285 (string-append store
1286 (string-take hash 8)
1287 "<!-- Guix: not a runtime dependency -->"
1288 (string-drop hash 8))))
1289 #t))
1290 (replace 'configure
1291 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
1292 (let* ((out (assoc-ref outputs "out"))
1293 (bash (which "bash"))
1294 (abs-srcdir (getcwd))
1295 (srcdir (string-append "../" (basename abs-srcdir)))
1296 (flags `(,(string-append "--prefix=" out)
1297 ,@configure-flags))
1298 (mozconfig (string-append (getcwd) "/.mozconfig")))
1299 (setenv "SHELL" bash)
1300 (setenv "AUTOCONF"
1301 (string-append (assoc-ref %build-inputs
1302 "autoconf")
1303 "/bin/autoconf"))
1304 (setenv "CONFIG_SHELL" bash)
1305 (setenv "QA_CONFIGURE_OPTIONS" ".*")
1306 (setenv "MOZBUILD_STATE_PATH"
1307 (string-append (getcwd) "/mach_state"))
1308 (setenv "MOZCONFIG"
1309 (string-append (getcwd) "/.mozconfig"))
1310 (setenv "CC" "gcc")
1311 (setenv "MOZ_NOSPAM" "1")
1312 (setenv "PYTHON"
1313 (string-append (assoc-ref inputs "python2")
1314 "/bin/python"))
1315 (setenv "MOZ_BUILD_DATE" ,%icedove-build-id) ; avoid timestamp
1316 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1317 (assoc-ref outputs "out")
1318 "/lib/icedove"))
1319 (mkdir-p (string-append (getcwd) "/builddir"))
1320 (with-output-to-file mozconfig
1321 (lambda ()
1322 (display
1323 (string-append
1324 "ac_add_options --disable-crashreporter\n"
1325 "ac_add_options --disable-debug\n"
1326 "ac_add_options --disable-debug-symbols\n"
1327 "ac_add_options --disable-elf-hack\n"
597aa644 1328 "ac_add_options --disable-jit\n"
b14aab67
JB
1329 "ac_add_options --disable-necko-wifi\n"
1330 "ac_add_options --disable-official-branding\n"
1331 "ac_add_options --disable-tests\n"
1332 "ac_add_options --disable-updater\n"
1333 "ac_add_options --disable-webrtc\n"
1334 "ac_add_options --enable-application=comm/mail\n"
1335 "ac_add_options --enable-calendar\n"
b14aab67
JB
1336 "ac_add_options --enable-default-toolkit=\"cairo-gtk3\"\n"
1337 "ac_add_options --enable-optimize\n"
1338 "ac_add_options --enable-pulseaudio\n"
1339 "ac_add_options --enable-release\n"
b14aab67
JB
1340 "ac_add_options --enable-strip\n"
1341 "ac_add_options --enable-system-ffi\n"
1342 "ac_add_options --enable-system-pixman\n"
b14aab67
JB
1343 "ac_add_options --prefix=" out "\n"
1344 "ac_add_options --with-clang-path=" (assoc-ref %build-inputs "clang") "/bin/clang\n"
1345 "ac_add_options --with-distribution-id=org.gnu\n"
1346 "ac_add_options --with-libclang-path=" (assoc-ref %build-inputs "clang") "/lib\n"
1347 "ac_add_options --with-system-bz2\n"
1348 "ac_add_options --with-system-icu\n"
1349 "ac_add_options --with-system-jpeg\n"
1350 "ac_add_options --with-system-libevent\n"
1351 "ac_add_options --with-system-nspr\n"
1352 "ac_add_options --with-system-nss\n"
1353 "ac_add_options --with-system-zlib\n"
1354 "ac_add_options --with-user-appdir=\\.icedove\n"))))
1355 (display (getcwd))
1356 (newline)
1357 (display "mach configure")
1358 (invoke "./mach" "configure"))))
1359 (replace 'build
1360 (lambda _ (invoke "./mach" "build")))
1361 (replace 'install
1362 (lambda _ (invoke "./mach" "install")))
964ba656
JB
1363 ;; Thunderbird doesn't provide any .desktop file.
1364 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
1365 (add-after 'install 'install-desktop-file
1366 (lambda* (#:key outputs #:allow-other-keys)
1367 (let* ((out (assoc-ref outputs "out"))
1368 (apps (string-append out "/share/applications")))
1369 (mkdir-p apps)
1370 (with-output-to-file (string-append apps "/icedove.desktop")
1371 (lambda _
1372 (format #t
1373 "[Desktop Entry]~@
1374 Name=Icedove~@
1375 Exec=~a/bin/icedove~@
1376 Icon=icedove~@
1377 GenericName=Mail/News Client~@
1378 Categories=Network;Email;~@
1379 Terminal=false~@
1380 StartupNotify=true~@
1381 MimeType=x-scheme-handler/mailto;~@
1382 Type=Application~@
1383 Actions=ComposeMessage;~@
1384 [Desktop Action ComposeMessage]~@
1385 Name=Write new message~@
1386 Exec=~@*~a/bin/icedove -compose~%"
1387 out))))
1388 #t))
b14aab67
JB
1389 (add-after 'install 'wrap-program
1390 (lambda* (#:key inputs outputs #:allow-other-keys)
1391 (let* ((out (assoc-ref outputs "out"))
1392 (lib (string-append out "/lib"))
1393 (gtk (assoc-ref inputs "gtk+"))
1394 (gtk-share (string-append gtk "/share"))
1395 (pulseaudio (assoc-ref inputs "pulseaudio"))
1396 (pulseaudio-lib (string-append pulseaudio "/lib")))
1397 (wrap-program (car (find-files lib "^icedove$"))
1398 `("XDG_DATA_DIRS" prefix (,gtk-share))
1399 `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib)))
1400 #t))))))
1401 (inputs
1402 `(("bzip2" ,bzip2)
1403 ("cairo" ,cairo)
1404 ("cups" ,cups)
1405 ("dbus-glib" ,dbus-glib)
1406 ("ffmpeg" ,ffmpeg)
1407 ("freetype" ,freetype)
1408 ("gdk-pixbuf" ,gdk-pixbuf)
1409 ("glib" ,glib)
1410 ("gtk+" ,gtk+)
1411 ("gtk+-2" ,gtk+-2)
1412 ("hunspell" ,hunspell)
597aa644 1413 ("icu4c" ,icu4c-67)
b14aab67
JB
1414 ("libcanberra" ,libcanberra)
1415 ("libevent" ,libevent)
1416 ("libffi" ,libffi)
1417 ("libgnome" ,libgnome)
1418 ("libjpeg-turbo" ,libjpeg-turbo)
1419 ("libpng-apng" ,libpng-apng)
1420 ("libvpx" ,libvpx)
1421 ("libxcomposite" ,libxcomposite)
1422 ("libxft" ,libxft)
1423 ("libxinerama" ,libxinerama)
1424 ("libxscrnsaver" ,libxscrnsaver)
1425 ("libxt" ,libxt)
1426 ("mesa" ,mesa)
1427 ("mit-krb5" ,mit-krb5)
1428 ("nspr" ,nspr)
df3752e1 1429 ("nss" ,nss-3.57)
b14aab67
JB
1430 ("pango" ,pango)
1431 ("pixman" ,pixman)
1432 ("pulseaudio" ,pulseaudio)
1433 ("sqlite" ,sqlite)
1434 ("startup-notification" ,startup-notification)
1435 ("unzip" ,unzip)
1436 ("zip" ,zip)
1437 ("zlib" ,zlib)))
1438 (native-inputs
1439 `(("thunderbird-sources"
1440 ;; The changeset identifier is taken from the file "sourcestamp.txt"
1441 ;; in the Thunderbird release tarball. We don't use the release
1442 ;; tarball because it duplicates the Icecat sources and only adds the
1443 ;; "comm" directory, which is provided by this repository.
9dc27bc3 1444 ,(let ((changeset "00912779d73faef4277c57fe99aa5259b11d244d"))
b14aab67
JB
1445 (origin
1446 (method hg-fetch)
1447 (uri (hg-reference
597aa644 1448 (url "https://hg.mozilla.org/releases/comm-esr78")
b14aab67
JB
1449 (changeset changeset)))
1450 (file-name (string-append "thunderbird-" version "-checkout"))
1451 (sha256
1452 (base32
9dc27bc3 1453 "12isvk6q8miwn81kimrgcmjh4vsmdbbx93q9pafgxlx3p92s5v8h")))))
b14aab67 1454 ("autoconf" ,autoconf-2.13)
597aa644 1455 ("cargo" ,rust-1.41 "cargo")
b14aab67
JB
1456 ("clang" ,clang)
1457 ("llvm" ,llvm)
1458 ("nasm" ,nasm)
597aa644 1459 ("node" ,node-10.22)
b14aab67
JB
1460 ("perl" ,perl)
1461 ("pkg-config" ,pkg-config)
1462 ("python" ,python)
1463 ("python2" ,python-2.7)
597aa644
JB
1464 ("rust" ,rust-1.41)
1465 ("rust-cbindgen" ,rust-cbindgen-0.14)
b14aab67
JB
1466 ("which" ,which)
1467 ("yasm" ,yasm)))
1468 (home-page "https://www.thunderbird.net")
1469 (synopsis "Rebranded Mozilla Thunderbird email client")
1470 (description
1471 "This package provides an email client built based on Mozilla
1472Thunderbird. It supports email, news feeds, chat, calendar and contacts.")
1473 (license license:mpl2.0)))
1474
167a0ce0
OP
1475(define-public firefox-decrypt
1476 (package
1477 (name "firefox-decrypt")
1478 (version "0.7.0")
1479 (source (origin
1480 (method git-fetch)
1481 (uri (git-reference
b0e7b699 1482 (url "https://github.com/Unode/firefox_decrypt")
167a0ce0
OP
1483 (commit version)))
1484 (file-name (git-file-name name version))
1485 (sha256
1486 (base32
1487 "17yyyxp47z4m8hnflcq34rc1y871515kr3f1y42j1l0yx3g0il07"))))
1488 (build-system trivial-build-system)
1489 (inputs
1490 `(("nss" ,nss)
1491 ("python" ,python)))
1492 (arguments
1493 `(#:modules ((guix build utils))
1494 #:builder
1495 (begin
1496 (use-modules (guix build utils))
1497 (setenv "PATH"
1498 (string-append
1499 (assoc-ref %build-inputs "python") "/bin"))
1500 (copy-file (string-append (assoc-ref %build-inputs "source")
1501 "/firefox_decrypt.py")
1502 "firefox_decrypt.py")
1503 (substitute* "firefox_decrypt.py"
1504 (("/usr/bin/env python") (which "python3"))
1505 (("libnss3.so") (string-append (assoc-ref %build-inputs "nss")
1506 "/lib/nss/libnss3.so")))
1507 (install-file "firefox_decrypt.py" (string-append %output "/bin"))
1508 #t)))
1509 (home-page "https://github.com/Unode/firefox_decrypt/")
1510 (synopsis "Tool to extract passwords from Mozilla profiles")
1511 (description "Firefox Decrypt is a tool to extract passwords from
1512Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.")
1513 (license license:gpl3+)))