2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook
|
2016-01-11 16:20:40 +00:00
|
|
|
, lzmaSupport ? true, xz ? null
|
|
|
|
}:
|
2010-11-28 16:37:48 +00:00
|
|
|
|
2016-01-11 16:20:40 +00:00
|
|
|
assert lzmaSupport -> xz != null;
|
|
|
|
|
|
|
|
let
|
|
|
|
mkWith = flag: name: if flag
|
|
|
|
then "--with-${name}"
|
|
|
|
else "--without-${name}";
|
2016-01-25 19:08:34 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "xdelta";
|
2020-01-26 13:51:08 +00:00
|
|
|
version = "3.1.0";
|
2016-01-11 17:34:21 +00:00
|
|
|
|
2015-04-16 21:25:24 +00:00
|
|
|
src = fetchFromGitHub {
|
2020-01-26 13:51:08 +00:00
|
|
|
sha256 = "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy";
|
2015-04-16 21:25:24 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
repo = "xdelta-devel";
|
|
|
|
owner = "jmacd";
|
2010-11-28 16:37:48 +00:00
|
|
|
};
|
|
|
|
|
2015-06-17 17:36:06 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
2016-01-11 16:20:40 +00:00
|
|
|
buildInputs = []
|
2021-01-15 09:19:50 +00:00
|
|
|
++ lib.optionals lzmaSupport [ xz ];
|
2010-11-28 16:37:48 +00:00
|
|
|
|
2015-04-16 21:25:24 +00:00
|
|
|
postPatch = ''
|
|
|
|
cd xdelta3
|
|
|
|
'';
|
|
|
|
|
2016-01-11 16:20:40 +00:00
|
|
|
configureFlags = [
|
|
|
|
(mkWith lzmaSupport "liblzma")
|
|
|
|
];
|
|
|
|
|
2015-04-16 21:25:24 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
2015-08-02 20:03:26 +00:00
|
|
|
mkdir $PWD/tmp
|
|
|
|
for i in testing/file.h xdelta3-test.h; do
|
|
|
|
substituteInPlace $i --replace /tmp $PWD/tmp
|
|
|
|
done
|
2015-04-16 21:25:24 +00:00
|
|
|
./xdelta3regtest
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -D -m755 xdelta3 $out/bin/xdelta3
|
|
|
|
install -D -m644 xdelta3.1 $out/share/man/man1/xdelta3.1
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-04-16 21:25:24 +00:00
|
|
|
description = "Binary differential compression in VCDIFF (RFC 3284) format";
|
2016-01-11 17:40:02 +00: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 01:11:51 +00:00
|
|
|
homepage = "http://xdelta.org/";
|
2015-05-28 17:20:29 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2021-05-26 20:00:06 +00:00
|
|
|
platforms = platforms.unix;
|
2010-11-28 16:37:48 +00:00
|
|
|
};
|
|
|
|
}
|