unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#36599] [PATCH] gnu: Add node-semver.
@ 2019-07-11 12:12 Giacomo Leidi
  2019-09-02 12:49 ` Ludovic Courtès
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Giacomo Leidi @ 2019-07-11 12:12 UTC (permalink / raw)
  To: 36599; +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 © 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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#36599] [PATCH] gnu: Add node-semver.
  2019-07-11 12:12 [bug#36599] [PATCH] gnu: Add node-semver Giacomo Leidi
@ 2019-09-02 12:49 ` Ludovic Courtès
  2019-09-02 14:50   ` Julien Lepiller
  2020-04-07 23:06 ` [bug#36599] [PATCH] gnu: Add node-semver. (Updated) goodoldpaul
  2020-04-17 14:54 ` [bug#36599] " goodoldpaul
  2 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2019-09-02 12:49 UTC (permalink / raw)
  To: Giacomo Leidi; +Cc: 36599

Hi Giacomo,

This patch seems to have been forgotten…

Giacomo Leidi <goodoldpaul@autistici.org> 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 "https://github.com/npm/node-semver.git")
> +                    (commit (string-append "v" version))))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +                "0lqb0v7frrdr7yvxy8b2yg6rp1jilninzk76qnx5qnswxnr4gj5m"))))

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

This installs files in non-standard locations:

--8<---------------cut here---------------start------------->8---
$ find $(./pre-inst-env guix build node-semver)
/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0
/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/package-lock.json
/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/bin
/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/bin/semver.js
/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/package.json
/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/semver.js
/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/range.bnf
/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/LICENSE
--8<---------------cut here---------------end--------------->8---

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

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 go
to share/node-semver?

Thanks in advance, and apologies for the loooong delay!

Ludo’.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#36599] [PATCH] gnu: Add node-semver.
  2019-09-02 12:49 ` Ludovic Courtès
@ 2019-09-02 14:50   ` Julien Lepiller
  2019-09-02 17:13     ` goodoldpaul
  0 siblings, 1 reply; 12+ messages in thread
From: Julien Lepiller @ 2019-09-02 14:50 UTC (permalink / raw)
  To: 36599, ludo, goodoldpaul

Le 2 septembre 2019 14:49:08 GMT+02:00, "Ludovic Courtès" <ludo@gnu.org> a écrit :
>Hi Giacomo,
>
>This patch seems to have been forgotten…
>
>Giacomo Leidi <goodoldpaul@autistici.org> 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 "https://github.com/npm/node-semver.git")
>> +                    (commit (string-append "v" version))))
>> +              (file-name (git-file-name name version))
>> +              (sha256
>> +               (base32
>> +               
>"0lqb0v7frrdr7yvxy8b2yg6rp1jilninzk76qnx5qnswxnr4gj5m"))))
>
>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)
>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))))
>
>This installs files in non-standard locations:
>
>--8<---------------cut here---------------start------------->8---
>$ find $(./pre-inst-env guix build node-semver)
>/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0
>/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/package-lock.json
>/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/bin
>/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/bin/semver.js
>/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/package.json
>/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/semver.js
>/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/range.bnf
>/gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/LICENSE
>--8<---------------cut here---------------end--------------->8---
>
>bin/ is fine, though should the binary be called ‘semver’ instead of
>‘semver.js’?
>
>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
>go
>to share/node-semver?
>
>Thanks in advance, and apologies for the loooong delay!
>
>Ludo’.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#36599] [PATCH] gnu: Add node-semver.
  2019-09-02 14:50   ` Julien Lepiller
@ 2019-09-02 17:13     ` goodoldpaul
  0 siblings, 0 replies; 12+ messages in thread
From: goodoldpaul @ 2019-09-02 17:13 UTC (permalink / raw)
  To: 36599

[-- Attachment #1: Type: text/plain, Size: 3917 bytes --]

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!

Bye,

Giacomo

On 2019-09-02 14:50, Julien Lepiller wrote:
> Le 2 septembre 2019 14:49:08 GMT+02:00, "Ludovic Courtès"
> <ludo@gnu.org> a écrit :
>> Hi Giacomo,
>> 
>> This patch seems to have been forgotten…
>> 
>> Giacomo Leidi <goodoldpaul@autistici.org> 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 "https://github.com/npm/node-semver.git")
>>> +                    (commit (string-append "v" version))))
>>> +              (file-name (git-file-name name version))
>>> +              (sha256
>>> +               (base32
>>> +
>> "0lqb0v7frrdr7yvxy8b2yg6rp1jilninzk76qnx5qnswxnr4gj5m"))))
>> 
>> 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)
>> 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))))
>> 
>> This installs files in non-standard locations:
>> 
>> --8<---------------cut here---------------start------------->8---
>> $ find $(./pre-inst-env guix build node-semver)
>> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0
>> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/package-lock.json
>> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/bin
>> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/bin/semver.js
>> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/package.json
>> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/semver.js
>> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/range.bnf
>> /gnu/store/dmclr4h1jwqp02j9bpp9xsr5pzacdmnl-node-semver-6.2.0/LICENSE
>> --8<---------------cut here---------------end--------------->8---
>> 
>> bin/ is fine, though should the binary be called ‘semver’ instead of
>> ‘semver.js’?
>> 
>> 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
>> go
>> to share/node-semver?
>> 
>> Thanks in advance, and apologies for the loooong delay!
>> 
>> Ludo’.
> 
> Actually we have a node-build-system now which woull work much better
> than the trivial-build-system.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-node-semver.patch --]
[-- Type: text/x-diff; name=0001-gnu-Add-node-semver.patch, Size: 3216 bytes --]

From 88991ab20c81b86ae82ed9c7102d3cd163ee3f98 Mon Sep 17 00:00:00 2001
From: Giacomo Leidi <goodoldpaul@autistici.org>
Date: Mon, 2 Sep 2019 19:03:17 +0200
Subject: [PATCH] gnu: Add node-semver.

* gnu/packages/npm.scm: New file.
* gnu/local.mk: Add it.
* gnu/packages/npm.scm (node-semver): New variable.
---
 gnu/local.mk         |  2 ++
 gnu/packages/npm.scm | 47 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)
 create mode 100644 gnu/packages/npm.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index dbae857c38..81e52a8b9a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -22,6 +22,7 @@
 # Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 # Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
 # Copyright © 2019 John Soo <jsoo1@asu.edu>
+# Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
 #
 # This file is part of GNU Guix.
 #
@@ -354,6 +355,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/ninja.scm			\
   %D%/packages/node.scm				\
   %D%/packages/noweb.scm			\
+  %D%/packages/npm.scm				\
   %D%/packages/nss.scm				\
   %D%/packages/ntp.scm				\
   %D%/packages/nutrition.scm			\
diff --git a/gnu/packages/npm.scm b/gnu/packages/npm.scm
new file mode 100644
index 0000000000..1c47dc0500
--- /dev/null
+++ b/gnu/packages/npm.scm
@@ -0,0 +1,47 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages npm)
+  #:use-module (guix build-system node)
+  #:use-module (guix git-download)
+  #:use-module ((guix licenses) #:select (isc))
+  #:use-module (guix packages))
+
+(define-public node-semver
+  (package
+    (name "node-semver")
+    (version "6.3.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
+                "15xqmj5h1gz2p3v3gczjl07rm75miavqr70xw2fxgz3n880s4iyn"))))
+    (build-system node-build-system)
+    (arguments
+     `(;; FIXME: Tests depend on node-tap
+       #:tests? #f))
+    (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.23.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#36599] [PATCH] gnu: Add node-semver. (Updated)
  2019-07-11 12:12 [bug#36599] [PATCH] gnu: Add node-semver Giacomo Leidi
  2019-09-02 12:49 ` Ludovic Courtès
@ 2020-04-07 23:06 ` goodoldpaul
  2020-04-09 20:01   ` Efraim Flashner
  2020-04-18 18:39   ` bug#36599: " Efraim Flashner
  2020-04-17 14:54 ` [bug#36599] " goodoldpaul
  2 siblings, 2 replies; 12+ messages in thread
From: goodoldpaul @ 2020-04-07 23:06 UTC (permalink / raw)
  To: 36599

[-- Attachment #1: Type: text/plain, Size: 67 bytes --]

Hi,
this patch fell again out of my mind. Here's an update version.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-node-semver.patch --]
[-- Type: text/x-diff; name=0001-gnu-Add-node-semver.patch, Size: 1847 bytes --]

From 143a217a89e4f73149c73523565a1437d8bdfa0e Mon Sep 17 00:00:00 2001
From: Giacomo Leidi <goodoldpaul@autistici.org>
Date: Wed, 8 Apr 2020 00:59:13 +0200
Subject: [PATCH]  gnu: Add node-semver.

* gnu/packages/node-xyz.scm (node-semver): New variable.
---
 gnu/packages/node-xyz.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm
index 44236ec469..27cd5c18b7 100644
--- a/gnu/packages/node-xyz.scm
+++ b/gnu/packages/node-xyz.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -244,3 +245,26 @@ protocol used in @code{node-lynx}.")
     (description "This package provides the Node.js @code{util.deprecate()}
 function with browser support.")
     (license license:expat)))
+
+(define-public node-semver
+  (package
+    (name "node-semver")
+    (version "7.2.1")
+    (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
+                "06biknqb05r9xsmcflm3ygh50pjvdk84x6r79w43kmck4fn3qn5p"))))
+    (build-system node-build-system)
+    (arguments
+     `(#:tests? #f)) ;; FIXME: Tests depend on node-tap
+    (home-page "https://github.com/npm/node-semver")
+    (synopsis "Parses semantic versions strings")
+    (description
+     "@code{node-semver} is a JavaScript implementation of the
+@uref{https://semver.org/, SemVer.org} specification.")
+    (license license:isc)))
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#36599] [PATCH] gnu: Add node-semver. (Updated)
  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-18 18:39   ` bug#36599: " Efraim Flashner
  1 sibling, 1 reply; 12+ messages in thread
From: Efraim Flashner @ 2020-04-09 20:01 UTC (permalink / raw)
  To: goodoldpaul; +Cc: 36599

[-- Attachment #1: Type: text/plain, Size: 1292 bytes --]

Overall it looks good to me. I also checked npm¹ and it agrees that
there are no dependencies for this package. Do you happen to know why
there's a test directory installed? I don't know if it's supposed to be
there but it seems strange to me

$ tree /gnu/store/sgq5frrlnpip3sjjsqjrwc4czys1ry8a-node-semver-7.2.1 -d
/gnu/store/sgq5frrlnpip3sjjsqjrwc4czys1ry8a-node-semver-7.2.1
├── bin
├── lib
│   └── node_modules
│       └── semver
│           ├── bin
│           ├── classes
│           ├── functions
│           ├── internal
│           ├── ranges
│           ├── tap-snapshots
│           └── test
│               ├── bin
│               ├── classes
│               ├── fixtures
│               ├── functions
│               ├── internal
│               └── ranges
└── share
    └── doc
        └── node-semver-7.2.1


¹ https://www.npmjs.com/package/semver



-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#36599] [PATCH] gnu: Add node-semver. (Updated)
  2020-04-09 20:01   ` Efraim Flashner
@ 2020-04-15 15:36     ` goodoldpaul
  2020-04-15 17:09       ` Julien Lepiller
  0 siblings, 1 reply; 12+ messages in thread
From: goodoldpaul @ 2020-04-15 15:36 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: 36599

[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]

Hi Efraim,

> Overall it looks good to me. I also checked npm¹ and it agrees that
> there are no dependencies for this package. Do you happen to know why
> there's a test directory installed? I don't know if it's supposed to be
> there but it seems strange to me

I didn't notice and I agree that tests shouldn't be installed but IIUC 
it's a limitation of the node-build-system that copies recursively the 
contents of the node_modules directory. I checked and it seems that 
other packages using the node-build-system have the same problem (i.e. 
node-color-name install test.js, node-far installs a test directory). 
One way to fix this could be adding an extra phase (either to each 
package or in the node-build-system with a special field indicating a 
list of tests directories) where we delete the test directory from  
node_modules preventing the copy.

On my system I get

orang3@frastanato ~/code/guix [env]$ du -sh 
/gnu/store/5kkb1nya9ws12b2qxsn0r7904nx6v5b5-node-semver-7.2.1
732K    /gnu/store/5kkb1nya9ws12b2qxsn0r7904nx6v5b5-node-semver-7.2.1

orang3@frastanato ~/code/guix [env]$ du -sh 
/gnu/store/5kkb1nya9ws12b2qxsn0r7904nx6v5b5-node-semver-7.2.1/lib/node_modules/semver/test/
264K    
/gnu/store/5kkb1nya9ws12b2qxsn0r7904nx6v5b5-node-semver-7.2.1/lib/node_modules/semver/test/

which is not much but amounts nearly to 1/3 of the total disk usage of 
semver. If you believe that another phase deleting the tests would be 
better I attached an attempt.

Giacomo

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-node-semver.patch --]
[-- Type: text/x-diff; name=0001-gnu-Add-node-semver.patch, Size: 2163 bytes --]

From 77ffe7c3a0be8e215f4f4ae0b780385ffe39c1a2 Mon Sep 17 00:00:00 2001
From: Giacomo Leidi <goodoldpaul@autistici.org>
Date: Wed, 8 Apr 2020 00:59:13 +0200
Subject: [PATCH]  gnu: Add node-semver.

* gnu/packages/node-xyz.scm (node-semver): New variable.
---
 gnu/packages/node-xyz.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm
index 44236ec469..93328969e5 100644
--- a/gnu/packages/node-xyz.scm
+++ b/gnu/packages/node-xyz.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -244,3 +245,34 @@ protocol used in @code{node-lynx}.")
     (description "This package provides the Node.js @code{util.deprecate()}
 function with browser support.")
     (license license:expat)))
+
+(define-public node-semver
+  (package
+    (name "node-semver")
+    (version "7.2.1")
+    (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
+                "06biknqb05r9xsmcflm3ygh50pjvdk84x6r79w43kmck4fn3qn5p"))))
+    (build-system node-build-system)
+    (arguments
+     `(#:tests? #f ;; FIXME: Tests depend on node-tap
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'install 'delete-tests-dir
+           (lambda _
+             ;; Delete tests to prevent installing them
+             (delete-file-recursively "test")
+             (delete-file-recursively "tap-snapshots")
+             #t)))))
+    (home-page "https://github.com/npm/node-semver")
+    (synopsis "Parses semantic versions strings")
+    (description
+     "@code{node-semver} is a JavaScript implementation of the
+@uref{https://semver.org/, SemVer.org} specification.")
+    (license license:isc)))
-- 
2.26.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#36599] [PATCH] gnu: Add node-semver. (Updated)
  2020-04-15 15:36     ` goodoldpaul
@ 2020-04-15 17:09       ` Julien Lepiller
  0 siblings, 0 replies; 12+ messages in thread
From: Julien Lepiller @ 2020-04-15 17:09 UTC (permalink / raw)
  To: 36599, goodoldpaul, efraim

Le 15 avril 2020 11:36:06 GMT-04:00, goodoldpaul@autistici.org a écrit :
>Hi Efraim,
>
>> Overall it looks good to me. I also checked npm¹ and it agrees that
>> there are no dependencies for this package. Do you happen to know why
>> there's a test directory installed? I don't know if it's supposed to
>be
>> there but it seems strange to me
>
>I didn't notice and I agree that tests shouldn't be installed but IIUC 
>it's a limitation of the node-build-system that copies recursively the 
>contents of the node_modules directory. I checked and it seems that 
>other packages using the node-build-system have the same problem (i.e. 
>node-color-name install test.js, node-far installs a test directory). 
>One way to fix this could be adding an extra phase (either to each 
>package or in the node-build-system with a special field indicating a 
>list of tests directories) where we delete the test directory from  
>node_modules preventing the copy.
>
>On my system I get
>
>orang3@frastanato ~/code/guix [env]$ du -sh 
>/gnu/store/5kkb1nya9ws12b2qxsn0r7904nx6v5b5-node-semver-7.2.1
>732K    /gnu/store/5kkb1nya9ws12b2qxsn0r7904nx6v5b5-node-semver-7.2.1
>
>orang3@frastanato ~/code/guix [env]$ du -sh 
>/gnu/store/5kkb1nya9ws12b2qxsn0r7904nx6v5b5-node-semver-7.2.1/lib/node_modules/semver/test/
>264K    
>/gnu/store/5kkb1nya9ws12b2qxsn0r7904nx6v5b5-node-semver-7.2.1/lib/node_modules/semver/test/
>
>which is not much but amounts nearly to 1/3 of the total disk usage of 
>semver. If you believe that another phase deleting the tests would be 
>better I attached an attempt.
>
>Giacomo

Does npm install the test.js files when run by ittself (in which case we replicate its behavior), or does it have a mechanism to know what files to install? If so we thould replicate that mecanism.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#36599] [PATCH] gnu: Add node-semver. (Updated)
  2019-07-11 12:12 [bug#36599] [PATCH] gnu: Add node-semver Giacomo Leidi
  2019-09-02 12:49 ` Ludovic Courtès
  2020-04-07 23:06 ` [bug#36599] [PATCH] gnu: Add node-semver. (Updated) goodoldpaul
@ 2020-04-17 14:54 ` goodoldpaul
  2020-04-17 15:03   ` Efraim Flashner
  2020-04-17 16:09   ` Julien Lepiller
  2 siblings, 2 replies; 12+ messages in thread
From: goodoldpaul @ 2020-04-17 14:54 UTC (permalink / raw)
  To: julien; +Cc: 36599

Hi Julien,

> Does npm install the test.js files when run by ittself (in which case 
> we replicate its behavior), or does it have a mechanism to know what 
> files to install? If so we thould replicate that mecanism.

On my system I get

giacomo@frarch /tmp$ npm i semver
npm WARN saveError ENOENT: no such file or directory, open 
'/tmp/package.json'
npm WARN enoent ENOENT: no such file or directory, open 
'/tmp/package.json'
npm WARN tmp No description
npm WARN tmp No repository field.
npm WARN tmp No README data
npm WARN tmp No license field.

+ semver@7.3.2
added 1 package and audited 1 package in 0.626s
found 0 vulnerabilities

giacomo@frarch /tmp$ ls -l node_modules/semver/
total 48
drwxr-xr-x 2 giacomo giacomo    60 Apr 17 16:43 bin/
-rw-r--r-- 1 giacomo giacomo  2257 Oct 26  1985 CHANGELOG.md
drwxr-xr-x 2 giacomo giacomo   120 Apr 17 16:43 classes/
drwxr-xr-x 2 giacomo giacomo   520 Apr 17 16:43 functions/
-rw-r--r-- 1 giacomo giacomo  1982 Oct 26  1985 index.js
drwxr-xr-x 2 giacomo giacomo   120 Apr 17 16:43 internal/
-rw-r--r-- 1 giacomo giacomo   765 Oct 26  1985 LICENSE
-rw-r--r-- 1 giacomo giacomo  1645 Apr 17 16:43 package.json
-rw-r--r-- 1 giacomo giacomo    69 Oct 26  1985 preload.js
-rw-r--r-- 1 giacomo giacomo   619 Oct 26  1985 range.bnf
drwxr-xr-x 2 giacomo giacomo   260 Apr 17 16:43 ranges/
-rw-r--r-- 1 giacomo giacomo 22109 Oct 26  1985 README.md

so I believe that npm uses the "files" key [0] in package.json to decide 
what to install.

I'm definitely available to implement that but it could take a week or 
two, if we feel it should be changed right away I'm probably not the 
best person to do that.

What do you think? Should I open another issue about this?

Giacomo

[0]: https://github.com/npm/node-semver/blob/master/package.json#L21

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#36599] [PATCH] gnu: Add node-semver. (Updated)
  2020-04-17 14:54 ` [bug#36599] " goodoldpaul
@ 2020-04-17 15:03   ` Efraim Flashner
  2020-04-17 16:09   ` Julien Lepiller
  1 sibling, 0 replies; 12+ messages in thread
From: Efraim Flashner @ 2020-04-17 15:03 UTC (permalink / raw)
  To: goodoldpaul; +Cc: julien, 36599

[-- Attachment #1: Type: text/plain, Size: 2384 bytes --]

On Fri, Apr 17, 2020 at 02:54:43PM +0000, goodoldpaul@autistici.org wrote:
> Hi Julien,
> 
> > Does npm install the test.js files when run by ittself (in which case we
> > replicate its behavior), or does it have a mechanism to know what files
> > to install? If so we thould replicate that mecanism.
> 
> On my system I get
> 
> giacomo@frarch /tmp$ npm i semver
> npm WARN saveError ENOENT: no such file or directory, open
> '/tmp/package.json'
> npm WARN enoent ENOENT: no such file or directory, open '/tmp/package.json'
> npm WARN tmp No description
> npm WARN tmp No repository field.
> npm WARN tmp No README data
> npm WARN tmp No license field.
> 
> + semver@7.3.2
> added 1 package and audited 1 package in 0.626s
> found 0 vulnerabilities
> 
> giacomo@frarch /tmp$ ls -l node_modules/semver/
> total 48
> drwxr-xr-x 2 giacomo giacomo    60 Apr 17 16:43 bin/
> -rw-r--r-- 1 giacomo giacomo  2257 Oct 26  1985 CHANGELOG.md
> drwxr-xr-x 2 giacomo giacomo   120 Apr 17 16:43 classes/
> drwxr-xr-x 2 giacomo giacomo   520 Apr 17 16:43 functions/
> -rw-r--r-- 1 giacomo giacomo  1982 Oct 26  1985 index.js
> drwxr-xr-x 2 giacomo giacomo   120 Apr 17 16:43 internal/
> -rw-r--r-- 1 giacomo giacomo   765 Oct 26  1985 LICENSE
> -rw-r--r-- 1 giacomo giacomo  1645 Apr 17 16:43 package.json
> -rw-r--r-- 1 giacomo giacomo    69 Oct 26  1985 preload.js
> -rw-r--r-- 1 giacomo giacomo   619 Oct 26  1985 range.bnf
> drwxr-xr-x 2 giacomo giacomo   260 Apr 17 16:43 ranges/
> -rw-r--r-- 1 giacomo giacomo 22109 Oct 26  1985 README.md
> 
> so I believe that npm uses the "files" key [0] in package.json to decide
> what to install.
> 

Thanks for looking into it.

> I'm definitely available to implement that but it could take a week or two,
> if we feel it should be changed right away I'm probably not the best person
> to do that.
> 
> What do you think? Should I open another issue about this?

I think we should fix it, but it shouldn't block getting your package
into Guix. Go ahead and open a new issue for it.

> 
> Giacomo
> 
> [0]: https://github.com/npm/node-semver/blob/master/package.json#L21
> 
> 
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#36599] [PATCH] gnu: Add node-semver. (Updated)
  2020-04-17 14:54 ` [bug#36599] " goodoldpaul
  2020-04-17 15:03   ` Efraim Flashner
@ 2020-04-17 16:09   ` Julien Lepiller
  1 sibling, 0 replies; 12+ messages in thread
From: Julien Lepiller @ 2020-04-17 16:09 UTC (permalink / raw)
  To: goodoldpaul; +Cc: 36599

Le 17 avril 2020 10:54:43 GMT-04:00, goodoldpaul@autistici.org a écrit :
>Hi Julien,
>
>> Does npm install the test.js files when run by ittself (in which case
>
>> we replicate its behavior), or does it have a mechanism to know what 
>> files to install? If so we thould replicate that mecanism.
>
>On my system I get
>
>giacomo@frarch /tmp$ npm i semver
>npm WARN saveError ENOENT: no such file or directory, open 
>'/tmp/package.json'
>npm WARN enoent ENOENT: no such file or directory, open 
>'/tmp/package.json'
>npm WARN tmp No description
>npm WARN tmp No repository field.
>npm WARN tmp No README data
>npm WARN tmp No license field.
>
>+ semver@7.3.2
>added 1 package and audited 1 package in 0.626s
>found 0 vulnerabilities
>
>giacomo@frarch /tmp$ ls -l node_modules/semver/
>total 48
>drwxr-xr-x 2 giacomo giacomo    60 Apr 17 16:43 bin/
>-rw-r--r-- 1 giacomo giacomo  2257 Oct 26  1985 CHANGELOG.md
>drwxr-xr-x 2 giacomo giacomo   120 Apr 17 16:43 classes/
>drwxr-xr-x 2 giacomo giacomo   520 Apr 17 16:43 functions/
>-rw-r--r-- 1 giacomo giacomo  1982 Oct 26  1985 index.js
>drwxr-xr-x 2 giacomo giacomo   120 Apr 17 16:43 internal/
>-rw-r--r-- 1 giacomo giacomo   765 Oct 26  1985 LICENSE
>-rw-r--r-- 1 giacomo giacomo  1645 Apr 17 16:43 package.json
>-rw-r--r-- 1 giacomo giacomo    69 Oct 26  1985 preload.js
>-rw-r--r-- 1 giacomo giacomo   619 Oct 26  1985 range.bnf
>drwxr-xr-x 2 giacomo giacomo   260 Apr 17 16:43 ranges/
>-rw-r--r-- 1 giacomo giacomo 22109 Oct 26  1985 README.md
>
>so I believe that npm uses the "files" key [0] in package.json to
>decide 
>what to install.
>
>I'm definitely available to implement that but it could take a week or 
>two, if we feel it should be changed right away I'm probably not the 
>best person to do that.
>
>What do you think? Should I open another issue about this?
>
>Giacomo
>
>[0]: https://github.com/npm/node-semver/blob/master/package.json#L21

We don't have to rush, and I won't implement that faster than you, so if you can and want to do it, please go ahead :). Opening a new bug to track that is a good idea. Can you do that?

Thank you!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#36599: [PATCH] gnu: Add node-semver. (Updated)
  2020-04-07 23:06 ` [bug#36599] [PATCH] gnu: Add node-semver. (Updated) goodoldpaul
  2020-04-09 20:01   ` Efraim Flashner
@ 2020-04-18 18:39   ` Efraim Flashner
  1 sibling, 0 replies; 12+ messages in thread
From: Efraim Flashner @ 2020-04-18 18:39 UTC (permalink / raw)
  To: goodoldpaul; +Cc: 36599-done

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

As we discussed in the other parts of this thread, I've pushed the patch
(without the extra phase to delete the tests) and closed the bug. Feel
free to open a bug about only installing the intended files.


-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-04-18 18:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-11 12:12 [bug#36599] [PATCH] gnu: Add node-semver Giacomo Leidi
2019-09-02 12:49 ` 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

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).