Commit | Line | Data |
---|---|---|
be0f6112 | 1 | ;;; GNU Guix --- Functional package management for GNU |
5deea4fc | 2 | ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> |
aff0cce9 | 3 | ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> |
429c8284 | 4 | ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org> |
1aaaff1a | 5 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> |
e80a4479 | 6 | ;;; Copyright © 2016, 2017, 2018, 2019 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> |
b14aab67 | 9 | ;;; Copyright © 2017, 2018 Nikita <nikita@n0.is> |
37db2370 | 10 | ;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
b14aab67 | 11 | ;;; Copyright © 2018, 2020 Ricardo Wurmus <rekado@elephly.net> |
7d141788 | 12 | ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com> |
167a0ce0 | 13 | ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com> |
37db2370 | 14 | ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> |
b14aab67 JB |
15 | ;;; Copyright © 2019, 2020 Adrian Malacoda <malacoda@monarch-pass.net> |
16 | ;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de> | |
be0f6112 AE |
17 | ;;; |
18 | ;;; This file is part of GNU Guix. | |
19 | ;;; | |
20 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
21 | ;;; under the terms of the GNU General Public License as published by | |
22 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
23 | ;;; your option) any later version. | |
24 | ;;; | |
25 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
26 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
27 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
28 | ;;; GNU General Public License for more details. | |
29 | ;;; | |
30 | ;;; You should have received a copy of the GNU General Public License | |
31 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
32 | ||
33 | (define-module (gnu packages gnuzilla) | |
07d4d9b7 | 34 | #:use-module ((srfi srfi-1) #:hide (zip)) |
1461dd24 | 35 | #:use-module (ice-9 match) |
be0f6112 | 36 | #:use-module (gnu packages) |
b5b73a82 | 37 | #:use-module ((guix licenses) #:prefix license:) |
be0f6112 AE |
38 | #:use-module (guix packages) |
39 | #:use-module (guix download) | |
192a59d0 | 40 | #:use-module (guix git-download) |
ad21d767 | 41 | #:use-module (guix hg-download) |
948879ee MW |
42 | #:use-module (guix gexp) |
43 | #:use-module (guix store) | |
44 | #:use-module (guix monads) | |
aaac423c | 45 | #:use-module (guix utils) |
be0f6112 | 46 | #:use-module (guix build-system gnu) |
e67ad553 | 47 | #:use-module (guix build-system cargo) |
167a0ce0 | 48 | #:use-module (guix build-system trivial) |
948879ee | 49 | #:use-module (gnu packages admin) |
94e96f7f | 50 | #:use-module (gnu packages audio) |
002c3e6d | 51 | #:use-module (gnu packages autotools) |
bfb48f4f | 52 | #:use-module (gnu packages base) |
948879ee | 53 | #:use-module (gnu packages bash) |
1aaaff1a | 54 | #:use-module (gnu packages databases) |
be0f6112 | 55 | #:use-module (gnu packages glib) |
be0f6112 | 56 | #:use-module (gnu packages gtk) |
90e1cdae MW |
57 | #:use-module (gnu packages gnome) |
58 | #:use-module (gnu packages libcanberra) | |
59 | #:use-module (gnu packages cups) | |
89e34644 | 60 | #:use-module (gnu packages kerberos) |
be0f6112 AE |
61 | #:use-module (gnu packages linux) |
62 | #:use-module (gnu packages perl) | |
63 | #:use-module (gnu packages pkg-config) | |
1ae6df81 | 64 | #:use-module (gnu packages compression) |
74c7af9f | 65 | #:use-module (gnu packages fontutils) |
1ae6df81 | 66 | #:use-module (gnu packages libevent) |
90e1cdae | 67 | #:use-module (gnu packages libreoffice) ;for hunspell |
e55354b8 | 68 | #:use-module (gnu packages image) |
1ae6df81 | 69 | #:use-module (gnu packages libffi) |
74c7af9f | 70 | #:use-module (gnu packages pulseaudio) |
be0f6112 | 71 | #:use-module (gnu packages python) |
44d10b1f | 72 | #:use-module (gnu packages python-xyz) |
ad21d767 | 73 | #:use-module (gnu packages node) |
be0f6112 | 74 | #:use-module (gnu packages xorg) |
200726ed | 75 | #:use-module (gnu packages gl) |
01497dfe | 76 | #:use-module (gnu packages assembly) |
e67ad553 | 77 | #:use-module (gnu packages rust) |
c5c48761 | 78 | #:use-module (gnu packages rust-apps) |
8d956d86 | 79 | #:use-module (gnu packages llvm) |
aff0cce9 | 80 | #:use-module (gnu packages nss) |
13b284d9 MW |
81 | #:use-module (gnu packages icu4c) |
82 | #:use-module (gnu packages video) | |
94e96f7f | 83 | #:use-module (gnu packages xiph) |
13b284d9 | 84 | #:use-module (gnu packages xdisorg) |
cd0322a3 RW |
85 | #:use-module (gnu packages readline) |
86 | #:use-module (gnu packages sqlite)) | |
be0f6112 | 87 | |
4923e06f SB |
88 | (define-public mozjs |
89 | (package | |
90 | (name "mozjs") | |
91 | (version "17.0.0") | |
92 | (source (origin | |
93 | (method url-fetch) | |
94 | (uri (string-append | |
95 | "https://ftp.mozilla.org/pub/mozilla.org/js/" | |
96 | name version ".tar.gz")) | |
97 | (sha256 | |
98 | (base32 | |
68716289 | 99 | "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij")) |
a64b7da5 | 100 | (patches (search-patches "mozjs17-aarch64-support.patch")) |
68716289 SB |
101 | (modules '((guix build utils))) |
102 | (snippet | |
103 | ;; Fix incompatibility with Perl 5.22+. | |
6cbee49d MW |
104 | '(begin |
105 | (substitute* '("js/src/config/milestone.pl") | |
106 | (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE")) | |
107 | #t)))) | |
4923e06f SB |
108 | (build-system gnu-build-system) |
109 | (native-inputs | |
f403c676 EF |
110 | `(("perl" ,perl) |
111 | ("pkg-config" ,pkg-config) | |
112 | ("python" ,python-2))) | |
113 | (propagated-inputs | |
114 | `(("nspr" ,nspr))) ; in the Requires.private field of mozjs-17.0.pc | |
115 | (inputs | |
116 | `(("zlib" ,zlib))) | |
4923e06f | 117 | (arguments |
56486b3a EF |
118 | `(;; XXX: parallel build fails, lacking: |
119 | ;; mkdir -p "system_wrapper_js/" | |
120 | #:parallel-build? #f | |
87eeeeb0 | 121 | #:make-flags '("CXXFLAGS=-fpermissive") |
56486b3a EF |
122 | #:phases |
123 | (modify-phases %standard-phases | |
124 | (add-after 'unpack 'delete-timedout-test | |
a64b7da5 | 125 | ;; This test times out on slower hardware. |
e15793c8 MW |
126 | (lambda _ |
127 | (delete-file "js/src/jit-test/tests/basic/bug698584.js") | |
128 | #t)) | |
56486b3a | 129 | (add-before 'configure 'chdir |
4923e06f | 130 | (lambda _ |
56486b3a EF |
131 | (chdir "js/src") |
132 | #t)) | |
133 | (replace 'configure | |
134 | ;; configure fails if it is followed by SHELL and CONFIG_SHELL | |
135 | (lambda* (#:key outputs #:allow-other-keys) | |
136 | (let ((out (assoc-ref outputs "out"))) | |
137 | (setenv "SHELL" (which "sh")) | |
138 | (setenv "CONFIG_SHELL" (which "sh")) | |
e15793c8 MW |
139 | (invoke "./configure" (string-append "--prefix=" out) |
140 | ,@(if (string=? "aarch64-linux" | |
141 | (%current-system)) | |
142 | '("--host=aarch64-unknown-linux-gnu") | |
143 | '())))))))) | |
4923e06f SB |
144 | (home-page |
145 | "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey") | |
146 | (synopsis "Mozilla javascript engine") | |
147 | (description "SpiderMonkey is Mozilla's JavaScript engine written | |
148 | in C/C++.") | |
87158e85 | 149 | (license license:mpl2.0))) ; and others for some files |
4923e06f | 150 | |
cefdcb38 SB |
151 | (define-public mozjs-24 |
152 | (package (inherit mozjs) | |
153 | (name "mozjs") | |
154 | (version "24.2.0") | |
155 | (source (origin | |
156 | (method url-fetch) | |
157 | (uri (string-append | |
158 | "https://ftp.mozilla.org/pub/mozilla.org/js/" | |
159 | name "-" version ".tar.bz2")) | |
160 | (sha256 | |
161 | (base32 | |
68716289 SB |
162 | "1n1phk8r3l8icqrrap4czplnylawa0ddc2cc4cgdz46x3lrkybz6")) |
163 | (modules '((guix build utils))) | |
26f38d31 | 164 | (patches (search-patches "mozjs24-aarch64-support.patch")) |
68716289 SB |
165 | (snippet |
166 | ;; Fix incompatibility with Perl 5.22+. | |
6cbee49d MW |
167 | '(begin |
168 | (substitute* '("js/src/config/milestone.pl") | |
169 | (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE")) | |
170 | #t)))) | |
cefdcb38 | 171 | (arguments |
aaac423c EF |
172 | (substitute-keyword-arguments (package-arguments mozjs) |
173 | ((#:phases phases) | |
174 | `(modify-phases ,phases | |
175 | (replace 'configure | |
176 | (lambda* (#:key outputs #:allow-other-keys) | |
177 | (let ((out (assoc-ref outputs "out"))) | |
178 | ;; configure fails if it is followed by SHELL and CONFIG_SHELL | |
179 | (setenv "SHELL" (which "sh")) | |
180 | (setenv "CONFIG_SHELL" (which "sh")) | |
6073ef75 MW |
181 | (invoke "./configure" |
182 | (string-append "--prefix=" out) | |
183 | "--with-system-nspr" | |
184 | "--enable-system-ffi" | |
185 | "--enable-threadsafe" | |
186 | ,@(if (string=? "aarch64-linux" | |
187 | (%current-system)) | |
188 | '("--host=aarch64-unknown-linux-gnu") | |
189 | '()))))))))) | |
cefdcb38 SB |
190 | (inputs |
191 | `(("libffi" ,libffi) | |
192 | ("zlib" ,zlib))))) | |
193 | ||
29f381ba CL |
194 | (define-public mozjs-38 |
195 | (package | |
196 | (inherit mozjs) | |
197 | (name "mozjs") | |
198 | (version "38.2.1.rc0") | |
199 | (source (origin | |
200 | (method url-fetch) | |
201 | (uri (string-append | |
747c8f2a | 202 | "https://anduin.linuxfromscratch.org/BLFS/mozjs/" |
29f381ba CL |
203 | name "-" version ".tar.bz2")) |
204 | (sha256 | |
205 | (base32 | |
206 | "0p4bmbpgkfsj54xschcny0a118jdrdgg0q29rwxigg3lh5slr681")) | |
207 | (patches | |
208 | (search-patches | |
209 | ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1269317 for | |
210 | ;; GCC 6 compatibility. | |
211 | ||
212 | "mozjs38-version-detection.patch" ; for 0ad | |
213 | "mozjs38-tracelogger.patch" | |
214 | ||
215 | ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1339931. | |
216 | "mozjs38-pkg-config-version.patch" | |
217 | "mozjs38-shell-version.patch")) | |
218 | (modules '((guix build utils))) | |
219 | (snippet | |
220 | '(begin | |
221 | ;; Fix incompatibility with sed 4.4. | |
222 | (substitute* "js/src/configure" | |
223 | (("\\^\\[:space:\\]") "^[[:space:]]")) | |
224 | ||
225 | ;; The headers are symlinks to files that are in /tmp, so they | |
226 | ;; end up broken. Copy them instead. | |
227 | (substitute* | |
228 | "python/mozbuild/mozbuild/backend/recursivemake.py" | |
229 | (("\\['dist_include'\\].add_symlink") | |
230 | "['dist_include'].add_copy")) | |
231 | ||
232 | ;; Remove bundled libraries. | |
233 | (for-each delete-file-recursively | |
234 | '("intl" | |
235 | "js/src/ctypes/libffi" | |
236 | "js/src/ctypes/libffi-patches" | |
237 | "modules/zlib")) | |
238 | #t)))) | |
239 | (arguments | |
240 | `(;; XXX: parallel build fails, lacking: | |
241 | ;; mkdir -p "system_wrapper_js/" | |
242 | #:parallel-build? #f | |
243 | ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1008470. | |
244 | #:tests? #f | |
245 | #:phases | |
246 | (modify-phases %standard-phases | |
247 | (replace 'configure | |
248 | (lambda* (#:key outputs #:allow-other-keys) | |
249 | (let ((out (assoc-ref outputs "out"))) | |
250 | (chdir "js/src") | |
251 | (setenv "SHELL" (which "sh")) | |
252 | (setenv "CONFIG_SHELL" (which "sh")) | |
5f70b6d4 MW |
253 | (invoke "./configure" |
254 | (string-append "--prefix=" out) | |
255 | "--enable-ctypes" | |
256 | "--enable-gcgenerational" | |
257 | "--enable-optimize" | |
258 | "--enable-pie" | |
259 | "--enable-readline" | |
260 | "--enable-shared-js" | |
261 | "--enable-system-ffi" | |
262 | "--enable-threadsafe" | |
263 | "--enable-xterm-updates" | |
264 | "--with-system-icu" | |
265 | "--with-system-nspr" | |
266 | "--with-system-zlib" | |
29f381ba | 267 | |
5f70b6d4 MW |
268 | ;; Intl API requires bundled ICU. |
269 | "--without-intl-api"))))))) | |
29f381ba CL |
270 | (native-inputs |
271 | `(("perl" ,perl) | |
272 | ("pkg-config" ,pkg-config) | |
273 | ("python-2" ,python-2))) | |
274 | (inputs | |
275 | `(("libffi" ,libffi) | |
276 | ("readline" ,readline) | |
277 | ("icu4c" ,icu4c) | |
278 | ("zlib" ,zlib))))) | |
279 | ||
192a59d0 RW |
280 | (define-public mozjs-52 |
281 | ;; No releases yet at <https://archive.mozilla.org/pub/spidermonkey/releases/>. | |
282 | ;; While we could take a snapshot of the complete mozilla-esr52 repository at | |
283 | ;; <https://treeherder.mozilla.org/#/jobs?repo=mozilla-esr52&filter-searchStr=sm-tc>, | |
284 | ;; we take the Debian version instead, because it is easier to work with. | |
285 | (let ((commit "6507e63cc416fd7a3269e390efe712f8b56f374a") | |
286 | (revision "1")) | |
287 | (package (inherit mozjs-38) | |
288 | (version (git-version "52.0" revision commit)) | |
289 | (source (origin | |
290 | (method git-fetch) | |
291 | (uri (git-reference | |
292 | (url "https://salsa.debian.org/gnome-team/mozjs52.git") | |
293 | (commit commit))) | |
294 | (file-name (git-file-name "mozjs" version)) | |
295 | (sha256 | |
296 | (base32 | |
297 | "1ny0s53r8wn4byys87h784xrq1xg767akmfm6gqrbvrz57mlm3q2")))) | |
298 | (arguments | |
299 | `(#:tests? #f ; depends on repository metadata | |
300 | #:configure-flags | |
301 | '("--enable-ctypes" | |
302 | "--enable-optimize" | |
303 | "--enable-pie" | |
304 | "--enable-readline" | |
305 | "--enable-shared-js" | |
306 | "--enable-system-ffi" | |
307 | "--with-system-icu" | |
308 | "--with-system-nspr" | |
309 | "--with-system-zlib" | |
310 | ||
311 | ;; Intl API requires bundled ICU. | |
6cc147a3 RW |
312 | "--without-intl-api" |
313 | ||
314 | ;; Without this gnome-shell will crash at runtime. | |
315 | "--disable-jemalloc") | |
192a59d0 RW |
316 | #:phases |
317 | (modify-phases %standard-phases | |
318 | (add-after 'unpack 'patch-and-chdir | |
319 | (lambda* (#:key inputs #:allow-other-keys) | |
320 | ;; This patch prevents a segfault when executing JS_Init(). | |
321 | ;; The build does not fail without this patch, but the | |
322 | ;; configure phase of the gjs package would fail. | |
323 | ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1176787 | |
324 | (make-file-writable "js/src/old-configure.in") | |
325 | (make-file-writable "js/src/old-configure") | |
326 | (make-file-writable "mozglue/build/moz.build") | |
327 | (invoke "patch" "-p1" "--force" | |
328 | "--input" "debian/patches/disable-mozglue.patch") | |
329 | (invoke "touch" "js/src/configure") | |
330 | (chdir "js/src") | |
331 | #t)) | |
332 | (replace 'configure | |
333 | (lambda* (#:key inputs outputs configure-flags #:allow-other-keys) | |
334 | ;; The configure script does not accept environment variables | |
335 | ;; as arguments. | |
336 | (let ((out (assoc-ref outputs "out"))) | |
337 | (setenv "SHELL" (which "sh")) | |
338 | (setenv "CONFIG_SHELL" (which "sh")) | |
339 | (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf") | |
340 | "/bin/autoconf")) | |
341 | (apply invoke "./configure" | |
342 | (cons (string-append "--prefix=" out) | |
343 | configure-flags)))))))) | |
344 | (native-inputs | |
345 | `(("autoconf" ,autoconf-2.13) | |
346 | ("automake" ,automake) | |
347 | ,@(package-native-inputs mozjs-38)))))) | |
348 | ||
204cfbe1 RW |
349 | (define-public mozjs-60 |
350 | ;; No releases yet at <https://archive.mozilla.org/pub/spidermonkey/releases/>. | |
351 | ;; While we could take a snapshot of the complete mozilla-esr60 repository at | |
352 | ;; <https://treeherder.mozilla.org/#/jobs?repo=mozilla-esr60&filter-searchStr=sm-tc>, | |
353 | ;; we take the Debian version instead, because it is easier to work with. | |
354 | (package | |
355 | (inherit mozjs-38) | |
356 | (version "60.2.3-2") | |
357 | (source (origin | |
358 | (method git-fetch) | |
359 | (uri (git-reference | |
360 | (url "https://salsa.debian.org/gnome-team/mozjs60.git") | |
361 | (commit (string-append "debian/" version)))) | |
362 | (file-name (git-file-name "mozjs" version)) | |
363 | (sha256 | |
364 | (base32 | |
365 | "091w050rwzrdcbgyi934k2viyccmlqxrp13sm2mql71mabb5dai6")))) | |
366 | (arguments | |
367 | `(#:tests? #f ; FIXME: all tests pass, but then the check phase fails anyway. | |
368 | #:test-target "check-jstests" | |
369 | #:configure-flags | |
370 | '("--enable-ctypes" | |
371 | "--enable-optimize" | |
372 | "--enable-pie" | |
373 | "--enable-readline" | |
374 | "--enable-shared-js" | |
375 | "--enable-system-ffi" | |
376 | "--with-system-nspr" | |
377 | "--with-system-zlib" | |
378 | "--with-system-icu" | |
379 | "--with-intl-api" | |
380 | ;; This is important because without it gjs will segfault during the | |
381 | ;; configure phase. With jemalloc only the standalone mozjs console | |
382 | ;; will work. | |
383 | "--disable-jemalloc") | |
384 | #:phases | |
385 | (modify-phases %standard-phases | |
386 | (replace 'configure | |
387 | (lambda* (#:key inputs outputs configure-flags #:allow-other-keys) | |
388 | ;; The configure script does not accept environment variables as | |
389 | ;; arguments. It also must be run from a different directory, | |
390 | ;; but not the root directory either. | |
391 | (let ((out (assoc-ref outputs "out"))) | |
392 | (mkdir "run-configure-from-here") | |
393 | (chdir "run-configure-from-here") | |
394 | (setenv "SHELL" (which "sh")) | |
395 | (setenv "CONFIG_SHELL" (which "sh")) | |
396 | (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf") | |
397 | "/bin/autoconf")) | |
398 | (apply invoke "../js/src/configure" | |
399 | (cons (string-append "--prefix=" out) | |
400 | configure-flags)) | |
401 | #t))) | |
402 | (add-after 'unpack 'disable-broken-tests | |
403 | (lambda _ | |
404 | ;; This test assumes that /bin exists and contains certain | |
405 | ;; executables. | |
406 | (delete-file "js/src/tests/shell/os.js") | |
407 | #t))))) | |
408 | (native-inputs | |
409 | `(("autoconf" ,autoconf) | |
410 | ("automake" ,automake) | |
411 | ("which" ,which) | |
412 | ("perl" ,perl) | |
413 | ("pkg-config" ,pkg-config) | |
414 | ("python" ,python-2))))) | |
415 | ||
ad21d767 MW |
416 | (define mozilla-compare-locales |
417 | (origin | |
418 | (method hg-fetch) | |
419 | (uri (hg-reference | |
420 | (url "https://hg.mozilla.org/l10n/compare-locales/") | |
421 | (changeset "RELEASE_3_3_0"))) | |
422 | (file-name "mozilla-compare-locales") | |
423 | (sha256 (base32 "0biazbq7vbi99b99rfn4szwyx032dkpi09c9z4zs6f1br0f86iy1")))) | |
424 | ||
425 | (define (mozilla-locale locale changeset hash-string) | |
426 | (origin | |
427 | (method hg-fetch) | |
428 | (uri (hg-reference | |
429 | (url (string-append "https://hg.mozilla.org/l10n-central/" | |
430 | locale)) | |
431 | (changeset changeset))) | |
432 | (file-name (string-append "mozilla-locale-" locale)) | |
433 | (sha256 (base32 hash-string)))) | |
434 | ||
435 | (define-syntax-rule (mozilla-locales (hash-string changeset locale) ...) | |
436 | (list (mozilla-locale locale changeset hash-string) | |
437 | ...)) | |
438 | ||
439 | (define all-mozilla-locales | |
440 | (mozilla-locales | |
441 | ;; sha256 changeset locale | |
442 | ;;--------------------------------------------------------------------------- | |
443 | ("0pybx6j2ycbrr1xmv0spv19sd8a1dyzcs8kf6pzn71w8y6kiagcf" "35959cf2343c" "ach") | |
444 | ("0dixmkha738w7fkx20nx95xkfyrqb9vczpy6m03qnqfvb76xaxj5" "e8dc1010f909" "af") | |
445 | ("124j09va25gwfxdzyfixrli0skxv53c7niagjyp7g3a3kcv2lbhc" "4c67f6b96a7b" "an") | |
446 | ("0flgqll3xx0ym0zj0w9j2jw3fmhs6h9m4l5da6m0bpnk5ff80r06" "34cbea5f44a5" "ar") | |
447 | ("0kdb1yqfbfz508f4p77z3p1v6fwy190vs5ipj58hgdixjgbxkqay" "b4790b27633c" "ast") | |
448 | ("1vm5xw6wg12pygswd3p0qpkaxyryah6nif5n15chb4sb42c1gqcm" "96d341bf49d4" "az") | |
449 | ("1j2qrrws51qij6haz5b77n5vzqhsxgs1ppqqw4mdrkacwvz4ciwh" "4adaede00646" "be") | |
450 | ("0ydr8f9lbd51prgcbjb5yacb461j8va0s5bqfs0rnglkvhmk6ard" "d1140972aefe" "bg") | |
451 | ("0wyw90zjp8kpd1gljng00in9wr2cf59ww6z002lgx5k4gibnqcfd" "2b3ce92c2310" "bn") | |
452 | ("0kkq621h1qdmimyrmms9g5p70m54z2ddw4cd962nqbkrnmabq9vn" "426896350893" "br") | |
453 | ("0vibhnb3cbpbgf10db04g6vm372kb9i27p0jkwif019f7qprswd8" "7463f339ce07" "bs") | |
454 | ("1l8cn2fqfvx7bswzfy9vavv8cd32ha9ygdxxdbxi64wcgw0f80bf" "dab3f05125e4" "ca") | |
455 | ("0fik17y8zyg9w82lq501ic73a53c0q9r8v4zgn9bnzgsygig8qpq" "ebb9d989275a" "cak") | |
456 | ("0sj29v6144h39wzb4rvxph3cwgvs4gzkgpr0463d3fcs6jdi0kjs" "522352780348" "cs") | |
457 | ("1nz8jlx62l69jcdi59hlk8jysm15sh3d1cxqginjmx7w351wsidm" "0791b954c333" "cy") | |
458 | ("1vc01q1vlq26xm1vm1x0119jawxxp975p9k8ashmiwncl1bvqb48" "121f5f876f4c" "da") | |
459 | ("1iqny61rg57banfbbskc2y3pr6d35fabnxmynv7vxm9jd86pndz3" "95fb3e99a2bc" "de") | |
460 | ("06v9j8acx5h8za7m65v6qm0wjbkx6vm46m8sigcp69phyg3fjc96" "90e681b74587" "dsb") | |
461 | ("0lbk90x2dxdbh63fycqxspx6jqq2zlzys6grg45balw8yyvzqrkz" "58ba4c13fd42" "el") | |
462 | ("0c2ypvy0z8g78s5158v6h9khckq1xps34r5wbiiciix289m43dgl" "8953d8c98a30" "en-CA") | |
463 | ("0z3riz3w2z6p710p90ridmwwam4snnz5mn90gd4jc1h2n7vc9mr0" "5a2b9bca3f52" "en-GB") | |
464 | ("102gn3h4ap8c3x1p7vfc88vapkfiz6264y6byhxy1axxjk3x3a77" "e87cb1c61d6e" "eo") | |
465 | ("148wj6wsx0aq7cpaxk8njj7cb1wfjr2m96dgxq6b3qcv781ldvjn" "5db15fdf95d5" "es-AR") | |
466 | ("0r11d8vzvbyz17n371byvkrnszcv1zhr7rg64i58xra3y6d7is7n" "ce2ee0e51a92" "es-CL") | |
467 | ("1xmqa8p7lpqvkgg879hfnmf6kxcpawjk8z31cdzfp1hrdlmxg8n7" "7346617620f3" "es-ES") | |
468 | ("0jxv3jh2018lnybr9mzqrffvwmr87yab9bh8lxqjj294fxw1hrxm" "687f05eb0c58" "es-MX") | |
469 | ("1rpgv7pajv4xldsn1xxsia5j72vn3x8zl5wmbzkyw56lvn9fckvf" "839a5029c496" "et") | |
470 | ("0hxp4fr3y05rkpamdb1hlmybn6d3bv3rcawjm3axbpqxbyfdpfzc" "54e8d87230c9" "eu") | |
471 | ("1y50knymnmcihw8bhvahicc386mjm6dx4hx0j6fv8sl23wzx2h9m" "c5ffca960f9c" "fa") | |
472 | ("0pj9zgi0c3yl3myhvb5afiijayp2lqzhlk630ahxn5hgjgkz0lx7" "75c000a8538d" "ff") | |
473 | ("199jg0zv7wp1cq0ik2hf84j99jx5vq2jwac0gaayvjzkh2z83jqr" "f11b2e689e7b" "fi") | |
474 | ("1vxkiwwni7470ywy99arxxa56ljkhjrhxslsp1l1l61g6gdbbspr" "49ec4f791806" "fr") | |
475 | ("0d8gwdcj0jpjv03nhjds8jrg86pg371xpylaibwri76wlyl7m54i" "faa761a5cfdc" "fy-NL") | |
476 | ("0nipbxx11a2sjadzhbi88vgknw5hzr4nqy2722q3kc1212jbi754" "5bd9466f9f9d" "ga-IE") | |
477 | ("0bay8mrm65cvmnvqpwqgzr0h3cb18ifzg5kbsbxcvdfm9xv0zi9g" "a4f6a47e82dd" "gd") | |
478 | ("00kn5w3nnpw1pxg6hhrn9asf9hgpjd6ia4038iwzcqs68w887qcy" "6c2aa01ada4e" "gl") | |
479 | ("0jj13i0ach85c975vaz2rr83mibs29ipssa7qsjkb0y2ch6xya1k" "c2d607e36cb5" "gn") | |
480 | ("1nhqbgzilcb0pr7941dxkhg079bf8v7ldikp1s5xli34wf9sabm2" "f34465d6ac1c" "gu-IN") | |
481 | ("11bh0541d996cfin1zy72l66753q94i4idgv2waf0h40h9g3z1bm" "c2ecb2762274" "he") | |
482 | ("1lslji7hh5lx5ig1xgfjh4cdindsgh3n2a7qlvzwz96gda43lvv4" "94d2bb10ee03" "hi-IN") | |
483 | ("1nx5yw00l25i3m3grdm29mi9mi7h0cy5qx02pypir754pk3hiwcc" "08df0d94edd5" "hr") | |
484 | ("19yc9dk2pwqycynmx58d1ik6x4mnyfxscgr6sg676dpl613xd7nq" "21b614e77025" "hsb") | |
485 | ("0l3z64jlx6b6ivk1b5hwqyx9hm1m5721ywnb2m4zmg3g9fw4vn7f" "f82cad7170af" "hu") | |
486 | ("1sn0dxbbf2zwcpybwcw77qb4p0hf6fxapnsnn4avaab5g55dlgz4" "d94c30920396" "hy-AM") | |
487 | ("0c92cqxrhv4317kirmhpjk7mrq44yn6fp3v6syxnhz7xwxnhshjm" "6a5f176b0626" "ia") | |
488 | ("03gyg9gqsd6pwb9nydglhm46fi2wk2p2qygmhmrf8hnav3ba7n0r" "94e4302e0f85" "id") | |
489 | ("0ky8aaps92mn56rvkwn0i13wg8av8hzi1fvr0ahqhjcpj5sfgdwq" "eca348a59888" "is") | |
490 | ("01py0sfg7nljcsgpivryrvai4p4wzbcvhgc2ymr19r579nv1vw7g" "d541a6197359" "it") | |
491 | ("0iv7vmj43njmi7g1gjzsv68ax4j502d2wnkvbfz1rx11lrqs7yw1" "a5ab3a1d95b7" "ja") | |
492 | ("1sr9ccshcw6agbj4hbnpblxixb1jz0m36glas6f9ahxmi7m605si" "63763ffa5a94" "ja-JP-mac") | |
493 | ("1as33pzcsdkynrj16dv7w642vl6plbhk650am4l5djwm64f2rgms" "aa83e8555ddc" "ka") | |
494 | ("1jwaqb5qps3i5y9iw8l2hrwa0n8lfnx1k9x0p54y3jkh6p3q3fzc" "0e0e25c26247" "kab") | |
495 | ("0cjfiwv0q5i8d7fpwb4m2w5ahq687dqjlwlicgpa443yi2zsxr4s" "33117723ceb1" "kk") | |
496 | ("0k5b56cv39aaxf9r0p9c27f3fp6yq2ffd4w6qmd0ibpl69sm629d" "aff7b2a7825e" "km") | |
497 | ("1a0zg96jgq4zn9cz0h2qwc0vv1fbkfzs5qrgabg62wqgz286jvvv" "ea91638cb1dd" "kn") | |
498 | ("0jhmv2n3yx55r6fg3myg7j1c1nhsv25g016m6lh2j023xbr723gp" "88821009b5b3" "ko") | |
499 | ("06bybgv4m4i7r9p0qld65j31vbrnljhsdj649dl93msv2r69ilif" "88685d5f07b3" "lij") | |
500 | ("1bzjf8smw6ngi88j5g3fawrg54m8fifbhshwjbgkpj7rnrpjgh4w" "e046c7ffa7d0" "lt") | |
501 | ("18dmzmpavijb7fwzffas0j5nb6byqp8h6ki7hhf6qb35diqgfq6n" "c520ef4f576c" "lv") | |
502 | ("055zf7xj5h1h8mzxj1cjzhngpcvg2p5vs2dmffsa5zfprj02d0dm" "9e43723f18ad" "mk") | |
503 | ("1496fbyyzcl075gzcd3xy50h9jyhnzgb544k1scji56yhyfajacb" "ce615fef92c1" "mr") | |
504 | ("1wc1q8ksry181pvnysqsq4dhhsg5adw5vgqafmmq5sf6i2bwn2z0" "4fefe88cfaee" "ms") | |
505 | ("0awf6mrdwdhy2yvxynssvp1zg1nc2fqbmg2d2bhjcib69zx944xw" "3987a06866fd" "my") | |
506 | ("1hycvz7i4jd40hfs5abx6sgfdkafg0jhdgqih9b7lb08aqcl35pj" "2b3b8997d9a1" "nb-NO") | |
507 | ("048z1ib46izwryyy8l1x71kq4775n7l2ilbskhsyrbxqryma13k8" "f25324281615" "ne-NP") | |
508 | ("1qkxqpyr4la9bn1bqsgc2h9869arglh9n2kwpkq6722jzdbynkz2" "04c7d32c57f6" "nl") | |
509 | ("08gnmdll55dbqj7qs63gq1kljbvg24nzns6q4m0av3sszsic0jv5" "5587520e5019" "nn-NO") | |
510 | ("1yh2p4ipj5p2b7gh0xxj0n7ndvwn5bw2773ibrh7vz932mkzhhjn" "499386b02695" "oc") | |
511 | ("0kjbnixjzv9hvyba4ll20gs76vx84pviy134fvpjp9lfjpnpib55" "31c01c325675" "pa-IN") | |
512 | ("0g61imvr4639bbydyi0kwc1il7l1gzlfij4ywx7hdcmq2x6vgb9v" "fb5f3b8dea09" "pl") | |
513 | ("13n68d7z94d7943m6fwl4kizbqm3wp82xz69vng4w9vyqlvv7d41" "9a541cbdc748" "pt-BR") | |
514 | ("1j8afvrl1afmj2zixrp91rrhag5w4xw90raca1ic6mxyih9kvdi4" "edc959a685c2" "pt-PT") | |
515 | ("0wf4a6q9nvcmam2g8ksbymjdnrz59pdr5nirfpjprfhifjmxx4nn" "d2699db715cd" "rm") | |
516 | ("1k9qalir5pbh490w1mxyq31yhy9hbxsyrrk11hwlwlgn6syp9nvp" "b5460a9017bc" "ro") | |
517 | ("1avy6wyfa5lbvy36wai6mwhhh6x1y8a0jyjk8hvjn52yfxj1gypk" "59ffa8ad047a" "ru") | |
518 | ("1cakhm4jxcw1ij0l1vhxw74hsp5wg68i3319dkdncyyc5a2s1qv9" "8b3c8a7ebdfa" "si") | |
519 | ("0s534r09bqdfvw3q17y9b1035kzzlafjv656v73mqhyz3fkffsx5" "cb39dc77980e" "sk") | |
520 | ("1s58vgmnb9aiaiaqwwcivq3iyzpzj527w2aqh2nrh6xmaw7f43sr" "17d7969b1d9a" "sl") | |
521 | ("147qm7x5z8rkf24jpqvkdlqg0fjz1l3zwnaxvkh9y2jpzv7m0x7z" "c55b0e9ff99d" "son") | |
522 | ("0nn4r1rxi8cy7x9nmn5ljd8gcsn2rjl2ma2j7waxkafkm4rs6n20" "2bb3808072da" "sq") | |
523 | ("0jsb01b94z7qbm59yaj56nb7yx7a6hpgw8v6nzwhbvmnmcsird4p" "c323c0d02d61" "sr") | |
524 | ("1n7vv9y4sk3gig56rgfd2jk8jr2160grxk31bd1wkm7fvbndd259" "4220ce487cbc" "sv-SE") | |
525 | ("06270mq7gajxfrsb8gqd25v2dac68ask5vvlh6kkkp3hrgy02vid" "6a1dbc2fe1d3" "ta") | |
526 | ("10az7pd3npa7n8wq0qywvsj2qrx9592i2wffs3rnc1fviv1i1q0y" "028505b5ecd1" "te") | |
527 | ("0yj0c3iyibb3jyypvyiyhbr9asxa48v0nq21kcf9gphi8fnyp5if" "e44d38b6a67b" "th") | |
528 | ("1qc4nvhw834lx7p304fxma0fjdr4xfj4lf69dhh6biqz795lx45p" "1e0771d95708" "tr") | |
529 | ("1g4y2yq5xp61ncy7c08j7fqqr1jc0m1hjxmbg5659wzif3b3dkg4" "e3c96943e98f" "uk") | |
530 | ("1zbi28z1c3p5il7ndixyjsv4nrimzq36zjvlmq10am38ycqr9df8" "f35da1b02691" "ur") | |
531 | ("1jrxjjj8k771y0wljqbadxdj4pasg0771jmg4l3hvpgs929i3j9g" "6fd2084b3efe" "uz") | |
532 | ("1f8sqgxzgqmw6vzjv3f49lg43q09i3j62f471864vr71815agl8n" "33b5dfd0cd63" "vi") | |
533 | ("0ssnsbxw3q5k88fa081gkn1mbqn4j7bm6vb7yvz6h44j214xkz9x" "2d87c0740715" "xh") | |
534 | ("0kd3mrvvgczhsmw4rvpxxxc71bb469ayr8r4azf7gc0y5nmlm950" "a2b6625688d3" "zh-CN") | |
535 | ("0qy1asyfplkyc89z3g3gfm7b32aka92350b3ayv9d9dcgwxmfdwz" "4d6e959a13d1" "zh-TW"))) | |
536 | ||
bfb48f4f | 537 | (define (mozilla-patch file-name changeset hash) |
ae71cd8a | 538 | "Return an origin for CHANGESET from the mozilla-esr60 repository." |
bfb48f4f MW |
539 | (origin |
540 | (method url-fetch) | |
ae71cd8a | 541 | (uri (string-append "https://hg.mozilla.org/releases/mozilla-esr60/raw-rev/" |
bfb48f4f MW |
542 | changeset)) |
543 | (sha256 (base32 hash)) | |
544 | (file-name file-name))) | |
545 | ||
948879ee MW |
546 | (define* (computed-origin-method gexp-promise hash-algo hash |
547 | #:optional (name "source") | |
548 | #:key (system (%current-system)) | |
549 | (guile (default-guile))) | |
550 | "Return a derivation that executes the G-expression that results | |
551 | from forcing GEXP-PROMISE." | |
552 | (mlet %store-monad ((guile (package->derivation guile system))) | |
553 | (gexp->derivation (or name "computed-origin") | |
554 | (force gexp-promise) | |
2a1ec7bc | 555 | #:graft? #f ;nothing to graft |
948879ee MW |
556 | #:system system |
557 | #:guile-for-build guile))) | |
558 | ||
e45d7f31 MW |
559 | (define %icecat-version "68.12.0-guix0-preview1") |
560 | (define %icecat-build-id "20200825000000") ;must be of the form YYYYMMDDhhmmss | |
948879ee MW |
561 | |
562 | ;; 'icecat-source' is a "computed" origin that generates an IceCat tarball | |
563 | ;; from the corresponding upstream Firefox ESR tarball, using the 'makeicecat' | |
564 | ;; script from the upstream IceCat project. | |
565 | (define icecat-source | |
566 | (let* ((base-version (first (string-split %icecat-version #\-))) | |
567 | ||
568 | (major-version (first (string-split base-version #\.))) | |
569 | (minor-version (second (string-split base-version #\.))) | |
570 | (sub-version (third (string-split base-version #\.))) | |
571 | ||
572 | (upstream-firefox-version (string-append base-version "esr")) | |
573 | (upstream-firefox-source | |
574 | (origin | |
575 | (method url-fetch) | |
576 | (uri (string-append | |
577 | "https://ftp.mozilla.org/pub/firefox/releases/" | |
578 | upstream-firefox-version "/source/" | |
579 | "firefox-" upstream-firefox-version ".source.tar.xz")) | |
580 | (sha256 | |
581 | (base32 | |
e45d7f31 | 582 | "1k17pi4zh9hrvkzbw4rzzw879a15hpvwriylp75wl22rl7r2nsdf")))) |
948879ee | 583 | |
e45d7f31 | 584 | (upstream-icecat-base-version "68.12.0") ; maybe older than base-version |
ad21d767 | 585 | ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version)) |
e45d7f31 | 586 | (gnuzilla-commit "15a7c3d991a670b6489d4f432b52a188358f4ca5") |
948879ee MW |
587 | (gnuzilla-source |
588 | (origin | |
589 | (method git-fetch) | |
590 | (uri (git-reference | |
591 | (url "git://git.savannah.gnu.org/gnuzilla.git") | |
592 | (commit gnuzilla-commit))) | |
9b096517 MW |
593 | (file-name (git-file-name "gnuzilla" |
594 | ;;upstream-icecat-base-version | |
595 | (string-take gnuzilla-commit 8))) | |
948879ee MW |
596 | (sha256 |
597 | (base32 | |
e45d7f31 | 598 | "0n7p067yay413iy0gzprz0xrdkcxj5f8ywhkcghhhzw1nwajckba")))) |
948879ee MW |
599 | |
600 | (makeicecat-patch | |
c2614688 MW |
601 | (local-file (search-patch "icecat-makeicecat.patch"))) |
602 | (gnuzilla-fixes-patch | |
603 | (local-file (search-patch "icecat-use-older-reveal-hidden-html.patch")))) | |
948879ee MW |
604 | |
605 | (origin | |
606 | (method computed-origin-method) | |
607 | (file-name (string-append "icecat-" %icecat-version ".tar.xz")) | |
608 | (sha256 #f) | |
609 | (uri | |
610 | (delay | |
611 | (with-imported-modules '((guix build utils)) | |
612 | #~(begin | |
613 | (use-modules (guix build utils)) | |
614 | (let ((firefox-dir | |
615 | (string-append "firefox-" #$base-version)) | |
616 | (icecat-dir | |
ad21d767 | 617 | (string-append "icecat-" #$%icecat-version))) |
948879ee MW |
618 | |
619 | (mkdir "/tmp/bin") | |
620 | (set-path-environment-variable | |
621 | "PATH" '("bin") | |
622 | (list "/tmp" | |
623 | #+(canonical-package bash) | |
624 | #+(canonical-package coreutils) | |
625 | #+(canonical-package findutils) | |
626 | #+(canonical-package patch) | |
627 | #+(canonical-package xz) | |
628 | #+(canonical-package sed) | |
629 | #+(canonical-package grep) | |
630 | #+(canonical-package bzip2) | |
631 | #+(canonical-package gzip) | |
632 | #+(canonical-package tar) | |
633 | #+rename)) | |
634 | ||
635 | (symlink #+(file-append rename "/bin/rename") | |
636 | "/tmp/bin/prename") | |
637 | ||
638 | ;; We copy the gnuzilla source directory because it is | |
639 | ;; read-only in 'gnuzilla-source', and the makeicecat script | |
640 | ;; uses "cp -a" to copy parts of it and assumes that the | |
641 | ;; copies will be writable. | |
642 | (copy-recursively #+gnuzilla-source "/tmp/gnuzilla" | |
643 | #:log (%make-void-port "w")) | |
644 | ||
645 | (with-directory-excursion "/tmp/gnuzilla" | |
646 | (make-file-writable "makeicecat") | |
647 | (invoke "patch" "--force" "--no-backup-if-mismatch" | |
648 | "-p1" "--input" #+makeicecat-patch) | |
c2614688 MW |
649 | (invoke "patch" "--force" "--no-backup-if-mismatch" |
650 | "-p1" "--input" #+gnuzilla-fixes-patch) | |
948879ee MW |
651 | (patch-shebang "makeicecat") |
652 | (substitute* "makeicecat" | |
3e605b69 MW |
653 | (("^FFMAJOR=(.*)" all ffmajor) |
654 | (unless (string=? #$major-version | |
655 | (string-trim-both ffmajor)) | |
656 | ;; The makeicecat script cannot be expected to work | |
657 | ;; properly on a different version of Firefox, even if | |
658 | ;; no errors occur during execution. | |
659 | (error "makeicecat major version mismatch")) | |
948879ee MW |
660 | (string-append "FFMAJOR=" #$major-version "\n")) |
661 | (("^FFMINOR=.*") | |
662 | (string-append "FFMINOR=" #$minor-version "\n")) | |
663 | (("^FFSUB=.*") | |
664 | (string-append "FFSUB=" #$sub-version "\n")) | |
948879ee MW |
665 | (("^DATA=.*") |
666 | "DATA=/tmp/gnuzilla/data\n") | |
948879ee MW |
667 | (("/bin/sed") |
668 | #+(file-append (canonical-package sed) "/bin/sed")))) | |
669 | ||
670 | (format #t "Unpacking upstream firefox tarball...~%") | |
671 | (force-output) | |
672 | (invoke "tar" "xf" #+upstream-firefox-source) | |
673 | (rename-file firefox-dir icecat-dir) | |
674 | ||
675 | (with-directory-excursion icecat-dir | |
ad21d767 MW |
676 | (format #t "Populating l10n directory...~%") |
677 | (force-output) | |
05947d92 | 678 | (mkdir "l10n") |
ad21d767 MW |
679 | (with-directory-excursion "l10n" |
680 | (for-each | |
681 | (lambda (locale-dir) | |
682 | (let ((locale | |
683 | (string-drop (basename locale-dir) | |
684 | (+ 32 ; length of hash | |
685 | (string-length "-mozilla-locale-"))))) | |
686 | (format #t " ~a~%" locale) | |
687 | (force-output) | |
688 | (copy-recursively locale-dir locale | |
689 | #:log (%make-void-port "w")) | |
690 | (for-each make-file-writable (find-files locale)) | |
691 | (with-directory-excursion locale | |
692 | (when (file-exists? ".hgtags") | |
693 | (delete-file ".hgtags")) | |
694 | (mkdir-p "browser/chrome/browser/preferences") | |
695 | (call-with-output-file | |
696 | "browser/chrome/browser/preferences/advanced-scripts.dtd" | |
697 | (lambda (port) #f))))) | |
698 | '#+all-mozilla-locales) | |
699 | (copy-recursively #+mozilla-compare-locales | |
700 | "compare-locales" | |
701 | #:log (%make-void-port "w")) | |
702 | (delete-file "compare-locales/.gitignore") | |
703 | (delete-file "compare-locales/.hgignore") | |
704 | (delete-file "compare-locales/.hgtags")) | |
705 | ||
948879ee MW |
706 | (format #t "Running makeicecat script...~%") |
707 | (force-output) | |
ad21d767 | 708 | (invoke "bash" "/tmp/gnuzilla/makeicecat")) |
948879ee | 709 | |
34369f31 | 710 | (format #t "Packing IceCat source tarball...~%") |
948879ee MW |
711 | (force-output) |
712 | (invoke "tar" "cfa" #$output | |
8cf160e1 MW |
713 | ;; Avoid non-determinism in the archive. We set the |
714 | ;; mtime of files in the archive to early 1980 because | |
715 | ;; the build process fails if the mtime of source | |
716 | ;; files is pre-1980, due to the creation of zip | |
717 | ;; archives. | |
718 | "--mtime=@315619200" ; 1980-01-02 UTC | |
948879ee MW |
719 | "--owner=root:0" |
720 | "--group=root:0" | |
721 | "--sort=name" | |
722 | icecat-dir) | |
723 | ||
724 | #t)))))))) | |
725 | ||
be0f6112 AE |
726 | (define-public icecat |
727 | (package | |
728 | (name "icecat") | |
24886c13 | 729 | (version %icecat-version) |
46ce12d0 | 730 | (source icecat-source) |
be0f6112 AE |
731 | (build-system gnu-build-system) |
732 | (inputs | |
733 | `(("alsa-lib" ,alsa-lib) | |
1ae6df81 | 734 | ("bzip2" ,bzip2) |
90e1cdae | 735 | ("cups" ,cups) |
be0f6112 | 736 | ("dbus-glib" ,dbus-glib) |
90e1cdae MW |
737 | ("gdk-pixbuf" ,gdk-pixbuf) |
738 | ("glib" ,glib) | |
002c3e6d MW |
739 | ("gtk+" ,gtk+) |
740 | ("gtk+-2" ,gtk+-2) | |
257e3247 | 741 | ("graphite2" ,graphite2) |
74c7af9f MW |
742 | ("pango" ,pango) |
743 | ("freetype" ,freetype) | |
257e3247 | 744 | ("harfbuzz" ,harfbuzz) |
90e1cdae MW |
745 | ("libcanberra" ,libcanberra) |
746 | ("libgnome" ,libgnome) | |
7cba7647 | 747 | ("libjpeg-turbo" ,libjpeg-turbo) |
94e96f7f MW |
748 | ("libogg" ,libogg) |
749 | ;; ("libtheora" ,libtheora) ; wants theora-1.2, not yet released | |
750 | ("libvorbis" ,libvorbis) | |
74c7af9f | 751 | ("libxft" ,libxft) |
94e96f7f | 752 | ("libevent" ,libevent) |
90e1cdae MW |
753 | ("libxinerama" ,libxinerama) |
754 | ("libxscrnsaver" ,libxscrnsaver) | |
9f7ae77f | 755 | ("libxcomposite" ,libxcomposite) |
be0f6112 | 756 | ("libxt" ,libxt) |
1ae6df81 | 757 | ("libffi" ,libffi) |
e67ad553 | 758 | ("ffmpeg" ,ffmpeg) |
07fc1c0d | 759 | ("libvpx" ,libvpx) |
13b284d9 MW |
760 | ("icu4c" ,icu4c) |
761 | ("pixman" ,pixman) | |
74c7af9f | 762 | ("pulseaudio" ,pulseaudio) |
be0f6112 | 763 | ("mesa" ,mesa) |
90e1cdae | 764 | ("mit-krb5" ,mit-krb5) |
6d328879 | 765 | ;; See <https://bugs.gnu.org/32833> |
6c83c483 | 766 | ;; and related comments in the 'remove-bundled-libraries' phase. |
6d328879 MW |
767 | ;; UNBUNDLE-ME! ("nspr" ,nspr) |
768 | ;; UNBUNDLE-ME! ("nss" ,nss) | |
429c8284 | 769 | ("shared-mime-info" ,shared-mime-info) |
9bc79c11 | 770 | ("sqlite" ,sqlite) |
90e1cdae | 771 | ("startup-notification" ,startup-notification) |
be0f6112 | 772 | ("unzip" ,unzip) |
1ae6df81 LC |
773 | ("zip" ,zip) |
774 | ("zlib" ,zlib))) | |
c4c4cc05 | 775 | (native-inputs |
46ce12d0 MW |
776 | ;; The following patches are specific to the Guix packaging of IceCat, |
777 | ;; and therefore we prefer to leave them out of 'source', which should be | |
778 | ;; a tarball suitable for compilation on any system that IceCat supports. | |
779 | ;; (Bug fixes and security fixes, however, should go in 'source'). | |
ad21d767 MW |
780 | `(;; XXX TODO: Adapt these patches to IceCat 68. |
781 | ;; ("icecat-avoid-bundled-libraries.patch" | |
782 | ;; ,(search-patch "icecat-avoid-bundled-libraries.patch")) | |
783 | ;; ("icecat-use-system-graphite2+harfbuzz.patch" | |
784 | ;; ,(search-patch "icecat-use-system-graphite2+harfbuzz.patch")) | |
785 | ;; ("icecat-use-system-media-libs.patch" | |
786 | ;; ,(search-patch "icecat-use-system-media-libs.patch")) | |
46ce12d0 MW |
787 | |
788 | ("patch" ,(canonical-package patch)) | |
789 | ||
ad21d767 MW |
790 | ("rust" ,rust) |
791 | ("cargo" ,rust "cargo") | |
792 | ("rust-cbindgen" ,rust-cbindgen) | |
793 | ("llvm" ,llvm) | |
794 | ("clang" ,clang) | |
e67ad553 | 795 | ("perl" ,perl) |
ad21d767 MW |
796 | ("node" ,node) |
797 | ("python" ,python) | |
798 | ("python-2" ,python-2) | |
c4c4cc05 | 799 | ("python2-pysqlite" ,python2-pysqlite) |
002c3e6d | 800 | ("yasm" ,yasm) |
ad21d767 | 801 | ("nasm" ,nasm) ; XXX FIXME: only needed on x86_64 and i686 |
bfb48f4f | 802 | ("pkg-config" ,pkg-config) |
002c3e6d | 803 | ("autoconf" ,autoconf-2.13) |
bfb48f4f | 804 | ("which" ,which))) |
be0f6112 | 805 | (arguments |
74c7af9f MW |
806 | `(#:tests? #f ; no check target |
807 | #:out-of-source? #t ; must be built outside of the source directory | |
73b1b4eb LC |
808 | |
809 | ;; XXX: There are RUNPATH issues such as | |
810 | ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so, | |
811 | ;; which is not in its RUNPATH, but they appear to be harmless in | |
812 | ;; practice somehow. See <http://hydra.gnu.org/build/378133>. | |
813 | #:validate-runpath? #f | |
814 | ||
8d956d86 | 815 | #:configure-flags `("--enable-default-toolkit=cairo-gtk3" |
9502ea3e MW |
816 | |
817 | "--with-distribution-id=org.gnu" | |
818 | ||
34369f31 MW |
819 | ;; Do not require addons in the global app |
820 | ;; directory to be signed by Mozilla. | |
821 | "--with-unsigned-addon-scopes=app" | |
822 | ||
90e1cdae MW |
823 | "--enable-startup-notification" |
824 | "--enable-pulseaudio" | |
90e1cdae | 825 | |
9502ea3e MW |
826 | "--disable-tests" |
827 | "--disable-updater" | |
828 | "--disable-crashreporter" | |
9502ea3e | 829 | "--disable-eme" |
90e1cdae | 830 | "--disable-gconf" |
e67ad553 | 831 | |
90e1cdae | 832 | ;; Building with debugging symbols takes ~5GiB, so |
1ae6df81 LC |
833 | ;; disable it. |
834 | "--disable-debug" | |
835 | "--disable-debug-symbols" | |
836 | ||
8d956d86 MW |
837 | ;; Clang is needed to build Stylo, Mozilla's new |
838 | ;; CSS engine. We must specify the clang paths | |
839 | ;; manually, because otherwise the Mozilla build | |
840 | ;; system looks in the directories returned by | |
841 | ;; llvm-config --bindir and llvm-config --libdir, | |
842 | ;; which return paths in the llvm package where | |
843 | ;; clang is not found. | |
844 | ,(string-append "--with-clang-path=" | |
845 | (assoc-ref %build-inputs "clang") | |
846 | "/bin/clang") | |
847 | ,(string-append "--with-libclang-path=" | |
848 | (assoc-ref %build-inputs "clang") | |
849 | "/lib") | |
850 | ||
5bdec7d6 MW |
851 | ;; Hack to work around missing |
852 | ;; "unofficial" branding in icecat. | |
bfb48f4f MW |
853 | "--enable-official-branding" |
854 | ||
90e1cdae | 855 | ;; Avoid bundled libraries. |
1ae6df81 | 856 | "--with-system-zlib" |
90e1cdae | 857 | "--with-system-bz2" |
7cba7647 | 858 | "--with-system-jpeg" ; must be libjpeg-turbo |
ad21d767 MW |
859 | ;; UNBUNDLE-ME! "--with-system-libevent" |
860 | ;; UNBUNDLE-ME! "--with-system-ogg" | |
861 | ;; UNBUNDLE-ME! "--with-system-vorbis" | |
862 | ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released | |
863 | ;; UNBUNDLE-ME! "--with-system-libvpx" | |
483ab08f | 864 | "--with-system-icu" |
6d328879 MW |
865 | |
866 | ;; See <https://bugs.gnu.org/32833> | |
6c83c483 MW |
867 | ;; and related comments in the |
868 | ;; 'remove-bundled-libraries' phase below. | |
6d328879 MW |
869 | ;; UNBUNDLE-ME! "--with-system-nspr" |
870 | ;; UNBUNDLE-ME! "--with-system-nss" | |
871 | ||
ad21d767 MW |
872 | ;; UNBUNDLE-ME! "--with-system-harfbuzz" |
873 | ;; UNBUNDLE-ME! "--with-system-graphite2" | |
13b284d9 | 874 | "--enable-system-pixman" |
5b17fabc | 875 | "--enable-system-ffi" |
ad21d767 | 876 | ;; UNBUNDLE-ME! "--enable-system-sqlite" |
1ae6df81 | 877 | |
98a046cd AE |
878 | ;; Fails with "--with-system-png won't work because |
879 | ;; the system's libpng doesn't have APNG support". | |
880 | ;; According to | |
881 | ;; http://sourceforge.net/projects/libpng-apng/ , | |
882 | ;; "the Animated Portable Network Graphics (APNG) | |
883 | ;; is an unofficial extension of the Portable | |
884 | ;; Network Graphics (PNG) format"; | |
885 | ;; we probably do not wish to support it. | |
1ae6df81 | 886 | ;; "--with-system-png" |
5b17fabc | 887 | ) |
1ae6df81 | 888 | |
e80a4479 | 889 | #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums' |
7d141788 | 890 | |
9f7ae77f | 891 | #:modules ((ice-9 ftw) |
6cde5c34 | 892 | (ice-9 rdelim) |
37db2370 | 893 | (ice-9 regex) |
6cde5c34 | 894 | (ice-9 match) |
ad21d767 MW |
895 | (srfi srfi-34) |
896 | (srfi srfi-35) | |
429c8284 MW |
897 | (rnrs bytevectors) |
898 | (rnrs io ports) | |
899 | (guix elf) | |
900 | (guix build gremlin) | |
9f7ae77f | 901 | ,@%gnu-build-system-modules) |
be0f6112 | 902 | #:phases |
90e1cdae | 903 | (modify-phases %standard-phases |
46ce12d0 MW |
904 | (add-after 'unpack 'apply-guix-specific-patches |
905 | (lambda* (#:key inputs native-inputs #:allow-other-keys) | |
906 | (let ((patch (string-append (assoc-ref (or native-inputs inputs) | |
907 | "patch") | |
908 | "/bin/patch"))) | |
909 | (for-each (match-lambda | |
910 | ((label . file) | |
911 | (when (and (string-prefix? "icecat-" label) | |
912 | (string-suffix? ".patch" label)) | |
913 | (format #t "applying '~a'...~%" file) | |
914 | (invoke patch "--force" "--no-backup-if-mismatch" | |
915 | "-p1" "--input" file)))) | |
916 | (or native-inputs inputs))) | |
917 | #t)) | |
918 | (add-after 'apply-guix-specific-patches 'remove-bundled-libraries | |
919 | (lambda _ | |
920 | ;; Remove bundled libraries that we don't use, since they may | |
921 | ;; contain unpatched security flaws, they waste disk space and | |
922 | ;; memory, and may cause confusion. | |
923 | (for-each (lambda (file) | |
924 | (format #t "deleting '~a'...~%" file) | |
925 | (delete-file-recursively file)) | |
926 | '(;; FIXME: Removing the bundled icu breaks configure. | |
927 | ;; * The bundled icu headers are used in some places. | |
928 | ;; * The version number is taken from the bundled copy. | |
929 | ;;"intl/icu" | |
930 | ;; | |
931 | ;; FIXME: A script from the bundled nspr is used. | |
932 | ;;"nsprpub" | |
933 | ;; | |
934 | ;; FIXME: With the update to IceCat 60, using system NSS | |
935 | ;; broke certificate validation. See | |
936 | ;; <https://bugs.gnu.org/32833>. For now, we use | |
937 | ;; the bundled NSPR and NSS. TODO: Investigate, | |
938 | ;; and try to unbundle these libraries again. | |
939 | ;; UNBUNDLE-ME! "security/nss" | |
940 | ;; | |
941 | ;; TODO: Use more system media libraries. See: | |
942 | ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422> | |
943 | ;; * libtheora: esr60 wants v1.2, not yet released. | |
944 | ;; * soundtouch: avoiding the bundled library would | |
945 | ;; result in some loss of functionality. There's | |
946 | ;; also an issue with exception handling | |
947 | ;; configuration. It seems that this is needed in | |
948 | ;; some moz.build: | |
949 | ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1 | |
950 | ;; * libopus | |
951 | ;; * speex | |
952 | ;; | |
953 | "modules/freetype2" | |
954 | "modules/zlib" | |
ad21d767 MW |
955 | ;; "media/libjpeg" ; needed for now, because media/libjpeg/moz.build is referenced from config/external/moz.build |
956 | ;; UNBUNDLE-ME! "ipc/chromium/src/third_party/libevent" | |
957 | ;; UNBUNDLE-ME! "media/libvpx" | |
958 | ;; UNBUNDLE-ME! "media/libogg" | |
959 | ;; UNBUNDLE-ME! "media/libvorbis" | |
960 | ;; UNBUNDLE-ME! "media/libtheora" ; wants theora-1.2, not yet released | |
961 | ;; UNBUNDLE-ME! "media/libtremor" | |
962 | ;; UNBUNDLE-ME! "gfx/harfbuzz" | |
963 | ;; UNBUNDLE-ME! "gfx/graphite2" | |
46ce12d0 | 964 | "js/src/ctypes/libffi" |
ad21d767 MW |
965 | ;; UNBUNDLE-ME! "db/sqlite3" |
966 | )) | |
46ce12d0 MW |
967 | #t)) |
968 | (add-after 'remove-bundled-libraries 'link-libxul-with-libraries | |
969 | (lambda _ | |
970 | ;; libxul.so dynamically opens libraries, so here we explicitly | |
971 | ;; link them into libxul.so instead. | |
972 | ;; | |
973 | ;; TODO: It might be preferable to patch in absolute file names in | |
974 | ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to | |
975 | ;; work. More investigation is needed. | |
976 | (substitute* "toolkit/library/moz.build" | |
977 | (("^# This library needs to be last" all) | |
978 | (string-append "OS_LIBS += [ | |
9f7ae77f | 979 | 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5', |
002c3e6d | 980 | 'avcodec', 'avutil', 'pulse' ]\n\n" |
46ce12d0 MW |
981 | all))) |
982 | #t)) | |
8e556719 JL |
983 | (add-after 'link-libxul-with-libraries 'fix-ffmpeg-runtime-linker |
984 | (lambda* (#:key inputs #:allow-other-keys) | |
429c8284 MW |
985 | (let* ((ffmpeg (assoc-ref inputs "ffmpeg")) |
986 | (libavcodec (string-append ffmpeg "/lib/libavcodec.so"))) | |
987 | ;; Arrange to load libavcodec.so by its absolute file name. | |
988 | (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp" | |
989 | (("libavcodec\\.so") | |
990 | libavcodec)) | |
991 | ;; Populate the sandbox read-path whitelist as needed by ffmpeg. | |
992 | (let* ((mime-info (assoc-ref inputs "shared-mime-info")) | |
993 | (libavcodec-runpath (call-with-input-file libavcodec | |
994 | (compose elf-dynamic-info-runpath | |
995 | elf-dynamic-info | |
996 | parse-elf | |
997 | get-bytevector-all))) | |
998 | (whitelist (cons (string-append mime-info "/share/mime/") | |
999 | (map (lambda (dir) | |
1000 | (string-append dir "/")) | |
1001 | libavcodec-runpath))) | |
1002 | (whitelist-string (string-join whitelist ",")) | |
1003 | (port (open-file "browser/app/profile/icecat.js" "a"))) | |
1004 | (format #t "setting 'security.sandbox.content.read_path_whitelist' to '~a'~%" | |
1005 | whitelist-string) | |
1006 | (format port "~%pref(\"security.sandbox.content.read_path_whitelist\", ~S);~%" | |
1007 | whitelist-string) | |
1008 | (close-output-port port)) | |
1009 | #t))) | |
94e96f7f MW |
1010 | (replace 'bootstrap |
1011 | (lambda _ | |
46ce12d0 MW |
1012 | (invoke "sh" "-c" "autoconf old-configure.in > old-configure") |
1013 | ;; 'configure' must be newer than 'old-configure.in', or else the | |
1014 | ;; build system will raise an alarm and abort. | |
1015 | (invoke "touch" "configure"))) | |
e67ad553 | 1016 | (add-after 'patch-source-shebangs 'patch-cargo-checksums |
257e3247 | 1017 | (lambda _ |
7d141788 | 1018 | (use-modules (guix build cargo-utils)) |
e88735b4 | 1019 | (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")) |
ad21d767 | 1020 | (substitute* '("Cargo.lock" "gfx/wr/Cargo.lock") |
e67ad553 MW |
1021 | (("(\"checksum .* = )\".*\"" all name) |
1022 | (string-append name "\"" null-hash "\""))) | |
e80a4479 | 1023 | (generate-all-checksums "third_party/rust")) |
e67ad553 | 1024 | #t)) |
46ce12d0 MW |
1025 | (replace 'configure |
1026 | ;; configure does not work followed by both "SHELL=..." and | |
1027 | ;; "CONFIG_SHELL=..."; set environment variables instead | |
1028 | (lambda* (#:key outputs configure-flags #:allow-other-keys) | |
1029 | (let* ((out (assoc-ref outputs "out")) | |
1030 | (bash (which "bash")) | |
1031 | (abs-srcdir (getcwd)) | |
1032 | (srcdir (string-append "../" (basename abs-srcdir))) | |
1033 | (flags `(,(string-append "--prefix=" out) | |
1034 | ,(string-append "--with-l10n-base=" | |
1035 | abs-srcdir "/l10n") | |
1036 | ,@configure-flags))) | |
1037 | (setenv "SHELL" bash) | |
1038 | (setenv "CONFIG_SHELL" bash) | |
1039 | (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13 | |
1040 | (setenv "CC" "gcc") ; apparently needed when Stylo is enabled | |
7a1b2ba5 | 1041 | (setenv "MOZ_BUILD_DATE" ,%icecat-build-id) ; avoid timestamp |
46ce12d0 MW |
1042 | (mkdir "../build") |
1043 | (chdir "../build") | |
1044 | (format #t "build directory: ~s~%" (getcwd)) | |
1045 | (format #t "configure flags: ~s~%" flags) | |
1046 | (apply invoke bash | |
1047 | (string-append srcdir "/configure") | |
1048 | flags)))) | |
ad21d767 MW |
1049 | (replace 'build |
1050 | ;; The build system often spuriously fails. See | |
1051 | ;; <https://bugs.gentoo.org/show_bug.cgi?id=680934>. To | |
1052 | ;; work around this, we try the standard 'build' phase up | |
1053 | ;; to 5 times. | |
1054 | (lambda args | |
1055 | (let ((build (assoc-ref %standard-phases 'build))) | |
1056 | (let retry ((remaining-attempts 5)) | |
1057 | (if (= remaining-attempts 1) | |
1058 | (apply build args) | |
1059 | (guard (c ((invoke-error? c) | |
1060 | (format #t "~%Retrying build! (~a attempts remaining)~%~%" | |
1061 | (- remaining-attempts 1)) | |
1062 | (force-output) | |
1063 | (retry (- remaining-attempts 1)))) | |
1064 | (apply build args))))))) | |
37db2370 JK |
1065 | (add-after 'build 'neutralise-store-references |
1066 | (lambda _ | |
1067 | ;; Mangle the store references to compilers & other build tools in | |
1068 | ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64. | |
1069 | (substitute* | |
1070 | "dist/bin/chrome/toolkit/content/global/buildconfig.html" | |
1071 | (((format #f "(~a/)([0-9a-df-np-sv-z]{32})" | |
1072 | (regexp-quote (%store-directory))) | |
1073 | _ store hash) | |
1074 | (string-append store | |
1075 | (string-take hash 8) | |
1076 | "<!-- Guix: not a runtime dependency -->" | |
1077 | (string-drop hash 8)))) | |
1078 | #t)) | |
6cde5c34 LC |
1079 | (add-before 'configure 'install-desktop-entry |
1080 | (lambda* (#:key outputs #:allow-other-keys) | |
1081 | ;; Install the '.desktop' file. | |
05947d92 MW |
1082 | (let* ((desktop-file "taskcluster/docker/icecat-snap/icecat.desktop") |
1083 | (out (assoc-ref outputs "out")) | |
6cde5c34 | 1084 | (applications (string-append out "/share/applications"))) |
05947d92 MW |
1085 | (substitute* desktop-file |
1086 | (("^Exec=icecat") (string-append "Exec=" out "/bin/icecat")) | |
1087 | (("IceCat") "GNU IceCat") | |
1088 | (("Icon=.*") "Icon=icecat\n") | |
1089 | (("NewWindow") "new-window") | |
1090 | (("NewPrivateWindow") "new-private-window")) | |
1091 | (install-file desktop-file applications) | |
88a8ce87 AG |
1092 | #t))) |
1093 | (add-after 'install-desktop-entry 'install-icons | |
1094 | (lambda* (#:key outputs #:allow-other-keys) | |
1095 | (let ((out (assoc-ref outputs "out"))) | |
1096 | (with-directory-excursion "browser/branding/official" | |
1097 | (for-each | |
1098 | (lambda (file) | |
1099 | (let* ((size (string-filter char-numeric? file)) | |
1100 | (icons (string-append out "/share/icons/hicolor/" | |
1101 | size "x" size "/apps"))) | |
1102 | (mkdir-p icons) | |
1103 | (copy-file file (string-append icons "/icecat.png")))) | |
1104 | '("default16.png" "default22.png" "default24.png" | |
1105 | "default32.png" "default48.png" "content/icon64.png" | |
3f27124e MW |
1106 | "mozicon128.png" "default256.png")) |
1107 | #t)))) | |
6e75740f CL |
1108 | ;; This fixes the file chooser crash that happens with GTK 3. |
1109 | (add-after 'install 'wrap-program | |
1110 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1111 | (let* ((out (assoc-ref outputs "out")) | |
1112 | (lib (string-append out "/lib")) | |
1113 | (gtk (assoc-ref inputs "gtk+")) | |
ad21d767 | 1114 | (gtk-share (string-append gtk "/share")) |
9c6ea3cb EZ |
1115 | (mesa (assoc-ref inputs "mesa")) |
1116 | (mesa-lib (string-append mesa "/lib")) | |
ad21d767 | 1117 | (pulseaudio (assoc-ref inputs "pulseaudio")) |
f11d4290 IK |
1118 | (pulseaudio-lib (string-append pulseaudio "/lib")) |
1119 | (libxscrnsaver (assoc-ref inputs "libxscrnsaver")) | |
1120 | (libxscrnsaver-lib (string-append libxscrnsaver "/lib"))) | |
6e75740f | 1121 | (wrap-program (car (find-files lib "^icecat$")) |
ad21d767 | 1122 | `("XDG_DATA_DIRS" prefix (,gtk-share)) |
f11d4290 | 1123 | `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib ,mesa-lib ,libxscrnsaver-lib))) |
3f27124e | 1124 | #t)))))) |
6fd52309 | 1125 | (home-page "https://www.gnu.org/software/gnuzilla/") |
be0f6112 AE |
1126 | (synopsis "Entirely free browser derived from Mozilla Firefox") |
1127 | (description | |
1128 | "IceCat is the GNU version of the Firefox browser. It is entirely free | |
c5779c93 | 1129 | software, which does not recommend non-free plugins and addons. It also |
ad21d767 MW |
1130 | features built-in privacy-protecting features. |
1131 | ||
1132 | WARNING: IceCat 68 has not yet been released by the upstream IceCat project. | |
1133 | This is a preview release, and does not currently meet the privacy-respecting | |
1134 | standards of the IceCat project.") | |
63e8bb12 | 1135 | (license license:mpl2.0) ;and others, see toolkit/content/license.html |
99effc8f LC |
1136 | (properties |
1137 | `((ftp-directory . "/gnu/gnuzilla") | |
1138 | (cpe-name . "firefox_esr") | |
bfb48f4f | 1139 | (cpe-version . ,(first (string-split version #\-))))))) |
f5301f00 | 1140 | |
b14aab67 | 1141 | ;; Update this together with icecat! |
cb3bb849 | 1142 | (define %icedove-build-id "20200825000000") ;must be of the form YYYYMMDDhhmmss |
b14aab67 JB |
1143 | (define-public icedove |
1144 | (package | |
1145 | (name "icedove") | |
cb3bb849 | 1146 | (version "68.12.0") |
b14aab67 JB |
1147 | (source icecat-source) |
1148 | (properties | |
1149 | `((cpe-name . "thunderbird_esr"))) | |
1150 | (build-system gnu-build-system) | |
1151 | (arguments | |
1152 | `(#:tests? #f ; no check target | |
1153 | #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums' | |
1154 | #:modules ((guix build utils) ;find-files | |
1155 | (sxml simple) | |
1156 | (ice-9 regex) | |
1157 | ,@%gnu-build-system-modules) | |
1158 | #:phases | |
1159 | (modify-phases %standard-phases | |
1160 | (add-after 'unpack 'prepare-thunderbird-sources | |
1161 | (lambda* (#:key inputs #:allow-other-keys) | |
1162 | (mkdir "comm") | |
1163 | (copy-recursively (assoc-ref inputs "thunderbird-sources") | |
1164 | "comm") | |
1165 | (delete-file-recursively "obj-x86_64-pc-linux-gnu") | |
1166 | (delete-file "sourcestamp.txt") | |
1167 | #t)) | |
1168 | (add-after 'patch-source-shebangs 'patch-cargo-checksums | |
1169 | (lambda _ | |
1170 | (use-modules (guix build cargo-utils)) | |
1171 | (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")) | |
1172 | (substitute* '("Cargo.lock" "gfx/wr/Cargo.lock") | |
1173 | (("(\"checksum .* = )\".*\"" all name) | |
1174 | (string-append name "\"" null-hash "\""))) | |
1175 | (generate-all-checksums "third_party/rust")) | |
1176 | #t)) | |
1177 | ;; Fixes issue where each installation directory generates its own profile. | |
1178 | ;; See e.g. https://trac.torproject.org/projects/tor/ticket/31457 | |
1179 | (add-after 'patch-source-shebangs 'fix-profile-setting | |
1180 | (lambda _ | |
1181 | (substitute* "comm/mail/moz.configure" | |
1182 | (("'MOZ_DEDICATED_PROFILES', True") | |
1183 | "'MOZ_DEDICATED_PROFILES', False")) | |
1184 | #t)) | |
1185 | (add-after 'prepare-thunderbird-sources 'rename-to-icedove | |
1186 | (lambda _ | |
1187 | (substitute* "comm/mail/confvars.sh" | |
1188 | (("MOZ_APP_BASENAME=Thunderbird") | |
1189 | "MOZ_APP_BASENAME=Icedove\nMOZ_APP_DISPLAYNAME=Icedove") | |
1190 | (("MOZ_APP_NAME=thunderbird") | |
1191 | "MOZ_APP_NAME=icedove") | |
1192 | (("MOZ_UPDATER=1") | |
1193 | "MOZ_UPDATER=0")) | |
1194 | ;; Remove branding to comply with Mozilla's trademark policy | |
1195 | (with-directory-excursion "comm/mail/branding/nightly" | |
1196 | (delete-file "content/about-wordmark.svg") | |
1197 | (call-with-output-file "content/about-wordmark.svg" | |
1198 | (lambda (port) | |
1199 | (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg") | |
1200 | (viewBox "0 0 789.1 90.78") | |
1201 | (width "333") | |
1202 | (height "48") | |
1203 | (fill "#fff")) | |
1204 | (text (@ (x "400") (y "70") | |
1205 | (text-anchor "middle") | |
1206 | (font-size "90")) | |
1207 | "Icedove Daily")) | |
1208 | port))) | |
1209 | (substitute* '("locales/en-US/brand.properties" | |
1210 | "locales/en-US/brand.ftl" | |
1211 | "locales/en-US/brand.dtd" | |
1212 | "configure.sh") | |
1213 | (("Thunderbird") "Icedove") | |
1214 | (("mozilla.org") "guix.gnu.org"))) | |
1215 | ;; Remove other mentions of Thunderbird in user-visible text. | |
1216 | (with-directory-excursion "comm/mail/base/content" | |
1217 | (substitute* '("newInstallPage.xhtml" | |
1218 | "overrides/app-license-name.html" | |
1219 | "newInstall.xul") | |
1220 | (("Thunderbird") "Icedove"))) | |
1221 | (with-directory-excursion "comm/mail/components/" | |
1222 | (substitute* '("mailGlue.js" | |
1223 | "extensions/schemas/addressBook.json" | |
1224 | "extensions/schemas/tabs.json" | |
1225 | "extensions/schemas/cloudFile.json" | |
1226 | "extensions/schemas/chrome_settings_overrides.json" | |
1227 | "extensions/schemas/windows.json" | |
1228 | "extensions/parent/ext-mail.js" | |
1229 | "im/messages/mail/Info.plist" | |
1230 | "enterprisepolicies/moz.build" | |
1231 | "enterprisepolicies/helpers/moz.build" | |
1232 | "enterprisepolicies/schemas/moz.build" | |
1233 | "preferences/chat.inc.xul") | |
1234 | (("Thunderbird") "Icedove"))) | |
1235 | (substitute* "comm/calendar/lightning/lightning-packager.mk" | |
1236 | (("ifeq \\(thunderbird") | |
1237 | "ifeq (icedove")) | |
1238 | (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js" | |
1239 | "comm/mailnews/extensions/newsblog/content/feed-subscriptions.js" | |
1240 | "comm/common/src/customizeToolbar.js") | |
1241 | (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e) | |
1242 | (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e))) | |
1243 | ||
1244 | ;; Override addon URLs and settings | |
1245 | (substitute* "comm/mail/app/profile/all-thunderbird.js" | |
1246 | (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m) | |
1247 | (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");")) | |
1248 | (("(pref\\(\"extensions.getAddons.search.url\").*" _ m) | |
1249 | (string-append m ", \"https://guix.gnu.org/packages\");")) | |
1250 | (("(pref\\(\"extensions.update.enabled\").*" _ m) | |
1251 | (string-append m ", false);")) | |
1252 | (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m) | |
1253 | (string-append m ", false);")) | |
1254 | (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m) | |
1255 | (string-append m ", false);"))) | |
1256 | #t)) | |
1257 | (add-after 'build 'neutralize-store-references | |
1258 | (lambda _ | |
1259 | ;; Mangle the store references to compilers & other build tools in | |
1260 | ;; about:buildconfig, reducing Icedove's closure significant. | |
1261 | ;; The resulting files are saved in lib/thunderbird/omni.ja | |
1262 | (substitute* | |
1263 | ;; Use find because the path "obj-x86_64-pc-linux-gnu" contains | |
1264 | ;; the architecture and the system -> more complicated. | |
1265 | (find-files "." "buildconfig.html") | |
1266 | (((format #f "(~a/)([0-9a-df-np-sv-z]{32})" | |
1267 | (regexp-quote (%store-directory))) | |
1268 | _ store hash) | |
1269 | (string-append store | |
1270 | (string-take hash 8) | |
1271 | "<!-- Guix: not a runtime dependency -->" | |
1272 | (string-drop hash 8)))) | |
1273 | #t)) | |
1274 | (replace 'configure | |
1275 | (lambda* (#:key inputs outputs configure-flags #:allow-other-keys) | |
1276 | (let* ((out (assoc-ref outputs "out")) | |
1277 | (bash (which "bash")) | |
1278 | (abs-srcdir (getcwd)) | |
1279 | (srcdir (string-append "../" (basename abs-srcdir))) | |
1280 | (flags `(,(string-append "--prefix=" out) | |
1281 | ,@configure-flags)) | |
1282 | (mozconfig (string-append (getcwd) "/.mozconfig"))) | |
1283 | (setenv "SHELL" bash) | |
1284 | (setenv "AUTOCONF" | |
1285 | (string-append (assoc-ref %build-inputs | |
1286 | "autoconf") | |
1287 | "/bin/autoconf")) | |
1288 | (setenv "CONFIG_SHELL" bash) | |
1289 | (setenv "QA_CONFIGURE_OPTIONS" ".*") | |
1290 | (setenv "MOZBUILD_STATE_PATH" | |
1291 | (string-append (getcwd) "/mach_state")) | |
1292 | (setenv "MOZCONFIG" | |
1293 | (string-append (getcwd) "/.mozconfig")) | |
1294 | (setenv "CC" "gcc") | |
1295 | (setenv "MOZ_NOSPAM" "1") | |
1296 | (setenv "PYTHON" | |
1297 | (string-append (assoc-ref inputs "python2") | |
1298 | "/bin/python")) | |
1299 | (setenv "MOZ_BUILD_DATE" ,%icedove-build-id) ; avoid timestamp | |
1300 | (setenv "LDFLAGS" (string-append "-Wl,-rpath=" | |
1301 | (assoc-ref outputs "out") | |
1302 | "/lib/icedove")) | |
1303 | (mkdir-p (string-append (getcwd) "/builddir")) | |
1304 | (with-output-to-file mozconfig | |
1305 | (lambda () | |
1306 | (display | |
1307 | (string-append | |
1308 | "ac_add_options --disable-crashreporter\n" | |
1309 | "ac_add_options --disable-debug\n" | |
1310 | "ac_add_options --disable-debug-symbols\n" | |
1311 | "ac_add_options --disable-elf-hack\n" | |
1312 | "ac_add_options --disable-gconf\n" | |
1313 | "ac_add_options --disable-ion\n" | |
1314 | "ac_add_options --disable-necko-wifi\n" | |
1315 | "ac_add_options --disable-official-branding\n" | |
1316 | "ac_add_options --disable-tests\n" | |
1317 | "ac_add_options --disable-updater\n" | |
1318 | "ac_add_options --disable-webrtc\n" | |
1319 | "ac_add_options --enable-application=comm/mail\n" | |
1320 | "ac_add_options --enable-calendar\n" | |
1321 | "ac_add_options --enable-content-sandbox\n" | |
1322 | "ac_add_options --enable-default-toolkit=\"cairo-gtk3\"\n" | |
1323 | "ac_add_options --enable-optimize\n" | |
1324 | "ac_add_options --enable-pulseaudio\n" | |
1325 | "ac_add_options --enable-release\n" | |
1326 | "ac_add_options --enable-startup-notification\n" | |
1327 | "ac_add_options --enable-strip\n" | |
1328 | "ac_add_options --enable-system-ffi\n" | |
1329 | "ac_add_options --enable-system-pixman\n" | |
1330 | "ac_add_options --enable-system-sqlite\n" | |
1331 | "ac_add_options --prefix=" out "\n" | |
1332 | "ac_add_options --with-clang-path=" (assoc-ref %build-inputs "clang") "/bin/clang\n" | |
1333 | "ac_add_options --with-distribution-id=org.gnu\n" | |
1334 | "ac_add_options --with-libclang-path=" (assoc-ref %build-inputs "clang") "/lib\n" | |
1335 | "ac_add_options --with-system-bz2\n" | |
1336 | "ac_add_options --with-system-icu\n" | |
1337 | "ac_add_options --with-system-jpeg\n" | |
1338 | "ac_add_options --with-system-libevent\n" | |
1339 | "ac_add_options --with-system-nspr\n" | |
1340 | "ac_add_options --with-system-nss\n" | |
1341 | "ac_add_options --with-system-zlib\n" | |
1342 | "ac_add_options --with-user-appdir=\\.icedove\n")))) | |
1343 | (display (getcwd)) | |
1344 | (newline) | |
1345 | (display "mach configure") | |
1346 | (invoke "./mach" "configure")))) | |
1347 | (replace 'build | |
1348 | (lambda _ (invoke "./mach" "build"))) | |
1349 | (replace 'install | |
1350 | (lambda _ (invoke "./mach" "install"))) | |
964ba656 JB |
1351 | ;; Thunderbird doesn't provide any .desktop file. |
1352 | ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1637575 | |
1353 | (add-after 'install 'install-desktop-file | |
1354 | (lambda* (#:key outputs #:allow-other-keys) | |
1355 | (let* ((out (assoc-ref outputs "out")) | |
1356 | (apps (string-append out "/share/applications"))) | |
1357 | (mkdir-p apps) | |
1358 | (with-output-to-file (string-append apps "/icedove.desktop") | |
1359 | (lambda _ | |
1360 | (format #t | |
1361 | "[Desktop Entry]~@ | |
1362 | Name=Icedove~@ | |
1363 | Exec=~a/bin/icedove~@ | |
1364 | Icon=icedove~@ | |
1365 | GenericName=Mail/News Client~@ | |
1366 | Categories=Network;Email;~@ | |
1367 | Terminal=false~@ | |
1368 | StartupNotify=true~@ | |
1369 | MimeType=x-scheme-handler/mailto;~@ | |
1370 | Type=Application~@ | |
1371 | Actions=ComposeMessage;~@ | |
1372 | [Desktop Action ComposeMessage]~@ | |
1373 | Name=Write new message~@ | |
1374 | Exec=~@*~a/bin/icedove -compose~%" | |
1375 | out)))) | |
1376 | #t)) | |
b14aab67 JB |
1377 | (add-after 'install 'wrap-program |
1378 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1379 | (let* ((out (assoc-ref outputs "out")) | |
1380 | (lib (string-append out "/lib")) | |
1381 | (gtk (assoc-ref inputs "gtk+")) | |
1382 | (gtk-share (string-append gtk "/share")) | |
1383 | (pulseaudio (assoc-ref inputs "pulseaudio")) | |
1384 | (pulseaudio-lib (string-append pulseaudio "/lib"))) | |
1385 | (wrap-program (car (find-files lib "^icedove$")) | |
1386 | `("XDG_DATA_DIRS" prefix (,gtk-share)) | |
1387 | `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib))) | |
1388 | #t)))))) | |
1389 | (inputs | |
1390 | `(("bzip2" ,bzip2) | |
1391 | ("cairo" ,cairo) | |
1392 | ("cups" ,cups) | |
1393 | ("dbus-glib" ,dbus-glib) | |
1394 | ("ffmpeg" ,ffmpeg) | |
1395 | ("freetype" ,freetype) | |
1396 | ("gdk-pixbuf" ,gdk-pixbuf) | |
1397 | ("glib" ,glib) | |
1398 | ("gtk+" ,gtk+) | |
1399 | ("gtk+-2" ,gtk+-2) | |
1400 | ("hunspell" ,hunspell) | |
1401 | ("icu4c" ,icu4c) | |
1402 | ("libcanberra" ,libcanberra) | |
1403 | ("libevent" ,libevent) | |
1404 | ("libffi" ,libffi) | |
1405 | ("libgnome" ,libgnome) | |
1406 | ("libjpeg-turbo" ,libjpeg-turbo) | |
1407 | ("libpng-apng" ,libpng-apng) | |
1408 | ("libvpx" ,libvpx) | |
1409 | ("libxcomposite" ,libxcomposite) | |
1410 | ("libxft" ,libxft) | |
1411 | ("libxinerama" ,libxinerama) | |
1412 | ("libxscrnsaver" ,libxscrnsaver) | |
1413 | ("libxt" ,libxt) | |
1414 | ("mesa" ,mesa) | |
1415 | ("mit-krb5" ,mit-krb5) | |
1416 | ("nspr" ,nspr) | |
1417 | ("nss" ,nss) | |
1418 | ("pango" ,pango) | |
1419 | ("pixman" ,pixman) | |
1420 | ("pulseaudio" ,pulseaudio) | |
1421 | ("sqlite" ,sqlite) | |
1422 | ("startup-notification" ,startup-notification) | |
1423 | ("unzip" ,unzip) | |
1424 | ("zip" ,zip) | |
1425 | ("zlib" ,zlib))) | |
1426 | (native-inputs | |
1427 | `(("thunderbird-sources" | |
1428 | ;; The changeset identifier is taken from the file "sourcestamp.txt" | |
1429 | ;; in the Thunderbird release tarball. We don't use the release | |
1430 | ;; tarball because it duplicates the Icecat sources and only adds the | |
1431 | ;; "comm" directory, which is provided by this repository. | |
cb3bb849 | 1432 | ,(let ((changeset "b41cdff70b185358d9c4c1d4a36cfad15a24f001")) |
b14aab67 JB |
1433 | (origin |
1434 | (method hg-fetch) | |
1435 | (uri (hg-reference | |
1436 | (url "https://hg.mozilla.org/releases/comm-esr68") | |
1437 | (changeset changeset))) | |
1438 | (file-name (string-append "thunderbird-" version "-checkout")) | |
1439 | (sha256 | |
1440 | (base32 | |
cb3bb849 | 1441 | "1xvky8p5r41mxdyg9amydy94p51wmmdwdz0zq2vzspr9viixf7xm"))))) |
b14aab67 JB |
1442 | ("autoconf" ,autoconf-2.13) |
1443 | ("cargo" ,rust "cargo") | |
1444 | ("clang" ,clang) | |
1445 | ("llvm" ,llvm) | |
1446 | ("nasm" ,nasm) | |
1447 | ("node" ,node) | |
1448 | ("perl" ,perl) | |
1449 | ("pkg-config" ,pkg-config) | |
1450 | ("python" ,python) | |
1451 | ("python2" ,python-2.7) | |
1452 | ("rust" ,rust) | |
1453 | ("rust-cbindgen" ,rust-cbindgen) | |
1454 | ("which" ,which) | |
1455 | ("yasm" ,yasm))) | |
1456 | (home-page "https://www.thunderbird.net") | |
1457 | (synopsis "Rebranded Mozilla Thunderbird email client") | |
1458 | (description | |
1459 | "This package provides an email client built based on Mozilla | |
1460 | Thunderbird. It supports email, news feeds, chat, calendar and contacts.") | |
1461 | (license license:mpl2.0))) | |
1462 | ||
167a0ce0 OP |
1463 | (define-public firefox-decrypt |
1464 | (package | |
1465 | (name "firefox-decrypt") | |
1466 | (version "0.7.0") | |
1467 | (source (origin | |
1468 | (method git-fetch) | |
1469 | (uri (git-reference | |
b0e7b699 | 1470 | (url "https://github.com/Unode/firefox_decrypt") |
167a0ce0 OP |
1471 | (commit version))) |
1472 | (file-name (git-file-name name version)) | |
1473 | (sha256 | |
1474 | (base32 | |
1475 | "17yyyxp47z4m8hnflcq34rc1y871515kr3f1y42j1l0yx3g0il07")))) | |
1476 | (build-system trivial-build-system) | |
1477 | (inputs | |
1478 | `(("nss" ,nss) | |
1479 | ("python" ,python))) | |
1480 | (arguments | |
1481 | `(#:modules ((guix build utils)) | |
1482 | #:builder | |
1483 | (begin | |
1484 | (use-modules (guix build utils)) | |
1485 | (setenv "PATH" | |
1486 | (string-append | |
1487 | (assoc-ref %build-inputs "python") "/bin")) | |
1488 | (copy-file (string-append (assoc-ref %build-inputs "source") | |
1489 | "/firefox_decrypt.py") | |
1490 | "firefox_decrypt.py") | |
1491 | (substitute* "firefox_decrypt.py" | |
1492 | (("/usr/bin/env python") (which "python3")) | |
1493 | (("libnss3.so") (string-append (assoc-ref %build-inputs "nss") | |
1494 | "/lib/nss/libnss3.so"))) | |
1495 | (install-file "firefox_decrypt.py" (string-append %output "/bin")) | |
1496 | #t))) | |
1497 | (home-page "https://github.com/Unode/firefox_decrypt/") | |
1498 | (synopsis "Tool to extract passwords from Mozilla profiles") | |
1499 | (description "Firefox Decrypt is a tool to extract passwords from | |
1500 | Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.") | |
1501 | (license license:gpl3+))) |