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 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
6 ;;; Copyright © 2016, 2017, 2018 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 Nils Gillmann <ng0@n0.is>
10 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages gnuzilla)
29 #:use-module ((srfi srfi-1) #:hide (zip))
30 #:use-module (ice-9 match)
31 #:use-module (gnu packages)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix utils)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system cargo)
39 #:use-module (gnu packages audio)
40 #:use-module (gnu packages autotools)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages databases)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages gtk)
46 #:use-module (gnu packages gnome)
47 #:use-module (gnu packages libcanberra)
48 #:use-module (gnu packages cups)
49 #:use-module (gnu packages kerberos)
50 #:use-module (gnu packages linux)
51 #:use-module (gnu packages perl)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages fontutils)
55 #:use-module (gnu packages libevent)
56 #:use-module (gnu packages libreoffice) ;for hunspell
57 #:use-module (gnu packages image)
58 #:use-module (gnu packages libffi)
59 #:use-module (gnu packages pulseaudio)
60 #:use-module (gnu packages python)
61 #:use-module (gnu packages python-xyz)
62 #:use-module (gnu packages xorg)
63 #:use-module (gnu packages gl)
64 #:use-module (gnu packages assembly)
65 #:use-module (gnu packages rust)
66 #:use-module (gnu packages llvm)
67 #:use-module (gnu packages icu4c)
68 #:use-module (gnu packages video)
69 #:use-module (gnu packages xiph)
70 #:use-module (gnu packages xdisorg)
71 #:use-module (gnu packages readline)
72 #:use-module (gnu packages sqlite))
81 "https://ftp.mozilla.org/pub/mozilla.org/js/"
82 name version ".tar.gz"))
85 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))
86 (patches (search-patches "mozjs17-aarch64-support.patch"))
87 (modules '((guix build utils)))
89 ;; Fix incompatibility with Perl 5.22+.
91 (substitute* '("js/src/config/milestone.pl")
92 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE"))
94 (build-system gnu-build-system)
97 ("pkg-config" ,pkg-config)
98 ("python" ,python-2)))
100 `(("nspr" ,nspr))) ; in the Requires.private field of mozjs-17.0.pc
104 `(;; XXX: parallel build fails, lacking:
105 ;; mkdir -p "system_wrapper_js/"
108 (modify-phases %standard-phases
109 (add-after 'unpack 'delete-timedout-test
110 ;; This test times out on slower hardware.
112 (delete-file "js/src/jit-test/tests/basic/bug698584.js")
114 (add-before 'configure 'chdir
119 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
120 (lambda* (#:key outputs #:allow-other-keys)
121 (let ((out (assoc-ref outputs "out")))
122 (setenv "SHELL" (which "sh"))
123 (setenv "CONFIG_SHELL" (which "sh"))
124 (invoke "./configure" (string-append "--prefix=" out)
125 ,@(if (string=? "aarch64-linux"
127 '("--host=aarch64-unknown-linux-gnu")
130 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey")
131 (synopsis "Mozilla javascript engine")
132 (description "SpiderMonkey is Mozilla's JavaScript engine written
134 (license license:mpl2.0))) ; and others for some files
136 (define-public mozjs-24
137 (package (inherit mozjs)
143 "https://ftp.mozilla.org/pub/mozilla.org/js/"
144 name "-" version ".tar.bz2"))
147 "1n1phk8r3l8icqrrap4czplnylawa0ddc2cc4cgdz46x3lrkybz6"))
148 (modules '((guix build utils)))
149 (patches (search-patches "mozjs24-aarch64-support.patch"))
151 ;; Fix incompatibility with Perl 5.22+.
153 (substitute* '("js/src/config/milestone.pl")
154 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE"))
157 (substitute-keyword-arguments (package-arguments mozjs)
159 `(modify-phases ,phases
161 (lambda* (#:key outputs #:allow-other-keys)
162 (let ((out (assoc-ref outputs "out")))
163 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
164 (setenv "SHELL" (which "sh"))
165 (setenv "CONFIG_SHELL" (which "sh"))
166 (invoke "./configure"
167 (string-append "--prefix=" out)
169 "--enable-system-ffi"
170 "--enable-threadsafe"
171 ,@(if (string=? "aarch64-linux"
173 '("--host=aarch64-unknown-linux-gnu")
179 (define-public mozjs-38
183 (version "38.2.1.rc0")
187 "https://people.mozilla.org/~sstangl/"
188 name "-" version ".tar.bz2"))
191 "0p4bmbpgkfsj54xschcny0a118jdrdgg0q29rwxigg3lh5slr681"))
194 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1269317 for
195 ;; GCC 6 compatibility.
197 "mozjs38-version-detection.patch" ; for 0ad
198 "mozjs38-tracelogger.patch"
200 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1339931.
201 "mozjs38-pkg-config-version.patch"
202 "mozjs38-shell-version.patch"))
203 (modules '((guix build utils)))
206 ;; Fix incompatibility with sed 4.4.
207 (substitute* "js/src/configure"
208 (("\\^\\[:space:\\]") "^[[:space:]]"))
210 ;; The headers are symlinks to files that are in /tmp, so they
211 ;; end up broken. Copy them instead.
213 "python/mozbuild/mozbuild/backend/recursivemake.py"
214 (("\\['dist_include'\\].add_symlink")
215 "['dist_include'].add_copy"))
217 ;; Remove bundled libraries.
218 (for-each delete-file-recursively
220 "js/src/ctypes/libffi"
221 "js/src/ctypes/libffi-patches"
225 `(;; XXX: parallel build fails, lacking:
226 ;; mkdir -p "system_wrapper_js/"
228 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1008470.
231 (modify-phases %standard-phases
233 (lambda* (#:key outputs #:allow-other-keys)
234 (let ((out (assoc-ref outputs "out")))
236 (setenv "SHELL" (which "sh"))
237 (setenv "CONFIG_SHELL" (which "sh"))
238 (invoke "./configure"
239 (string-append "--prefix=" out)
241 "--enable-gcgenerational"
246 "--enable-system-ffi"
247 "--enable-threadsafe"
248 "--enable-xterm-updates"
253 ;; Intl API requires bundled ICU.
254 "--without-intl-api")))))))
257 ("pkg-config" ,pkg-config)
258 ("python-2" ,python-2)))
261 ("readline" ,readline)
265 (define-public mozjs-52
266 ;; No releases yet at <https://archive.mozilla.org/pub/spidermonkey/releases/>.
267 ;; While we could take a snapshot of the complete mozilla-esr52 repository at
268 ;; <https://treeherder.mozilla.org/#/jobs?repo=mozilla-esr52&filter-searchStr=sm-tc>,
269 ;; we take the Debian version instead, because it is easier to work with.
270 (let ((commit "6507e63cc416fd7a3269e390efe712f8b56f374a")
272 (package (inherit mozjs-38)
273 (version (git-version "52.0" revision commit))
277 (url "https://salsa.debian.org/gnome-team/mozjs52.git")
279 (file-name (git-file-name "mozjs" version))
282 "1ny0s53r8wn4byys87h784xrq1xg767akmfm6gqrbvrz57mlm3q2"))))
284 `(#:tests? #f ; depends on repository metadata
291 "--enable-system-ffi"
296 ;; Intl API requires bundled ICU.
297 "--without-intl-api")
299 (modify-phases %standard-phases
300 (add-after 'unpack 'patch-and-chdir
301 (lambda* (#:key inputs #:allow-other-keys)
302 ;; This patch prevents a segfault when executing JS_Init().
303 ;; The build does not fail without this patch, but the
304 ;; configure phase of the gjs package would fail.
305 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1176787
306 (make-file-writable "js/src/old-configure.in")
307 (make-file-writable "js/src/old-configure")
308 (make-file-writable "mozglue/build/moz.build")
309 (invoke "patch" "-p1" "--force"
310 "--input" "debian/patches/disable-mozglue.patch")
311 (invoke "touch" "js/src/configure")
315 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
316 ;; The configure script does not accept environment variables
318 (let ((out (assoc-ref outputs "out")))
319 (setenv "SHELL" (which "sh"))
320 (setenv "CONFIG_SHELL" (which "sh"))
321 (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf")
323 (apply invoke "./configure"
324 (cons (string-append "--prefix=" out)
325 configure-flags))))))))
327 `(("autoconf" ,autoconf-2.13)
328 ("automake" ,automake)
329 ,@(package-native-inputs mozjs-38))))))
338 "https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v"
339 version "/src/nspr-" version ".tar.gz"))
342 "0vjms4j75zvv5b2siyafg7hh924ysx2cwjad8spzp7x87n8n929c"))))
343 (build-system gnu-build-system)
347 `(#:tests? #f ; no check target
348 #:configure-flags (list "--enable-64bit"
349 (string-append "LDFLAGS=-Wl,-rpath="
350 (assoc-ref %outputs "out")
352 ;; Use fixed timestamps for reproducibility.
353 #:make-flags '("SH_DATE='1970-01-01 00:00:01'"
354 ;; This is epoch 1 in microseconds.
356 #:phases (modify-phases %standard-phases
357 (add-before 'configure 'chdir
358 (lambda _ (chdir "nspr") #t)))))
360 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR")
361 (synopsis "Netscape API for system level and libc-like functions")
362 (description "Netscape Portable Runtime (@dfn{NSPR}) provides a
363 platform-neutral API for system level and libc-like functions. It is used
364 in the Mozilla clients.")
365 (license license:mpl2.0)))
373 (uri (let ((version-with-underscores
374 (string-join (string-split version #\.) "_")))
376 "https://ftp.mozilla.org/pub/mozilla.org/security/nss/"
377 "releases/NSS_" version-with-underscores "_RTM/src/"
378 "nss-" version ".tar.gz")))
381 "0jw6qlfl2g47hhx056nvnj6h92bk3sn46hy3ig61a911dzblvrkb"))
382 ;; Create nss.pc and nss-config.
383 (patches (search-patches "nss-pkgconfig.patch"
384 "nss-increase-test-timeout.patch"))))
385 (build-system gnu-build-system)
386 (outputs '("out" "bin"))
388 `(#:parallel-build? #f ; not supported
390 (let* ((out (assoc-ref %outputs "out"))
391 (nspr (string-append (assoc-ref %build-inputs "nspr")))
392 (rpath (string-append "-Wl,-rpath=" out "/lib/nss")))
393 (list "-C" "nss" (string-append "PREFIX=" out)
395 "NSS_USE_SYSTEM_SQLITE=1"
396 (string-append "NSPR_INCLUDE_DIR=" nspr "/include/nspr")
397 ;; Add $out/lib/nss to RPATH.
398 (string-append "RPATH=" rpath)
399 (string-append "LDFLAGS=" rpath)))
400 #:modules ((guix build gnu-build-system)
406 (modify-phases %standard-phases
410 ;; Tells NSS to build for the 64-bit ABI if we are 64-bit system.
411 ,@(match (%current-system)
412 ((or "x86_64-linux" "aarch64-linux")
413 `((setenv "USE_64" "1")))
419 ;; Use 127.0.0.1 instead of $HOST.$DOMSUF as HOSTADDR for testing.
420 ;; The later requires a working DNS or /etc/hosts.
421 (setenv "DOMSUF" "(none)")
422 (setenv "USE_IP" "TRUE")
423 (setenv "IP_ADDRESS" "127.0.0.1")
425 ;; The "PayPalEE.cert" certificate expires every six months,
426 ;; leading to test failures:
427 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=609734>. To
428 ;; work around that, set the time to roughly the release date.
429 (invoke "faketime" "2018-09-01" "./nss/tests/all.sh")))
431 (lambda* (#:key outputs #:allow-other-keys)
432 (let* ((out (assoc-ref outputs "out"))
433 (bin (string-append (assoc-ref outputs "bin") "/bin"))
434 (inc (string-append out "/include/nss"))
435 (lib (string-append out "/lib/nss"))
436 (obj (match (scandir "dist" (cut string-suffix? "OBJ" <>))
437 ((obj) (string-append "dist/" obj)))))
438 ;; Install nss-config to $out/bin.
439 (install-file (string-append obj "/bin/nss-config")
440 (string-append out "/bin"))
441 (delete-file (string-append obj "/bin/nss-config"))
442 ;; Install nss.pc to $out/lib/pkgconfig.
443 (install-file (string-append obj "/lib/pkgconfig/nss.pc")
444 (string-append out "/lib/pkgconfig"))
445 (delete-file (string-append obj "/lib/pkgconfig/nss.pc"))
446 (rmdir (string-append obj "/lib/pkgconfig"))
447 ;; Install other files.
448 (copy-recursively "dist/public/nss" inc)
449 (copy-recursively (string-append obj "/bin") bin)
450 (copy-recursively (string-append obj "/lib") lib)
452 ;; FIXME: libgtest1.so is installed in the above step, and it's
453 ;; (unnecessarily) linked with several NSS libraries, but
454 ;; without the needed rpaths, causing the 'validate-runpath'
455 ;; phase to fail. Here we simply delete libgtest1.so, since it
456 ;; seems to be used only during the tests.
457 (delete-file (string-append lib "/libgtest1.so"))
458 (delete-file (string-append lib "/libgtestutil.so"))
464 (propagated-inputs `(("nspr" ,nspr))) ; required by nss.pc.
465 (native-inputs `(("perl" ,perl)
466 ("libfaketime" ,libfaketime))) ;for tests
468 ;; The NSS test suite takes around 48 hours on Loongson 3A (MIPS) when
469 ;; another build is happening concurrently on the same machine.
470 (properties '((timeout . 216000))) ; 60 hours
473 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS")
474 (synopsis "Network Security Services")
476 "Network Security Services (@dfn{NSS}) is a set of libraries designed to
477 support cross-platform development of security-enabled client and server
478 applications. Applications built with NSS can support SSL v2 and v3, TLS,
479 PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other
480 security standards.")
481 (license license:mpl2.0)))
483 (define (mozilla-patch file-name changeset hash)
484 "Return an origin for CHANGESET from the mozilla-esr60 repository."
487 (uri (string-append "https://hg.mozilla.org/releases/mozilla-esr60/raw-rev/"
489 (sha256 (base32 hash))
490 (file-name file-name)))
492 (define-public icecat
495 (version "60.3.0-gnu1")
499 (uri (string-append "mirror://gnu/gnuzilla/"
500 (first (string-split version #\-))
501 "/" name "-" version ".tar.bz2"))
504 "0icnl64nxcyf7dprpdpygxhabsvyhps8c3ixysj9bcdlj9q34ib1"))
507 (search-patch "icecat-avoid-bundled-libraries.patch")
508 (search-patch "icecat-use-system-graphite2+harfbuzz.patch")
509 (search-patch "icecat-use-system-media-libs.patch")
510 (mozilla-patch "icecat-bug-1464061.patch" "d28761dbff18" "1f58rzwx4s1af66fdwn9lgkcd1ksmq8kn8imvf78p90jqi24h7b4")
511 (mozilla-patch "icecat-bug-1479853.patch" "4faeb696dd06" "12891xx9c15s6kby6d3zk64v5nqgaq7sw597zv1fkd3a6x69hlva")
512 (mozilla-patch "icecat-CVE-2018-17466.patch" "12ba39f69876" "1piyq44f0xa0a9z2748aqwpaziaxwp61d86gyhalbyag8lcxfb3p")
513 (mozilla-patch "icecat-CVE-2018-18498.patch" "a0adabeedf26" "0f5wazha3zxzhy2j8f93hx62l9p02b1p40vi07qah3ar67h4ccj9")
514 (mozilla-patch "icecat-CVE-2018-12405-pt01.patch" "19604eb26230" "1wqxgph4z14ijhk2j2m4av5p6gx72d02lzz83q6yy0k065kw8psb")
515 (mozilla-patch "icecat-CVE-2018-18492.patch" "98737ab09270" "0fyl6wv0jxcxpkfpsff46y93k49n8lrw0k7c1p45g8da015dx27a")
516 (mozilla-patch "icecat-CVE-2018-18493.patch" "1cf7d80355d5" "19jp4x32vyxam54d1r9fm7jwf6krhhf3xazfqmxb9aw4iwdil7dl")
517 (mozilla-patch "icecat-CVE-2018-12405-pt02.patch" "c264774b8913" "1hxyi131x8jwawrq90cgkph833iv9ixrdrgzl1r978gbzwq10xz2")
518 (mozilla-patch "icecat-bug-1477773.patch" "ec13fda7c9b0" "0zj7aylgw55g0y7plaafn5gq8jwcsdr1bpdxacs0hq914nm8zy9z")
519 (mozilla-patch "icecat-CVE-2018-12405-pt03.patch" "5e1a9644aeef" "1qimrpgyrd8zkiri7w57j0aymk20y9b34am5w7rvr6qj1lhrbfla")
520 (mozilla-patch "icecat-bug-1485655.patch" "9055726e2d89" "1pppxr94zqh6zmi2mn1ih21qap09vk5ivbhnwxqr8iszvygjg44g")
521 (mozilla-patch "icecat-bug-1410214.patch" "9e641345e2ef" "0542xss2jdb8drh4g50cfy32l300x69dyywgx3dqs03vgr3qplxy")
522 (mozilla-patch "icecat-CVE-2018-12405-pt04.patch" "6398541ec302" "1c2yi7mkg3d5afxsgj9fp3zq8yhkmphrll5d60d5xsdv88kqqiyf")
523 (mozilla-patch "icecat-bug-1496736.patch" "3bed863ee656" "038k7jk3yp16410crwfdvhyb2vis49c6bplrfr83v51885cqldar")
524 (mozilla-patch "icecat-bug-1498765.patch" "a08c8493ba19" "0bwg4vg03j962lb9q8ihpiy4rmygykf1q9ij8x7h34q7hg43yjya")
525 (mozilla-patch "icecat-CVE-2018-12405-pt05.patch" "ee204e26690e" "1scs45xhlr1mwv6x2q6n22363f42by8cjmifqwzlikggs21f5mcq")
526 (mozilla-patch "icecat-bug-1507035.patch" "cec8b58ab3fe" "1f131ibpkrhsa44l822hnm5qgvapbs3i9pj25iimdwvr933winz8")
527 (mozilla-patch "icecat-bug-1501680.patch" "282c6bb81562" "1zgw7l5zmni8468y3f6cip1nlw63cfdd9vv9b00cbrgy96d1q2cp")
528 (mozilla-patch "icecat-bug-1500310.patch" "b3a439a26186" "0mrjxcmrlv04fyl36dwxk97dw08g2hlikvw2hfa1l0y8zsc4bgw8")
529 (mozilla-patch "icecat-bug-1500366.patch" "abd59256c4e3" "1jgwh2v4kwb6kf2h7mwf128w1k1jj119bfhlgqpmn9ami35wpzf3")
530 (mozilla-patch "icecat-bug-1493080.patch" "a7cabf306d05" "1n7wv67rcaz8wj31jc77ssjdj3kb61gdg7pigj828c5z2cgns1k5")
531 (mozilla-patch "icecat-CVE-2018-12405-pt06.patch" "8bbf80948b50" "1nvc69zgz9nvbw1pwxkil1fx4cxxpr6bsjrpp6l2kv7jhgax1bqk")
532 (mozilla-patch "icecat-bug-1507564.patch" "60619cc47b10" "09fanqr08kqgraw4xp7y2az4jc7ia8nn200rqjfj20vmkyjz97j3")
533 (mozilla-patch "icecat-bug-1507730.patch" "dd0f01818b9c" "14ziq1bm72n58xrvsgzpjj5z6ifpvi70r5jfhbkbj69mf4y4cx2z")
534 (mozilla-patch "icecat-CVE-2018-12405-pt07.patch" "a73a46ddc848" "1bvvyav3xyn6rgn6haicinxn0dasl9dyc1i37fyb7wr5wcpahybs")
535 (mozilla-patch "icecat-CVE-2018-18494.patch" "a72ec8e21577" "095zghmwdcbaid5426p9vpl757d8sfbsvgn201bjm7nhm03m4z7i")
536 (mozilla-patch "icecat-CVE-2018-12405-pt08.patch" "b6d0fc61fd0b" "0059avawxi4s4747plybjsjq8j2h4z7amw05p28xyg95a2njwnaa")
537 (mozilla-patch "icecat-bug-1499028.patch" "a62ede2dd3bc" "0ikmnibni8bdvpr9p42wskyyic08vzqdz5qr028bqzyg5119gily")
538 (mozilla-patch "icecat-bug-1426574.patch" "0db86656655b" "0kmccb4ccdzbzncwklx7w1bg7r61zwl2wnfp67vl27hm9xykbck7")
539 (mozilla-patch "icecat-CVE-2018-12405-pt09.patch" "20e31905de62" "0b5a441645wy3q4asaygvdq0inrxmxrh33cpgdp6ngflq9p2i6h0")
540 (mozilla-patch "icecat-CVE-2018-12405-pt10.patch" "c2832f98fe51" "0b4jfjfdyrihwjdfavd54hn9kdg2f017lmfr7mj2llp71flxwwj7")
541 (mozilla-patch "icecat-bug-1511495.patch" "d428d2b8f585" "1f9xs0bjhbphvkv60cnvz34sr2rv38jzvi47wh3nablg41yjpdrk")))
542 (modules '((guix build utils)))
545 (use-modules (ice-9 ftw))
546 ;; Remove bundled libraries that we don't use, since they may
547 ;; contain unpatched security flaws, they waste disk space and
548 ;; network bandwidth, and may cause confusion.
549 (for-each delete-file-recursively
550 '(;; FIXME: Removing the bundled icu breaks configure.
551 ;; * The bundled icu headers are used in some places.
552 ;; * The version number is taken from the bundled copy.
555 ;; FIXME: A script from the bundled nspr is used.
558 ;; FIXME: With the update to IceCat 60, using system NSS
559 ;; broke certificate validation. See
560 ;; <https://bugs.gnu.org/32833>. For now, we use
561 ;; the bundled NSPR and NSS. TODO: Investigate,
562 ;; and try to unbundle these libraries again.
563 ;; UNBUNDLE-ME! "security/nss"
565 ;; TODO: Use more system media libraries. See:
566 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
567 ;; * libtheora: esr60 wants v1.2, not yet released.
568 ;; * soundtouch: avoiding the bundled library would
569 ;; result in some loss of functionality. There's
570 ;; also an issue with exception handling
571 ;; configuration. It seems that this is needed in
573 ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1
580 "ipc/chromium/src/third_party/libevent"
585 ;; "media/libtheora" ; wants theora-1.2, not yet released
589 "js/src/ctypes/libffi"
591 ;; Delete .pyc files, typically present in icecat source tarballs
592 (for-each delete-file (find-files "." "\\.pyc$"))
593 ;; Delete obj-* directories, sometimes present in icecat tarballs
594 (for-each delete-file-recursively
595 (scandir "." (lambda (name)
596 (string-prefix? "obj-" name))))
598 (build-system gnu-build-system)
600 `(("alsa-lib" ,alsa-lib)
603 ("dbus-glib" ,dbus-glib)
604 ("gdk-pixbuf" ,gdk-pixbuf)
608 ("graphite2" ,graphite2)
610 ("freetype" ,freetype)
611 ("harfbuzz" ,harfbuzz)
612 ("hunspell" ,hunspell)
613 ("libcanberra" ,libcanberra)
614 ("libgnome" ,libgnome)
615 ("libjpeg-turbo" ,libjpeg-turbo)
617 ;; ("libtheora" ,libtheora) ; wants theora-1.2, not yet released
618 ("libvorbis" ,libvorbis)
620 ("libevent" ,libevent)
621 ("libxinerama" ,libxinerama)
622 ("libxscrnsaver" ,libxscrnsaver)
623 ("libxcomposite" ,libxcomposite)
630 ("pulseaudio" ,pulseaudio)
632 ("mit-krb5" ,mit-krb5)
633 ;; See <https://bugs.gnu.org/32833>
634 ;; and related comments in the 'snippet' above.
635 ;; UNBUNDLE-ME! ("nspr" ,nspr)
636 ;; UNBUNDLE-ME! ("nss" ,nss)
638 ("startup-notification" ,startup-notification)
643 ;; Icecat 60 checkes for rust>=1.24
644 `(("rust" ,rust-1.24)
645 ("cargo" ,rust-1.24 "cargo")
647 ("clang" ,clang-3.9.1)
649 ("python" ,python-2) ; Python 3 not supported
650 ("python2-pysqlite" ,python2-pysqlite)
652 ("pkg-config" ,pkg-config)
653 ("autoconf" ,autoconf-2.13)
656 `(#:tests? #f ; no check target
657 #:out-of-source? #t ; must be built outside of the source directory
659 ;; XXX: There are RUNPATH issues such as
660 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
661 ;; which is not in its RUNPATH, but they appear to be harmless in
662 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
663 #:validate-runpath? #f
665 #:imported-modules ,%cargo-build-system-modules ;for `generate-checksums'
667 #:configure-flags `("--enable-default-toolkit=cairo-gtk3"
669 "--with-distribution-id=org.gnu"
671 "--enable-startup-notification"
672 "--enable-pulseaudio"
676 "--disable-crashreporter"
677 "--disable-maintenance-service"
681 ;; Building with debugging symbols takes ~5GiB, so
684 "--disable-debug-symbols"
686 ;; Clang is needed to build Stylo, Mozilla's new
687 ;; CSS engine. We must specify the clang paths
688 ;; manually, because otherwise the Mozilla build
689 ;; system looks in the directories returned by
690 ;; llvm-config --bindir and llvm-config --libdir,
691 ;; which return paths in the llvm package where
692 ;; clang is not found.
693 ,(string-append "--with-clang-path="
694 (assoc-ref %build-inputs "clang")
696 ,(string-append "--with-libclang-path="
697 (assoc-ref %build-inputs "clang")
700 ;; Hack to work around missing
701 ;; "unofficial" branding in icecat.
702 "--enable-official-branding"
704 ;; Avoid bundled libraries.
707 "--with-system-jpeg" ; must be libjpeg-turbo
708 "--with-system-libevent"
710 "--with-system-vorbis"
711 ;; "--with-system-theora" ; wants theora-1.2, not yet released
712 "--with-system-libvpx"
715 ;; See <https://bugs.gnu.org/32833>
716 ;; and related comments in the 'snippet' above.
717 ;; UNBUNDLE-ME! "--with-system-nspr"
718 ;; UNBUNDLE-ME! "--with-system-nss"
720 "--with-system-harfbuzz"
721 "--with-system-graphite2"
722 "--enable-system-pixman"
723 "--enable-system-ffi"
724 "--enable-system-hunspell"
725 "--enable-system-sqlite"
727 ;; Fails with "--with-system-png won't work because
728 ;; the system's libpng doesn't have APNG support".
730 ;; http://sourceforge.net/projects/libpng-apng/ ,
731 ;; "the Animated Portable Network Graphics (APNG)
732 ;; is an unofficial extension of the Portable
733 ;; Network Graphics (PNG) format";
734 ;; we probably do not wish to support it.
735 ;; "--with-system-png"
738 #:modules ((ice-9 ftw)
741 ,@%gnu-build-system-modules)
743 (modify-phases %standard-phases
745 'unpack 'ensure-no-mtimes-pre-1980
747 ;; Without this, the 'source/test/addons/packed.xpi' and
748 ;; 'source/test/addons/simple-prefs.xpi' targets fail while trying
749 ;; to create zip archives.
750 (let ((early-1980 315619200)) ; 1980-01-02 UTC
751 (ftw "." (lambda (file stat flag)
752 (unless (<= early-1980 (stat:mtime stat))
753 (utime file early-1980 early-1980))
757 'unpack 'link-libxul-with-libraries
759 ;; libxul.so dynamically opens libraries, so here we explicitly
760 ;; link them into libxul.so instead.
762 ;; TODO: It might be preferable to patch in absolute file names in
763 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
764 ;; work. More investigation is needed.
765 (substitute* "toolkit/library/moz.build"
766 (("^# This library needs to be last" all)
767 (string-append "OS_LIBS += [
768 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
769 'avcodec', 'avutil', 'pulse' ]\n\n"
774 (invoke "sh" "-c" "autoconf old-configure.in > old-configure")))
775 (add-after 'patch-source-shebangs 'patch-cargo-checksums
777 (use-modules (guix build cargo-build-system))
778 (let ((null-file "/dev/null")
779 (null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
780 (substitute* '("Cargo.lock" "servo/Cargo.lock")
781 (("(\"checksum .* = )\".*\"" all name)
782 (string-append name "\"" null-hash "\"")))
785 (delete-file filename)
786 (let ((dir (dirname filename)))
787 (display (string-append
788 "patch-cargo-checksums: generate-checksums for "
790 (generate-checksums dir null-file)))
791 (find-files "third_party/rust" ".cargo-checksum.json")))
793 (add-before 'configure 'augment-CPLUS_INCLUDE_PATH
794 (lambda* (#:key build inputs #:allow-other-keys)
795 ;; Here, we add additional entries to CPLUS_INCLUDE_PATH, to work
796 ;; around a problem that otherwise occurs when attempting to
797 ;; build Stylo, which requires Rust and Clang. Without these
798 ;; additional entries, errors occur during the build indicating
799 ;; that the <cstddef> and "c++config.h" headers cannot be found.
800 ;; Note that the 'build' keyword argument contains the GNU
801 ;; triplet, e.g. "x86_64-unknown-linux-gnu".
802 (let ((gcc (assoc-ref inputs "gcc")))
803 (setenv "CPLUS_INCLUDE_PATH"
804 (string-append gcc "/include/c++" ":"
805 gcc "/include/c++/" build ":"
806 (getenv "CPLUS_INCLUDE_PATH"))))))
809 ;; configure does not work followed by both "SHELL=..." and
810 ;; "CONFIG_SHELL=..."; set environment variables instead
811 (lambda* (#:key outputs configure-flags #:allow-other-keys)
812 (let* ((out (assoc-ref outputs "out"))
813 (bash (which "bash"))
814 (abs-srcdir (getcwd))
815 (srcdir (string-append "../" (basename abs-srcdir)))
816 (flags `(,(string-append "--prefix=" out)
817 ,(string-append "--with-l10n-base="
820 (setenv "SHELL" bash)
821 (setenv "CONFIG_SHELL" bash)
822 (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13
823 (setenv "CC" "gcc") ; apparently needed when Stylo is enabled
826 (format #t "build directory: ~s~%" (getcwd))
827 (format #t "configure flags: ~s~%" flags)
829 (string-append srcdir "/configure")
831 (add-before 'configure 'install-desktop-entry
832 (lambda* (#:key outputs #:allow-other-keys)
833 ;; Install the '.desktop' file.
834 (define (swallow-%%-directives input output)
835 ;; Interpret '%%ifdef' directives found in the '.desktop' file.
836 (let loop ((state 'top))
837 (match (read-line input 'concat)
841 (cond ((string-prefix? "%%ifdef" line)
843 ((string-prefix? "%%else" line)
845 ((string-prefix? "%%endif" line)
850 (display line output)
855 (let* ((out (assoc-ref outputs "out"))
856 (applications (string-append out "/share/applications")))
857 (call-with-input-file "debian/icecat.desktop.in"
859 (call-with-output-file "debian/icecat.desktop"
861 (swallow-%%-directives input output)))))
863 (substitute* "debian/icecat.desktop"
864 (("@MOZ_DISPLAY_NAME@")
866 (("^Exec=@MOZ_APP_NAME@")
867 (string-append "Exec=" out "/bin/icecat"))
870 (install-file "debian/icecat.desktop" applications)
872 (add-after 'install-desktop-entry 'install-icons
873 (lambda* (#:key outputs #:allow-other-keys)
874 (let ((out (assoc-ref outputs "out")))
875 (with-directory-excursion "browser/branding/official"
878 (let* ((size (string-filter char-numeric? file))
879 (icons (string-append out "/share/icons/hicolor/"
880 size "x" size "/apps")))
882 (copy-file file (string-append icons "/icecat.png"))))
883 '("default16.png" "default22.png" "default24.png"
884 "default32.png" "default48.png" "content/icon64.png"
885 "mozicon128.png" "default256.png"))
887 ;; This fixes the file chooser crash that happens with GTK 3.
888 (add-after 'install 'wrap-program
889 (lambda* (#:key inputs outputs #:allow-other-keys)
890 (let* ((out (assoc-ref outputs "out"))
891 (lib (string-append out "/lib"))
892 (gtk (assoc-ref inputs "gtk+"))
893 (gtk-share (string-append gtk "/share")))
894 (wrap-program (car (find-files lib "^icecat$"))
895 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))
897 (home-page "https://www.gnu.org/software/gnuzilla/")
898 (synopsis "Entirely free browser derived from Mozilla Firefox")
900 "IceCat is the GNU version of the Firefox browser. It is entirely free
901 software, which does not recommend non-free plugins and addons. It also
902 features built-in privacy-protecting features.")
903 (license license:mpl2.0) ;and others, see toolkit/content/license.html
905 `((ftp-directory . "/gnu/gnuzilla")
906 (cpe-name . "firefox_esr")
907 (cpe-version . ,(first (string-split version #\-)))))))
909 (define-public conkeror
910 ;; The Conkeror web browser relied on XULRunner, which IceCat > 50 no longer
911 ;; provides. See <http://conkeror.org> for the original web page.
912 (deprecated-package "conkeror" icecat))