From a555d1ad55980bdd67d7774ddb5eb7cb0bd957a8 Mon Sep 17 00:00:00 2001 From: emaryn Date: Tue, 29 Apr 2025 13:53:24 +0800 Subject: [PATCH] grype: 0.87.0 -> 0.91.2 Diff: https://github.com/anchore/grype/compare/refs/tags/v0.87.0...refs/tags/v0.91.2 Changelog: https://github.com/anchore/grype/releases/tag/v0.91.2 --- pkgs/by-name/gr/grype/package.nix | 28 +++++++++++++++------------- pkgs/top-level/all-packages.nix | 4 ---- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/pkgs/by-name/gr/grype/package.nix b/pkgs/by-name/gr/grype/package.nix index 2df384d4b2a9..30b331f98f08 100644 --- a/pkgs/by-name/gr/grype/package.nix +++ b/pkgs/by-name/gr/grype/package.nix @@ -7,15 +7,15 @@ openssl, }: -buildGoModule rec { +buildGoModule (finalAttrs: { pname = "grype"; - version = "0.87.0"; + version = "0.91.2"; src = fetchFromGitHub { owner = "anchore"; repo = "grype"; - tag = "v${version}"; - hash = "sha256-El7cegeHMb6fhO1Vr6FK0E3Mlk/dbU0Dv4lUYNu0Gcc="; + tag = "v${finalAttrs.version}"; + hash = "sha256-y1uq7tNTzAhEAX/LZkrwfAanWDJpzuM+AWHlVcOVpqg="; # populate values that require us to use git. By doing this in postFetch we # can delete .git afterwards and maintain better reproducibility of the src. leaveDotGit = true; @@ -30,7 +30,7 @@ buildGoModule rec { proxyVendor = true; - vendorHash = "sha256-SbKvDAzWq58O0e/+1r5oI3rxfdsnPenMPwqNRTOe7AI="; + vendorHash = "sha256-A0YvbCI2n67Q9vA86PMY3DUGi6zbTgR8iWg8Nfvy9IQ="; nativeBuildInputs = [ installShellFiles ]; @@ -46,8 +46,8 @@ buildGoModule rec { ldflags = [ "-s" "-w" - "-X=main.version=${version}" - "-X=main.gitDescription=v${version}" + "-X=main.version=${finalAttrs.version}" + "-X=main.gitDescription=v${finalAttrs.version}" "-X=main.gitTreeState=clean" ]; @@ -67,13 +67,15 @@ buildGoModule rec { unset ldflags # patch utility script - patchShebangs grype/db/legacy/distribution/test-fixtures/tls/generate-x509-cert-pair.sh + patchShebangs grype/db/v5/distribution/test-fixtures/tls/generate-x509-cert-pair.sh # FIXME: these tests fail when building with Nix substituteInPlace test/cli/config_test.go \ --replace-fail "Test_configLoading" "Skip_configLoading" substituteInPlace test/cli/db_providers_test.go \ --replace-fail "TestDBProviders" "SkipDBProviders" + substituteInPlace grype/presenter/cyclonedx/presenter_test.go \ + --replace-fail "TestCycloneDxPresenterDir" "SkipCycloneDxPresenterDir" # remove tests that depend on docker substituteInPlace test/cli/cmd_test.go \ @@ -115,20 +117,20 @@ buildGoModule rec { --zsh <($out/bin/grype completion zsh) ''; - meta = with lib; { + meta = { description = "Vulnerability scanner for container images and filesystems"; homepage = "https://github.com/anchore/grype"; - changelog = "https://github.com/anchore/grype/releases/tag/v${version}"; + changelog = "https://github.com/anchore/grype/releases/tag/v${finalAttrs.version}"; longDescription = '' As a vulnerability scanner grype is able to scan the contents of a container image or filesystem to find known vulnerabilities. ''; - license = with licenses; [ asl20 ]; - maintainers = with maintainers; [ + license = with lib.licenses; [ asl20 ]; + maintainers = with lib.maintainers; [ fab jk kashw2 ]; mainProgram = "grype"; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d754bf7bb9b2..839ff4b61699 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2457,10 +2457,6 @@ with pkgs; pythonPackages = python3Packages; }; - grype = callPackage ../by-name/gr/grype/package.nix { - buildGoModule = buildGo123Module; - }; - hocr-tools = with python3Packages; toPythonApplication hocr-tools; hopper = qt5.callPackage ../development/tools/analysis/hopper { };