+cc maintainer ;)

On Thu, Apr 02 2020, Denis Fondras <open...@ledeuns.net> wrote:
> node-gyp needs to know about the installed Node.js version.
>
> This needs to be updated each time Node.js is upgraded. May we do this
> automatically with sed in Makefile pre-patch section ?

pre-configure already uses ${SUBST_CMD} on this file.
With this diff you should be able to use ${NODE_VERSION} in
patches/patch-deps_npm_node_modules_node-gyp_lib_install_js (untested).

Index: Makefile
===================================================================
RCS file: /d/cvs/ports/lang/node/Makefile,v
retrieving revision 1.82
diff -u -p -p -u -r1.82 Makefile
--- Makefile    24 Nov 2019 18:42:28 -0000      1.82
+++ Makefile    2 Apr 2020 13:52:05 -0000
@@ -61,6 +61,7 @@ SUBST_VARS +=                 DISTNAME
 SUBST_VARS +=          DISTFILES
 SUBST_VARS +=          EXTRACT_SUFX
 SUBST_VARS +=          LOCALBASE
+SUBST_VARS +=          NODE_VERSION
 SUBST_VARS +=          PREFIX
 SUBST_VARS +=          WRKDIST
 

> Index: patches/patch-deps_npm_node_modules_node-gyp_lib_install_js
> ===================================================================
> RCS file: 
> /cvs/ports/lang/node/patches/patch-deps_npm_node_modules_node-gyp_lib_install_js,v
> retrieving revision 1.11
> diff -u -p -r1.11 patch-deps_npm_node_modules_node-gyp_lib_install_js
> --- patches/patch-deps_npm_node_modules_node-gyp_lib_install_js       24 Nov 
> 2019 18:42:28 -0000      1.11
> +++ patches/patch-deps_npm_node_modules_node-gyp_lib_install_js       2 Apr 
> 2020 07:18:39 -0000
> @@ -11,7 +11,7 @@ Index: deps/npm/node_modules/node-gyp/li
>   
>         // now download the node tarball
>  -      var tarPath = gyp.opts.tarball
> -+      var tarPath = gyp.opts['tarball'] || 
> '/usr/local/share/node/node-v12.9.0.tar.gz' // Fix for OpenBSD
> ++      var tarPath = gyp.opts['tarball'] || 
> '/usr/local/share/node/node-v12.13.1.tar.gz' // Fix for OpenBSD
>         var badDownload = false
>         var extractCount = 0
>         var contentShasums = {}
>

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to