mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
49 lines
1.2 KiB
Nix
49 lines
1.2 KiB
Nix
{ stdenv, fetchgit, go, Security }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "hub-${version}";
|
|
version = "2.2.9";
|
|
|
|
src = fetchgit {
|
|
url = https://github.com/github/hub.git;
|
|
rev = "refs/tags/v${version}";
|
|
sha256 = "195ckp1idz2azv0mm1q258yjz2n51sia9xdcjnqlprmq9aig5ldh";
|
|
};
|
|
|
|
|
|
buildInputs = [ go ] ++ stdenv.lib.optional stdenv.isDarwin Security;
|
|
|
|
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
|
|
|
|
buildPhase = ''
|
|
patchShebangs .
|
|
sh script/build
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p "$out/bin"
|
|
cp bin/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"
|
|
|
|
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?
|
|
# ?
|
|
'';
|
|
|
|
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;
|
|
};
|
|
}
|