5e9e1146e1
GitOrigin-RevId: 18036c0be90f4e308ae3ebcab0e14aae0336fe42
41 lines
975 B
Nix
41 lines
975 B
Nix
{ lib
|
|
, buildGoModule
|
|
, fetchFromGitHub
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "api-linter";
|
|
version = "1.55.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "googleapis";
|
|
repo = "api-linter";
|
|
rev = "v${version}";
|
|
hash = "sha256-aywqb//fhygphjX3suVfqNIG0saPPnhgLPA/DBpSVQY=";
|
|
};
|
|
|
|
vendorHash = "sha256-oK1d9aQ43Zj+Xt4tMhn+Lz1Q09psqqdTUqbgEdkuBvg=";
|
|
|
|
subPackages = [ "cmd/api-linter" ];
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
];
|
|
|
|
# reference: https://github.com/googleapis/api-linter/blob/v1.55.0/.github/workflows/release.yaml#L76
|
|
preBuild = ''
|
|
cat > cmd/api-linter/version.go <<EOF
|
|
package main
|
|
const version = "${version}"
|
|
EOF
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Linter for APIs defined in protocol buffers";
|
|
homepage = "https://github.com/googleapis/api-linter/";
|
|
changelog = "https://github.com/googleapis/api-linter/releases/tag/${src.rev}";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ xrelkd ];
|
|
};
|
|
}
|