From 1560fde9892893d022b9d70557d433c683bb92a2 Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Wed, 11 Aug 2021 10:29:52 +0100 Subject: buf: 0.46.0 -> 0.49.0 Dropped leaveDotGit to avoid non-determinism issues Skip test that requried .git Slight cleanup Add myself as a maintainer --- pkgs/development/tools/buf/default.nix | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'pkgs/development/tools/buf/default.nix') diff --git a/pkgs/development/tools/buf/default.nix b/pkgs/development/tools/buf/default.nix index fb515841c7f..230f5b09b99 100644 --- a/pkgs/development/tools/buf/default.nix +++ b/pkgs/development/tools/buf/default.nix @@ -7,29 +7,32 @@ buildGoModule rec { pname = "buf"; - version = "0.46.0"; + version = "0.49.0"; src = fetchFromGitHub { owner = "bufbuild"; repo = pname; rev = "v${version}"; - sha256 = "sha256-5mjk31HuPNO/RhmMhIm3dAZAED/Kk33ObjC8KbPKRxk="; - leaveDotGit = true; # Required by TestWorkspaceGit + sha256 = "sha256-xP2UbcHwimN09IXrGp3zhBLL74l/8YKotqBNRTITF18="; }; - vendorSha256 = "sha256-K8UZDEhAvD292RCEDKfY9PdZGS389vLF3oukcBndUF4="; + vendorSha256 = "sha256-WgQSLe99CbOwJC8ewDcSq6PcBJdmiPRmvAonq8drQ1w="; patches = [ # Skip a test that requires networking to be available to work. ./skip_test_requiring_network.patch + # Skip TestWorkspaceGit which requires .git and commits. + ./skip_test_requiring_dotgit.patch ]; nativeBuildInputs = [ protobuf ]; + # Required for TestGitCloner checkInputs = [ git ]; ldflags = [ "-s" "-w" ]; preCheck = '' - export PATH=$PATH:$GOPATH/bin + # The tests need access to some of the built utilities + export PATH="$PATH:$GOPATH/bin" # To skip TestCloneBranchAndRefToBucket export CI=true ''; @@ -38,24 +41,32 @@ buildGoModule rec { runHook preInstall mkdir -p "$out/bin" - dir="$GOPATH/bin" # Only install required binaries, don't install testing binaries - for file in \ + for FILE in \ "buf" \ "protoc-gen-buf-breaking" \ "protoc-gen-buf-lint" \ "protoc-gen-buf-check-breaking" \ "protoc-gen-buf-check-lint"; do - cp "$dir/$file" "$out/bin/" + cp "$GOPATH/bin/$FILE" "$out/bin/" done runHook postInstall ''; + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + $out/bin/buf --help + $out/bin/buf --version 2>&1 | grep "${version}" + runHook postInstallCheck + ''; + meta = with lib; { - description = "Create consistent Protobuf APIs that preserve compatibility and comply with design best-practices"; homepage = "https://buf.build"; + changelog = "https://github.com/bufbuild/buf/releases/tag/v${version}"; + description = "Create consistent Protobuf APIs that preserve compatibility and comply with design best-practices"; license = licenses.asl20; - maintainers = with maintainers; [ raboof ]; + maintainers = with maintainers; [ raboof jk ]; }; } -- cgit 1.4.1