Tuesday, November 01, 2022

Re: node-gyp expects node-XXX-headers.tar.gz, not xz ?

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/node/Makefile,v
retrieving revision 1.109
diff -u -p -r1.109 Makefile
--- Makefile 12 Oct 2022 16:15:02 -0000 1.109
+++ Makefile 1 Nov 2022 10:24:55 -0000
@@ -8,9 +8,9 @@ COMMENT = JavaScript runtime built on Ch
NODE_VERSION = v16.17.1
PLEDGE_VER = 1.1.2
DISTFILES = node-pledge-{}${PLEDGE_VER}.tar.gz:0 \
- ${DISTNAME}-headers.tar.xz \
+ ${DISTNAME}-headers.tar.gz \
${DISTNAME}.tar.xz
-REVISION = 0
+REVISION = 1

DISTNAME = node-${NODE_VERSION}
PKGNAME = ${DISTNAME:S/v//g}
@@ -98,8 +98,8 @@ post-install:
${MODPY_BIN} ${MODPY_LIBDIR}/compileall.py \
${PREFIX}/lib/node_modules/npm/node_modules/node-gyp/update-gyp.py
${INSTALL_DATA_DIR} ${PREFIX}/share/node
- ${INSTALL_DATA} ${FULLDISTDIR}/${DISTNAME}-headers.tar.xz \
- ${PREFIX}/share/node/${DISTNAME}-headers.tar.xz
+ ${INSTALL_DATA} ${FULLDISTDIR}/${DISTNAME}-headers.tar.gz \
+ ${PREFIX}/share/node/${DISTNAME}-headers.tar.gz
ln -s ${TRUEPREFIX}/lib/node_modules/npm/bin/node-gyp-bin/node-gyp \
${PREFIX}/bin/node-gyp;
cd ${PREFIX}/lib/node_modules/npm/node_modules && for x in *; do \
Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/node/distinfo,v
retrieving revision 1.64
diff -u -p -r1.64 distinfo
--- distinfo 23 Sep 2022 19:28:50 -0000 1.64
+++ distinfo 1 Nov 2022 10:24:55 -0000
@@ -1,6 +1,6 @@
SHA256 (node-pledge-1.1.2.tar.gz) = zY/JcbZ32mmtqWXXNn3/9aTh7Y3F6fAAaADDA8SYwEk=
-SHA256 (node-v16.17.1-headers.tar.xz) = VUyNG0sW4PTAc7nffEnIk3FqOlM/JaxkbyNhn1zO598=
+SHA256 (node-v16.17.1-headers.tar.gz) = Ncy5XK8CzaO9aA2kNQqK5dZmp6nq46/lwqGz7ymu8Qg=
SHA256 (node-v16.17.1.tar.xz) = ZyH+tBUtVtLGs1jOOXq9Wn8drwnuLiXFAhubTT+GozA=
SIZE (node-pledge-1.1.2.tar.gz) = 3155
-SIZE (node-v16.17.1-headers.tar.xz) = 386032
+SIZE (node-v16.17.1-headers.tar.gz) = 568068
SIZE (node-v16.17.1.tar.xz) = 35661452
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/lang/node/pkg/PLIST,v
retrieving revision 1.51
diff -u -p -r1.51 PLIST
--- pkg/PLIST 1 Sep 2022 20:42:56 -0000 1.51
+++ pkg/PLIST 1 Nov 2022 10:24:56 -0000
@@ -2518,7 +2518,7 @@ share/doc/node/
share/doc/node/gdbinit
share/doc/node/lldb_commands.py
share/node/
-share/node/${DISTNAME}-headers.tar.xz
+share/node/${DISTNAME}-headers.tar.gz
share/systemtap/
share/systemtap/tapset/
share/systemtap/tapset/node.stp
> currently nodejs port installs
> /usr/local/share/node/node-v16.17.1-headers.tar.xz but from my
> understanding node-gyp expects the tar.gz one:

Correct. We're patching the the fallback path to the .tar.gz into
/usr/local/lib/node_modules/node-gyp/lib/install.js - otherwise node-gyp
would attend to download the tarball.

I overlooked that when changing to .tar.xz.

Apparently node-tar only handles gzipped tarballs, so the proper way
forward is to change back to installing the .tar.gz

Patch is attached, could you have a look and see if that fixes the issue?

No comments:

Post a Comment