2021-01-10 23:54:33 -08:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ncurses, asciidoc, xmlto, docbook_xsl, docbook_xml_dtd_45
|
2021-01-18 22:50:56 -08:00
|
|
|
, readline, makeWrapper, git, libiconv, autoreconfHook, findXMLCatalogs, pkg-config
|
2014-05-25 04:28:06 -07:00
|
|
|
}:
|
2012-08-07 15:49:12 -07:00
|
|
|
|
2012-11-16 17:13:25 -08:00
|
|
|
stdenv.mkDerivation rec {
|
2017-04-10 06:03:04 -07:00
|
|
|
pname = "tig";
|
2020-04-09 13:23:31 -07:00
|
|
|
version = "2.5.1";
|
2017-04-10 06:03:04 -07:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jonas";
|
|
|
|
repo = pname;
|
2019-08-15 05:41:18 -07:00
|
|
|
rev = "${pname}-${version}";
|
2020-04-09 13:23:31 -07:00
|
|
|
sha256 = "0wxcbfqsk8p84zizy6lf3gp5j122wrf8c7xlipki6nhcfhksn33b";
|
2012-08-07 15:49:12 -07:00
|
|
|
};
|
2013-11-09 10:06:55 -08:00
|
|
|
|
2021-01-18 22:50:56 -08:00
|
|
|
nativeBuildInputs = [ makeWrapper autoreconfHook asciidoc xmlto docbook_xsl docbook_xml_dtd_45 findXMLCatalogs pkg-config ];
|
2017-04-10 06:03:04 -07:00
|
|
|
|
|
|
|
autoreconfFlags = "-I tools -v";
|
|
|
|
|
|
|
|
buildInputs = [ ncurses readline git ]
|
2021-01-15 05:21:58 -08:00
|
|
|
++ lib.optionals stdenv.isDarwin [ libiconv ];
|
2013-11-09 10:06:55 -08:00
|
|
|
|
2017-04-10 06:03:04 -07:00
|
|
|
# those files are inherently impure, we'll handle the corresponding dependencies.
|
|
|
|
postPatch = ''
|
|
|
|
rm -f contrib/config.make-*
|
2013-11-09 10:03:16 -08:00
|
|
|
'';
|
2013-11-09 10:06:55 -08:00
|
|
|
|
2015-01-13 13:51:04 -08:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2012-08-07 15:49:12 -07:00
|
|
|
installPhase = ''
|
|
|
|
make install
|
|
|
|
make install-doc
|
2018-09-23 10:36:22 -07:00
|
|
|
|
2020-04-13 23:51:32 -07:00
|
|
|
# fixes tig-completion __git-complete dependency
|
|
|
|
sed -i '1s;^;source ${git}/share/bash-completion/completions/git\n;' contrib/tig-completion.bash
|
|
|
|
|
|
|
|
install -D contrib/tig-completion.bash $out/share/bash-completion/completions/tig
|
2018-07-11 00:08:52 -07:00
|
|
|
cp contrib/vim.tigrc $out/etc/
|
2015-01-13 13:51:04 -08:00
|
|
|
|
2020-07-31 11:41:04 -07:00
|
|
|
# Note: Until https://github.com/jonas/tig/issues/940 is resolved it is best
|
|
|
|
# not to install the ZSH completion so that the fallback implemenation from
|
|
|
|
# ZSH can be used (Completion/Unix/Command/_git: "_tig () { _git-log }"):
|
|
|
|
#install -D contrib/tig-completion.zsh $out/share/zsh/site-functions/_tig
|
|
|
|
|
2015-01-13 13:51:04 -08:00
|
|
|
wrapProgram $out/bin/tig \
|
|
|
|
--prefix PATH ':' "${git}/bin"
|
2012-08-07 15:49:12 -07:00
|
|
|
'';
|
2013-11-09 10:06:55 -08:00
|
|
|
|
2021-01-10 23:54:33 -08:00
|
|
|
meta = with lib; {
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://jonas.github.io/tig/";
|
2013-11-09 10:06:55 -08:00
|
|
|
description = "Text-mode interface for git";
|
2019-08-20 10:36:05 -07:00
|
|
|
maintainers = with maintainers; [ bjornfor domenkozar qknight globin ];
|
2013-05-20 10:33:18 -07:00
|
|
|
license = licenses.gpl2;
|
2014-04-12 09:37:45 -07:00
|
|
|
platforms = platforms.unix;
|
2012-08-07 15:49:12 -07:00
|
|
|
};
|
|
|
|
}
|