1{ stdenv, fetchurl, bzip2 }:
2
3stdenv.mkDerivation rec {
4 name = "bsdiff-${version}";
5 version = "4.3";
6
7 src = fetchurl {
8 url = "http://www.daemonology.net/bsdiff/${name}.tar.gz";
9 sha256 = "0j2zm3z271x5aw63mwhr3vymzn45p2vvrlrpm9cz2nywna41b0hq";
10 };
11
12 buildInputs = [ bzip2 ];
13 patches = [ ./include-systypes.patch ];
14
15 buildPhase = ''
16 cc -O3 -lbz2 bspatch.c -o bspatch
17 cc -O3 -lbz2 bsdiff.c -o bsdiff
18 '';
19
20 installPhase = ''
21 mkdir -p $out/bin
22 mkdir -p $out/share/man/man1
23
24 cp bsdiff $out/bin
25 cp bspatch $out/bin
26 cp bsdiff.1 $out/share/man/man1
27 cp bspatch.1 $out/share/man/man1
28 '';
29
30 meta = {
31 description = "An efficient binary diff/patch tool";
32 homepage = "http://www.daemonology.net/bsdiff";
33 license = stdenv.lib.licenses.bsd2;
34 platforms = stdenv.lib.platforms.unix;
35 maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
36 };
37}