gnu: r-scater: Update to 1.8.0.
[jackhill/guix/guix.git] / gnu / packages / gnuzilla.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 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 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 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages gnuzilla)
28 #:use-module ((srfi srfi-1) #:hide (zip))
29 #:use-module (ice-9 match)
30 #:use-module (gnu packages)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix utils)
35 #:use-module (guix build-system gnu)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages databases)
39 #:use-module (gnu packages glib)
40 #:use-module (gnu packages gtk)
41 #:use-module (gnu packages gnome)
42 #:use-module (gnu packages libcanberra)
43 #:use-module (gnu packages cups)
44 #:use-module (gnu packages kerberos)
45 #:use-module (gnu packages linux)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages fontutils)
50 #:use-module (gnu packages libevent)
51 #:use-module (gnu packages libreoffice) ;for hunspell
52 #:use-module (gnu packages image)
53 #:use-module (gnu packages libffi)
54 #:use-module (gnu packages pulseaudio)
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages xorg)
57 #:use-module (gnu packages gl)
58 #:use-module (gnu packages assembly)
59 #:use-module (gnu packages icu4c)
60 #:use-module (gnu packages video)
61 #:use-module (gnu packages xdisorg)
62 #:use-module (gnu packages readline))
63
64 (define-public mozjs
65 (package
66 (name "mozjs")
67 (version "17.0.0")
68 (source (origin
69 (method url-fetch)
70 (uri (string-append
71 "https://ftp.mozilla.org/pub/mozilla.org/js/"
72 name version ".tar.gz"))
73 (sha256
74 (base32
75 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))
76 (patches (search-patches "mozjs17-aarch64-support.patch"))
77 (modules '((guix build utils)))
78 (snippet
79 ;; Fix incompatibility with Perl 5.22+.
80 '(substitute* '("js/src/config/milestone.pl")
81 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE")))))
82 (build-system gnu-build-system)
83 (native-inputs
84 `(("perl" ,perl)
85 ("pkg-config" ,pkg-config)
86 ("python" ,python-2)))
87 (propagated-inputs
88 `(("nspr" ,nspr))) ; in the Requires.private field of mozjs-17.0.pc
89 (inputs
90 `(("zlib" ,zlib)))
91 (arguments
92 `(;; XXX: parallel build fails, lacking:
93 ;; mkdir -p "system_wrapper_js/"
94 #:parallel-build? #f
95 #:phases
96 (modify-phases %standard-phases
97 (add-after 'unpack 'delete-timedout-test
98 ;; This test times out on slower hardware.
99 (lambda _ (delete-file "js/src/jit-test/tests/basic/bug698584.js")))
100 (add-before 'configure 'chdir
101 (lambda _
102 (chdir "js/src")
103 #t))
104 (replace 'configure
105 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
106 (lambda* (#:key outputs #:allow-other-keys)
107 (let ((out (assoc-ref outputs "out")))
108 (setenv "SHELL" (which "sh"))
109 (setenv "CONFIG_SHELL" (which "sh"))
110 (zero? (system*
111 "./configure" (string-append "--prefix=" out)
112 ,@(if (string=? "aarch64-linux"
113 (%current-system))
114 '("--host=aarch64-unknown-linux-gnu")
115 '())))))))))
116 (home-page
117 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey")
118 (synopsis "Mozilla javascript engine")
119 (description "SpiderMonkey is Mozilla's JavaScript engine written
120 in C/C++.")
121 (license license:mpl2.0))) ; and others for some files
122
123 (define-public mozjs-24
124 (package (inherit mozjs)
125 (name "mozjs")
126 (version "24.2.0")
127 (source (origin
128 (method url-fetch)
129 (uri (string-append
130 "https://ftp.mozilla.org/pub/mozilla.org/js/"
131 name "-" version ".tar.bz2"))
132 (sha256
133 (base32
134 "1n1phk8r3l8icqrrap4czplnylawa0ddc2cc4cgdz46x3lrkybz6"))
135 (modules '((guix build utils)))
136 (patches (search-patches "mozjs24-aarch64-support.patch"))
137 (snippet
138 ;; Fix incompatibility with Perl 5.22+.
139 '(substitute* '("js/src/config/milestone.pl")
140 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE")))))
141 (arguments
142 (substitute-keyword-arguments (package-arguments mozjs)
143 ((#:phases phases)
144 `(modify-phases ,phases
145 (replace 'configure
146 (lambda* (#:key outputs #:allow-other-keys)
147 (let ((out (assoc-ref outputs "out")))
148 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
149 (setenv "SHELL" (which "sh"))
150 (setenv "CONFIG_SHELL" (which "sh"))
151 (zero? (system* "./configure"
152 (string-append "--prefix=" out)
153 "--with-system-nspr"
154 "--enable-system-ffi"
155 "--enable-threadsafe"
156 ,@(if (string=? "aarch64-linux"
157 (%current-system))
158 '("--host=aarch64-unknown-linux-gnu")
159 '()))))))))))
160 (inputs
161 `(("libffi" ,libffi)
162 ("zlib" ,zlib)))))
163
164 (define-public mozjs-38
165 (package
166 (inherit mozjs)
167 (name "mozjs")
168 (version "38.2.1.rc0")
169 (source (origin
170 (method url-fetch)
171 (uri (string-append
172 "https://people.mozilla.org/~sstangl/"
173 name "-" version ".tar.bz2"))
174 (sha256
175 (base32
176 "0p4bmbpgkfsj54xschcny0a118jdrdgg0q29rwxigg3lh5slr681"))
177 (patches
178 (search-patches
179 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1269317 for
180 ;; GCC 6 compatibility.
181
182 "mozjs38-version-detection.patch" ; for 0ad
183 "mozjs38-tracelogger.patch"
184
185 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1339931.
186 "mozjs38-pkg-config-version.patch"
187 "mozjs38-shell-version.patch"))
188 (modules '((guix build utils)))
189 (snippet
190 '(begin
191 ;; Fix incompatibility with sed 4.4.
192 (substitute* "js/src/configure"
193 (("\\^\\[:space:\\]") "^[[:space:]]"))
194
195 ;; The headers are symlinks to files that are in /tmp, so they
196 ;; end up broken. Copy them instead.
197 (substitute*
198 "python/mozbuild/mozbuild/backend/recursivemake.py"
199 (("\\['dist_include'\\].add_symlink")
200 "['dist_include'].add_copy"))
201
202 ;; Remove bundled libraries.
203 (for-each delete-file-recursively
204 '("intl"
205 "js/src/ctypes/libffi"
206 "js/src/ctypes/libffi-patches"
207 "modules/zlib"))
208 #t))))
209 (arguments
210 `(;; XXX: parallel build fails, lacking:
211 ;; mkdir -p "system_wrapper_js/"
212 #:parallel-build? #f
213 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1008470.
214 #:tests? #f
215 #:phases
216 (modify-phases %standard-phases
217 (replace 'configure
218 (lambda* (#:key outputs #:allow-other-keys)
219 (let ((out (assoc-ref outputs "out")))
220 (chdir "js/src")
221 (setenv "SHELL" (which "sh"))
222 (setenv "CONFIG_SHELL" (which "sh"))
223 (zero? (system* "./configure"
224 (string-append "--prefix=" out)
225 "--enable-ctypes"
226 "--enable-gcgenerational"
227 "--enable-optimize"
228 "--enable-pie"
229 "--enable-readline"
230 "--enable-shared-js"
231 "--enable-system-ffi"
232 "--enable-threadsafe"
233 "--enable-xterm-updates"
234 "--with-system-icu"
235 "--with-system-nspr"
236 "--with-system-zlib"
237
238 ;; Intl API requires bundled ICU.
239 "--without-intl-api"))))))))
240 (native-inputs
241 `(("perl" ,perl)
242 ("pkg-config" ,pkg-config)
243 ("python-2" ,python-2)))
244 (inputs
245 `(("libffi" ,libffi)
246 ("readline" ,readline)
247 ("icu4c" ,icu4c)
248 ("zlib" ,zlib)))))
249
250 (define-public nspr
251 (package
252 (name "nspr")
253 (version "4.19")
254 (source (origin
255 (method url-fetch)
256 (uri (string-append
257 "https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v"
258 version "/src/nspr-" version ".tar.gz"))
259 (sha256
260 (base32
261 "0agpv3f17h8kmzi0ifibaaxc1k3xc0q61wqw3l6r2xr2z8bmkn9f"))))
262 (build-system gnu-build-system)
263 (native-inputs
264 `(("perl" ,perl)))
265 (arguments
266 `(#:tests? #f ; no check target
267 #:configure-flags (list "--enable-64bit"
268 (string-append "LDFLAGS=-Wl,-rpath="
269 (assoc-ref %outputs "out")
270 "/lib"))
271 ;; Use fixed timestamps for reproducibility.
272 #:make-flags '("SH_DATE='1970-01-01 00:00:01'"
273 ;; This is epoch 1 in microseconds.
274 "SH_NOW=100000")
275 #:phases (modify-phases %standard-phases
276 (add-before 'configure 'chdir
277 (lambda _ (chdir "nspr") #t)))))
278 (home-page
279 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR")
280 (synopsis "Netscape API for system level and libc-like functions")
281 (description "Netscape Portable Runtime (@dfn{NSPR}) provides a
282 platform-neutral API for system level and libc-like functions. It is used
283 in the Mozilla clients.")
284 (license license:mpl2.0)))
285
286 (define-public nss
287 (package
288 (name "nss")
289 (version "3.36.1")
290 (source (origin
291 (method url-fetch)
292 (uri (let ((version-with-underscores
293 (string-join (string-split version #\.) "_")))
294 (string-append
295 "https://ftp.mozilla.org/pub/mozilla.org/security/nss/"
296 "releases/NSS_" version-with-underscores "_RTM/src/"
297 "nss-" version ".tar.gz")))
298 (sha256
299 (base32
300 "1zrb49mp7cy3snnday1zv8d76h1mgppbcwxnlkqsgxlga8fl89b0"))
301 ;; Create nss.pc and nss-config.
302 (patches (search-patches "nss-pkgconfig.patch"
303 "nss-increase-test-timeout.patch"))))
304 (build-system gnu-build-system)
305 (outputs '("out" "bin"))
306 (arguments
307 `(#:parallel-build? #f ; not supported
308 #:make-flags
309 (let* ((out (assoc-ref %outputs "out"))
310 (nspr (string-append (assoc-ref %build-inputs "nspr")))
311 (rpath (string-append "-Wl,-rpath=" out "/lib/nss")))
312 (list "-C" "nss" (string-append "PREFIX=" out)
313 "NSDISTMODE=copy"
314 "NSS_USE_SYSTEM_SQLITE=1"
315 (string-append "NSPR_INCLUDE_DIR=" nspr "/include/nspr")
316 ;; Add $out/lib/nss to RPATH.
317 (string-append "RPATH=" rpath)
318 (string-append "LDFLAGS=" rpath)))
319 #:modules ((guix build gnu-build-system)
320 (guix build utils)
321 (ice-9 ftw)
322 (ice-9 match)
323 (srfi srfi-26))
324 #:phases
325 (modify-phases %standard-phases
326 (replace 'configure
327 (lambda _
328 (setenv "CC" "gcc")
329 ;; Tells NSS to build for the 64-bit ABI if we are 64-bit system.
330 ,@(match (%current-system)
331 ((or "x86_64-linux" "aarch64-linux")
332 `((setenv "USE_64" "1")))
333 (_
334 '()))
335 #t))
336 (replace 'check
337 (lambda _
338 ;; Use 127.0.0.1 instead of $HOST.$DOMSUF as HOSTADDR for testing.
339 ;; The later requires a working DNS or /etc/hosts.
340 (setenv "DOMSUF" "(none)")
341 (setenv "USE_IP" "TRUE")
342 (setenv "IP_ADDRESS" "127.0.0.1")
343 (zero? (system* "./nss/tests/all.sh"))))
344 (replace 'install
345 (lambda* (#:key outputs #:allow-other-keys)
346 (let* ((out (assoc-ref outputs "out"))
347 (bin (string-append (assoc-ref outputs "bin") "/bin"))
348 (inc (string-append out "/include/nss"))
349 (lib (string-append out "/lib/nss"))
350 (obj (match (scandir "dist" (cut string-suffix? "OBJ" <>))
351 ((obj) (string-append "dist/" obj)))))
352 ;; Install nss-config to $out/bin.
353 (install-file (string-append obj "/bin/nss-config")
354 (string-append out "/bin"))
355 (delete-file (string-append obj "/bin/nss-config"))
356 ;; Install nss.pc to $out/lib/pkgconfig.
357 (install-file (string-append obj "/lib/pkgconfig/nss.pc")
358 (string-append out "/lib/pkgconfig"))
359 (delete-file (string-append obj "/lib/pkgconfig/nss.pc"))
360 (rmdir (string-append obj "/lib/pkgconfig"))
361 ;; Install other files.
362 (copy-recursively "dist/public/nss" inc)
363 (copy-recursively (string-append obj "/bin") bin)
364 (copy-recursively (string-append obj "/lib") lib)
365
366 ;; FIXME: libgtest1.so is installed in the above step, and it's
367 ;; (unnecessarily) linked with several NSS libraries, but
368 ;; without the needed rpaths, causing the 'validate-runpath'
369 ;; phase to fail. Here we simply delete libgtest1.so, since it
370 ;; seems to be used only during the tests.
371 (delete-file (string-append lib "/libgtest1.so"))
372 (delete-file (string-append lib "/libgtestutil.so"))
373
374 #t))))))
375 (inputs
376 `(("sqlite" ,sqlite)
377 ("zlib" ,zlib)))
378 (propagated-inputs `(("nspr" ,nspr))) ; required by nss.pc.
379 (native-inputs `(("perl" ,perl)))
380
381 ;; The NSS test suite takes around 48 hours on Loongson 3A (MIPS) when
382 ;; another build is happening concurrently on the same machine.
383 (properties '((timeout . 216000))) ; 60 hours
384
385 (home-page
386 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS")
387 (synopsis "Network Security Services")
388 (description
389 "Network Security Services (@dfn{NSS}) is a set of libraries designed to
390 support cross-platform development of security-enabled client and server
391 applications. Applications built with NSS can support SSL v2 and v3, TLS,
392 PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other
393 security standards.")
394 (license license:mpl2.0)))
395
396 (define (mozilla-patch file-name changeset hash)
397 "Return an origin for CHANGESET from the mozilla-esr52 repository."
398 (origin
399 (method url-fetch)
400 (uri (string-append "https://hg.mozilla.org/releases/mozilla-esr52/raw-rev/"
401 changeset))
402 (sha256 (base32 hash))
403 (file-name file-name)))
404
405 (define-public icecat
406 (package
407 (name "icecat")
408 (version "52.6.0-gnu1")
409 (source
410 (origin
411 (method url-fetch)
412 (uri (string-append "mirror://gnu/gnuzilla/"
413 (first (string-split version #\-))
414 "/" name "-" version ".tar.bz2"))
415 (sha256
416 (base32
417 "09fn54glqg1aa93hnz5zdcy07cps09dbni2b4200azh6nang630a"))
418 (patches
419 (list
420 (search-patch "icecat-avoid-bundled-libraries.patch")
421 (search-patch "icecat-use-system-harfbuzz.patch")
422 (search-patch "icecat-use-system-graphite2.patch")
423 (mozilla-patch "icecat-bug-546387.patch" "d13e3fefb76e" "1b760r0bg2ydbl585wlmajljh1nlisrwxvjws5b28a3sgjy01i6k")
424 (mozilla-patch "icecat-bug-1350152.patch" "f822bda79c28" "1wf56169ca874shr6r7qx40s17h2gwj7ngmpyylrpmd1c6hipvsj")
425 (mozilla-patch "icecat-bug-1411708.patch" "34c968767eb7" "0l2jy201ikj3m3h66mvlsj4y0ki7cpm7x7nnfygbwnfxg42s1sip")
426 (mozilla-patch "icecat-bug-1375217.patch" "00fc630c9a46" "17pcprp452nslk6sac6sili0p74zh8w3g0v1wsdn0ikm9xmnphhv")
427 (mozilla-patch "icecat-CVE-2018-5145.patch" "f0ec180993d2" "0jiazxcwki83wr00fyh2g518ynsd33p7nk65zk4d1682gn22lc8v")
428 (mozilla-patch "icecat-CVE-2018-5130.patch" "a6a9e26688c1" "0cvizvilb4k422j2gzqcbakznvsffmk6n6xn1ayj5rgxfaizkkqk")
429 (mozilla-patch "icecat-CVE-2018-5125-pt1.patch" "198ad052621e" "1721zx8hifdlflrhvw6hmkdgjbvsmxl9n84iji5qywhlp2krdk9r")
430 (mozilla-patch "icecat-bug-1426087.patch" "391ea77ebfdb" "1fhkvd0z6mvdkj7m0d3jlj42rsdw5r4x122c1wb1i428228ifw6n")
431 (mozilla-patch "icecat-bug-1416307.patch" "54f2f7f93b30" "1ncjir16mqya37wgf6fy2rqki3vl433c4grjr3fypmlig6xfgg1l")
432 (mozilla-patch "icecat-CVE-2018-5127.patch" "2c4d7a59041b" "178c6gid89cvw52yqs43i6x6s5w0hslj0rfa2r8b4762ij3civ92")
433 (mozilla-patch "icecat-CVE-2018-5125-pt2.patch" "f87ef3774d5e" "0payf3az2w93nzl5qknqx290jbxk8v39rwhdgq7wyd5f245dywxk")
434 (mozilla-patch "icecat-CVE-2018-5125-pt3.patch" "ac743923f81d" "0msyr45xr1j5q4x6ah4r907pwjngyi0k6pp9y8ixk21cnwbzrdwx")
435 (mozilla-patch "icecat-CVE-2018-5129.patch" "456913d7e8b5" "0fx0s06kxxj7g4hllinaskgh41z3k48zml6yqqzxx485qk3hdh9x")
436 (mozilla-patch "icecat-bug-1334465-pt1.patch" "f95c5b881442" "0iaddhf65jd9cycj4bw0b207n2jiqkr4q84jifzyqn4ygs75wdqd")
437 (mozilla-patch "icecat-bug-1334465-pt2.patch" "8a4265c8fb41" "1d9zfdbrlw9wzr84b7pj7lxgy487lsx0kfd89287hjk0al8m6vrw")
438 (mozilla-patch "icecat-bug-1398021.patch" "28855df568d8" "1kmq836gniplxpjnvq8lhbcc1aqi56al628r1mzdy94b5yb0lis3")
439 (mozilla-patch "icecat-bug-1388020.patch" "e8ab2736499b" "0n28vcd65rxsyq3z22rfcfksryfndhm1i3g6ah3akg11jnagqf5v")
440 (mozilla-patch "icecat-CVE-2018-5125-pt4.patch" "014877bf17ea" "0hk90pnf7h7kvidji6ydvva1zpyraipn03pjhvprdqr7k2fqzmsz")
441 (mozilla-patch "icecat-CVE-2018-5125-pt5.patch" "5b3a5de48912" "1ifya05rcd34ryp9zawdacihhkkf2m0xn2q8m8c6v78bvxj0mgig")
442 (mozilla-patch "icecat-CVE-2018-5144.patch" "1df9b4404acd" "1sd59vsarfsbh3vlrzrqv6n1ni7vxdzm83j6s6g0fygl1h8kwijg")
443 (mozilla-patch "icecat-bug-1430173-pt1.patch" "9124c3972e2b" "13ns5yy39yzfx7lrkv4rgwdz6s6q0z4i09wkbxdvnkfsz17cd17i")
444 (mozilla-patch "icecat-bug-1430173-pt2.patch" "9f6dc031be51" "0bv2p98z5ahp3x9wxnhwxn87g21djvzzp7jy55ik90hqixsbhwdl")
445 (mozilla-patch "icecat-CVE-2018-5131.patch" "3102fbb97b32" "0kg0183v92gxjb9255xjwhxyd6gl77l9c0civx3040k975fybwlp")
446 (mozilla-patch "icecat-CVE-2018-5125-pt6.patch" "4904c0f4a645" "0lsq62ynksy1fbw0m87f1d741fyvrrp1vrznx5hx0l2p4g4frhv3")
447 (mozilla-patch "icecat-CVE-2018-5125-pt7.patch" "16b8073d5c30" "1dv94qqah1wjd3bxjvrkmjbb2f95d3d11zpm8mggdk52il575bwl")
448 (mozilla-patch "icecat-bug-1442127-pt1.patch" "f931f85b09da" "02s380w8a73g4w2wm810lbigh4z4rrlfy10ywwhv4lpkbk8xg7pr")
449 (mozilla-patch "icecat-bug-1442127-pt2.patch" "da5792b70f30" "116k9qja5ir9b3laazasp43f5jx59qq72nknmq5bn5v1ixya9r4l")
450 (mozilla-patch "icecat-CVE-2018-5125-pt8.patch" "62b831df8269" "109pn0hqn7s27580glv4z7qv1pmjzii9szvf3wkn97k5wybrzgkx")
451 (mozilla-patch "icecat-bug-1442504.patch" "8954ce68a364" "0bl65zw82bwqg0mmcri94pxqq6ibff7y5rclkzapb081p6yvf73q")
452 (mozilla-patch "icecat-CVE-2018-5125-pt9.patch" "8a16f439117c" "108iarql6z7h1r4rlzac6n6lrzs78x7kcdbfa0b5dbr5xc66jmgb")
453 (mozilla-patch "icecat-bug-1426603.patch" "ca0b92ecedee" "0dc3mdl4a3hrq4j384zjavf3splj6blv4masign710hk7svlgbhq")
454 (mozilla-patch "icecat-CVE-2018-5146.patch" "494e5d5278ba" "1yb4lxjw499ppwhk31vz0vzl0cfqvj9d4jwqag7ayj53ybwsqgjr")
455 (mozilla-patch "icecat-CVE-2018-5147.patch" "5cd5586a2f48" "10s774pwvj6xfk3kk6ivnhp2acc8x9sqq6na8z47nkhgwl2712i5")
456 (mozilla-patch "icecat-CVE-2018-5148.patch" "c3e447e07077" "0gmwy631f8ip4gr1mpbjk8bx1n1748wdls5zq4y8hpmpnq5g1wyx")
457 (mozilla-patch "icecat-CVE-2018-5178.patch" "17201199b18d" "1d0hcim1fwh0bklwpmnal1mv9d9kmyif1m15aj1nqkf1n3x4xc37")
458 (mozilla-patch "icecat-bug-1361699.patch" "a07d6c3ff262" "1z8mjg2487r8pxi0x951v6fwwr696q84f6hlzimc3r7bn5ds9r83")
459 (mozilla-patch "icecat-CVE-2018-5150-pt01.patch" "7127ccf8f88c" "0m4my7aflpp0wlqilr2m4axd7k2fyrs7jqdcz2rrz5pwivz1anvd")
460 (mozilla-patch "icecat-bug-1444231.patch" "57bd35fa8618" "0pl6x5amc5x6nhwl7qnmnff3jjjxmbs8r365bfzj58g7q5ihqwvf")
461 (mozilla-patch "icecat-CVE-2018-5150-pt02.patch" "2f3e1ccf1661" "0azl8g81kpc0w2xpjpgm1154ll12g0a8n6i7bl3s9nnrk2i26n74")
462 (mozilla-patch "icecat-CVE-2018-5159.patch" "8ff2c4d68e36" "0kz1rqhnz8ca4z20hnpcafidhsrwhnm0h2gmlgchni33h8pisr1f")
463 (mozilla-patch "icecat-CVE-2018-5154.patch" "b8c430253efd" "1arjcaps9axhxh5ff84n9bydhhzrihn7hbq7v69nvqwqrjp3lgg9")
464 (mozilla-patch "icecat-CVE-2018-5155.patch" "05cadfa3ac39" "0q0vh7vy7x0l8jp6376fn10qljfp4mnp4m9zfn90j4m19pfl86a0")
465 (mozilla-patch "icecat-CVE-2018-5168.patch" "48a678d7cb81" "1yfh7kxxxvqck2hpn98pwag4splyc6c9brc5haq28fp8x9r9qvlk")
466 (mozilla-patch "icecat-CVE-2018-5150-pt03.patch" "112032576872" "1x1hxyggbxlnlj0n9cbp03hjnfvm6cq8nqj0jizrd8cfyd5aig8p")
467 (mozilla-patch "icecat-CVE-2018-5150-pt04.patch" "ad9a885b0df4" "1hrk1q9mk59jww55g4lqmaflznk87x3vvjn2mxfgfbbjs8l1cyz4")
468 (mozilla-patch "icecat-bug-1452416.patch" "f89ab96a2532" "1dqchxdyznhgyxhfq0hm0vg1p597hjqflfzigc7j3s5vxf9rg2nv")
469 (mozilla-patch "icecat-CVE-2018-5150-pt05.patch" "af885a1bd293" "1wfpqhm2dp4fsx6zbrncngsqz7g2x09b625zcighixrbpvybyww3")
470 (mozilla-patch "icecat-CVE-2018-5150-pt06.patch" "666fc84ec72d" "0lml2wqd4yqidhi364x8r90f78397k2y0kq5z5bv8l8j4bhcnb9v")
471 (search-patch "icecat-CVE-2018-5157-and-CVE-2018-5158.patch")
472 (mozilla-patch "icecat-CVE-2018-5150-pt07.patch" "1ab40761a856" "1kgwypy7k5b33jwkni4025za4kcnv5m6klsx4wsswlixmljmkbc7")
473 (mozilla-patch "icecat-bug-1453339.patch" "0edb8dca7087" "0b30pipqryh311sc97rcmwnx9n8qdlbbz90b2hkybjnprmbhfxrm")
474 (mozilla-patch "icecat-CVE-2018-5150-pt08.patch" "134c728799c1" "16hbwx6fx1hrddsyjjbd3z954ql3pg348xs13h9riyblq8crzmam")
475 (mozilla-patch "icecat-CVE-2018-5150-pt09.patch" "14eab155eaa8" "0wr4xgblxzk4c2gvlnpl7ic1196mrhry1hgwdl1jivq0ji5cbvbd")
476 (mozilla-patch "icecat-bug-1452619.patch" "2b75d55ccf0e" "1g87aybw6ggv6hyk385bplv0lx63n020gwyq0d6d4pqld48hsm1i")
477 (mozilla-patch "icecat-bug-1453127.patch" "89857f35df29" "0gzi47svrw5ajdlm3i12193psm702zx70x5h1rwp4gb7gxh4m4d9")
478 (mozilla-patch "icecat-CVE-2018-5150-pt10.patch" "3f2ec03c0405" "0w02952dlxd2gmwghck2nm4rjjmc5ylg62bw6m1rvi35kcr134lr")
479 (mozilla-patch "icecat-CVE-2018-5183.patch" "f729bf78fb3a" "0xkj6jwxwdqkvb5c7wi16b8cm8qrnlrd3s9jnd46jg03iykrx56f")
480 (mozilla-patch "icecat-bug-1437842.patch" "eb896089db47" "10lppk4x2d3pim71a36ky1dmg08rs5ckfiljwvfnr1cw6934qxl4")
481 (mozilla-patch "icecat-bug-1458270.patch" "2374dca97bde" "0y1g55wvj44nzb1qfkl271jcf8s1ik8lcl1785z0zim4qzn7qkpa")
482 (mozilla-patch "icecat-bug-1452576.patch" "70b6298e0c9e" "0n5jfy6c421dkybk8m18vd61y95zz0r64g1p1zlya3fps5knfaqi")
483 (mozilla-patch "icecat-bug-1459206-pt1.patch" "4ef79fe9b3b7" "1c32z1ki1i6xj1nbb0xlxwqnmz48ikmy8dmp37rkjz8ssn04wgfg")
484 (mozilla-patch "icecat-bug-1459206-pt2.patch" "9ad16112044a" "0ayya67sx7avcb8bplfdxb92l9g4mjrb1s3hby283llhqv0ikg9b")
485 (mozilla-patch "icecat-bug-1459162.patch" "11d8a87fb6d6" "1rkmdk18llw0x1jakix75hlhy0hpsmlminnflagbzrzjli81gwm1")
486 (mozilla-patch "icecat-bug-1451297.patch" "407b10ad1273" "16qzsfirw045xag96f1qvpdlibm8lwdj9l1mlli4n1vz0db91v9q")
487 (mozilla-patch "icecat-bug-1462682.patch" "e76e2e481b17" "0hnx13msjy28n3bpa2c24kpzalam4bdk5gnp0f9k671l48rs9yb3")
488 (mozilla-patch "icecat-bug-1450688.patch" "2c75bfcd465c" "1pjinj8qypafqm2fk68s3hzcbzcijn09qzrpcxvzq6bl1yfc1xfd")
489 (mozilla-patch "icecat-bug-1456975.patch" "042f80f3befd" "0av918kin4bkrq7gnjz0h9w8kkq8rk9l93250lfl5kqrinza1gsk")
490 (mozilla-patch "icecat-bugs-1442722+1455071+1433642+1456604+1458320.patch"
491 "bb0451c9c4a0" "1lhm1b2a7c6jwhzsg3c830hfhp17p8j9zbcmgchpb8c5jkc3vw0x")
492 (mozilla-patch "icecat-bug-1465108-pt1.patch" "8189b262e3b9" "13rh86ddwmj1bhv3ibbil3sv5xbqq1c9v1czgbsna5hxxkzc1y3b")
493 (mozilla-patch "icecat-bug-1465108-pt2.patch" "9f81ae3f6e1d" "05vfg8a8jrzd93n1wvncmvdmqgf9cgsl8ryxgjs3032gbbjkga7q")
494 (mozilla-patch "icecat-bug-1459693.patch" "face7a3dd5d7" "0jclw30mf693w8lrmvn0iankggj21nh4j3zh51q5363rj5xncdzx")
495 (mozilla-patch "icecat-bug-1464829.patch" "7afb58c046c8" "1r0569r76712x7x1sw6xr0x06ilv6iw3fncb0f8r8b9mp6wrpx34")
496 (mozilla-patch "icecat-bug-1452375-pt1.patch" "f1a745f8c42d" "11q73pb7a8f09xjzil4rhg5nr49zrnz1vb0prni0kqvrnppf5s40")
497 (mozilla-patch "icecat-bug-1452375-pt2.patch" "1f9a430881cc" "0f79rv7njliqxx33z07n60b50jg0a596d1km7ayz2hivbl2d0168")))
498 (modules '((guix build utils)))
499 (snippet
500 '(begin
501 (use-modules (ice-9 ftw))
502 ;; Remove bundled libraries that we don't use, since they may
503 ;; contain unpatched security flaws, they waste disk space and
504 ;; network bandwidth, and may cause confusion.
505 (for-each delete-file-recursively
506 '(;; FIXME: Removing the bundled icu breaks configure.
507 ;; * The bundled icu headers are used in some places.
508 ;; * The version number is taken from the bundled copy.
509 ;;"intl/icu"
510 ;;
511 ;; FIXME: A script from the bundled nspr is used.
512 ;;"nsprpub"
513 ;;
514 ;; TODO: Use system media libraries. Waiting for:
515 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
516 ;; * libogg
517 ;; * libtheora
518 ;; * libvorbis
519 ;; * libtremor (not yet in guix)
520 ;; * libopus
521 ;; * speex
522 ;; * soundtouch (not yet in guix)
523 ;;
524 "modules/freetype2"
525 "modules/zlib"
526 "modules/libbz2"
527 "ipc/chromium/src/third_party/libevent"
528 "media/libjpeg"
529 "media/libvpx"
530 "security/nss"
531 "gfx/cairo"
532 "gfx/harfbuzz"
533 "gfx/graphite2"
534 "js/src/ctypes/libffi"
535 "db/sqlite3"))
536 ;; Delete .pyc files, typically present in icecat source tarballs
537 (for-each delete-file (find-files "." "\\.pyc$"))
538 ;; Delete obj-* directories, sometimes present in icecat tarballs
539 (for-each delete-file-recursively
540 (scandir "." (lambda (name)
541 (string-prefix? "obj-" name))))
542 #t))))
543 (build-system gnu-build-system)
544 (inputs
545 `(("alsa-lib" ,alsa-lib)
546 ("bzip2" ,bzip2)
547 ("cairo" ,cairo)
548 ("cups" ,cups)
549 ("dbus-glib" ,dbus-glib)
550 ("gdk-pixbuf" ,gdk-pixbuf)
551 ("glib" ,glib)
552 ("gtk+" ,gtk+)
553 ("gtk+-2" ,gtk+-2)
554 ("graphite2" ,graphite2)
555 ("pango" ,pango)
556 ("freetype" ,freetype)
557 ("harfbuzz" ,harfbuzz)
558 ("hunspell" ,hunspell)
559 ("libcanberra" ,libcanberra)
560 ("libgnome" ,libgnome)
561 ("libjpeg-turbo" ,libjpeg-turbo)
562 ("libxft" ,libxft)
563 ("libevent" ,libevent-2.0)
564 ("libxinerama" ,libxinerama)
565 ("libxscrnsaver" ,libxscrnsaver)
566 ("libxcomposite" ,libxcomposite)
567 ("libxt" ,libxt)
568 ("libffi" ,libffi)
569 ("ffmpeg" ,ffmpeg-3.4)
570 ("libvpx" ,libvpx)
571 ("icu4c" ,icu4c)
572 ("pixman" ,pixman)
573 ("pulseaudio" ,pulseaudio)
574 ("mesa" ,mesa)
575 ("mit-krb5" ,mit-krb5)
576 ("nspr" ,nspr)
577 ("nss" ,nss)
578 ("sqlite" ,sqlite)
579 ("startup-notification" ,startup-notification)
580 ("unzip" ,unzip)
581 ("zip" ,zip)
582 ("zlib" ,zlib)))
583 (native-inputs
584 `(("perl" ,perl)
585 ("python" ,python-2) ; Python 3 not supported
586 ("python2-pysqlite" ,python2-pysqlite)
587 ("yasm" ,yasm)
588 ("pkg-config" ,pkg-config)
589 ("autoconf" ,autoconf-2.13)
590 ("which" ,which)))
591 (arguments
592 `(#:tests? #f ; no check target
593 #:out-of-source? #t ; must be built outside of the source directory
594
595 ;; XXX: There are RUNPATH issues such as
596 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
597 ;; which is not in its RUNPATH, but they appear to be harmless in
598 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
599 #:validate-runpath? #f
600
601 #:configure-flags '("--enable-default-toolkit=cairo-gtk3"
602
603 "--with-distribution-id=org.gnu"
604
605 "--enable-gio"
606 "--enable-startup-notification"
607 "--enable-pulseaudio"
608
609 "--disable-tests"
610 "--disable-updater"
611 "--disable-crashreporter"
612 "--disable-maintenance-service"
613 "--disable-eme"
614 "--disable-gconf"
615 "--disable-gnomeui"
616
617 ;; Building with debugging symbols takes ~5GiB, so
618 ;; disable it.
619 "--disable-debug"
620 "--disable-debug-symbols"
621
622 ;; Hack to work around missing
623 ;; "unofficial" branding in icecat.
624 "--enable-official-branding"
625
626 ;; Avoid bundled libraries.
627 "--with-system-zlib"
628 "--with-system-bz2"
629 "--with-system-jpeg" ; must be libjpeg-turbo
630 "--with-system-libevent"
631 "--with-system-libvpx"
632 "--with-system-icu"
633 "--with-system-nspr"
634 "--with-system-nss"
635 "--with-system-harfbuzz"
636 "--with-system-graphite2"
637 "--enable-system-pixman"
638 "--enable-system-cairo"
639 "--enable-system-ffi"
640 "--enable-system-hunspell"
641 "--enable-system-sqlite"
642
643 ;; Fails with "--with-system-png won't work because
644 ;; the system's libpng doesn't have APNG support".
645 ;; According to
646 ;; http://sourceforge.net/projects/libpng-apng/ ,
647 ;; "the Animated Portable Network Graphics (APNG)
648 ;; is an unofficial extension of the Portable
649 ;; Network Graphics (PNG) format";
650 ;; we probably do not wish to support it.
651 ;; "--with-system-png"
652 )
653
654 #:modules ((ice-9 ftw)
655 (ice-9 rdelim)
656 (ice-9 match)
657 ,@%gnu-build-system-modules)
658 #:phases
659 (modify-phases %standard-phases
660 (add-after
661 'unpack 'ensure-no-mtimes-pre-1980
662 (lambda _
663 ;; Without this, the 'source/test/addons/packed.xpi' and
664 ;; 'source/test/addons/simple-prefs.xpi' targets fail while trying
665 ;; to create zip archives.
666 (let ((early-1980 315619200)) ; 1980-01-02 UTC
667 (ftw "." (lambda (file stat flag)
668 (unless (<= early-1980 (stat:mtime stat))
669 (utime file early-1980 early-1980))
670 #t))
671 #t)))
672 (add-after
673 'unpack 'use-skia-by-default
674 (lambda _
675 ;; Use the bundled Skia library by default, since IceCat appears
676 ;; to be far more stable when using it than when using our system
677 ;; Cairo.
678 (let ((out (open "browser/app/profile/icecat.js"
679 (logior O_WRONLY O_APPEND))))
680 (format out "~%// Use Skia by default~%")
681 (format out "pref(~s, ~s);~%" "gfx.canvas.azure.backends" "skia")
682 (format out "pref(~s, ~s);~%" "gfx.content.azure.backends" "skia")
683 (close-port out))
684 #t))
685 (add-after
686 'unpack 'link-libxul-with-libraries
687 (lambda _
688 ;; libxul.so dynamically opens libraries, so here we explicitly
689 ;; link them into libxul.so instead.
690 ;;
691 ;; TODO: It might be preferable to patch in absolute file names in
692 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
693 ;; work. More investigation is needed.
694 (substitute* "toolkit/library/moz.build"
695 (("^# This library needs to be last" all)
696 (string-append "OS_LIBS += [
697 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
698 'avcodec', 'avutil', 'pulse' ]\n\n"
699 all)))
700 #t))
701 (replace
702 'configure
703 ;; configure does not work followed by both "SHELL=..." and
704 ;; "CONFIG_SHELL=..."; set environment variables instead
705 (lambda* (#:key outputs configure-flags #:allow-other-keys)
706 (let* ((out (assoc-ref outputs "out"))
707 (bash (which "bash"))
708 (abs-srcdir (getcwd))
709 (srcdir (string-append "../" (basename abs-srcdir)))
710 (flags `(,(string-append "--prefix=" out)
711 ,(string-append "--with-l10n-base="
712 abs-srcdir "/l10n")
713 ,@configure-flags)))
714 (setenv "SHELL" bash)
715 (setenv "CONFIG_SHELL" bash)
716 (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13
717 (mkdir "../build")
718 (chdir "../build")
719 (format #t "build directory: ~s~%" (getcwd))
720 (format #t "configure flags: ~s~%" flags)
721 (zero? (apply system* bash
722 (string-append srcdir "/configure")
723 flags)))))
724 (add-before 'configure 'install-desktop-entry
725 (lambda* (#:key outputs #:allow-other-keys)
726 ;; Install the '.desktop' file.
727 (define (swallow-%%-directives input output)
728 ;; Interpret '%%ifdef' directives found in the '.desktop' file.
729 (let loop ((state 'top))
730 (match (read-line input 'concat)
731 ((? eof-object?)
732 #t)
733 ((? string? line)
734 (cond ((string-prefix? "%%ifdef" line)
735 (loop 'ifdef))
736 ((string-prefix? "%%else" line)
737 (loop 'else))
738 ((string-prefix? "%%endif" line)
739 (loop 'top))
740 (else
741 (case state
742 ((top else)
743 (display line output)
744 (loop state))
745 (else
746 (loop state)))))))))
747
748 (let* ((out (assoc-ref outputs "out"))
749 (applications (string-append out "/share/applications")))
750 (call-with-input-file "debian/icecat.desktop.in"
751 (lambda (input)
752 (call-with-output-file "debian/icecat.desktop"
753 (lambda (output)
754 (swallow-%%-directives input output)))))
755
756 (substitute* "debian/icecat.desktop"
757 (("@MOZ_DISPLAY_NAME@")
758 "GNU IceCat")
759 (("^Exec=@MOZ_APP_NAME@")
760 (string-append "Exec=" out "/bin/icecat"))
761 (("@MOZ_APP_NAME@")
762 "icecat"))
763 (install-file "debian/icecat.desktop" applications)
764 #t)))
765 (add-after 'install-desktop-entry 'install-icons
766 (lambda* (#:key outputs #:allow-other-keys)
767 (let ((out (assoc-ref outputs "out")))
768 (with-directory-excursion "browser/branding/official"
769 (for-each
770 (lambda (file)
771 (let* ((size (string-filter char-numeric? file))
772 (icons (string-append out "/share/icons/hicolor/"
773 size "x" size "/apps")))
774 (mkdir-p icons)
775 (copy-file file (string-append icons "/icecat.png"))))
776 '("default16.png" "default22.png" "default24.png"
777 "default32.png" "default48.png" "content/icon64.png"
778 "mozicon128.png" "default256.png"))))))
779 ;; This fixes the file chooser crash that happens with GTK 3.
780 (add-after 'install 'wrap-program
781 (lambda* (#:key inputs outputs #:allow-other-keys)
782 (let* ((out (assoc-ref outputs "out"))
783 (lib (string-append out "/lib"))
784 (gtk (assoc-ref inputs "gtk+"))
785 (gtk-share (string-append gtk "/share")))
786 (wrap-program (car (find-files lib "^icecat$"))
787 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))))
788 (home-page "https://www.gnu.org/software/gnuzilla/")
789 (synopsis "Entirely free browser derived from Mozilla Firefox")
790 (description
791 "IceCat is the GNU version of the Firefox browser. It is entirely free
792 software, which does not recommend non-free plugins and addons. It also
793 features built-in privacy-protecting features.")
794 (license license:mpl2.0) ;and others, see toolkit/content/license.html
795 (properties
796 `((ftp-directory . "/gnu/gnuzilla")
797 (cpe-name . "firefox_esr")
798 (cpe-version . ,(first (string-split version #\-)))))))