2018-05-30 14:44:47 +02:00
|
|
|
{ stdenv, fetchgit, go, ronn, groff, utillinux, Security }:
|
2012-12-12 06:45:43 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "hub-${version}";
|
2018-05-30 14:44:47 +02:00
|
|
|
version = "2.3.0";
|
2012-12-12 06:45:43 +01:00
|
|
|
|
2015-01-04 00:28:38 +01:00
|
|
|
src = fetchgit {
|
|
|
|
url = https://github.com/github/hub.git;
|
|
|
|
rev = "refs/tags/v${version}";
|
2018-05-30 14:44:47 +02:00
|
|
|
sha256 = "0rx5izxgjxh4jdn991x90xvgbc7nhwx15pkmmzc8rkdzf0hnas1s";
|
2012-12-12 06:45:43 +01:00
|
|
|
};
|
|
|
|
|
2015-02-18 04:30:59 +01:00
|
|
|
|
2018-05-30 14:44:47 +02:00
|
|
|
buildInputs = [ go ronn groff utillinux ]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin Security;
|
2015-01-04 00:28:38 +01:00
|
|
|
|
|
|
|
buildPhase = ''
|
2018-05-30 14:44:47 +02:00
|
|
|
mkdir bin
|
|
|
|
ln -s ${ronn}/bin/ronn bin/ronn
|
|
|
|
|
2015-02-18 04:30:59 +01:00
|
|
|
patchShebangs .
|
2018-05-30 14:44:47 +02:00
|
|
|
make all man-pages
|
2012-12-12 06:45:43 +01:00
|
|
|
'';
|
|
|
|
|
2015-01-04 00:28:38 +01:00
|
|
|
installPhase = ''
|
2018-05-30 14:44:47 +02:00
|
|
|
prefix=$out sh -x < script/install.sh
|
2015-01-04 00:28:38 +01:00
|
|
|
|
|
|
|
mkdir -p "$out/share/zsh/site-functions"
|
|
|
|
cp "etc/hub.zsh_completion" "$out/share/zsh/site-functions/_hub"
|
|
|
|
|
2016-09-22 09:26:58 +02:00
|
|
|
mkdir -p "$out/etc/bash_completion.d"
|
|
|
|
cp "etc/hub.bash_completion.sh" "$out/etc/bash_completion.d/"
|
2015-01-04 00:28:38 +01:00
|
|
|
|
2018-05-30 14:44:47 +02:00
|
|
|
# Should we also install provided git-hooks?
|
|
|
|
# And fish completion?
|
2012-12-12 06:45:43 +01:00
|
|
|
'';
|
|
|
|
|
2015-01-04 00:28:38 +01: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 19:50:55 +02:00
|
|
|
platforms = with platforms; unix;
|
2012-12-12 06:45:43 +01:00
|
|
|
};
|
|
|
|
}
|