1.6 KiB
bsdiff
This is a clone of Google's bsdiff from https://android.googlesource.com/platform/external/bsdiff, with only small changes to the
Makefile(plus a one-line source portability shim) so it builds with a modern toolchain and on macOS. The bsdiff/bspatch sources themselves are unmodified upstream code. For the original project description and provenance, seeREADME.chromium,README.android, andREADME.version.
bsdiff and bspatch are tools for building and applying patches to binary files.
Building
Requirements: a C++14 compiler and the brotli, libdivsufsort, and bzip2 libraries. On macOS, bzip2 ships with the system SDK, so only brotli and libdivsufsort need to be installed:
brew install brotli libdivsufsort
make
make builds the bsdiff and bspatch tools and the libbsdiff /
libbspatch shared libraries. make test additionally builds the unit tests
and requires GoogleTest (brew install googletest).
Local changes
These are the only differences from upstream:
Makefile: build with-std=c++14; on macOS, find the brotli/divsufsort/bzip2 headers and libraries under the Homebrew prefix and use the system linker's-install_nameflag in place of GNUld's-soname; skip the GoogleTest-dependent unit-test targets (and the.depsscan of their sources) when GoogleTest isn't installed.file.cc: provide a portableTEMP_FAILURE_RETRYfallback for platforms that define it neither in<unistd.h>(glibc) nor via Android's<utils/Compat.h>(e.g. macOS).