-
-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16290 from binarin/init-diff-so-fancy
diff-so-fancy: init at 0.9.3
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
pkgs/applications/version-management/git-and-tools/diff-so-fancy/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{stdenv, git, perl, ncurses, coreutils, fetchFromGitHub, makeWrapper, ...}: | ||
|
||
stdenv.mkDerivation rec { | ||
name = "diff-so-fancy-${version}"; | ||
version = "0.9.3"; | ||
|
||
# perl is needed here so patchShebangs can do its job | ||
buildInputs = [perl makeWrapper]; | ||
|
||
src = fetchFromGitHub { | ||
owner = "so-fancy"; | ||
repo = "diff-so-fancy"; | ||
rev = "v${version}"; | ||
sha256 = "0b5k54h3l4z81p6f7n14g2r5vz7qdyyrbql0z7rwhb7sw7s7zrgx"; | ||
}; | ||
|
||
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 = { | ||
homepage = https://github.com/so-fancy/diff-so-fancy; | ||
description = "Good-looking diffs filter for git"; | ||
license = stdenv.lib.licenses.mit; | ||
|
||
longDescription = '' | ||
diff-so-fancy builds on the good-lookin' output of git contrib's | ||
diff-highlight to upgrade your diffs' appearances. | ||
''; | ||
|
||
platforms = stdenv.lib.platforms.all; | ||
}; | ||
} |