Merge pull request #144369 from LeSuisse/cosign-1.3.0

This commit is contained in:
Sandro 2021-11-03 13:19:23 +01:00 committed by GitHub
commit 44e2c10820
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,29 +1,35 @@
{ stdenv, lib, buildGoModule, fetchFromGitHub, pcsclite, pkg-config, PCSC, pivKeySupport ? true }:
{ stdenv, lib, buildGoModule, fetchFromGitHub, pcsclite, pkg-config, installShellFiles, PCSC, pivKeySupport ? true }:
buildGoModule rec {
pname = "cosign";
version = "1.2.1";
version = "1.3.0";
src = fetchFromGitHub {
owner = "sigstore";
repo = pname;
rev = "v${version}";
sha256 = "sha256-peR/TPydR4O6kGkRUpOgUCJ7xGRLbl9pYB1lAehjVK4=";
sha256 = "sha256-VKlM+bsK2Oj0UB4LF10pHEIJqXv6cAO5rtxnTogpfOk=";
};
buildInputs =
lib.optional (stdenv.isLinux && pivKeySupport) (lib.getDev pcsclite)
buildInputs = lib.optional (stdenv.isLinux && pivKeySupport) (lib.getDev pcsclite)
++ lib.optionals (stdenv.isDarwin && pivKeySupport) [ PCSC ];
nativeBuildInputs = [ pkg-config ];
nativeBuildInputs = [ pkg-config installShellFiles ];
vendorSha256 = "sha256-DyRMQ43BJOkDtWEqmAzqICyaSyQJ9H4i69VJ4dCGF44=";
vendorSha256 = "sha256-idMvvYeP5rAT6r9RPZ9S8K9KTpVYVq06ZKSBPxWA2ms=";
excludedPackages = "\\(copasetic\\|sample\\|webhook\\)";
excludedPackages = "\\(sample\\|webhook\\|help\\)";
tags = lib.optionals pivKeySupport [ "pivkey" ];
ldflags = [ "-s" "-w" "-X github.com/sigstore/cosign/cmd/cosign/cli.GitVersion=v${version}" ];
ldflags = [ "-s" "-w" "-X github.com/sigstore/cosign/cmd/cosign/cli/options.GitVersion=v${version}" ];
postInstall = ''
installShellCompletion --cmd cosign \
--bash <($out/bin/cosign completion bash) \
--fish <($out/bin/cosign completion fish) \
--zsh <($out/bin/cosign completion zsh)
'';
meta = with lib; {
homepage = "https://github.com/sigstore/cosign";