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