3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/version-management/git-and-tools/diff-so-fancy/default.nix
R. RyanTM ea356329ca gitAndTools.diff-so-fancy: 1.2.6 -> 1.2.7
Semi-automatic update generated by
https://github.com/ryantm/nixpkgs-update tools. This update was made
based on information from
https://repology.org/metapackage/diff-so-fancy/versions
2019-09-26 06:59:00 -07:00

49 lines
1.5 KiB
Nix

{stdenv, git, perl, ncurses, coreutils, fetchFromGitHub, makeWrapper, ...}:
stdenv.mkDerivation rec {
pname = "diff-so-fancy";
version = "1.2.7";
src = fetchFromGitHub {
owner = "so-fancy";
repo = "diff-so-fancy";
rev = "v${version}";
sha256 = "0y5cp236gi6h7llzai5d27086l4zz58mz1zs01r97xnnmjs9vw21";
};
# Perl is needed here for patchShebangs
nativeBuildInputs = [ perl makeWrapper ];
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
cp -r lib $out/lib/diff-so-fancy
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"
'';
meta = with stdenv.lib; {
homepage = https://github.com/so-fancy/diff-so-fancy;
description = "Good-looking diffs filter for git";
license = licenses.mit;
platforms = platforms.all;
longDescription = ''
diff-so-fancy builds on the good-lookin' output of git contrib's
diff-highlight to upgrade your diffs' appearances.
'';
maintainers = with maintainers; [ fpletz globin ];
};
}