depot/third_party/nixpkgs/pkgs/applications/version-management/git-and-tools/gh/default.nix
Default email 66604c92c1 Project import generated by Copybara.
GitOrigin-RevId: 32b8ed738096bafb4cdb7f70347a0f63f9f40151
2020-05-15 23:57:56 +02:00

36 lines
No EOL
871 B
Nix

{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:
buildGoModule rec {
pname = "gh";
version = "0.8.0";
src = fetchFromGitHub {
owner = "cli";
repo = "cli";
rev = "v${version}";
sha256 = "08fy3677yq52x40rab49ijhw4r25ls2807dbv9wpna6w07n7r8v7";
};
vendorSha256 = "0s99bjmsafnzhl3s2lcybxgsw1s4i1h3vh6p40gz4vsfhndidqrq";
buildFlagsArray = [
"-ldflags=-s -w -X github.com/cli/cli/command.Version=${version}"
];
subPackages = [ "cmd/gh" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
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 ];
};
}