lang/npm: Set proper env for build/install, ensure FAKEHOME is used.

This commit is contained in:
fhajny 2018-06-28 11:28:01 +00:00
parent bf98cab3a6
commit e94045d573
4 changed files with 23 additions and 7 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.6 2018/05/24 14:14:43 fhajny Exp $
# $NetBSD: Makefile,v 1.7 2018/06/28 11:28:01 fhajny Exp $
DISTNAME= npm-6.1.0
CATEGORIES= lang
@ -36,13 +36,13 @@ CHECK_INTERPRETER_SKIP+=lib/node_modules/npm/*
.include "../../mk/bsd.prefs.mk"
pre-build:
cd ${WRKSRC} && node bin/npm-cli.js install ${WRKDIR}/${MARKED} --no-global --no-timing --no-save
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} node bin/npm-cli.js install ${WRKDIR}/${MARKED} --no-global --no-timing --no-save
do-install:
${FIND} ${WRKSRC} -type f -name '*.orig' -delete
cd ${WRKSRC} && ${SETENV} ${INSTALL_ENV} ${PREFIX}/bin/node \
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${INSTALL_ENV} ${PREFIX}/bin/node \
bin/npm-cli.js pack
cd ${WRKSRC} && ${SETENV} ${INSTALL_ENV} ${PREFIX}/bin/node \
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${INSTALL_ENV} ${PREFIX}/bin/node \
bin/npm-cli.js install -g -f ${DISTNAME}.tgz
.if ${PKGMANDIR} != "share/man"
${RM} -f -r ${DESTDIR}${PREFIX}/${PKGMANDIR}

View file

@ -1,4 +1,4 @@
@comment $NetBSD: PLIST,v 1.3 2018/05/24 14:14:43 fhajny Exp $
@comment $NetBSD: PLIST,v 1.4 2018/06/28 11:28:01 fhajny Exp $
bin/npm
bin/npx
lib/node_modules/npm/.github/CODEOWNERS
@ -6543,4 +6543,3 @@ man/man7/npm-scope.7
man/man7/npm-scripts.7
man/man7/removing-npm.7
man/man7/semver.7
@pkgdir share

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.6 2018/05/24 14:14:43 fhajny Exp $
$NetBSD: distinfo,v 1.7 2018/06/28 11:28:01 fhajny Exp $
SHA1 (marked-0.3.19.tar.gz) = d30691ac399f05d156f40a0a893ce7a2a7f6c5be
RMD160 (marked-0.3.19.tar.gz) = e78a28dfaf5fc1039e48f63228f892fa24a13e6f
@ -9,6 +9,7 @@ RMD160 (npm-6.1.0.tar.gz) = 406ca2a8f0a4d77fbd16c57c1e90ff50c5a8dee4
SHA512 (npm-6.1.0.tar.gz) = 8c44e462965ea1ca93f76a34b98726eb20123c127fda8a19643cb2345d612381e94e2741fcdbe814ccf3c73069ecdc89412d8963d2b4f0fb67a8c45bb6f1d85c
Size (npm-6.1.0.tar.gz) = 8579329 bytes
SHA1 (patch-Makefile) = 29b3e9515ee2a45f3b12c116075c00faca73d270
SHA1 (patch-lib_config_defaults.js) = 5a00cbef781c9ab4efcec41ad781987f3f540886
SHA1 (patch-node__modules_node-gyp_gyp_pylib_gyp_generator_make.py) = 291e079fb48caea7501ab864c19ef26672b76bc5
SHA1 (patch-node__modules_node-gyp_gyp_pylib_gyp_xcode__emulation.py) = 7f9f5cd8aadafd309ba8dfb27f96fe8fa56a8af8
SHA1 (patch-node__modules_node-gyp_lib_configure.js) = 5cee993904ffeb1497418706e258c2e61bbd847e

View file

@ -0,0 +1,16 @@
$NetBSD: patch-lib_config_defaults.js,v 1.1 2018/06/28 11:28:01 fhajny Exp $
If both PREFIX and DESTDIR are defined, combine for UNIX best practice.
--- lib/config/defaults.js.orig 2018-05-24 01:48:32.000000000 +0000
+++ lib/config/defaults.js
@@ -91,6 +91,9 @@ Object.defineProperty(exports, 'defaults
if (process.env.PREFIX) {
globalPrefix = process.env.PREFIX
+ if (process.env.DESTDIR) {
+ globalPrefix = path.join(process.env.DESTDIR, globalPrefix)
+ }
} else if (process.platform === 'win32') {
// c:\node\node.exe --> prefix=c:\node\
globalPrefix = path.dirname(process.execPath)