2020-03-28 16:32:01 -07:00
|
|
|
{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:
|
2020-02-03 18:15:27 -08:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "gh";
|
2020-09-08 01:50:31 -07:00
|
|
|
version = "0.12.0";
|
2020-02-03 18:15:27 -08:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cli";
|
|
|
|
repo = "cli";
|
|
|
|
rev = "v${version}";
|
2020-09-08 01:50:31 -07:00
|
|
|
sha256 = "1nwpqwr8sqqpndj7qsk935i1675f4qdbl31x60a038l9iiwc28x1";
|
2020-02-03 18:15:27 -08:00
|
|
|
};
|
|
|
|
|
2020-09-08 01:50:31 -07:00
|
|
|
vendorSha256 = "1m5ahzh5sfla3p6hllr7wjigvrnccdvrsdjpxd2hy0rl7jsrp85m";
|
2020-02-03 18:15:27 -08:00
|
|
|
|
2020-05-15 07:20:36 -07:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make GH_VERSION=${version} bin/gh manpages
|
|
|
|
'';
|
2020-02-03 18:15:27 -08:00
|
|
|
|
2020-05-15 07:20:36 -07:00
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 bin/gh -t $out/bin
|
|
|
|
installManPage share/man/*/*.[1-9]
|
2020-02-03 18:15:27 -08:00
|
|
|
|
|
|
|
for shell in bash fish zsh; do
|
|
|
|
$out/bin/gh completion -s $shell > gh.$shell
|
|
|
|
installShellCompletion gh.$shell
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2020-08-10 15:27:35 -07:00
|
|
|
checkPhase = ''
|
|
|
|
make test
|
|
|
|
'';
|
|
|
|
|
2020-03-28 16:32:01 -07:00
|
|
|
meta = with lib; {
|
2020-02-03 18:15:27 -08:00
|
|
|
description = "GitHub CLI tool";
|
2020-02-13 15:46:21 -08:00
|
|
|
homepage = "https://cli.github.com/";
|
2020-02-03 18:15:27 -08:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ zowoq ];
|
|
|
|
};
|
2020-05-15 07:20:36 -07:00
|
|
|
}
|