diff options
Diffstat (limited to 'www/yarn-node20')
-rw-r--r-- | www/yarn-node20/Makefile | 52 | ||||
-rw-r--r-- | www/yarn-node20/distinfo | 3 | ||||
-rw-r--r-- | www/yarn-node20/files/patch-lib_cli.js | 80 | ||||
-rw-r--r-- | www/yarn-node20/pkg-descr | 4 | ||||
-rw-r--r-- | www/yarn-node20/pkg-plist | 12 |
5 files changed, 148 insertions, 3 deletions
diff --git a/www/yarn-node20/Makefile b/www/yarn-node20/Makefile index 77d7de2d408f..8d34f0a20309 100644 --- a/www/yarn-node20/Makefile +++ b/www/yarn-node20/Makefile @@ -1,5 +1,51 @@ -USES= nodejs:20,run +PORTNAME= yarn +DISTVERSIONPREFIX= v +PORTVERSION= 1.22.19 +CATEGORIES= www +MASTER_SITES= https://yarnpkg.com/downloads/${PORTVERSION}/ +PKGNAMESUFFIX= ${NODEJS_SUFFIX} -MASTERDIR= ${.CURDIR}/../yarn-node18 +MAINTAINER= pizzamig@FreeBSD.org +COMMENT= Package manager for node, alternative to npm +WWW= https://classic.yarnpkg.com/ -.include "${MASTERDIR}/Makefile" +LICENSE= BSD2CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES?= nodejs:20,run +USES+= cpe +CPE_VENDOR= ${PORTNAME}pkg + +CONFLICTS_INSTALL= yarn-node[0-9][0-9] + +OPTIONS_DEFINE= HADOOPCOMPAT +HADOOPCOMPAT_DESC= hadoop2 compatibility, the yarn script is excluded + +OPTIONS_SUB= yes + +HADOOPCOMPAT_CONFLICTS_INSTALL_OFF= hadoop2* + +NO_ARCH= yes +NO_BUILD= yes + +post-patch: + @${RM} ${WRKSRC}/bin/*.cmd + @${REINPLACE_CMD} -i '' \ + -e 's|"installationMethod": "tar"|"installationMethod": "pkg"|g' \ + ${WRKSRC}/package.json + @${REINPLACE_CMD} -i '' -e 's%Linux)%Linux|FreeBSD)%g' \ + ${WRKSRC}/bin/yarn + +do-install: + ${MKDIR} ${STAGEDIR}${PREFIX}/lib/node_modules/yarn + (cd ${WRKSRC}/ && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/lib/node_modules/yarn) + ${RLN} ${STAGEDIR}${PREFIX}/lib/node_modules/yarn/bin/yarn.js \ + ${STAGEDIR}${PREFIX}/bin/yarn.js + ${RLN} ${STAGEDIR}${PREFIX}/lib/node_modules/yarn/bin/yarnpkg \ + ${STAGEDIR}${PREFIX}/bin/yarnpkg + +do-install-HADOOPCOMPAT-off: + ${RLN} ${STAGEDIR}${PREFIX}/lib/node_modules/yarn/bin/yarn \ + ${STAGEDIR}${PREFIX}/bin/yarn + +.include <bsd.port.mk> diff --git a/www/yarn-node20/distinfo b/www/yarn-node20/distinfo new file mode 100644 index 000000000000..7dd276a3014a --- /dev/null +++ b/www/yarn-node20/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1674865425 +SHA256 (yarn-v1.22.19.tar.gz) = 732620bac8b1690d507274f025f3c6cfdc3627a84d9642e38a07452cc00e0f2e +SIZE (yarn-v1.22.19.tar.gz) = 1244259 diff --git a/www/yarn-node20/files/patch-lib_cli.js b/www/yarn-node20/files/patch-lib_cli.js new file mode 100644 index 000000000000..0165be16caab --- /dev/null +++ b/www/yarn-node20/files/patch-lib_cli.js @@ -0,0 +1,80 @@ +--- lib/cli.js.orig 2020-03-09 15:51:47 UTC ++++ lib/cli.js +@@ -56939,10 +56939,10 @@ function getRcConfigForFolder(cwd) { + } + + function loadRcFile(fileText, filePath) { +- var _parse = (0, (_lockfile || _load_lockfile()).parse)(fileText, filePath), ++ var _parse = (0, (_lockfile || _load_lockfile()).parse)(fileText, 'yarnrc'), + values = _parse.object; + +- if (filePath.match(/\.yml$/) && typeof values.yarnPath === 'string') { ++ if (filePath.match(/\.yml$/)) { + values = { 'yarn-path': values.yarnPath }; + } + +@@ -64532,27 +64532,16 @@ function parse(str, fileLoc) { + var parser = new Parser(str, fileLoc); + parser.next(); + +- if (!fileLoc.endsWith(`.yml`)) { ++ try { ++ return parser.parse(); ++ } catch (error1) { + try { +- return parser.parse(); +- } catch (error1) { +- try { +- return safeLoad(str, { +- schema: FAILSAFE_SCHEMA +- }); +- } catch (error2) { +- throw error1; +- } ++ return safeLoad(str, { ++ schema: FAILSAFE_SCHEMA ++ }); ++ } catch (error2) { ++ throw error1; + } +- } else { +- var result = safeLoad(str, { +- schema: FAILSAFE_SCHEMA +- }); +- if (typeof result === 'object') { +- return result; +- } else { +- return {}; +- } + } + } + +@@ -90319,7 +90308,7 @@ var _buildSubCommands = (0, (_buildSubCommands2 || _lo + var rcPath = `${config.lockfileFolder}/.yarnrc.yml`; + reporter.log(`Updating ${chalk.magenta(rcPath)}...`); + +- yield (_fs || _load_fs()).writeFilePreservingEol(rcPath, `yarnPath: ${(0, (_stringify || _load_stringify()).default)(targetPath)}\n`); ++ yield (_fs || _load_fs()).writeFilePreservingEol(rcPath, `yarnPath: ${(0, (_stringify || _load_stringify()).default)(yarnPath)}\n`); + } else { + var _rcPath = `${config.lockfileFolder}/.yarnrc`; + reporter.log(`Updating ${chalk.magenta(_rcPath)}...`); +@@ -101330,11 +101319,7 @@ function parseRcPaths(paths, parser) { + try { + return parser((0, (_fs || _load_fs()).readFileSync)(path).toString(), path); + } catch (error) { +- if (error.code === 'ENOENT' || error.code === 'EISDIR') { +- return {}; +- } else { +- throw error; +- } ++ return {}; + } + }))); + } +@@ -153406,4 +153391,4 @@ module.exports = require("dns"); + module.exports = require("domain"); + + /***/ }) +-/******/ ]); +\ No newline at end of file ++/******/ ]); diff --git a/www/yarn-node20/pkg-descr b/www/yarn-node20/pkg-descr new file mode 100644 index 000000000000..50f1b63d7d7b --- /dev/null +++ b/www/yarn-node20/pkg-descr @@ -0,0 +1,4 @@ +Yarn is a new node package manager that replaces the existing workflow for the +npm client or other package managers while remaining compatible with the npm +registry. It has the same feature set as existing workflows while operating +faster, more securely, and more reliably. diff --git a/www/yarn-node20/pkg-plist b/www/yarn-node20/pkg-plist new file mode 100644 index 000000000000..db77c3ec95bd --- /dev/null +++ b/www/yarn-node20/pkg-plist @@ -0,0 +1,12 @@ +%%NO_HADOOPCOMPAT%%bin/yarn +bin/yarn.js +bin/yarnpkg +lib/node_modules/yarn/LICENSE +lib/node_modules/yarn/README.md +@(,,755) lib/node_modules/yarn/bin/yarn +@(,,755) lib/node_modules/yarn/bin/yarn.js +@(,,755) lib/node_modules/yarn/bin/yarnpkg +@(,,755) lib/node_modules/yarn/lib/cli.js +lib/node_modules/yarn/lib/v8-compile-cache.js +lib/node_modules/yarn/package.json +lib/node_modules/yarn/preinstall.js |