depot/third_party/nixpkgs/pkgs/tools/security/age/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

49 lines
1.2 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, fetchpatch, installShellFiles }:
buildGoModule rec {
pname = "age";
version = "1.2.0";
src = fetchFromGitHub {
owner = "FiloSottile";
repo = "age";
rev = "v${version}";
hash = "sha256-O0NKDPvr+6ZupakPIpnGgDcdfG3nWR1pvVE+3KkYurY=";
};
vendorHash = "sha256-5We4OYoexzzSF1AkxuGCUwuYJ3Wra+T6mCcT4XYgzhU=";
ldflags = [
"-s" "-w" "-X main.Version=${version}"
];
nativeBuildInputs = [ installShellFiles ];
preInstall = ''
installManPage doc/*.1
'';
doInstallCheck = true;
installCheckPhase = ''
if [[ "$("$out/bin/${pname}" --version)" == "${version}" ]]; then
echo '${pname} smoke check passed'
else
echo '${pname} smoke check failed'
return 1
fi
'';
# plugin test is flaky, see https://github.com/FiloSottile/age/issues/517
checkFlags = [
"-skip" "TestScript/plugin"
];
meta = with lib; {
changelog = "https://github.com/FiloSottile/age/releases/tag/v${version}";
homepage = "https://age-encryption.org/";
description = "Modern encryption tool with small explicit keys";
license = licenses.bsd3;
mainProgram = "age";
maintainers = with maintainers; [ tazjin ];
};
}