guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

65/107: gnu: Add mozjs-68.


From: guix-commits
Subject: 65/107: gnu: Add mozjs-68.
Date: Tue, 12 May 2020 10:53:25 -0400 (EDT)

kkebreau pushed a commit to branch wip-gnome3.36
in repository guix.

commit 28e2d0e7b5bce147bd8caddea4ef33a83fa17691
Author: Kei Kebreau <address@hidden>
AuthorDate: Tue Apr 21 11:10:24 2020 -0400

    gnu: Add mozjs-68.
    
    * gnu/packages/gnuzilla.scm (mozjs-68): New variable.
---
 gnu/packages/gnuzilla.scm | 84 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 8a92668..86b4e75 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2020 Jakub Kądziołka <address@hidden>
 ;;; Copyright © 2019, 2020 Adrian Malacoda <address@hidden>
 ;;; Copyright © 2020 Jonathan Brielmaier <address@hidden>
+;;; Copyright © 2020 Kei Kebreau <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -413,6 +414,89 @@ in C/C++.")
        ("pkg-config" ,pkg-config)
        ("python" ,python-2)))))
 
+(define-public mozjs-68
+  ;; No releases yet at 
<https://archive.mozilla.org/pub/spidermonkey/releases/>.
+  ;; While we could take a snapshot of the complete mozilla-esr60 repository at
+  ;; 
<https://treeherder.mozilla.org/#/jobs?repo=mozilla-esr68&filter-searchStr=sm-tc>,
+  ;; we take the Debian version instead, because it is easier to work with.
+  (package
+    (inherit mozjs-60)
+    (version "68.6.0-2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://salsa.debian.org/gnome-team/mozjs68.git";)
+                    (commit (string-append "debian/" version))))
+              (file-name (git-file-name "mozjs" version))
+              (sha256
+               (base32
+                "1iwn19sni8pgkn2p1l4gj4skr2zvmrpl0cfgdknmvxfrvwyfb4dx"))))
+    (arguments
+     `(#:tests? #f ; FIXME: all tests pass, but then the check phase fails 
anyway.
+       #:test-target "check-jstests"
+       #:configure-flags
+       `("--enable-ctypes"
+         "--enable-optimize"
+         "--enable-readline"
+         "--enable-shared-js"
+         "--enable-system-ffi"
+         "--with-system-nspr"
+         "--with-system-zlib"
+         "--with-system-icu"
+         "--with-intl-api"
+         ;; This is important because without it gjs will segfault during the
+         ;; configure phase.  With jemalloc only the standalone mozjs console
+         ;; will work.
+         "--disable-jemalloc"
+         ;; We must specify the clang paths manually, because otherwise the
+         ;; Mozilla build system looks in the directories returned by
+         ;; llvm-config --bindir and llvm-config --libdir, which return paths
+         ;; in the llvm package where clang is not found.
+         ,(string-append "--with-clang-path="
+                         (assoc-ref %build-inputs "clang")
+                         "/bin/clang")
+         ,(string-append "--with-libclang-path="
+                         (assoc-ref %build-inputs "clang")
+                         "/lib"))
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
+             ;; The configure script does not accept environment variables as
+             ;; arguments.  It also must be run from a different directory,
+             ;; but not the root directory either.
+             (let ((out (assoc-ref outputs "out")))
+               (mkdir "run-configure-from-here")
+               (chdir "run-configure-from-here")
+               (setenv "SHELL" (which "sh"))
+               (setenv "CONFIG_SHELL" (which "sh"))
+               (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf")
+                                                 "/bin/autoconf"))
+
+               (apply invoke "../js/src/configure"
+                      (cons (string-append "--prefix=" out)
+                            configure-flags))
+               #t)))
+         (add-after 'unpack 'disable-broken-tests
+           (lambda _
+             ;; This test assumes that /bin exists and contains certain
+             ;; executables.
+             (delete-file "js/src/tests/shell/os.js")
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf-2.13)    ; required for "--localdir" flag to work
+       ("automake" ,automake)
+       ("which" ,which)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python)
+       ("python-2" ,python-2)
+       ("rust" ,rust)
+       ("cargo" ,rust "cargo")
+       ("rust-cbindgen" ,rust-cbindgen)
+       ("llvm" ,llvm)
+       ("clang" ,clang)))))
+
 (define mozilla-compare-locales
   (origin
     (method hg-fetch)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]