depot/third_party/nixpkgs/pkgs/by-name/gi/gitsign/package.nix

61 lines
1.3 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
makeWrapper,
gitMinimal,
testers,
gitsign,
}:
buildGoModule rec {
pname = "gitsign";
version = "0.11.0";
src = fetchFromGitHub {
owner = "sigstore";
repo = pname;
rev = "v${version}";
hash = "sha256-103sW7X5Bddvqat9oHfkpG2BReu7g24xGH2ia0JLAjQ=";
};
vendorHash = "sha256-XzKpzEYAKQUkGT+/XQJPzEp/qYuBOnE7jWHXtmitZDI=";
subPackages = [
"."
"cmd/gitsign-credential-cache"
];
nativeBuildInputs = [ makeWrapper ];
nativeCheckInputs = [ gitMinimal ];
ldflags = [
"-s"
"-w"
"-X github.com/sigstore/gitsign/pkg/version.gitVersion=${version}"
];
preCheck = ''
# test all paths
unset subPackages
'';
postInstall = ''
for f in $out/bin/*; do
wrapProgram $f --prefix PATH : ${lib.makeBinPath [ gitMinimal ]}
done
'';
passthru.tests.version = testers.testVersion { package = gitsign; };
meta = {
homepage = "https://github.com/sigstore/gitsign";
changelog = "https://github.com/sigstore/gitsign/releases/tag/v${version}";
description = "Keyless Git signing using Sigstore";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
lesuisse
developer-guy
];
mainProgram = "gitsign";
};
}