Merge remote-tracking branch 'origin/master' into core-updates
[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 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014, 2015, 2016, 2017 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 ng0 <ng0@infotropique.org>
10 ;;; Copyright © 2017 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.17")
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 "158hdn285dsb5rys8wl1wi32dd1axwhqq0r8fwny4aj157m0l2jr"))))
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 #:phases (modify-phases %standard-phases
272 (add-before 'configure 'chdir
273 (lambda _ (chdir "nspr") #t)))))
274 (home-page
275 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR")
276 (synopsis "Netscape API for system level and libc-like functions")
277 (description "Netscape Portable Runtime (NSPR) provides a
278 platform-neutral API for system level and libc-like functions. It is used
279 in the Mozilla clients.")
280 (license license:mpl2.0)))
281
282 (define-public nss
283 (package
284 (name "nss")
285 (version "3.34.1")
286 (source (origin
287 (method url-fetch)
288 (uri (let ((version-with-underscores
289 (string-join (string-split version #\.) "_")))
290 (string-append
291 "https://ftp.mozilla.org/pub/mozilla.org/security/nss/"
292 "releases/NSS_" version-with-underscores "_RTM/src/"
293 "nss-" version ".tar.gz")))
294 (sha256
295 (base32
296 "186x33wsk4mzjz7dzbn8p0py9a0nzkgzpfkdv4rlyy5gghv5vhd3"))
297 ;; Create nss.pc and nss-config.
298 (patches (search-patches "nss-pkgconfig.patch"
299 "nss-increase-test-timeout.patch"))))
300 (build-system gnu-build-system)
301 (outputs '("out" "bin"))
302 (arguments
303 `(#:parallel-build? #f ; not supported
304 #:make-flags
305 (let* ((out (assoc-ref %outputs "out"))
306 (nspr (string-append (assoc-ref %build-inputs "nspr")))
307 (rpath (string-append "-Wl,-rpath=" out "/lib/nss")))
308 (list "-C" "nss" (string-append "PREFIX=" out)
309 "NSDISTMODE=copy"
310 "NSS_USE_SYSTEM_SQLITE=1"
311 (string-append "NSPR_INCLUDE_DIR=" nspr "/include/nspr")
312 ;; Add $out/lib/nss to RPATH.
313 (string-append "RPATH=" rpath)
314 (string-append "LDFLAGS=" rpath)))
315 #:modules ((guix build gnu-build-system)
316 (guix build utils)
317 (ice-9 ftw)
318 (ice-9 match)
319 (srfi srfi-26))
320 #:phases
321 (modify-phases %standard-phases
322 (replace 'configure
323 (lambda _
324 (setenv "CC" "gcc")
325 ;; Tells NSS to build for the 64-bit ABI if we are 64-bit system.
326 ,@(match (%current-system)
327 ((or "x86_64-linux" "aarch64-linux")
328 `((setenv "USE_64" "1")))
329 (_
330 '()))
331 #t))
332 (replace 'check
333 (lambda _
334 ;; Use 127.0.0.1 instead of $HOST.$DOMSUF as HOSTADDR for testing.
335 ;; The later requires a working DNS or /etc/hosts.
336 (setenv "DOMSUF" "(none)")
337 (setenv "USE_IP" "TRUE")
338 (setenv "IP_ADDRESS" "127.0.0.1")
339 (zero? (system* "./nss/tests/all.sh"))))
340 (replace 'install
341 (lambda* (#:key outputs #:allow-other-keys)
342 (let* ((out (assoc-ref outputs "out"))
343 (bin (string-append (assoc-ref outputs "bin") "/bin"))
344 (inc (string-append out "/include/nss"))
345 (lib (string-append out "/lib/nss"))
346 (obj (match (scandir "dist" (cut string-suffix? "OBJ" <>))
347 ((obj) (string-append "dist/" obj)))))
348 ;; Install nss-config to $out/bin.
349 (install-file (string-append obj "/bin/nss-config")
350 (string-append out "/bin"))
351 (delete-file (string-append obj "/bin/nss-config"))
352 ;; Install nss.pc to $out/lib/pkgconfig.
353 (install-file (string-append obj "/lib/pkgconfig/nss.pc")
354 (string-append out "/lib/pkgconfig"))
355 (delete-file (string-append obj "/lib/pkgconfig/nss.pc"))
356 (rmdir (string-append obj "/lib/pkgconfig"))
357 ;; Install other files.
358 (copy-recursively "dist/public/nss" inc)
359 (copy-recursively (string-append obj "/bin") bin)
360 (copy-recursively (string-append obj "/lib") lib)
361
362 ;; FIXME: libgtest1.so is installed in the above step, and it's
363 ;; (unnecessarily) linked with several NSS libraries, but
364 ;; without the needed rpaths, causing the 'validate-runpath'
365 ;; phase to fail. Here we simply delete libgtest1.so, since it
366 ;; seems to be used only during the tests.
367 (delete-file (string-append lib "/libgtest1.so"))
368 (delete-file (string-append lib "/libgtestutil.so"))
369
370 #t))))))
371 (inputs
372 `(("sqlite" ,sqlite)
373 ("zlib" ,zlib)))
374 (propagated-inputs `(("nspr" ,nspr))) ; required by nss.pc.
375 (native-inputs `(("perl" ,perl)))
376
377 ;; The NSS test suite takes around 48 hours on Loongson 3A (MIPS) when
378 ;; another build is happening concurrently on the same machine.
379 (properties '((timeout . 216000))) ; 60 hours
380
381 (home-page
382 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS")
383 (synopsis "Network Security Services")
384 (description
385 "Network Security Services (@dfn{NSS}) is a set of libraries designed to
386 support cross-platform development of security-enabled client and server
387 applications. Applications built with NSS can support SSL v2 and v3, TLS,
388 PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other
389 security standards.")
390 (license license:mpl2.0)))
391
392 (define (mozilla-patch file-name changeset hash)
393 "Return an origin for CHANGESET from the mozilla-esr52 repository."
394 (origin
395 (method url-fetch)
396 (uri (string-append "https://hg.mozilla.org/releases/mozilla-esr52/raw-rev/"
397 changeset))
398 (sha256 (base32 hash))
399 (file-name file-name)))
400
401 (define-public icecat
402 (package
403 (name "icecat")
404 (version "52.3.0-gnu1")
405 (source
406 (origin
407 (method url-fetch)
408 (uri (string-append "mirror://gnu/gnuzilla/"
409 (first (string-split version #\-))
410 "/" name "-" version ".tar.bz2"))
411 (sha256
412 (base32
413 "00jki754d6310fxj1b7dbhqj69y5igck6gqg6rgfya243nsb56k9"))
414 (patches
415 (list
416 (search-patch "icecat-avoid-bundled-libraries.patch")
417 (mozilla-patch "icecat-bug-546387.patch" "d13e3fefb76e" "1b760r0bg2ydbl585wlmajljh1nlisrwxvjws5b28a3sgjy01i6k")
418 (mozilla-patch "icecat-bug-1350152.patch" "f822bda79c28" "1wf56169ca874shr6r7qx40s17h2gwj7ngmpyylrpmd1c6hipvsj")
419 (mozilla-patch "icecat-bug-1388166.patch" "fbb0bdb191d5" "1y8wpj38vw1dd6f375s9i0mrk9bd8z8gz5g70p4qynfllpkn072d")
420 (mozilla-patch "icecat-CVE-2017-7810-pt1.patch" "fbddb5cdd3c7" "0k5nyl2z1y2rx9fwqyfj64678yv6v3pnmshgk552pbzqmaf8i1hq")
421 (mozilla-patch "icecat-CVE-2017-7810-pt2.patch" "76c25987a275" "095b9vwsiza9ikbnnppfcld16h75x5bxjfxc73913y04n0i42ifh")
422 (mozilla-patch "icecat-CVE-2017-7810-pt3.patch" "32eec29a85a5" "057simakqg56jvas1wkskg5kszn96m74nca26x08d5w7rzmbv1q2")
423 (mozilla-patch "icecat-bug-1373222.patch" "ecef71fa933f" "0vsymgy5j702lamvh2riahni7rdj9ba3bd6i4a2m22d638rwp1i2")
424 (mozilla-patch "icecat-CVE-2017-7814.patch" "68a444daf85b" "1faaadaajidzb9i00710zxdyv370hlrdg1l5rw2ymfmzbjj4jqyd")
425 (mozilla-patch "icecat-bug-1376825.patch" "eeeec9cafc4e" "188qf6zi9kyxb33330yia6wmrd5mdyqn5hr1cl38zy7m3akv8srh")
426 (mozilla-patch "icecat-bug-1385272.patch" "d68fa12fbffc" "13gh97vz9n2b7303jcvr1072iy8bghy9chvbmxzvw82prvkscavw")
427 (mozilla-patch "icecat-bug-1390002.patch" "c24e6fc9f689" "0aswhy5fz2f6wzd5j5gg3nqvz707ip344089h2z2chcp146vxmf4")
428 (mozilla-patch "icecat-CVE-2017-7810-pt4.patch" "ae110cf77596" "0gdrkfq9wy9cfcdgbj14ci86xgh2prkbz69pfy97r9igd8059syw")
429 (mozilla-patch "icecat-CVE-2017-7810-pt5.patch" "b8417112486d" "1hya6lccz7vm51v4f6ww072794cwzmfn9xhxmvrnqbiyspxx5fz4")
430 (mozilla-patch "icecat-bug-1386905.patch" "badbf4308211" "0fj1pyjqfdsbrlfykwmkzav2nvdj1f4grwq3cal9f7ay6wjnfs9b")
431 (mozilla-patch "icecat-CVE-2017-7810-pt6.patch" "d78675515c78" "03w5hqy40xkckbaf5bm9kdbdqvp9ffvpk9mlrc9lja6b7qa4pjhg")
432 (mozilla-patch "icecat-bug-1382303.patch" "f01155fe4d54" "0hnz1kvmvspg6453kydsklbvrjgzn8x3djvrym3f2xl2yinaf90d")
433 (mozilla-patch "icecat-bug-1393467.patch" "4eec2a60622c" "1h006mwcsagq7mz7haymwgr7fn4zj14n5lxbjcmhdqrxdvma2hjj")
434 (mozilla-patch "icecat-bug-1384801.patch" "9556e792f905" "0i74r807189s8i78483caiifw68cn7fs543i4cys6k3gn12dhhjy")
435 (mozilla-patch "icecat-CVE-2017-7823.patch" "bd284765b5bc" "1c4hss87kc4qwx30magbqczm9h7zmwirjfc8zimqbrnwv9bbsfh3")
436 (mozilla-patch "icecat-CVE-2017-7805.patch" "113da8d46aa4" "1vy0lw659mwixmb57mgybga152rdwqd5zj1g7nfw1zgp15pfwr75")
437 (mozilla-patch "icecat-bug-1376399.patch" "58a574502ca9" "1zmg91pg0s5nwngc32a4fywidvxyaayvx1h052fsv0i4cfm16l9v")
438 (mozilla-patch "icecat-bug-1396570.patch" "24db61862c54" "0af1jjfma042xvn0xhgims1yvb2b51nhn4m0pcfwg3fn0llmka03")
439 (mozilla-patch "icecat-CVE-2017-7819.patch" "1a02f11c6efe" "18a9qvdvrqw34qw3lljg6gkn358jl23lyimhmbc964023rhs36sz")
440 (mozilla-patch "icecat-CVE-2017-7810-pt7.patch" "002686d9536f" "065g0d759wfiaj69b1sqg7l08p2knc0q9m9hvkgwwsf0r78xcbjj")
441 (mozilla-patch "icecat-CVE-2017-7810-pt8.patch" "eaadb31758d8" "0b3k3la6ykac5mbp9gyqqgjbmj19vx9sl1b0wp387qar0p12nyaz")
442 (mozilla-patch "icecat-bug-1368269.patch" "0cff5e66e0f4" "0jb0wqi7c0ih4441s1908j6gv18v4inh7k2w47h3c9nhz4rgyrw7")
443 (mozilla-patch "icecat-CVE-2017-7793.patch" "6ff3c82962f0" "0bw82034kdmrpznigbavzzsiybzrw8giyf8v0z2cxf6mwl72bf9k")
444 (mozilla-patch "icecat-bug-1400399.patch" "d6f78b1349b7" "0i3gwr2al3xl65yfa3nimvy8dp0jzpx21f6bjw18xwn7zkkh9j54")
445 (mozilla-patch "icecat-bug-1400721.patch" "285cde398833" "0a1i32zl30wfyw7zkqj595s94n6wdlg5c495m0910pd05pjg3qam")
446 (mozilla-patch "icecat-CVE-2017-7826-pt01.patch" "98b3988592a6" "03wy173lj6mvmh5q92brf596h8676h0zasgqfnndpvsmsiaih120")
447 (mozilla-patch "icecat-CVE-2017-7826-pt02.patch" "47590f0c274b" "0zsys6dcyhfb4a8k2dhsls7425jg6r1ijlrsn1lc5smwyf62zx5v")
448 (mozilla-patch "icecat-CVE-2017-7826-pt03.patch" "55b435cbbb55" "1gcasaqrxa13a55v05bkxl3d1md829kpfhqiaws83wn08x28l0my")
449 (mozilla-patch "icecat-CVE-2017-7826-pt04.patch" "8549cf2dab3e" "168gs32ncavaj9xn4gwhh9i01cbpnhgx9yn333apsrc1gwknpvsr")
450 (mozilla-patch "icecat-CVE-2017-7826-pt05.patch" "349acf56ff49" "1vwn87rdryfjsn809pl50xmr82q98gz3vz9h6clkd905vbd9rwz7")
451 (mozilla-patch "icecat-CVE-2017-7826-pt06.patch" "3af5bf8bdea0" "07az28dnpxr36j7i3llxkrlkrmg0bwk4f3sm75x1f0r1v5575p3p")
452 (mozilla-patch "icecat-CVE-2017-7826-pt07.patch" "592df6088926" "1gy27idik4b6wcg4szww08cmpcljssja8wql6w1d807h7ni65lr7")
453 (mozilla-patch "icecat-CVE-2017-7826-pt08.patch" "77a2d4610275" "13ysbwflnysj4rs45ibckd621s0vyg1s8dvannlvanvrz1g72zcz")
454 (mozilla-patch "icecat-CVE-2017-7826-pt09.patch" "2b30335d0b95" "0hs5cwickvfw7r5dn7y148jgr2b21hl613qp83k56634d0y64qwp")
455 (mozilla-patch "icecat-CVE-2017-7826-pt10.patch" "d6f008f95598" "0xclxrbg7pv8pa2j15p0gy9c8sigy2i9j0kvazl5fbyg6jsg3xgd")
456 (mozilla-patch "icecat-CVE-2017-7826-pt11.patch" "ab9b51cd75ac" "08jy3rbkyh934aw261ls0s87947d2mhss7xqk1xfdir9crij2g27")
457 (mozilla-patch "icecat-bug-1343147-pt1.patch" "971d6345bc3a" "13791cvc51i991i5qyz6gp94vwzwkx479bnr8fsf8dw7z72wrsch")
458 (mozilla-patch "icecat-bug-1343147-pt2.patch" "60df7db06669" "0r372g1zksvkzyz0qpq0mp30frilgsfxxx2xida8xc08wgxp5lh9")
459 (mozilla-patch "icecat-CVE-2017-7826-pt12.patch" "df49c25e6e4c" "0j77xbkxpflqf4jlccrv61vq0jgp4lfn8kb0zw1lswp3cyd6ml4i")
460 (mozilla-patch "icecat-CVE-2017-7826-pt13.patch" "3b899f872623" "01zjcpm8yp4s8yf4mj1bzq01aylmi69kd8qv0rrcl9hmj4g3pzr2")
461 (mozilla-patch "icecat-CVE-2017-7826-pt14.patch" "3d6d558ae6a6" "17wynknvs5wi7m9g5vn43rjmivbg1l6pnv8jymz1ccidy27qgdqi")
462 (mozilla-patch "icecat-CVE-2017-7826-pt15.patch" "8426754b7130" "0bbm2294bkvld55rdbpsc8b82ljqdcxpbg6cwdzvwfhqayl2pnqm")
463 (mozilla-patch "icecat-CVE-2017-7828-pt1.patch" "5ddd5d2aa769" "12z5i8h6qwjb1h1fvp2426bgsnsxx539d8k2is9x1q4133356niy")
464 (mozilla-patch "icecat-CVE-2017-7826-pt16.patch" "dd068f4e132a" "17qy9c1vfkz3pj6y8qmqbic73wrangsbdlylk2s54nbzhhp9cj1g")
465 (mozilla-patch "icecat-CVE-2017-7826-pt17.patch" "e6bd533b57e9" "1mmqav9yhxd0j47yffcdykaqjibfwjsk0jn0f44099s87y8qn9zy")
466 (mozilla-patch "icecat-CVE-2017-7826-pt18.patch" "2a87fb6b9c07" "0z0scw4y1vqhqkbw1ag14g8xrif14l95x7fd50q2sw425lli29lc")
467 (mozilla-patch "icecat-bug-1404910.patch" "5007f2472f64" "0ns1l4yipwbb52sps2xzg30qd1rkpwykxq4chjg3wllhmcxbvvpw")
468 (mozilla-patch "icecat-CVE-2017-7830.patch" "04e3b5c1f0b2" "0nmv3jnx94ykxg64xkiwc8kx4df8zw7y5yzjnxz1sll2v88b9hmf")
469 (mozilla-patch "icecat-CVE-2017-7828-pt2.patch" "2f48c03d9b3f" "16qdy3rahmkhsjnzqjcgzg1a4k7czd40m04gs9i75cd88kbripri")
470 (mozilla-patch "icecat-bug-1348660-pt1.patch" "a352bfcbaf55" "1j3kxnhci9fh3lj8rizbcfv8xzn5kikxwpfy8a091d51sdn20873")
471 (mozilla-patch "icecat-bug-1348660-pt2.patch" "57f43e2ab9b5" "1jva4y79zb85npak3mddrx5rsf4mxczb314kcr8yhlkwqv0nx5sp")
472 (mozilla-patch "icecat-bug-1348660-pt3.patch" "917d65bb8896" "0k29y8i96lanqjjm6vybg0s6gjbk1mz5bfnga6aj1g0hnb7c3s8d")
473 (mozilla-patch "icecat-bug-1348660-pt4.patch" "28934912eede" "1mhxw26050l3d09n8w912a86df87afcshvsk9k1k375anfk0927x")
474 (search-patch "icecat-bug-1348660-pt5.patch")
475 (mozilla-patch "icecat-bug-1348660-pt6.patch" "556ff3bfb9fc" "0kckjc8jp885xfaiwx2b9qnk1plqjhi0mwhjjcmfajvh3l3mrl8h")
476 (mozilla-patch "icecat-bug-1350564.patch" "2abf26abb2a2" "0axdzp9g9k74wpkwrsdx263h01sv9bd3rarhhl68xnvc7n6i45lx")
477 (mozilla-patch "icecat-bug-1404787.patch" "8335e1d7b140" "17d7kb8ginzflhdkrbi60vh2b907spbzmvwih7a595gqpihmnqqn")
478 (mozilla-patch "icecat-CVE-2017-7826-pt19.patch" "de336078d36b" "0gyzbap8hr1iywk0x2x0h7z7zp7q89hi56h8c03vvc7771dkvjkf")
479 (mozilla-patch "icecat-bug-1047098-pt1.patch" "088577f0c46e" "0y3sz6kx07ls7jsvhqhhrl6v69a94wqvv3lz7hnplah23y06h17z")
480 (mozilla-patch "icecat-bug-1047098-pt2.patch" "c7e3abf74023" "11dcjzx56v4yb2dvm23j2g86q8yva2hc69lmb7s5w18l6ygwwhzr")
481 (mozilla-patch "icecat-bug-1047098-pt3.patch" "36bd15d14c5a" "0cb3l3hpsgk674f08kfamxhqfga3ah5v904gpxq9ag006vzd2cxz")
482 (mozilla-patch "icecat-bug-1404105.patch" "2909ba991f31" "126vssj57dc800347f075wlnjzcwamnxxmgxl9w78jpb0hj9gf16")
483 (search-patch "icecat-bug-1415133.patch")
484 (mozilla-patch "icecat-bug-1355576.patch" "cf34a0574e58" "1z7sa1d12hypgivm5xxn32s58afpjcij97jvnafcgnfvxywrgr1m")
485 (mozilla-patch "icecat-CVE-2017-7843.patch" "f6216ea8b8fc" "0jnhdkj0ch9mj01mzlvhjgf8zsxlbg6m7yvpq99qr7xmg0pzbgwl")
486 (mozilla-patch "icecat-bug-1413741.patch" "4e00ce2897c4" "0k95vi31glia2i03djidkc0gkwp9qldy34fz1rxcj56a1iphbq7w")
487 (mozilla-patch "icecat-bug-1224396.patch" "92d450811409" "0xsvggnr0y65nd52nkbjvpcbs5nd84pvbayk5vinbx1mnk2wh2vy")
488 (mozilla-patch "icecat-bug-1415582.patch" "7eba7d14704a" "1vi17qmjzh3kji14iz370kvs4425asgp93ns2chf5ldlq5b9196g")
489 (mozilla-patch "icecat-bug-1417797.patch" "457d023c167e" "11g8hg8yp20lsn52dx1ym8r4yjsnsmx0h182d6nbl6ab9wp7d1m9")
490 (mozilla-patch "icecat-bug-1410134.patch" "5e7b16213198" "14c4x6c3mygf8p77n9bia5rndjpngbvik1r1ylk97k3ggy4fj6zh")
491 (mozilla-patch "icecat-bug-1419363.patch" "0712b6cbbdc8" "0rllsq6ckpms7g9k6qky1gr5rz1gav4widrha6w1s9f88cbrqgk5")
492 (mozilla-patch "icecat-bug-1408276.patch" "084c427ccf99" "0sjdy2iang09a9g6liavpjgry04dp6smjgj0y7lp5lfqijdr8q2d")
493 (mozilla-patch "icecat-bug-1382366.patch" "1bfb3d8d4510" "0c2dcxj74ijs6qf9sqcbj8w998hblic66vy41818z7xnw46j5j1j")
494 (mozilla-patch "icecat-bug-1414425.patch" "5623e01e63a8" "08dn3v96bsb61hy3wfxz43fhn1mk9vlm5ydvdjgi3wiqadvacgzs")
495 (mozilla-patch "icecat-bug-1409951.patch" "14a389d40329" "0f4gbak5bd2walxrxs3myig28v9lhvplf3a1nws1a4ajx80slzq1")
496 (mozilla-patch "icecat-bug-1415441.patch" "7339297cddb7" "017lbw0mn5rwzb2abfw6qrk07m3r96vwbj81cmqvdfnmprcjni5j")
497 (mozilla-patch "icecat-bug-1418922.patch" "aa55d4cdaee5" "1l3qwjfx0jsbbw2dg8bsnx7k47zibamgswndq0d1bchnmary62aw")
498 (mozilla-patch "icecat-bug-1382358.patch" "762f4e53889a" "0n61zrb6rz9bhhdsqs5ziwaiy81pq52c76p9qmi9hrxbn24ism1k")
499 (mozilla-patch "icecat-bug-1399520.patch" "0152d097672f" "16ybg718calvciv00kil8s97lhh11hj6gx0acf73r44xfkvm8nfg")
500 (search-patch "icecat-bug-1414945.patch")
501 (mozilla-patch "icecat-bug-1414452.patch" "079356ed5317" "107c0b93g2k743wvhwz2ps3j6p09qld7d0raljijv5y5n8q4wp92")
502 (mozilla-patch "icecat-bug-1418854.patch" "93e4994a892c" "00r2qxw3619529vy9d04dl9kcziqy3fv3iawgy9svzygyx1kj5wx")
503 (mozilla-patch "icecat-bug-1422389.patch" "f8a6e1864832" "1wbxn0v50637yjg8b8675k01x9cyx95jpjxpyqfaa97762qkznba")
504 (mozilla-patch "icecat-bug-1415598.patch" "0cc1c9068714" "1qmqpi14zs7c95k3c7396gpp6apb622k0mgv553kw4rr81nj1yac")
505 (mozilla-patch "icecat-bug-1418447.patch" "ce6f3fb2bf58" "1b1msb5d5jsgrqa2hkbsrm0n54qdmx1b2bf65v44v17appa03lra")
506 (mozilla-patch "icecat-bug-1423159.patch" "6b4d3c5d5e51" "074p93dhwr1ckhypkjpblnmg9hg44a9030g1glqffi9dyn3iq3k4")
507 (mozilla-patch "icecat-bug-1411745.patch" "1a510ee578a0" "1imb7glh2m1zwvvpvr4k4iddms5byqzr35j7kv3y5is77aiwl4z5")
508 (mozilla-patch "icecat-bug-1411708.patch" "34c968767eb7" "0l2jy201ikj3m3h66mvlsj4y0ki7cpm7x7nnfygbwnfxg42s1sip")
509 (mozilla-patch "icecat-bug-1423086.patch" "bc166be85bb4" "0w1lrjzfrfflaw4l6sfi3ir81iyi9gyfck5g41dwp0jc1b59jzvg")
510 (mozilla-patch "icecat-bug-1412145.patch" "66cfc3c4047d" "05j8ic4lv2d2ygr6d62rkdlfyg2rpljalwrkkhllinw2dfi3n15b")
511 (mozilla-patch "icecat-bug-1399400.patch" "3236ffdf0ced" "1kvk4qyslaj1ldgs1wpxnf79zajcihzcd1zvbrg990i3hgyn3gk3")
512 (mozilla-patch "icecat-bug-1424373-pt1.patch" "320032aaa068" "1ch282qibprz1q0f2imvynh4sg7gads6sf3ayhjcd62zjncpgyz7")
513 (search-patch "icecat-bug-1424373-pt2.patch")))
514 (modules '((guix build utils)))
515 (snippet
516 '(begin
517 (use-modules (ice-9 ftw))
518 ;; Remove bundled libraries that we don't use, since they may
519 ;; contain unpatched security flaws, they waste disk space and
520 ;; network bandwidth, and may cause confusion.
521 (for-each delete-file-recursively
522 '(;; FIXME: Removing the bundled icu breaks configure.
523 ;; * The bundled icu headers are used in some places.
524 ;; * The version number is taken from the bundled copy.
525 ;;"intl/icu"
526 ;;
527 ;; FIXME: A script from the bundled nspr is used.
528 ;;"nsprpub"
529 ;;
530 ;; TODO: Use system media libraries. Waiting for:
531 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
532 ;; * libogg
533 ;; * libtheora
534 ;; * libvorbis
535 ;; * libtremor (not yet in guix)
536 ;; * libopus
537 ;; * speex
538 ;; * soundtouch (not yet in guix)
539 ;;
540 ;; TODO: Use system harfbuzz. Waiting for:
541 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=847568>
542 ;;
543 ;; TODO: Use system graphite2.
544 ;;
545 "modules/freetype2"
546 "modules/zlib"
547 "modules/libbz2"
548 "ipc/chromium/src/third_party/libevent"
549 "media/libjpeg"
550 "media/libvpx"
551 "security/nss"
552 "gfx/cairo"
553 "js/src/ctypes/libffi"
554 "db/sqlite3"))
555 ;; Delete .pyc files, typically present in icecat source tarballs
556 (for-each delete-file (find-files "." "\\.pyc$"))
557 ;; Delete obj-* directories, sometimes present in icecat tarballs
558 (for-each delete-file-recursively
559 (scandir "." (lambda (name)
560 (string-prefix? "obj-" name))))
561 #t))))
562 (build-system gnu-build-system)
563 (inputs
564 `(("alsa-lib" ,alsa-lib)
565 ("bzip2" ,bzip2)
566 ("cairo" ,cairo)
567 ("cups" ,cups)
568 ("dbus-glib" ,dbus-glib)
569 ("gdk-pixbuf" ,gdk-pixbuf)
570 ("glib" ,glib)
571 ("gtk+" ,gtk+)
572 ("gtk+-2" ,gtk+-2)
573 ("pango" ,pango)
574 ("freetype" ,freetype)
575 ("hunspell" ,hunspell)
576 ("libcanberra" ,libcanberra)
577 ("libgnome" ,libgnome)
578 ("libjpeg-turbo" ,libjpeg-turbo)
579 ("libxft" ,libxft)
580 ("libevent" ,libevent-2.0)
581 ("libxinerama" ,libxinerama)
582 ("libxscrnsaver" ,libxscrnsaver)
583 ("libxcomposite" ,libxcomposite)
584 ("libxt" ,libxt)
585 ("libffi" ,libffi)
586 ("ffmpeg" ,ffmpeg)
587 ("libvpx" ,libvpx)
588 ("icu4c" ,icu4c)
589 ("pixman" ,pixman)
590 ("pulseaudio" ,pulseaudio)
591 ("mesa" ,mesa)
592 ("mit-krb5" ,mit-krb5)
593 ("nspr" ,nspr)
594 ("nss" ,nss)
595 ("sqlite" ,sqlite)
596 ("startup-notification" ,startup-notification)
597 ("unzip" ,unzip)
598 ("zip" ,zip)
599 ("zlib" ,zlib)))
600 (native-inputs
601 `(("perl" ,perl)
602 ("python" ,python-2) ; Python 3 not supported
603 ("python2-pysqlite" ,python2-pysqlite)
604 ("yasm" ,yasm)
605 ("pkg-config" ,pkg-config)
606 ("autoconf" ,autoconf-2.13)
607 ("which" ,which)))
608 (arguments
609 `(#:tests? #f ; no check target
610 #:out-of-source? #t ; must be built outside of the source directory
611
612 ;; XXX: There are RUNPATH issues such as
613 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
614 ;; which is not in its RUNPATH, but they appear to be harmless in
615 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
616 #:validate-runpath? #f
617
618 #:configure-flags '("--enable-default-toolkit=cairo-gtk3"
619 "--enable-gio"
620 "--enable-startup-notification"
621 "--enable-pulseaudio"
622
623 "--disable-gconf"
624 "--disable-gnomeui"
625
626 ;; Building with debugging symbols takes ~5GiB, so
627 ;; disable it.
628 "--disable-debug"
629 "--disable-debug-symbols"
630
631 ;; Hack to work around missing
632 ;; "unofficial" branding in icecat.
633 "--enable-official-branding"
634
635 ;; Avoid bundled libraries.
636 "--with-system-zlib"
637 "--with-system-bz2"
638 "--with-system-jpeg" ; must be libjpeg-turbo
639 "--with-system-libevent"
640 "--with-system-libvpx"
641 "--with-system-icu"
642 "--with-system-nspr"
643 "--with-system-nss"
644 "--enable-system-pixman"
645 "--enable-system-cairo"
646 "--enable-system-ffi"
647 "--enable-system-hunspell"
648 "--enable-system-sqlite"
649
650 ;; Fails with "--with-system-png won't work because
651 ;; the system's libpng doesn't have APNG support".
652 ;; According to
653 ;; http://sourceforge.net/projects/libpng-apng/ ,
654 ;; "the Animated Portable Network Graphics (APNG)
655 ;; is an unofficial extension of the Portable
656 ;; Network Graphics (PNG) format";
657 ;; we probably do not wish to support it.
658 ;; "--with-system-png"
659 )
660
661 #:modules ((ice-9 ftw)
662 (ice-9 rdelim)
663 (ice-9 match)
664 ,@%gnu-build-system-modules)
665 #:phases
666 (modify-phases %standard-phases
667 (add-after
668 'unpack 'ensure-no-mtimes-pre-1980
669 (lambda _
670 ;; Without this, the 'source/test/addons/packed.xpi' and
671 ;; 'source/test/addons/simple-prefs.xpi' targets fail while trying
672 ;; to create zip archives.
673 (let ((early-1980 315619200)) ; 1980-01-02 UTC
674 (ftw "." (lambda (file stat flag)
675 (unless (<= early-1980 (stat:mtime stat))
676 (utime file early-1980 early-1980))
677 #t))
678 #t)))
679 (add-after
680 'unpack 'use-skia-by-default
681 (lambda _
682 ;; Use the bundled Skia library by default, since IceCat appears
683 ;; to be far more stable when using it than when using our system
684 ;; Cairo.
685 (let ((out (open "browser/app/profile/icecat.js"
686 (logior O_WRONLY O_APPEND))))
687 (format out "~%// Use Skia by default~%")
688 (format out "pref(~s, ~s);~%" "gfx.canvas.azure.backends" "skia")
689 (format out "pref(~s, ~s);~%" "gfx.content.azure.backends" "skia")
690 (close-port out))
691 #t))
692 (add-after
693 'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
694 (lambda _
695 ;; libxul.so dynamically opens libraries, so here we explicitly
696 ;; link them into libxul.so instead.
697 ;;
698 ;; TODO: It might be preferable to patch in absolute file names in
699 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
700 ;; work. More investigation is needed.
701 (substitute* "toolkit/library/moz.build"
702 (("^# This library needs to be last" all)
703 (string-append "OS_LIBS += [
704 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
705 'avcodec', 'avutil', 'pulse' ]\n\n"
706 all)))
707 #t))
708 (replace
709 'configure
710 ;; configure does not work followed by both "SHELL=..." and
711 ;; "CONFIG_SHELL=..."; set environment variables instead
712 (lambda* (#:key outputs configure-flags #:allow-other-keys)
713 (let* ((out (assoc-ref outputs "out"))
714 (bash (which "bash"))
715 (abs-srcdir (getcwd))
716 (srcdir (string-append "../" (basename abs-srcdir)))
717 (flags `(,(string-append "--prefix=" out)
718 ,(string-append "--with-l10n-base="
719 abs-srcdir "/l10n")
720 ,@configure-flags)))
721 (setenv "SHELL" bash)
722 (setenv "CONFIG_SHELL" bash)
723 (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13
724 (mkdir "../build")
725 (chdir "../build")
726 (format #t "build directory: ~s~%" (getcwd))
727 (format #t "configure flags: ~s~%" flags)
728 (zero? (apply system* bash
729 (string-append srcdir "/configure")
730 flags)))))
731 (add-before 'configure 'install-desktop-entry
732 (lambda* (#:key outputs #:allow-other-keys)
733 ;; Install the '.desktop' file.
734 (define (swallow-%%-directives input output)
735 ;; Interpret '%%ifdef' directives found in the '.desktop' file.
736 (let loop ((state 'top))
737 (match (read-line input 'concat)
738 ((? eof-object?)
739 #t)
740 ((? string? line)
741 (cond ((string-prefix? "%%ifdef" line)
742 (loop 'ifdef))
743 ((string-prefix? "%%else" line)
744 (loop 'else))
745 ((string-prefix? "%%endif" line)
746 (loop 'top))
747 (else
748 (case state
749 ((top else)
750 (display line output)
751 (loop state))
752 (else
753 (loop state)))))))))
754
755 (let* ((out (assoc-ref outputs "out"))
756 (applications (string-append out "/share/applications")))
757 (call-with-input-file "debian/icecat.desktop.in"
758 (lambda (input)
759 (call-with-output-file "debian/icecat.desktop"
760 (lambda (output)
761 (swallow-%%-directives input output)))))
762
763 (substitute* "debian/icecat.desktop"
764 (("@MOZ_DISPLAY_NAME@")
765 "GNU IceCat")
766 (("^Exec=@MOZ_APP_NAME@")
767 (string-append "Exec=" out "/bin/icecat"))
768 (("@MOZ_APP_NAME@")
769 "icecat"))
770 (install-file "debian/icecat.desktop" applications)
771 #t)))
772 (add-after 'install-desktop-entry 'install-icons
773 (lambda* (#:key outputs #:allow-other-keys)
774 (let ((out (assoc-ref outputs "out")))
775 (with-directory-excursion "browser/branding/official"
776 (for-each
777 (lambda (file)
778 (let* ((size (string-filter char-numeric? file))
779 (icons (string-append out "/share/icons/hicolor/"
780 size "x" size "/apps")))
781 (mkdir-p icons)
782 (copy-file file (string-append icons "/icecat.png"))))
783 '("default16.png" "default22.png" "default24.png"
784 "default32.png" "default48.png" "content/icon64.png"
785 "mozicon128.png" "default256.png"))))))
786 ;; This fixes the file chooser crash that happens with GTK 3.
787 (add-after 'install 'wrap-program
788 (lambda* (#:key inputs outputs #:allow-other-keys)
789 (let* ((out (assoc-ref outputs "out"))
790 (lib (string-append out "/lib"))
791 (gtk (assoc-ref inputs "gtk+"))
792 (gtk-share (string-append gtk "/share")))
793 (wrap-program (car (find-files lib "^icecat$"))
794 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))))
795 (home-page "https://www.gnu.org/software/gnuzilla/")
796 (synopsis "Entirely free browser derived from Mozilla Firefox")
797 (description
798 "IceCat is the GNU version of the Firefox browser. It is entirely free
799 software, which does not recommend non-free plugins and addons. It also
800 features built-in privacy-protecting features.")
801 (license license:mpl2.0) ;and others, see toolkit/content/license.html
802 (properties
803 `((ftp-directory . "/gnu/gnuzilla")
804 (cpe-name . "firefox_esr")
805 (cpe-version . ,(first (string-split version #\-)))))))