nixpkgs-suyu/pkgs/tools/compression/xdelta/default.nix

62 lines
1.5 KiB
Nix
Raw Normal View History

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