nixpkgs/pkgs/tools/compression/xdelta/default.nix
2016-01-11 18:35:50 +01:00

59 lines
1.3 KiB
Nix

{ stdenv, fetchFromGitHub, autoreconfHook
, lzmaSupport ? true, xz ? null
}:
assert lzmaSupport -> xz != null;
let
version = "3.0.11";
mkWith = flag: name: if flag
then "--with-${name}"
else "--without-${name}";
in stdenv.mkDerivation {
name = "xdelta-${version}";
src = fetchFromGitHub {
sha256 = "1c7xym7xr26phyf4wb9hh2w88ybzbzh2w3h1kyqq3da0ndidmf2r";
rev = "v${version}";
repo = "xdelta-devel";
owner = "jmacd";
};
nativeBuildInputs = [ autoreconfHook ];
buildInputs = []
++ stdenv.lib.optionals lzmaSupport [ xz ];
postPatch = ''
cd xdelta3
'';
configureFlags = [
(mkWith lzmaSupport "liblzma")
];
enableParallelBuilding = true;
doCheck = true;
checkPhase = ''
mkdir $PWD/tmp
for i in testing/file.h xdelta3-test.h; do
substituteInPlace $i --replace /tmp $PWD/tmp
done
./xdelta3regtest
'';
installPhase = ''
install -D -m755 xdelta3 $out/bin/xdelta3
install -D -m644 xdelta3.1 $out/share/man/man1/xdelta3.1
'';
meta = with stdenv.lib; {
inherit version;
description = "Binary differential compression in VCDIFF (RFC 3284) format";
homepage = http://xdelta.org/;
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ nckx ];
};
}