summary refs log tree commit diff
path: root/pkgs/development/tools/buf/default.nix
diff options
context:
space:
mode:
author06kellyjac <dev@j-k.io>2021-08-11 10:29:52 +0100
committer06kellyjac <dev@j-k.io>2021-08-11 10:29:52 +0100
commit1560fde9892893d022b9d70557d433c683bb92a2 (patch)
tree42b6c12e5f36f602fe38284224333011d148f7de /pkgs/development/tools/buf/default.nix
parente60aa920682611357194c3ee2a1952fe118e9979 (diff)
downloadnixpkgs-1560fde9892893d022b9d70557d433c683bb92a2.tar
nixpkgs-1560fde9892893d022b9d70557d433c683bb92a2.tar.gz
nixpkgs-1560fde9892893d022b9d70557d433c683bb92a2.tar.bz2
nixpkgs-1560fde9892893d022b9d70557d433c683bb92a2.tar.lz
nixpkgs-1560fde9892893d022b9d70557d433c683bb92a2.tar.xz
nixpkgs-1560fde9892893d022b9d70557d433c683bb92a2.tar.zst
nixpkgs-1560fde9892893d022b9d70557d433c683bb92a2.zip
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
Diffstat (limited to 'pkgs/development/tools/buf/default.nix')
-rw-r--r--pkgs/development/tools/buf/default.nix31
1 files changed, 21 insertions, 10 deletions
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 ];
   };
 }