2019-02-27 21:37:23 +00:00
|
|
|
{ stdenv, buildGoPackage, fetchFromGitHub, groff, Security, utillinux }:
|
2012-12-12 05:45:43 +00:00
|
|
|
|
2018-06-21 23:12:52 +01:00
|
|
|
buildGoPackage rec {
|
2019-02-17 16:54:29 +00:00
|
|
|
pname = "hub";
|
2019-07-20 03:01:55 +01:00
|
|
|
version = "2.12.3";
|
2012-12-12 05:45:43 +00:00
|
|
|
|
2018-06-21 23:12:52 +01:00
|
|
|
goPackagePath = "github.com/github/hub";
|
|
|
|
|
2019-02-17 16:54:29 +00:00
|
|
|
# Only needed to build the man-pages
|
|
|
|
excludedPackages = [ "github.com/github/hub/md2roff-bin" ];
|
|
|
|
|
2018-06-21 23:12:52 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "github";
|
2019-02-17 16:54:29 +00:00
|
|
|
repo = pname;
|
2018-06-21 23:12:52 +01:00
|
|
|
rev = "v${version}";
|
2019-07-20 03:01:55 +01:00
|
|
|
sha256 = "13l4nc3k6vl9x1x0153mwi351j3z266wx0fp7xw2851avrgkk9zg";
|
2012-12-12 05:45:43 +00:00
|
|
|
};
|
|
|
|
|
2019-02-27 21:37:23 +00:00
|
|
|
nativeBuildInputs = [ groff utillinux ];
|
|
|
|
buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
|
2015-02-18 03:30:59 +00:00
|
|
|
|
2018-06-21 23:12:52 +01:00
|
|
|
postPatch = ''
|
2015-02-18 03:30:59 +00:00
|
|
|
patchShebangs .
|
2012-12-12 05:45:43 +00:00
|
|
|
'';
|
|
|
|
|
2018-06-21 23:12:52 +01:00
|
|
|
postInstall = ''
|
|
|
|
cd go/src/${goPackagePath}
|
|
|
|
install -D etc/hub.zsh_completion "$bin/share/zsh/site-functions/_hub"
|
2018-12-30 00:38:35 +00:00
|
|
|
install -D etc/hub.bash_completion.sh "$bin/share/bash-completion/completions/hub"
|
2018-06-21 23:12:52 +01:00
|
|
|
install -D etc/hub.fish_completion "$bin/share/fish/vendor_completions.d/hub.fish"
|
2015-01-03 23:28:38 +00:00
|
|
|
|
2019-02-27 21:37:23 +00:00
|
|
|
LC_ALL=C.UTF8 \
|
|
|
|
make man-pages
|
2018-10-31 18:32:44 +00:00
|
|
|
cp -vr --parents share/man/man[1-9]/*.[1-9] $bin/
|
2012-12-12 05:45:43 +00:00
|
|
|
'';
|
|
|
|
|
2015-01-03 23:28:38 +00:00
|
|
|
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 ];
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = with platforms; unix;
|
2012-12-12 05:45:43 +00:00
|
|
|
};
|
|
|
|
}
|