From patchwork Wed Feb 16 01:58:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Pursel X-Patchwork-Id: 37283 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 A168527BBEA; Wed, 16 Feb 2022 02:01:05 +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 1EA0727BBE9 for ; Wed, 16 Feb 2022 02:01:05 +0000 (GMT) Received: from localhost ([::1]:43302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nK9cu-0002Eg-6l for patchwork@mira.cbaines.net; Tue, 15 Feb 2022 21:01:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nK9c7-0002ET-Vr for guix-patches@gnu.org; Tue, 15 Feb 2022 21:00:16 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53100) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nK9bv-0001BP-02 for guix-patches@gnu.org; Tue, 15 Feb 2022 21:00:14 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nK9bu-00071u-TG for guix-patches@gnu.org; Tue, 15 Feb 2022 21:00:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54021] [PATCH] Add rhino javascript package Resent-From: Frank Pursel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 16 Feb 2022 02:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54021 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54021@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164497674626916 (code B ref -1); Wed, 16 Feb 2022 02:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 16 Feb 2022 01:59:06 +0000 Received: from localhost ([127.0.0.1]:46997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nK9b0-000702-EC for submit@debbugs.gnu.org; Tue, 15 Feb 2022 20:59:06 -0500 Received: from lists.gnu.org ([209.51.188.17]:50568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nK9az-0006zv-5Q for submit@debbugs.gnu.org; Tue, 15 Feb 2022 20:59:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:32796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nK9ay-0002Ao-Rg for guix-patches@gnu.org; Tue, 15 Feb 2022 20:59:04 -0500 Received: from [2607:f8b0:4864:20::630] (port=35816 helo=mail-pl1-x630.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nK9aw-00014L-Jm for guix-patches@gnu.org; Tue, 15 Feb 2022 20:59:04 -0500 Received: by mail-pl1-x630.google.com with SMTP id i10so851276plr.2 for ; Tue, 15 Feb 2022 17:58:59 -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=bfkMj73rWQu7AeeQIZEc8GeSZQkKBmlOuGx5GNXOWKI=; b=Nf4UJ7rm18ozEqnrd0ZLegldTtERjzH2yzIvyOsCsDfhfxn9RU7+zNc2TxKIvbjVdp gvb23Xs72+TVQaM89JAc7cUe7w7F9nHE+BPR+im2Ty1ikwN5+iaFNo2xc/epNVQ4Syqo r2bpXZEkM9ZZeoQ5lkZ4xgSKoeVFtmLeeYzBXi4jS1sxjVm410o0OnuUFWxAz+OycRQQ ttaGAiUueKX+tbG/UQKAfXv9EoVYuTaG1NdhEEOUfm9jEBZb5H/OT31g+UF4ue+chwA7 LYWLjMHXHaozyVbCT2ijZf0ADpv9EaPIxhmEr6xfXdTBJ+MIxFaR+cowmA6IXwH4Jx40 HuHQ== 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=bfkMj73rWQu7AeeQIZEc8GeSZQkKBmlOuGx5GNXOWKI=; b=M+v51WrBAUSAlzxBDjJJVpkdLxQ6xRGA8gRkm5/anx9u5ebgZ9zFBSr738+Oe1T0he YCK0G5sXca0fXE9Vlg0IoLtn/BAa3Dwh6AvxZTSIUo7hFTeir2xlSwqSLDEQ7pxoEdIb Q6uxNmKUYpA7WzsZdKk93glyxVmpNoHAfkZnQs2ZA1yRL845gWMwGa83f+M9NsusbMRN KRckZj9k/P06fBnhcSgXnQPQJNjrq6W09AB9u5TLV/P/A8tLqeoVnHk7tKKKTgdWlFMP I0C4Eps98+UFA4egGcVtDiCaKxi3e0dYoXK5swUvrkDIQ3fwfa6SCIk2+D7r6GBbXHy8 Pxvw== X-Gm-Message-State: AOAM532KWYXaJW3J/VfYXPWQgWpxbvwJVCIoaJwDjwbvf86tqNxtIq+Y aYNclUvC5kq23aH6Qd8MRJFViwD90Dk= X-Google-Smtp-Source: ABdhPJxBzacJpLlYg1nJ0Yhdm4TC/HhPQ8Agu4YeEbawsRZXOQk35ze74GdxMB7KTMqNffKTJMf/sg== X-Received: by 2002:a17:90a:a117:b0:1b9:65ef:fa64 with SMTP id s23-20020a17090aa11700b001b965effa64mr351134pjp.102.1644976738341; Tue, 15 Feb 2022 17:58:58 -0800 (PST) Received: from Ginko.local ([66.170.190.211]) by smtp.gmail.com with ESMTPSA id k13sm44429686pfc.176.2022.02.15.17.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 17:58:57 -0800 (PST) From: Frank Pursel Date: Tue, 15 Feb 2022 17:58:53 -0800 Message-ID: <87pmnnr2qq.fsf@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::630 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=frank.pursel@gmail.com; helo=mail-pl1-x630.google.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.904, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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, Rhino javascript has been around a long time. It has also been built upon by many others. I needed to build this version for another package and wanted to send it on as it might be useful. Regards, Frank From c386b47786fc318cdfa0b1157a22590ebc279460 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 | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm index c453ac432a..e9db0d2ce6 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,7 @@ (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 (guix packages) #:use-module (guix download) #:use-module (guix git-download) @@ -38,6 +40,7 @@ (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 build-system ant) #:use-module (guix utils)) (define-public cjson @@ -788,3 +791,65 @@ (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") (rel-git-tag "Rhino1_7_7_2_Release") + (git-commitv "935942527ff434b205e797df4185518e5369466e") + (git-short-commit (substring git-commitv 0 6)) + (hash "09i4yr98hs6855fs7fhgmrpiwpr90lhxdv2bvfj97nn4rv1d7wl8")) + (package + (name "rhino") + (version git-short-commit) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mozilla/rhino.git") + (commit git-short-commit))) + (file-name (git-file-name name git-short-commit)) + (sha256 + (base32 + hash)))) + (build-system ant-build-system) + (inputs (list java-junit java-hamcrest-core + `(,icedtea "jdk"))) + (arguments + `(#:phases (modify-phases %standard-phases + (add-after 'unpack 'clean-jars + (lambda _ + (for-each (lambda (jarf) + (delete-file jarf) + (format #t "Deleted: ~s +" jarf)) + (find-files "." ".*\\.jar$")) #t)) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (if tests? + (setenv "ANT_OPTS" "-Doffline=true") + (invoke "ant" "junit")) #t)) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (pkg+ver (string-append ,name ,rel-ver)) + (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") + (which "java") + (string-append out "/share/java/js.jar")))) + (chmod rhino #o755) #t)))))) + (home-page "https://mozilla.github.io/rhino") + (synopsis "Javascript implemented in java") + (description + "The Rhino engine, created primarily by Norris +Boyd (also at Netscape) is a JavaScript implementation written in +Java. Rhino is ECMA-262 Edition 5 compliant.") + (license license:mpl2.0)))) +