nixpkgs/pkgs/applications/version-management/git-and-tools/hub/default.nix

47 lines
1.1 KiB
Nix
Raw Normal View History

2018-05-30 14:44:47 +02:00
{ stdenv, fetchgit, go, ronn, groff, utillinux, Security }:
stdenv.mkDerivation rec {
name = "hub-${version}";
2018-05-30 14:44:47 +02:00
version = "2.3.0";
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";
};
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
patchShebangs .
2018-05-30 14:44:47 +02:00
make all man-pages
'';
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?
'';
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 ];
platforms = with platforms; unix;
};
}