2021-01-11 07:54:33 +00:00
|
|
|
{lib, stdenv, git, perl, ncurses, coreutils, fetchFromGitHub, makeWrapper, ...}:
|
2016-06-17 11:34:17 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "diff-so-fancy";
|
2021-07-29 17:17:29 +01:00
|
|
|
version = "1.4.3";
|
2016-06-17 11:34:17 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "so-fancy";
|
|
|
|
repo = "diff-so-fancy";
|
|
|
|
rev = "v${version}";
|
2021-07-29 17:17:29 +01:00
|
|
|
sha256 = "sha256-/xdBvq2u1s5/yzjwr3MLxpaD1CNktcPijXJTKW3Bc4c=";
|
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
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with 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.
|
|
|
|
'';
|
2021-06-14 21:36:43 +01:00
|
|
|
maintainers = with maintainers; [ fpletz globin ma27 ];
|
2016-06-17 11:34:17 +01:00
|
|
|
};
|
|
|
|
}
|