depot/third_party/nixpkgs/pkgs/development/tools/analysis/snyk/default.nix
Default email 5ca88bfbb9 Project import generated by Copybara.
GitOrigin-RevId: 9f918d616c5321ad374ae6cb5ea89c9e04bf3e58
2024-07-31 10:19:44 +00:00

45 lines
1.1 KiB
Nix

{ lib
, buildNpmPackage
, fetchFromGitHub
, stdenv
, testers
, snyk
}:
buildNpmPackage rec {
pname = "snyk";
version = "1.1292.1";
src = fetchFromGitHub {
owner = "snyk";
repo = "cli";
rev = "refs/tags/v${version}";
hash = "sha256-N54fSRYTFOlmfpommEFIqbMP5IBkhatMwx4CQ8fd5QI=";
};
npmDepsHash = "sha256-VHZqc111cC8AANogxXVg4BFlngdmrrt7E+tCMF5Rl7g=";
postPatch = ''
substituteInPlace package.json \
--replace-fail '"version": "1.0.0-monorepo"' '"version": "${version}"'
'';
env.NIX_CFLAGS_COMPILE =
# Fix error: no member named 'aligned_alloc' in the global namespace
lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) "-D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION=1";
npmBuildScript = "build:prod";
passthru.tests.version = testers.testVersion {
package = snyk;
};
meta = with lib; {
description = "Scans and monitors projects for security vulnerabilities";
homepage = "https://snyk.io";
changelog = "https://github.com/snyk/cli/releases/tag/v${version}";
license = licenses.asl20;
maintainers = [ ];
mainProgram = "snyk";
};
}