buf: init at 0.40.0

This commit is contained in:
Arnout Engelen 2021-03-25 11:41:51 +01:00
parent f5e8bdd07d
commit 675d5ba700
No known key found for this signature in database
GPG key ID: 061107B0F74A6DAA
3 changed files with 53 additions and 0 deletions

View file

@ -0,0 +1,36 @@
{ lib
, buildGoModule
, fetchFromGitHub
, protobuf
}:
buildGoModule rec {
pname = "buf";
version = "0.40.0";
src = fetchFromGitHub {
owner = "bufbuild";
repo = pname;
rev = "v${version}";
sha256 = "sha256-N6o+1cfer8rgKJ3+CL25axJSjGV/YSG1sLIHXJzsC6o=";
};
patches = [
./skip_test_requiring_network.patch
];
preCheck = ''
export PATH=$PATH:$GOPATH/bin
'';
nativeBuildInputs = [ protobuf ];
vendorSha256 = "sha256-vl+WqtpegoAvylx/lcyfJk8DAOub8U4Lx3Pe3eW4M/E=";
meta = with lib; {
description = "Create consistent Protobuf APIs that preserve compatibility and comply with design best-practices";
homepage = "https://buf.build";
license = licenses.asl20;
maintainers = with maintainers; [ raboof ];
};
}

View file

@ -0,0 +1,15 @@
diff --git a/internal/buf/internal/buftesting/buftesting.go b/internal/buf/internal/buftesting/buftesting.go
index dc8da0c..70ad299 100644
--- a/internal/buf/internal/buftesting/buftesting.go
+++ b/internal/buf/internal/buftesting/buftesting.go
@@ -100,6 +100,10 @@ func RunActualProtoc(
// GetGoogleapisDirPath gets the path to a clone of googleapis.
func GetGoogleapisDirPath(t *testing.T, buftestingDirPath string) string {
+ // Requires network access, which is not available during
+ // the nixpkgs sandboxed build
+ t.Skip()
+
googleapisDirPath := filepath.Join(buftestingDirPath, testGoogleapisDirPath)
require.NoError(
t,

View file

@ -166,6 +166,8 @@ in
breakpad = callPackage ../development/misc/breakpad { };
buf = callPackage ../development/tools/buf { };
# Zip file format only allows times after year 1980, which makes e.g. Python wheel building fail with:
# ValueError: ZIP does not support timestamps before 1980
ensureNewerSourcesForZipFilesHook = ensureNewerSourcesHook { year = "1980"; };