Skip to content

Commit

Permalink
Merge pull request #42354 from Mic92/hub
Browse files Browse the repository at this point in the history
gitAndTools.hub: remove go compiler from runtime closure
  • Loading branch information
Mic92 authored Jun 21, 2018
2 parents fe948fd + 6906e5c commit 4756e6f
Showing 1 changed file with 18 additions and 21 deletions.
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

0 comments on commit 4756e6f

Please sign in to comment.