1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014, 2015, 2016, 2017 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
6 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
8 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
9 ;;; Copyright © 2017 ng0 <ng0@no-reply.pragmatique.xyz>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages gnuzilla)
27 #:use-module ((srfi srfi-1) #:hide (zip))
28 #:use-module (ice-9 match)
29 #:use-module (gnu packages)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix utils)
34 #:use-module (guix build-system gnu)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages databases)
38 #:use-module (gnu packages glib)
39 #:use-module (gnu packages gtk)
40 #:use-module (gnu packages gnome)
41 #:use-module (gnu packages libcanberra)
42 #:use-module (gnu packages cups)
43 #:use-module (gnu packages kerberos)
44 #:use-module (gnu packages linux)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages fontutils)
49 #:use-module (gnu packages libevent)
50 #:use-module (gnu packages libreoffice) ;for hunspell
51 #:use-module (gnu packages image)
52 #:use-module (gnu packages libffi)
53 #:use-module (gnu packages pulseaudio)
54 #:use-module (gnu packages python)
55 #:use-module (gnu packages xorg)
56 #:use-module (gnu packages gl)
57 #:use-module (gnu packages assembly)
58 #:use-module (gnu packages icu4c)
59 #:use-module (gnu packages video)
60 #:use-module (gnu packages xdisorg)
61 #:use-module (gnu packages readline))
70 "https://ftp.mozilla.org/pub/mozilla.org/js/"
71 name version ".tar.gz"))
74 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))
75 (patches (search-patches "mozjs17-aarch64-support.patch"))
76 (modules '((guix build utils)))
78 ;; Fix incompatibility with Perl 5.22+.
79 '(substitute* '("js/src/config/milestone.pl")
80 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE")))))
81 (build-system gnu-build-system)
84 ("pkg-config" ,pkg-config)
85 ("python" ,python-2)))
87 `(("nspr" ,nspr))) ; in the Requires.private field of mozjs-17.0.pc
91 `(;; XXX: parallel build fails, lacking:
92 ;; mkdir -p "system_wrapper_js/"
95 (modify-phases %standard-phases
96 (add-after 'unpack 'delete-timedout-test
97 ;; This test times out on slower hardware.
98 (lambda _ (delete-file "js/src/jit-test/tests/basic/bug698584.js")))
99 (add-before 'configure 'chdir
104 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
105 (lambda* (#:key outputs #:allow-other-keys)
106 (let ((out (assoc-ref outputs "out")))
107 (setenv "SHELL" (which "sh"))
108 (setenv "CONFIG_SHELL" (which "sh"))
110 "./configure" (string-append "--prefix=" out)
111 ,@(if (string=? "aarch64-linux"
113 '("--host=aarch64-unknown-linux-gnu")
116 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey")
117 (synopsis "Mozilla javascript engine")
118 (description "SpiderMonkey is Mozilla's JavaScript engine written
120 (license license:mpl2.0))) ; and others for some files
122 (define-public mozjs-24
123 (package (inherit mozjs)
129 "https://ftp.mozilla.org/pub/mozilla.org/js/"
130 name "-" version ".tar.bz2"))
133 "1n1phk8r3l8icqrrap4czplnylawa0ddc2cc4cgdz46x3lrkybz6"))
134 (modules '((guix build utils)))
135 (patches (search-patches "mozjs24-aarch64-support.patch"))
137 ;; Fix incompatibility with Perl 5.22+.
138 '(substitute* '("js/src/config/milestone.pl")
139 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE")))))
141 (substitute-keyword-arguments (package-arguments mozjs)
143 `(modify-phases ,phases
145 (lambda* (#:key outputs #:allow-other-keys)
146 (let ((out (assoc-ref outputs "out")))
147 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
148 (setenv "SHELL" (which "sh"))
149 (setenv "CONFIG_SHELL" (which "sh"))
150 (zero? (system* "./configure"
151 (string-append "--prefix=" out)
153 "--enable-system-ffi"
154 "--enable-threadsafe"
155 ,@(if (string=? "aarch64-linux"
157 '("--host=aarch64-unknown-linux-gnu")
163 (define-public mozjs-38
167 (version "38.2.1.rc0")
171 "https://people.mozilla.org/~sstangl/"
172 name "-" version ".tar.bz2"))
175 "0p4bmbpgkfsj54xschcny0a118jdrdgg0q29rwxigg3lh5slr681"))
178 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1269317 for
179 ;; GCC 6 compatibility.
181 "mozjs38-version-detection.patch" ; for 0ad
182 "mozjs38-tracelogger.patch"
184 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1339931.
185 "mozjs38-pkg-config-version.patch"
186 "mozjs38-shell-version.patch"))
187 (modules '((guix build utils)))
190 ;; Fix incompatibility with sed 4.4.
191 (substitute* "js/src/configure"
192 (("\\^\\[:space:\\]") "^[[:space:]]"))
194 ;; The headers are symlinks to files that are in /tmp, so they
195 ;; end up broken. Copy them instead.
197 "python/mozbuild/mozbuild/backend/recursivemake.py"
198 (("\\['dist_include'\\].add_symlink")
199 "['dist_include'].add_copy"))
201 ;; Remove bundled libraries.
202 (for-each delete-file-recursively
204 "js/src/ctypes/libffi"
205 "js/src/ctypes/libffi-patches"
209 `(;; XXX: parallel build fails, lacking:
210 ;; mkdir -p "system_wrapper_js/"
212 ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1008470.
215 (modify-phases %standard-phases
217 (lambda* (#:key outputs #:allow-other-keys)
218 (let ((out (assoc-ref outputs "out")))
220 (setenv "SHELL" (which "sh"))
221 (setenv "CONFIG_SHELL" (which "sh"))
222 (zero? (system* "./configure"
223 (string-append "--prefix=" out)
225 "--enable-gcgenerational"
230 "--enable-system-ffi"
231 "--enable-threadsafe"
232 "--enable-xterm-updates"
237 ;; Intl API requires bundled ICU.
238 "--without-intl-api"))))))))
241 ("pkg-config" ,pkg-config)
242 ("python-2" ,python-2)))
245 ("readline" ,readline)
256 "https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v"
257 version "/src/nspr-" version ".tar.gz"))
260 "158hdn285dsb5rys8wl1wi32dd1axwhqq0r8fwny4aj157m0l2jr"))))
261 (build-system gnu-build-system)
265 `(#:tests? #f ; no check target
266 #:configure-flags (list "--enable-64bit"
267 (string-append "LDFLAGS=-Wl,-rpath="
268 (assoc-ref %outputs "out")
270 #:phases (modify-phases %standard-phases
271 (add-before 'configure 'chdir
272 (lambda _ (chdir "nspr") #t)))))
274 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR")
275 (synopsis "Netscape API for system level and libc-like functions")
276 (description "Netscape Portable Runtime (NSPR) provides a
277 platform-neutral API for system level and libc-like functions. It is used
278 in the Mozilla clients.")
279 (license license:mpl2.0)))
287 (uri (let ((version-with-underscores
288 (string-join (string-split version #\.) "_")))
290 "https://ftp.mozilla.org/pub/mozilla.org/security/nss/"
291 "releases/NSS_" version-with-underscores "_RTM/src/"
292 "nss-" version ".tar.gz")))
295 "1r44qa4j7sri50mxxbnrpm6fxprwrhv76whi7bfq73j06syxmw4q"))
296 ;; Create nss.pc and nss-config.
297 (patches (search-patches "nss-pkgconfig.patch"
298 "nss-increase-test-timeout.patch"))))
299 (build-system gnu-build-system)
300 (outputs '("out" "bin"))
302 `(#:parallel-build? #f ; not supported
304 (let* ((out (assoc-ref %outputs "out"))
305 (nspr (string-append (assoc-ref %build-inputs "nspr")))
306 (rpath (string-append "-Wl,-rpath=" out "/lib/nss")))
307 (list "-C" "nss" (string-append "PREFIX=" out)
309 "NSS_USE_SYSTEM_SQLITE=1"
310 (string-append "NSPR_INCLUDE_DIR=" nspr "/include/nspr")
311 ;; Add $out/lib/nss to RPATH.
312 (string-append "RPATH=" rpath)
313 (string-append "LDFLAGS=" rpath)))
314 #:modules ((guix build gnu-build-system)
320 (modify-phases %standard-phases
324 ;; Tells NSS to build for the 64-bit ABI if we are 64-bit system.
325 ,@(match (%current-system)
326 ((or "x86_64-linux" "aarch64-linux")
327 `((setenv "USE_64" "1")))
333 ;; Use 127.0.0.1 instead of $HOST.$DOMSUF as HOSTADDR for testing.
334 ;; The later requires a working DNS or /etc/hosts.
335 (setenv "DOMSUF" "(none)")
336 (setenv "USE_IP" "TRUE")
337 (setenv "IP_ADDRESS" "127.0.0.1")
338 (zero? (system* "./nss/tests/all.sh"))))
340 (lambda* (#:key outputs #:allow-other-keys)
341 (let* ((out (assoc-ref outputs "out"))
342 (bin (string-append (assoc-ref outputs "bin") "/bin"))
343 (inc (string-append out "/include/nss"))
344 (lib (string-append out "/lib/nss"))
345 (obj (match (scandir "dist" (cut string-suffix? "OBJ" <>))
346 ((obj) (string-append "dist/" obj)))))
347 ;; Install nss-config to $out/bin.
348 (install-file (string-append obj "/bin/nss-config")
349 (string-append out "/bin"))
350 (delete-file (string-append obj "/bin/nss-config"))
351 ;; Install nss.pc to $out/lib/pkgconfig.
352 (install-file (string-append obj "/lib/pkgconfig/nss.pc")
353 (string-append out "/lib/pkgconfig"))
354 (delete-file (string-append obj "/lib/pkgconfig/nss.pc"))
355 (rmdir (string-append obj "/lib/pkgconfig"))
356 ;; Install other files.
357 (copy-recursively "dist/public/nss" inc)
358 (copy-recursively (string-append obj "/bin") bin)
359 (copy-recursively (string-append obj "/lib") lib)
361 ;; FIXME: libgtest1.so is installed in the above step, and it's
362 ;; (unnecessarily) linked with several NSS libraries, but
363 ;; without the needed rpaths, causing the 'validate-runpath'
364 ;; phase to fail. Here we simply delete libgtest1.so, since it
365 ;; seems to be used only during the tests.
366 (delete-file (string-append lib "/libgtest1.so"))
367 (delete-file (string-append lib "/libgtestutil.so"))
373 (propagated-inputs `(("nspr" ,nspr))) ; required by nss.pc.
374 (native-inputs `(("perl" ,perl)))
376 ;; The NSS test suite takes around 48 hours on Loongson 3A (MIPS) when
377 ;; another build is happening concurrently on the same machine.
378 (properties '((timeout . 216000))) ; 60 hours
381 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS")
382 (synopsis "Network Security Services")
384 "Network Security Services (NSS) is a set of libraries designed to support
385 cross-platform development of security-enabled client and server applications.
386 Applications built with NSS can support SSL v2 and v3, TLS, PKCS #5, PKCS #7,
387 PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other security
389 (license license:mpl2.0)))
391 (define (mozilla-patch file-name changeset hash)
392 "Return an origin for CHANGESET from the mozilla-esr52 repository."
395 (uri (string-append "https://hg.mozilla.org/releases/mozilla-esr52/raw-rev/"
397 (sha256 (base32 hash))
398 (file-name file-name)))
400 (define-public icecat
403 (version "52.3.0-gnu1")
407 (uri (string-append "mirror://gnu/gnuzilla/"
408 (first (string-split version #\-))
409 "/" name "-" version ".tar.bz2"))
412 "00jki754d6310fxj1b7dbhqj69y5igck6gqg6rgfya243nsb56k9"))
415 (search-patch "icecat-avoid-bundled-libraries.patch")
416 (mozilla-patch "icecat-bug-546387.patch" "d13e3fefb76e" "1b760r0bg2ydbl585wlmajljh1nlisrwxvjws5b28a3sgjy01i6k")
417 (mozilla-patch "icecat-bug-1350152.patch" "f822bda79c28" "1wf56169ca874shr6r7qx40s17h2gwj7ngmpyylrpmd1c6hipvsj")
418 (mozilla-patch "icecat-bug-1388166.patch" "fbb0bdb191d5" "1y8wpj38vw1dd6f375s9i0mrk9bd8z8gz5g70p4qynfllpkn072d")
419 (mozilla-patch "icecat-CVE-2017-7810-pt1.patch" "fbddb5cdd3c7" "0k5nyl2z1y2rx9fwqyfj64678yv6v3pnmshgk552pbzqmaf8i1hq")
420 (mozilla-patch "icecat-CVE-2017-7810-pt2.patch" "76c25987a275" "095b9vwsiza9ikbnnppfcld16h75x5bxjfxc73913y04n0i42ifh")
421 (mozilla-patch "icecat-CVE-2017-7810-pt3.patch" "32eec29a85a5" "057simakqg56jvas1wkskg5kszn96m74nca26x08d5w7rzmbv1q2")
422 (mozilla-patch "icecat-bug-1373222.patch" "ecef71fa933f" "0vsymgy5j702lamvh2riahni7rdj9ba3bd6i4a2m22d638rwp1i2")
423 (mozilla-patch "icecat-CVE-2017-7814.patch" "68a444daf85b" "1faaadaajidzb9i00710zxdyv370hlrdg1l5rw2ymfmzbjj4jqyd")
424 (mozilla-patch "icecat-bug-1376825.patch" "eeeec9cafc4e" "188qf6zi9kyxb33330yia6wmrd5mdyqn5hr1cl38zy7m3akv8srh")
425 (mozilla-patch "icecat-bug-1385272.patch" "d68fa12fbffc" "13gh97vz9n2b7303jcvr1072iy8bghy9chvbmxzvw82prvkscavw")
426 (mozilla-patch "icecat-bug-1390002.patch" "c24e6fc9f689" "0aswhy5fz2f6wzd5j5gg3nqvz707ip344089h2z2chcp146vxmf4")
427 (mozilla-patch "icecat-CVE-2017-7810-pt4.patch" "ae110cf77596" "0gdrkfq9wy9cfcdgbj14ci86xgh2prkbz69pfy97r9igd8059syw")
428 (mozilla-patch "icecat-CVE-2017-7810-pt5.patch" "b8417112486d" "1hya6lccz7vm51v4f6ww072794cwzmfn9xhxmvrnqbiyspxx5fz4")))
429 (modules '((guix build utils)))
432 (use-modules (ice-9 ftw))
433 ;; Remove bundled libraries that we don't use, since they may
434 ;; contain unpatched security flaws, they waste disk space and
435 ;; network bandwidth, and may cause confusion.
436 (for-each delete-file-recursively
437 '(;; FIXME: Removing the bundled icu breaks configure.
438 ;; * The bundled icu headers are used in some places.
439 ;; * The version number is taken from the bundled copy.
442 ;; FIXME: A script from the bundled nspr is used.
445 ;; TODO: Use system media libraries. Waiting for:
446 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
450 ;; * libtremor (not yet in guix)
453 ;; * soundtouch (not yet in guix)
455 ;; TODO: Use system harfbuzz. Waiting for:
456 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=847568>
458 ;; TODO: Use system graphite2.
463 "ipc/chromium/src/third_party/libevent"
468 "js/src/ctypes/libffi"
470 ;; Delete .pyc files, typically present in icecat source tarballs
471 (for-each delete-file (find-files "." "\\.pyc$"))
472 ;; Delete obj-* directories, sometimes present in icecat tarballs
473 (for-each delete-file-recursively
474 (scandir "." (lambda (name)
475 (string-prefix? "obj-" name))))
477 (build-system gnu-build-system)
479 `(("alsa-lib" ,alsa-lib)
483 ("dbus-glib" ,dbus-glib)
484 ("gdk-pixbuf" ,gdk-pixbuf)
489 ("freetype" ,freetype)
490 ("hunspell" ,hunspell)
491 ("libcanberra" ,libcanberra)
492 ("libgnome" ,libgnome)
493 ("libjpeg-turbo" ,libjpeg-turbo)
495 ("libevent" ,libevent-2.0)
496 ("libxinerama" ,libxinerama)
497 ("libxscrnsaver" ,libxscrnsaver)
498 ("libxcomposite" ,libxcomposite)
505 ("pulseaudio" ,pulseaudio)
507 ("mit-krb5" ,mit-krb5)
511 ("startup-notification" ,startup-notification)
517 ("python" ,python-2) ; Python 3 not supported
518 ("python2-pysqlite" ,python2-pysqlite)
520 ("pkg-config" ,pkg-config)
521 ("autoconf" ,autoconf-2.13)
524 `(#:tests? #f ; no check target
525 #:out-of-source? #t ; must be built outside of the source directory
527 ;; XXX: There are RUNPATH issues such as
528 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
529 ;; which is not in its RUNPATH, but they appear to be harmless in
530 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
531 #:validate-runpath? #f
533 #:configure-flags '("--enable-default-toolkit=cairo-gtk3"
535 "--enable-startup-notification"
536 "--enable-pulseaudio"
541 ;; Building with debugging symbols takes ~5GiB, so
544 "--disable-debug-symbols"
546 ;; Hack to work around missing
547 ;; "unofficial" branding in icecat.
548 "--enable-official-branding"
550 ;; Avoid bundled libraries.
553 "--with-system-jpeg" ; must be libjpeg-turbo
554 "--with-system-libevent"
555 "--with-system-libvpx"
559 "--enable-system-pixman"
560 "--enable-system-cairo"
561 "--enable-system-ffi"
562 "--enable-system-hunspell"
563 "--enable-system-sqlite"
565 ;; Fails with "--with-system-png won't work because
566 ;; the system's libpng doesn't have APNG support".
568 ;; http://sourceforge.net/projects/libpng-apng/ ,
569 ;; "the Animated Portable Network Graphics (APNG)
570 ;; is an unofficial extension of the Portable
571 ;; Network Graphics (PNG) format";
572 ;; we probably do not wish to support it.
573 ;; "--with-system-png"
576 #:modules ((ice-9 ftw)
579 ,@%gnu-build-system-modules)
581 (modify-phases %standard-phases
583 'unpack 'ensure-no-mtimes-pre-1980
585 ;; Without this, the 'source/test/addons/packed.xpi' and
586 ;; 'source/test/addons/simple-prefs.xpi' targets fail while trying
587 ;; to create zip archives.
588 (let ((early-1980 315619200)) ; 1980-01-02 UTC
589 (ftw "." (lambda (file stat flag)
590 (unless (<= early-1980 (stat:mtime stat))
591 (utime file early-1980 early-1980))
595 'unpack 'use-skia-by-default
597 ;; Use the bundled Skia library by default, since IceCat appears
598 ;; to be far more stable when using it than when using our system
600 (let ((out (open "browser/app/profile/icecat.js"
601 (logior O_WRONLY O_APPEND))))
602 (format out "~%// Use Skia by default~%")
603 (format out "pref(~s, ~s);~%" "gfx.canvas.azure.backends" "skia")
604 (format out "pref(~s, ~s);~%" "gfx.content.azure.backends" "skia")
608 'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
610 ;; libxul.so dynamically opens libraries, so here we explicitly
611 ;; link them into libxul.so instead.
613 ;; TODO: It might be preferable to patch in absolute file names in
614 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
615 ;; work. More investigation is needed.
616 (substitute* "toolkit/library/moz.build"
617 (("^# This library needs to be last" all)
618 (string-append "OS_LIBS += [
619 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
620 'avcodec', 'avutil', 'pulse' ]\n\n"
625 ;; configure does not work followed by both "SHELL=..." and
626 ;; "CONFIG_SHELL=..."; set environment variables instead
627 (lambda* (#:key outputs configure-flags #:allow-other-keys)
628 (let* ((out (assoc-ref outputs "out"))
629 (bash (which "bash"))
630 (abs-srcdir (getcwd))
631 (srcdir (string-append "../" (basename abs-srcdir)))
632 (flags `(,(string-append "--prefix=" out)
633 ,(string-append "--with-l10n-base="
636 (setenv "SHELL" bash)
637 (setenv "CONFIG_SHELL" bash)
638 (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13
641 (format #t "build directory: ~s~%" (getcwd))
642 (format #t "configure flags: ~s~%" flags)
643 (zero? (apply system* bash
644 (string-append srcdir "/configure")
646 (add-before 'configure 'install-desktop-entry
647 (lambda* (#:key outputs #:allow-other-keys)
648 ;; Install the '.desktop' file.
649 (define (swallow-%%-directives input output)
650 ;; Interpret '%%ifdef' directives found in the '.desktop' file.
651 (let loop ((state 'top))
652 (match (read-line input 'concat)
656 (cond ((string-prefix? "%%ifdef" line)
658 ((string-prefix? "%%else" line)
660 ((string-prefix? "%%endif" line)
665 (display line output)
670 (let* ((out (assoc-ref outputs "out"))
671 (applications (string-append out "/share/applications")))
672 (call-with-input-file "debian/icecat.desktop.in"
674 (call-with-output-file "debian/icecat.desktop"
676 (swallow-%%-directives input output)))))
678 (substitute* "debian/icecat.desktop"
679 (("@MOZ_DISPLAY_NAME@")
681 (("^Exec=@MOZ_APP_NAME@")
682 (string-append "Exec=" out "/bin/icecat"))
685 (install-file "debian/icecat.desktop" applications)
687 (add-after 'install-desktop-entry 'install-icons
688 (lambda* (#:key outputs #:allow-other-keys)
689 (let ((out (assoc-ref outputs "out")))
690 (with-directory-excursion "browser/branding/official"
693 (let* ((size (string-filter char-numeric? file))
694 (icons (string-append out "/share/icons/hicolor/"
695 size "x" size "/apps")))
697 (copy-file file (string-append icons "/icecat.png"))))
698 '("default16.png" "default22.png" "default24.png"
699 "default32.png" "default48.png" "content/icon64.png"
700 "mozicon128.png" "default256.png"))))))
701 ;; This fixes the file chooser crash that happens with GTK 3.
702 (add-after 'install 'wrap-program
703 (lambda* (#:key inputs outputs #:allow-other-keys)
704 (let* ((out (assoc-ref outputs "out"))
705 (lib (string-append out "/lib"))
706 (gtk (assoc-ref inputs "gtk+"))
707 (gtk-share (string-append gtk "/share")))
708 (wrap-program (car (find-files lib "^icecat$"))
709 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))))
710 (home-page "https://www.gnu.org/software/gnuzilla/")
711 (synopsis "Entirely free browser derived from Mozilla Firefox")
713 "IceCat is the GNU version of the Firefox browser. It is entirely free
714 software, which does not recommend non-free plugins and addons. It also
715 features built-in privacy-protecting features.")
716 (license license:mpl2.0) ;and others, see toolkit/content/license.html
718 `((ftp-directory . "/gnu/gnuzilla")
719 (cpe-name . "firefox_esr")
720 (cpe-version . ,(first (string-split version #\-)))))))