15 src = fetchFromGitHub {
19 hash = "sha256-XLVEZYQEq9qXrH7EytoHO3QExOAZX6N57amcKBy5ORE=";
22 vendorHash = "sha256-P1MNwpz3UbaQHLFv5mMs9d0xulitfAD90T1jWxVi5/k=";
25 # Skip a test that requires networking to be available to work.
26 ./skip_broken_tests.patch
29 nativeBuildInputs = [ installShellFiles ];
31 ldflags = [ "-s" "-w" ];
34 git # Required for TestGitCloner
35 protobuf_26 # Required for buftesting.GetProtocFilePaths
39 "-skip=TestWorkspaceGit"
43 # For WebAssembly runtime tests
44 GOOS=wasip1 GOARCH=wasm go build -o $GOPATH/bin/buf-plugin-suffix.wasm \
45 ./private/bufpkg/bufcheck/internal/cmd/buf-plugin-suffix
47 # The tests need access to some of the built utilities
48 export PATH="$PATH:$GOPATH/bin"
51 # Allow tests that bind or connect to localhost on macOS.
52 __darwinAllowLocalNetworking = true;
58 # Only install required binaries, don't install testing binaries
59 for FILE in buf protoc-gen-buf-breaking protoc-gen-buf-lint; do
60 install -D -m 555 -t $out/bin $GOPATH/bin/$FILE
64 installShellCompletion --cmd buf \
65 --bash <($GOPATH/bin/buf completion bash) \
66 --fish <($GOPATH/bin/buf completion fish) \
67 --zsh <($GOPATH/bin/buf completion zsh)
70 mkdir man && $GOPATH/bin/buf manpages man
76 passthru.tests.version = testers.testVersion { package = buf; };
79 homepage = "https://buf.build";
80 changelog = "https://github.com/bufbuild/buf/releases/tag/v${version}";
81 description = "Create consistent Protobuf APIs that preserve compatibility and comply with design best-practices";
82 license = lib.licenses.asl20;
83 maintainers = with lib.maintainers; [ jk lrewega aaronjheng ];