16 src = fetchFromGitHub {
20 sha256 = "sha256-KnG1FUdC8xpW/wI4E8+RzO0StKF+N7Wx1jTWNm4302M=";
23 vendorSha256 = "sha256-e/hkJoQ1GkSl4mhhgYVB4POult87DzWOXRLGyDVP+M0=";
26 # Skip a test that requires networking to be available to work.
27 ./skip_test_requiring_network.patch
28 # Skip TestWorkspaceGit which requires .git and commits.
29 ./skip_test_requiring_dotgit.patch
30 # Remove reliance of tests on file protocol which is disabled in git by default now
31 # Rebased upstream change https://github.com/bufbuild/buf/commit/bcaa77f8bbb8f6c198154c7c8d53596da4506dab
32 ./buf-tests-dont-use-file-transport.patch
33 # Make TestCyclicImport tests deterministic (see https://github.com/bufbuild/buf/pull/1551)
35 url = "https://github.com/bufbuild/buf/commit/75b5ef4c84f5953002dff95a1c66cb82b0e3b06f.patch";
36 sha256 = "sha256-pKF3VXkzttsTTT2r/Z37ug9nnu8gRdkfmv/aTOhAJpw=";
38 # Make TestDuplicateSyntheticOneofs check deterministic (see https://github.com/bufbuild/buf/pull/1579)
40 url = "https://github.com/bufbuild/buf/commit/9e72aa314e6f02b36793caa5f6068394cbdcb98c.patch";
41 sha256 = "sha256-6NEF3sP1EQ6cQxkH2xRyHxAD0OrXBlQQa05rLK998wo=";
45 nativeBuildInputs = [ installShellFiles ];
47 ldflags = [ "-s" "-w" ];
50 git # Required for TestGitCloner
51 protobuf # Required for buftesting.GetProtocFilePaths
55 # The tests need access to some of the built utilities
56 export PATH="$PATH:$GOPATH/bin"
57 # To skip TestCloneBranchAndRefToBucket
65 # Only install required binaries, don't install testing binaries
66 for FILE in buf protoc-gen-buf-breaking protoc-gen-buf-lint; do
67 install -D -m 555 -t $out/bin $GOPATH/bin/$FILE
71 installShellCompletion --cmd buf \
72 --bash <($GOPATH/bin/buf completion bash) \
73 --fish <($GOPATH/bin/buf completion fish) \
74 --zsh <($GOPATH/bin/buf completion zsh)
77 mkdir man && $GOPATH/bin/buf manpages man
83 passthru.tests.version = testers.testVersion { package = buf; };
86 homepage = "https://buf.build";
87 changelog = "https://github.com/bufbuild/buf/releases/tag/v${version}";
88 description = "Create consistent Protobuf APIs that preserve compatibility and comply with design best-practices";
89 license = licenses.asl20;
90 maintainers = with maintainers; [ jk lrewega ];