15 src = fetchFromGitHub {
19 hash = "sha256-CNt7ZfUMRQNNVusaBgEW64WH1TFYz8yEBfKksGVRVUM=";
22 vendorHash = "sha256-kagSvwxVE+URRY2C5tRtdRwtHBIdQh3BWUG1b3+L8Os=";
25 # Skip a test that requires networking to be available to work,
26 # and a test which requires the source checkout to be part of a git repository
27 ./skip_broken_tests.patch
30 nativeBuildInputs = [ installShellFiles ];
32 ldflags = [ "-s" "-w" ];
35 git # Required for TestGitCloner
36 protobuf # Required for buftesting.GetProtocFilePaths
40 # The tests need access to some of the built utilities
41 export PATH="$PATH:$GOPATH/bin"
44 # Allow tests that bind or connect to localhost on macOS.
45 __darwinAllowLocalNetworking = true;
51 # Only install required binaries, don't install testing binaries
52 for FILE in buf protoc-gen-buf-breaking protoc-gen-buf-lint; do
53 install -D -m 555 -t $out/bin $GOPATH/bin/$FILE
57 installShellCompletion --cmd buf \
58 --bash <($GOPATH/bin/buf completion bash) \
59 --fish <($GOPATH/bin/buf completion fish) \
60 --zsh <($GOPATH/bin/buf completion zsh)
63 mkdir man && $GOPATH/bin/buf manpages man
69 passthru.tests.version = testers.testVersion { package = buf; };
72 homepage = "https://buf.build";
73 changelog = "https://github.com/bufbuild/buf/releases/tag/v${version}";
74 description = "Create consistent Protobuf APIs that preserve compatibility and comply with design best-practices";
75 license = licenses.asl20;
76 maintainers = with maintainers; [ jk lrewega ];