gnu: icecat: Update to 31.6.0-gnu1.
[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>
46a3e00b 3;;; Copyright © 2013, 2014 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)
23 #:use-module (gnu packages)
b5b73a82 24 #:use-module ((guix licenses) #:prefix license:)
be0f6112
AE
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
1aaaff1a 28 #:use-module (gnu packages databases)
be0f6112
AE
29 #:use-module (gnu packages glib)
30 #:use-module (gnu packages gstreamer)
31 #:use-module (gnu packages gtk)
32 #:use-module (gnu packages linux)
33 #:use-module (gnu packages perl)
34 #:use-module (gnu packages pkg-config)
1ae6df81 35 #:use-module (gnu packages compression)
74c7af9f 36 #:use-module (gnu packages fontutils)
1ae6df81 37 #:use-module (gnu packages libevent)
e55354b8 38 #:use-module (gnu packages image)
1ae6df81 39 #:use-module (gnu packages libffi)
74c7af9f 40 #:use-module (gnu packages pulseaudio)
be0f6112
AE
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages xorg)
200726ed 43 #:use-module (gnu packages gl)
be0f6112 44 #:use-module (gnu packages yasm)
13b284d9
MW
45 #:use-module (gnu packages icu4c)
46 #:use-module (gnu packages video)
47 #:use-module (gnu packages xdisorg)
be0f6112
AE
48 #:use-module (gnu packages zip))
49
4923e06f
SB
50(define-public mozjs
51 (package
52 (name "mozjs")
53 (version "17.0.0")
54 (source (origin
55 (method url-fetch)
56 (uri (string-append
57 "https://ftp.mozilla.org/pub/mozilla.org/js/"
58 name version ".tar.gz"))
59 (sha256
60 (base32
61 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))))
62 (build-system gnu-build-system)
63 (native-inputs
64 `(("perl", perl)
65 ("python" ,python-2)))
66 (arguments
67 `(#:phases
68 (alist-cons-before
69 'configure 'chdir
70 (lambda _
71 (chdir "js/src"))
72 (alist-replace
73 'configure
74 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
75 (lambda* (#:key outputs #:allow-other-keys)
76 (let ((out (assoc-ref outputs "out")))
77 (setenv "SHELL" (which "sh"))
78 (setenv "CONFIG_SHELL" (which "sh"))
79 (zero? (system*
80 "./configure" (string-append "--prefix=" out)))))
81 %standard-phases))))
82 (home-page
83 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey")
84 (synopsis "Mozilla javascript engine")
85 (description "SpiderMonkey is Mozilla's JavaScript engine written
86in C/C++.")
87 (license license:mpl2.0))) ; and others for some files
88
89(define-public nspr
90 (package
91 (name "nspr")
61427c8d 92 (version "4.10.8")
4923e06f
SB
93 (source (origin
94 (method url-fetch)
95 (uri (string-append
96 "https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v"
97 version "/src/nspr-" version ".tar.gz"))
98 (sha256
99 (base32
61427c8d 100 "05aaakz24ba2hdzlqx8qamwrsp7gni1acms8mr6m432wa9yaazjh"))))
4923e06f
SB
101 (build-system gnu-build-system)
102 (native-inputs
103 `(("perl", perl)))
104 (arguments
105 `(#:tests? #f ; no check target
106 #:configure-flags
107 `("--enable-64bit")
108 #:phases
109 (alist-cons-before
110 'configure 'chdir
111 (lambda _
112 (chdir "nspr"))
113 %standard-phases)))
114 (home-page
115 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR")
116 (synopsis "Netscape API for system level and libc-like functions")
117 (description "Netscape Portable Runtime (NSPR) provides a
118platform-neutral API for system level and libc-like functions. It is used
119in the Mozilla clients.")
120 (license license:mpl2.0)))
121
1aaaff1a
SB
122(define-public nss
123 (package
124 (name "nss")
2bb9b5de 125 (version "3.18")
1aaaff1a
SB
126 (source (origin
127 (method url-fetch)
2bb9b5de
MW
128 (uri (let ((version-with-underscores
129 (string-join (string-split version #\.) "_")))
130 (string-append
131 "ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/"
132 "releases/NSS_" version-with-underscores "_RTM/src/"
133 "nss-" version ".tar.gz")))
1aaaff1a
SB
134 (sha256
135 (base32
2bb9b5de 136 "0h0xy9kvd2s8r438q4dfn25cgvv5dc1hkm9lb4bgrxpr5bxv13b1"))
1aaaff1a
SB
137 ;; Create nss.pc and nss-config.
138 (patches (list (search-patch "nss-pkgconfig.patch")))))
139 (build-system gnu-build-system)
140 (outputs '("out" "bin"))
141 (arguments
142 '(#:parallel-build? #f ; failed
143 #:make-flags
144 (let* ((out (assoc-ref %outputs "out"))
145 (nspr (string-append (assoc-ref %build-inputs "nspr")))
146 (rpath (string-append "-Wl,-rpath=" out "/lib/nss")))
147 (list "-C" "nss" (string-append "PREFIX=" out)
148 "NSDISTMODE=copy"
149 "NSS_USE_SYSTEM_SQLITE=1"
150 (string-append "NSPR_INCLUDE_DIR=" nspr "/include/nspr")
151 ;; Add $out/lib/nss to RPATH.
152 (string-append "RPATH=" rpath)
153 (string-append "LDFLAGS=" rpath)))
154 #:modules ((guix build gnu-build-system)
155 (guix build utils)
156 (ice-9 ftw)
157 (ice-9 match)
158 (srfi srfi-26))
159 #:imported-modules ((guix build gnu-build-system)
160 (guix build utils))
161 #:phases
162 (alist-replace
163 'configure
164 (lambda* (#:key system inputs #:allow-other-keys)
165 ;; Tells NSS to build for the 64-bit ABI if we are 64-bit system.
166 (when (string-prefix? "x86_64" system)
167 (setenv "USE_64" "1"))
168 #t)
169 (alist-replace
170 'check
171 (lambda _
172 ;; Use 127.0.0.1 instead of $HOST.$DOMSUF as HOSTADDR for testing.
173 ;; The later requires a working DNS or /etc/hosts.
174 (setenv "DOMSUF" "(none)")
175 (setenv "USE_IP" "TRUE")
176 (setenv "IP_ADDRESS" "127.0.0.1")
177 (zero? (system* "./nss/tests/all.sh")))
178 (alist-replace
179 'install
180 (lambda* (#:key outputs #:allow-other-keys)
181 (let* ((out (assoc-ref outputs "out"))
182 (bin (string-append (assoc-ref outputs "bin") "/bin"))
183 (inc (string-append out "/include/nss"))
184 (lib (string-append out "/lib/nss"))
185 (obj (match (scandir "dist" (cut string-suffix? "OBJ" <>))
186 ((obj) (string-append "dist/" obj)))))
187 ;; Install nss-config to $out/bin.
188 (mkdir-p (string-append out "/bin"))
189 (copy-file (string-append obj "/bin/nss-config")
190 (string-append out "/bin/nss-config"))
191 (delete-file (string-append obj "/bin/nss-config"))
192 ;; Install nss.pc to $out/lib/pkgconfig.
193 (mkdir-p (string-append out "/lib/pkgconfig"))
194 (copy-file (string-append obj "/lib/pkgconfig/nss.pc")
195 (string-append out "/lib/pkgconfig/nss.pc"))
196 (delete-file (string-append obj "/lib/pkgconfig/nss.pc"))
197 (rmdir (string-append obj "/lib/pkgconfig"))
198 ;; Install other files.
199 (copy-recursively "dist/public/nss" inc)
200 (copy-recursively (string-append obj "/bin") bin)
201 (copy-recursively (string-append obj "/lib") lib)))
202 %standard-phases)))))
203 (inputs
204 `(("sqlite" ,sqlite)
205 ("zlib" ,zlib)))
206 (propagated-inputs `(("nspr" ,nspr))) ; required by nss.pc.
207 (native-inputs `(("perl" ,perl)))
208 (home-page
209 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS")
210 (synopsis "Network Security Services")
211 (description
212 "Network Security Services (NSS) is a set of libraries designed to support
213cross-platform development of security-enabled client and server applications.
214Applications built with NSS can support SSL v2 and v3, TLS, PKCS #5, PKCS #7,
215PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other security
216standards.")
217 (license license:mpl2.0)))
218
be0f6112
AE
219(define-public icecat
220 (package
221 (name "icecat")
7e84e199 222 (version "31.6.0-gnu1")
be0f6112
AE
223 (source
224 (origin
225 (method url-fetch)
47bc885c 226 (uri (string-append "mirror://gnu/gnuzilla/"
582100a0 227 version "/" name "-" version ".tar.bz2"))
be0f6112
AE
228 (sha256
229 (base32
7e84e199 230 "1a4l23msg4cpc4yp59q2z6xv63r6advlbnjy65v4djv6yhgnqf1i"))))
be0f6112
AE
231 (build-system gnu-build-system)
232 (inputs
233 `(("alsa-lib" ,alsa-lib)
1ae6df81 234 ("bzip2" ,bzip2)
5b17fabc 235 ("cairo" ,cairo)
be0f6112
AE
236 ("dbus" ,dbus)
237 ("dbus-glib" ,dbus-glib)
238 ("glib" ,glib)
43cc5c5e
MW
239 ("gstreamer" ,gstreamer)
240 ("gst-plugins-base" ,gst-plugins-base)
be0f6112 241 ("gtk+" ,gtk+-2)
74c7af9f
MW
242 ("pango" ,pango)
243 ("freetype" ,freetype)
244 ("libxft" ,libxft)
1ae6df81 245 ("libevent" ,libevent)
be0f6112 246 ("libxt" ,libxt)
1ae6df81 247 ("libffi" ,libffi)
13b284d9
MW
248 ("libvpx" ,libvpx)
249 ("icu4c" ,icu4c)
250 ("pixman" ,pixman)
74c7af9f 251 ("pulseaudio" ,pulseaudio)
be0f6112 252 ("mesa" ,mesa)
5b17fabc
MW
253 ("nspr" ,nspr)
254 ("nss" ,nss)
be0f6112
AE
255 ("unzip" ,unzip)
256 ("yasm" ,yasm)
1ae6df81
LC
257 ("zip" ,zip)
258 ("zlib" ,zlib)))
c4c4cc05
JD
259 (native-inputs
260 `(("perl" ,perl)
261 ("python" ,python-2) ; Python 3 not supported
262 ("python2-pysqlite" ,python2-pysqlite)
030daf71 263 ("pkg-config" ,pkg-config)))
be0f6112 264 (arguments
74c7af9f
MW
265 `(#:tests? #f ; no check target
266 #:out-of-source? #t ; must be built outside of the source directory
1ae6df81
LC
267
268 #:configure-flags '(;; Building with debugging symbols takes ~5GiB, so
269 ;; disable it.
270 "--disable-debug"
271 "--disable-debug-symbols"
272
46a3e00b 273 "--enable-pulseaudio"
43cc5c5e 274 "--enable-gstreamer=1.0"
1ae6df81
LC
275
276 "--with-system-zlib"
277 "--with-system-bz2" ; FIXME: not used
278 "--with-system-libevent"
13b284d9
MW
279 "--with-system-libvpx"
280 "--with-system-icu"
5b17fabc
MW
281 "--with-system-nspr"
282 "--with-system-nss"
13b284d9 283 "--enable-system-pixman"
5b17fabc
MW
284 "--enable-system-cairo"
285 "--enable-system-ffi"
13b284d9
MW
286
287 ;; Fails with "configure: error: System
288 ;; SQLite library is not compiled with
5b17fabc 289 ;; SQLITE_ENABLE_UNLOCK_NOTIFY."
13b284d9 290 ;; "--enable-system-sqlite"
1ae6df81 291
98a046cd
AE
292 ;; Fails with "--with-system-png won't work because
293 ;; the system's libpng doesn't have APNG support".
294 ;; According to
295 ;; http://sourceforge.net/projects/libpng-apng/ ,
296 ;; "the Animated Portable Network Graphics (APNG)
297 ;; is an unofficial extension of the Portable
298 ;; Network Graphics (PNG) format";
299 ;; we probably do not wish to support it.
1ae6df81
LC
300 ;; "--with-system-png"
301
98a046cd
AE
302 ;; Fails with "libjpeg-turbo JCS_EXTENSIONS
303 ;; required".
304 ;; According to
305 ;; http://sourceforge.net/projects/libjpeg-turbo/ ,
306 ;; "libjpeg-turbo is a derivative of libjpeg that
307 ;; uses MMX, SSE, SSE2, and NEON SIMD instructions
308 ;; to accelerate baseline JPEG compression/
309 ;; decompression", so we had better not use it
1ae6df81 310 ;; "--with-system-jpeg"
5b17fabc 311 )
1ae6df81 312
be0f6112 313 #:phases
74c7af9f
MW
314 (alist-replace
315 'configure
316 ;; configure does not work followed by both "SHELL=..." and
317 ;; "CONFIG_SHELL=..."; set environment variables instead
318 (lambda* (#:key outputs configure-flags #:allow-other-keys)
319 (let* ((out (assoc-ref outputs "out"))
320 (bash (which "bash"))
321 (abs-srcdir (getcwd))
322 (srcdir (string-append "../" (basename abs-srcdir)))
323 (flags `(,(string-append "--prefix=" out)
324 ,(string-append "--with-l10n-base="
325 abs-srcdir "/l10n")
326 ,@configure-flags)))
327 (setenv "SHELL" bash)
328 (setenv "CONFIG_SHELL" bash)
329 (mkdir "../build")
330 (chdir "../build")
331 (format #t "build directory: ~s~%" (getcwd))
332 (format #t "configure flags: ~s~%" flags)
333 (zero? (apply system* bash
334 (string-append srcdir "/configure")
335 flags))))
336 %standard-phases)))
be0f6112
AE
337 (home-page "http://www.gnu.org/software/gnuzilla/")
338 (synopsis "Entirely free browser derived from Mozilla Firefox")
339 (description
340 "IceCat is the GNU version of the Firefox browser. It is entirely free
c5779c93 341software, which does not recommend non-free plugins and addons. It also
79c311b8 342features built-in privacy-protecting features.")
be0f6112 343 (license license:mpl2.0))) ; and others, see toolkit/content/license.html