Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/release-notes/rl-2605.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

### Breaking changes {#sec-nixpkgs-release-26.05-lib-breaking}

- Create the first release note entry in this section!
- `corepack_latest` has been removed, as Corepack is no longer distributed with Node.js.
Comment thread
fabianhjr marked this conversation as resolved.


### Deprecations {#sec-nixpkgs-release-26.05-lib-deprecations}
Expand Down
50 changes: 50 additions & 0 deletions pkgs/by-name/co/corepack/missing-hashes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"@esbuild/aix-ppc64@npm:0.25.12": "deeef1c11ce6d3dde3fc87368cf600218de18cff4cefe9888a09c39cc81177305c51c2dbccf6513c1b07795c67a11297c12014366fdeb9e51f34896020dd0210",
"@esbuild/android-arm64@npm:0.25.12": "7364b62583e0b0e0c3997d38815f462b11b85997efad33099715ede94a3bac29a80a98709e6ba902e9ced207242308d5923b249da7af2fb83b50efab4bd693fd",
"@esbuild/android-arm@npm:0.25.12": "04c9b60e0447331d7005745a7e9750987db465fd94717df62276b5dd7e13a3789db95b029f6e9f735e583b95f2f50b18f2aba1a381c8b5645156bb9d21ecacf0",
"@esbuild/android-x64@npm:0.25.12": "a22c5c03c55c3a12693b67f1a5de8dff7b853f79261ad1562a55b25bf91d327fd8c8899444c069a3fb68175c7df6dd0f2824ba5051927a4711f5841793cc58f2",
"@esbuild/darwin-arm64@npm:0.25.12": "5a66f6d44f2dac62341cc73956d8a1ea346e2e66f8cbdfcda9349a0b6ad01024d6c9c2ded05a9ba720c7541575c0b4be4c4ed6f62c529c13df141bb2a247f461",
"@esbuild/darwin-x64@npm:0.25.12": "181a933b603253a3eab9173a97e619b59fb953c70309fd3e005e58ed32654c866f752edde7250e63f788bb857e13b28c710d87496479b2de894226bf5779661e",
"@esbuild/freebsd-arm64@npm:0.25.12": "7a7bd7f62d7e5e4a162bea901365bef5996ac15b3b0af361ce6adb77431f95cc9b831e8f764056f2395fc09a4117fdc7d14a583af4344770ae13dc1dc030dcb4",
"@esbuild/freebsd-x64@npm:0.25.12": "ca5c61ab87dadadff1cd72c62c32b3dbff6e5242ee6f7f53c579e3e11aae263bd009e18a2cbd36a065d42e7b7c43e7186832584f7436646bfc25dc637fac819d",
"@esbuild/linux-arm64@npm:0.25.12": "b66f73867351e0666fe00f9281bb7d8dd089d221a5cef6311826b169271b8451f5e265fb41625161a0af142641d5db1e02999aaba98dc1b8a52f4c099db07cb7",
"@esbuild/linux-arm@npm:0.25.12": "1ea6f003abec0177f27ee6954fcce15cecffd94aa57781e712936b6eed64d9579267bcd7612645d3b41cc7591ae411d6491c4517e3bc0de936f101e278510644",
"@esbuild/linux-ia32@npm:0.25.12": "df3d5ceb61b7cf4471cdba740a8ca46ae6c5a9dc6dce60440d2a62a25c36144e38b6bf301937117bb183a7b5517ee87a9735d543c785a13b1de56715e34cc7e6",
"@esbuild/linux-loong64@npm:0.25.12": "b38ba56880536b6bd46467673d81a49ed41661cd217065d440a384d0b4dd1bd59dbc79d6bc81c4948959116a7bc339c1f9749412705ff2a2f7a5c1bef69e2205",
"@esbuild/linux-mips64el@npm:0.25.12": "a8694250193ecf430fb541d1371226a922c462cafac6be65e051f13efbbdf62aa94316fc5a0805f010f60da4051517aca3bfac121b352c443803aac874024d85",
"@esbuild/linux-ppc64@npm:0.25.12": "f9c2ca2a75aefa5495ce3cb4e0a4086816b083dfe7d0642afc22c2eac4ea50f1ca4d3a353b6a603fffc689f57bd17e6cc3c0fe8d5727cb2d429bbdc1db1fdd38",
"@esbuild/linux-riscv64@npm:0.25.12": "29bc64137de629f8210e4788cef6cc021d8b432c0b28b9df05ccca6e60b772e7d23c3c9faa5da4037c7dd1574f66fdcb71775ee14298f86a571a2556beeb11d9",
"@esbuild/linux-s390x@npm:0.25.12": "cb32577ea8441277525a2acf888d32ef8d9ebbd7563d5d4ec9b5b387b11e9aa7d8a3f7cc3faea4524dc068a767300537aca4e127ac524030207d9745a785f30b",
"@esbuild/linux-x64@npm:0.25.12": "5364064fc64864df2ad963d21430b7dbeb1918a829e3d82f9c7cc87ffbca551e312338dc8016e3008288f85a9f181986056bbc782a52ee547d2435dd50738593",
"@esbuild/netbsd-arm64@npm:0.25.12": "9c9e0b87fd7385604fa4a118e88ba88b36ce846174016d7c71939ba2be2de57e720e3c684ec7de52eaae17edf4f6df88442c8eb1db7e4675870b357b15bc1bd2",
"@esbuild/netbsd-x64@npm:0.25.12": "148e7a91557ad0084af1478921bbb88ce3cb78a213e5b16250b34a28057d5ff5dd14483bec73edd959fdbd6daf617e2a56137596530de07592180c5777ac491b",
"@esbuild/openbsd-arm64@npm:0.25.12": "87b6070d4c63615802709e5f7c2de23d0c201186e18777200a023a1d84da1ba39bab3b0b444a468f93d4039147c333499589e9f00717d1e4a7eeb764e01082af",
"@esbuild/openbsd-x64@npm:0.25.12": "664bfe0fc286b1850147797d7a625b33614eba656da0fa589d93956f040559a9211ebf7b68c9e90b49b898ba330f2f81daab763c596f5c84ae4183ffa8bc0c69",
"@esbuild/openharmony-arm64@npm:0.25.12": "422e2d50f8948b45342301ee4c08ea988619bd025830c1a195eb41cafb1dedb35b8441a66c679a7a82fb920e56f89fb6bff85b4c4f10d09584f437be125d8745",
"@esbuild/sunos-x64@npm:0.25.12": "ea9f6d4d1fe803063075ffa20b3a4ae11a92a933e56d437bfa9de13bdcd2320b8057aa3e971c12fb04f1388f55185d885a2a86a96be914a42808bc636575164c",
"@esbuild/win32-arm64@npm:0.25.12": "f61e582d7a3fa474cf764573dd9b54a48bd4f0bb0684f4a588a79a1ba0fe37447bc8bc5d2d8809d1f27022ad0c95a5728ce7d2b5941dac78607c1e50ca14c6d7",
"@esbuild/win32-ia32@npm:0.25.12": "4c135f8face7b6e5682efc5972367b579f06656487d1859c3e3165d5e10a95c455bb0aa69339fc3db215084f3229ffb954d87b2780645993f70dee883cb9ba73",
"@esbuild/win32-x64@npm:0.25.12": "7db86204f566c4d1155458c6e383d5f560a3f7e00475c65e97549e30a222bac66bd64cfd422691a7dcead2e0518e50aab5caeb7f525dfea6875c3209d6352e8e",
"@rollup/rollup-android-arm-eabi@npm:4.53.2": "624c3cf3ff0b7ab780de960bce750ed28c4df7569dfc289e8c234fe1763e2e68a9747a4cb9cdb6ec1b1621e48dfd940ff8ab041c441448d053288558712ead8c",
"@rollup/rollup-android-arm64@npm:4.53.2": "a05e83077081eb4df811a3f3fbab914d1ed3ad945a60b8b2802dc21fa5bd0d3fe57e727c6b0eb36ba2e7cbe637f9be9bfeaf2fb05d2ed83b8f1971d4337cd21e",
"@rollup/rollup-darwin-arm64@npm:4.53.2": "987c4dd3b5edbd713813e1b266289352895af67f3c7649685811c0a688e2c54fd64c9dab2b37ab0eca1431ca868e61f6fa9c18e758204afacfcec4f494bd37e6",
"@rollup/rollup-darwin-x64@npm:4.53.2": "afddb37a1dc14017bd99b4aa8a263f9cc115b1968ea5ef51f3da1d0a4b24d869f3be771e1eb99971a52e7e72909d4a2384e4a6815c73b809cbdbad9a5d5b2e1e",
"@rollup/rollup-freebsd-arm64@npm:4.53.2": "590828430d14304413e746dcfd5c9133e7a389966c8677a4720b4ecd69ef049c5fddba4c6ea642e61b49b909310fb02fc00ec95cef5447c4bb26f7ac8bc739f6",
"@rollup/rollup-freebsd-x64@npm:4.53.2": "c9ba7207d6c9ce516d384f9ffb83c104a2b25d44a96d187a25bcaac5a830af9ef57475aeffc30adcfe0343a052db944ec4ae39af9d298f958386227defc06353",
"@rollup/rollup-linux-arm-gnueabihf@npm:4.53.2": "f70d6dc3684b1599a90bbbab606348ce169a7fdd012d1b5c20238093e30d5b01b168e6f7cc6b6c2233df84d87ab1c05039ee40dda304c388356ebbcdafd1a521",
"@rollup/rollup-linux-arm-musleabihf@npm:4.53.2": "2bbc219fcaeb2b5e292650e7c9a0076ceabeaad5f1c8d6d3577a8092a565d9c8f3279030c740c86cebd35068fb4640f7f7a6c354011e925d2042d79f59af8da9",
"@rollup/rollup-linux-arm64-gnu@npm:4.53.2": "53cd00ef29ad6268e84317c2e30feface713d14df22038265929a8684c76171d6ceedd965201977f0345786d39f641dc1202aed9f4b97a476cfc952cc3719174",
"@rollup/rollup-linux-arm64-musl@npm:4.53.2": "5a439746f54b5d657b5930075b725a6a49d4f55aef6e8bdd10c59bc7186428d83028a6a22a4edef66e3ef9a954da9b96218332eaf556c12ab7bc231d88ff12ec",
"@rollup/rollup-linux-loong64-gnu@npm:4.53.2": "2a906684e9a1d585755547be77ed7c6f8d69f7f484773ba8285eeb2cbe819b7d06148c167dbb163bab029ae920e46d6977822114d9c24e9103a437637bf22f59",
"@rollup/rollup-linux-ppc64-gnu@npm:4.53.2": "fcb23e70c88ee61725b6cc9ef2b01d63ba12b674e86e5e3a7c33e1c25fc7882a666ffb4d14c714c515330f680bc74d2615f661e3f652955102541ac2c74ca217",
"@rollup/rollup-linux-riscv64-gnu@npm:4.53.2": "cc98bbebc5c4d445e60f14359fb6e2f8acdd23fe81d6aba8b27fee96bce8954ca21119928116d417f389edd594888f614ad39e9a9397de3c1b6e3c3cc9e39e14",
"@rollup/rollup-linux-riscv64-musl@npm:4.53.2": "309f231d747bbc5b37093b713c28926c827062e45fb524fa8d07c64834a2e6b84abac110b2a9f099cf76569fa4576d02b36aa292468bf06e57196bf6dd77d2a5",
"@rollup/rollup-linux-s390x-gnu@npm:4.53.2": "3f935b10cef450e4a2faff477fd9878f018066a82fc4229bd6a1e7958faaf6499cf262541fe0af03e4fddbbd3d1bd8eab6f05e743463ffdcc4b19bc4b464df8c",
"@rollup/rollup-linux-x64-gnu@npm:4.53.2": "4df0206018e3ea80f617028bf0fb69db8ec301fb1863cea791611717807f90e96f8fa4d2449c4e6847514dd5249402764134844bd8a07b50eddcca8069783ac4",
"@rollup/rollup-linux-x64-musl@npm:4.53.2": "28d1e7aa206777f600540851caba578be32abfd4379194c7d1d7a6550181eecec1bf342197b8c2096c8743d9f5e2f5641aabb9ee43e172874da438208a45a52f",
"@rollup/rollup-openharmony-arm64@npm:4.53.2": "9c430d3ad3cfc294ad221fa9f382e5cfa1479f44098807d43683cea4bcf786d0e5fdeef2a07e0eca5176abf47532b51a1bb8733bb7ee1c8bd11e31567421b89c",
"@rollup/rollup-win32-arm64-msvc@npm:4.53.2": "ca5ac1c54519ceffde6f4c69564317b5d84fc9e670fd090ced22916e5bf9e8e25a0deb8377cedb494b8a106f61d128e282b0d4bac9ae2135eb76fdcfee511ec4",
"@rollup/rollup-win32-ia32-msvc@npm:4.53.2": "01a6ae614efd77ad83115022da67b437cc7b43868741cbb4923ed2d763e2cded0bb05af5818d4fb7486abe2ab52d435727bc965c2af8efe571018d6ea0ff3e76",
"@rollup/rollup-win32-x64-gnu@npm:4.53.2": "ce081608eaa3009279aa5685e1671f15b495910556e396ab3c7585d3d2f5afb354d70544a2ff01654f46c723aac91fd38e0982f9ebba3ef843663d6c42e5692b",
"@rollup/rollup-win32-x64-msvc@npm:4.53.2": "6a4195d5ceb9533fb53daeac056d6878a6caeb03c238083db49c7a112accba15ca50e9cb2f9f4417375092ddf4819ca795954dc4a61106e42941b0cfdbb0b44c"
}
112 changes: 112 additions & 0 deletions pkgs/by-name/co/corepack/package.nix
Comment thread
aduh95 marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
lib,
stdenvNoCC,
cacert,
yarn-berry,
nodejs,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use corepack, I assume, in most of the cases, that we don't use NPM

So, why are we using nodejs instead of nodejs-slim ? @fabianhjr

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetchFromGitHub,
nix-update-script,
versionCheckHook,
fetchpatch2,
}:

stdenvNoCC.mkDerivation (finalAttrs: {
pname = "corepack";
version = "0.34.4";

src = fetchFromGitHub {
owner = "nodejs";
repo = "corepack";
tag = "v${finalAttrs.version}";
hash = "sha256-AE2tDeDs1wzDdTrkG/ic2ydQC8G2wcaKD6s7ec7p+Ew=";
};

patches = [
# The build fails with better-sqlite3, needed for installCheck phase.
# We can use the built-in SQLite module instead (and skip the installCheck phase on version of
# Node.js that do not have built-in SQLite support).
./use-builtin-sqlite.patch
Comment thread
aduh95 marked this conversation as resolved.
];

nativeBuildInputs = [
nodejs
yarn-berry
yarn-berry.yarnBerryConfigHook
];
buildInputs = [
nodejs
Comment thread
aduh95 marked this conversation as resolved.
];

missingHashes = ./missing-hashes.json;
offlineCache = yarn-berry.fetchYarnBerryDeps {
inherit nodejs;
inherit (finalAttrs)
missingHashes
patches
src
;
hash = "sha256-Yzm3PtdbR9Tx2bisdzTw0XGD6rAc/KUCzmhjGuXdft4=";
};

postPatch = ''
Comment thread
aduh95 marked this conversation as resolved.
substituteInPlace tests/_runCli.ts --replace-fail 'require.resolve(`../dist/corepack.js`)' "'$out/bin/corepack'"
substituteInPlace tests/main.test.ts --replace-fail 'npath.dirname(__dirname)' "'$out'"

substituteInPlace mkshims.ts --replace-fail './lib/corepack.cjs' '../lib/corepack.cjs'
substituteInPlace \
sources/corepackUtils.ts \
sources/commands/Enable.ts \
--replace-fail 'require.resolve(`corepack/package.json`)' "'$out/package.json'"
'';

buildPhase = ''
runHook preBuild

yarn build

runHook postBuild
'';

installPhase = ''
runHook preInstall

install -Dm644 dist/lib/corepack.cjs -t $out/lib
node -p 'Object.keys(require("./package.json").publishConfig.bin).join("\0")' | while IFS= read -r -d "" binName; do
Comment thread
aduh95 marked this conversation as resolved.
echo "Installing bin/$binName"
install -Dm755 "dist/$binName.js" -T "$out/bin/$binName"
done
mkdir "$out/dist"
find dist -maxdepth 1 -name "*.js" -print0 | while IFS= read -r -d "" jsFile; do
echo "Installing $jsFile"
if [ -f "$out/bin/''${jsFile:5:-3}" ]; then
ln -s "$out/bin/''${jsFile:5:-3}" "$out/$jsFile"
else
install -m755 "$jsFile" -T $out/$jsFile
fi
done

runHook postInstall
'';

nativeInstallCheckInputs = [
cacert
versionCheckHook
];
# Built-in SQLite support is only available in Node.js 22+, and required to run the tests.
preInstallCheck = lib.optional (lib.versionAtLeast nodejs.version "22") ''
# Exclude test files that require internet access.
NOCK_ENV=replay yarn test --reporter tap --exclude tests/config.test.ts --exclude tests/Use.test.ts
Comment thread
fabianhjr marked this conversation as resolved.
'';
doInstallCheck = true;

passthru.updateScript = nix-update-script { };

meta = {
changelog = "https://github.com/nodejs/corepack/blob/${finalAttrs.src.tag}/CHANGELOG.md";
description = "Package manager version manager for Node.js projects";
homepage = "https://github.com/nodejs/corepack";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ aduh95 ];
mainProgram = "corepack";
};
})
Loading
Loading