depot/third_party/nixpkgs/pkgs/tools/compression/bsdiff/default.nix
Default email 21cecf6002 Project import generated by Copybara.
GitOrigin-RevId: dd14e5d78e90a2ccd6007e569820de9b4861a6c2
2021-07-24 08:14:16 -04:00

37 lines
900 B
Nix

{ lib, stdenv, fetchurl, bzip2 }:
stdenv.mkDerivation rec {
pname = "bsdiff";
version = "4.3";
src = fetchurl {
url = "https://www.daemonology.net/bsdiff/${pname}-${version}.tar.gz";
sha256 = "0j2zm3z271x5aw63mwhr3vymzn45p2vvrlrpm9cz2nywna41b0hq";
};
buildInputs = [ bzip2 ];
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 = with lib; {
description = "An efficient binary diff/patch tool";
homepage = "https://www.daemonology.net/bsdiff/";
license = licenses.bsd2;
platforms = platforms.unix;
maintainers = [ maintainers.thoughtpolice ];
};
}