1 { lib, stdenv, fetchFromGitHub, autoreconfHook
2 , lzmaSupport ? true, xz ? null
5 assert lzmaSupport -> xz != null;
8 mkWith = flag: name: if flag
10 else "--without-${name}";
11 in stdenv.mkDerivation rec {
15 src = fetchFromGitHub {
16 sha256 = "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy";
18 repo = "xdelta-devel";
22 nativeBuildInputs = [ autoreconfHook ];
24 ++ lib.optionals lzmaSupport [ xz ];
29 substituteInPlace Makefile.am --replace \
31 "common_CFLAGS = -DXD3_USE_LARGESIZET=1"
35 (mkWith lzmaSupport "liblzma")
38 enableParallelBuilding = true;
43 for i in testing/file.h xdelta3-test.h; do
44 substituteInPlace $i --replace /tmp $PWD/tmp
50 install -D -m755 xdelta3 $out/bin/xdelta3
51 install -D -m644 xdelta3.1 $out/share/man/man1/xdelta3.1
55 description = "Binary differential compression in VCDIFF (RFC 3284) format";
57 xdelta is a command line program for delta encoding, which generates two
58 file differences. This is similar to diff and patch, but it is targeted
59 for binary files and does not generate human readable output.
61 homepage = "http://xdelta.org/";
62 license = licenses.gpl2Plus;
63 mainProgram = "xdelta3";
64 platforms = platforms.linux;