depot/third_party/nixpkgs/pkgs/applications/version-management/git-and-tools/gh/default.nix
Default email 4fc29cb41f Project import generated by Copybara.
GitOrigin-RevId: 135073a87b7e2c631739f4ffa016e1859b1a425e
2020-05-29 08:06:01 +02:00

38 lines
895 B
Nix

{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:
buildGoModule rec {
pname = "gh";
version = "0.9.0";
src = fetchFromGitHub {
owner = "cli";
repo = "cli";
rev = "v${version}";
sha256 = "050wqjng0l42ilaiglwm1mzrrmnk0bg9icnzq9sm88axgl4xpmdy";
};
vendorSha256 = "0s99bjmsafnzhl3s2lcybxgsw1s4i1h3vh6p40gz4vsfhndidqrq";
nativeBuildInputs = [ installShellFiles ];
buildPhase = ''
make GH_VERSION=${version} bin/gh manpages
'';
installPhase = ''
install -Dm755 bin/gh -t $out/bin
installManPage share/man/*/*.[1-9]
for shell in bash fish zsh; do
$out/bin/gh completion -s $shell > gh.$shell
installShellCompletion gh.$shell
done
'';
meta = with lib; {
description = "GitHub CLI tool";
homepage = "https://cli.github.com/";
license = licenses.mit;
maintainers = with maintainers; [ zowoq ];
};
}