From: Giacomo Leidi <goodoldpaul@autistici.org>
To: 36599@debbugs.gnu.org
Cc: Giacomo Leidi <goodoldpaul@autistici.org>
Subject: [bug#36599] [PATCH] gnu: Add node-semver.
Date: Thu, 11 Jul 2019 14:12:21 +0200 [thread overview]
Message-ID: <20190711121221.16123-1-goodoldpaul@autistici.org> (raw)
* 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 © 2017 Mike Gerwitz <mtg@gnu.org>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018, 2019 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -23,10 +24,12 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(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.json" "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)))
--
2.22.0
next reply other threads:[~2019-07-11 15:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-11 12:12 Giacomo Leidi [this message]
2019-09-02 12:49 ` [bug#36599] [PATCH] gnu: Add node-semver Ludovic Courtès
2019-09-02 14:50 ` Julien Lepiller
2019-09-02 17:13 ` goodoldpaul
2020-04-07 23:06 ` [bug#36599] [PATCH] gnu: Add node-semver. (Updated) goodoldpaul
2020-04-09 20:01 ` Efraim Flashner
2020-04-15 15:36 ` goodoldpaul
2020-04-15 17:09 ` Julien Lepiller
2020-04-18 18:39 ` bug#36599: " Efraim Flashner
2020-04-17 14:54 ` [bug#36599] " goodoldpaul
2020-04-17 15:03 ` Efraim Flashner
2020-04-17 16:09 ` Julien Lepiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190711121221.16123-1-goodoldpaul@autistici.org \
--to=goodoldpaul@autistici.org \
--cc=36599@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).