Commit | Line | Data |
---|---|---|
be0f6112 | 1 | ;;; GNU Guix --- Functional package management for GNU |
5deea4fc | 2 | ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> |
27913a6d | 3 | ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 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/") | |
c7011ff8 | 421 | (changeset "RELEASE_8_0_0"))) |
ad21d767 | 422 | (file-name "mozilla-compare-locales") |
c7011ff8 | 423 | (sha256 (base32 "0052wq92sg4i776x407b5838jx9h3phl9xy69m2q34f31n3gdyk2")))) |
ad21d767 MW |
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 | ;;--------------------------------------------------------------------------- | |
c7011ff8 MW |
443 | ("1q1p7nl97478hkf1msbbcdh98k6fn87xwqihbw8np00ll5gk9k4v" "97cf3c155484" "ach") |
444 | ("0sajpblp639l448xywx7xlybjr5dm0rfrzx511a8pa9wn7dma4mf" "46929b4dda4e" "af") | |
445 | ("04s756aaf1yyli1dn1vfdjymgyjs1pz2n7jvz76j27x4nzdgss7l" "96ffd2b04ba3" "an") | |
446 | ("16nw7slm7irsnjf81r6zl273kbzri8sdbimzgzxwm0vh6xr61rgs" "1c4231166ddf" "ar") | |
447 | ("0i0qrj4j8zjv55cisbmr21dp8mz933hc9wkpn3abz5k5pn84gpry" "bc4384b8be78" "ast") | |
448 | ("1r77mmwg9x1jfa7g5lqa31rgyfrnix1zj80ibn5rq9gyhhsdrwbd" "dd56aead51fa" "az") | |
449 | ("1kzjpy5bnvps8di72ksynhbhc9bpw1ml6hvphm74z8dz55ai4c18" "9d2bff64ddfb" "be") | |
450 | ("1fygvjgph3siknfm7l0fh9y4ava72z1rxkip1zgmcdgq7jz8wzpf" "3808f4fe4db6" "bg") | |
451 | ("1x9nlqia441xh04rhkmkw6qrgpwnyqw0grrf5n2qw96939wnmgl7" "5ca8752ed8df" "bn") | |
452 | ("18yyxqzab44bgqx7h052d5nxyhv0l5bidgr16z1b3ak2crsfyx9q" "4c5d30ca9bf2" "br") | |
453 | ("11bschjz7pgsm4r1qan5l4s3nkzm5jb0kivpp186wd1xsjci5bjb" "cf2478a7eae1" "bs") | |
454 | ("12bak64nl6qi092l55xv330vh38mfsicrrf4wi693nn7zqb3mbpw" "4aa2cc349211" "ca") | |
455 | ("0p97d7pnxqs971rr5c57i6cw3mx1mp3iasa0xdmdk0zpz9pjd3s4" "806914072144" "ca-valencia") | |
456 | ("1rligf98h9r16mw3r3n5jalzi74xn2dnh6hkiixp7s2bvhjicwa4" "db2163383129" "cak") | |
457 | ("18y5j8ljh72mj2nbx0m64mi3fyjbwyx992i004sv3zvs4d4z18w4" "d1d09eedddde" "cs") | |
458 | ("12i4m9q6f8sl8arm8ja4gs4sl9m59p3kddlqi68srpz9mk66rqxz" "1caf58c64227" "cy") | |
459 | ("16wacsd23zd4j0yi6vbj033wylia8hlpswx949x5hy1h9817j4vn" "9ef3b56aa243" "da") | |
460 | ("1ddxnqpfi1wnciwmzkvvjinb51h22bg70r0dn7db17q64p4271rk" "a050b0eaec0a" "de") | |
461 | ("0gw5h52rw3bc2lwffnv845sjwwj22gmabchmpa1rw2y6087dc7zk" "613135cb0759" "dsb") | |
462 | ("0v17da37w1kbs73i6xql4c9xng6rfachyylpy3w8hpibpvi7i30n" "903db7c76b31" "el") | |
463 | ("0ky1nj4kp070nriw0igsa64l39plcv2365zl8lqpbydyp6clwc3m" "6bb74673e9aa" "en-CA") | |
464 | ("15jck6si2l4h5lrs8zjx56y97p70njpi26nnq6xfmvj1dk5qb4g2" "c06bd83a9295" "en-GB") | |
465 | ("1gc400n8j8qk70vdw7fkf4m9yviia35cmj6361pxnyvsjrgm4qvm" "ae0fda5114c4" "eo") | |
466 | ("0y01lahdrd3krsh6nrr3iw36r2x4advh5qw54vf92w11l3aiyvfz" "0c294dc9ce40" "es-AR") | |
467 | ("16jjbsfa62dxk36ccziv7nmh26c1s0b05960in6zs5nnfrv4yh35" "7c30b2981fb4" "es-CL") | |
468 | ("0qh8c8f8dsv1v56n1mcpn84l39bpnqfl8v8iacq12zh322srr549" "ad1444f4f833" "es-ES") | |
469 | ("1vh3hm5r4ch6mk3ymbk12b9rppwc75fmbi0i7cml82kxsi77bzw5" "0a26cdb23536" "es-MX") | |
470 | ("159l92jxx48lgba1g8ig3mdzhwsf3jpg3nx1g9blq4majk5hqr6q" "65a38a830795" "et") | |
471 | ("1ha8y1wbgb66dqm26x1q2xwygy7bblkjz40y9vh5d2qlpr3fn0av" "21e0930b221d" "eu") | |
472 | ("0rq4pcw6klm0bbljm1wdfvna8bpa35cm47hh2s63i2xdax4scahf" "5a4bb020cf09" "fa") | |
473 | ("1py2594gsvpgrxnplz278ffb7grsf384kzjskrl1zyps0jw8fb1x" "4a4f712cd4aa" "ff") | |
474 | ("1dyd55ngsglp1w2gh0yaacwb0vsq23gdvnj76f2x6g39h1li9s0z" "9c51cd915e2b" "fi") | |
475 | ("0kimwivpq6pr63jh1k9fszsv8bi8vns3scg76mmnvbhh2ca8q7wj" "4f9e24a696ee" "fr") | |
476 | ("1sbbnnp12lgy5qan2kix02942830b1969bd7jxrv7piwqfch9i06" "9e21a0eeb5b1" "fy-NL") | |
477 | ("0dsvvyfrzkx5h44gqgdci7arb8h4lq48w20cnr8fc7j17grvnkzz" "999a995bc09d" "ga-IE") | |
478 | ("1487msbsgrfzmyijhf6a4wbqdjpd7b7ki9nwrjjjjlnbw0h0ljpb" "6a9ddcab3240" "gd") | |
479 | ("1kzc4fwr18kgisdzba2acj1ag8mxbifqpk5p30jv68nmvqfsvl8d" "51eb5e352db9" "gl") | |
480 | ("13gy3wn44kcxr7j3sbl69fp415875f4vb0gm91hx0fysqlvryhcs" "b9de1ffe3224" "gn") | |
481 | ("0w5nvzpjn5vr35c1852rlff581vpy71nc096cz125852kyqkzkc3" "5b3307475ada" "gu-IN") | |
482 | ("1ycakc4qpy9vcy50j3ricryjfnjr9v3a5ijj6bbfl4y6aks157fy" "c742df968ffd" "he") | |
483 | ("1b2jf83c500wm5wcdnijq0b7y4m8n6271smq8pygahn5nq17f0gq" "1a3039a52b8a" "hi-IN") | |
484 | ("19bbw8ix5m83cf4yarcmjl7jqa8xfabwqnh3nj6vi52rwvn7whk5" "8dc50e269ef3" "hr") | |
485 | ("12rrsvgg6bb2h8fhni7jbx8pv983q8ym5fhfjim957n9q2yp5db6" "67e40f48dec7" "hsb") | |
486 | ("0apyh713p3hrlj8041xwblcssahbmsqp9v9hbmb50ayf4z850kr1" "40073a597b1b" "hu") | |
487 | ("0q0r076lq250d3vmnz9d92wj137c2v8i362c2avmkgp5zr3mcl0z" "2ea33335afdb" "hy-AM") | |
488 | ("0qza33gdc1i9259dwd2f7vd78s0a6rg34aqdkhcn7f2l6ybw6xd6" "930041db15eb" "ia") | |
489 | ("1211h0gp7gianh3qf76w04gfzk4n2bnyc9i8dviyz0vh4cjbx11m" "08811a49b41c" "id") | |
490 | ("12lcr841g1j7453s7gb51vrvxmshx4ha3h1jx4vh8wr891xv8l6a" "2f7a8d31e0ba" "is") | |
491 | ("1x585g0r2kcv0d3phnxx85bk5g0pi1yl0hwp4idv19yc9hslr04s" "188357cc04b4" "it") | |
492 | ("09v35g9v7j6x0p1hggydm3a1rmq2fh4z7g1l88z3w5k6wq2nhj1b" "45cee0ba4771" "ja") | |
493 | ("0prs3vycfvvaffjigdgyxiq41ak2rc34lnan5a6cwdqjgy7z450s" "d60a19d9bf17" "ja-JP-mac") | |
494 | ("1nskzm8rgczrbgcxlzzq5zqdfd456ad0cylq27nf0wjiyq6kjzcm" "00cb00e78672" "ka") | |
495 | ("0g6zznmhiam172nm7g2qzfpk415mna8kiihm73z2sdns64xb3ymg" "77a293a4bced" "kab") | |
496 | ("17dld9lrym7rpvpvnkssivp4wx1f11zpk86wczbq1h52qgd70p55" "2c9b33a56d5d" "kk") | |
497 | ("1nlzl8930c8ql3yq425wyqlxvq8arrjv20xpm5g7yfxd54av89ac" "9cddd42af05c" "km") | |
498 | ("07hkrcdksvrqk816yimd036dlw15nc4sjk4gmw16ywbp093v0mqq" "e0c2969a8398" "kn") | |
499 | ("08aqggvk3qbv5bzks9i1iba9akhkpm01d2c9k0zf41mpr2r5yfg2" "827567d0dafc" "ko") | |
500 | ("0vagaiwy80bs1k3gkacshlzb5zchkcshx0ypwirvayc63sw4yl8l" "694b2a24e868" "lij") | |
501 | ("1r43kp1kzahrbza0hiyavqplk9h08pzsb6rpjy79jr6l1iqb89sy" "d6728db7e060" "lt") | |
502 | ("0sq2wbsj79xl7fi454k6q5xdhxyck1whjz315rv37vphqpx86b9b" "61e9b33f4d94" "lv") | |
503 | ("0q8jxg1af22hs9wjdf0jd3bqk4rafxyzvsjl35k75am7l2y1fl3c" "9e482f6dd72c" "mk") | |
504 | ("1zsfzjrzbc58d30a9yz12h5vphywgpw8xg6y6zn3677a785dvr20" "1fd2763336a4" "mr") | |
505 | ("1rzygkkpn1a59daygd3hdaqph2np6sqvpgh68j0xr4il958ymnsm" "67ddab62dab4" "ms") | |
506 | ("16jp6w5gizfxs7jvncg3ly13m59vqvh4rlmjd0q23m5g5ff9sklc" "3ed015b51bf3" "my") | |
507 | ("1wfv023j67lb4iyf49fsknwm4z3xy0xqcf25b2nzanggxj26n01x" "d01801233a8f" "nb-NO") | |
508 | ("1946vfia58vbjfippb5pfsskbjj95w7hb340smn6ry2vmza99mxp" "582defb08fb2" "ne-NP") | |
509 | ("12w5ywh4c3s55y3zqc48cp1gcpwwjg444yfh1bghhhb9ni1xkh5i" "05f6359a29a6" "nl") | |
510 | ("17jb076320cgkw1ypwmws2vjxsqlv2ww8aaisa3j334vbrw1m4zx" "50b41a1ddded" "nn-NO") | |
511 | ("1y840j0v5zdgj94cbacy6j1snf44rynmzxq3yk8i26arcar62akl" "a6a138531a44" "oc") | |
512 | ("0jq1hq4xhqxpa26r8pb1bgbaljgfkhn9l6p5pbnslkllpbh70q6l" "e70a3afaef25" "pa-IN") | |
513 | ("1hih138skwy2gb8q10ngg6zalrk3aa3d549mg79gqzxbi5zy19fw" "e035f33389eb" "pl") | |
514 | ("1hhif4hx4k351wm1bzykzycfzb5q8msxmiwh5r1cy32rh8wkxwhh" "54098495f37f" "pt-BR") | |
515 | ("0gkjs12rxjml1m3mljskpz1gr6aph0c31nwpwdqybfg54w9qslib" "3fdf021f624e" "pt-PT") | |
516 | ("0anyvwd9v6mr8y3ww33s6qnxkawqn5lz65vrxx3m3kzky63ai1xk" "794f9374eb87" "rm") | |
517 | ("1p4drj25gsfv7lwgm5saazh38iqrh53952n8i4bmxpn0nadbm2n5" "71ce18bcf6cc" "ro") | |
518 | ("17yssf4axd3zvncl4ka4wkfnwcn0z0arp3390vb9cps67na29p36" "3a9587227699" "ru") | |
519 | ("0xk6rksspcw1222v4rgk5a6gzrpx64k29hm7p9qkqwd70s34yj46" "c020582a72ce" "si") | |
520 | ("1ax5ibydyn7sj208r66zcxlcr8dxdqrw28vqyjif4jx583rp4lfp" "745a699b7f51" "sk") | |
521 | ("13rin7hm1dv8g0hbcv8mp2hiwpk1k5bhzvkqpqajkkik4lx523mc" "8e437e2351ef" "sl") | |
522 | ("0yh5jkl5zw3f7x1w2w6zfj3dyvcl4wj1zv4di7qsq2nl2yyizf7x" "2d99e2eff94f" "son") | |
523 | ("0vzq7s27jsdbw5k59wfykysg1kd8w229ab5d4zjdf30l59igkahh" "69bbdf07bd80" "sq") | |
524 | ("1mwivvs8vrk6vjq6i33kwlrlisra7dy35521ayps9p2rz2dll4rr" "215df5c5125c" "sr") | |
525 | ("0g97yz1rg5cfflj8vvq3sqliyvm06x818z9yldfh5rjg1y6n9fjd" "8be00a1a50d4" "sv-SE") | |
526 | ("0ii02jn3lh2i6d0s95whx9aj6w3x8axc7w1rlzj0lc2s9n52krz3" "170a84339dbe" "ta") | |
527 | ("1ss7symad2crapxjqc0xhc0n17l79r5vf7flvkgk7npjky4vb7nv" "72a79a304f7f" "te") | |
528 | ("11iqmg8zamgscnvs4n2xpw3g9azn6w38qs313wiwm86pyx6694ss" "8e91ce3064c5" "th") | |
529 | ("1zgkvn9flb8by62ip9r3gmpgxwgkww1zhml5mwa0djq3ppfdgi1c" "0f914d0cda56" "tl") | |
530 | ("1filkhdak6dbrd83q602x1qw1703nlm53nm9gcyab8s16gsx6ylz" "62ca6a8eaeba" "tr") | |
531 | ("0cgagdy0ixprk3knczdmkqxkmx4ybmshhh0956kxbd0iab0dfcf6" "f110ccac4cde" "trs") | |
532 | ("1f1ghk67zwnwc5x3nk82vcv94nf8glngkfya1hg074q3088sj9pa" "56c0102d5f1c" "uk") | |
533 | ("0iyw1b2jjylkdwxv9sxvj4ikxl64sx612b2dvvmf1di8bw86w74r" "7d53bce5ae98" "ur") | |
534 | ("1q83cp5pfgs8l03zirwi8r5qp8qyh4zvxdx1ilgaqqlyg42yql7c" "9b500e1a054d" "uz") | |
535 | ("1d4nkybz2hk64ay04k965b9lc5nhhpmzcs5ww3b6q4n93rf9c2z7" "2a000025928a" "vi") | |
536 | ("1cnrsfnyl3sw3sxsggmjwydvphb2diy0vzknvxdhpnvq3ln18hga" "74724087c25b" "xh") | |
537 | ("1j6l66v1xw27z8w78mpsnmqgv8m277mf4r0hgqcrb4zx7xc2vqyy" "527e5e090608" "zh-CN") | |
538 | ("1frwx35klpyz3sdwrkz7945ivb2dwaawhhyfnz4092h9hn7rc4ky" "6cd366ad2947" "zh-TW"))) | |
bfb48f4f | 539 | |
948879ee MW |
540 | (define* (computed-origin-method gexp-promise hash-algo hash |
541 | #:optional (name "source") | |
542 | #:key (system (%current-system)) | |
543 | (guile (default-guile))) | |
544 | "Return a derivation that executes the G-expression that results | |
545 | from forcing GEXP-PROMISE." | |
546 | (mlet %store-monad ((guile (package->derivation guile system))) | |
547 | (gexp->derivation (or name "computed-origin") | |
548 | (force gexp-promise) | |
2a1ec7bc | 549 | #:graft? #f ;nothing to graft |
948879ee MW |
550 | #:system system |
551 | #:guile-for-build guile))) | |
552 | ||
8ec5415c MW |
553 | (define %icecat-version "78.5.0-guix0-preview1") |
554 | (define %icecat-build-id "20201117000000") ;must be of the form YYYYMMDDhhmmss | |
948879ee MW |
555 | |
556 | ;; 'icecat-source' is a "computed" origin that generates an IceCat tarball | |
557 | ;; from the corresponding upstream Firefox ESR tarball, using the 'makeicecat' | |
558 | ;; script from the upstream IceCat project. | |
559 | (define icecat-source | |
560 | (let* ((base-version (first (string-split %icecat-version #\-))) | |
561 | ||
562 | (major-version (first (string-split base-version #\.))) | |
563 | (minor-version (second (string-split base-version #\.))) | |
564 | (sub-version (third (string-split base-version #\.))) | |
565 | ||
566 | (upstream-firefox-version (string-append base-version "esr")) | |
567 | (upstream-firefox-source | |
568 | (origin | |
569 | (method url-fetch) | |
570 | (uri (string-append | |
571 | "https://ftp.mozilla.org/pub/firefox/releases/" | |
572 | upstream-firefox-version "/source/" | |
573 | "firefox-" upstream-firefox-version ".source.tar.xz")) | |
574 | (sha256 | |
575 | (base32 | |
8ec5415c | 576 | "1442yjmwz69hkfcvh8kkb60jf4c9ms0pac04nc3xw2da13v4zxai")))) |
948879ee | 577 | |
8ec5415c | 578 | (upstream-icecat-base-version "78.5.0") ; maybe older than base-version |
ad21d767 | 579 | ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version)) |
8ec5415c | 580 | (gnuzilla-commit "bcfe407570cae32d00dd33a268de0e0593166f7b") |
948879ee MW |
581 | (gnuzilla-source |
582 | (origin | |
583 | (method git-fetch) | |
584 | (uri (git-reference | |
585 | (url "git://git.savannah.gnu.org/gnuzilla.git") | |
586 | (commit gnuzilla-commit))) | |
9b096517 MW |
587 | (file-name (git-file-name "gnuzilla" |
588 | ;;upstream-icecat-base-version | |
589 | (string-take gnuzilla-commit 8))) | |
948879ee MW |
590 | (sha256 |
591 | (base32 | |
8ec5415c | 592 | "1pg8fjjg91qyrv7za585ds1xrdvmybbkf2jmkff107fh5y23lxrg")))) |
948879ee | 593 | |
27913a6d LC |
594 | ;; 'search-patch' returns either a valid file name or #f, so wrap it |
595 | ;; in 'assume-valid-file-name' to avoid 'local-file' warnings. | |
c2614688 | 596 | (gnuzilla-fixes-patch |
27913a6d LC |
597 | (local-file (assume-valid-file-name |
598 | (search-patch "icecat-use-older-reveal-hidden-html.patch")))) | |
c7011ff8 | 599 | (makeicecat-patch |
27913a6d LC |
600 | (local-file (assume-valid-file-name |
601 | (search-patch "icecat-makeicecat.patch"))))) | |
948879ee MW |
602 | |
603 | (origin | |
604 | (method computed-origin-method) | |
605 | (file-name (string-append "icecat-" %icecat-version ".tar.xz")) | |
606 | (sha256 #f) | |
607 | (uri | |
608 | (delay | |
609 | (with-imported-modules '((guix build utils)) | |
610 | #~(begin | |
611 | (use-modules (guix build utils)) | |
612 | (let ((firefox-dir | |
613 | (string-append "firefox-" #$base-version)) | |
614 | (icecat-dir | |
ad21d767 | 615 | (string-append "icecat-" #$%icecat-version))) |
948879ee MW |
616 | |
617 | (mkdir "/tmp/bin") | |
618 | (set-path-environment-variable | |
619 | "PATH" '("bin") | |
620 | (list "/tmp" | |
621 | #+(canonical-package bash) | |
622 | #+(canonical-package coreutils) | |
623 | #+(canonical-package findutils) | |
624 | #+(canonical-package patch) | |
625 | #+(canonical-package xz) | |
626 | #+(canonical-package sed) | |
627 | #+(canonical-package grep) | |
628 | #+(canonical-package bzip2) | |
629 | #+(canonical-package gzip) | |
630 | #+(canonical-package tar) | |
631 | #+rename)) | |
632 | ||
633 | (symlink #+(file-append rename "/bin/rename") | |
634 | "/tmp/bin/prename") | |
635 | ||
636 | ;; We copy the gnuzilla source directory because it is | |
637 | ;; read-only in 'gnuzilla-source', and the makeicecat script | |
638 | ;; uses "cp -a" to copy parts of it and assumes that the | |
639 | ;; copies will be writable. | |
640 | (copy-recursively #+gnuzilla-source "/tmp/gnuzilla" | |
641 | #:log (%make-void-port "w")) | |
642 | ||
643 | (with-directory-excursion "/tmp/gnuzilla" | |
644 | (make-file-writable "makeicecat") | |
c2614688 MW |
645 | (invoke "patch" "--force" "--no-backup-if-mismatch" |
646 | "-p1" "--input" #+gnuzilla-fixes-patch) | |
c7011ff8 MW |
647 | (invoke "patch" "--force" "--no-backup-if-mismatch" |
648 | "-p1" "--input" #+makeicecat-patch) | |
948879ee MW |
649 | (patch-shebang "makeicecat") |
650 | (substitute* "makeicecat" | |
3e605b69 MW |
651 | (("^FFMAJOR=(.*)" all ffmajor) |
652 | (unless (string=? #$major-version | |
653 | (string-trim-both ffmajor)) | |
654 | ;; The makeicecat script cannot be expected to work | |
655 | ;; properly on a different version of Firefox, even if | |
656 | ;; no errors occur during execution. | |
657 | (error "makeicecat major version mismatch")) | |
948879ee MW |
658 | (string-append "FFMAJOR=" #$major-version "\n")) |
659 | (("^FFMINOR=.*") | |
660 | (string-append "FFMINOR=" #$minor-version "\n")) | |
661 | (("^FFSUB=.*") | |
662 | (string-append "FFSUB=" #$sub-version "\n")) | |
948879ee MW |
663 | (("^DATA=.*") |
664 | "DATA=/tmp/gnuzilla/data\n") | |
948879ee MW |
665 | (("/bin/sed") |
666 | #+(file-append (canonical-package sed) "/bin/sed")))) | |
667 | ||
668 | (format #t "Unpacking upstream firefox tarball...~%") | |
669 | (force-output) | |
670 | (invoke "tar" "xf" #+upstream-firefox-source) | |
671 | (rename-file firefox-dir icecat-dir) | |
672 | ||
673 | (with-directory-excursion icecat-dir | |
ad21d767 MW |
674 | (format #t "Populating l10n directory...~%") |
675 | (force-output) | |
05947d92 | 676 | (mkdir "l10n") |
ad21d767 MW |
677 | (with-directory-excursion "l10n" |
678 | (for-each | |
679 | (lambda (locale-dir) | |
680 | (let ((locale | |
681 | (string-drop (basename locale-dir) | |
682 | (+ 32 ; length of hash | |
683 | (string-length "-mozilla-locale-"))))) | |
684 | (format #t " ~a~%" locale) | |
685 | (force-output) | |
686 | (copy-recursively locale-dir locale | |
687 | #:log (%make-void-port "w")) | |
688 | (for-each make-file-writable (find-files locale)) | |
689 | (with-directory-excursion locale | |
690 | (when (file-exists? ".hgtags") | |
691 | (delete-file ".hgtags")) | |
692 | (mkdir-p "browser/chrome/browser/preferences") | |
693 | (call-with-output-file | |
694 | "browser/chrome/browser/preferences/advanced-scripts.dtd" | |
695 | (lambda (port) #f))))) | |
696 | '#+all-mozilla-locales) | |
697 | (copy-recursively #+mozilla-compare-locales | |
698 | "compare-locales" | |
699 | #:log (%make-void-port "w")) | |
700 | (delete-file "compare-locales/.gitignore") | |
701 | (delete-file "compare-locales/.hgignore") | |
702 | (delete-file "compare-locales/.hgtags")) | |
703 | ||
948879ee MW |
704 | (format #t "Running makeicecat script...~%") |
705 | (force-output) | |
ad21d767 | 706 | (invoke "bash" "/tmp/gnuzilla/makeicecat")) |
948879ee | 707 | |
34369f31 | 708 | (format #t "Packing IceCat source tarball...~%") |
948879ee MW |
709 | (force-output) |
710 | (invoke "tar" "cfa" #$output | |
8cf160e1 MW |
711 | ;; Avoid non-determinism in the archive. We set the |
712 | ;; mtime of files in the archive to early 1980 because | |
713 | ;; the build process fails if the mtime of source | |
714 | ;; files is pre-1980, due to the creation of zip | |
715 | ;; archives. | |
716 | "--mtime=@315619200" ; 1980-01-02 UTC | |
948879ee MW |
717 | "--owner=root:0" |
718 | "--group=root:0" | |
719 | "--sort=name" | |
720 | icecat-dir) | |
721 | ||
722 | #t)))))))) | |
723 | ||
be0f6112 AE |
724 | (define-public icecat |
725 | (package | |
726 | (name "icecat") | |
24886c13 | 727 | (version %icecat-version) |
46ce12d0 | 728 | (source icecat-source) |
be0f6112 AE |
729 | (build-system gnu-build-system) |
730 | (inputs | |
731 | `(("alsa-lib" ,alsa-lib) | |
1ae6df81 | 732 | ("bzip2" ,bzip2) |
90e1cdae | 733 | ("cups" ,cups) |
be0f6112 | 734 | ("dbus-glib" ,dbus-glib) |
90e1cdae MW |
735 | ("gdk-pixbuf" ,gdk-pixbuf) |
736 | ("glib" ,glib) | |
002c3e6d MW |
737 | ("gtk+" ,gtk+) |
738 | ("gtk+-2" ,gtk+-2) | |
c7011ff8 | 739 | ;; UNBUNDLE-ME! ("graphite2" ,graphite2) |
74c7af9f MW |
740 | ("pango" ,pango) |
741 | ("freetype" ,freetype) | |
c7011ff8 | 742 | ;; UNBUNDLE-ME! ("harfbuzz" ,harfbuzz) |
90e1cdae MW |
743 | ("libcanberra" ,libcanberra) |
744 | ("libgnome" ,libgnome) | |
7cba7647 | 745 | ("libjpeg-turbo" ,libjpeg-turbo) |
c7011ff8 MW |
746 | ;; UNBUNDLE-ME! ("libogg" ,libogg) |
747 | ;; UNBUNDLE-ME! ("libtheora" ,libtheora) ; wants theora-1.2, not yet released | |
748 | ;; UNBUNDLE-ME! ("libvorbis" ,libvorbis) | |
74c7af9f | 749 | ("libxft" ,libxft) |
94e96f7f | 750 | ("libevent" ,libevent) |
90e1cdae MW |
751 | ("libxinerama" ,libxinerama) |
752 | ("libxscrnsaver" ,libxscrnsaver) | |
9f7ae77f | 753 | ("libxcomposite" ,libxcomposite) |
be0f6112 | 754 | ("libxt" ,libxt) |
1ae6df81 | 755 | ("libffi" ,libffi) |
e67ad553 | 756 | ("ffmpeg" ,ffmpeg) |
c7011ff8 | 757 | ;; UNBUNDLE-ME! ("libvpx" ,libvpx) |
f0648a4b | 758 | ("icu4c" ,icu4c-67) |
13b284d9 | 759 | ("pixman" ,pixman) |
74c7af9f | 760 | ("pulseaudio" ,pulseaudio) |
be0f6112 | 761 | ("mesa" ,mesa) |
90e1cdae | 762 | ("mit-krb5" ,mit-krb5) |
6d328879 | 763 | ;; See <https://bugs.gnu.org/32833> |
6c83c483 | 764 | ;; and related comments in the 'remove-bundled-libraries' phase. |
6d328879 MW |
765 | ;; UNBUNDLE-ME! ("nspr" ,nspr) |
766 | ;; UNBUNDLE-ME! ("nss" ,nss) | |
429c8284 | 767 | ("shared-mime-info" ,shared-mime-info) |
c7011ff8 | 768 | ;; UNBUNDLE-ME! ("sqlite" ,sqlite) |
be0f6112 | 769 | ("unzip" ,unzip) |
1ae6df81 | 770 | ("zip" ,zip) |
c7011ff8 MW |
771 | ;; UNBUNDLE-ME! ("zlib" ,zlib) |
772 | )) | |
c4c4cc05 | 773 | (native-inputs |
46ce12d0 MW |
774 | ;; The following patches are specific to the Guix packaging of IceCat, |
775 | ;; and therefore we prefer to leave them out of 'source', which should be | |
776 | ;; a tarball suitable for compilation on any system that IceCat supports. | |
777 | ;; (Bug fixes and security fixes, however, should go in 'source'). | |
ad21d767 MW |
778 | `(;; XXX TODO: Adapt these patches to IceCat 68. |
779 | ;; ("icecat-avoid-bundled-libraries.patch" | |
780 | ;; ,(search-patch "icecat-avoid-bundled-libraries.patch")) | |
781 | ;; ("icecat-use-system-graphite2+harfbuzz.patch" | |
782 | ;; ,(search-patch "icecat-use-system-graphite2+harfbuzz.patch")) | |
783 | ;; ("icecat-use-system-media-libs.patch" | |
784 | ;; ,(search-patch "icecat-use-system-media-libs.patch")) | |
46ce12d0 MW |
785 | |
786 | ("patch" ,(canonical-package patch)) | |
787 | ||
c7011ff8 MW |
788 | ("rust" ,rust-1.41) |
789 | ("cargo" ,rust-1.41 "cargo") | |
790 | ("rust-cbindgen" ,rust-cbindgen-0.14) | |
ad21d767 MW |
791 | ("llvm" ,llvm) |
792 | ("clang" ,clang) | |
e67ad553 | 793 | ("perl" ,perl) |
c7011ff8 | 794 | ("node" ,node-10.22) |
ad21d767 MW |
795 | ("python" ,python) |
796 | ("python-2" ,python-2) | |
c4c4cc05 | 797 | ("python2-pysqlite" ,python2-pysqlite) |
002c3e6d | 798 | ("yasm" ,yasm) |
ad21d767 | 799 | ("nasm" ,nasm) ; XXX FIXME: only needed on x86_64 and i686 |
bfb48f4f | 800 | ("pkg-config" ,pkg-config) |
002c3e6d | 801 | ("autoconf" ,autoconf-2.13) |
bfb48f4f | 802 | ("which" ,which))) |
be0f6112 | 803 | (arguments |
74c7af9f MW |
804 | `(#:tests? #f ; no check target |
805 | #:out-of-source? #t ; must be built outside of the source directory | |
73b1b4eb LC |
806 | |
807 | ;; XXX: There are RUNPATH issues such as | |
808 | ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so, | |
809 | ;; which is not in its RUNPATH, but they appear to be harmless in | |
810 | ;; practice somehow. See <http://hydra.gnu.org/build/378133>. | |
811 | #:validate-runpath? #f | |
812 | ||
c7011ff8 | 813 | #:configure-flags `("--enable-default-toolkit=cairo-gtk3-wayland" |
9502ea3e MW |
814 | |
815 | "--with-distribution-id=org.gnu" | |
816 | ||
c7011ff8 MW |
817 | ;; Do not require addons in the global app or |
818 | ;; system directories to be signed by Mozilla. | |
819 | "--with-unsigned-addon-scopes=app,system" | |
820 | "--allow-addon-sideload" | |
34369f31 | 821 | |
90e1cdae | 822 | "--enable-pulseaudio" |
90e1cdae | 823 | |
9502ea3e MW |
824 | "--disable-tests" |
825 | "--disable-updater" | |
826 | "--disable-crashreporter" | |
9502ea3e | 827 | "--disable-eme" |
e67ad553 | 828 | |
90e1cdae | 829 | ;; Building with debugging symbols takes ~5GiB, so |
1ae6df81 LC |
830 | ;; disable it. |
831 | "--disable-debug" | |
832 | "--disable-debug-symbols" | |
833 | ||
8d956d86 MW |
834 | ;; Clang is needed to build Stylo, Mozilla's new |
835 | ;; CSS engine. We must specify the clang paths | |
836 | ;; manually, because otherwise the Mozilla build | |
837 | ;; system looks in the directories returned by | |
838 | ;; llvm-config --bindir and llvm-config --libdir, | |
839 | ;; which return paths in the llvm package where | |
840 | ;; clang is not found. | |
841 | ,(string-append "--with-clang-path=" | |
842 | (assoc-ref %build-inputs "clang") | |
843 | "/bin/clang") | |
844 | ,(string-append "--with-libclang-path=" | |
845 | (assoc-ref %build-inputs "clang") | |
846 | "/lib") | |
847 | ||
5bdec7d6 MW |
848 | ;; Hack to work around missing |
849 | ;; "unofficial" branding in icecat. | |
bfb48f4f MW |
850 | "--enable-official-branding" |
851 | ||
90e1cdae | 852 | ;; Avoid bundled libraries. |
7cba7647 | 853 | "--with-system-jpeg" ; must be libjpeg-turbo |
c7011ff8 MW |
854 | ;; UNBUNDLE-ME! "--with-system-zlib" |
855 | ;; UNBUNDLE-ME! "--with-system-bz2" | |
ad21d767 MW |
856 | ;; UNBUNDLE-ME! "--with-system-libevent" |
857 | ;; UNBUNDLE-ME! "--with-system-ogg" | |
858 | ;; UNBUNDLE-ME! "--with-system-vorbis" | |
859 | ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released | |
860 | ;; UNBUNDLE-ME! "--with-system-libvpx" | |
f0648a4b ZZ |
861 | "--with-system-icu" |
862 | ||
6d328879 | 863 | ;; See <https://bugs.gnu.org/32833> |
6c83c483 MW |
864 | ;; and related comments in the |
865 | ;; 'remove-bundled-libraries' phase below. | |
6d328879 MW |
866 | ;; UNBUNDLE-ME! "--with-system-nspr" |
867 | ;; UNBUNDLE-ME! "--with-system-nss" | |
c7011ff8 | 868 | |
ad21d767 MW |
869 | ;; UNBUNDLE-ME! "--with-system-harfbuzz" |
870 | ;; UNBUNDLE-ME! "--with-system-graphite2" | |
13b284d9 | 871 | "--enable-system-pixman" |
5b17fabc | 872 | "--enable-system-ffi" |
ad21d767 | 873 | ;; UNBUNDLE-ME! "--enable-system-sqlite" |
1ae6df81 | 874 | |
98a046cd AE |
875 | ;; Fails with "--with-system-png won't work because |
876 | ;; the system's libpng doesn't have APNG support". | |
877 | ;; According to | |
878 | ;; http://sourceforge.net/projects/libpng-apng/ , | |
879 | ;; "the Animated Portable Network Graphics (APNG) | |
880 | ;; is an unofficial extension of the Portable | |
881 | ;; Network Graphics (PNG) format"; | |
882 | ;; we probably do not wish to support it. | |
1ae6df81 | 883 | ;; "--with-system-png" |
5b17fabc | 884 | ) |
1ae6df81 | 885 | |
e80a4479 | 886 | #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums' |
7d141788 | 887 | |
9f7ae77f | 888 | #:modules ((ice-9 ftw) |
6cde5c34 | 889 | (ice-9 rdelim) |
37db2370 | 890 | (ice-9 regex) |
6cde5c34 | 891 | (ice-9 match) |
ad21d767 MW |
892 | (srfi srfi-34) |
893 | (srfi srfi-35) | |
429c8284 MW |
894 | (rnrs bytevectors) |
895 | (rnrs io ports) | |
896 | (guix elf) | |
897 | (guix build gremlin) | |
9f7ae77f | 898 | ,@%gnu-build-system-modules) |
be0f6112 | 899 | #:phases |
90e1cdae | 900 | (modify-phases %standard-phases |
46ce12d0 MW |
901 | (add-after 'unpack 'apply-guix-specific-patches |
902 | (lambda* (#:key inputs native-inputs #:allow-other-keys) | |
903 | (let ((patch (string-append (assoc-ref (or native-inputs inputs) | |
904 | "patch") | |
905 | "/bin/patch"))) | |
906 | (for-each (match-lambda | |
907 | ((label . file) | |
908 | (when (and (string-prefix? "icecat-" label) | |
909 | (string-suffix? ".patch" label)) | |
910 | (format #t "applying '~a'...~%" file) | |
911 | (invoke patch "--force" "--no-backup-if-mismatch" | |
912 | "-p1" "--input" file)))) | |
913 | (or native-inputs inputs))) | |
914 | #t)) | |
915 | (add-after 'apply-guix-specific-patches 'remove-bundled-libraries | |
916 | (lambda _ | |
917 | ;; Remove bundled libraries that we don't use, since they may | |
918 | ;; contain unpatched security flaws, they waste disk space and | |
919 | ;; memory, and may cause confusion. | |
920 | (for-each (lambda (file) | |
921 | (format #t "deleting '~a'...~%" file) | |
922 | (delete-file-recursively file)) | |
923 | '(;; FIXME: Removing the bundled icu breaks configure. | |
924 | ;; * The bundled icu headers are used in some places. | |
925 | ;; * The version number is taken from the bundled copy. | |
926 | ;;"intl/icu" | |
927 | ;; | |
928 | ;; FIXME: A script from the bundled nspr is used. | |
929 | ;;"nsprpub" | |
930 | ;; | |
931 | ;; FIXME: With the update to IceCat 60, using system NSS | |
932 | ;; broke certificate validation. See | |
933 | ;; <https://bugs.gnu.org/32833>. For now, we use | |
934 | ;; the bundled NSPR and NSS. TODO: Investigate, | |
935 | ;; and try to unbundle these libraries again. | |
936 | ;; UNBUNDLE-ME! "security/nss" | |
937 | ;; | |
938 | ;; TODO: Use more system media libraries. See: | |
939 | ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422> | |
940 | ;; * libtheora: esr60 wants v1.2, not yet released. | |
941 | ;; * soundtouch: avoiding the bundled library would | |
942 | ;; result in some loss of functionality. There's | |
943 | ;; also an issue with exception handling | |
944 | ;; configuration. It seems that this is needed in | |
945 | ;; some moz.build: | |
946 | ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1 | |
947 | ;; * libopus | |
948 | ;; * speex | |
949 | ;; | |
950 | "modules/freetype2" | |
ad21d767 | 951 | ;; "media/libjpeg" ; needed for now, because media/libjpeg/moz.build is referenced from config/external/moz.build |
c7011ff8 | 952 | ;; UNBUNDLE-ME! "modules/zlib" |
ad21d767 MW |
953 | ;; UNBUNDLE-ME! "ipc/chromium/src/third_party/libevent" |
954 | ;; UNBUNDLE-ME! "media/libvpx" | |
955 | ;; UNBUNDLE-ME! "media/libogg" | |
956 | ;; UNBUNDLE-ME! "media/libvorbis" | |
957 | ;; UNBUNDLE-ME! "media/libtheora" ; wants theora-1.2, not yet released | |
958 | ;; UNBUNDLE-ME! "media/libtremor" | |
959 | ;; UNBUNDLE-ME! "gfx/harfbuzz" | |
960 | ;; UNBUNDLE-ME! "gfx/graphite2" | |
46ce12d0 | 961 | "js/src/ctypes/libffi" |
ad21d767 MW |
962 | ;; UNBUNDLE-ME! "db/sqlite3" |
963 | )) | |
46ce12d0 MW |
964 | #t)) |
965 | (add-after 'remove-bundled-libraries 'link-libxul-with-libraries | |
966 | (lambda _ | |
967 | ;; libxul.so dynamically opens libraries, so here we explicitly | |
968 | ;; link them into libxul.so instead. | |
969 | ;; | |
970 | ;; TODO: It might be preferable to patch in absolute file names in | |
971 | ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to | |
972 | ;; work. More investigation is needed. | |
973 | (substitute* "toolkit/library/moz.build" | |
974 | (("^# This library needs to be last" all) | |
975 | (string-append "OS_LIBS += [ | |
9f7ae77f | 976 | 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5', |
002c3e6d | 977 | 'avcodec', 'avutil', 'pulse' ]\n\n" |
46ce12d0 MW |
978 | all))) |
979 | #t)) | |
8e556719 JL |
980 | (add-after 'link-libxul-with-libraries 'fix-ffmpeg-runtime-linker |
981 | (lambda* (#:key inputs #:allow-other-keys) | |
429c8284 MW |
982 | (let* ((ffmpeg (assoc-ref inputs "ffmpeg")) |
983 | (libavcodec (string-append ffmpeg "/lib/libavcodec.so"))) | |
984 | ;; Arrange to load libavcodec.so by its absolute file name. | |
985 | (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp" | |
986 | (("libavcodec\\.so") | |
987 | libavcodec)) | |
988 | ;; Populate the sandbox read-path whitelist as needed by ffmpeg. | |
989 | (let* ((mime-info (assoc-ref inputs "shared-mime-info")) | |
990 | (libavcodec-runpath (call-with-input-file libavcodec | |
991 | (compose elf-dynamic-info-runpath | |
992 | elf-dynamic-info | |
993 | parse-elf | |
994 | get-bytevector-all))) | |
995 | (whitelist (cons (string-append mime-info "/share/mime/") | |
996 | (map (lambda (dir) | |
997 | (string-append dir "/")) | |
998 | libavcodec-runpath))) | |
999 | (whitelist-string (string-join whitelist ",")) | |
1000 | (port (open-file "browser/app/profile/icecat.js" "a"))) | |
1001 | (format #t "setting 'security.sandbox.content.read_path_whitelist' to '~a'~%" | |
1002 | whitelist-string) | |
1003 | (format port "~%pref(\"security.sandbox.content.read_path_whitelist\", ~S);~%" | |
1004 | whitelist-string) | |
1005 | (close-output-port port)) | |
1006 | #t))) | |
94e96f7f MW |
1007 | (replace 'bootstrap |
1008 | (lambda _ | |
46ce12d0 MW |
1009 | (invoke "sh" "-c" "autoconf old-configure.in > old-configure") |
1010 | ;; 'configure' must be newer than 'old-configure.in', or else the | |
1011 | ;; build system will raise an alarm and abort. | |
1012 | (invoke "touch" "configure"))) | |
e67ad553 | 1013 | (add-after 'patch-source-shebangs 'patch-cargo-checksums |
257e3247 | 1014 | (lambda _ |
7d141788 | 1015 | (use-modules (guix build cargo-utils)) |
e88735b4 | 1016 | (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")) |
c7011ff8 MW |
1017 | (for-each (lambda (file) |
1018 | (format #t "patching checksums in ~a~%" file) | |
981cdc90 | 1019 | (substitute* file |
c7011ff8 MW |
1020 | (("^checksum = \".*\"") |
1021 | (string-append "checksum = \"" null-hash "\"")))) | |
1022 | (find-files "." "Cargo.lock$")) | |
1023 | (for-each generate-all-checksums | |
1024 | '("services" | |
1025 | "js" | |
1026 | "third_party/rust" | |
1027 | "dom/media" | |
1028 | "dom/webauthn" | |
1029 | "toolkit" | |
1030 | "gfx" | |
1031 | "storage" | |
1032 | "modules" | |
1033 | "xpcom/rust" | |
1034 | "media" | |
1035 | "mozglue/static/rust" | |
1036 | "netwerk" | |
1037 | "remote" | |
1038 | "intl" | |
1039 | "servo" | |
1040 | "security/manager/ssl" | |
1041 | "build"))) | |
e67ad553 | 1042 | #t)) |
46ce12d0 MW |
1043 | (replace 'configure |
1044 | ;; configure does not work followed by both "SHELL=..." and | |
1045 | ;; "CONFIG_SHELL=..."; set environment variables instead | |
1046 | (lambda* (#:key outputs configure-flags #:allow-other-keys) | |
1047 | (let* ((out (assoc-ref outputs "out")) | |
1048 | (bash (which "bash")) | |
1049 | (abs-srcdir (getcwd)) | |
1050 | (srcdir (string-append "../" (basename abs-srcdir))) | |
1051 | (flags `(,(string-append "--prefix=" out) | |
1052 | ,(string-append "--with-l10n-base=" | |
1053 | abs-srcdir "/l10n") | |
1054 | ,@configure-flags))) | |
1055 | (setenv "SHELL" bash) | |
1056 | (setenv "CONFIG_SHELL" bash) | |
1057 | (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13 | |
1058 | (setenv "CC" "gcc") ; apparently needed when Stylo is enabled | |
7a1b2ba5 | 1059 | (setenv "MOZ_BUILD_DATE" ,%icecat-build-id) ; avoid timestamp |
46ce12d0 MW |
1060 | (mkdir "../build") |
1061 | (chdir "../build") | |
1062 | (format #t "build directory: ~s~%" (getcwd)) | |
1063 | (format #t "configure flags: ~s~%" flags) | |
1064 | (apply invoke bash | |
1065 | (string-append srcdir "/configure") | |
1066 | flags)))) | |
ad21d767 MW |
1067 | (replace 'build |
1068 | ;; The build system often spuriously fails. See | |
1069 | ;; <https://bugs.gentoo.org/show_bug.cgi?id=680934>. To | |
1070 | ;; work around this, we try the standard 'build' phase up | |
1071 | ;; to 5 times. | |
1072 | (lambda args | |
1073 | (let ((build (assoc-ref %standard-phases 'build))) | |
1074 | (let retry ((remaining-attempts 5)) | |
1075 | (if (= remaining-attempts 1) | |
1076 | (apply build args) | |
1077 | (guard (c ((invoke-error? c) | |
1078 | (format #t "~%Retrying build! (~a attempts remaining)~%~%" | |
1079 | (- remaining-attempts 1)) | |
1080 | (force-output) | |
1081 | (retry (- remaining-attempts 1)))) | |
1082 | (apply build args))))))) | |
37db2370 JK |
1083 | (add-after 'build 'neutralise-store-references |
1084 | (lambda _ | |
1085 | ;; Mangle the store references to compilers & other build tools in | |
1086 | ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64. | |
1087 | (substitute* | |
1088 | "dist/bin/chrome/toolkit/content/global/buildconfig.html" | |
1089 | (((format #f "(~a/)([0-9a-df-np-sv-z]{32})" | |
1090 | (regexp-quote (%store-directory))) | |
1091 | _ store hash) | |
1092 | (string-append store | |
1093 | (string-take hash 8) | |
1094 | "<!-- Guix: not a runtime dependency -->" | |
1095 | (string-drop hash 8)))) | |
1096 | #t)) | |
6cde5c34 LC |
1097 | (add-before 'configure 'install-desktop-entry |
1098 | (lambda* (#:key outputs #:allow-other-keys) | |
1099 | ;; Install the '.desktop' file. | |
05947d92 MW |
1100 | (let* ((desktop-file "taskcluster/docker/icecat-snap/icecat.desktop") |
1101 | (out (assoc-ref outputs "out")) | |
6cde5c34 | 1102 | (applications (string-append out "/share/applications"))) |
05947d92 MW |
1103 | (substitute* desktop-file |
1104 | (("^Exec=icecat") (string-append "Exec=" out "/bin/icecat")) | |
1105 | (("IceCat") "GNU IceCat") | |
1106 | (("Icon=.*") "Icon=icecat\n") | |
1107 | (("NewWindow") "new-window") | |
1108 | (("NewPrivateWindow") "new-private-window")) | |
1109 | (install-file desktop-file applications) | |
88a8ce87 AG |
1110 | #t))) |
1111 | (add-after 'install-desktop-entry 'install-icons | |
1112 | (lambda* (#:key outputs #:allow-other-keys) | |
1113 | (let ((out (assoc-ref outputs "out"))) | |
1114 | (with-directory-excursion "browser/branding/official" | |
1115 | (for-each | |
1116 | (lambda (file) | |
1117 | (let* ((size (string-filter char-numeric? file)) | |
1118 | (icons (string-append out "/share/icons/hicolor/" | |
1119 | size "x" size "/apps"))) | |
1120 | (mkdir-p icons) | |
1121 | (copy-file file (string-append icons "/icecat.png")))) | |
1122 | '("default16.png" "default22.png" "default24.png" | |
1123 | "default32.png" "default48.png" "content/icon64.png" | |
3f27124e MW |
1124 | "mozicon128.png" "default256.png")) |
1125 | #t)))) | |
6e75740f CL |
1126 | ;; This fixes the file chooser crash that happens with GTK 3. |
1127 | (add-after 'install 'wrap-program | |
1128 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1129 | (let* ((out (assoc-ref outputs "out")) | |
1130 | (lib (string-append out "/lib")) | |
1131 | (gtk (assoc-ref inputs "gtk+")) | |
ad21d767 | 1132 | (gtk-share (string-append gtk "/share")) |
9c6ea3cb EZ |
1133 | (mesa (assoc-ref inputs "mesa")) |
1134 | (mesa-lib (string-append mesa "/lib")) | |
ad21d767 | 1135 | (pulseaudio (assoc-ref inputs "pulseaudio")) |
f11d4290 IK |
1136 | (pulseaudio-lib (string-append pulseaudio "/lib")) |
1137 | (libxscrnsaver (assoc-ref inputs "libxscrnsaver")) | |
1138 | (libxscrnsaver-lib (string-append libxscrnsaver "/lib"))) | |
6e75740f | 1139 | (wrap-program (car (find-files lib "^icecat$")) |
ad21d767 | 1140 | `("XDG_DATA_DIRS" prefix (,gtk-share)) |
c7011ff8 MW |
1141 | ;; The following line is commented out because the icecat |
1142 | ;; package on guix has been observed to be unstable when | |
1143 | ;; using wayland, and the bundled extensions stop working. | |
1144 | ;; `("MOZ_ENABLE_WAYLAND" = ("1")) | |
f11d4290 | 1145 | `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib ,mesa-lib ,libxscrnsaver-lib))) |
3f27124e | 1146 | #t)))))) |
6fd52309 | 1147 | (home-page "https://www.gnu.org/software/gnuzilla/") |
be0f6112 AE |
1148 | (synopsis "Entirely free browser derived from Mozilla Firefox") |
1149 | (description | |
1150 | "IceCat is the GNU version of the Firefox browser. It is entirely free | |
c5779c93 | 1151 | software, which does not recommend non-free plugins and addons. It also |
ad21d767 MW |
1152 | features built-in privacy-protecting features. |
1153 | ||
c7011ff8 | 1154 | WARNING: IceCat 78 has not yet been released by the upstream IceCat project. |
ad21d767 MW |
1155 | This is a preview release, and does not currently meet the privacy-respecting |
1156 | standards of the IceCat project.") | |
63e8bb12 | 1157 | (license license:mpl2.0) ;and others, see toolkit/content/license.html |
99effc8f LC |
1158 | (properties |
1159 | `((ftp-directory . "/gnu/gnuzilla") | |
1160 | (cpe-name . "firefox_esr") | |
bfb48f4f | 1161 | (cpe-version . ,(first (string-split version #\-))))))) |
f5301f00 | 1162 | |
b14aab67 | 1163 | ;; Update this together with icecat! |
266d5705 | 1164 | (define %icedove-build-id "20201202000000") ;must be of the form YYYYMMDDhhmmss |
b14aab67 JB |
1165 | (define-public icedove |
1166 | (package | |
1167 | (name "icedove") | |
266d5705 | 1168 | (version "78.5.1") |
597aa644 | 1169 | (source icecat-source) |
b14aab67 JB |
1170 | (properties |
1171 | `((cpe-name . "thunderbird_esr"))) | |
1172 | (build-system gnu-build-system) | |
1173 | (arguments | |
1174 | `(#:tests? #f ; no check target | |
1175 | #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums' | |
1176 | #:modules ((guix build utils) ;find-files | |
1177 | (sxml simple) | |
1178 | (ice-9 regex) | |
1179 | ,@%gnu-build-system-modules) | |
1180 | #:phases | |
1181 | (modify-phases %standard-phases | |
1182 | (add-after 'unpack 'prepare-thunderbird-sources | |
1183 | (lambda* (#:key inputs #:allow-other-keys) | |
1184 | (mkdir "comm") | |
1185 | (copy-recursively (assoc-ref inputs "thunderbird-sources") | |
1186 | "comm") | |
1187 | (delete-file-recursively "obj-x86_64-pc-linux-gnu") | |
1188 | (delete-file "sourcestamp.txt") | |
1189 | #t)) | |
1190 | (add-after 'patch-source-shebangs 'patch-cargo-checksums | |
1191 | (lambda _ | |
1192 | (use-modules (guix build cargo-utils)) | |
1193 | (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")) | |
597aa644 JB |
1194 | (for-each (lambda (file) |
1195 | (format #t "patching checksums in ~a~%" file) | |
1196 | (substitute* file | |
1197 | (("^checksum = \".*\"") | |
1198 | (string-append "checksum = \"" null-hash "\"")))) | |
1199 | (find-files "." "Cargo.lock$")) | |
1200 | (for-each generate-all-checksums | |
1201 | '("third_party/rust" | |
1202 | "toolkit/library/rust"))) | |
b14aab67 JB |
1203 | #t)) |
1204 | ;; Fixes issue where each installation directory generates its own profile. | |
1205 | ;; See e.g. https://trac.torproject.org/projects/tor/ticket/31457 | |
1206 | (add-after 'patch-source-shebangs 'fix-profile-setting | |
1207 | (lambda _ | |
1208 | (substitute* "comm/mail/moz.configure" | |
1209 | (("'MOZ_DEDICATED_PROFILES', True") | |
1210 | "'MOZ_DEDICATED_PROFILES', False")) | |
1211 | #t)) | |
1212 | (add-after 'prepare-thunderbird-sources 'rename-to-icedove | |
1213 | (lambda _ | |
1214 | (substitute* "comm/mail/confvars.sh" | |
1215 | (("MOZ_APP_BASENAME=Thunderbird") | |
1216 | "MOZ_APP_BASENAME=Icedove\nMOZ_APP_DISPLAYNAME=Icedove") | |
1217 | (("MOZ_APP_NAME=thunderbird") | |
1218 | "MOZ_APP_NAME=icedove") | |
1219 | (("MOZ_UPDATER=1") | |
1220 | "MOZ_UPDATER=0")) | |
1221 | ;; Remove branding to comply with Mozilla's trademark policy | |
1222 | (with-directory-excursion "comm/mail/branding/nightly" | |
1223 | (delete-file "content/about-wordmark.svg") | |
1224 | (call-with-output-file "content/about-wordmark.svg" | |
1225 | (lambda (port) | |
1226 | (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg") | |
1227 | (viewBox "0 0 789.1 90.78") | |
1228 | (width "333") | |
1229 | (height "48") | |
1230 | (fill "#fff")) | |
1231 | (text (@ (x "400") (y "70") | |
1232 | (text-anchor "middle") | |
1233 | (font-size "90")) | |
1234 | "Icedove Daily")) | |
1235 | port))) | |
1236 | (substitute* '("locales/en-US/brand.properties" | |
1237 | "locales/en-US/brand.ftl" | |
1238 | "locales/en-US/brand.dtd" | |
1239 | "configure.sh") | |
1240 | (("Thunderbird") "Icedove") | |
1241 | (("mozilla.org") "guix.gnu.org"))) | |
1242 | ;; Remove other mentions of Thunderbird in user-visible text. | |
1243 | (with-directory-excursion "comm/mail/base/content" | |
597aa644 | 1244 | (substitute* '("overrides/app-license-name.html") |
b14aab67 JB |
1245 | (("Thunderbird") "Icedove"))) |
1246 | (with-directory-excursion "comm/mail/components/" | |
597aa644 | 1247 | (substitute* '("MailGlue.jsm" |
b14aab67 JB |
1248 | "extensions/schemas/addressBook.json" |
1249 | "extensions/schemas/tabs.json" | |
1250 | "extensions/schemas/cloudFile.json" | |
1251 | "extensions/schemas/chrome_settings_overrides.json" | |
1252 | "extensions/schemas/windows.json" | |
1253 | "extensions/parent/ext-mail.js" | |
1254 | "im/messages/mail/Info.plist" | |
1255 | "enterprisepolicies/moz.build" | |
1256 | "enterprisepolicies/helpers/moz.build" | |
597aa644 | 1257 | "enterprisepolicies/schemas/moz.build") |
b14aab67 | 1258 | (("Thunderbird") "Icedove"))) |
b14aab67 | 1259 | (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js" |
b14aab67 JB |
1260 | "comm/common/src/customizeToolbar.js") |
1261 | (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e) | |
1262 | (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e))) | |
1263 | ||
1264 | ;; Override addon URLs and settings | |
1265 | (substitute* "comm/mail/app/profile/all-thunderbird.js" | |
1266 | (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m) | |
1267 | (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");")) | |
1268 | (("(pref\\(\"extensions.getAddons.search.url\").*" _ m) | |
1269 | (string-append m ", \"https://guix.gnu.org/packages\");")) | |
1270 | (("(pref\\(\"extensions.update.enabled\").*" _ m) | |
1271 | (string-append m ", false);")) | |
1272 | (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m) | |
1273 | (string-append m ", false);")) | |
1274 | (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m) | |
1275 | (string-append m ", false);"))) | |
1276 | #t)) | |
1277 | (add-after 'build 'neutralize-store-references | |
1278 | (lambda _ | |
1279 | ;; Mangle the store references to compilers & other build tools in | |
1280 | ;; about:buildconfig, reducing Icedove's closure significant. | |
1281 | ;; The resulting files are saved in lib/thunderbird/omni.ja | |
1282 | (substitute* | |
1283 | ;; Use find because the path "obj-x86_64-pc-linux-gnu" contains | |
1284 | ;; the architecture and the system -> more complicated. | |
1285 | (find-files "." "buildconfig.html") | |
1286 | (((format #f "(~a/)([0-9a-df-np-sv-z]{32})" | |
1287 | (regexp-quote (%store-directory))) | |
1288 | _ store hash) | |
1289 | (string-append store | |
1290 | (string-take hash 8) | |
1291 | "<!-- Guix: not a runtime dependency -->" | |
1292 | (string-drop hash 8)))) | |
1293 | #t)) | |
1294 | (replace 'configure | |
1295 | (lambda* (#:key inputs outputs configure-flags #:allow-other-keys) | |
1296 | (let* ((out (assoc-ref outputs "out")) | |
1297 | (bash (which "bash")) | |
1298 | (abs-srcdir (getcwd)) | |
1299 | (srcdir (string-append "../" (basename abs-srcdir))) | |
1300 | (flags `(,(string-append "--prefix=" out) | |
1301 | ,@configure-flags)) | |
1302 | (mozconfig (string-append (getcwd) "/.mozconfig"))) | |
1303 | (setenv "SHELL" bash) | |
1304 | (setenv "AUTOCONF" | |
1305 | (string-append (assoc-ref %build-inputs | |
1306 | "autoconf") | |
1307 | "/bin/autoconf")) | |
1308 | (setenv "CONFIG_SHELL" bash) | |
1309 | (setenv "QA_CONFIGURE_OPTIONS" ".*") | |
1310 | (setenv "MOZBUILD_STATE_PATH" | |
1311 | (string-append (getcwd) "/mach_state")) | |
1312 | (setenv "MOZCONFIG" | |
1313 | (string-append (getcwd) "/.mozconfig")) | |
1314 | (setenv "CC" "gcc") | |
1315 | (setenv "MOZ_NOSPAM" "1") | |
1316 | (setenv "PYTHON" | |
1317 | (string-append (assoc-ref inputs "python2") | |
1318 | "/bin/python")) | |
1319 | (setenv "MOZ_BUILD_DATE" ,%icedove-build-id) ; avoid timestamp | |
1320 | (setenv "LDFLAGS" (string-append "-Wl,-rpath=" | |
1321 | (assoc-ref outputs "out") | |
1322 | "/lib/icedove")) | |
1323 | (mkdir-p (string-append (getcwd) "/builddir")) | |
1324 | (with-output-to-file mozconfig | |
1325 | (lambda () | |
1326 | (display | |
1327 | (string-append | |
1328 | "ac_add_options --disable-crashreporter\n" | |
1329 | "ac_add_options --disable-debug\n" | |
1330 | "ac_add_options --disable-debug-symbols\n" | |
1331 | "ac_add_options --disable-elf-hack\n" | |
597aa644 | 1332 | "ac_add_options --disable-jit\n" |
b14aab67 JB |
1333 | "ac_add_options --disable-necko-wifi\n" |
1334 | "ac_add_options --disable-official-branding\n" | |
1335 | "ac_add_options --disable-tests\n" | |
1336 | "ac_add_options --disable-updater\n" | |
1337 | "ac_add_options --disable-webrtc\n" | |
1338 | "ac_add_options --enable-application=comm/mail\n" | |
1339 | "ac_add_options --enable-calendar\n" | |
b14aab67 JB |
1340 | "ac_add_options --enable-default-toolkit=\"cairo-gtk3\"\n" |
1341 | "ac_add_options --enable-optimize\n" | |
1342 | "ac_add_options --enable-pulseaudio\n" | |
1343 | "ac_add_options --enable-release\n" | |
b14aab67 JB |
1344 | "ac_add_options --enable-strip\n" |
1345 | "ac_add_options --enable-system-ffi\n" | |
1346 | "ac_add_options --enable-system-pixman\n" | |
b14aab67 JB |
1347 | "ac_add_options --prefix=" out "\n" |
1348 | "ac_add_options --with-clang-path=" (assoc-ref %build-inputs "clang") "/bin/clang\n" | |
1349 | "ac_add_options --with-distribution-id=org.gnu\n" | |
1350 | "ac_add_options --with-libclang-path=" (assoc-ref %build-inputs "clang") "/lib\n" | |
1351 | "ac_add_options --with-system-bz2\n" | |
1352 | "ac_add_options --with-system-icu\n" | |
1353 | "ac_add_options --with-system-jpeg\n" | |
1354 | "ac_add_options --with-system-libevent\n" | |
1355 | "ac_add_options --with-system-nspr\n" | |
1356 | "ac_add_options --with-system-nss\n" | |
1357 | "ac_add_options --with-system-zlib\n" | |
1358 | "ac_add_options --with-user-appdir=\\.icedove\n")))) | |
1359 | (display (getcwd)) | |
1360 | (newline) | |
1361 | (display "mach configure") | |
1362 | (invoke "./mach" "configure")))) | |
1363 | (replace 'build | |
1364 | (lambda _ (invoke "./mach" "build"))) | |
1365 | (replace 'install | |
1366 | (lambda _ (invoke "./mach" "install"))) | |
964ba656 JB |
1367 | ;; Thunderbird doesn't provide any .desktop file. |
1368 | ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1637575 | |
1369 | (add-after 'install 'install-desktop-file | |
1370 | (lambda* (#:key outputs #:allow-other-keys) | |
1371 | (let* ((out (assoc-ref outputs "out")) | |
1372 | (apps (string-append out "/share/applications"))) | |
1373 | (mkdir-p apps) | |
1374 | (with-output-to-file (string-append apps "/icedove.desktop") | |
1375 | (lambda _ | |
1376 | (format #t | |
1377 | "[Desktop Entry]~@ | |
1378 | Name=Icedove~@ | |
1379 | Exec=~a/bin/icedove~@ | |
1380 | Icon=icedove~@ | |
1381 | GenericName=Mail/News Client~@ | |
1382 | Categories=Network;Email;~@ | |
1383 | Terminal=false~@ | |
1384 | StartupNotify=true~@ | |
1385 | MimeType=x-scheme-handler/mailto;~@ | |
1386 | Type=Application~@ | |
1387 | Actions=ComposeMessage;~@ | |
1388 | [Desktop Action ComposeMessage]~@ | |
1389 | Name=Write new message~@ | |
1390 | Exec=~@*~a/bin/icedove -compose~%" | |
1391 | out)))) | |
1392 | #t)) | |
b14aab67 JB |
1393 | (add-after 'install 'wrap-program |
1394 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1395 | (let* ((out (assoc-ref outputs "out")) | |
1396 | (lib (string-append out "/lib")) | |
1397 | (gtk (assoc-ref inputs "gtk+")) | |
1398 | (gtk-share (string-append gtk "/share")) | |
1399 | (pulseaudio (assoc-ref inputs "pulseaudio")) | |
1400 | (pulseaudio-lib (string-append pulseaudio "/lib"))) | |
1401 | (wrap-program (car (find-files lib "^icedove$")) | |
1402 | `("XDG_DATA_DIRS" prefix (,gtk-share)) | |
1403 | `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib))) | |
1404 | #t)))))) | |
1405 | (inputs | |
1406 | `(("bzip2" ,bzip2) | |
1407 | ("cairo" ,cairo) | |
1408 | ("cups" ,cups) | |
1409 | ("dbus-glib" ,dbus-glib) | |
1410 | ("ffmpeg" ,ffmpeg) | |
1411 | ("freetype" ,freetype) | |
1412 | ("gdk-pixbuf" ,gdk-pixbuf) | |
1413 | ("glib" ,glib) | |
1414 | ("gtk+" ,gtk+) | |
1415 | ("gtk+-2" ,gtk+-2) | |
1416 | ("hunspell" ,hunspell) | |
597aa644 | 1417 | ("icu4c" ,icu4c-67) |
b14aab67 JB |
1418 | ("libcanberra" ,libcanberra) |
1419 | ("libevent" ,libevent) | |
1420 | ("libffi" ,libffi) | |
1421 | ("libgnome" ,libgnome) | |
1422 | ("libjpeg-turbo" ,libjpeg-turbo) | |
1423 | ("libpng-apng" ,libpng-apng) | |
1424 | ("libvpx" ,libvpx) | |
1425 | ("libxcomposite" ,libxcomposite) | |
1426 | ("libxft" ,libxft) | |
1427 | ("libxinerama" ,libxinerama) | |
1428 | ("libxscrnsaver" ,libxscrnsaver) | |
1429 | ("libxt" ,libxt) | |
1430 | ("mesa" ,mesa) | |
1431 | ("mit-krb5" ,mit-krb5) | |
1432 | ("nspr" ,nspr) | |
b6fc2054 | 1433 | ("nss" ,nss) |
b14aab67 JB |
1434 | ("pango" ,pango) |
1435 | ("pixman" ,pixman) | |
1436 | ("pulseaudio" ,pulseaudio) | |
1437 | ("sqlite" ,sqlite) | |
1438 | ("startup-notification" ,startup-notification) | |
1439 | ("unzip" ,unzip) | |
1440 | ("zip" ,zip) | |
1441 | ("zlib" ,zlib))) | |
1442 | (native-inputs | |
1443 | `(("thunderbird-sources" | |
1444 | ;; The changeset identifier is taken from the file "sourcestamp.txt" | |
1445 | ;; in the Thunderbird release tarball. We don't use the release | |
1446 | ;; tarball because it duplicates the Icecat sources and only adds the | |
1447 | ;; "comm" directory, which is provided by this repository. | |
266d5705 | 1448 | ,(let ((changeset "7bfb6e5797a4120c798eaa67a9cddd2846badcee")) |
b14aab67 JB |
1449 | (origin |
1450 | (method hg-fetch) | |
1451 | (uri (hg-reference | |
597aa644 | 1452 | (url "https://hg.mozilla.org/releases/comm-esr78") |
b14aab67 JB |
1453 | (changeset changeset))) |
1454 | (file-name (string-append "thunderbird-" version "-checkout")) | |
1455 | (sha256 | |
1456 | (base32 | |
266d5705 | 1457 | "0s0c96137brg25dysym579kv4vq65z8czb4mcssqvwkg316g2dqp"))))) |
b14aab67 | 1458 | ("autoconf" ,autoconf-2.13) |
597aa644 | 1459 | ("cargo" ,rust-1.41 "cargo") |
b14aab67 JB |
1460 | ("clang" ,clang) |
1461 | ("llvm" ,llvm) | |
1462 | ("nasm" ,nasm) | |
597aa644 | 1463 | ("node" ,node-10.22) |
b14aab67 JB |
1464 | ("perl" ,perl) |
1465 | ("pkg-config" ,pkg-config) | |
1466 | ("python" ,python) | |
1467 | ("python2" ,python-2.7) | |
597aa644 JB |
1468 | ("rust" ,rust-1.41) |
1469 | ("rust-cbindgen" ,rust-cbindgen-0.14) | |
b14aab67 JB |
1470 | ("which" ,which) |
1471 | ("yasm" ,yasm))) | |
1472 | (home-page "https://www.thunderbird.net") | |
1473 | (synopsis "Rebranded Mozilla Thunderbird email client") | |
1474 | (description | |
1475 | "This package provides an email client built based on Mozilla | |
1476 | Thunderbird. It supports email, news feeds, chat, calendar and contacts.") | |
1477 | (license license:mpl2.0))) | |
1478 | ||
764c682e JB |
1479 | (define-public icedove/wayland |
1480 | (package/inherit icedove | |
1481 | (name "icedove-wayland") | |
1482 | (arguments | |
1483 | (substitute-keyword-arguments (package-arguments icedove) | |
1484 | ((#:phases phases) | |
1485 | `(modify-phases ,phases | |
1486 | (replace 'wrap-program | |
1487 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1488 | (let* ((out (assoc-ref outputs "out")) | |
1489 | (lib (string-append out "/lib")) | |
1490 | (gtk (assoc-ref inputs "gtk+")) | |
1491 | (gtk-share (string-append gtk "/share")) | |
1492 | (pulseaudio (assoc-ref inputs "pulseaudio")) | |
1493 | (pulseaudio-lib (string-append pulseaudio "/lib"))) | |
1494 | (wrap-program (car (find-files lib "^icedove$")) | |
1495 | `("MOZ_ENABLE_WAYLAND" = ("1")) | |
1496 | `("XDG_DATA_DIRS" prefix (,gtk-share)) | |
1497 | `("LD_LIBRARY_PATH" prefix (,pulseaudio-lib))) | |
1498 | #t))))))))) | |
1499 | ||
167a0ce0 OP |
1500 | (define-public firefox-decrypt |
1501 | (package | |
1502 | (name "firefox-decrypt") | |
1503 | (version "0.7.0") | |
1504 | (source (origin | |
1505 | (method git-fetch) | |
1506 | (uri (git-reference | |
b0e7b699 | 1507 | (url "https://github.com/Unode/firefox_decrypt") |
167a0ce0 OP |
1508 | (commit version))) |
1509 | (file-name (git-file-name name version)) | |
1510 | (sha256 | |
1511 | (base32 | |
1512 | "17yyyxp47z4m8hnflcq34rc1y871515kr3f1y42j1l0yx3g0il07")))) | |
1513 | (build-system trivial-build-system) | |
1514 | (inputs | |
1515 | `(("nss" ,nss) | |
1516 | ("python" ,python))) | |
1517 | (arguments | |
1518 | `(#:modules ((guix build utils)) | |
1519 | #:builder | |
1520 | (begin | |
1521 | (use-modules (guix build utils)) | |
1522 | (setenv "PATH" | |
1523 | (string-append | |
1524 | (assoc-ref %build-inputs "python") "/bin")) | |
1525 | (copy-file (string-append (assoc-ref %build-inputs "source") | |
1526 | "/firefox_decrypt.py") | |
1527 | "firefox_decrypt.py") | |
1528 | (substitute* "firefox_decrypt.py" | |
1529 | (("/usr/bin/env python") (which "python3")) | |
1530 | (("libnss3.so") (string-append (assoc-ref %build-inputs "nss") | |
1531 | "/lib/nss/libnss3.so"))) | |
1532 | (install-file "firefox_decrypt.py" (string-append %output "/bin")) | |
1533 | #t))) | |
1534 | (home-page "https://github.com/Unode/firefox_decrypt/") | |
1535 | (synopsis "Tool to extract passwords from Mozilla profiles") | |
1536 | (description "Firefox Decrypt is a tool to extract passwords from | |
1537 | Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.") | |
1538 | (license license:gpl3+))) |