From 6906e5c1494b0134748dc73ebb7a02e0ab2c7ff6 Mon Sep 17 00:00:00 2001 From: Jörg Thalheim Date: Thu, 21 Jun 2018 23:12:52 +0100 Subject: gitAndTools.hub: remove go compiler from runtime closure --- .../git-and-tools/hub/default.nix | 39 ++++++++++------------ 1 file changed, 18 insertions(+), 21 deletions(-) (limited to 'pkgs/applications/version-management') diff --git a/pkgs/applications/version-management/git-and-tools/hub/default.nix b/pkgs/applications/version-management/git-and-tools/hub/default.nix index 1a6e8bc56f40..c9f666390b55 100644 --- a/pkgs/applications/version-management/git-and-tools/hub/default.nix +++ b/pkgs/applications/version-management/git-and-tools/hub/default.nix @@ -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; { -- cgit 1.4.1