summary refs log tree commit diff
path: root/pkgs/tools/compression
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2016-01-11 18:34:21 +0100
committerTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2016-01-11 20:34:36 +0100
commit6aa786d1d602b4bfb5b8bff1caf0739aec71db95 (patch)
treedaaaee1daf0b6030ef761d3cd9bba464b0d7fa72 /pkgs/tools/compression
parent823f797c2678c8057db1ad0dd1f91a09adbd2151 (diff)
downloadnixlib-6aa786d1d602b4bfb5b8bff1caf0739aec71db95.tar
nixlib-6aa786d1d602b4bfb5b8bff1caf0739aec71db95.tar.gz
nixlib-6aa786d1d602b4bfb5b8bff1caf0739aec71db95.tar.bz2
nixlib-6aa786d1d602b4bfb5b8bff1caf0739aec71db95.tar.lz
nixlib-6aa786d1d602b4bfb5b8bff1caf0739aec71db95.tar.xz
nixlib-6aa786d1d602b4bfb5b8bff1caf0739aec71db95.tar.zst
nixlib-6aa786d1d602b4bfb5b8bff1caf0739aec71db95.zip
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.”
Diffstat (limited to 'pkgs/tools/compression')
-rw-r--r--pkgs/tools/compression/xdelta/default.nix2
-rw-r--r--pkgs/tools/compression/xdelta/unstable.nix62
2 files changed, 63 insertions, 1 deletions
diff --git a/pkgs/tools/compression/xdelta/default.nix b/pkgs/tools/compression/xdelta/default.nix
index 54e04d303d66..84ccde3fd37d 100644
--- a/pkgs/tools/compression/xdelta/default.nix
+++ b/pkgs/tools/compression/xdelta/default.nix
@@ -11,7 +11,7 @@ let
     else "--without-${name}";
 in stdenv.mkDerivation {
   name = "xdelta-${version}";
-  
+
   src = fetchFromGitHub {
     sha256 = "1c7xym7xr26phyf4wb9hh2w88ybzbzh2w3h1kyqq3da0ndidmf2r";
     rev = "v${version}";
diff --git a/pkgs/tools/compression/xdelta/unstable.nix b/pkgs/tools/compression/xdelta/unstable.nix
new file mode 100644
index 000000000000..8637463dfc0d
--- /dev/null
+++ b/pkgs/tools/compression/xdelta/unstable.nix
@@ -0,0 +1,62 @@
+{ 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 ];
+  };
+}