1 {lib, stdenv, git, perl, ncurses, coreutils, fetchFromGitHub, makeWrapper, ...}:
3 stdenv.mkDerivation rec {
4 pname = "diff-so-fancy";
7 src = fetchFromGitHub {
9 repo = "diff-so-fancy";
11 sha256 = "sha256-yF+LI1lsE1qwOc3u7mtc+uu0N/8m4bZD5qP+xFraaTI=";
19 perl # needed for patchShebangs
27 mkdir -p $out/bin $out/lib/diff-so-fancy
29 # diff-so-fancy executable searches for it's library relative to
30 # itself, so we are copying executable to lib, and only symlink it
32 cp diff-so-fancy $out/lib/diff-so-fancy
33 cp -r lib $out/lib/diff-so-fancy
34 ln -s $out/lib/diff-so-fancy/diff-so-fancy $out/bin
36 # ncurses is needed for `tput`
37 wrapProgram $out/lib/diff-so-fancy/diff-so-fancy \
38 --prefix PATH : "${git}/share/git/contrib/diff-highlight" \
39 --prefix PATH : "${git}/bin" \
40 --prefix PATH : "${coreutils}/bin" \
41 --prefix PATH : "${ncurses.out}/bin"
47 homepage = "https://github.com/so-fancy/diff-so-fancy";
48 description = "Good-looking diffs filter for git";
49 license = licenses.mit;
50 platforms = platforms.all;
52 diff-so-fancy builds on the good-lookin' output of git contrib's
53 diff-highlight to upgrade your diffs' appearances.
55 maintainers = with maintainers; [ fpletz ma27 ];
56 mainProgram = "diff-so-fancy";