brotli-1.2.0

Introduction to Brotli

Brotli provides a general-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling. Its libraries are particularly used for WOFF2 fonts on webpages.

This package is known to build and work properly using an LFS 12.4 platform.

Package Information

  • Download (HTTP): https://github.com/google/brotli/archive/v1.2.0/brotli-1.2.0.tar.gz

  • Download SHA256 Sum: 816c96e8e8f193b40151dad7e8ff37b1221d019dbcb9c35cd3fadbfe6477dfec

  • Download MD5 sum: 8fbfae9a5ecbc278ae7f761ecb6d1285

  • Download size: 632 KB

  • Estimated disk space required: 33 MB (with python3 bindings)

  • Estimated build time: 0.3 SBU (with python3 bindings; parallelism=4)

Brotli Dependencies

Required

CMake-4.1.3

Optional

"pytest" (for testing Python3 bindings)

Installation of Brotli

Prepare brotli by running the following commands:

cmake -B build -D CMAKE_INSTALL_PREFIX=/usr \
      -D CMAKE_BUILD_TYPE=Release  \
      -G Ninja

To Build brotli issue:

ninja -C build

To test the results, issue:

ninja -C build test

Now Install brotli, as the root user:

ninja -C build install

If desired, build the Python3 bindings:

sed -e '/libraries +=/s/=.*/= [required_system_library[3:]]/' \
    -e '/package_configuration/d'                             \
    -e '/pkgconfig/d'                                         \
    -i setup.py

USE_SYSTEM_BROTLI=1 \
pip3 wheel -w dist --no-build-isolation --no-deps --no-cache-dir $PWD

Install the Python3 bindings as the root user:

pip3 install --no-index --find-links dist --no-user Brotli

To test the Python3 binding, issue: pytest.

Command Explanations

sed ... -i setup.py: Allow building the Python3 binding with USE_SYSTEM_BROTLI=1 but without the Python 3 pkgconfig module (that BLFS does not provide) installed.

USE_SYSTEM_BROTLI=1: Stop setup.py from rebuilding the entire package all over again, use the already installed libraries for the Python3 binding instead.

Contents

Installed Programs: brotli
Installed Libraries: libbrotlicommon.so, libbrotlidec.so, and libbrotlienc.so
Installed Directories: /usr/include/brotli and /usr/lib/python3/site-packages/Brotli-1.2.0.dist-info (if you built and installed the Python3 bindings)

Short Descriptions

brotli

can compress or decompress files, or test the integrity of compressed files

libbrotlicommon{-static.a,.so}

is the Brotli common dictionary library

libbrotlidec{-static.a,.so}

is the Brotli decoder library

libbrotlienc{-static.a,.so}

is the Brotli common encoder library