gurobi: 12.0.0 -> 12.0.1 (#377852)
[NixPkgs.git] / pkgs / by-name / tr / trivy / package.nix
bloba307d3853f9a080ed52746eff0d5abfe069ef17b
2   lib,
3   stdenv,
4   buildPackages,
5   buildGoModule,
6   fetchFromGitHub,
7   installShellFiles,
8   testers,
9   trivy,
12 buildGoModule rec {
13   pname = "trivy";
14   version = "0.59.0";
16   src = fetchFromGitHub {
17     owner = "aquasecurity";
18     repo = "trivy";
19     tag = "v${version}";
20     hash = "sha256-DIBpuSW8igkpZxhve77fzJ1u3sp3iWHmi7746F0cKEQ=";
21   };
23   # Hash mismatch on across Linux and Darwin
24   proxyVendor = true;
26   vendorHash = "sha256-kRKGX3hRbjLb/thhFcX4/y1ty0EGME63VGOsPaUcZKc=";
28   subPackages = [ "cmd/trivy" ];
30   ldflags = [
31     "-s"
32     "-w"
33     "-X=github.com/aquasecurity/trivy/pkg/version/app.ver=${version}"
34   ];
36   nativeBuildInputs = [ installShellFiles ];
38   # Tests require network access
39   doCheck = false;
41   postInstall =
42     let
43       trivy =
44         if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
45           placeholder "out"
46         else
47           buildPackages.trivy;
48     in
49     ''
50       installShellCompletion --cmd trivy \
51         --bash <(${trivy}/bin/trivy completion bash) \
52         --fish <(${trivy}/bin/trivy completion fish) \
53         --zsh <(${trivy}/bin/trivy completion zsh)
54     '';
56   doInstallCheck = true;
58   passthru.tests.version = testers.testVersion {
59     package = trivy;
60     command = "trivy --version";
61     version = "Version: ${version}";
62   };
64   meta = with lib; {
65     description = "Simple and comprehensive vulnerability scanner for containers, suitable for CI";
66     homepage = "https://github.com/aquasecurity/trivy";
67     changelog = "https://github.com/aquasecurity/trivy/releases/tag/v${version}";
68     longDescription = ''
69       Trivy is a simple and comprehensive vulnerability scanner for containers
70       and other artifacts. A software vulnerability is a glitch, flaw, or
71       weakness present in the software or in an Operating System. Trivy detects
72       vulnerabilities of OS packages (Alpine, RHEL, CentOS, etc.) and
73       application dependencies (Bundler, Composer, npm, yarn, etc.).
74     '';
75     mainProgram = "trivy";
76     license = licenses.asl20;
77     maintainers = with maintainers; [
78       fab
79       jk
80     ];
81   };