2021-01-11 07:54:33 +00:00
|
|
|
{lib, stdenv, git, perl, ncurses, coreutils, fetchFromGitHub, makeWrapper, ...}:
|
2016-06-17 10:34:17 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "diff-so-fancy";
|
2023-06-10 04:46:13 +00:00
|
|
|
version = "1.4.4";
|
2016-06-17 10:34:17 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "so-fancy";
|
|
|
|
repo = "diff-so-fancy";
|
|
|
|
rev = "v${version}";
|
2023-06-10 04:46:13 +00:00
|
|
|
sha256 = "sha256-yF+LI1lsE1qwOc3u7mtc+uu0N/8m4bZD5qP+xFraaTI=";
|
2016-06-17 10:34:17 +00:00
|
|
|
};
|
|
|
|
|
2020-08-21 15:21:42 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
2017-04-02 20:22:32 +00:00
|
|
|
|
2020-08-21 15:21:42 +00:00
|
|
|
buildInputs = [
|
|
|
|
perl # needed for patchShebangs
|
|
|
|
];
|
|
|
|
|
|
|
|
dontBuild = true;
|
2016-06-17 10:34:17 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2020-08-21 15:21:42 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2016-06-17 10:34:17 +00: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 03:23:04 +00:00
|
|
|
cp -r lib $out/lib/diff-so-fancy
|
2016-06-17 10:34:17 +00: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 15:21:42 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2016-06-17 10:34:17 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/so-fancy/diff-so-fancy";
|
2016-06-17 10:34:17 +00:00
|
|
|
description = "Good-looking diffs filter for git";
|
2017-04-02 20:22:32 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
2016-06-17 10:34:17 +00: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 20:36:43 +00:00
|
|
|
maintainers = with maintainers; [ fpletz globin ma27 ];
|
2016-06-17 10:34:17 +00:00
|
|
|
};
|
|
|
|
}
|