gnu: geiser: Update to 0.8.1.
[jackhill/guix/guix.git] / gnu / packages / gnuzilla.scm
CommitLineData
be0f6112 1;;; GNU Guix --- Functional package management for GNU
5deea4fc 2;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
8f3c3e84 3;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
2a666e9c 4;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
1aaaff1a 5;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
be0f6112
AE
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages gnuzilla)
07d4d9b7 23 #:use-module ((srfi srfi-1) #:hide (zip))
be0f6112 24 #:use-module (gnu packages)
b5b73a82 25 #:use-module ((guix licenses) #:prefix license:)
be0f6112
AE
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix build-system gnu)
1aaaff1a 29 #:use-module (gnu packages databases)
be0f6112
AE
30 #:use-module (gnu packages glib)
31 #:use-module (gnu packages gstreamer)
32 #:use-module (gnu packages gtk)
90e1cdae
MW
33 #:use-module (gnu packages gnome)
34 #:use-module (gnu packages libcanberra)
35 #:use-module (gnu packages cups)
36 #:use-module (gnu packages mit-krb5)
be0f6112
AE
37 #:use-module (gnu packages linux)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages pkg-config)
1ae6df81 40 #:use-module (gnu packages compression)
74c7af9f 41 #:use-module (gnu packages fontutils)
1ae6df81 42 #:use-module (gnu packages libevent)
90e1cdae 43 #:use-module (gnu packages libreoffice) ;for hunspell
e55354b8 44 #:use-module (gnu packages image)
1ae6df81 45 #:use-module (gnu packages libffi)
74c7af9f 46 #:use-module (gnu packages pulseaudio)
be0f6112
AE
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages xorg)
200726ed 49 #:use-module (gnu packages gl)
be0f6112 50 #:use-module (gnu packages yasm)
13b284d9
MW
51 #:use-module (gnu packages icu4c)
52 #:use-module (gnu packages video)
53 #:use-module (gnu packages xdisorg)
be0f6112
AE
54 #:use-module (gnu packages zip))
55
4923e06f
SB
56(define-public mozjs
57 (package
58 (name "mozjs")
59 (version "17.0.0")
60 (source (origin
61 (method url-fetch)
62 (uri (string-append
63 "https://ftp.mozilla.org/pub/mozilla.org/js/"
64 name version ".tar.gz"))
65 (sha256
66 (base32
67 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))))
68 (build-system gnu-build-system)
69 (native-inputs
70 `(("perl", perl)
71 ("python" ,python-2)))
72 (arguments
73 `(#:phases
74 (alist-cons-before
75 'configure 'chdir
76 (lambda _
77 (chdir "js/src"))
78 (alist-replace
79 'configure
80 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
81 (lambda* (#:key outputs #:allow-other-keys)
82 (let ((out (assoc-ref outputs "out")))
83 (setenv "SHELL" (which "sh"))
84 (setenv "CONFIG_SHELL" (which "sh"))
85 (zero? (system*
86 "./configure" (string-append "--prefix=" out)))))
87 %standard-phases))))
88 (home-page
89 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey")
90 (synopsis "Mozilla javascript engine")
91 (description "SpiderMonkey is Mozilla's JavaScript engine written
92in C/C++.")
87158e85 93 (license license:mpl2.0))) ; and others for some files
4923e06f
SB
94
95(define-public nspr
96 (package
97 (name "nspr")
61427c8d 98 (version "4.10.8")
4923e06f
SB
99 (source (origin
100 (method url-fetch)
101 (uri (string-append
102 "https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v"
103 version "/src/nspr-" version ".tar.gz"))
104 (sha256
105 (base32
61427c8d 106 "05aaakz24ba2hdzlqx8qamwrsp7gni1acms8mr6m432wa9yaazjh"))))
4923e06f
SB
107 (build-system gnu-build-system)
108 (native-inputs
109 `(("perl", perl)))
110 (arguments
8550894b
LC
111 `(#:tests? #f ; no check target
112 #:configure-flags (list "--enable-64bit"
113 (string-append "LDFLAGS=-Wl,-rpath="
114 (assoc-ref %outputs "out")
115 "/lib"))
116 #:phases (alist-cons-before
117 'configure 'chdir
118 (lambda _
119 (chdir "nspr"))
120 %standard-phases)))
4923e06f
SB
121 (home-page
122 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR")
123 (synopsis "Netscape API for system level and libc-like functions")
124 (description "Netscape Portable Runtime (NSPR) provides a
125platform-neutral API for system level and libc-like functions. It is used
126in the Mozilla clients.")
127 (license license:mpl2.0)))
128
1aaaff1a
SB
129(define-public nss
130 (package
131 (name "nss")
f8686375 132 (version "3.19.2")
1aaaff1a
SB
133 (source (origin
134 (method url-fetch)
2bb9b5de
MW
135 (uri (let ((version-with-underscores
136 (string-join (string-split version #\.) "_")))
137 (string-append
138 "ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/"
139 "releases/NSS_" version-with-underscores "_RTM/src/"
140 "nss-" version ".tar.gz")))
1aaaff1a
SB
141 (sha256
142 (base32
f8686375 143 "1bn9wbf52z4423134hpkyvcxq1568fvzmkybv2d49n31iwz6c1hk"))
1aaaff1a
SB
144 ;; Create nss.pc and nss-config.
145 (patches (list (search-patch "nss-pkgconfig.patch")))))
146 (build-system gnu-build-system)
147 (outputs '("out" "bin"))
148 (arguments
149 '(#:parallel-build? #f ; failed
150 #:make-flags
151 (let* ((out (assoc-ref %outputs "out"))
152 (nspr (string-append (assoc-ref %build-inputs "nspr")))
153 (rpath (string-append "-Wl,-rpath=" out "/lib/nss")))
154 (list "-C" "nss" (string-append "PREFIX=" out)
155 "NSDISTMODE=copy"
156 "NSS_USE_SYSTEM_SQLITE=1"
157 (string-append "NSPR_INCLUDE_DIR=" nspr "/include/nspr")
158 ;; Add $out/lib/nss to RPATH.
159 (string-append "RPATH=" rpath)
160 (string-append "LDFLAGS=" rpath)))
161 #:modules ((guix build gnu-build-system)
162 (guix build utils)
163 (ice-9 ftw)
164 (ice-9 match)
165 (srfi srfi-26))
1aaaff1a
SB
166 #:phases
167 (alist-replace
168 'configure
169 (lambda* (#:key system inputs #:allow-other-keys)
170 ;; Tells NSS to build for the 64-bit ABI if we are 64-bit system.
171 (when (string-prefix? "x86_64" system)
172 (setenv "USE_64" "1"))
173 #t)
174 (alist-replace
175 'check
176 (lambda _
177 ;; Use 127.0.0.1 instead of $HOST.$DOMSUF as HOSTADDR for testing.
178 ;; The later requires a working DNS or /etc/hosts.
179 (setenv "DOMSUF" "(none)")
180 (setenv "USE_IP" "TRUE")
181 (setenv "IP_ADDRESS" "127.0.0.1")
182 (zero? (system* "./nss/tests/all.sh")))
183 (alist-replace
184 'install
185 (lambda* (#:key outputs #:allow-other-keys)
186 (let* ((out (assoc-ref outputs "out"))
187 (bin (string-append (assoc-ref outputs "bin") "/bin"))
188 (inc (string-append out "/include/nss"))
189 (lib (string-append out "/lib/nss"))
190 (obj (match (scandir "dist" (cut string-suffix? "OBJ" <>))
191 ((obj) (string-append "dist/" obj)))))
192 ;; Install nss-config to $out/bin.
96c46210
LC
193 (install-file (string-append obj "/bin/nss-config")
194 (string-append out "/bin"))
1aaaff1a
SB
195 (delete-file (string-append obj "/bin/nss-config"))
196 ;; Install nss.pc to $out/lib/pkgconfig.
96c46210
LC
197 (install-file (string-append obj "/lib/pkgconfig/nss.pc")
198 (string-append out "/lib/pkgconfig"))
1aaaff1a
SB
199 (delete-file (string-append obj "/lib/pkgconfig/nss.pc"))
200 (rmdir (string-append obj "/lib/pkgconfig"))
201 ;; Install other files.
202 (copy-recursively "dist/public/nss" inc)
203 (copy-recursively (string-append obj "/bin") bin)
204 (copy-recursively (string-append obj "/lib") lib)))
205 %standard-phases)))))
206 (inputs
207 `(("sqlite" ,sqlite)
208 ("zlib" ,zlib)))
209 (propagated-inputs `(("nspr" ,nspr))) ; required by nss.pc.
210 (native-inputs `(("perl" ,perl)))
86e3e370
MW
211
212 ;; The NSS test suite takes over 28 hours on Loongson 3A (MIPS), and
213 ;; possibly longer when another build is happening concurrently on the
214 ;; same machine.
215 (properties '((timeout . 144000))) ; 40 hours
216
1aaaff1a
SB
217 (home-page
218 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS")
219 (synopsis "Network Security Services")
220 (description
221 "Network Security Services (NSS) is a set of libraries designed to support
222cross-platform development of security-enabled client and server applications.
223Applications built with NSS can support SSL v2 and v3, TLS, PKCS #5, PKCS #7,
224PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other security
225standards.")
226 (license license:mpl2.0)))
227
be0f6112
AE
228(define-public icecat
229 (package
230 (name "icecat")
b76c4152 231 (version "31.8.0-gnu1")
be0f6112
AE
232 (source
233 (origin
234 (method url-fetch)
47bc885c 235 (uri (string-append "mirror://gnu/gnuzilla/"
07d4d9b7
MW
236 (first (string-split version #\-)) "/"
237 name "-" version ".tar.bz2"))
be0f6112
AE
238 (sha256
239 (base32
b76c4152 240 "11wx29mb5pcg4mgk07a6vjwh52ca90k0x4m9wv0v3y5dmp88f01p"))
c037a0f7
MW
241 (patches (map search-patch '("icecat-CVE-2015-4473-partial.patch"
242 "icecat-CVE-2015-4482.patch"
243 "icecat-CVE-2015-4488.patch"
244 "icecat-CVE-2015-4489.patch"
245 "icecat-CVE-2015-4491.patch"
246 "icecat-CVE-2015-4492.patch"
247 "icecat-CVE-2015-4495.patch"
a5e55dfb
MW
248 "icecat-enable-acceleration-and-webgl.patch"
249 "icecat-freetype-2.6.patch"
250 "icecat-libvpx-1.4.patch")))
90e1cdae
MW
251 (modules '((guix build utils)))
252 (snippet
253 '(begin
254 ;; Remove bundled libraries that we don't use, since they may
255 ;; contain unpatched security flaws, they waste disk space and
256 ;; network bandwidth, and may cause confusion.
257 (for-each delete-file-recursively
258 '(;; FIXME: Removing the bundled icu breaks configure.
259 ;; * The bundled icu headers are used in some places.
260 ;; * The version number is taken from the bundled copy.
261 ;;"intl/icu"
262 ;;
263 ;; FIXME: A script from the bundled nspr is used.
264 ;;"nsprpub"
265 ;;
266 ;; TODO: Use system media libraries. Waiting for:
267 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
268 ;; * libogg
269 ;; * libtheora
270 ;; * libvorbis
271 ;; * libtremor (not yet in guix)
272 ;; * libopus
273 ;; * speex
274 ;; * soundtouch (not yet in guix)
275 ;;
276 ;; TODO: Use system harfbuzz. Waiting for:
277 ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=847568>
278 ;;
279 "modules/freetype2"
280 "modules/zlib"
281 "modules/libbz2"
282 "ipc/chromium/src/third_party/libevent"
283 "media/libvpx"
284 "security/nss"
285 "gfx/cairo"
286 "js/src/ctypes/libffi"
287 "db/sqlite3"))
a5e55dfb 288 #t))))
be0f6112
AE
289 (build-system gnu-build-system)
290 (inputs
291 `(("alsa-lib" ,alsa-lib)
1ae6df81 292 ("bzip2" ,bzip2)
5b17fabc 293 ("cairo" ,cairo)
90e1cdae 294 ("cups" ,cups)
be0f6112 295 ("dbus-glib" ,dbus-glib)
90e1cdae
MW
296 ("gdk-pixbuf" ,gdk-pixbuf)
297 ("glib" ,glib)
43cc5c5e
MW
298 ("gstreamer" ,gstreamer)
299 ("gst-plugins-base" ,gst-plugins-base)
be0f6112 300 ("gtk+" ,gtk+-2)
74c7af9f
MW
301 ("pango" ,pango)
302 ("freetype" ,freetype)
90e1cdae
MW
303 ("hunspell" ,hunspell)
304 ("libcanberra" ,libcanberra)
305 ("libgnome" ,libgnome)
74c7af9f 306 ("libxft" ,libxft)
1ae6df81 307 ("libevent" ,libevent)
90e1cdae
MW
308 ("libxinerama" ,libxinerama)
309 ("libxscrnsaver" ,libxscrnsaver)
be0f6112 310 ("libxt" ,libxt)
1ae6df81 311 ("libffi" ,libffi)
13b284d9
MW
312 ("libvpx" ,libvpx)
313 ("icu4c" ,icu4c)
314 ("pixman" ,pixman)
74c7af9f 315 ("pulseaudio" ,pulseaudio)
be0f6112 316 ("mesa" ,mesa)
90e1cdae 317 ("mit-krb5" ,mit-krb5)
5b17fabc
MW
318 ("nspr" ,nspr)
319 ("nss" ,nss)
9128e323 320 ("sqlite" ,sqlite)
90e1cdae 321 ("startup-notification" ,startup-notification)
be0f6112
AE
322 ("unzip" ,unzip)
323 ("yasm" ,yasm)
1ae6df81
LC
324 ("zip" ,zip)
325 ("zlib" ,zlib)))
c4c4cc05
JD
326 (native-inputs
327 `(("perl" ,perl)
328 ("python" ,python-2) ; Python 3 not supported
329 ("python2-pysqlite" ,python2-pysqlite)
030daf71 330 ("pkg-config" ,pkg-config)))
be0f6112 331 (arguments
74c7af9f
MW
332 `(#:tests? #f ; no check target
333 #:out-of-source? #t ; must be built outside of the source directory
1ae6df81 334
73b1b4eb
LC
335
336 ;; XXX: There are RUNPATH issues such as
337 ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so,
338 ;; which is not in its RUNPATH, but they appear to be harmless in
339 ;; practice somehow. See <http://hydra.gnu.org/build/378133>.
340 #:validate-runpath? #f
341
90e1cdae
MW
342 #:configure-flags '("--enable-default-toolkit=cairo-gtk2"
343 "--enable-pango"
344 "--enable-gio"
345 "--enable-svg"
346 "--enable-canvas"
347 "--enable-mathml"
348 "--enable-startup-notification"
349 "--enable-pulseaudio"
350 "--enable-gstreamer=1.0"
351
352 "--disable-gnomevfs"
353 "--disable-gconf"
354 "--disable-gnomeui"
355
356 ;; Building with debugging symbols takes ~5GiB, so
1ae6df81
LC
357 ;; disable it.
358 "--disable-debug"
359 "--disable-debug-symbols"
360
90e1cdae 361 ;; Avoid bundled libraries.
1ae6df81 362 "--with-system-zlib"
90e1cdae 363 "--with-system-bz2"
1ae6df81 364 "--with-system-libevent"
13b284d9
MW
365 "--with-system-libvpx"
366 "--with-system-icu"
5b17fabc
MW
367 "--with-system-nspr"
368 "--with-system-nss"
13b284d9 369 "--enable-system-pixman"
5b17fabc
MW
370 "--enable-system-cairo"
371 "--enable-system-ffi"
90e1cdae 372 "--enable-system-hunspell"
9128e323 373 "--enable-system-sqlite"
1ae6df81 374
98a046cd
AE
375 ;; Fails with "--with-system-png won't work because
376 ;; the system's libpng doesn't have APNG support".
377 ;; According to
378 ;; http://sourceforge.net/projects/libpng-apng/ ,
379 ;; "the Animated Portable Network Graphics (APNG)
380 ;; is an unofficial extension of the Portable
381 ;; Network Graphics (PNG) format";
382 ;; we probably do not wish to support it.
1ae6df81
LC
383 ;; "--with-system-png"
384
98a046cd
AE
385 ;; Fails with "libjpeg-turbo JCS_EXTENSIONS
386 ;; required".
387 ;; According to
388 ;; http://sourceforge.net/projects/libjpeg-turbo/ ,
389 ;; "libjpeg-turbo is a derivative of libjpeg that
390 ;; uses MMX, SSE, SSE2, and NEON SIMD instructions
391 ;; to accelerate baseline JPEG compression/
392 ;; decompression", so we had better not use it
1ae6df81 393 ;; "--with-system-jpeg"
5b17fabc 394 )
1ae6df81 395
be0f6112 396 #:phases
90e1cdae
MW
397 (modify-phases %standard-phases
398 (add-after
399 'unpack 'remove-h264parse-from-blacklist
400 (lambda _
401 ;; Remove h264parse from gstreamer format helper blacklist. It
402 ;; was put there to work around a bug in a pre-1.0 version of
403 ;; gstreamer. See:
404 ;; https://www.mozilla.org/en-US/security/advisories/mfsa2015-47/
405 (substitute* "content/media/gstreamer/GStreamerFormatHelper.cpp"
406 (("^ \"h264parse\",\n") ""))
407 #t))
408 (add-after
409 'unpack 'arrange-to-link-libxul-with-libraries-it-might-dlopen
410 (lambda _
411 ;; libxul.so dynamically opens libraries, so here we explicitly
412 ;; link them into libxul.so instead.
413 ;;
414 ;; TODO: It might be preferable to patch in absolute file names in
415 ;; calls to dlopen or PR_LoadLibrary, but that didn't seem to
416 ;; work. More investigation is needed.
417 (let ((p (open-file "toolkit/library/libxul.mk" "a")))
418 (display "\nOS_LIBS += -lGL -lgnome-2 -lcanberra -lXss \\
419 -lcups -lgssapi_krb5 -lgstreamer-1.0 \\
420 -lgstapp-1.0 -lgstvideo-1.0\n"
421 p)
422 (close-port p)
423 #t)))
424 (replace
425 'configure
426 ;; configure does not work followed by both "SHELL=..." and
427 ;; "CONFIG_SHELL=..."; set environment variables instead
428 (lambda* (#:key outputs configure-flags #:allow-other-keys)
429 (let* ((out (assoc-ref outputs "out"))
430 (bash (which "bash"))
431 (abs-srcdir (getcwd))
432 (srcdir (string-append "../" (basename abs-srcdir)))
433 (flags `(,(string-append "--prefix=" out)
434 ,(string-append "--with-l10n-base="
435 abs-srcdir "/l10n")
436 ,@configure-flags)))
437 (setenv "SHELL" bash)
438 (setenv "CONFIG_SHELL" bash)
439 (mkdir "../build")
440 (chdir "../build")
441 (format #t "build directory: ~s~%" (getcwd))
442 (format #t "configure flags: ~s~%" flags)
443 (zero? (apply system* bash
444 (string-append srcdir "/configure")
445 flags))))))))
be0f6112
AE
446 (home-page "http://www.gnu.org/software/gnuzilla/")
447 (synopsis "Entirely free browser derived from Mozilla Firefox")
448 (description
449 "IceCat is the GNU version of the Firefox browser. It is entirely free
c5779c93 450software, which does not recommend non-free plugins and addons. It also
79c311b8 451features built-in privacy-protecting features.")
be0f6112 452 (license license:mpl2.0))) ; and others, see toolkit/content/license.html