6.18. bsdpatch 0.99.1

bsdpatch provides the FreeBSD-derived patch utility for applying unified diffs in the target userspace.

Input assumption: bsdpatch-v0.99.1.tar.gz is already present in LBI_SOURCES from the chapter 4 source staging step.

Licenses:

Dependencies:

patch is a FreeBSD-derived patch utility made portable by the Chimera Linux bsdpatch project. we need it to apply source patches reliably in later package build flows throughout this book.

Extract and Enter the Source Tree

cd "$LBI_SOURCES"
tar -xf bsdpatch-v0.99.1.tar.gz
cd bsdpatch-0.99.1

Build bsdpatch

Configure note: this package does not ship a configure script, so lbi_configure is not supported here. Build settings are passed directly to make.
make $LWI_MAKE_FLAGS \
    CC="$LBI_ROOT/system/tools/bin/$LBI_TARGET-clang" \
    CFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LWI_CFLAGS" \
    LDFLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LBI_CUSTOM_LDFLAGS"

Install bsdpatch

make install \
    DESTDIR="$LBI_ROOT" \
    PREFIX=/system \
    BINDIR=/system/binaries \
    DATADIR=/system/documentation \
    MANDIR=/system/documentation/man-pages/man1 \
    INSTALL_NAME=patch

Command Explanations