summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2017-09-20 00:47:37 +0200
committertv <tv@krebsco.de>2017-09-20 00:48:32 +0200
commita038ec100d480cb499366d64562369d3654895f7 (patch)
tree4e463fb6cb87949c38132d20aed613652af3aae0
parentf4a094d5d431a6f852b71e1c13cb9d8f32fcd590 (diff)
tv diff-so-fancy: init at ed8cf17
Based on nixpkgs 28dd1158ff18def37892677a9eef109ce5147b81
-rw-r--r--tv/5pkgs/default.nix4
-rw-r--r--tv/5pkgs/simple/diff-so-fancy.nix48
2 files changed, 52 insertions, 0 deletions
diff --git a/tv/5pkgs/default.nix b/tv/5pkgs/default.nix
index 8a7a613ba..1796609a9 100644
--- a/tv/5pkgs/default.nix
+++ b/tv/5pkgs/default.nix
@@ -24,6 +24,10 @@ foldl' mergeAttrs {}
"$@"
'';
+ gitAndTools = super.gitAndTools // {
+ inherit (self) diff-so-fancy;
+ };
+
ff = self.writeDashBin "ff" ''
exec ${self.firefoxWrapper}/bin/firefox "$@"
'';
diff --git a/tv/5pkgs/simple/diff-so-fancy.nix b/tv/5pkgs/simple/diff-so-fancy.nix
new file mode 100644
index 000000000..9ce6d9234
--- /dev/null
+++ b/tv/5pkgs/simple/diff-so-fancy.nix
@@ -0,0 +1,48 @@
+{stdenv, git, perl, ncurses, coreutils, fetchFromGitHub, makeWrapper, ...}:
+
+stdenv.mkDerivation rec {
+ name = "diff-so-fancy-${version}";
+ version = "ed8cf17";
+
+ src = fetchFromGitHub {
+ owner = "so-fancy";
+ repo = "diff-so-fancy";
+ rev = "ed8cf1763d38bdd79ceb55a73b9ce7e30f1e184d";
+ sha256 = "176qn0w2rn6mr5ymvkblyiznqq7yyibfsnnjfivcyhz69w6yr9r9";
+ };
+
+ # 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 ];
+ };
+}