[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#36599] [PATCH] gnu: Add node-semver.

From: goodoldpaul
Subject: [bug#36599] [PATCH] gnu: Add node-semver.
Date: Mon, 02 Sep 2019 17:13:09 +0000
User-agent: Roundcube Webmail

Hello everybody,
I also forgot about this patch: I was actually conviced that another patch providing node-semver was merged with the new node-build-system.

Here's the updated package (greatly simplified, as foreseen by Julien, thanks to the new node-build-system). I added it in a new npm.scm file to maintain consistency with i.e. Haskell, Python or Rust. If you think this should be put in node.scm, don't hesitate to tell!



On 2019-09-02 14:50, Julien Lepiller wrote:
Le 2 septembre 2019 14:49:08 GMT+02:00, "Ludovic Courtès"
<address@hidden> a écrit :
Hi Giacomo,

This patch seems to have been forgotten…

Giacomo Leidi <address@hidden> skribis:

* gnu/packages/node.scm (node-semver): New variable.


+(define-public node-semver
+  (package
+    (name "node-semver")
+    (version "6.2.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "";)
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32

The nice thing is that the source doesn’t contain any binaries (or
“minified” code),.

+    (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)
+                (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))))

This installs files in non-standard locations:

--8<---------------cut here---------------start------------->8---
$ find $(./pre-inst-env guix build node-semver)
--8<---------------cut here---------------end--------------->8---

bin/ is fine, though should the binary be called ‘semver’ instead of

Could you arrange so that ‘LICENSE’ goes to ‘share/doc/node-semver’?

As for the other files, I don’t know.   Are they needed?  Should they
to share/node-semver?

Thanks in advance, and apologies for the loooong delay!


Actually we have a node-build-system now which woull work much better
than the trivial-build-system.

Attachment: 0001-gnu-Add-node-semver.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]