1{ lib
2, buildGoModule
3, fetchFromGitHub
4}:
5
6buildGoModule rec {
7 pname = "api-linter";
8 version = "1.59.1";
9
10 src = fetchFromGitHub {
11 owner = "googleapis";
12 repo = "api-linter";
13 rev = "v${version}";
14 hash = "sha256-PgDdCcXiy9Dpop2myuRoi8KQROZdJ76ce4ax7wU4bpc=";
15 };
16
17 vendorHash = "sha256-egAZ4CeSSStfkN2mGgzGHTBojHKHoVEf3o0oi+OpMkw=";
18
19 subPackages = [ "cmd/api-linter" ];
20
21 ldflags = [
22 "-s"
23 "-w"
24 ];
25
26 # reference: https://github.com/googleapis/api-linter/blob/v1.59.1/.github/workflows/release.yaml#L76
27 preBuild = ''
28 cat > cmd/api-linter/version.go <<EOF
29 package main
30 const version = "${version}"
31 EOF
32 '';
33
34 meta = with lib; {
35 description = "Linter for APIs defined in protocol buffers";
36 homepage = "https://github.com/googleapis/api-linter/";
37 changelog = "https://github.com/googleapis/api-linter/releases/tag/${src.rev}";
38 license = licenses.asl20;
39 maintainers = with maintainers; [ xrelkd ];
40 };
41}