gnu: linux-libre@4.1: Update to 4.1.47.
[jackhill/guix/guix.git] / gnu / packages / gnuzilla.scm
CommitLineData
be0f6112 1;;; GNU Guix --- Functional package management for GNU
5deea4fc 2;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
89e34644 3;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
98986200 4;;; Copyright © 2014, 2015, 2016, 2017 Mark H Weaver <mhw@netris.org>
1aaaff1a 5;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
1461dd24 6;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
88a8ce87 7;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
8db94716 8;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
c1463145 9;;; Copyright © 2017 ng0 <ng0@infotropique.org>
e26e55c8 10;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
be0f6112
AE
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)
07d4d9b7 28 #:use-module ((srfi srfi-1) #:hide (zip))
1461dd24 29 #:use-module (ice-9 match)
be0f6112 30 #:use-module (gnu packages)
b5b73a82 31 #:use-module ((guix licenses) #:prefix license:)
be0f6112
AE
32 #:use-module (guix packages)
33 #:use-module (guix download)
aaac423c 34 #:use-module (guix utils)
be0f6112 35 #:use-module (guix build-system gnu)
002c3e6d 36 #:use-module (gnu packages autotools)
bfb48f4f 37 #:use-module (gnu packages base)
1aaaff1a 38 #:use-module (gnu packages databases)
be0f6112 39 #:use-module (gnu packages glib)
be0f6112 40 #:use-module (gnu packages gtk)
90e1cdae
MW
41 #:use-module (gnu packages gnome)
42 #:use-module (gnu packages libcanberra)
43 #:use-module (gnu packages cups)
89e34644 44 #:use-module (gnu packages kerberos)
be0f6112
AE
45 #:use-module (gnu packages linux)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages pkg-config)
1ae6df81 48 #:use-module (gnu packages compression)
74c7af9f 49 #:use-module (gnu packages fontutils)
1ae6df81 50 #:use-module (gnu packages libevent)
90e1cdae 51 #:use-module (gnu packages libreoffice) ;for hunspell
e55354b8 52 #:use-module (gnu packages image)
1ae6df81 53 #:use-module (gnu packages libffi)
74c7af9f 54 #:use-module (gnu packages pulseaudio)
be0f6112
AE
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages xorg)
200726ed 57 #:use-module (gnu packages gl)
01497dfe 58 #:use-module (gnu packages assembly)
13b284d9
MW
59 #:use-module (gnu packages icu4c)
60 #:use-module (gnu packages video)
61 #:use-module (gnu packages xdisorg)
29f381ba 62 #:use-module (gnu packages readline))
be0f6112 63
4923e06f
SB
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
68716289 75 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))
a64b7da5 76 (patches (search-patches "mozjs17-aarch64-support.patch"))
68716289
SB
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")))))
4923e06f
SB
82 (build-system gnu-build-system)
83 (native-inputs
f403c676
EF
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)))
4923e06f 91 (arguments
56486b3a
EF
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
a64b7da5 98 ;; This test times out on slower hardware.
56486b3a
EF
99 (lambda _ (delete-file "js/src/jit-test/tests/basic/bug698584.js")))
100 (add-before 'configure 'chdir
4923e06f 101 (lambda _
56486b3a
EF
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 '())))))))))
4923e06f
SB
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
120in C/C++.")
87158e85 121 (license license:mpl2.0))) ; and others for some files
4923e06f 122
cefdcb38
SB
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
68716289
SB
134 "1n1phk8r3l8icqrrap4czplnylawa0ddc2cc4cgdz46x3lrkybz6"))
135 (modules '((guix build utils)))
26f38d31 136 (patches (search-patches "mozjs24-aarch64-support.patch"))
68716289
SB
137 (snippet
138 ;; Fix incompatibility with Perl 5.22+.
139 '(substitute* '("js/src/config/milestone.pl")
140 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE")))))
cefdcb38 141 (arguments
aaac423c
EF
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 '()))))))))))
cefdcb38
SB
160 (inputs
161 `(("libffi" ,libffi)
162 ("zlib" ,zlib)))))
163
29f381ba
CL
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
4923e06f
SB
250(define-public nspr
251 (package
252 (name "nspr")
ad7a73a9 253 (version "4.17")
4923e06f
SB
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
ad7a73a9 261 "158hdn285dsb5rys8wl1wi32dd1axwhqq0r8fwny4aj157m0l2jr"))))
4923e06f
SB
262 (build-system gnu-build-system)
263 (native-inputs
84fb4bd9 264 `(("perl" ,perl)))
4923e06f 265 (arguments
8550894b
LC
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"))
04952bd7
EF
271 #:phases (modify-phases %standard-phases
272 (add-before 'configure 'chdir
273 (lambda _ (chdir "nspr") #t)))))
4923e06f
SB
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
278platform-neutral API for system level and libc-like functions. It is used
279in the Mozilla clients.")
280 (license license:mpl2.0)))
281
1aaaff1a
SB
282(define-public nss
283 (package
284 (name "nss")
a93447b8 285 (version "3.34")
1aaaff1a
SB
286 (source (origin
287 (method url-fetch)
2bb9b5de
MW
288 (uri (let ((version-with-underscores
289 (string-join (string-split version #\.) "_")))
290 (string-append
fe88f636 291 "https://ftp.mozilla.org/pub/mozilla.org/security/nss/"
2bb9b5de
MW
292 "releases/NSS_" version-with-underscores "_RTM/src/"
293 "nss-" version ".tar.gz")))
1aaaff1a
SB
294 (sha256
295 (base32
a93447b8 296 "1x9acn47iva9j42kxfamgvn99lrnqv47fgn3rz3j6c1ph50rai8d"))
1aaaff1a 297 ;; Create nss.pc and nss-config.
d027b001
MB
298 (patches (search-patches "nss-pkgconfig.patch"
299 "nss-increase-test-timeout.patch"))))
1aaaff1a
SB
300 (build-system gnu-build-system)
301 (outputs '("out" "bin"))
302 (arguments
1461dd24 303 `(#:parallel-build? #f ; not supported
1aaaff1a
SB
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))
1aaaff1a 320 #:phases
db3c06d5
MB
321 (modify-phases %standard-phases
322 (replace 'configure
1461dd24 323 (lambda _
db3c06d5
MB
324 (setenv "CC" "gcc")
325 ;; Tells NSS to build for the 64-bit ABI if we are 64-bit system.
1461dd24
MB
326 ,@(match (%current-system)
327 ((or "x86_64-linux" "aarch64-linux")
328 `((setenv "USE_64" "1")))
329 (_
330 '()))
db3c06d5
MB
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)
3161f6a4 361
db3c06d5
MB
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"))
bd512249 368 (delete-file (string-append lib "/libgtestutil.so"))
3161f6a4 369
db3c06d5 370 #t))))))
1aaaff1a
SB
371 (inputs
372 `(("sqlite" ,sqlite)
373 ("zlib" ,zlib)))
374 (propagated-inputs `(("nspr" ,nspr))) ; required by nss.pc.
375 (native-inputs `(("perl" ,perl)))
86e3e370 376
e9b718a0
MW
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
86e3e370 380
1aaaff1a
SB
381 (home-page
382 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS")
383 (synopsis "Network Security Services")
384 (description
e26e55c8
TGR
385 "Network Security Services (@dfn{NSS}) is a set of libraries designed to
386support cross-platform development of security-enabled client and server
387applications. Applications built with NSS can support SSL v2 and v3, TLS,
388PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other
389security standards.")
1aaaff1a
SB
390 (license license:mpl2.0)))
391
bfb48f4f 392(define (mozilla-patch file-name changeset hash)
002c3e6d 393 "Return an origin for CHANGESET from the mozilla-esr52 repository."
bfb48f4f
MW
394 (origin
395 (method url-fetch)
002c3e6d 396 (uri (string-append "https://hg.mozilla.org/releases/mozilla-esr52/raw-rev/"
bfb48f4f
MW
397 changeset))
398 (sha256 (base32 hash))
399 (file-name file-name)))
400
be0f6112
AE
401(define-public icecat
402 (package
403 (name "icecat")
3c7c9161 404 (version "52.3.0-gnu1")
be0f6112
AE
405 (source
406 (origin
407 (method url-fetch)
5bdec7d6
MW
408 (uri (string-append "mirror://gnu/gnuzilla/"
409 (first (string-split version #\-))
410 "/" name "-" version ".tar.bz2"))
be0f6112
AE
411 (sha256
412 (base32
3c7c9161 413 "00jki754d6310fxj1b7dbhqj69y5igck6gqg6rgfya243nsb56k9"))
bfb48f4f 414 (patches
5bdec7d6
MW
415 (list
416 (search-patch "icecat-avoid-bundled-libraries.patch")
3c7c9161
MW
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")
3fd2f86a
MW
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")
3c7c9161 423 (mozilla-patch "icecat-bug-1373222.patch" "ecef71fa933f" "0vsymgy5j702lamvh2riahni7rdj9ba3bd6i4a2m22d638rwp1i2")
3fd2f86a 424 (mozilla-patch "icecat-CVE-2017-7814.patch" "68a444daf85b" "1faaadaajidzb9i00710zxdyv370hlrdg1l5rw2ymfmzbjj4jqyd")
3c7c9161
MW
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")
3fd2f86a 428 (mozilla-patch "icecat-CVE-2017-7810-pt4.patch" "ae110cf77596" "0gdrkfq9wy9cfcdgbj14ci86xgh2prkbz69pfy97r9igd8059syw")
464a2889
MW
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")
bb234ed8 445 (mozilla-patch "icecat-bug-1400721.patch" "285cde398833" "0a1i32zl30wfyw7zkqj595s94n6wdlg5c495m0910pd05pjg3qam")
6a71fa6f
MW
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")
f7ddf996
MW
457 (mozilla-patch "icecat-bug-1343147-pt1.patch" "971d6345bc3a" "13791cvc51i991i5qyz6gp94vwzwkx479bnr8fsf8dw7z72wrsch")
458 (mozilla-patch "icecat-bug-1343147-pt2.patch" "60df7db06669" "0r372g1zksvkzyz0qpq0mp30frilgsfxxx2xida8xc08wgxp5lh9")
6a71fa6f
MW
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")
f1e32145
MW
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")))
90e1cdae
MW
485 (modules '((guix build utils)))
486 (snippet
487 '(begin
bfb48f4f 488 (use-modules (ice-9 ftw))
90e1cdae
MW
489 ;; Remove bundled libraries that we don't use, since they may
490 ;; contain unpatched security flaws, they waste disk space and
491 ;; network bandwidth, and may cause confusion.
492 (for-each delete-file-recursively
493 '(;; FIXME: Removing the bundled icu breaks configure.
494 ;; * The bundled icu headers are used in some places.
495 ;; * The version number is taken from the bundled copy.
496 ;;"intl/icu"
497 ;;
498 ;; FIXME: A script from the bundled nspr is used.
499 ;;"nsprpub"
500 ;;
501 ;; TODO: Use system media libraries. Waiting for:
502 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
503 ;; * libogg
504 ;; * libtheora
505 ;; * libvorbis
506 ;; * libtremor (not yet in guix)
507 ;; * libopus
508 ;; * speex
509 ;; * soundtouch (not yet in guix)
510 ;;
511 ;; TODO: Use system harfbuzz. Waiting for:
512 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=847568>
513 ;;
59d4cf1c
MW
514 ;; TODO: Use system graphite2.
515 ;;
90e1cdae
MW
516 "modules/freetype2"
517 "modules/zlib"
518 "modules/libbz2"
519 "ipc/chromium/src/third_party/libevent"
7cba7647 520 "media/libjpeg"
90e1cdae
MW
521 "media/libvpx"
522 "security/nss"
523 "gfx/cairo"
524 "js/src/ctypes/libffi"
525 "db/sqlite3"))
bfb48f4f
MW
526 ;; Delete .pyc files, typically present in icecat source tarballs
527 (for-each delete-file (find-files "." "\\.pyc$"))
5bdec7d6 528 ;; Delete obj-* directories, sometimes present in icecat tarballs
bfb48f4f
MW
529 (for-each delete-file-recursively
530 (scandir "." (lambda (name)
531 (string-prefix? "obj-" name))))
a5e55dfb 532 #t))))
be0f6112
AE
533 (build-system gnu-build-system)
534 (inputs
535 `(("alsa-lib" ,alsa-lib)
1ae6df81 536 ("bzip2" ,bzip2)
5b17fabc 537 ("cairo" ,cairo)
90e1cdae 538 ("cups" ,cups)
be0f6112 539 ("dbus-glib" ,dbus-glib)
90e1cdae
MW
540 ("gdk-pixbuf" ,gdk-pixbuf)
541 ("glib" ,glib)
002c3e6d
MW
542 ("gtk+" ,gtk+)
543 ("gtk+-2" ,gtk+-2)
74c7af9f
MW
544 ("pango" ,pango)
545 ("freetype" ,freetype)
90e1cdae
MW
546 ("hunspell" ,hunspell)
547 ("libcanberra" ,libcanberra)
548 ("libgnome" ,libgnome)
7cba7647 549 ("libjpeg-turbo" ,libjpeg-turbo)
74c7af9f 550 ("libxft" ,libxft)
e8fc1a0d 551 ("libevent" ,libevent-2.0)
90e1cdae
MW
552 ("libxinerama" ,libxinerama)
553 ("libxscrnsaver" ,libxscrnsaver)
9f7ae77f 554 ("libxcomposite" ,libxcomposite)
be0f6112 555 ("libxt" ,libxt)
1ae6df81 556 ("libffi" ,libffi)
002c3e6d 557 ("ffmpeg" ,ffmpeg)
13b284d9
MW
558 ("libvpx" ,libvpx)
559 ("icu4c" ,icu4c)
560 ("pixman" ,pixman)
74c7af9f 561 ("pulseaudio" ,pulseaudio)
be0f6112 562 ("mesa" ,mesa)
90e1cdae 563 ("mit-krb5" ,mit-krb5)
5b17fabc
MW
564 ("nspr" ,nspr)
565 ("nss" ,nss)
9bc79c11 566 ("sqlite" ,sqlite)
90e1cdae 567 ("startup-notification" ,startup-notification)
be0f6112 568 ("unzip" ,unzip)
1ae6df81
LC
569 ("zip" ,zip)
570 ("zlib" ,zlib)))
c4c4cc05
JD
571 (native-inputs
572 `(("perl" ,perl)
573 ("python" ,python-2) ; Python 3 not supported
574 ("python2-pysqlite" ,python2-pysqlite)
002c3e6d 575 ("yasm" ,yasm)
bfb48f4f 576 ("pkg-config" ,pkg-config)
002c3e6d 577 ("autoconf" ,autoconf-2.13)
bfb48f4f 578 ("which" ,which)))
be0f6112 579 (arguments
74c7af9f
MW
580 `(#:tests? #f ; no check target
581 #:out-of-source? #t ; must be built outside of the source directory
73b1b4eb
LC
582
583 ;; XXX: There are RUNPATH issues such as
584 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
585 ;; which is not in its RUNPATH, but they appear to be harmless in
586 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
587 #:validate-runpath? #f
588
002c3e6d 589 #:configure-flags '("--enable-default-toolkit=cairo-gtk3"
90e1cdae 590 "--enable-gio"
90e1cdae
MW
591 "--enable-startup-notification"
592 "--enable-pulseaudio"
90e1cdae 593
90e1cdae
MW
594 "--disable-gconf"
595 "--disable-gnomeui"
596
597 ;; Building with debugging symbols takes ~5GiB, so
1ae6df81
LC
598 ;; disable it.
599 "--disable-debug"
600 "--disable-debug-symbols"
601
5bdec7d6
MW
602 ;; Hack to work around missing
603 ;; "unofficial" branding in icecat.
bfb48f4f
MW
604 "--enable-official-branding"
605
90e1cdae 606 ;; Avoid bundled libraries.
1ae6df81 607 "--with-system-zlib"
90e1cdae 608 "--with-system-bz2"
7cba7647 609 "--with-system-jpeg" ; must be libjpeg-turbo
1ae6df81 610 "--with-system-libevent"
13b284d9 611 "--with-system-libvpx"
483ab08f 612 "--with-system-icu"
5b17fabc
MW
613 "--with-system-nspr"
614 "--with-system-nss"
13b284d9 615 "--enable-system-pixman"
5b17fabc
MW
616 "--enable-system-cairo"
617 "--enable-system-ffi"
90e1cdae 618 "--enable-system-hunspell"
9128e323 619 "--enable-system-sqlite"
1ae6df81 620
98a046cd
AE
621 ;; Fails with "--with-system-png won't work because
622 ;; the system's libpng doesn't have APNG support".
623 ;; According to
624 ;; http://sourceforge.net/projects/libpng-apng/ ,
625 ;; "the Animated Portable Network Graphics (APNG)
626 ;; is an unofficial extension of the Portable
627 ;; Network Graphics (PNG) format";
628 ;; we probably do not wish to support it.
1ae6df81 629 ;; "--with-system-png"
5b17fabc 630 )
1ae6df81 631
9f7ae77f 632 #:modules ((ice-9 ftw)
6cde5c34
LC
633 (ice-9 rdelim)
634 (ice-9 match)
9f7ae77f 635 ,@%gnu-build-system-modules)
be0f6112 636 #:phases
90e1cdae 637 (modify-phases %standard-phases
9f7ae77f
MW
638 (add-after
639 'unpack 'ensure-no-mtimes-pre-1980
640 (lambda _
641 ;; Without this, the 'source/test/addons/packed.xpi' and
642 ;; 'source/test/addons/simple-prefs.xpi' targets fail while trying
643 ;; to create zip archives.
644 (let ((early-1980 315619200)) ; 1980-01-02 UTC
645 (ftw "." (lambda (file stat flag)
646 (unless (<= early-1980 (stat:mtime stat))
647 (utime file early-1980 early-1980))
648 #t))
649 #t)))
2abf6371
MW
650 (add-after
651 'unpack 'use-skia-by-default
652 (lambda _
653 ;; Use the bundled Skia library by default, since IceCat appears
654 ;; to be far more stable when using it than when using our system
655 ;; Cairo.
656 (let ((out (open "browser/app/profile/icecat.js"
657 (logior O_WRONLY O_APPEND))))
658 (format out "~%// Use Skia by default~%")
659 (format out "pref(~s, ~s);~%" "gfx.canvas.azure.backends" "skia")
660 (format out "pref(~s, ~s);~%" "gfx.content.azure.backends" "skia")
661 (close-port out))
662 #t))
90e1cdae
MW
663 (add-after
664 'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
665 (lambda _
666 ;; libxul.so dynamically opens libraries, so here we explicitly
667 ;; link them into libxul.so instead.
668 ;;
669 ;; TODO: It might be preferable to patch in absolute file names in
670 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
671 ;; work. More investigation is needed.
9f7ae77f 672 (substitute* "toolkit/library/moz.build"
002c3e6d
MW
673 (("^# This library needs to be last" all)
674 (string-append "OS_LIBS += [
9f7ae77f 675 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
002c3e6d
MW
676 'avcodec', 'avutil', 'pulse' ]\n\n"
677 all)))
9f7ae77f 678 #t))
90e1cdae
MW
679 (replace
680 'configure
681 ;; configure does not work followed by both "SHELL=..." and
682 ;; "CONFIG_SHELL=..."; set environment variables instead
683 (lambda* (#:key outputs configure-flags #:allow-other-keys)
684 (let* ((out (assoc-ref outputs "out"))
685 (bash (which "bash"))
686 (abs-srcdir (getcwd))
687 (srcdir (string-append "../" (basename abs-srcdir)))
688 (flags `(,(string-append "--prefix=" out)
689 ,(string-append "--with-l10n-base="
690 abs-srcdir "/l10n")
691 ,@configure-flags)))
692 (setenv "SHELL" bash)
693 (setenv "CONFIG_SHELL" bash)
002c3e6d 694 (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13
90e1cdae
MW
695 (mkdir "../build")
696 (chdir "../build")
697 (format #t "build directory: ~s~%" (getcwd))
698 (format #t "configure flags: ~s~%" flags)
699 (zero? (apply system* bash
700 (string-append srcdir "/configure")
6cde5c34
LC
701 flags)))))
702 (add-before 'configure 'install-desktop-entry
703 (lambda* (#:key outputs #:allow-other-keys)
704 ;; Install the '.desktop' file.
705 (define (swallow-%%-directives input output)
706 ;; Interpret '%%ifdef' directives found in the '.desktop' file.
707 (let loop ((state 'top))
708 (match (read-line input 'concat)
709 ((? eof-object?)
710 #t)
711 ((? string? line)
712 (cond ((string-prefix? "%%ifdef" line)
713 (loop 'ifdef))
714 ((string-prefix? "%%else" line)
715 (loop 'else))
716 ((string-prefix? "%%endif" line)
717 (loop 'top))
718 (else
719 (case state
720 ((top else)
721 (display line output)
722 (loop state))
723 (else
724 (loop state)))))))))
725
726 (let* ((out (assoc-ref outputs "out"))
727 (applications (string-append out "/share/applications")))
728 (call-with-input-file "debian/icecat.desktop.in"
729 (lambda (input)
730 (call-with-output-file "debian/icecat.desktop"
731 (lambda (output)
732 (swallow-%%-directives input output)))))
733
734 (substitute* "debian/icecat.desktop"
735 (("@MOZ_DISPLAY_NAME@")
736 "GNU IceCat")
737 (("^Exec=@MOZ_APP_NAME@")
738 (string-append "Exec=" out "/bin/icecat"))
739 (("@MOZ_APP_NAME@")
740 "icecat"))
741 (install-file "debian/icecat.desktop" applications)
88a8ce87
AG
742 #t)))
743 (add-after 'install-desktop-entry 'install-icons
744 (lambda* (#:key outputs #:allow-other-keys)
745 (let ((out (assoc-ref outputs "out")))
746 (with-directory-excursion "browser/branding/official"
747 (for-each
748 (lambda (file)
749 (let* ((size (string-filter char-numeric? file))
750 (icons (string-append out "/share/icons/hicolor/"
751 size "x" size "/apps")))
752 (mkdir-p icons)
753 (copy-file file (string-append icons "/icecat.png"))))
754 '("default16.png" "default22.png" "default24.png"
755 "default32.png" "default48.png" "content/icon64.png"
6e75740f
CL
756 "mozicon128.png" "default256.png"))))))
757 ;; This fixes the file chooser crash that happens with GTK 3.
758 (add-after 'install 'wrap-program
759 (lambda* (#:key inputs outputs #:allow-other-keys)
760 (let* ((out (assoc-ref outputs "out"))
761 (lib (string-append out "/lib"))
762 (gtk (assoc-ref inputs "gtk+"))
763 (gtk-share (string-append gtk "/share")))
764 (wrap-program (car (find-files lib "^icecat$"))
765 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))))
6fd52309 766 (home-page "https://www.gnu.org/software/gnuzilla/")
be0f6112
AE
767 (synopsis "Entirely free browser derived from Mozilla Firefox")
768 (description
769 "IceCat is the GNU version of the Firefox browser. It is entirely free
c5779c93 770software, which does not recommend non-free plugins and addons. It also
79c311b8 771features built-in privacy-protecting features.")
63e8bb12 772 (license license:mpl2.0) ;and others, see toolkit/content/license.html
99effc8f
LC
773 (properties
774 `((ftp-directory . "/gnu/gnuzilla")
775 (cpe-name . "firefox_esr")
bfb48f4f 776 (cpe-version . ,(first (string-split version #\-)))))))