From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SBuDMtHbDWJ/aAEAgWs5BA (envelope-from ) for ; Thu, 17 Feb 2022 06:23:29 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id oBbEL9HbDWJ8RAEA9RJhRA (envelope-from ) for ; Thu, 17 Feb 2022 06:23:29 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3B13F4F5BD for ; Thu, 17 Feb 2022 06:23:29 +0100 (CET) Received: from localhost ([::1]:53852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKZGJ-0007xt-MB for larch@yhetil.org; Thu, 17 Feb 2022 00:23:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKZG2-0007xf-S5 for guix-patches@gnu.org; Thu, 17 Feb 2022 00:23:10 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55941) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nKZFu-0000AU-FO for guix-patches@gnu.org; Thu, 17 Feb 2022 00:23:10 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nKZFu-0003bO-98 for guix-patches@gnu.org; Thu, 17 Feb 2022 00:23:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54021] [PATCH] Adding rhino package, revised patch 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: Thu, 17 Feb 2022 05:23: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.164507537013812 (code B ref 54021); Thu, 17 Feb 2022 05:23:02 +0000 Received: (at 54021) by debbugs.gnu.org; 17 Feb 2022 05:22:50 +0000 Received: from localhost ([127.0.0.1]:49838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKZFi-0003ah-6r for submit@debbugs.gnu.org; Thu, 17 Feb 2022 00:22:50 -0500 Received: from mail-pl1-f182.google.com ([209.85.214.182]:41487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKZFg-0003aU-8n for 54021@debbugs.gnu.org; Thu, 17 Feb 2022 00:22:48 -0500 Received: by mail-pl1-f182.google.com with SMTP id j4so3728505plj.8 for <54021@debbugs.gnu.org>; Wed, 16 Feb 2022 21:22:48 -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=d2XuMP99wP9Aiii5Oog+yEd2WaH9UeHIJdthK/k5Wu4=; b=O0xBcp0wfX+qiGpEN8aYazhvriRgd5fT2IfxZcEWBtlmD4GUHyKTFCTH/mfasCXqX8 qIVRzf37uMRejpj9HqgINh8b+jBuSf4ihB4Zg0/PRE/taGuVUQipEw+G+QBUgsx/TEoe KTrnMN9/nBBakR9fohs2vz/uSnF8LfoUcjBY33RjnBrgxwqg+Ks8KoucXwxIP9Cprann C569iU1n8nFv7vkhEiPFLo6FURrldwOj8qlPHy8OnOg755lXNRhSbDGtvavJfJORDCeh vGhOSvPyA0IcHmUMxjPJHei4kBxnmgxeMOMwmPyjIVb6S+rx+8rYS2YBS+f03Q4iA3Wa hrBg== 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=d2XuMP99wP9Aiii5Oog+yEd2WaH9UeHIJdthK/k5Wu4=; b=L6XhifZiSbzNZ7iuANY+o7QtqBML1Nt5OlnqzWCBA5+/mpau1GXwq7SmGF9EDQwCD2 4mQ4bSt5ZiLa0bf+2OfR9Jf1L9un87fah97t7DjajvP9pqY164sE57vKQGTDH2CuPB49 ZRXI8LMZ2cqkbiW2vI26GQDpaj34QmK/BnsRvKOy9Bc4GwGy6DbHIkcLZnA055E8dwHL by7PQTCYZpOsq/FMWbYWHlX74FgJb8R0kp3RqDh9y2GtPAOUykLf627XtDmkY/p/Gt2G 2eQjGWCX0vXgckOjzGMzCKJbMYrAdarFo79RZ4BUMBZ0knUmrjySF3yvGrkLpJh16elj uNtA== X-Gm-Message-State: AOAM5324ZRCbOFqjyjTDHYELjPTxvjo9vh7msedlA7POXGUK7NTOmUjE W27sI/140LTe69eyX/2z62c= X-Google-Smtp-Source: ABdhPJxjlxJa4lMxtLuEKS/ZPPaO7tKEH0PXoFEDjLk75Qz01raCHi//XFDSaPVnojCTz6SBL++ryw== X-Received: by 2002:a17:902:b112:b0:14d:b42c:d4bd with SMTP id q18-20020a170902b11200b0014db42cd4bdmr1274312plr.160.1645075362044; Wed, 16 Feb 2022 21:22:42 -0800 (PST) Received: from Ginko.local ([66.170.190.211]) by smtp.gmail.com with ESMTPSA id h14sm51133082pfh.95.2022.02.16.21.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 21:22:41 -0800 (PST) From: Frank Pursel Date: Wed, 16 Feb 2022 21:22:39 -0800 Message-ID: <87mtiqqd7k.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645075409; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=d2XuMP99wP9Aiii5Oog+yEd2WaH9UeHIJdthK/k5Wu4=; b=uBBnSfHPOyjqqIzzl+b7CiXF1BuBMyCC0fXCutnmNo0N1FKdpEEGmfMs0NYDlTPRvwkIH3 HFgJ/lERzLCbXSWl+bSfS2CFc/8Q4T1wQzZ1TRfffI5txPCGawSGKzfjNCxsjIYWpjcgiU Z7fG674k11vCb6KfKqEGGjC2Z0dU5wzqKZAhkdtOQkRaMxd8aC6kI7rbX24l8r2DPlntZw //Zf4kpKARvbpuYd3q5TtL5A5hS9Od1mn1Dr8PFhPYnboWGxIKTUEH4i368bYfpUw88HMT B9yrGSjliUji+MeEsEINCvCFwFGaEgA1zPD+xiP7QRVQjxqLcbEOJu3Wmx8jng== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645075409; a=rsa-sha256; cv=none; b=uRxGMGbIHXN8tQeEAX1YkEWFKkgHpelH7ydGcNNca0YXQ+er2sjmzdk0+sbRSjltkR/iFE WnYxh+E9QPOmmGgjc8mi9+HFEcx+n/fCCY/1L8pgxldRqozPviYftDuWt+kAoxyZ2ts6YD p7/ATsDQe6PnSBlEeXMlZzolpOolGqQFLNquE+KVXN53Ww0bWpiDcS9yAETv//xBp5RNaG lUe0ANXAJCrK3rksjQ+BorW0ao1TX0qNNyWO/47WzHo5hyuDUoo4e8fUwTQykFLRi4W5qz xx7+aOAj4xyZiflMwUWDQyrgk0PrpbDg3oGwhNuqfWc3u+RVs4x0+8V153KSEw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=O0xBcp0w; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.83 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=O0xBcp0w; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3B13F4F5BD X-Spam-Score: -2.83 X-Migadu-Scanner: scn0.migadu.com X-TUID: vvGAqh7MoKoJ Hi, I've incorporated the feedback I've receive so far and worked to get the check phase to complete successfully but this effort is complicated by the default use of benchmarking and instrumentation. I don't think this additional instrumentation is appropriate to the check phase of this package. I can get testing to naively succeed using an alternate target but because this version of the software has had longterm and widespread experience I recommend that we simply be honest and set tests? to #f. That is what I've done here. Comments in the source describe choices I made that you might decide are undesirable. Let me know what you think. Regards, Frank >From 84848769a9c40e770d7a29edf200292a04bdcb2e Mon Sep 17 00:00:00 2001 Message-Id: <84848769a9c40e770d7a29edf200292a04bdcb2e.1645075292.git.frank.= pursel@gmail.com> 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 | 105 +++++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 1 deletion(-) diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm index c453ac432a..3068ce8197 100644 --- a/gnu/packages/javascript.scm +++ b/gnu/packages/javascript.scm @@ -6,6 +6,7 @@ ;;; Copyright =C2=A9 2018 Nicolas Goaziou ;;; Copyright =C2=A9 2021 Pierre Neidhardt ;;; Copyright =C2=A9 2021 Maxim Cournoyer +;;; Copyright =C2=A9 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)) =20 (define-public cjson (package @@ -788,3 +794,100 @@ (define-public duktape your build, and use the Duktape API to call ECMAScript functions from C co= de 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 "09i4yr98hs6855fs7fhgmrpiwpr90lhxdv2bvfj97nn4rv1d= 7wl8")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Identify bundled jars to maintain build purity + ;; remove bundled jars but those for testing + ;; all appear to be for testing or unused build system + ;; + ;; source/rhino [env]$ find . -name '*.jar' + ;; ./testsrc/org/mozilla/javascript/tests/commonjs/mod= ule/modules.jar + ;; ./testsrc/tests/src/jstests.jar + ;; ./gradle/wrapper/gradle-wrapper.jar + (format #t "~%~a~%" "Sourced jars") + (for-each + (lambda (f) (format #t "~/~a~%" f)) + (find-files "." ".*\\.jar$")) + #t)))) + (build-system ant-build-system) + (inputs (list bash-minimal)) + (native-inputs (list java-junit + java-hamcrest-core + java-snakeyaml ;Required for tests. + perl ;Required for 'jsdriver' che= ck target. + )) + (arguments + `(#:tests? #f + ;; tests? currently fail + ;; the 'junit' target defaults to impure instrumentation = and benchmarking. + ;; there is another target 'jsdriver' of unknown scope wh= ich succeeds + ;; As this pkg+ver has seen longstanding use, tests? are = disabled. + #:phases (modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? inputs native-inputs #:allow-= other-keys) + (when tests? + (setenv "ANT_OPTS" "-Doffline=3Dtrue") + (let ((junit-lib (assoc-ref inputs "java-junit")) + (hamcrest-lib (assoc-ref inputs "java-hamc= rest-core")) + (snakeyaml-lib (assoc-ref inputs "java-sna= keyaml"))) + (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 "")))) + ;; Check could alternatively invoke the jsdriv= er target here. + (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"))) + (mkdir-p bin) + (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.j= ar")))) + (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)))) + --=20 2.34.0