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";
|
2020-04-24 20:39:08 +01:00
|
|
|
version = "1.3.0";
|
2016-06-17 11:34:17 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "so-fancy";
|
|
|
|
repo = "diff-so-fancy";
|
|
|
|
rev = "v${version}";
|
2020-04-24 20:39:08 +01:00
|
|
|
sha256 = "0aavxahzha2mms4vdwysk79pa6wzswpfwgsq2hwaxnaf66maahfl";
|
2016-06-17 11:34:17 +01:00
|
|
|
};
|
|
|
|
|
2020-08-21 16:21:42 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
2017-04-02 21:22:32 +01:00
|
|
|
|
2020-08-21 16:21:42 +01:00
|
|
|
buildInputs = [
|
|
|
|
perl # needed for patchShebangs
|
|
|
|
];
|
|
|
|
|
|
|
|
dontBuild = true;
|
2016-06-17 11:34:17 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
2020-08-21 16:21:42 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
2016-06-17 11:34:17 +01:00
|
|
|
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"
|
2020-08-21 16:21:42 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
2016-06-17 11:34:17 +01:00
|
|
|
'';
|
|
|
|
|
2017-04-02 21:22:32 +01:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/so-fancy/diff-so-fancy";
|
2016-06-17 11:34:17 +01:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|