2024-06-20 14:57:18 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
makeWrapper,
|
|
|
|
nodejs,
|
|
|
|
overrideSDK,
|
|
|
|
pnpm_9,
|
|
|
|
python3,
|
|
|
|
testers,
|
|
|
|
xcbuild,
|
|
|
|
nixosTests,
|
2024-07-27 06:49:29 +00:00
|
|
|
nix-update-script,
|
2024-06-20 14:57:18 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# fix build error, `no member named 'aligned_alloc'` on x86_64-darwin
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/272156#issuecomment-1839904283
|
|
|
|
stdenv' = if stdenv.hostPlatform.isDarwin then overrideSDK stdenv "11.0" else stdenv;
|
|
|
|
in
|
|
|
|
stdenv'.mkDerivation (finalAttrs: {
|
|
|
|
pname = "renovate";
|
2024-10-09 16:51:18 +00:00
|
|
|
version = "38.105.2";
|
2024-06-20 14:57:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "renovatebot";
|
|
|
|
repo = "renovate";
|
|
|
|
rev = "refs/tags/${finalAttrs.version}";
|
2024-10-09 16:51:18 +00:00
|
|
|
hash = "sha256-gF8bxzNF1AUJJDxFdNfa+sr/TP0S4uLCXyu3tjRuBjc=";
|
2024-06-20 14:57:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace package.json \
|
|
|
|
--replace-fail "0.0.0-semantic-release" "${finalAttrs.version}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
nodejs
|
|
|
|
pnpm_9.configHook
|
|
|
|
python3
|
|
|
|
] ++ lib.optional stdenv'.hostPlatform.isDarwin xcbuild;
|
|
|
|
|
|
|
|
pnpmDeps = pnpm_9.fetchDeps {
|
|
|
|
inherit (finalAttrs) pname version src;
|
2024-10-23 06:41:50 +00:00
|
|
|
hash = "sha256-AdNleEe1wVBfhhoM6xit06ql1xEz/TLhZ7qpofwQ874=";
|
2024-06-20 14:57:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
env.COREPACK_ENABLE_STRICT = 0;
|
|
|
|
|
|
|
|
buildPhase =
|
|
|
|
''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
pnpm build
|
|
|
|
pnpm prune --prod --ignore-scripts
|
|
|
|
''
|
|
|
|
# The optional dependency re2 is not built by pnpm and needs to be built manually.
|
|
|
|
# If re2 is not built, you will get an annoying warning when you run renovate.
|
|
|
|
+ ''
|
|
|
|
pushd node_modules/.pnpm/re2*/node_modules/re2
|
|
|
|
|
|
|
|
mkdir -p $HOME/.node-gyp/${nodejs.version}
|
|
|
|
echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion
|
|
|
|
ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version}
|
|
|
|
export npm_config_nodedir=${nodejs}
|
|
|
|
npm run rebuild
|
|
|
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
# TODO: replace with `pnpm deploy`
|
|
|
|
# now it fails to build with ERR_PNPM_NO_OFFLINE_META
|
|
|
|
# see https://github.com/pnpm/pnpm/issues/5315
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/{bin,lib/node_modules/renovate}
|
|
|
|
cp -r dist node_modules package.json renovate-schema.json $out/lib/node_modules/renovate
|
|
|
|
|
|
|
|
makeWrapper "${lib.getExe nodejs}" "$out/bin/renovate" \
|
|
|
|
--add-flags "$out/lib/node_modules/renovate/dist/renovate.js"
|
|
|
|
makeWrapper "${lib.getExe nodejs}" "$out/bin/renovate-config-validator" \
|
|
|
|
--add-flags "$out/lib/node_modules/renovate/dist/config-validator.js"
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
2024-09-26 11:04:55 +00:00
|
|
|
version = testers.testVersion { package = finalAttrs.finalPackage; };
|
2024-07-27 06:49:29 +00:00
|
|
|
vm-test = nixosTests.renovate;
|
|
|
|
};
|
|
|
|
updateScript = nix-update-script { };
|
2024-06-20 14:57:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Cross-platform Dependency Automation by Mend.io";
|
|
|
|
homepage = "https://github.com/renovatebot/renovate";
|
2024-07-27 06:49:29 +00:00
|
|
|
changelog = "https://github.com/renovatebot/renovate/releases/tag/${finalAttrs.version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
license = lib.licenses.agpl3Only;
|
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
marie
|
|
|
|
natsukium
|
|
|
|
];
|
|
|
|
mainProgram = "renovate";
|
|
|
|
platforms = nodejs.meta.platforms;
|
|
|
|
};
|
|
|
|
})
|