Merge branch 'master' into staging
[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 ng0 <ng0@infotropique.org>
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.18")
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 "0d7vr3wrgp73qbywrvdkikk8vq1s1n9vhf62db80g1zqkg05g5mq"))))
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 (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.35")
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 "1ypn68z9ncbbshi3184ywrhx5i846lyd72gps1grzqzdkgh7s4pl"))
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.3.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 "00jki754d6310fxj1b7dbhqj69y5igck6gqg6rgfya243nsb56k9"))
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-1388166.patch" "fbb0bdb191d5" "1y8wpj38vw1dd6f375s9i0mrk9bd8z8gz5g70p4qynfllpkn072d")
426 (mozilla-patch "icecat-CVE-2017-7810-pt1.patch" "fbddb5cdd3c7" "0k5nyl2z1y2rx9fwqyfj64678yv6v3pnmshgk552pbzqmaf8i1hq")
427 (mozilla-patch "icecat-CVE-2017-7810-pt2.patch" "76c25987a275" "095b9vwsiza9ikbnnppfcld16h75x5bxjfxc73913y04n0i42ifh")
428 (mozilla-patch "icecat-CVE-2017-7810-pt3.patch" "32eec29a85a5" "057simakqg56jvas1wkskg5kszn96m74nca26x08d5w7rzmbv1q2")
429 (mozilla-patch "icecat-bug-1373222.patch" "ecef71fa933f" "0vsymgy5j702lamvh2riahni7rdj9ba3bd6i4a2m22d638rwp1i2")
430 (mozilla-patch "icecat-CVE-2017-7814.patch" "68a444daf85b" "1faaadaajidzb9i00710zxdyv370hlrdg1l5rw2ymfmzbjj4jqyd")
431 (mozilla-patch "icecat-bug-1376825.patch" "eeeec9cafc4e" "188qf6zi9kyxb33330yia6wmrd5mdyqn5hr1cl38zy7m3akv8srh")
432 (mozilla-patch "icecat-bug-1385272.patch" "d68fa12fbffc" "13gh97vz9n2b7303jcvr1072iy8bghy9chvbmxzvw82prvkscavw")
433 (mozilla-patch "icecat-bug-1390002.patch" "c24e6fc9f689" "0aswhy5fz2f6wzd5j5gg3nqvz707ip344089h2z2chcp146vxmf4")
434 (mozilla-patch "icecat-CVE-2017-7810-pt4.patch" "ae110cf77596" "0gdrkfq9wy9cfcdgbj14ci86xgh2prkbz69pfy97r9igd8059syw")
435 (mozilla-patch "icecat-CVE-2017-7810-pt5.patch" "b8417112486d" "1hya6lccz7vm51v4f6ww072794cwzmfn9xhxmvrnqbiyspxx5fz4")
436 (mozilla-patch "icecat-bug-1386905.patch" "badbf4308211" "0fj1pyjqfdsbrlfykwmkzav2nvdj1f4grwq3cal9f7ay6wjnfs9b")
437 (mozilla-patch "icecat-CVE-2017-7810-pt6.patch" "d78675515c78" "03w5hqy40xkckbaf5bm9kdbdqvp9ffvpk9mlrc9lja6b7qa4pjhg")
438 (mozilla-patch "icecat-bug-1382303.patch" "f01155fe4d54" "0hnz1kvmvspg6453kydsklbvrjgzn8x3djvrym3f2xl2yinaf90d")
439 (mozilla-patch "icecat-bug-1393467.patch" "4eec2a60622c" "1h006mwcsagq7mz7haymwgr7fn4zj14n5lxbjcmhdqrxdvma2hjj")
440 (mozilla-patch "icecat-bug-1384801.patch" "9556e792f905" "0i74r807189s8i78483caiifw68cn7fs543i4cys6k3gn12dhhjy")
441 (mozilla-patch "icecat-CVE-2017-7823.patch" "bd284765b5bc" "1c4hss87kc4qwx30magbqczm9h7zmwirjfc8zimqbrnwv9bbsfh3")
442 (mozilla-patch "icecat-CVE-2017-7805.patch" "113da8d46aa4" "1vy0lw659mwixmb57mgybga152rdwqd5zj1g7nfw1zgp15pfwr75")
443 (mozilla-patch "icecat-bug-1376399.patch" "58a574502ca9" "1zmg91pg0s5nwngc32a4fywidvxyaayvx1h052fsv0i4cfm16l9v")
444 (mozilla-patch "icecat-bug-1396570.patch" "24db61862c54" "0af1jjfma042xvn0xhgims1yvb2b51nhn4m0pcfwg3fn0llmka03")
445 (mozilla-patch "icecat-CVE-2017-7819.patch" "1a02f11c6efe" "18a9qvdvrqw34qw3lljg6gkn358jl23lyimhmbc964023rhs36sz")
446 (mozilla-patch "icecat-CVE-2017-7810-pt7.patch" "002686d9536f" "065g0d759wfiaj69b1sqg7l08p2knc0q9m9hvkgwwsf0r78xcbjj")
447 (mozilla-patch "icecat-CVE-2017-7810-pt8.patch" "eaadb31758d8" "0b3k3la6ykac5mbp9gyqqgjbmj19vx9sl1b0wp387qar0p12nyaz")
448 (mozilla-patch "icecat-bug-1368269.patch" "0cff5e66e0f4" "0jb0wqi7c0ih4441s1908j6gv18v4inh7k2w47h3c9nhz4rgyrw7")
449 (mozilla-patch "icecat-CVE-2017-7793.patch" "6ff3c82962f0" "0bw82034kdmrpznigbavzzsiybzrw8giyf8v0z2cxf6mwl72bf9k")
450 (mozilla-patch "icecat-bug-1400399.patch" "d6f78b1349b7" "0i3gwr2al3xl65yfa3nimvy8dp0jzpx21f6bjw18xwn7zkkh9j54")
451 (mozilla-patch "icecat-bug-1400721.patch" "285cde398833" "0a1i32zl30wfyw7zkqj595s94n6wdlg5c495m0910pd05pjg3qam")
452 (mozilla-patch "icecat-CVE-2017-7826-pt01.patch" "98b3988592a6" "03wy173lj6mvmh5q92brf596h8676h0zasgqfnndpvsmsiaih120")
453 (mozilla-patch "icecat-CVE-2017-7826-pt02.patch" "47590f0c274b" "0zsys6dcyhfb4a8k2dhsls7425jg6r1ijlrsn1lc5smwyf62zx5v")
454 (mozilla-patch "icecat-CVE-2017-7826-pt03.patch" "55b435cbbb55" "1gcasaqrxa13a55v05bkxl3d1md829kpfhqiaws83wn08x28l0my")
455 (mozilla-patch "icecat-CVE-2017-7826-pt04.patch" "8549cf2dab3e" "168gs32ncavaj9xn4gwhh9i01cbpnhgx9yn333apsrc1gwknpvsr")
456 (mozilla-patch "icecat-CVE-2017-7826-pt05.patch" "349acf56ff49" "1vwn87rdryfjsn809pl50xmr82q98gz3vz9h6clkd905vbd9rwz7")
457 (mozilla-patch "icecat-CVE-2017-7826-pt06.patch" "3af5bf8bdea0" "07az28dnpxr36j7i3llxkrlkrmg0bwk4f3sm75x1f0r1v5575p3p")
458 (mozilla-patch "icecat-CVE-2017-7826-pt07.patch" "592df6088926" "1gy27idik4b6wcg4szww08cmpcljssja8wql6w1d807h7ni65lr7")
459 (mozilla-patch "icecat-CVE-2017-7826-pt08.patch" "77a2d4610275" "13ysbwflnysj4rs45ibckd621s0vyg1s8dvannlvanvrz1g72zcz")
460 (mozilla-patch "icecat-CVE-2017-7826-pt09.patch" "2b30335d0b95" "0hs5cwickvfw7r5dn7y148jgr2b21hl613qp83k56634d0y64qwp")
461 (mozilla-patch "icecat-CVE-2017-7826-pt10.patch" "d6f008f95598" "0xclxrbg7pv8pa2j15p0gy9c8sigy2i9j0kvazl5fbyg6jsg3xgd")
462 (mozilla-patch "icecat-CVE-2017-7826-pt11.patch" "ab9b51cd75ac" "08jy3rbkyh934aw261ls0s87947d2mhss7xqk1xfdir9crij2g27")
463 (mozilla-patch "icecat-bug-1343147-pt1.patch" "971d6345bc3a" "13791cvc51i991i5qyz6gp94vwzwkx479bnr8fsf8dw7z72wrsch")
464 (mozilla-patch "icecat-bug-1343147-pt2.patch" "60df7db06669" "0r372g1zksvkzyz0qpq0mp30frilgsfxxx2xida8xc08wgxp5lh9")
465 (mozilla-patch "icecat-CVE-2017-7826-pt12.patch" "df49c25e6e4c" "0j77xbkxpflqf4jlccrv61vq0jgp4lfn8kb0zw1lswp3cyd6ml4i")
466 (mozilla-patch "icecat-CVE-2017-7826-pt13.patch" "3b899f872623" "01zjcpm8yp4s8yf4mj1bzq01aylmi69kd8qv0rrcl9hmj4g3pzr2")
467 (mozilla-patch "icecat-CVE-2017-7826-pt14.patch" "3d6d558ae6a6" "17wynknvs5wi7m9g5vn43rjmivbg1l6pnv8jymz1ccidy27qgdqi")
468 (mozilla-patch "icecat-CVE-2017-7826-pt15.patch" "8426754b7130" "0bbm2294bkvld55rdbpsc8b82ljqdcxpbg6cwdzvwfhqayl2pnqm")
469 (mozilla-patch "icecat-CVE-2017-7828-pt1.patch" "5ddd5d2aa769" "12z5i8h6qwjb1h1fvp2426bgsnsxx539d8k2is9x1q4133356niy")
470 (mozilla-patch "icecat-CVE-2017-7826-pt16.patch" "dd068f4e132a" "17qy9c1vfkz3pj6y8qmqbic73wrangsbdlylk2s54nbzhhp9cj1g")
471 (mozilla-patch "icecat-CVE-2017-7826-pt17.patch" "e6bd533b57e9" "1mmqav9yhxd0j47yffcdykaqjibfwjsk0jn0f44099s87y8qn9zy")
472 (mozilla-patch "icecat-CVE-2017-7826-pt18.patch" "2a87fb6b9c07" "0z0scw4y1vqhqkbw1ag14g8xrif14l95x7fd50q2sw425lli29lc")
473 (mozilla-patch "icecat-bug-1404910.patch" "5007f2472f64" "0ns1l4yipwbb52sps2xzg30qd1rkpwykxq4chjg3wllhmcxbvvpw")
474 (mozilla-patch "icecat-CVE-2017-7830.patch" "04e3b5c1f0b2" "0nmv3jnx94ykxg64xkiwc8kx4df8zw7y5yzjnxz1sll2v88b9hmf")
475 (mozilla-patch "icecat-CVE-2017-7828-pt2.patch" "2f48c03d9b3f" "16qdy3rahmkhsjnzqjcgzg1a4k7czd40m04gs9i75cd88kbripri")
476 (mozilla-patch "icecat-bug-1348660-pt1.patch" "a352bfcbaf55" "1j3kxnhci9fh3lj8rizbcfv8xzn5kikxwpfy8a091d51sdn20873")
477 (mozilla-patch "icecat-bug-1348660-pt2.patch" "57f43e2ab9b5" "1jva4y79zb85npak3mddrx5rsf4mxczb314kcr8yhlkwqv0nx5sp")
478 (mozilla-patch "icecat-bug-1348660-pt3.patch" "917d65bb8896" "0k29y8i96lanqjjm6vybg0s6gjbk1mz5bfnga6aj1g0hnb7c3s8d")
479 (mozilla-patch "icecat-bug-1348660-pt4.patch" "28934912eede" "1mhxw26050l3d09n8w912a86df87afcshvsk9k1k375anfk0927x")
480 (search-patch "icecat-bug-1348660-pt5.patch")
481 (mozilla-patch "icecat-bug-1348660-pt6.patch" "556ff3bfb9fc" "0kckjc8jp885xfaiwx2b9qnk1plqjhi0mwhjjcmfajvh3l3mrl8h")
482 (mozilla-patch "icecat-bug-1350564.patch" "2abf26abb2a2" "0axdzp9g9k74wpkwrsdx263h01sv9bd3rarhhl68xnvc7n6i45lx")
483 (mozilla-patch "icecat-bug-1404787.patch" "8335e1d7b140" "17d7kb8ginzflhdkrbi60vh2b907spbzmvwih7a595gqpihmnqqn")
484 (mozilla-patch "icecat-CVE-2017-7826-pt19.patch" "de336078d36b" "0gyzbap8hr1iywk0x2x0h7z7zp7q89hi56h8c03vvc7771dkvjkf")
485 (mozilla-patch "icecat-bug-1047098-pt1.patch" "088577f0c46e" "0y3sz6kx07ls7jsvhqhhrl6v69a94wqvv3lz7hnplah23y06h17z")
486 (mozilla-patch "icecat-bug-1047098-pt2.patch" "c7e3abf74023" "11dcjzx56v4yb2dvm23j2g86q8yva2hc69lmb7s5w18l6ygwwhzr")
487 (mozilla-patch "icecat-bug-1047098-pt3.patch" "36bd15d14c5a" "0cb3l3hpsgk674f08kfamxhqfga3ah5v904gpxq9ag006vzd2cxz")
488 (mozilla-patch "icecat-bug-1404105.patch" "2909ba991f31" "126vssj57dc800347f075wlnjzcwamnxxmgxl9w78jpb0hj9gf16")
489 (search-patch "icecat-bug-1415133.patch")
490 (mozilla-patch "icecat-bug-1355576.patch" "cf34a0574e58" "1z7sa1d12hypgivm5xxn32s58afpjcij97jvnafcgnfvxywrgr1m")
491 (mozilla-patch "icecat-CVE-2017-7843.patch" "f6216ea8b8fc" "0jnhdkj0ch9mj01mzlvhjgf8zsxlbg6m7yvpq99qr7xmg0pzbgwl")
492 (mozilla-patch "icecat-bug-1413741.patch" "4e00ce2897c4" "0k95vi31glia2i03djidkc0gkwp9qldy34fz1rxcj56a1iphbq7w")
493 (mozilla-patch "icecat-CVE-2018-5089-pt01.patch" "92d450811409" "0xsvggnr0y65nd52nkbjvpcbs5nd84pvbayk5vinbx1mnk2wh2vy")
494 (mozilla-patch "icecat-CVE-2018-5089-pt02.patch" "7eba7d14704a" "1vi17qmjzh3kji14iz370kvs4425asgp93ns2chf5ldlq5b9196g")
495 (mozilla-patch "icecat-CVE-2018-5089-pt03.patch" "457d023c167e" "11g8hg8yp20lsn52dx1ym8r4yjsnsmx0h182d6nbl6ab9wp7d1m9")
496 (mozilla-patch "icecat-CVE-2018-5089-pt04.patch" "5e7b16213198" "14c4x6c3mygf8p77n9bia5rndjpngbvik1r1ylk97k3ggy4fj6zh")
497 (mozilla-patch "icecat-CVE-2018-5102.patch" "0712b6cbbdc8" "0rllsq6ckpms7g9k6qky1gr5rz1gav4widrha6w1s9f88cbrqgk5")
498 (mozilla-patch "icecat-CVE-2018-5089-pt05.patch" "084c427ccf99" "0sjdy2iang09a9g6liavpjgry04dp6smjgj0y7lp5lfqijdr8q2d")
499 (mozilla-patch "icecat-CVE-2018-5089-pt06.patch" "1bfb3d8d4510" "0c2dcxj74ijs6qf9sqcbj8w998hblic66vy41818z7xnw46j5j1j")
500 (mozilla-patch "icecat-bug-1414425.patch" "5623e01e63a8" "08dn3v96bsb61hy3wfxz43fhn1mk9vlm5ydvdjgi3wiqadvacgzs")
501 (mozilla-patch "icecat-CVE-2018-5089-pt07.patch" "14a389d40329" "0f4gbak5bd2walxrxs3myig28v9lhvplf3a1nws1a4ajx80slzq1")
502 (mozilla-patch "icecat-bug-1415441.patch" "7339297cddb7" "017lbw0mn5rwzb2abfw6qrk07m3r96vwbj81cmqvdfnmprcjni5j")
503 (mozilla-patch "icecat-CVE-2018-5096.patch" "aa55d4cdaee5" "1l3qwjfx0jsbbw2dg8bsnx7k47zibamgswndq0d1bchnmary62aw")
504 (mozilla-patch "icecat-bug-1382358.patch" "762f4e53889a" "0n61zrb6rz9bhhdsqs5ziwaiy81pq52c76p9qmi9hrxbn24ism1k")
505 (mozilla-patch "icecat-CVE-2018-5089-pt08.patch" "0152d097672f" "16ybg718calvciv00kil8s97lhh11hj6gx0acf73r44xfkvm8nfg")
506 (search-patch "icecat-bug-1414945.patch")
507 (mozilla-patch "icecat-CVE-2018-5089-pt09.patch" "079356ed5317" "107c0b93g2k743wvhwz2ps3j6p09qld7d0raljijv5y5n8q4wp92")
508 (mozilla-patch "icecat-CVE-2018-5089-pt10.patch" "93e4994a892c" "00r2qxw3619529vy9d04dl9kcziqy3fv3iawgy9svzygyx1kj5wx")
509 (mozilla-patch "icecat-CVE-2018-5089-pt11.patch" "f8a6e1864832" "1wbxn0v50637yjg8b8675k01x9cyx95jpjxpyqfaa97762qkznba")
510 (mozilla-patch "icecat-CVE-2018-5089-pt12.patch" "0cc1c9068714" "1qmqpi14zs7c95k3c7396gpp6apb622k0mgv553kw4rr81nj1yac")
511 (mozilla-patch "icecat-CVE-2018-5095.patch" "ce6f3fb2bf58" "1b1msb5d5jsgrqa2hkbsrm0n54qdmx1b2bf65v44v17appa03lra")
512 (mozilla-patch "icecat-CVE-2018-5103.patch" "6b4d3c5d5e51" "074p93dhwr1ckhypkjpblnmg9hg44a9030g1glqffi9dyn3iq3k4")
513 (mozilla-patch "icecat-bug-1411745.patch" "1a510ee578a0" "1imb7glh2m1zwvvpvr4k4iddms5byqzr35j7kv3y5is77aiwl4z5")
514 (mozilla-patch "icecat-bug-1411708.patch" "34c968767eb7" "0l2jy201ikj3m3h66mvlsj4y0ki7cpm7x7nnfygbwnfxg42s1sip")
515 (mozilla-patch "icecat-CVE-2018-5091.patch" "bc166be85bb4" "0w1lrjzfrfflaw4l6sfi3ir81iyi9gyfck5g41dwp0jc1b59jzvg")
516 (mozilla-patch "icecat-CVE-2018-5089-pt13.patch" "66cfc3c4047d" "05j8ic4lv2d2ygr6d62rkdlfyg2rpljalwrkkhllinw2dfi3n15b")
517 (mozilla-patch "icecat-CVE-2018-5098.patch" "3236ffdf0ced" "1kvk4qyslaj1ldgs1wpxnf79zajcihzcd1zvbrg990i3hgyn3gk3")
518 (mozilla-patch "icecat-bug-1424373-pt1.patch" "320032aaa068" "1ch282qibprz1q0f2imvynh4sg7gads6sf3ayhjcd62zjncpgyz7")
519 (search-patch "icecat-bug-1424373-pt2.patch")
520 (mozilla-patch "icecat-CVE-2018-5089-pt14.patch" "c2945f1249eb" "18p0344w6grpyfiz8dczfw977p0qy37iqv95whgnrjli2ab51kji")
521 (mozilla-patch "icecat-CVE-2018-5117-pt1.patch" "263165eacc54" "0518xnd9f4qkn7l0z73kldm9dr33y6hf054ril4f8r2j8s9fy33i")
522 (mozilla-patch "icecat-CVE-2018-5117-pt2.patch" "58e87d9cc44e" "0j9qwjm25bmhw0sj426yl4fqaa6zknf5cjk0yisdd3895652n5i4")
523 (mozilla-patch "icecat-CVE-2018-5089-pt15.patch" "aa4b11615431" "0whfvwaj3dmk89ah2kbv7zz7a8ckqa0xajf5fl12bgl7q8c8ndnm")
524 (mozilla-patch "icecat-CVE-2018-5104.patch" "66761c5bfbe1" "076128pxc7ik1zq2v0d5m6vd7nls2030jzdc4w0ggy8hd5yyb8g9")
525 (mozilla-patch "icecat-bug-1408631.patch" "6f5c8df1925d" "1hgr18p5dwhlsan6jxlj3ay7cbfyywk40bpbnjc8gqmq6y25cn48")
526 (mozilla-patch "icecat-bug-1422735.patch" "b88ef76f5687" "0rzpxfrhddc0238rq3r1b02j95g0rdplk1fjmk85m51xvggh9086")
527 (mozilla-patch "icecat-bug-1261963.patch" "d0c98f5b6c12" "1z9jn19hnwjand9c0ifc39gq71nz17jjqy2s5fqr2z06y8qys62h")
528 (mozilla-patch "icecat-CVE-2018-5089-pt16.patch" "f7865afb1fe6" "0i7ydmcr1g0ih3myyxaxjq6wfg3rvq5j4893kjqksqihfqrkzs4j")
529 (mozilla-patch "icecat-CVE-2018-5097.patch" "9fb7614319df" "1xirahk06w8pyw4pdh64f4pg3qcb7c8x8frrmad2895fagy14g4k")
530 (mozilla-patch "icecat-mitigate-spectre.patch" "81d6465bd7c2" "1za5l249pb5x7f283vrimy0ankjzvwa99hfql3v4fm5a4grjkj9n")
531 (mozilla-patch "icecat-CVE-2018-5089-pt17.patch" "5f753161df25" "1k2mpwagz08wzxfzwy2b4a0pz0hkhdqby6n11i7pasx3ary670km")
532 (mozilla-patch "icecat-CVE-2018-5099.patch" "b95d654de120" "1cv7nz2gsyjjigw6wv4xagh8q6bcg0971md8b6xjvz5m26aynlaw")
533 (mozilla-patch "icecat-bug-1408631.patch" "3b1faddc0e5f" "0817x5mrdyjj0gc9yi19m6d78d18ypc9nbld64d2axhc8v9bz3xf")
534 (mozilla-patch "icecat-glibc-2.26.patch" "57d4fae4dffe" "1sv7kp7m4i7n31ny8k7cpjsrqpxh5y5jm27sh2cgpj7fhi5kqsj2")
535 (mozilla-patch "icecat-CVE-2018-5089-pt18.patch" "fe271a2b9503" "11wr8mdxw01dlmzkq55hf0qd52cwmx4vk96cff66d4kkl1dbj6qn")
536 (mozilla-patch "icecat-CVE-2018-5089-pt19.patch" "410da936a1e8" "14dvaysz0svlh50kdabjhd2s5avz6p93sbyqhwik5rlvcg5ax5zp")
537 (mozilla-patch "icecat-CVE-2018-5089-pt20.patch" "8368a9a379e3" "0fqq01ms7m4kb9b10n8gy5n9n4x43crz2gn1r6c4ny52wzgm3j6f")
538 (mozilla-patch "icecat-CVE-2018-5089-pt21.patch" "a7c8e85285e2" "1caa2w5r8rqb1qrk4mgf2vw1k592idvqmgs8qfz2dp2744kk6z98")
539 (mozilla-patch "icecat-bug-1375217.patch" "00fc630c9a46" "17pcprp452nslk6sac6sili0p74zh8w3g0v1wsdn0ikm9xmnphhv")
540 (mozilla-patch "icecat-bug-1261175.patch" "f0ec180993d2" "0jiazxcwki83wr00fyh2g518ynsd33p7nk65zk4d1682gn22lc8v")
541 (mozilla-patch "icecat-bug-1433005.patch" "a6a9e26688c1" "0cvizvilb4k422j2gzqcbakznvsffmk6n6xn1ayj5rgxfaizkkqk")
542 (mozilla-patch "icecat-bug-1434580.patch" "198ad052621e" "1721zx8hifdlflrhvw6hmkdgjbvsmxl9n84iji5qywhlp2krdk9r")
543 (mozilla-patch "icecat-bug-1426087.patch" "391ea77ebfdb" "1fhkvd0z6mvdkj7m0d3jlj42rsdw5r4x122c1wb1i428228ifw6n")))
544 (modules '((guix build utils)))
545 (snippet
546 '(begin
547 (use-modules (ice-9 ftw))
548 ;; Remove bundled libraries that we don't use, since they may
549 ;; contain unpatched security flaws, they waste disk space and
550 ;; network bandwidth, and may cause confusion.
551 (for-each delete-file-recursively
552 '(;; FIXME: Removing the bundled icu breaks configure.
553 ;; * The bundled icu headers are used in some places.
554 ;; * The version number is taken from the bundled copy.
555 ;;"intl/icu"
556 ;;
557 ;; FIXME: A script from the bundled nspr is used.
558 ;;"nsprpub"
559 ;;
560 ;; TODO: Use system media libraries. Waiting for:
561 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
562 ;; * libogg
563 ;; * libtheora
564 ;; * libvorbis
565 ;; * libtremor (not yet in guix)
566 ;; * libopus
567 ;; * speex
568 ;; * soundtouch (not yet in guix)
569 ;;
570 "modules/freetype2"
571 "modules/zlib"
572 "modules/libbz2"
573 "ipc/chromium/src/third_party/libevent"
574 "media/libjpeg"
575 "media/libvpx"
576 "security/nss"
577 "gfx/cairo"
578 "gfx/harfbuzz"
579 "gfx/graphite2"
580 "js/src/ctypes/libffi"
581 "db/sqlite3"))
582 ;; Delete .pyc files, typically present in icecat source tarballs
583 (for-each delete-file (find-files "." "\\.pyc$"))
584 ;; Delete obj-* directories, sometimes present in icecat tarballs
585 (for-each delete-file-recursively
586 (scandir "." (lambda (name)
587 (string-prefix? "obj-" name))))
588 #t))))
589 (build-system gnu-build-system)
590 (inputs
591 `(("alsa-lib" ,alsa-lib)
592 ("bzip2" ,bzip2)
593 ("cairo" ,cairo)
594 ("cups" ,cups)
595 ("dbus-glib" ,dbus-glib)
596 ("gdk-pixbuf" ,gdk-pixbuf)
597 ("glib" ,glib)
598 ("gtk+" ,gtk+)
599 ("gtk+-2" ,gtk+-2)
600 ("graphite2" ,graphite2)
601 ("pango" ,pango)
602 ("freetype" ,freetype)
603 ("harfbuzz" ,harfbuzz)
604 ("hunspell" ,hunspell)
605 ("libcanberra" ,libcanberra)
606 ("libgnome" ,libgnome)
607 ("libjpeg-turbo" ,libjpeg-turbo)
608 ("libxft" ,libxft)
609 ("libevent" ,libevent-2.0)
610 ("libxinerama" ,libxinerama)
611 ("libxscrnsaver" ,libxscrnsaver)
612 ("libxcomposite" ,libxcomposite)
613 ("libxt" ,libxt)
614 ("libffi" ,libffi)
615 ("ffmpeg" ,ffmpeg)
616 ("libvpx" ,libvpx)
617 ("icu4c" ,icu4c)
618 ("pixman" ,pixman)
619 ("pulseaudio" ,pulseaudio)
620 ("mesa" ,mesa)
621 ("mit-krb5" ,mit-krb5)
622 ("nspr" ,nspr)
623 ("nss" ,nss)
624 ("sqlite" ,sqlite)
625 ("startup-notification" ,startup-notification)
626 ("unzip" ,unzip)
627 ("zip" ,zip)
628 ("zlib" ,zlib)))
629 (native-inputs
630 `(("perl" ,perl)
631 ("python" ,python-2) ; Python 3 not supported
632 ("python2-pysqlite" ,python2-pysqlite)
633 ("yasm" ,yasm)
634 ("pkg-config" ,pkg-config)
635 ("autoconf" ,autoconf-2.13)
636 ("which" ,which)))
637 (arguments
638 `(#:tests? #f ; no check target
639 #:out-of-source? #t ; must be built outside of the source directory
640
641 ;; XXX: There are RUNPATH issues such as
642 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
643 ;; which is not in its RUNPATH, but they appear to be harmless in
644 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
645 #:validate-runpath? #f
646
647 #:configure-flags '("--enable-default-toolkit=cairo-gtk3"
648 "--enable-gio"
649 "--enable-startup-notification"
650 "--enable-pulseaudio"
651
652 "--disable-gconf"
653 "--disable-gnomeui"
654
655 ;; Building with debugging symbols takes ~5GiB, so
656 ;; disable it.
657 "--disable-debug"
658 "--disable-debug-symbols"
659
660 ;; Hack to work around missing
661 ;; "unofficial" branding in icecat.
662 "--enable-official-branding"
663
664 ;; Avoid bundled libraries.
665 "--with-system-zlib"
666 "--with-system-bz2"
667 "--with-system-jpeg" ; must be libjpeg-turbo
668 "--with-system-libevent"
669 "--with-system-libvpx"
670 "--with-system-icu"
671 "--with-system-nspr"
672 "--with-system-nss"
673 "--with-system-harfbuzz"
674 "--with-system-graphite2"
675 "--enable-system-pixman"
676 "--enable-system-cairo"
677 "--enable-system-ffi"
678 "--enable-system-hunspell"
679 "--enable-system-sqlite"
680
681 ;; Fails with "--with-system-png won't work because
682 ;; the system's libpng doesn't have APNG support".
683 ;; According to
684 ;; http://sourceforge.net/projects/libpng-apng/ ,
685 ;; "the Animated Portable Network Graphics (APNG)
686 ;; is an unofficial extension of the Portable
687 ;; Network Graphics (PNG) format";
688 ;; we probably do not wish to support it.
689 ;; "--with-system-png"
690 )
691
692 #:modules ((ice-9 ftw)
693 (ice-9 rdelim)
694 (ice-9 match)
695 ,@%gnu-build-system-modules)
696 #:phases
697 (modify-phases %standard-phases
698 (add-after
699 'unpack 'ensure-no-mtimes-pre-1980
700 (lambda _
701 ;; Without this, the 'source/test/addons/packed.xpi' and
702 ;; 'source/test/addons/simple-prefs.xpi' targets fail while trying
703 ;; to create zip archives.
704 (let ((early-1980 315619200)) ; 1980-01-02 UTC
705 (ftw "." (lambda (file stat flag)
706 (unless (<= early-1980 (stat:mtime stat))
707 (utime file early-1980 early-1980))
708 #t))
709 #t)))
710 (add-after
711 'unpack 'use-skia-by-default
712 (lambda _
713 ;; Use the bundled Skia library by default, since IceCat appears
714 ;; to be far more stable when using it than when using our system
715 ;; Cairo.
716 (let ((out (open "browser/app/profile/icecat.js"
717 (logior O_WRONLY O_APPEND))))
718 (format out "~%// Use Skia by default~%")
719 (format out "pref(~s, ~s);~%" "gfx.canvas.azure.backends" "skia")
720 (format out "pref(~s, ~s);~%" "gfx.content.azure.backends" "skia")
721 (close-port out))
722 #t))
723 (add-after
724 'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
725 (lambda _
726 ;; libxul.so dynamically opens libraries, so here we explicitly
727 ;; link them into libxul.so instead.
728 ;;
729 ;; TODO: It might be preferable to patch in absolute file names in
730 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
731 ;; work. More investigation is needed.
732 (substitute* "toolkit/library/moz.build"
733 (("^# This library needs to be last" all)
734 (string-append "OS_LIBS += [
735 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
736 'avcodec', 'avutil', 'pulse' ]\n\n"
737 all)))
738 #t))
739 (replace
740 'configure
741 ;; configure does not work followed by both "SHELL=..." and
742 ;; "CONFIG_SHELL=..."; set environment variables instead
743 (lambda* (#:key outputs configure-flags #:allow-other-keys)
744 (let* ((out (assoc-ref outputs "out"))
745 (bash (which "bash"))
746 (abs-srcdir (getcwd))
747 (srcdir (string-append "../" (basename abs-srcdir)))
748 (flags `(,(string-append "--prefix=" out)
749 ,(string-append "--with-l10n-base="
750 abs-srcdir "/l10n")
751 ,@configure-flags)))
752 (setenv "SHELL" bash)
753 (setenv "CONFIG_SHELL" bash)
754 (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13
755 (mkdir "../build")
756 (chdir "../build")
757 (format #t "build directory: ~s~%" (getcwd))
758 (format #t "configure flags: ~s~%" flags)
759 (zero? (apply system* bash
760 (string-append srcdir "/configure")
761 flags)))))
762 (add-before 'configure 'install-desktop-entry
763 (lambda* (#:key outputs #:allow-other-keys)
764 ;; Install the '.desktop' file.
765 (define (swallow-%%-directives input output)
766 ;; Interpret '%%ifdef' directives found in the '.desktop' file.
767 (let loop ((state 'top))
768 (match (read-line input 'concat)
769 ((? eof-object?)
770 #t)
771 ((? string? line)
772 (cond ((string-prefix? "%%ifdef" line)
773 (loop 'ifdef))
774 ((string-prefix? "%%else" line)
775 (loop 'else))
776 ((string-prefix? "%%endif" line)
777 (loop 'top))
778 (else
779 (case state
780 ((top else)
781 (display line output)
782 (loop state))
783 (else
784 (loop state)))))))))
785
786 (let* ((out (assoc-ref outputs "out"))
787 (applications (string-append out "/share/applications")))
788 (call-with-input-file "debian/icecat.desktop.in"
789 (lambda (input)
790 (call-with-output-file "debian/icecat.desktop"
791 (lambda (output)
792 (swallow-%%-directives input output)))))
793
794 (substitute* "debian/icecat.desktop"
795 (("@MOZ_DISPLAY_NAME@")
796 "GNU IceCat")
797 (("^Exec=@MOZ_APP_NAME@")
798 (string-append "Exec=" out "/bin/icecat"))
799 (("@MOZ_APP_NAME@")
800 "icecat"))
801 (install-file "debian/icecat.desktop" applications)
802 #t)))
803 (add-after 'install-desktop-entry 'install-icons
804 (lambda* (#:key outputs #:allow-other-keys)
805 (let ((out (assoc-ref outputs "out")))
806 (with-directory-excursion "browser/branding/official"
807 (for-each
808 (lambda (file)
809 (let* ((size (string-filter char-numeric? file))
810 (icons (string-append out "/share/icons/hicolor/"
811 size "x" size "/apps")))
812 (mkdir-p icons)
813 (copy-file file (string-append icons "/icecat.png"))))
814 '("default16.png" "default22.png" "default24.png"
815 "default32.png" "default48.png" "content/icon64.png"
816 "mozicon128.png" "default256.png"))))))
817 ;; This fixes the file chooser crash that happens with GTK 3.
818 (add-after 'install 'wrap-program
819 (lambda* (#:key inputs outputs #:allow-other-keys)
820 (let* ((out (assoc-ref outputs "out"))
821 (lib (string-append out "/lib"))
822 (gtk (assoc-ref inputs "gtk+"))
823 (gtk-share (string-append gtk "/share")))
824 (wrap-program (car (find-files lib "^icecat$"))
825 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))))
826 (home-page "https://www.gnu.org/software/gnuzilla/")
827 (synopsis "Entirely free browser derived from Mozilla Firefox")
828 (description
829 "IceCat is the GNU version of the Firefox browser. It is entirely free
830 software, which does not recommend non-free plugins and addons. It also
831 features built-in privacy-protecting features.")
832 (license license:mpl2.0) ;and others, see toolkit/content/license.html
833 (properties
834 `((ftp-directory . "/gnu/gnuzilla")
835 (cpe-name . "firefox_esr")
836 (cpe-version . ,(first (string-split version #\-)))))))