forked from mirrors/nixpkgs
Merge pull request #133905 from raboof/buf-use-testVersion-utility
buf: use testVersion utility
This commit is contained in:
commit
3f3e055bcd
2 changed files with 4 additions and 8 deletions
|
@ -613,7 +613,7 @@ rec {
|
||||||
command ? "${package.meta.mainProgram or package.pname or package.name} --version",
|
command ? "${package.meta.mainProgram or package.pname or package.name} --version",
|
||||||
version ? package.version,
|
version ? package.version,
|
||||||
}: runCommand "test-version" { nativeBuildInputs = [ package ]; meta.timeout = 60; } ''
|
}: runCommand "test-version" { nativeBuildInputs = [ package ]; meta.timeout = 60; } ''
|
||||||
${command} | grep -Fw ${version}
|
${command} |& grep -Fw ${version}
|
||||||
touch $out
|
touch $out
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, protobuf
|
, protobuf
|
||||||
, git
|
, git
|
||||||
|
, testVersion
|
||||||
|
, buf
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildGoModule rec {
|
buildGoModule rec {
|
||||||
|
@ -54,13 +56,7 @@ buildGoModule rec {
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doInstallCheck = true;
|
passthru.tests.version = testVersion { package = buf; };
|
||||||
installCheckPhase = ''
|
|
||||||
runHook preInstallCheck
|
|
||||||
$out/bin/buf --help
|
|
||||||
$out/bin/buf --version 2>&1 | grep "${version}"
|
|
||||||
runHook postInstallCheck
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://buf.build";
|
homepage = "https://buf.build";
|
||||||
|
|
Loading…
Add table
Reference in a new issue