6.21. xz 5.8.3

xz provides liblzma and command-line tools for .xz and .lzma compression workflows in the target userspace.

Input assumption: xz-5.8.3.tar.xz is already present in LBI_SOURCES from the chapter 4 source staging step.

Licenses:

Dependencies:

xz is a compression toolkit that provides liblzma and .xz/.lzma command-line tools. we need it to provide xz and liblzma for compression workflows and later package dependencies.

Extract and Enter the Source Tree

cd "$LBI_SOURCES"
tar -xf xz-5.8.3.tar.xz
cd xz-5.8.3

Configure xz (CMake Path)

Upstream note: INSTALL documents the CMake options for this package (XZ_*, TUKLIB_*, and CMAKE_*), including XZ_NLS and tool toggles.
lbi_cmake build \
    -DCMAKE_C_COMPILER="$LBI_ROOT/system/tools/bin/$LBI_TARGET-clang" \
    -DCMAKE_AR="$LBI_ROOT/system/tools/bin/$LBI_TARGET-ar" \
    -DCMAKE_RANLIB="$LBI_ROOT/system/tools/bin/$LBI_TARGET-ranlib" \
    -DCMAKE_INSTALL_PREFIX=/system \
    -DCMAKE_INSTALL_BINDIR=binaries \
    -DCMAKE_INSTALL_SBINDIR=systembinaries \
    -DCMAKE_INSTALL_LIBDIR=libraries \
    -DCMAKE_INSTALL_LIBEXECDIR=systembinaries \
    -DCMAKE_INSTALL_INCLUDEDIR=headers \
    -DCMAKE_INSTALL_SYSCONFDIR=configuration \
    -DCMAKE_INSTALL_LOCALSTATEDIR=variable \
    -DCMAKE_INSTALL_MANDIR=documentation/man-pages \
    -DCMAKE_INSTALL_INFODIR=documentation/info \
    -DCMAKE_INSTALL_DATAROOTDIR=documentation \
    -DCMAKE_INSTALL_DOCDIR=documentation/xz \
    -DCMAKE_C_FLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LWI_CFLAGS" \
    -DCMAKE_SHARED_LINKER_FLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LBI_CUSTOM_LDFLAGS" \
    -DCMAKE_EXE_LINKER_FLAGS="--target=$LBI_TARGET --sysroot=$LBI_ROOT $LBI_CUSTOM_LDFLAGS" \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_SHARED_LIBS=ON \
    -DBUILD_TESTING=OFF \
    -DXZ_NLS=OFF \
    -DXZ_DOXYGEN=OFF

Build xz

cmake --build build $LWI_MAKE_FLAGS

Install xz

DESTDIR="$LBI_ROOT" cmake --install build

Command Explanations