diff --git a/www/npm/Makefile b/www/npm/Makefile index 4c1093ab603e..88e1c3ca88cb 100644 --- a/www/npm/Makefile +++ b/www/npm/Makefile @@ -1,38 +1,39 @@ PORTNAME= npm PORTVERSION= 8.18.0 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= LOCAL/sunpoet MAINTAINER= sunpoet@FreeBSD.org COMMENT= Node package manager LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/lib/node_modules/npm/LICENSE RUN_DEPENDS= gmake:devel/gmake USES?= nodejs:run USES+= cpe python:3.6+ shebangfix tar:xz NO_ARCH= yes NO_BUILD= yes REINPLACE_ARGS= -i '' CONFLICTS_INSTALL?= npm-node14 npm-node16 npm-node18 CPE_VENDOR= npmjs SHEBANG_GLOB= *.py post-patch: @${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' ${WRKSRC}/etc/man.d/npm.conf @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp @${REINPLACE_CMD} -e 's|exec python |exec ${PYTHON_CMD} |' ${WRKSRC}/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp @${FIND} ${WRKSRC}/ -name '*.sh' -exec ${REINPLACE_CMD} -e '1 s|/usr/local|${LOCALBASE}|' {} + do-install: cd ${WRKSRC}/ && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/ ${ECHO_CMD} 'python=${PYTHON_CMD}' > ${STAGEDIR}${PREFIX}/etc/npmrc ${PYTHON_CMD} -O -m compileall -d ${PREFIX}/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp -f ${STAGEDIR}${PREFIX}/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp .include diff --git a/www/npm/files/patch-npm-run b/www/npm/files/patch-npm-run new file mode 100644 index 000000000000..58b5e25a9c72 --- /dev/null +++ b/www/npm/files/patch-npm-run @@ -0,0 +1,11 @@ +--- lib/node_modules/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js.orig 2022-08-27 11:30:45 UTC ++++ lib/node_modules/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js +@@ -67,7 +67,7 @@ const makeSpawnArgs = options => { + } + const spawnArgs = isCmd + ? ['/d', '/s', '/c', script] +- : ['-c', '--', script] ++ : ['-c', script] + + const spawnOpts = { + env: spawnEnv,