aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroki Tagato <tagattie@FreeBSD.org>2023-11-06 14:23:38 +0000
committerHiroki Tagato <tagattie@FreeBSD.org>2023-11-06 14:27:11 +0000
commit64cacbc564767d1a53e0a3390d28e1d6fb0aa320 (patch)
treedf31d8d1ae591815651cbbd611425b9f0cfebb85
parentbade8088697e8ced11f37cc3d63d900f6b4b6301 (diff)
downloadports-64cacbc564767d1a53e0a3390d28e1d6fb0aa320.tar.gz
ports-64cacbc564767d1a53e0a3390d28e1d6fb0aa320.zip
security/bitwarden-cli: fix fetch and build
npm version 10 fails with the following error when prefetching node modules (this only happens with poudriere): npm ERR! code EEXIST npm ERR! syscall open npm ERR! path /wrkdirs/usr/ports/security/bitwarden-cli/work/.npm/_cacache/tmp/e61947a0 npm ERR! errno -17 npm ERR! EEXIST: file already exists, open '/wrkdirs/usr/ports/security/bitwarden-cli/work/.npm/_cacache/tmp/e61947a0' npm ERR! File exists: /wrkdirs/usr/ports/security/bitwarden-cli/work/.npm/_cacache/tmp/e61947a0 npm ERR! Remove the existing file and try again, or run npm npm ERR! with --force to overwrite files recklessly. As a temporary workaround, install and use npm version 9 for prefetching node modules. Reported by: Miroslav Lachman <000.fbsd@quip.cz> (via private mail) MFH: 2023Q4
-rw-r--r--security/bitwarden-cli/Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/security/bitwarden-cli/Makefile b/security/bitwarden-cli/Makefile
index 27edd8ba370a..707187e26af5 100644
--- a/security/bitwarden-cli/Makefile
+++ b/security/bitwarden-cli/Makefile
@@ -37,6 +37,8 @@ USE_GITHUB= yes
GH_ACCOUNT= bitwarden
GH_PROJECT= clients
+MAKE_ENV+= PYTHONDONTWRITEBYTECODE=1
+
BUILD_WRKSRC= ${WRKSRC}/apps/cli
PLIST_FILES= bin/bw \
@@ -65,7 +67,8 @@ pre-fetch:
${MKDIR} ${WRKDIR}/node-modules-cache; \
${CP} -R ${FILESDIR}/packagejsons/* ${WRKDIR}/node-modules-cache; \
cd ${WRKDIR}/node-modules-cache && \
- ${SETENV} HOME=${WRKDIR} npm ci --ignore-scripts --no-progress; \
+ ${SETENV} HOME=${WRKDIR} npm install -g --prefix=${WRKDIR} npm@9.9.0 && \
+ ${SETENV} HOME=${WRKDIR} PATH=${WRKDIR}/bin:${PATH} npm ci --ignore-scripts --no-progress; \
${FIND} ${WRKDIR}/node-modules-cache -depth 1 -print | \
${GREP} -v node_modules | ${XARGS} ${RM} -r; \
${FIND} ${WRKDIR}/node-modules-cache -type d -exec ${CHMOD} 755 {} ';'; \