summary refs log tree commit diff
path: root/pkgs/tools/text/colordiff/default.nix
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2021-02-12 05:01:54 +0100
committerSandro Jäckel <sandro.jaeckel@gmail.com>2021-02-12 20:35:42 +0100
commitca45892b9f32453206097a5ed5507ac63774c352 (patch)
tree94a44603f623bb3979852945581db5f944ca2599 /pkgs/tools/text/colordiff/default.nix
parent39125d0a088c4e1cc6d119d6fc9bf71380fb3e17 (diff)
downloadnixpkgs-ca45892b9f32453206097a5ed5507ac63774c352.tar
nixpkgs-ca45892b9f32453206097a5ed5507ac63774c352.tar.gz
nixpkgs-ca45892b9f32453206097a5ed5507ac63774c352.tar.bz2
nixpkgs-ca45892b9f32453206097a5ed5507ac63774c352.tar.lz
nixpkgs-ca45892b9f32453206097a5ed5507ac63774c352.tar.xz
nixpkgs-ca45892b9f32453206097a5ed5507ac63774c352.tar.zst
nixpkgs-ca45892b9f32453206097a5ed5507ac63774c352.zip
colordiff: build from source, cleanup, take maintainership
Diffstat (limited to 'pkgs/tools/text/colordiff/default.nix')
-rw-r--r--pkgs/tools/text/colordiff/default.nix36
1 files changed, 23 insertions, 13 deletions
diff --git a/pkgs/tools/text/colordiff/default.nix b/pkgs/tools/text/colordiff/default.nix
index 04d41b74db0..364d3c6edc4 100644
--- a/pkgs/tools/text/colordiff/default.nix
+++ b/pkgs/tools/text/colordiff/default.nix
@@ -1,26 +1,36 @@
-{ lib, stdenv, fetchurl, perl /*, xmlto */}:
+{ lib, stdenv, fetchFromGitHub, docbook_xml_dtd_412, docbook_xsl, perl, w3m, xmlto }:
 
 stdenv.mkDerivation rec {
-  name = "colordiff-1.0.19";
+  pname = "colordiff";
+  version = "1.0.19";
 
-  src = fetchurl {
-    urls = [
-      "https://www.colordiff.org/${name}.tar.gz"
-      "http://www.colordiff.org/archive/${name}.tar.gz"
-    ];
-    sha256 = "069vzzgs7b44bmfh3ks2psrdb26s1w19gp9w4xxbgi7nhx6w3s26";
+  src = fetchFromGitHub {
+    owner = "daveewart";
+    repo = "colordiff";
+    rev = "v${version}";
+    sha256 = "1v7s1yn0qvn08iwm5js8mxn442392qyr7s9ij506byfd497ag7qk";
   };
 
-  buildInputs = [ perl /* xmlto */ ];
+  nativeBuildInputs = [ docbook_xml_dtd_412 docbook_xsl perl w3m xmlto ];
 
-  dontBuild = 1; # do not build doc yet.
+  buildInputs = [ perl ];
 
-  installPhase = ''make INSTALL_DIR=/bin MAN_DIR=/share/man/man1 DESTDIR="$out" install'';
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace 'TMPDIR=colordiff-''${VERSION}' ""
+  '';
+
+  installFlags = [
+    "INSTALL_DIR=/bin"
+    "MAN_DIR=/share/man/man1"
+    "DESTDIR=${placeholder "out"}"
+  ];
 
   meta = with lib; {
     description = "Wrapper for 'diff' that produces the same output but with pretty 'syntax' highlighting";
     homepage = "https://www.colordiff.org/";
-    license = licenses.gpl3;
-    platforms = platforms.linux ++ platforms.darwin;
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ SuperSandro2000 ];
   };
 }