From mboxrd@z Thu Jan 1 00:00:00 1970 From: ng0 Subject: [PATCH 1/3] gnu: Add mozjs-38. Date: Fri, 30 Dec 2016 18:04:48 +0000 Message-ID: <20161230180450.23500-2-ng0@libertad.pw> References: <20161230180450.23500-1-ng0@libertad.pw> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cN1Y0-0006WF-Nv for guix-devel@gnu.org; Fri, 30 Dec 2016 13:04:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cN1Xx-0005ST-1y for guix-devel@gnu.org; Fri, 30 Dec 2016 13:04:54 -0500 Received: from aibo.runbox.com ([91.220.196.211]:46864) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cN1Xw-0005Rm-Ne for guix-devel@gnu.org; Fri, 30 Dec 2016 13:04:53 -0500 Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1cN1Xv-0008Bu-H8 for guix-devel@gnu.org; Fri, 30 Dec 2016 19:04:51 +0100 In-Reply-To: <20161230180450.23500-1-ng0@libertad.pw> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Cc: ng0 From: ng0 * gnu/packages/gnuzilla.scm (mozjs-38): New variable. --- gnu/packages/gnuzilla.scm | 123 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index 07ed2af0b..4ad4218eb 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2015 Sou Bunnbu ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2016 Alex Griffin +;;; Copyright © 2016 ng0 ;;; ;;; This file is part of GNU Guix. ;;; @@ -40,6 +41,7 @@ #:use-module (gnu packages linux) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages readline) #:use-module (gnu packages compression) #:use-module (gnu packages fontutils) #:use-module (gnu packages libevent) @@ -149,6 +151,127 @@ in C/C++.") `(("libffi" ,libffi) ("zlib" ,zlib))))) +(define-public mozjs-38 + (package (inherit mozjs) + (name "mozjs") + (version "38.2.1.rc0") + (source (origin + (method url-fetch) + (uri (list + ;; The upstream server at people.mozilla.org produces + ;; a tls handshake error, the file at people.freebsd.org + ;; is identical and produces no such error. + (string-append + "https://people.freebsd.org/~sunpoet/distfiles/" + name "-" version ".tar.bz2") + ;; XXX: The upstream server at people.mozilla.org + ;; TODO: Use revision control system checkout? + (string-append + "https://people.mozilla.org/~sstangl/" + name "-" version ".tar.bz2"))) + ;; TODO: Unbundle icu ("intl" dir) + (sha256 + (base32 + "0p4bmbpgkfsj54xschcny0a118jdrdgg0q29rwxigg3lh5slr681")))) + (arguments + `(;; XXX: parallel build fails, lacking: + ;; mkdir -p "system_wrapper_js/" + ;; #:parallel-build? #f + ;; Tests fail due to missing module 'xpt': + ;; ImportError: No module named xpt + #:tests? #f + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (chdir "js/src") + ;; configure fails if it is followed by SHELL and CONFIG_SHELL + (setenv "SHELL" (which "sh")) + (setenv "CONFIG_SHELL" (which "sh")) + (setenv "LIBXUL_DIST" (assoc-ref %outputs "out")) + ;; TODO: Use exact version, if we leave this empty it + ;; will be empty in the .pc file. + ;; (setenv "MOZILLA_VERSION" "38.2.1") + ;; (setenv "MOZJS_MAJOR_VERSION" "38") + ;; (setenv "MOZJS_MINOR_VERSION" "2") + ;; (setenv "MOZJS_PATCH_VERSION" "1") + ;; + ;; (substitute* "js.pc.in" + ;; ;;(("@MOZILLA_VERSION@") "38.2.1")) + ;; (("@MOZILLA_VERSION@") "38.0.0")) + (zero? (system* "./configure" + (string-append "--prefix=" out) + "--with-system-nspr" + "--enable-system-ffi" + "--enable-threadsafe" + "--with-system-icu" + "--with-system-zlib" + "--enable-readline" + + ;; These are required by 0ad and they may + ;; or may not be good defaults for other + ;; uses. + "--enable-gcgenerational" + "--enable-shared-js"))))) + (add-after 'install 'fix-header-symlinks + ;; The headers are symlinks to a directory that does not + ;; get put into the store location, so they end up broken. + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (inc (string-append out "/include/mozjs-")) + (incjs (string-append inc "/js")) + (moz (string-append inc "/mozilla"))) + ;; TODO: for-each + (chdir "../..") ; Change to root of build directory + (delete-file-recursively incjs) + (copy-recursively "js/public/" incjs) + ;; Remove stuff we don't need: + (delete-file-recursively moz) + (copy-recursively "mfbt" moz) + (delete-file (string-append inc "/jsalloc.h")) + (delete-file (string-append inc "/jsapi.h")) + (delete-file (string-append inc "/jsbytecode.h")) + (delete-file (string-append inc "/jsclist.h")) + (delete-file (string-append inc "/jscpucfg.h")) + (delete-file (string-append inc "/jsfriendapi.h")) + (delete-file (string-append inc "/js.msg")) + (delete-file (string-append inc "/jsperf.h")) + (delete-file (string-append inc "/jsprf.h")) + (delete-file (string-append inc "/jsprototypes.h")) + (delete-file (string-append inc "/jspubtd.h")) + (delete-file (string-append inc "/jstypes.h")) + (delete-file (string-append inc "/jsversion.h")) + (delete-file (string-append inc "/jswrapper.h")) + (install-file "js/src/jsalloc.h" inc) + (install-file "js/src/jsapi.h" inc) + (install-file "js/src/jsbytecode.h" inc) + (install-file "js/src/jsclist.h" inc) + (install-file "js/src/jscpucfg.h" inc) + (install-file "js/src/jsfriendapi.h" inc) + (install-file "js/src/js.msg" inc) + (install-file "js/src/perf/jsperf.h" inc) + (install-file "js/src/jsprf.h" inc) + (install-file "js/src/jsprototypes.h" inc) + (install-file "js/src/jspubtd.h" inc) + (install-file "js/src/jstypes.h" inc) + (install-file "js/src/jsversion.h" inc) + (install-file "js/src/jswrapper.h" inc) + (delete-file-recursively (string-append moz "/decimal")) + (delete-file-recursively (string-append moz "/tests")) + (delete-file-recursively (string-append moz "/double-conversion")))))))) + (native-inputs + `(("perl" ,perl) + ("pkg-config" ,pkg-config) + ("python-2" ,python-2))) + (propagated-inputs + `(("nspr" ,nspr))) ; in the Requires.private field of mozjs-24.pc + (inputs + `(("libffi" ,libffi) + ("readline" ,readline) + ("icu4c" ,icu4c) + ("zlib" ,zlib))))) + (define-public nspr (package (name "nspr") -- 2.11.0