[PATCH 1/9] gnu: Add node-buffer-crc32.

DoneSubmitted by Nicolas Graves.
Details
3 participants
  • Liliana Marie Prikler
  • Marius Bakke
  • Nicolas Graves
Owner
unassigned
Severity
normal
Merged with
N
N
Nicolas Graves wrote on 14 Jun 11:49 +0200
(address . guix-patches@gnu.org)(name . Nicolas Graves)(address . ngraves@ngraves.fr)
20220614094954.15197-1-ngraves@ngraves.fr
* gnu/packages/node-xyz.scm (node-buffer-crc32): New variable.
---
gnu/packages/node-xyz.scm | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

Toggle diff (45 lines)
diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm
index 9dcb5c3d16..be37d627cf 100644
--- a/gnu/packages/node-xyz.scm
+++ b/gnu/packages/node-xyz.scm
@@ -56,6 +56,38 @@ (define-public node-acorn
 architecture supporting plugins.")
     (license license:expat)))
 
+(define-public node-buffer-crc32
+  (package
+    (name "node-buffer-crc32")
+    (version "0.2.13")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/brianloveswords/buffer-crc32")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+          (base32
+           "09qx2mnd898190m50mc0rhyvbm7d677sxz9bn09qmqkz6fnsddgf"))))
+    (build-system node-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (delete 'check)
+         (replace 'configure
+           (lambda* (#:key inputs #:allow-other-keys)
+             (invoke (string-append (assoc-ref inputs "node") "/bin/npm")
+                     "--offline" "--ignore-scripts" "install" "--production")
+             #t)))))
+    (home-page "https://github.com/brianloveswords/buffer-crc32")
+    (synopsis "crc32 that works with binary data and fancy character sets,
+outputs buffer, signed or unsigned data and has tests.")
+    (description "This package provides crc32 that works with binary data and
+fancy character sets, outputs buffer, signed or unsigned data and has tests, for
+Node.")
+    (license license:expat)))
+
 (define-public node-color-name
   (package
     (name "node-color-name")
-- 
2.36.1
N
N
Nicolas Graves wrote on 14 Jun 12:03 +0200
(address . 55958@debbugs.gnu.org)
87ilp3d0jp.fsf@ngraves.fr
Hi !

This series of patches allows to produce the crx file without having to
rely on chromium and xorg.

Not fully tested, originally designed for fixing bug#55844, and works at
least for building a few extensions.

I volontarily built all node packages without development dependencies
(npm...) so that it stays simple, and replaced mri by minimist so that we
also avoid a lot of dependencies.

Cheers,

Nicolas
L
L
Liliana Marie Prikler wrote on 15 Jun 11:21 +0200
(address . control@debbugs.gnu.org)
c511c7cd5bad5cf933cfee73d92d8253d8b3c9ef.camel@ist.tugraz.at
merge 55958 55959 55960 55961 55962 55963 55964 55965 55966
thanks
M
M
Marius Bakke wrote on 23 Jun 22:07 +0200
87h74brvnn.fsf@gnu.org
Nicolas Graves via Guix-patches via <guix-patches@gnu.org> skriver:

Toggle quote (5 lines)
> Hi !
>
> This series of patches allows to produce the crx file without having to
> rely on chromium and xorg.

Awesome. :-)

Toggle quote (3 lines)
> Not fully tested, originally designed for fixing bug#55844, and works at
> least for building a few extensions.

OK. Looking forward to more Chromium extensions in Guix!

Toggle quote (4 lines)
> I volontarily built all node packages without development dependencies
> (npm...) so that it stays simple, and replaced mri by minimist so that we
> also avoid a lot of dependencies.

Makes sense, well done. I'll comment on the patches individually.

Thanks!
-----BEGIN PGP SIGNATURE-----

iIUEARYKAC0WIQRNTknu3zbaMQ2ddzTocYulkRQQdwUCYrTH/A8cbWFyaXVzQGdu
dS5vcmcACgkQ6HGLpZEUEHfUHgD/ez/gygV3QbBcXh4JqcN528fs4Rf7rY/rq1+j
REUyjiUBAPPGPUNHKB69pP8HHhqDLJaKHbDgqGVkVTOJXjcGiUgA
=CoRn
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 23 Jun 22:15 +0200
Re: [bug#55958] [PATCH 1/9] gnu: Add node-buffer-crc32.
(name . Nicolas Graves)(address . ngraves@ngraves.fr)
87edzfrv9w.fsf@gnu.org
Nicolas Graves via Guix-patches via <guix-patches@gnu.org> skriver:

Toggle quote (2 lines)
> * gnu/packages/node-xyz.scm (node-buffer-crc32): New variable.

[...]

Toggle quote (5 lines)
> + (arguments
> + '(#:phases
> + (modify-phases %standard-phases
> + (delete 'check)

Use #:tests? #f instead of deleting the phase.

Toggle quote (5 lines)
> + (replace 'configure
> + (lambda* (#:key inputs #:allow-other-keys)
> + (invoke (string-append (assoc-ref inputs "node") "/bin/npm")
> + "--offline" "--ignore-scripts" "install" "--production")

Use (search-input-file inputs "/bin/npm") instead of (assoc-ref inputs ...).

Although in this case I think you don't need the absolute file name as
"npm" should already be on PATH, so you can just (invoke "npm" ...).


Toggle quote (2 lines)
> + #t)))))

There is no need to end phases on #t any more.

Toggle quote (4 lines)
> + (synopsis "crc32 that works with binary data and fancy character sets,
> +outputs buffer, signed or unsigned data and has tests.")

Try to keep synopses short, and avoid duplicating the description.
Maybe something like "CRC32 implementation in JavaScript"?

Toggle quote (2 lines)
> + (description "This package provides crc32 that works with binary data and

s/crc32/a CRC32 algorithm/

Toggle quote (2 lines)
> +fancy character sets, outputs buffer, signed or unsigned data and has tests, for

I don't understand what "outputs buffer" means here, can you elaborate?

Otherwise LGTM.
-----BEGIN PGP SIGNATURE-----

iIUEARYKAC0WIQRNTknu3zbaMQ2ddzTocYulkRQQdwUCYrTJ6w8cbWFyaXVzQGdu
dS5vcmcACgkQ6HGLpZEUEHearQD/UN+RzfTh3NNy1OYtJgrgVaY7IMFBNAPK1C4O
nq/KM+sBAMwlTqz8YVIB8/wnymr7pVn+1snHGB+fccDjfAgnFwcF
=WA9o
-----END PGP SIGNATURE-----

N
N
Nicolas Graves wrote on 19 Jul 23:28 +0200
[PATCH] gnu: Add node-buffer-crc32.
(address . 55958@debbugs.gnu.org)(address . ngraves@ngraves.fr)
20220719212859.26080-1-ngraves@ngraves.fr
* gnu/packages/node-xyz.scm (node-buffer-crc32): New variable.
---
gnu/packages/node-xyz.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

Toggle diff (43 lines)
diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm
index 9dcb5c3d16..d6035e2c23 100644
--- a/gnu/packages/node-xyz.scm
+++ b/gnu/packages/node-xyz.scm
@@ -56,6 +56,36 @@ (define-public node-acorn
 architecture supporting plugins.")
     (license license:expat)))
 
+(define-public node-buffer-crc32
+  (package
+    (name "node-buffer-crc32")
+    (version "0.2.13")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/brianloveswords/buffer-crc32")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+          (base32
+           "09qx2mnd898190m50mc0rhyvbm7d677sxz9bn09qmqkz6fnsddgf"))))
+    (build-system node-build-system)
+    (arguments
+     '(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key inputs #:allow-other-keys)
+             (invoke "npm" "--offline"
+                     "--ignore-scripts" "install" "--production"))))))
+    (home-page "https://github.com/brianloveswords/buffer-crc32")
+    (synopsis "CRC32 implementation in Javascript")
+    (description "This package provides a CRC32 algorithm that works with
+binary data and fancy character sets, signed or unsigned data and has tests,
+for Node.")
+    (license license:expat)))
+
 (define-public node-color-name
   (package
     (name "node-color-name")
-- 
2.37.0
?
Your comment

This issue is archived.

To comment on this conversation send email to 55958@debbugs.gnu.org