From patchwork Fri Feb 18 20:42:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Pursel X-Patchwork-Id: 37340 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7C96927BBEA; Fri, 18 Feb 2022 20:45:59 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DE5D827BBE9 for ; Fri, 18 Feb 2022 20:45:58 +0000 (GMT) Received: from localhost ([::1]:45360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nLA8b-0007t1-Vb for patchwork@mira.cbaines.net; Fri, 18 Feb 2022 15:45:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLA5m-000554-U9 for guix-patches@gnu.org; Fri, 18 Feb 2022 15:43:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34343) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nLA5m-00005n-KM for guix-patches@gnu.org; Fri, 18 Feb 2022 15:43:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nLA5m-0005o0-Cs for guix-patches@gnu.org; Fri, 18 Feb 2022 15:43:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54021] [PATCH] if, at first, you don't succeed... References: <87pmnnr2qq.fsf@gmail.com> In-Reply-To: <87pmnnr2qq.fsf@gmail.com> Resent-From: Frank Pursel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 18 Feb 2022 20:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54021 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54021@debbugs.gnu.org Received: via spool by 54021-submit@debbugs.gnu.org id=B54021.164521694722269 (code B ref 54021); Fri, 18 Feb 2022 20:43:02 +0000 Received: (at 54021) by debbugs.gnu.org; 18 Feb 2022 20:42:27 +0000 Received: from localhost ([127.0.0.1]:56473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLA5C-0005n6-DW for submit@debbugs.gnu.org; Fri, 18 Feb 2022 15:42:26 -0500 Received: from mail-pl1-f178.google.com ([209.85.214.178]:41727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLA5A-0005mt-Ni for 54021@debbugs.gnu.org; Fri, 18 Feb 2022 15:42:25 -0500 Received: by mail-pl1-f178.google.com with SMTP id j4so8051165plj.8 for <54021@debbugs.gnu.org>; Fri, 18 Feb 2022 12:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=oSzwYtNKKuszWJ+svRnNpUuskMW3TnuaIaaQK6pUCtc=; b=dULeZKns0ZUAbYVZ09fPf/mAkV89XhHG2Ge3zLzDzlgHfyG4SxsMMW0K9vEySlcfrq daNrvIyBfNfdYfvqOv8jgvc8Zbm3CJYYdv3MVEU7h97bzNcJ0ZHFpXLqdOzvIHyksuBX SSzy6oV1nNpqLm3I6n1TJ2OTbJzMZXdBDHK8DqosJ3XzVhaJz4LyXCSGccpuScfh9pnZ QKoYQBj/i+HGvJXCOKteHGPiH/EYmMslKT3HbgSSwuOWv5S+/sk1MzWBgc+Y5/mncq7y YYQhRSs36MZQjGG14Vl/bdCtF7dWVAjaXQHKuEVazr8ETlGdG968giBGgsd51OXiFdCW db+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=oSzwYtNKKuszWJ+svRnNpUuskMW3TnuaIaaQK6pUCtc=; b=q4MtS3MVnA/HWNeu0cRWXgSKV+pb1ubiutNwk5FJ1MM8JiSoMGhE0TlAWW0k5o8YhQ d3iza/CZqZLgXcr4OYgTNnYqg4O4LNcAIazCFjydz+6sll3EsNYBUpP+mS9FMVuNUgzb qk1g66fTgK1xbyMUi7VXpUY6VZtXcxz70k22FOBxzd9k0WgFH+1v3eAmSU/m8v9IFPm1 YGhUxIcxMlVv6VHPGGWDKllGhHPgdtbacNM9eVECm8r9eTFBsOEDgaJfXWmg6EBOfboT bfroNz+YvkMSGmIKwjGFgd5DT956nUIDh/vNRwp884f5d6FeySgB4R0AjVIAGnvB5Zk2 7l2A== X-Gm-Message-State: AOAM530+8hNv/wukH8jC/Wqhxo7xUs3JVuRGQco/AjwRMoBenxRT+l7H 10SvCojOcJ8of9HQb9Q5Eos= X-Google-Smtp-Source: ABdhPJw+9DJoltbPa7CnBfeCod8U6ohwk+nhcjV2jmlabIlCodQGrP68HcWYBR4HDRjDQ84BnjOcGQ== X-Received: by 2002:a17:90b:4a02:b0:1b8:d3c7:7a2b with SMTP id kk2-20020a17090b4a0200b001b8d3c77a2bmr14327431pjb.194.1645216938735; Fri, 18 Feb 2022 12:42:18 -0800 (PST) Received: from Ginko.local ([66.170.190.211]) by smtp.gmail.com with ESMTPSA id h5sm4144917pfi.18.2022.02.18.12.42.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 12:42:17 -0800 (PST) From: Frank Pursel Date: Fri, 18 Feb 2022 12:42:16 -0800 Message-ID: <87k0drrjo7.fsf@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi, I think this addresses all the identified issues and, best of all, does it with a now, meaningful check phase. Regards, Frank From e45fd6a53579327667067ca0642e97d0cb373d5c Mon Sep 17 00:00:00 2001 Message-Id: From: Frank Pursel Date: Tue, 15 Feb 2022 14:07:28 -0800 Subject: [PATCH] Adding rhino javascript guix package. * guix/gnu/package/javascript.scm (rhino): Added package. --- gnu/packages/javascript.scm | 106 +++++++++++++++++++++++++++++++++++- 1 file changed, 105 insertions(+), 1 deletion(-) diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm index c453ac432a..158abaded7 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. ;;; @@ -31,6 +32,9 @@ (define-module (gnu packages javascript) #:use-module (gnu packages readline) #:use-module (gnu packages uglifyjs) #:use-module (gnu packages web) + #:use-module (gnu packages java) + #:use-module (gnu packages bash) + #:use-module (gnu packages perl) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) @@ -38,7 +42,9 @@ (define-module (gnu packages javascript) #:use-module (guix build-system cmake) #:use-module (guix build-system trivial) #:use-module (guix build-system minify) - #:use-module (guix utils)) + #:use-module (guix build-system ant) + #:use-module (guix utils) + #:use-module (guix gexp)) (define-public cjson (package @@ -788,3 +794,101 @@ (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 + (let* ((rel-ver "1.7.7.2") + (commit "935942527ff434b205e797df4185518e5369466e")) + (package + (name "rhino") + (version rel-ver) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mozilla/rhino.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "09i4yr98hs6855fs7fhgmrpiwpr90lhxdv2bvfj97nn4rv1d7wl8")) + (modules '((guix build utils))) + (snippet '(begin + ;; Remove benchmark testing + (with-directory-excursion + "testsrc" + (delete-file-recursively "benchmarks")) + (with-directory-excursion + "testsrc/org/mozilla/javascript" + (delete-file-recursively "benchmarks")) + ;; Identify bundled jars + (format #t "~%~a~%" "Sourced jars") + (for-each (lambda (f) + (format #t "~/~a~%" 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) + (with-directory-excursion "man" + (install-file "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)))) +