bsdiff: adopt and clean up

Bonus: simpler build, and should fix the build of bsdiff for Darwin
(patch taken from homebrew).

Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
Austin Seipp
2014-03-28 18:52:37 -05:00
parent 3f577799af
commit 960690e931
3 changed files with 42 additions and 15 deletions
+30 -7
View File
@@ -1,14 +1,37 @@
{stdenv, fetchurl, bzip2}:
{ stdenv, fetchurl, bzip2 }:
stdenv.mkDerivation rec {
name = "bsdiff-${version}";
version = "4.3";
stdenv.mkDerivation {
name = "bsdiff-4.3";
builder = ./builder.sh;
src = fetchurl {
url = http://www.daemonology.net/bsdiff/bsdiff-4.3.tar.gz;
url = "http://www.daemonology.net/bsdiff/${name}.tar.gz";
sha256 = "0j2zm3z271x5aw63mwhr3vymzn45p2vvrlrpm9cz2nywna41b0hq";
};
buildInputs = [ bzip2 ];
patchPhase = ''
sed 's/^\.//g' -i Makefile
patches = [ ./include-systypes.patch ];
buildPhase = ''
cc -O3 -lbz2 bspatch.c -o bspatch
cc -O3 -lbz2 bsdiff.c -o bsdiff
'';
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/man/man1
cp bsdiff $out/bin
cp bspatch $out/bin
cp bsdiff.1 $out/share/man/man1
cp bspatch.1 $out/share/man/man1
'';
meta = {
description = "An efficient binary diff/patch tool";
homepage = "http://www.daemonology.net/bsdiff";
license = stdenv.lib.licenses.bsd2;
platforms = stdenv.lib.platforms.unix;
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
};
}