2016-06-17 11:34:17 +01:00
|
|
|
{stdenv, git, perl, ncurses, coreutils, fetchFromGitHub, makeWrapper, ...}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "diff-so-fancy";
|
2019-09-26 14:59:00 +01:00
|
|
|
version = "1.2.7";
|
2016-06-17 11:34:17 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "so-fancy";
|
|
|
|
repo = "diff-so-fancy";
|
|
|
|
rev = "v${version}";
|
2019-09-26 14:59:00 +01:00
|
|
|
sha256 = "0y5cp236gi6h7llzai5d27086l4zz58mz1zs01r97xnnmjs9vw21";
|
2016-06-17 11:34:17 +01:00
|
|
|
};
|
|
|
|
|
2017-04-02 21:22:32 +01:00
|
|
|
# Perl is needed here for patchShebangs
|
|
|
|
nativeBuildInputs = [ perl makeWrapper ];
|
|
|
|
|
2016-06-17 11:34:17 +01:00
|
|
|
buildPhase = null;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/lib/diff-so-fancy
|
|
|
|
|
|
|
|
# diff-so-fancy executable searches for it's library relative to
|
|
|
|
# itself, so we are copying executable to lib, and only symlink it
|
|
|
|
# from bin/
|
|
|
|
cp diff-so-fancy $out/lib/diff-so-fancy
|
2017-07-18 04:23:04 +01:00
|
|
|
cp -r lib $out/lib/diff-so-fancy
|
2016-06-17 11:34:17 +01:00
|
|
|
ln -s $out/lib/diff-so-fancy/diff-so-fancy $out/bin
|
|
|
|
|
|
|
|
# ncurses is needed for `tput`
|
|
|
|
wrapProgram $out/lib/diff-so-fancy/diff-so-fancy \
|
|
|
|
--prefix PATH : "${git}/share/git/contrib/diff-highlight" \
|
|
|
|
--prefix PATH : "${git}/bin" \
|
|
|
|
--prefix PATH : "${coreutils}/bin" \
|
|
|
|
--prefix PATH : "${ncurses.out}/bin"
|
|
|
|
'';
|
|
|
|
|
2017-04-02 21:22:32 +01:00
|
|
|
meta = with stdenv.lib; {
|
2016-06-17 11:34:17 +01:00
|
|
|
homepage = https://github.com/so-fancy/diff-so-fancy;
|
|
|
|
description = "Good-looking diffs filter for git";
|
2017-04-02 21:22:32 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
2016-06-17 11:34:17 +01:00
|
|
|
longDescription = ''
|
|
|
|
diff-so-fancy builds on the good-lookin' output of git contrib's
|
|
|
|
diff-highlight to upgrade your diffs' appearances.
|
|
|
|
'';
|
2019-08-20 18:36:05 +01:00
|
|
|
maintainers = with maintainers; [ fpletz globin ];
|
2016-06-17 11:34:17 +01:00
|
|
|
};
|
|
|
|
}
|