depot/third_party/nixpkgs/pkgs/applications/version-management/git-and-tools/hub/default.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

43 lines
1.2 KiB
Nix

{ stdenv, buildGoPackage, fetchFromGitHub, groff, utillinux }:
buildGoPackage rec {
pname = "hub";
version = "2.14.2";
goPackagePath = "github.com/github/hub";
# Only needed to build the man-pages
excludedPackages = [ "github.com/github/hub/md2roff-bin" ];
src = fetchFromGitHub {
owner = "github";
repo = pname;
rev = "v${version}";
sha256 = "1qjab3dpia1jdlszz3xxix76lqrm4zbmqzd9ymld7h06awzsg2vh";
};
nativeBuildInputs = [ groff utillinux ];
postPatch = ''
patchShebangs .
'';
postInstall = ''
cd go/src/${goPackagePath}
install -D etc/hub.zsh_completion "$bin/share/zsh/site-functions/_hub"
install -D etc/hub.bash_completion.sh "$bin/share/bash-completion/completions/hub"
install -D etc/hub.fish_completion "$bin/share/fish/vendor_completions.d/hub.fish"
LC_ALL=C.UTF8 \
make man-pages
cp -vr --parents share/man/man[1-9]/*.[1-9] $bin/
'';
meta = with stdenv.lib; {
description = "Command-line wrapper for git that makes you better at GitHub";
license = licenses.mit;
homepage = "https://hub.github.com/";
maintainers = with maintainers; [ the-kenny globin ];
platforms = with platforms; unix;
};
}