gnu: Add mozjs (Mozilla Spidermonkey).
[jackhill/guix/guix.git] / gnu / packages / polkit.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages polkit)
20 #:use-module ((guix licenses) #:select (lgpl2.0+ mpl2.0))
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages perl)
25 #:use-module (gnu packages python))
26
27 (define-public mozjs
28 (package
29 (name "mozjs")
30 (version "17.0.0")
31 (source (origin
32 (method url-fetch)
33 (uri (string-append
34 "https://ftp.mozilla.org/pub/mozilla.org/js/"
35 name version ".tar.gz"))
36 (sha256
37 (base32
38 "1fig2wf4f10v43mqx67y68z6h77sy900d1w0pz9qarrqx57rc7ij"))))
39 (build-system gnu-build-system)
40 (native-inputs
41 `(("perl", perl)
42 ("python" ,python-2)))
43 (arguments
44 `(#:phases
45 (alist-cons-before
46 'configure 'chdir
47 (lambda _
48 (chdir "js/src"))
49 (alist-replace
50 'configure
51 ;; configure fails if it is followed by SHELL and CONFIG_SHELL
52 (lambda* (#:key outputs #:allow-other-keys)
53 (let ((out (assoc-ref outputs "out")))
54 (setenv "SHELL" (which "sh"))
55 (setenv "CONFIG_SHELL" (which "sh"))
56 (zero? (system*
57 "./configure" (string-append "--prefix=" out)))))
58 %standard-phases))))
59 (home-page
60 "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey")
61 (synopsis "Mozilla javascript engine")
62 (description "SpiderMonkey is Mozilla's JavaScript engine written
63 in C/C++.")
64 (license mpl2.0))) ; and others for some files