2015-02-18 04:30:59 +01:00
|
|
|
{ stdenv, fetchgit, go, Security }:
|
2012-12-12 06:45:43 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "hub-${version}";
|
2015-04-16 09:25:25 +02:00
|
|
|
version = "2.2.1";
|
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}";
|
2015-04-16 09:25:25 +02:00
|
|
|
sha256 = "1rklqm5b0n5rcbdsr6kvk24cw7dc505ylb1608fva7qman49vlls";
|
2012-12-12 06:45:43 +01:00
|
|
|
};
|
|
|
|
|
2015-02-18 04:30:59 +01:00
|
|
|
|
|
|
|
buildInputs = [ go ] ++ stdenv.lib.optional stdenv.isDarwin Security;
|
2012-12-12 06:45:43 +01:00
|
|
|
|
2015-01-04 00:28:38 +01:00
|
|
|
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
2015-02-18 04:30:59 +01:00
|
|
|
patchShebangs .
|
2015-01-11 18:53:38 +01:00
|
|
|
sh script/build
|
2012-12-12 06:45:43 +01:00
|
|
|
'';
|
|
|
|
|
2015-01-04 00:28:38 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
cp hub "$out/bin/"
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
# Broken: https://github.com/github/hub/issues/592
|
|
|
|
# mkdir -p "$out/etc/bash_completion.d"
|
|
|
|
# cp "etc/hub.bash_completion.sh" "$out/etc/bash_completion.d/"
|
|
|
|
|
|
|
|
# Should we also install provided git-hooks?
|
|
|
|
# ?
|
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 ];
|
2012-12-12 06:45:43 +01:00
|
|
|
};
|
|
|
|
}
|