Patchwork gnu: node: Update to 6.8.0.

login
register
mail settings
Submitter Al McElrath
Date Oct. 14, 2016, 11:59 p.m.
Message ID <87oa2mzdle.fsf@atonesir.com>
Download mbox | patch
Permalink /patch/16524/
State New
Headers show

Comments

Al McElrath - Oct. 14, 2016, 11:59 p.m.
I took Jelle's 6.4.0 patch and updated it to 6.8.0. I only updated the
version and included a patch that is specific to 6.8.0. Hopefully this
version will have more success. I reset the author to myself. Not sure
what the protocol is for patching someone else's patch.
Ludovic Courtès - Oct. 17, 2016, 9:57 a.m.
Al McElrath <hello@atonesir.com> skribis:

> I took Jelle's 6.4.0 patch and updated it to 6.8.0. I only updated the
> version and included a patch that is specific to 6.8.0. Hopefully this
> version will have more success. I reset the author to myself. Not sure
> what the protocol is for patching someone else's patch.

For a relatively small patch like this, I think it doesn’t matter much,
though it’s a good idea to acknowledge people via a “Co-authored-by”
tag when appropriate.

> From e847558aa98e7f3f1d7abe3b89bcf52d8122b325 Mon Sep 17 00:00:00 2001
> From: Al McElrath <hello@yrns.org>
> Date: Fri, 14 Oct 2016 16:39:44 -0700
> Subject: [PATCH] gnu: node: Update to 6.8.0.
>
> Remove <https://debbugs.gnu.org/23744> and
> <https://debbugs.gnu.org/23723> workaround.
>
> * gnu/packages/node.scm (node): Update to 6.8.0.
>   (node)[arguments]: Disabled more tests. Remove custom 'patch-shebangs'
>   phase. Manually patch npm script shebang in new 'patch-npm-shebang'
>   phase.
> * gnu/packages/patches/node-9077.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add patches.

Applied, thanks!

Ludo’.

Patch

From e847558aa98e7f3f1d7abe3b89bcf52d8122b325 Mon Sep 17 00:00:00 2001
From: Al McElrath <hello@yrns.org>
Date: Fri, 14 Oct 2016 16:39:44 -0700
Subject: [PATCH] gnu: node: Update to 6.8.0.

Remove <https://debbugs.gnu.org/23744> and
<https://debbugs.gnu.org/23723> workaround.

* gnu/packages/node.scm (node): Update to 6.8.0.
  (node)[arguments]: Disabled more tests. Remove custom 'patch-shebangs'
  phase. Manually patch npm script shebang in new 'patch-npm-shebang'
  phase.
* gnu/packages/patches/node-9077.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add patches.
---
 gnu/local.mk                         |  1 +
 gnu/packages/node.scm                | 34 +++++++++++++++-------------------
 gnu/packages/patches/node-9077.patch | 30 ++++++++++++++++++++++++++++++
 3 files changed, 46 insertions(+), 19 deletions(-)
 create mode 100644 gnu/packages/patches/node-9077.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index a9343f0..979569a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -722,6 +722,7 @@  dist_patch_DATA =						\
   %D%/packages/patches/ngircd-no-dns-in-tests.patch		\
   %D%/packages/patches/ninja-tests.patch			\
   %D%/packages/patches/ninja-zero-mtime.patch			\
+  %D%/packages/patches/node-9077.patch				\
   %D%/packages/patches/nss-pkgconfig.patch			\
   %D%/packages/patches/nvi-assume-preserve-path.patch		\
   %D%/packages/patches/nvi-dbpagesize-binpower.patch		\
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index 887ef93..617dffc 100644
--- a/gnu/packages/node.scm
+++ b/gnu/packages/node.scm
@@ -25,6 +25,7 @@ 
   #:use-module (guix derivations)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
+  #:use-module (gnu packages)
   #:use-module (gnu packages base)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages gcc)
@@ -37,14 +38,16 @@ 
 (define-public node
   (package
     (name "node")
-    (version "6.0.0")
+    (version "6.8.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://nodejs.org/dist/v" version
                                   "/node-v" version ".tar.gz"))
               (sha256
                (base32
-                "0cpw7ng193jgfbw2g1fd0kcglmjjkbj4xb89g00z8zz0lj0nvdbd"))))
+                "0lj3250hglz4w5ic4svd7wlg2r3qc49hnasvbva1v69l8yvx98m8"))
+              ;; https://github.com/nodejs/node/pull/9077
+              (patches (search-patches "node-9077.patch"))))
     (build-system gnu-build-system)
     (arguments
      ;; TODO: Package http_parser and add --shared-http-parser.
@@ -78,10 +81,10 @@ 
              ;; FIXME: These tests fail in the build container, but they don't
              ;; seem to be indicative of real problems in practice.
              (for-each delete-file
-                       '("test/parallel/test-cluster-master-error.js"
+                       '("test/parallel/test-dgram-membership.js"
+                         "test/parallel/test-cluster-master-error.js"
                          "test/parallel/test-cluster-master-kill.js"
                          "test/parallel/test-npm-install.js"
-                         "test/parallel/test-stdout-close-unref.js"
                          "test/sequential/test-child-process-emfile.js"))
              #t))
          (replace 'configure
@@ -101,22 +104,15 @@ 
                              (string-append (assoc-ref inputs "python")
                                             "/bin/python")
                              "configure" flags)))))
-         (replace 'patch-shebangs
-           (lambda* (#:key outputs #:allow-other-keys #:rest all)
-             ;; Work around <http://bugs.gnu.org/23723>.
-             (let* ((patch  (assoc-ref %standard-phases 'patch-shebangs))
-                    (npm    (string-append (assoc-ref outputs "out")
-                                           "/bin/npm"))
+         (add-after 'patch-shebangs 'patch-npm-shebang
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((bindir (string-append (assoc-ref outputs "out")
+                                           "/bin"))
+                    (npm    (string-append bindir "/npm"))
                     (target (readlink npm)))
-               (and (apply patch all)
-                    (with-directory-excursion (dirname npm)
-                      ;; Turn NPM into a symlink to TARGET again, which 'npm'
-                      ;; relies on for the resolution of relative file names
-                      ;; in JS files.
-                      (delete-file target)
-                      (rename-file npm target)
-                      (symlink target npm)
-                      #t))))))))
+               (with-directory-excursion bindir
+                 (patch-shebang target (list bindir))
+                 #t)))))))
     (native-inputs
      `(("python" ,python-2)
        ("perl" ,perl)
diff --git a/gnu/packages/patches/node-9077.patch b/gnu/packages/patches/node-9077.patch
new file mode 100644
index 0000000..e57f5ca
--- /dev/null
+++ b/gnu/packages/patches/node-9077.patch
@@ -0,0 +1,30 @@ 
+From fc164acbbb700fd50ab9c04b47fc1b2687e9c0f4 Mon Sep 17 00:00:00 2001
+From: "Bradley T. Hughes" <bradleythughes@fastmail.fm>
+Date: Thu, 13 Oct 2016 07:38:38 +0000
+Subject: [PATCH] build: add -DZLIB_CONST when building with --shared-zlib
+
+Commit 782620f added the define only when building with the bundled
+zlib. Using a shared zlib results in build breakage:
+
+../src/inspector_agent.cc:179:16: error: assigning to 'Bytef *' (aka 'unsigned char *') from incompatible type
+      'const uint8_t *' (aka 'const unsigned char *')
+  strm.next_in = PROTOCOL_JSON + 3;
+               ^ ~~~~~~~~~~~~~~~~~
+1 error generated.
+---
+ node.gyp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/node.gyp b/node.gyp
+index fa98547..d799ba1 100644
+--- a/node.gyp
++++ b/node.gyp
+@@ -480,6 +480,8 @@
+         }],
+         [ 'node_shared_zlib=="false"', {
+           'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ],
++        }, {
++          'defines': [ 'ZLIB_CONST' ],
+         }],
+ 
+         [ 'node_shared_http_parser=="false"', {
-- 
2.6.3