2015-02-18 03:30:59 +00:00
|
|
|
{ stdenv, fetchgit, go, Security }:
|
2012-12-12 05:45:43 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "hub-${version}";
|
2017-01-10 01:10:18 +00:00
|
|
|
version = "2.2.9";
|
2012-12-12 05:45:43 +00:00
|
|
|
|
2015-01-03 23:28:38 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = https://github.com/github/hub.git;
|
|
|
|
rev = "refs/tags/v${version}";
|
2017-01-10 01:10:18 +00:00
|
|
|
sha256 = "195ckp1idz2azv0mm1q258yjz2n51sia9xdcjnqlprmq9aig5ldh";
|
2012-12-12 05:45:43 +00:00
|
|
|
};
|
|
|
|
|
2015-02-18 03:30:59 +00:00
|
|
|
|
|
|
|
buildInputs = [ go ] ++ stdenv.lib.optional stdenv.isDarwin Security;
|
2012-12-12 05:45:43 +00:00
|
|
|
|
2015-01-03 23:28:38 +00:00
|
|
|
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
2015-02-18 03:30:59 +00:00
|
|
|
patchShebangs .
|
2015-01-11 17:53:38 +00:00
|
|
|
sh script/build
|
2012-12-12 05:45:43 +00:00
|
|
|
'';
|
|
|
|
|
2015-01-03 23:28:38 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/bin"
|
2016-09-02 23:38:38 +01:00
|
|
|
cp bin/hub "$out/bin/"
|
2015-01-03 23:28:38 +00:00
|
|
|
|
|
|
|
mkdir -p "$out/share/man/man1"
|
|
|
|
cp "man/hub.1" "$out/share/man/man1/"
|
|
|
|
|
|
|
|
mkdir -p "$out/share/zsh/site-functions"
|
|
|
|
cp "etc/hub.zsh_completion" "$out/share/zsh/site-functions/_hub"
|
|
|
|
|
2016-09-22 08:26:58 +01:00
|
|
|
mkdir -p "$out/etc/bash_completion.d"
|
|
|
|
cp "etc/hub.bash_completion.sh" "$out/etc/bash_completion.d/"
|
2015-01-03 23:28:38 +00:00
|
|
|
|
|
|
|
# Should we also install provided git-hooks?
|
|
|
|
# ?
|
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
|
|
|
};
|
|
|
|
}
|