nixpkgs/pkgs/tools/compression/xdelta/unstable.nix
Tobias Geerinckx-Rice 6aa786d1d6 xdeltaUnstable: init at 3.1.0
This will eventually become the new stable branch (as unstable ones
are wont to do), but is worth having if you want to patch yesterday's
‘large’ files today, or need to apply patches already created with it.

“First release of the 3.1.x series. This is taken from the
"64bithash" branch.

- Adds support for -B values greater than 2GB, enabled by
  -DXD3_USE_LARGESIZET=1 variable. [Enabled in nixpkgs.]
- Adds new performance and speed regression test, written in #Golang.
  [Not enabled in nixpkgs.]

When compiled for large sizes, xdelta3 uses a 64bit checksum function.
This impacts both compression and speed.

Relative to 3.0.11, the new branch is currently 3-5% slower and
has 1-2% worse compression. Performance will be addressed in
future 3.1.x releases.”
2016-01-11 20:34:36 +01:00

62 lines
1.4 KiB
Nix

{ stdenv, fetchFromGitHub, autoreconfHook
, lzmaSupport ? true, xz ? null
}:
assert lzmaSupport -> xz != null;
let
version = "3.1.0";
mkWith = flag: name: if flag
then "--with-${name}"
else "--without-${name}";
in stdenv.mkDerivation {
name = "xdelta-${version}";
src = fetchFromGitHub {
sha256 = "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy";
rev = "v${version}";
repo = "xdelta-devel";
owner = "jmacd";
};
nativeBuildInputs = [ autoreconfHook ];
buildInputs = []
++ stdenv.lib.optionals lzmaSupport [ xz ];
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
'';
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 ];
};
}