From: goodoldpaul@autistici.org
To: Efraim Flashner <efraim@flashner.co.il>
Cc: 36599@debbugs.gnu.org
Subject: [bug#36599] [PATCH] gnu: Add node-semver. (Updated)
Date: Wed, 15 Apr 2020 15:36:06 +0000 [thread overview]
Message-ID: <c7c5b4ec926007e9611d74a7cca62d48@autistici.org> (raw)
In-Reply-To: <20200409200150.GQ1518@E5400>
[-- 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
next prev parent reply other threads:[~2020-04-15 15:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=c7c5b4ec926007e9611d74a7cca62d48@autistici.org \
--to=goodoldpaul@autistici.org \
--cc=36599@debbugs.gnu.org \
--cc=efraim@flashner.co.il \
/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).