diff mbox series

[bug#51838,v9,19/41] gnu: Add node-safe-buffer.

Message ID 20220108084229.362642-20-philip@philipmcgrath.com
State Accepted
Headers show
Series guix: node-build-system: Support compiling add-ons with node-gyp. | expand

Commit Message

Philip McGrath Jan. 8, 2022, 8:42 a.m. UTC
* gnu/packages/node-xyz.scm (node-safe-buffer): New variable.
---
 gnu/packages/node-xyz.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm
index e12849b0a6..9c524fec5e 100644
--- a/gnu/packages/node-xyz.scm
+++ b/gnu/packages/node-xyz.scm
@@ -393,6 +393,36 @@  (define-public node-inherits
 @code{inherits()}.")
     (license license:isc)))
 
+(define-public node-safe-buffer
+  (package
+    (name "node-safe-buffer")
+    (version "5.2.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/feross/safe-buffer")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0r26m0nl41h90ihnl2xf0cqs6z9z7jb87dl5j8yqb7887r9jlbpi"))))
+    (build-system node-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'patch-dependencies 'delete-dependencies
+           (lambda args
+             (delete-dependencies '("tape" "standard")))))
+       #:tests? #f))
+    (home-page
+     "https://github.com/feross/safe-buffer")
+    (synopsis "Safer Node.js Buffer API")
+    (description "A safe drop-in replacement the Node.js @code{Buffer} API
+that works in all versions of Node.js, using the built-in implementation when
+available.")
+    (license license:expat)))
+
 (define-public node-irc-colors
   (package
     (name "node-irc-colors")