gnu: r-maldiquant: Move to (gnu packages cran).
[jackhill/guix/guix.git] / gnu / packages / node.scm
index a3cf3c9..f0b989b 100644 (file)
@@ -6,6 +6,7 @@
 ;;; Copyright © 2017 Mike Gerwitz <mtg@gnu.org>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 
 (define-module (gnu packages node)
   #:use-module ((guix licenses) #:select (expat))
+  #:use-module ((guix build utils) #:select (alist-replace))
   #:use-module (guix packages)
   #:use-module (guix derivations)
   #:use-module (guix download)
+  #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
   #:use-module (gnu packages adns)
 (define-public node
   (package
     (name "node")
-    (version "10.19.0")
+    (version "10.20.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://nodejs.org/dist/v" version
                                   "/node-v" version ".tar.xz"))
               (sha256
                (base32
-                "0sginvcsf7lrlzsnpahj4bj1f673wfvby8kaxgvzlrbb7sy229v2"))
+                "0cvjwnl0wkcsyw3kannbdv01s235wrnp11n2s6swzjx95gpichfi"))
               (modules '((guix build utils)))
               (snippet
                `(begin
@@ -197,3 +200,33 @@ devices.")
     (license expat)
     (properties '((max-silent-time . 7200)     ;2h, needed on ARM
                   (timeout . 21600)))))        ;6h
+
+;; TODO: Make this the default node on core-updates.  This cannot be done on
+;; master since this version of node requires a newer nghttp2 library at link
+;; time.
+(define-public node-10.22
+  (package
+    (inherit node)
+    (version "10.22.0")
+    (source (origin
+              (inherit (package-source node))
+              (uri (string-append "https://nodejs.org/dist/v" version
+                                  "/node-v" version ".tar.xz"))
+              (sha256
+               (base32
+                "1nz18fa550li10r0kzsm28c2rvvq61nq8bqdygip0rmvbi2paxg0"))))
+    (inputs
+     (alist-replace "nghttp2" (list nghttp2-1.41 "lib")
+                    (package-inputs node)))))
+
+(define-public libnode
+  (package
+    (inherit node)
+    (name "libnode")
+    (arguments
+     (substitute-keyword-arguments (package-arguments node)
+       ((#:configure-flags flags ''())
+        `(cons* "--shared" "--without-npm" ,flags))
+       ((#:phases phases '%standard-phases)
+        `(modify-phases ,phases
+           (delete 'patch-npm-shebang)))))))