uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
78
pkgs/development/tools/buf/default.nix
Normal file
78
pkgs/development/tools/buf/default.nix
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
{ lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, protobuf
|
||||
, git
|
||||
, testers
|
||||
, buf
|
||||
, installShellFiles
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "buf";
|
||||
version = "1.5.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "bufbuild";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-Jcj1tpcG64mSVn444isGsK9AcITh171ibECukv3bXDI=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-aHGV8UfPn7xsySPXRSzsEpcaz1Ll49Mj1S9izvaIRWY=";
|
||||
|
||||
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 = [ installShellFiles ];
|
||||
|
||||
ldflags = [ "-s" "-w" ];
|
||||
|
||||
checkInputs = [
|
||||
git # Required for TestGitCloner
|
||||
protobuf # Required for buftesting.GetProtocFilePaths
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
# The tests need access to some of the built utilities
|
||||
export PATH="$PATH:$GOPATH/bin"
|
||||
# To skip TestCloneBranchAndRefToBucket
|
||||
export CI=true
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
# Binaries
|
||||
# Only install required binaries, don't install testing binaries
|
||||
for FILE in buf protoc-gen-buf-breaking protoc-gen-buf-lint; do
|
||||
install -D -m 555 -t $out/bin $GOPATH/bin/$FILE
|
||||
done
|
||||
|
||||
# Completions
|
||||
installShellCompletion --cmd buf \
|
||||
--bash <($GOPATH/bin/buf completion bash) \
|
||||
--fish <($GOPATH/bin/buf completion fish) \
|
||||
--zsh <($GOPATH/bin/buf completion zsh)
|
||||
|
||||
# Man Pages
|
||||
mkdir man && $GOPATH/bin/buf manpages man
|
||||
installManPage man/*
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.tests.version = testers.testVersion { package = buf; };
|
||||
|
||||
meta = with lib; {
|
||||
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 jk lrewega ];
|
||||
};
|
||||
}
|
||||
14
pkgs/development/tools/buf/skip_test_requiring_dotgit.patch
Normal file
14
pkgs/development/tools/buf/skip_test_requiring_dotgit.patch
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
diff --git a/private/buf/cmd/buf/workspace_test.go b/private/buf/cmd/buf/workspace_test.go
|
||||
index 25e33dd..f593beb 100644
|
||||
--- a/private/buf/cmd/buf/workspace_test.go
|
||||
+++ b/private/buf/cmd/buf/workspace_test.go
|
||||
@@ -340,6 +340,9 @@ func TestWorkspaceNestedArchive(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestWorkspaceGit(t *testing.T) {
|
||||
+ // Requires .git directory which we do not retain due to
|
||||
+ // `leaveDotGit` non-determinism
|
||||
+ t.Skip()
|
||||
t.Skip("skip until the move to private/buf is merged")
|
||||
// Directory paths specified as a git reference within a workspace.
|
||||
t.Parallel()
|
||||
15
pkgs/development/tools/buf/skip_test_requiring_network.patch
Normal file
15
pkgs/development/tools/buf/skip_test_requiring_network.patch
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
diff --git a/private/bufpkg/buftesting/buftesting.go b/private/bufpkg/buftesting/buftesting.go
|
||||
index 82b3ec4..ef8263a 100644
|
||||
--- a/private/bufpkg/buftesting/buftesting.go
|
||||
+++ b/private/bufpkg/buftesting/buftesting.go
|
||||
@@ -99,6 +99,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,
|
||||
Loading…
Add table
Add a link
Reference in a new issue