Wrap 'tig' command to add with git to PATH.

This ensures that git is added as a run-time dependency of tig and
allows tig to find the git command even if git is not installed in the
user environment. Fixes #5741.
This commit is contained in:
Robert Helgesson 2015-01-13 22:51:04 +01:00
parent 07966befee
commit db01e50f6a
2 changed files with 8 additions and 5 deletions

View File

@ -68,9 +68,7 @@ rec {
inherit stdenv fetchurl; inherit stdenv fetchurl;
}; };
tig = import ./tig { tig = callPackage ./tig { };
inherit stdenv fetchurl ncurses asciidoc xmlto docbook_xsl docbook_xml_dtd_45 readline;
};
hub = import ./hub { hub = import ./hub {
inherit go; inherit go;

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, ncurses, asciidoc, xmlto, docbook_xsl, docbook_xml_dtd_45 { stdenv, fetchurl, ncurses, asciidoc, xmlto, docbook_xsl, docbook_xml_dtd_45
, readline , readline, makeWrapper, git
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -11,17 +11,22 @@ stdenv.mkDerivation rec {
}; };
buildInputs = [ ncurses asciidoc xmlto docbook_xsl readline ]; buildInputs = [ ncurses asciidoc xmlto docbook_xsl readline git makeWrapper ];
preConfigure = '' preConfigure = ''
export XML_CATALOG_FILES='${docbook_xsl}/xml/xsl/docbook/catalog.xml ${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml' export XML_CATALOG_FILES='${docbook_xsl}/xml/xsl/docbook/catalog.xml ${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml'
''; '';
enableParallelBuilding = true;
installPhase = '' installPhase = ''
make install make install
make install-doc make install-doc
mkdir -p $out/etc/bash_completion.d/ mkdir -p $out/etc/bash_completion.d/
cp contrib/tig-completion.bash $out/etc/bash_completion.d/ cp contrib/tig-completion.bash $out/etc/bash_completion.d/
wrapProgram $out/bin/tig \
--prefix PATH ':' "${git}/bin"
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {