2020-04-24 23:36:52 +00:00
|
|
|
{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "gh";
|
2020-10-07 09:15:18 +00:00
|
|
|
version = "1.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cli";
|
|
|
|
repo = "cli";
|
|
|
|
rev = "v${version}";
|
2020-10-07 09:15:18 +00:00
|
|
|
sha256 = "1jf1y6135p30dlr42fnl0w7782fczizq8yya4bsd6xf66bcq0zzn";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
vendorSha256 = "12ka5x5m4h8dfpcdhfjc5lz6bm8pzfqkbhs9j3a8w08xsi93dvdz";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
2020-09-25 04:45:31 +00:00
|
|
|
export GO_LDFLAGS="-s -w"
|
2020-05-29 06:06:01 +00:00
|
|
|
make GH_VERSION=${version} bin/gh manpages
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 bin/gh -t $out/bin
|
|
|
|
installManPage share/man/*/*.[1-9]
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
for shell in bash fish zsh; do
|
|
|
|
$out/bin/gh completion -s $shell > gh.$shell
|
|
|
|
installShellCompletion gh.$shell
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
checkPhase = ''
|
|
|
|
make test
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "GitHub CLI tool";
|
|
|
|
homepage = "https://cli.github.com/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ zowoq ];
|
|
|
|
};
|
2020-05-29 06:06:01 +00:00
|
|
|
}
|