1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
6 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages gnuzilla)
24 #:use-module ((srfi srfi-1) #:hide (zip))
25 #:use-module (gnu packages)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix build-system gnu)
30 #:use-module (gnu packages databases)
31 #:use-module (gnu packages glib)
32 #:use-module (gnu packages gstreamer)
33 #:use-module (gnu packages gtk)
34 #:use-module (gnu packages gnome)
35 #:use-module (gnu packages libcanberra)
36 #:use-module (gnu packages cups)
37 #:use-module (gnu packages mit-krb5)
38 #:use-module (gnu packages linux)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages fontutils)
43 #:use-module (gnu packages libevent)
44 #:use-module (gnu packages libreoffice) ;for hunspell
45 #:use-module (gnu packages image)
46 #:use-module (gnu packages libffi)
47 #:use-module (gnu packages pulseaudio)
48 #:use-module (gnu packages python)
49 #:use-module (gnu packages xorg)
50 #:use-module (gnu packages gl)
51 #:use-module (gnu packages yasm)
52 #:use-module (gnu packages icu4c)
53 #:use-module (gnu packages video)
54 #:use-module (gnu packages xdisorg)
55 #:use-module (gnu packages zip))
64 "https://ftp.mozilla.org/pub/mozilla.org/js/"
65 name version ".tar.gz"))
68 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))
69 (modules '((guix build utils)))
71 ;; Fix incompatibility with Perl 5.22+.
72 '(substitute* '("js/src/config/milestone.pl")
73 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE")))))
74 (build-system gnu-build-system)
77 ("python" ,python-2)))
86 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
87 (lambda* (#:key outputs #:allow-other-keys)
88 (let ((out (assoc-ref outputs "out")))
89 (setenv "SHELL" (which "sh"))
90 (setenv "CONFIG_SHELL" (which "sh"))
92 "./configure" (string-append "--prefix=" out)))))
95 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey")
96 (synopsis "Mozilla javascript engine")
97 (description "SpiderMonkey is Mozilla's JavaScript engine written
99 (license license:mpl2.0))) ; and others for some files
101 (define-public mozjs-24
102 (package (inherit mozjs)
108 "https://ftp.mozilla.org/pub/mozilla.org/js/"
109 name "-" version ".tar.bz2"))
112 "1n1phk8r3l8icqrrap4czplnylawa0ddc2cc4cgdz46x3lrkybz6"))
113 (modules '((guix build utils)))
115 ;; Fix incompatibility with Perl 5.22+.
116 '(substitute* '("js/src/config/milestone.pl")
117 (("defined\\(@TEMPLATE_FILE)") "@TEMPLATE_FILE")))))
120 (modify-phases %standard-phases
123 (lambda* (#:key outputs #:allow-other-keys)
124 (let ((out (assoc-ref outputs "out")))
126 ;; configure fails if it is follwed by SHELL and CONFIG_SHELL
127 (setenv "SHELL" (which "sh"))
128 (setenv "CONFIG_SHELL" (which "sh"))
129 (zero? (system* "./configure"
130 (string-append "--prefix=" out)
132 "--enable-system-ffi"
133 "--enable-threadsafe"))))))))
136 ("pkg-config" ,pkg-config)
137 ("python" ,python-2)))
139 `(("nspr" ,nspr))) ; in the Requires.private field of mozjs-24.pc
151 "https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v"
152 version "/src/nspr-" version ".tar.gz"))
155 "01ria9wk6329hxqsy75p9dkxiqkq4nkz0jjzll7hslih3jbi8dil"))))
156 (build-system gnu-build-system)
160 `(#:tests? #f ; no check target
161 #:configure-flags (list "--enable-64bit"
162 (string-append "LDFLAGS=-Wl,-rpath="
163 (assoc-ref %outputs "out")
165 #:phases (alist-cons-before
171 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR")
172 (synopsis "Netscape API for system level and libc-like functions")
173 (description "Netscape Portable Runtime (NSPR) provides a
174 platform-neutral API for system level and libc-like functions. It is used
175 in the Mozilla clients.")
176 (license license:mpl2.0)))
184 (uri (let ((version-with-underscores
185 (string-join (string-split version #\.) "_")))
187 "https://ftp.mozilla.org/pub/mozilla.org/security/nss/"
188 "releases/NSS_" version-with-underscores "_RTM/src/"
189 "nss-" version ".tar.gz")))
192 "0knr99yc8sba2ga6x1gwhg9gr1dmgcl344g3bmxm8c364i2vpxns"))
193 ;; Create nss.pc and nss-config.
194 (patches (search-patches "nss-pkgconfig.patch"))))
195 (build-system gnu-build-system)
196 (outputs '("out" "bin"))
198 '(#:parallel-build? #f ; failed
200 (let* ((out (assoc-ref %outputs "out"))
201 (nspr (string-append (assoc-ref %build-inputs "nspr")))
202 (rpath (string-append "-Wl,-rpath=" out "/lib/nss")))
203 (list "-C" "nss" (string-append "PREFIX=" out)
205 "NSS_USE_SYSTEM_SQLITE=1"
206 (string-append "NSPR_INCLUDE_DIR=" nspr "/include/nspr")
207 ;; Add $out/lib/nss to RPATH.
208 (string-append "RPATH=" rpath)
209 (string-append "LDFLAGS=" rpath)))
210 #:modules ((guix build gnu-build-system)
218 (lambda* (#:key system inputs #:allow-other-keys)
220 ;; Tells NSS to build for the 64-bit ABI if we are 64-bit system.
221 (when (string-prefix? "x86_64" system)
222 (setenv "USE_64" "1"))
227 ;; Use 127.0.0.1 instead of $HOST.$DOMSUF as HOSTADDR for testing.
228 ;; The later requires a working DNS or /etc/hosts.
229 (setenv "DOMSUF" "(none)")
230 (setenv "USE_IP" "TRUE")
231 (setenv "IP_ADDRESS" "127.0.0.1")
232 (zero? (system* "./nss/tests/all.sh")))
235 (lambda* (#:key outputs #:allow-other-keys)
236 (let* ((out (assoc-ref outputs "out"))
237 (bin (string-append (assoc-ref outputs "bin") "/bin"))
238 (inc (string-append out "/include/nss"))
239 (lib (string-append out "/lib/nss"))
240 (obj (match (scandir "dist" (cut string-suffix? "OBJ" <>))
241 ((obj) (string-append "dist/" obj)))))
242 ;; Install nss-config to $out/bin.
243 (install-file (string-append obj "/bin/nss-config")
244 (string-append out "/bin"))
245 (delete-file (string-append obj "/bin/nss-config"))
246 ;; Install nss.pc to $out/lib/pkgconfig.
247 (install-file (string-append obj "/lib/pkgconfig/nss.pc")
248 (string-append out "/lib/pkgconfig"))
249 (delete-file (string-append obj "/lib/pkgconfig/nss.pc"))
250 (rmdir (string-append obj "/lib/pkgconfig"))
251 ;; Install other files.
252 (copy-recursively "dist/public/nss" inc)
253 (copy-recursively (string-append obj "/bin") bin)
254 (copy-recursively (string-append obj "/lib") lib)))
255 %standard-phases)))))
259 (propagated-inputs `(("nspr" ,nspr))) ; required by nss.pc.
260 (native-inputs `(("perl" ,perl)))
262 ;; The NSS test suite takes over 28 hours on Loongson 3A (MIPS), and
263 ;; possibly longer when another build is happening concurrently on the
265 (properties '((timeout . 144000))) ; 40 hours
268 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS")
269 (synopsis "Network Security Services")
271 "Network Security Services (NSS) is a set of libraries designed to support
272 cross-platform development of security-enabled client and server applications.
273 Applications built with NSS can support SSL v2 and v3, TLS, PKCS #5, PKCS #7,
274 PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other security
276 (license license:mpl2.0)))
278 (define-public icecat
281 (version "38.7.1-gnu1")
285 (uri (string-append "mirror://gnu/gnuzilla/"
286 (first (string-split version #\-)) "/"
287 name "-" version ".tar.bz2"))
290 "1wdmd6hasra36g86ha1dw8sl7a5mvr7c4jbjx4zyg9629y5gqr8g"))
291 (patches (search-patches
292 "icecat-avoid-bundled-includes.patch"
293 "icecat-re-enable-DHE-cipher-suites.patch"))
294 (modules '((guix build utils)))
297 ;; Remove bundled libraries that we don't use, since they may
298 ;; contain unpatched security flaws, they waste disk space and
299 ;; network bandwidth, and may cause confusion.
300 (for-each delete-file-recursively
301 '(;; FIXME: Removing the bundled icu breaks configure.
302 ;; * The bundled icu headers are used in some places.
303 ;; * The version number is taken from the bundled copy.
306 ;; FIXME: A script from the bundled nspr is used.
309 ;; TODO: Use system media libraries. Waiting for:
310 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
314 ;; * libtremor (not yet in guix)
317 ;; * soundtouch (not yet in guix)
319 ;; TODO: Use system harfbuzz. Waiting for:
320 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=847568>
322 ;; TODO: Use system graphite2.
327 "ipc/chromium/src/third_party/libevent"
331 "js/src/ctypes/libffi"
334 (build-system gnu-build-system)
336 `(("alsa-lib" ,alsa-lib)
340 ("dbus-glib" ,dbus-glib)
341 ("gdk-pixbuf" ,gdk-pixbuf)
343 ("gstreamer" ,gstreamer)
344 ("gst-plugins-base" ,gst-plugins-base)
347 ("freetype" ,freetype)
348 ("hunspell" ,hunspell)
349 ("libcanberra" ,libcanberra)
350 ("libgnome" ,libgnome)
352 ("libevent" ,libevent)
353 ("libxinerama" ,libxinerama)
354 ("libxscrnsaver" ,libxscrnsaver)
355 ("libxcomposite" ,libxcomposite)
361 ("pulseaudio" ,pulseaudio)
363 ("mit-krb5" ,mit-krb5)
367 ("startup-notification" ,startup-notification)
374 ("python" ,python-2) ; Python 3 not supported
375 ("python2-pysqlite" ,python2-pysqlite)
376 ("pkg-config" ,pkg-config)))
378 `(#:tests? #f ; no check target
379 #:out-of-source? #t ; must be built outside of the source directory
382 ;; XXX: There are RUNPATH issues such as
383 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
384 ;; which is not in its RUNPATH, but they appear to be harmless in
385 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
386 #:validate-runpath? #f
388 #:configure-flags '("--enable-default-toolkit=cairo-gtk2"
394 "--enable-startup-notification"
395 "--enable-pulseaudio"
396 "--enable-gstreamer=1.0"
402 ;; Building with debugging symbols takes ~5GiB, so
405 "--disable-debug-symbols"
407 ;; Avoid bundled libraries.
410 "--with-system-libevent"
411 "--with-system-libvpx"
415 "--enable-system-pixman"
416 "--enable-system-cairo"
417 "--enable-system-ffi"
418 "--enable-system-hunspell"
419 "--enable-system-sqlite"
421 ;; Fails with "--with-system-png won't work because
422 ;; the system's libpng doesn't have APNG support".
424 ;; http://sourceforge.net/projects/libpng-apng/ ,
425 ;; "the Animated Portable Network Graphics (APNG)
426 ;; is an unofficial extension of the Portable
427 ;; Network Graphics (PNG) format";
428 ;; we probably do not wish to support it.
429 ;; "--with-system-png"
431 ;; Fails with "libjpeg-turbo JCS_EXTENSIONS
434 ;; http://sourceforge.net/projects/libjpeg-turbo/ ,
435 ;; "libjpeg-turbo is a derivative of libjpeg that
436 ;; uses MMX, SSE, SSE2, and NEON SIMD instructions
437 ;; to accelerate baseline JPEG compression/
438 ;; decompression", so we had better not use it
439 ;; "--with-system-jpeg"
442 #:modules ((ice-9 ftw)
443 ,@%gnu-build-system-modules)
445 (modify-phases %standard-phases
447 'unpack 'ensure-no-mtimes-pre-1980
449 ;; Without this, the 'source/test/addons/packed.xpi' and
450 ;; 'source/test/addons/simple-prefs.xpi' targets fail while trying
451 ;; to create zip archives.
452 (let ((early-1980 315619200)) ; 1980-01-02 UTC
453 (ftw "." (lambda (file stat flag)
454 (unless (<= early-1980 (stat:mtime stat))
455 (utime file early-1980 early-1980))
459 'unpack 'remove-h264parse-from-blacklist
461 ;; Remove h264parse from gstreamer format helper blacklist. It
462 ;; was put there to work around a bug in a pre-1.0 version of
464 ;; https://www.mozilla.org/en-US/security/advisories/mfsa2015-47/
465 (substitute* "dom/media/gstreamer/GStreamerFormatHelper.cpp"
466 (("^ \"h264parse\",\n") ""))
469 'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
471 ;; libxul.so dynamically opens libraries, so here we explicitly
472 ;; link them into libxul.so instead.
474 ;; TODO: It might be preferable to patch in absolute file names in
475 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
476 ;; work. More investigation is needed.
477 (substitute* "toolkit/library/moz.build"
478 (("^# This needs to be last")
480 'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
481 'gstreamer-1.0', 'gstapp-1.0', 'gstvideo-1.0' ]\n\n"))
485 ;; configure does not work followed by both "SHELL=..." and
486 ;; "CONFIG_SHELL=..."; set environment variables instead
487 (lambda* (#:key outputs configure-flags #:allow-other-keys)
488 (let* ((out (assoc-ref outputs "out"))
489 (bash (which "bash"))
490 (abs-srcdir (getcwd))
491 (srcdir (string-append "../" (basename abs-srcdir)))
492 (flags `(,(string-append "--prefix=" out)
493 ,(string-append "--with-l10n-base="
496 (setenv "SHELL" bash)
497 (setenv "CONFIG_SHELL" bash)
500 (format #t "build directory: ~s~%" (getcwd))
501 (format #t "configure flags: ~s~%" flags)
502 (zero? (apply system* bash
503 (string-append srcdir "/configure")
505 (home-page "http://www.gnu.org/software/gnuzilla/")
506 (synopsis "Entirely free browser derived from Mozilla Firefox")
508 "IceCat is the GNU version of the Firefox browser. It is entirely free
509 software, which does not recommend non-free plugins and addons. It also
510 features built-in privacy-protecting features.")
511 (license license:mpl2.0) ;and others, see toolkit/content/license.html
512 (properties '((ftp-directory . "/gnu/gnuzilla")))))