From 242c67349b079c337ed3a056600d3303774b4170 Mon Sep 17 00:00:00 2001 From: Aaron Jheng Date: Sat, 1 Jul 2023 09:54:12 +0000 Subject: [PATCH 1/2] secretscanner: 20210214-42a38f9 -> 1.2.0 --- pkgs/tools/security/secretscanner/default.nix | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/security/secretscanner/default.nix b/pkgs/tools/security/secretscanner/default.nix index 93d440009f3f..859e6edc6fa0 100644 --- a/pkgs/tools/security/secretscanner/default.nix +++ b/pkgs/tools/security/secretscanner/default.nix @@ -3,26 +3,43 @@ , fetchFromGitHub , hyperscan , pkg-config +, protobuf +, protoc-gen-go +, protoc-gen-go-grpc }: buildGoModule rec { pname = "secretscanner"; - version = "20210214-${lib.strings.substring 0 7 rev}"; - rev = "42a38f9351352bf6240016b5b93d971be35cad46"; + version = "1.2.0"; src = fetchFromGitHub { owner = "deepfence"; repo = "SecretScanner"; - inherit rev; - sha256 = "0yga71f7bx5a3hj5agr88pd7j8jnxbwqm241fhrvv8ic4sx0mawg"; + rev = "v${version}"; + fetchSubmodules = true; + hash = "sha256-lTUZLuEiC9xpHYWn3uv4ZtbvHX6ETsjxacjd/O0kU8I="; }; - vendorSha256 = "0b7qa83iqnigihgwlqsxi28n7d9h0dk3wx1bqvhn4k01483cipsd"; + vendorHash = "sha256-lB+fiSdflIYGw0hMN0a9IOtRcJwYEUPQqaeU7mAfSQs="; - nativeBuildInputs = [ pkg-config ]; + excludedPackages = [ + "./agent-plugins-grpc/proto" # No need to build submodules + ]; + + nativeBuildInputs = [ + pkg-config + protobuf + protoc-gen-go + protoc-gen-go-grpc + ]; buildInputs = [ hyperscan ]; + preBuild = '' + # Compile proto files + make -C agent-plugins-grpc go + ''; + postInstall = '' mv $out/bin/SecretScanner $out/bin/$pname ''; From 7bba50f51452bf41cba233114bac4f5812695eb1 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 1 Jul 2023 12:15:16 +0200 Subject: [PATCH 2/2] secretscanner: add changelog to meta --- pkgs/tools/security/secretscanner/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/secretscanner/default.nix b/pkgs/tools/security/secretscanner/default.nix index 859e6edc6fa0..cff77db6b849 100644 --- a/pkgs/tools/security/secretscanner/default.nix +++ b/pkgs/tools/security/secretscanner/default.nix @@ -15,7 +15,7 @@ buildGoModule rec { src = fetchFromGitHub { owner = "deepfence"; repo = "SecretScanner"; - rev = "v${version}"; + rev = "refs/tags/v${version}"; fetchSubmodules = true; hash = "sha256-lTUZLuEiC9xpHYWn3uv4ZtbvHX6ETsjxacjd/O0kU8I="; }; @@ -33,7 +33,9 @@ buildGoModule rec { protoc-gen-go-grpc ]; - buildInputs = [ hyperscan ]; + buildInputs = [ + hyperscan + ]; preBuild = '' # Compile proto files @@ -47,6 +49,7 @@ buildGoModule rec { meta = with lib; { description = "Tool to find secrets and passwords in container images and file systems"; homepage = "https://github.com/deepfence/SecretScanner"; + changelog = "https://github.com/deepfence/SecretScanner/releases/tag/v${version}"; license = with licenses; [ mit ]; maintainers = with maintainers; [ fab ]; };