2021-01-11 10:54:33 +03:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook
|
2016-01-11 20:34:21 +03:00
|
|
|
, lzmaSupport ? true, xz ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert lzmaSupport -> xz != null;
|
|
|
|
|
|
|
|
let
|
|
|
|
mkWith = flag: name: if flag
|
|
|
|
then "--with-${name}"
|
|
|
|
else "--without-${name}";
|
2016-01-25 22:08:34 +03:00
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 15:41:18 +03:00
|
|
|
pname = "xdelta";
|
2016-01-25 22:08:34 +03:00
|
|
|
version = "3.1.0";
|
2016-01-11 20:34:21 +03:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
sha256 = "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy";
|
|
|
|
rev = "v${version}";
|
|
|
|
repo = "xdelta-devel";
|
|
|
|
owner = "jmacd";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
buildInputs = []
|
2021-01-15 12:19:50 +03:00
|
|
|
++ lib.optionals lzmaSupport [ xz ];
|
2016-01-11 20:34:21 +03:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
cd xdelta3
|
|
|
|
|
|
|
|
substituteInPlace Makefile.am --replace \
|
|
|
|
"common_CFLAGS =" \
|
|
|
|
"common_CFLAGS = -DXD3_USE_LARGESIZET=1"
|
|
|
|
'';
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-11 10:54:33 +03:00
|
|
|
meta = with lib; {
|
2016-01-11 20:34:21 +03:00
|
|
|
description = "Binary differential compression in VCDIFF (RFC 3284) format";
|
2016-01-11 20:40:02 +03:00
|
|
|
longDescription = ''
|
|
|
|
xdelta is a command line program for delta encoding, which generates two
|
|
|
|
file differences. This is similar to diff and patch, but it is targeted
|
|
|
|
for binary files and does not generate human readable output.
|
|
|
|
'';
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "http://xdelta.org/";
|
2016-01-11 20:34:21 +03:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|