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>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages gnuzilla)
25 #:use-module ((srfi srfi-1) #:hide (zip))
26 #:use-module (ice-9 match)
27 #:use-module (gnu packages)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix build-system gnu)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages databases)
34 #:use-module (gnu packages glib)
35 #:use-module (gnu packages gstreamer)
36 #:use-module (gnu packages gtk)
37 #:use-module (gnu packages gnome)
38 #:use-module (gnu packages libcanberra)
39 #:use-module (gnu packages cups)
40 #:use-module (gnu packages kerberos)
41 #:use-module (gnu packages linux)
42 #:use-module (gnu packages perl)
43 #:use-module (gnu packages pkg-config)
44 #:use-module (gnu packages compression)
45 #:use-module (gnu packages fontutils)
46 #:use-module (gnu packages libevent)
47 #:use-module (gnu packages libreoffice) ;for hunspell
48 #:use-module (gnu packages image)
49 #:use-module (gnu packages libffi)
50 #:use-module (gnu packages pulseaudio)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages xorg)
53 #:use-module (gnu packages gl)
54 #:use-module (gnu packages assembly)
55 #:use-module (gnu packages icu4c)
56 #:use-module (gnu packages video)
57 #:use-module (gnu packages xdisorg)
58 #:use-module (gnu packages zip))
67 "https://ftp.mozilla.org/pub/mozilla.org/js/"
68 name version ".tar.gz"))
71 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))
72 (modules '((guix build utils)))
74 ;; Fix incompatibility with Perl 5.22+.
75 '(substitute* '("js/src/config/milestone.pl")
76 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE")))))
77 (build-system gnu-build-system)
80 ("python" ,python-2)))
82 `(;; XXX: parallel build fails, lacking:
83 ;; mkdir -p "system_wrapper_js/"
92 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
93 (lambda* (#:key outputs #:allow-other-keys)
94 (let ((out (assoc-ref outputs "out")))
95 (setenv "SHELL" (which "sh"))
96 (setenv "CONFIG_SHELL" (which "sh"))
98 "./configure" (string-append "--prefix=" out)))))
101 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey")
102 (synopsis "Mozilla javascript engine")
103 (description "SpiderMonkey is Mozilla's JavaScript engine written
105 (license license:mpl2.0))) ; and others for some files
107 (define-public mozjs-24
108 (package (inherit mozjs)
114 "https://ftp.mozilla.org/pub/mozilla.org/js/"
115 name "-" version ".tar.bz2"))
118 "1n1phk8r3l8icqrrap4czplnylawa0ddc2cc4cgdz46x3lrkybz6"))
119 (modules '((guix build utils)))
121 ;; Fix incompatibility with Perl 5.22+.
122 '(substitute* '("js/src/config/milestone.pl")
123 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE")))))
125 '(;; XXX: parallel build fails, lacking:
126 ;; mkdir -p "system_wrapper_js/"
129 (modify-phases %standard-phases
132 (lambda* (#:key outputs #:allow-other-keys)
133 (let ((out (assoc-ref outputs "out")))
135 ;; configure fails if it is follwed by SHELL and CONFIG_SHELL
136 (setenv "SHELL" (which "sh"))
137 (setenv "CONFIG_SHELL" (which "sh"))
138 (zero? (system* "./configure"
139 (string-append "--prefix=" out)
141 "--enable-system-ffi"
142 "--enable-threadsafe"))))))))
145 ("pkg-config" ,pkg-config)
146 ("python" ,python-2)))
148 `(("nspr" ,nspr))) ; in the Requires.private field of mozjs-24.pc
160 "https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v"
161 version "/src/nspr-" version ".tar.gz"))
164 "1arkg08l6zlp8v44shqbk2c8qzwd913lgh60fb3yfxls6d8ifk2y"))))
165 (build-system gnu-build-system)
169 `(#:tests? #f ; no check target
170 #:configure-flags (list "--enable-64bit"
171 (string-append "LDFLAGS=-Wl,-rpath="
172 (assoc-ref %outputs "out")
174 #:phases (alist-cons-before
180 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR")
181 (synopsis "Netscape API for system level and libc-like functions")
182 (description "Netscape Portable Runtime (NSPR) provides a
183 platform-neutral API for system level and libc-like functions. It is used
184 in the Mozilla clients.")
185 (license license:mpl2.0)))
193 (uri (let ((version-with-underscores
194 (string-join (string-split version #\.) "_")))
196 "https://ftp.mozilla.org/pub/mozilla.org/security/nss/"
197 "releases/NSS_" version-with-underscores "_RTM/src/"
198 "nss-" version ".tar.gz")))
201 "149807rmzb76hnh48rw4m9jw83iw0168njzchz0hmbsgc8mk0i5w"))
202 ;; Create nss.pc and nss-config.
203 (patches (search-patches "nss-pkgconfig.patch"))))
204 (build-system gnu-build-system)
205 (outputs '("out" "bin"))
207 `(#:parallel-build? #f ; not supported
209 (let* ((out (assoc-ref %outputs "out"))
210 (nspr (string-append (assoc-ref %build-inputs "nspr")))
211 (rpath (string-append "-Wl,-rpath=" out "/lib/nss")))
212 (list "-C" "nss" (string-append "PREFIX=" out)
214 "NSS_USE_SYSTEM_SQLITE=1"
215 (string-append "NSPR_INCLUDE_DIR=" nspr "/include/nspr")
216 ;; Add $out/lib/nss to RPATH.
217 (string-append "RPATH=" rpath)
218 (string-append "LDFLAGS=" rpath)))
219 #:modules ((guix build gnu-build-system)
225 (modify-phases %standard-phases
229 ;; Tells NSS to build for the 64-bit ABI if we are 64-bit system.
230 ,@(match (%current-system)
231 ((or "x86_64-linux" "aarch64-linux")
232 `((setenv "USE_64" "1")))
238 ;; Use 127.0.0.1 instead of $HOST.$DOMSUF as HOSTADDR for testing.
239 ;; The later requires a working DNS or /etc/hosts.
240 (setenv "DOMSUF" "(none)")
241 (setenv "USE_IP" "TRUE")
242 (setenv "IP_ADDRESS" "127.0.0.1")
243 (zero? (system* "./nss/tests/all.sh"))))
245 (lambda* (#:key outputs #:allow-other-keys)
246 (let* ((out (assoc-ref outputs "out"))
247 (bin (string-append (assoc-ref outputs "bin") "/bin"))
248 (inc (string-append out "/include/nss"))
249 (lib (string-append out "/lib/nss"))
250 (obj (match (scandir "dist" (cut string-suffix? "OBJ" <>))
251 ((obj) (string-append "dist/" obj)))))
252 ;; Install nss-config to $out/bin.
253 (install-file (string-append obj "/bin/nss-config")
254 (string-append out "/bin"))
255 (delete-file (string-append obj "/bin/nss-config"))
256 ;; Install nss.pc to $out/lib/pkgconfig.
257 (install-file (string-append obj "/lib/pkgconfig/nss.pc")
258 (string-append out "/lib/pkgconfig"))
259 (delete-file (string-append obj "/lib/pkgconfig/nss.pc"))
260 (rmdir (string-append obj "/lib/pkgconfig"))
261 ;; Install other files.
262 (copy-recursively "dist/public/nss" inc)
263 (copy-recursively (string-append obj "/bin") bin)
264 (copy-recursively (string-append obj "/lib") lib)
266 ;; FIXME: libgtest1.so is installed in the above step, and it's
267 ;; (unnecessarily) linked with several NSS libraries, but
268 ;; without the needed rpaths, causing the 'validate-runpath'
269 ;; phase to fail. Here we simply delete libgtest1.so, since it
270 ;; seems to be used only during the tests.
271 (delete-file (string-append lib "/libgtest1.so"))
277 (propagated-inputs `(("nspr" ,nspr))) ; required by nss.pc.
278 (native-inputs `(("perl" ,perl)))
280 ;; The NSS test suite takes around 48 hours on Loongson 3A (MIPS) when
281 ;; another build is happening concurrently on the same machine.
282 (properties '((timeout . 216000))) ; 60 hours
285 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS")
286 (synopsis "Network Security Services")
288 "Network Security Services (NSS) is a set of libraries designed to support
289 cross-platform development of security-enabled client and server applications.
290 Applications built with NSS can support SSL v2 and v3, TLS, PKCS #5, PKCS #7,
291 PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other security
293 (license license:mpl2.0)))
295 (define (mozilla-patch file-name changeset hash)
296 "Return an origin for CHANGESET from the mozilla-esr45 repository."
299 (uri (string-append "https://hg.mozilla.org/releases/mozilla-esr45/raw-rev/"
301 (sha256 (base32 hash))
302 (file-name file-name)))
304 (define-public icecat
307 (version "45.7.0-gnu1")
311 (uri (string-append "mirror://gnu/gnuzilla/"
312 (first (string-split version #\-))
313 "/" name "-" version ".tar.bz2"))
316 "1mn73liylqzxk441f28wk326yglqs8zcwqs4zz51s8i2id2jsnv3"))
319 (search-patch "icecat-avoid-bundled-libraries.patch")
320 (search-patch "icecat-binutils.patch")
321 (mozilla-patch "icecat-CVE-2017-5398-pt01.patch" "1a39a54b5fea" "0k3sbf2w2yng2rpv6wl9zrm5cbsgq3pslr19xwrk8sk753as79fp")
322 (mozilla-patch "icecat-CVE-2017-5402.patch" "9828c3bb7b73" "0zgks0v9sqhwwkmry4daswvjwk6aqln6abx0iac1vwqqpg6swff6")
323 (mozilla-patch "icecat-CVE-2017-5398-pt02.patch" "fa3268a1147e" "1jyd1hvp42pz5l15agmb1jhw74b38x8xnj9ih5v4pskv41bgmyg5")
324 (mozilla-patch "icecat-CVE-2017-5400.patch" "347c10e4d6d1" "1w6yrm97l477q4ripbj0nimc87p4jscabvihpncxqbq9xzc4km7p")
325 (mozilla-patch "icecat-CVE-2017-5410.patch" "fe4a2cda54ad" "0spcs93hpz13d8670jgvww80f0ynrbhwbh62fkv27lpr6wmqwqh1")
326 (mozilla-patch "icecat-CVE-2017-5401.patch" "c38f8546be5f" "1sa22w9kzgynsn4c6zh4d66byskk5kffzbvlzrhyzvqjddypf9p8")
327 (mozilla-patch "icecat-CVE-2017-5398-pt03.patch" "41c80ecafa99" "0r33arr5wcgl00zgncasiyl65bmm6jy45clxnbb75nzjmsd1zx1s")
328 (mozilla-patch "icecat-CVE-2017-5405.patch" "381552c888b4" "1sjhh390cx1jqx74lxk6qd8f8ccppqgagqfhc9pnbm2m67hxvkj9")
329 (mozilla-patch "icecat-CVE-2017-5407.patch" "4ba337cdb998" "0vyknizid2z9nvl31m08c7fknizhv8dh8m54apm39k8lx77vf70p")
330 (mozilla-patch "icecat-CVE-2017-5398-pt04.patch" "886650fac531" "18fsr5dmav96ja0dah7mj34n8mjpckp0bbc32zjyaj5qx0m4h5cw")
331 (mozilla-patch "icecat-CVE-2017-5409.patch" "0a22becb23cd" "19fshrq4qkj5s0mjrads6by84gy7rsq3k57gha6sw6rvx8chjaz6")
332 (mozilla-patch "icecat-CVE-2017-5398-pt05.patch" "a0ead6ef09eb" "1hpsq81hhhq2a2dcq2dfndiwx93vvp5rfq0cgv6kwk2bsrq77wqq")
333 (mozilla-patch "icecat-CVE-2017-5398-pt06.patch" "d3fede027d06" "1aw02p367cm0ayijdiiawlb7qhab6jwqwkakj317yd1cjnmkalwr")
334 (mozilla-patch "icecat-CVE-2017-5398-pt07.patch" "ffca0f060bb4" "0qwisfp7idjj5nc1vp1afrf5lj66l2gp7rllkjmrqpz6cyfc708v")
335 (mozilla-patch "icecat-CVE-2017-5398-pt08.patch" "4aa65b44dcb9" "07j6dz2b7hp1bkfvkxwgpn2wc3hqrgjgwpaz96fcpz8yadg2fssw")
336 (mozilla-patch "icecat-bug-1318914.patch" "30e2382d800f" "0w8zky5i7zc5q943x37rdvi4wbcing0q7w9fcgvnnh5li2sbrsy8")
337 (mozilla-patch "icecat-CVE-2017-5408.patch" "403d2300adc2" "06r4j48rc1fd9gvmvqy68mlqah5xfxpkvwmxk0gnqc364kpq9slk")
338 (mozilla-patch "icecat-CVE-2017-5398-pt09.patch" "546ab5e99568" "05rdb9bm3n4lj0zq5a95xnwsb0vzirb9mbc2wf9xbi4xlamsgvvw")
339 (mozilla-patch "icecat-bug-1311380.patch" "ef6eeb7f8846" "1w19is5blbrwf3wlmy6wzgabih8sxp2kmkffqcj2g4jypfwyqn73")
340 (mozilla-patch "icecat-CVE-2017-5398-pt10.patch" "eec69810d80e" "1r20abhw7b38igsrdpkhcfwx9i9gmcxikv4y3sjr4wkbp684f7av")
341 (mozilla-patch "icecat-CVE-2017-5398-pt11.patch" "fec35ce6e68b" "1imdfrs8dxz44rhsmvydh29w5j64cij6g5ggrmhvz3386xvlil2v")
342 (mozilla-patch "icecat-CVE-2017-5398-pt12.patch" "725e2a217722" "06gfhi2ich279rjnxi15fb4igimsxnv5w6bx4g91js8wbvp2r3v0")
343 (mozilla-patch "icecat-CVE-2017-5398-pt13.patch" "d905a2e3a4d9" "1ibxi2s0czj47b739zmmjzbln8lpn27hdg4b17w58vhbhzkq31cx")
344 (mozilla-patch "icecat-CVE-2017-5398-pt14.patch" "0032560ae945" "0md3p5cix6nzbj5m199awc9gk52pygy5s9lx3a38vh3xvd92lsbj")
345 (mozilla-patch "icecat-CVE-2017-5398-pt15.patch" "91dda1e79ad8" "0b5h8fhagczfqkdgby982w6qgkw9y11zxxpdbn89rwmjpyp9nghx")
346 (mozilla-patch "icecat-CVE-2017-5404.patch" "556dd9e4a9e3" "0mbdx4xn1xs67n47ys9m42lc5ny96rz21ala848yajpdlxsz680g")
347 (mozilla-patch "icecat-bug-1341137-pt1.patch" "e86e0423dad1" "0dk1v7lcs61nx76qxcibha3ygqri15ldcvwwsrsayff9fq6k0v4y")
348 (mozilla-patch "icecat-bug-1341137-pt2.patch" "9aebee8b8cb9" "0m7p5iprhhwdv89aqqg7fla5szw6v7x2sll4ns0zg60pk4vm6izq")
349 (mozilla-patch "icecat-bug-1341137-pt3.patch" "69f3d44bdb48" "1ad7rw6nmg3c49ylqxlqqkb6cm2f0ygfzrigs6b60a2zkjqhbl0h")
350 (mozilla-patch "icecat-bug-1341137-pt4.patch" "22546e2cee64" "0gbwxa3p7qkq53hwnvxcqhx8h34qmnjdxy0h3ajik4mw76vrna9s")
351 (mozilla-patch "icecat-bug-1341137-pt5.patch" "e5083d8a855a" "1247vbpqzf007nigbxxqd6nwgr1dxd4p8cd0dr45afqh19vhlapj")
352 (mozilla-patch "icecat-bug-1339122.patch" "b0d156c7445e" "026jp5bb565yvhkmmicgygcn1lmak85p0466yl1vnjlx1rc8n724")))
353 (modules '((guix build utils)))
356 (use-modules (ice-9 ftw))
357 ;; Remove bundled libraries that we don't use, since they may
358 ;; contain unpatched security flaws, they waste disk space and
359 ;; network bandwidth, and may cause confusion.
360 (for-each delete-file-recursively
361 '(;; FIXME: Removing the bundled icu breaks configure.
362 ;; * The bundled icu headers are used in some places.
363 ;; * The version number is taken from the bundled copy.
366 ;; FIXME: A script from the bundled nspr is used.
369 ;; TODO: Use system media libraries. Waiting for:
370 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
374 ;; * libtremor (not yet in guix)
377 ;; * soundtouch (not yet in guix)
379 ;; TODO: Use system harfbuzz. Waiting for:
380 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=847568>
382 ;; TODO: Use system graphite2.
387 "ipc/chromium/src/third_party/libevent"
392 "js/src/ctypes/libffi"
394 ;; Delete .pyc files, typically present in icecat source tarballs
395 (for-each delete-file (find-files "." "\\.pyc$"))
396 ;; Delete obj-* directories, sometimes present in icecat tarballs
397 (for-each delete-file-recursively
398 (scandir "." (lambda (name)
399 (string-prefix? "obj-" name))))
401 (build-system gnu-build-system)
403 `(("alsa-lib" ,alsa-lib)
407 ("dbus-glib" ,dbus-glib)
408 ("gdk-pixbuf" ,gdk-pixbuf)
410 ("gstreamer" ,gstreamer)
411 ("gst-plugins-base" ,gst-plugins-base)
414 ("freetype" ,freetype)
415 ("hunspell" ,hunspell)
416 ("libcanberra" ,libcanberra)
417 ("libgnome" ,libgnome)
418 ("libjpeg-turbo" ,libjpeg-turbo)
420 ("libevent" ,libevent-2.0)
421 ("libxinerama" ,libxinerama)
422 ("libxscrnsaver" ,libxscrnsaver)
423 ("libxcomposite" ,libxcomposite)
429 ("pulseaudio" ,pulseaudio)
431 ("mit-krb5" ,mit-krb5)
435 ("startup-notification" ,startup-notification)
442 ("python" ,python-2) ; Python 3 not supported
443 ("python2-pysqlite" ,python2-pysqlite)
444 ("pkg-config" ,pkg-config)
447 `(#:tests? #f ; no check target
448 #:out-of-source? #t ; must be built outside of the source directory
451 ;; XXX: There are RUNPATH issues such as
452 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
453 ;; which is not in its RUNPATH, but they appear to be harmless in
454 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
455 #:validate-runpath? #f
457 #:configure-flags '("--enable-default-toolkit=cairo-gtk2"
463 "--enable-startup-notification"
464 "--enable-pulseaudio"
465 "--enable-gstreamer=1.0"
471 ;; Building with debugging symbols takes ~5GiB, so
474 "--disable-debug-symbols"
476 ;; Hack to work around missing
477 ;; "unofficial" branding in icecat.
478 "--enable-official-branding"
480 ;; Avoid bundled libraries.
483 "--with-system-jpeg" ; must be libjpeg-turbo
484 "--with-system-libevent"
485 "--with-system-libvpx"
489 "--enable-system-pixman"
490 "--enable-system-cairo"
491 "--enable-system-ffi"
492 "--enable-system-hunspell"
493 "--enable-system-sqlite"
495 ;; Fails with "--with-system-png won't work because
496 ;; the system's libpng doesn't have APNG support".
498 ;; http://sourceforge.net/projects/libpng-apng/ ,
499 ;; "the Animated Portable Network Graphics (APNG)
500 ;; is an unofficial extension of the Portable
501 ;; Network Graphics (PNG) format";
502 ;; we probably do not wish to support it.
503 ;; "--with-system-png"
506 #:modules ((ice-9 ftw)
509 ,@%gnu-build-system-modules)
511 (modify-phases %standard-phases
513 'unpack 'ensure-no-mtimes-pre-1980
515 ;; Without this, the 'source/test/addons/packed.xpi' and
516 ;; 'source/test/addons/simple-prefs.xpi' targets fail while trying
517 ;; to create zip archives.
518 (let ((early-1980 315619200)) ; 1980-01-02 UTC
519 (ftw "." (lambda (file stat flag)
520 (unless (<= early-1980 (stat:mtime stat))
521 (utime file early-1980 early-1980))
525 'unpack 'remove-h264parse-from-blacklist
527 ;; Remove h264parse from gstreamer format helper blacklist. It
528 ;; was put there to work around a bug in a pre-1.0 version of
530 ;; https://www.mozilla.org/en-US/security/advisories/mfsa2015-47/
531 (substitute* "dom/media/gstreamer/GStreamerFormatHelper.cpp"
532 (("^ \"h264parse\",\n") ""))
535 'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
537 ;; libxul.so dynamically opens libraries, so here we explicitly
538 ;; link them into libxul.so instead.
540 ;; TODO: It might be preferable to patch in absolute file names in
541 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
542 ;; work. More investigation is needed.
543 (substitute* "toolkit/library/moz.build"
544 (("^# This needs to be last")
546 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
547 'gstreamer-1.0', 'gstapp-1.0', 'gstvideo-1.0' ]\n\n"))
551 ;; configure does not work followed by both "SHELL=..." and
552 ;; "CONFIG_SHELL=..."; set environment variables instead
553 (lambda* (#:key outputs configure-flags #:allow-other-keys)
554 (let* ((out (assoc-ref outputs "out"))
555 (bash (which "bash"))
556 (abs-srcdir (getcwd))
557 (srcdir (string-append "../" (basename abs-srcdir)))
558 (flags `(,(string-append "--prefix=" out)
559 ,(string-append "--with-l10n-base="
562 (setenv "SHELL" bash)
563 (setenv "CONFIG_SHELL" bash)
566 (format #t "build directory: ~s~%" (getcwd))
567 (format #t "configure flags: ~s~%" flags)
568 (zero? (apply system* bash
569 (string-append srcdir "/configure")
571 (add-before 'configure 'install-desktop-entry
572 (lambda* (#:key outputs #:allow-other-keys)
573 ;; Install the '.desktop' file.
574 (define (swallow-%%-directives input output)
575 ;; Interpret '%%ifdef' directives found in the '.desktop' file.
576 (let loop ((state 'top))
577 (match (read-line input 'concat)
581 (cond ((string-prefix? "%%ifdef" line)
583 ((string-prefix? "%%else" line)
585 ((string-prefix? "%%endif" line)
590 (display line output)
595 (let* ((out (assoc-ref outputs "out"))
596 (applications (string-append out "/share/applications")))
597 (call-with-input-file "debian/icecat.desktop.in"
599 (call-with-output-file "debian/icecat.desktop"
601 (swallow-%%-directives input output)))))
603 (substitute* "debian/icecat.desktop"
604 (("@MOZ_DISPLAY_NAME@")
606 (("^Exec=@MOZ_APP_NAME@")
607 (string-append "Exec=" out "/bin/icecat"))
610 (install-file "debian/icecat.desktop" applications)
612 (add-after 'install-desktop-entry 'install-icons
613 (lambda* (#:key outputs #:allow-other-keys)
614 (let ((out (assoc-ref outputs "out")))
615 (with-directory-excursion "browser/branding/official"
618 (let* ((size (string-filter char-numeric? file))
619 (icons (string-append out "/share/icons/hicolor/"
620 size "x" size "/apps")))
622 (copy-file file (string-append icons "/icecat.png"))))
623 '("default16.png" "default22.png" "default24.png"
624 "default32.png" "default48.png" "content/icon64.png"
625 "mozicon128.png" "default256.png")))))))))
626 (home-page "http://www.gnu.org/software/gnuzilla/")
627 (synopsis "Entirely free browser derived from Mozilla Firefox")
629 "IceCat is the GNU version of the Firefox browser. It is entirely free
630 software, which does not recommend non-free plugins and addons. It also
631 features built-in privacy-protecting features.")
632 (license license:mpl2.0) ;and others, see toolkit/content/license.html
634 `((ftp-directory . "/gnu/gnuzilla")
635 (cpe-name . "firefox_esr")
636 (cpe-version . ,(first (string-split version #\-)))))))