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