From b489e63c3c62ab21ece235a9b5a4b9a4c7aede5b Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Fri, 4 Mar 2022 16:40:41 +0000 Subject: [PATCH] cosign: 1.5.2 -> 1.6.0 Co-authored-by: Thomas Gerbet --- pkgs/tools/security/cosign/default.nix | 35 +++++++++++++++++++------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/pkgs/tools/security/cosign/default.nix b/pkgs/tools/security/cosign/default.nix index 5bfc16718bf7..63d36e99032e 100644 --- a/pkgs/tools/security/cosign/default.nix +++ b/pkgs/tools/security/cosign/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "cosign"; - version = "1.5.2"; + version = "1.6.0"; src = fetchFromGitHub { owner = "sigstore"; repo = pname; rev = "v${version}"; - sha256 = "sha256-37jahAGgQn7HwwdRTlAS/oJQ3BxTkMViI6iJMBYFgjI="; + sha256 = "sha256-jAkTIO+tmb1vjS2eRWU9Fau7qzPCBlXJCk00iwNpULE="; }; buildInputs = lib.optional (stdenv.isLinux && pivKeySupport) (lib.getDev pcsclite) @@ -16,19 +16,36 @@ buildGoModule rec { nativeBuildInputs = [ pkg-config installShellFiles ]; - vendorSha256 = "sha256-d3aOX4iMlhlxgYbqCHCIFKXunVha0Fw4ZBmy4OA6EhI="; + vendorSha256 = "sha256-E9zeRlPIIoXo/EfagHC3aDnW747SdsPiqIA384D7NQI="; - excludedPackages = "\\(sample\\|webhook\\|help\\)"; + subPackages = [ + "cmd/cosign" + "cmd/cosign/webhook" + "cmd/sget" + ]; tags = [] ++ lib.optionals pivKeySupport [ "pivkey" ] ++ lib.optionals pkcs11Support [ "pkcs11key" ]; - ldflags = [ "-s" "-w" "-X github.com/sigstore/cosign/pkg/version.GitVersion=v${version}" ]; + ldflags = [ + "-s" + "-w" + "-X sigs.k8s.io/release-utils/version.gitVersion=v${version}" + "-X sigs.k8s.io/release-utils/version.gitTreeState=clean" + ]; - postPatch = '' - rm pkg/cosign/tuf/client_test.go # Require network access - rm internal/pkg/cosign/fulcio/signer_test.go # Require network access - rm internal/pkg/cosign/rekor/signer_test.go # Require network access + postBuild = '' + # cmd/cosign/webhook should be called cosigned + mv $GOPATH/bin/{webhook,cosigned} + ''; + + preCheck = '' + # test all paths + unset subPackages + + rm cmd/cosign/cli/fulcio/fulcioroots/fulcioroots_test.go # Require network access rm pkg/cosign/kubernetes/webhook/validator_test.go # Require network access + rm pkg/cosign/tlog_test.go # Require network access + rm pkg/cosign/tuf/client_test.go # Require network access ''; postInstall = ''