Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions pkgs/applications/version-management/git-and-tools/hub/default.nix
Original file line number Diff line number Diff line change
@@ -1,38 +1,35 @@
{ stdenv, fetchgit, go, ronn, groff, utillinux, Security }:
{ stdenv, buildGoPackage, fetchFromGitHub, go, ronn, ruby, groff, Security, utillinux }:

stdenv.mkDerivation rec {
buildGoPackage rec {
name = "hub-${version}";
version = "2.4.0";

src = fetchgit {
url = https://github.com/github/hub.git;
rev = "refs/tags/v${version}";
goPackagePath = "github.com/github/hub";

src = fetchFromGitHub {
owner = "github";
repo = "hub";
rev = "v${version}";
sha256 = "1lr6vg0zhg2air9bnzcl811g97jraxq05l3cs46wqqflwy57xpz2";
};

buildInputs = [ groff ronn ruby utillinux ] ++
stdenv.lib.optional stdenv.isDarwin Security;

buildInputs = [ go ronn groff utillinux ]
++ stdenv.lib.optional stdenv.isDarwin Security;

buildPhase = ''
postPatch = ''
mkdir bin
ln -s ${ronn}/bin/ronn bin/ronn

patchShebangs .
make all man-pages
'';

installPhase = ''
prefix=$out sh -x < script/install.sh

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/"
postInstall = ''
cd go/src/${goPackagePath}
install -D etc/hub.zsh_completion "$bin/share/zsh/site-functions/_hub"
install -D etc/hub.bash_completion.sh "$bin/etc/bash_completion.d/hub.bash_completion.sh"
install -D etc/hub.fish_completion "$bin/share/fish/vendor_completions.d/hub.fish"

# Should we also install provided git-hooks?
# And fish completion?
make man-pages
cp -r share/man $bin/share/man
'';

meta = with stdenv.lib; {
Expand Down