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

49 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchgit, go, Security }:
stdenv.mkDerivation rec {
name = "hub-${version}";
2016-09-22 07:26:58 +00:00
version = "2.2.8";
2015-01-03 23:28:38 +00:00
src = fetchgit {
url = https://github.com/github/hub.git;
rev = "refs/tags/v${version}";
2016-09-22 07:26:58 +00:00
sha256 = "1fv4jb9vsbkscnb79gss2mwnd1yf9jhgzw1mhimhx25xizbx1fck";
};
buildInputs = [ go ] ++ stdenv.lib.optional stdenv.isDarwin Security;
2015-01-03 23:28:38 +00:00
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
buildPhase = ''
patchShebangs .
sh script/build
'';
2015-01-03 23:28:38 +00:00
installPhase = ''
mkdir -p "$out/bin"
2016-09-02 22:38:38 +00: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 07:26:58 +00: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?
# ?
'';
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 ];
platforms = with platforms; unix;
};
}