npm11: new port

This commit is contained in:
Mohamed Akram
2025-05-11 13:15:30 +04:00
parent c3096e43c1
commit 556aecb05c
11 changed files with 136 additions and 9 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ long_description npm is a package manager for node. \
You can use it to install and publish your node programs. \
It manages dependencies and does other cool stuff.
conflicts npm3 npm4 npm5 npm6 npm7 npm8 npm9
conflicts npm3 npm4 npm5 npm6 npm7 npm8 npm9 npm11
homepage https://www.npmjs.com/
+93
View File
@@ -0,0 +1,93 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
name npm11
version 11.3.0
revision 0
categories devel
platforms any
supported_archs noarch
license MIT
maintainers {ciserlohn @ci42} openmaintainer
description node package manager
long_description npm is a package manager for node. \
You can use it to install and publish your node programs. \
It manages dependencies and does other cool stuff.
conflicts npm3 npm4 npm5 npm6 npm7 npm8 npm9 npm10
homepage https://www.npmjs.com/
master_sites https://registry.npmjs.org/npm/-/
distname npm-${version}
extract.suffix .tgz
# Please keep the sha1 - users can use it to validate sha values
# published on npmjs.org for the package
checksums rmd160 b734e3f8c29554e71593c5fb384986581b9b7acb \
sha256 1c2dd63f96799ed4bf92b7806d8509302a0f8da68ca452aae27f24388bb41df4 \
size 2753191
worksrcdir "package"
depends_lib path:bin/node:nodejs24
platform darwin {
if {${os.major} < 13} {
depends_lib-replace path:bin/node:nodejs24 path:bin/node:nodejs14
}
}
use_configure no
patchfiles patch-lib-commands-update.js.diff \
patch-package.json.diff
post-patch {
foreach f [concat ${worksrcpath}/bin/npm-cli.js \
${worksrcpath}/bin/npm-prefix.js \
${worksrcpath}/bin/npx-cli.js \
${worksrcpath}/node_modules/@npmcli/arborist/bin/index.js \
${worksrcpath}/node_modules/@npmcli/installed-package-contents/bin/index.js \
${worksrcpath}/node_modules/cross-spawn/node_modules/which/bin/node-which \
${worksrcpath}/node_modules/cssesc/bin/cssesc \
${worksrcpath}/node_modules/glob/dist/esm/bin.d.mts \
${worksrcpath}/node_modules/glob/dist/esm/bin.mjs \
${worksrcpath}/node_modules/mkdirp/bin/cmd.js \
${worksrcpath}/node_modules/node-gyp/bin/node-gyp.js \
${worksrcpath}/node_modules/nopt/bin/nopt.js \
${worksrcpath}/node_modules/pacote/bin/index.js \
${worksrcpath}/node_modules/qrcode-terminal/bin/qrcode-terminal.js \
${worksrcpath}/node_modules/semver/bin/semver.js \
${worksrcpath}/node_modules/which/bin/which.js] {
reinplace "s|/usr/bin/env node|${prefix}/bin/node|" ${f}
}
}
build {
system -W ${worksrcpath} "NPM_CONFIG_UNSAFE_PERM=false ${prefix}/bin/node bin/npm-cli.js pack"
}
destroot.cmd ${prefix}/bin/node ./bin/npm-cli.js
destroot.args --location global ${distname}.tgz
destroot.destdir --prefix=${destroot}${prefix}
post-destroot {
set completions_path ${destroot}${prefix}/share/bash-completion/completions/
xinstall -d ${completions_path}
xinstall -m 644 ${worksrcpath}/lib/utils/completion.sh ${completions_path}/npm
}
notes "
It is not recommended to install packages globally. But if you do so\
please be aware that they won't get cleaned up when you deactivate\
or uninstall ${name}. Globally installed packages will remain in\
${prefix}/lib/node_modules/ until you manually delete them.
"
livecheck.type regex
livecheck.url https://registry.npmjs.org/npm
livecheck.regex {"latest":"(.*?)"}
@@ -0,0 +1,24 @@
--- lib/commands/update.js.orig 1985-10-26 01:15:00.000000000 -0700
+++ lib/commands/update.js 2021-03-23 15:13:13.000000000 -0700
@@ -44,6 +44,21 @@
? global
: this.npm.prefix
+ // Prevent the npm package in global from updating. Prevent
+ // 'npm update -g' since it'll implicity upgrade npm and also
+ // prevent 'npm update -g npm'.
+ if (this.npm.config.get('global')) {
+ if (!args.length || (args.length && args.find(e => e === 'npm'))) {
+ log.error('update', 'Ignoring attempt to update npm in ' + global);
+ log.error('update', 'which is part of the MacPorts npm10 base');
+ log.error('update', 'installation. To update npm please run:');
+ log.error('update', 'sudo port selfupdate && sudo port upgrade npm10');
+ throw new Error('Ignoring attempt to update npm in ' + global +
+ ' which is part of the MacPorts npm10 base' +
+ ' installation.');
+ }
+ }
+
if (this.npm.config.get('depth')) {
log.warn('update', 'The --depth option no longer has any effect. See RFC0019.\n' +
'https://github.com/npm/rfcs/blob/latest/implemented/0019-remove-update-depth-option.md')
+10
View File
@@ -0,0 +1,10 @@
--- package.json.orig 1985-10-26 01:15:00.000000000 -0700
+++ package.json 2023-06-21 16:36:00.795518863 -0700
@@ -214,7 +214,6 @@
"test:nocolor": "CI=true tap -Rclassic",
"test-all": "node . run test -ws -iwr --if-present",
"snap": "tap",
- "prepack": "node . run build -w docs",
"posttest": "node . run lint",
"lint": "eslint \"**/*.js\"",
"lintfix": "node . run lint -- --fix",
+1 -1
View File
@@ -23,7 +23,7 @@ long_description npm is a package manager for node. \
You can use it to install and publish your node programs. \
It manages dependencies and does other cool stuff.
conflicts npm4 npm5 npm6 npm7 npm8 npm9 npm10
conflicts npm4 npm5 npm6 npm7 npm8 npm9 npm10 npm11
homepage http://www.npmjs.org/
+2 -2
View File
@@ -23,7 +23,7 @@ long_description npm is a package manager for node. \
You can use it to install and publish your node programs. \
It manages dependencies and does other cool stuff.
conflicts npm3 npm5 npm6 npm7 npm8 npm9 npm10
conflicts npm3 npm5 npm6 npm7 npm8 npm9 npm10 npm11
homepage http://www.npmjs.org/
@@ -89,7 +89,7 @@ It is not recommended to install packages globally. But if you do so\
please be aware that they won't get cleaned up when you deactivate\
or uninstall ${name}. Globally installed packages will remain in\
${prefix}/lib/node_modules/ until you manually delete them.
"
"
livecheck.type regex
livecheck.url http://registry.npmjs.org/npm
+1 -1
View File
@@ -23,7 +23,7 @@ long_description npm is a package manager for node. \
You can use it to install and publish your node programs. \
It manages dependencies and does other cool stuff.
conflicts npm3 npm4 npm6 npm7 npm8 npm9 npm10
conflicts npm3 npm4 npm6 npm7 npm8 npm9 npm10 npm11
homepage https://www.npmjs.com/
+1 -1
View File
@@ -15,7 +15,7 @@ long_description npm is a package manager for node. \
You can use it to install and publish your node programs. \
It manages dependencies and does other cool stuff.
conflicts npm3 npm4 npm5 npm7 npm8 npm9 npm10
conflicts npm3 npm4 npm5 npm7 npm8 npm9 npm10 npm11
homepage https://www.npmjs.com/
+1 -1
View File
@@ -15,7 +15,7 @@ long_description npm is a package manager for node. \
You can use it to install and publish your node programs. \
It manages dependencies and does other cool stuff.
conflicts npm3 npm4 npm5 npm6 npm8 npm9 npm10
conflicts npm3 npm4 npm5 npm6 npm8 npm9 npm10 npm11
homepage https://www.npmjs.com/
+1 -1
View File
@@ -15,7 +15,7 @@ long_description npm is a package manager for node. \
You can use it to install and publish your node programs. \
It manages dependencies and does other cool stuff.
conflicts npm3 npm4 npm5 npm6 npm7 npm9 npm10
conflicts npm3 npm4 npm5 npm6 npm7 npm9 npm10 npm11
homepage https://www.npmjs.com/
+1 -1
View File
@@ -15,7 +15,7 @@ long_description npm is a package manager for node. \
You can use it to install and publish your node programs. \
It manages dependencies and does other cool stuff.
conflicts npm3 npm4 npm5 npm6 npm7 npm8 npm10
conflicts npm3 npm4 npm5 npm6 npm7 npm8 npm10 npm11
homepage https://www.npmjs.com/