18 # fix build error, `no member named 'aligned_alloc'` on x86_64-darwin
19 # https://github.com/NixOS/nixpkgs/issues/272156#issuecomment-1839904283
20 stdenv' = if stdenv.hostPlatform.isDarwin then overrideSDK stdenv "11.0" else stdenv;
22 stdenv'.mkDerivation (finalAttrs: {
26 src = fetchFromGitHub {
27 owner = "renovatebot";
29 rev = "refs/tags/${finalAttrs.version}";
30 hash = "sha256-VMv55BVeauRa/hmg1Y7D15ltAbccdcMd4Azk5IInuH0=";
34 substituteInPlace package.json \
35 --replace-fail "0.0.0-semantic-release" "${finalAttrs.version}"
43 ] ++ lib.optional stdenv'.hostPlatform.isDarwin xcbuild;
45 pnpmDeps = pnpm_9.fetchDeps {
46 inherit (finalAttrs) pname version src;
47 hash = "sha256-ZYQ7G2BKkRxuyg31dysim+P1Vje0VysJm+UFyy4xuKI=";
50 env.COREPACK_ENABLE_STRICT = 0;
57 pnpm prune --prod --ignore-scripts
59 # The optional dependency re2 is not built by pnpm and needs to be built manually.
60 # If re2 is not built, you will get an annoying warning when you run renovate.
62 pushd node_modules/.pnpm/re2*/node_modules/re2
64 mkdir -p $HOME/.node-gyp/${nodejs.version}
65 echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion
66 ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version}
67 export npm_config_nodedir=${nodejs}
75 # TODO: replace with `pnpm deploy`
76 # now it fails to build with ERR_PNPM_NO_OFFLINE_META
77 # see https://github.com/pnpm/pnpm/issues/5315
81 mkdir -p $out/{bin,lib/node_modules/renovate}
82 cp -r dist node_modules package.json renovate-schema.json $out/lib/node_modules/renovate
84 makeWrapper "${lib.getExe nodejs}" "$out/bin/renovate" \
85 --add-flags "$out/lib/node_modules/renovate/dist/renovate.js"
86 makeWrapper "${lib.getExe nodejs}" "$out/bin/renovate-config-validator" \
87 --add-flags "$out/lib/node_modules/renovate/dist/config-validator.js"
94 version = testers.testVersion { package = renovate; };
95 vm-test = nixosTests.renovate;
97 updateScript = nix-update-script { };
101 description = "Cross-platform Dependency Automation by Mend.io";
102 homepage = "https://github.com/renovatebot/renovate";
103 changelog = "https://github.com/renovatebot/renovate/releases/tag/${finalAttrs.version}";
104 license = lib.licenses.agpl3Only;
105 maintainers = with lib.maintainers; [
109 mainProgram = "renovate";
110 platforms = nodejs.meta.platforms;