From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:47808) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlals-0002ut-23 for guix-patches@gnu.org; Thu, 11 Jul 2019 11:14:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlalq-00050F-2N for guix-patches@gnu.org; Thu, 11 Jul 2019 11:14:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57808) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hlalo-0004x8-0U for guix-patches@gnu.org; Thu, 11 Jul 2019 11:14:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hlall-0001Va-Vt for guix-patches@gnu.org; Thu, 11 Jul 2019 11:14:03 -0400 Subject: [bug#36599] [PATCH] gnu: Add node-semver. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:48761) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlXwd-00067O-8a for guix-patches@gnu.org; Thu, 11 Jul 2019 08:13:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlXwa-00017D-0Q for guix-patches@gnu.org; Thu, 11 Jul 2019 08:13:03 -0400 Received: from latitanza.investici.org ([2001:888:2000:56::19]:61039) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hlXwZ-00010v-2l for guix-patches@gnu.org; Thu, 11 Jul 2019 08:12:59 -0400 From: Giacomo Leidi Date: Thu, 11 Jul 2019 14:12:21 +0200 Message-Id: <20190711121221.16123-1-goodoldpaul@autistici.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 36599@debbugs.gnu.org Cc: Giacomo Leidi * gnu/packages/node.scm (node-semver): New variable. --- gnu/packages/node.scm | 48 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm index fc43fcb04c..2f3fe17334 100644 --- a/gnu/packages/node.scm +++ b/gnu/packages/node.scm @@ -6,6 +6,7 @@ ;;; Copyright =C2=A9 2017 Mike Gerwitz ;;; Copyright =C2=A9 2018 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2018, 2019 Marius Bakke +;;; Copyright =C2=A9 2019 Giacomo Leidi ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,10 +24,12 @@ ;;; along with GNU Guix. If not, see . =20 (define-module (gnu packages node) - #:use-module ((guix licenses) #:select (expat)) + #:use-module ((guix licenses) #:select (expat isc)) #:use-module (guix packages) #:use-module (guix derivations) #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system trivial) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages adns) @@ -184,3 +187,46 @@ devices.") (home-page "https://nodejs.org/") (license expat) (properties '((timeout . 3600))))) ; 1 h + +(define-public node-semver + (package + (name "node-semver") + (version "6.2.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/npm/node-semver.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0lqb0v7frrdr7yvxy8b2yg6rp1jilninzk76qnx5qnswxnr4gj5m"))= )) + (build-system trivial-build-system) + (propagated-inputs + `(("node" ,node))) + (arguments + '(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((source (assoc-ref %build-inputs "source")) + (out (assoc-ref %outputs "out")) + (semver-js "semver.js") + (entry-point (string-append "bin/" semver-js))) + (mkdir-p (string-append out "/bin")) + (setenv "PATH" (string-append (assoc-ref %build-inputs + "node") + "/bin:" (getenv "PATH"))) + (map (lambda (file) + (install-file (string-append source "/" file) out)) + (list semver-js "LICENSE" "package.json" "package-lock.j= son" "range.bnf")) + (install-file (string-append source "/" entry-point) + (string-append out "/bin")) + (patch-shebang (string-append out "/" entry-point)) + #t)))) + (home-page "https://github.com/npm/node-semver") + (synopsis "Parses semantic versions strings") + (description + "node-semver is a JavaScript implementation of the +@uref{https://semver.org/, SemVer.org} specification.") + (license isc))) --=20 2.22.0