From b04d2724f7434401b4311eee4ceb0e6d70033f83 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 22 Feb 2022 23:19:36 +0100 Subject: gnu: js-selectize: Minify different source file. * gnu/packages/javascript.scm (js-selectize)[arguments]: Minify concatenated file. --- gnu/packages/javascript.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gnu/packages/javascript.scm') diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm index c453ac432a..779ffcb7b8 100644 --- a/gnu/packages/javascript.scm +++ b/gnu/packages/javascript.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Arun Isaac -;;; Copyright © 2017, 2019, 2020 Ricardo Wurmus +;;; Copyright © 2017, 2019, 2020, 2022 Ricardo Wurmus ;;; Copyright © 2017, 2018, 2020, 2021 Tobias Geerinckx-Rice ;;; Copyright © 2017, 2018, 2019, 2020 Efraim Flashner ;;; Copyright © 2018 Nicolas Goaziou @@ -592,7 +592,10 @@ (define-public js-selectize (base32 "15gichl8wi6yxag2ps723nxrgyan15976dzsnvw9h9py8sbyyzjn")))) (build-system minify-build-system) - (arguments `(#:javascript-files '("src/selectize.js"))) + ;; We use the standalone file instead of src/selectize.js because the + ;; former includes the source code for MicroEvent and other modules that + ;; Selectize refers to. + (arguments `(#:javascript-files '("dist/js/standalone/selectize.js"))) (home-page "https://selectize.github.io/selectize.js/") (synopsis "Hybrid widget between a textbox and } -- cgit v1.2.3 From 22525731fdbfeebfc51d17dc6674a92d75383213 Mon Sep 17 00:00:00 2001 From: Frank Pursel Date: Tue, 15 Feb 2022 14:07:28 -0800 Subject: gnu: Add rhino. * gnu/package/javascript.scm (rhino): New variable. Signed-off-by: Julien Lepiller --- gnu/packages/javascript.scm | 103 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 2 deletions(-) (limited to 'gnu/packages/javascript.scm') diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm index 779ffcb7b8..68d338de8d 100644 --- a/gnu/packages/javascript.scm +++ b/gnu/packages/javascript.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2018 Nicolas Goaziou ;;; Copyright © 2021 Pierre Neidhardt ;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2022 Frank Pursel ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,7 +27,9 @@ (define-module (gnu packages javascript) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages compression) + #:use-module (gnu packages java) #:use-module (gnu packages node) #:use-module (gnu packages readline) #:use-module (gnu packages uglifyjs) @@ -34,10 +37,11 @@ (define-module (gnu packages javascript) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) - #:use-module (guix build-system gnu) + #:use-module (guix build-system ant) #:use-module (guix build-system cmake) - #:use-module (guix build-system trivial) + #:use-module (guix build-system gnu) #:use-module (guix build-system minify) + #:use-module (guix build-system trivial) #:use-module (guix utils)) (define-public cjson @@ -791,3 +795,98 @@ (define-public duktape your build, and use the Duktape API to call ECMAScript functions from C code and vice versa.") (license license:expat))) + +(define-public rhino + (package + (name "rhino") + (version "1.7.7.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mozilla/rhino.git") + (commit "935942527ff434b205e797df4185518e5369466e"))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "09i4yr98hs6855fs7fhgmrpiwpr90lhxdv2bvfj97nn4rv1d7wl8")) + (modules '((guix build utils))) + (snippet '(begin + ;; Remove benchmark testing + (delete-file-recursively "testsrc/benchmarks") + (delete-file-recursively + "testsrc/org/mozilla/javascript/benchmarks") + ;; Identify bundled jars + (format #t "~%~a~%" "Sourced jars") + (for-each (lambda (f) + (format #t "~/Deleting: ~a~%" f) + (delete-file f)) + (find-files "." "\\.jar$")))))) + (build-system ant-build-system) + (inputs (list bash-minimal)) + (native-inputs (list java-junit java-hamcrest-core java-snakeyaml)) + (arguments + `(#:phases + (modify-phases + %standard-phases + (replace 'check + (lambda* (#:key tests? inputs native-inputs + #:allow-other-keys) + (when tests? + (setenv "ANT_OPTS" "-Doffline=true") + (let ((junit-lib + (assoc-ref inputs "java-junit")) + (hamcrest-lib + (assoc-ref inputs "java-hamcrest-core")) + (snakeyaml-lib + (assoc-ref inputs "java-snakeyaml"))) + (with-directory-excursion "testsrc" + (substitute* "build.xml" + (("" all) + (string-append "")) + (("" all) + (string-append "")) + (("" + all) + (string-append "")) + (("" all) + (string-append "")) + (("") + (string-append + "")) + (("") + (string-append "")) + (("") + (string-append "")) + ;; Disabling instrumentation. + (("(")))) + (invoke "ant" "junit"))))) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (pkg+ver (string-append ,name ,version)) + (bin (string-append out "/bin")) + (rhino (string-append bin "/rhino")) + (man (string-append out "/share/man/man1"))) + (mkdir-p bin) + (install-file "man/rhino.1" man) + (install-file (string-append "build/" pkg+ver + "/js.jar") + (string-append out "/share/java")) + (with-output-to-file rhino + (lambda _ + (format #t "#!~a~%~a -jar ~a $@~%" + (search-input-file inputs "/bin/bash") + (search-input-file inputs "/bin/java") + (string-append out "/share/java/js.jar")))) + (chmod rhino #o755))))))) + (home-page "https://mozilla.github.io/rhino") + (synopsis "Javascript implemented in Java") + (description + "Rhino implements ECMAScript, also known as JavaScript, in Java as +specified in the fifth edition of ECMA-262.") + (license license:mpl2.0))) + -- cgit v1.2.3