From 0b70b34f19dc8ec43da543f6d64426f1a8013a71 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 15 Dec 2025 20:49:18 +1100 Subject: [PATCH] Fix build on manylinux_2_28 x86_64 --- .ci/install.sh | 3 +++ .github/workflows/wheels-dependencies.sh | 25 +++++++++++----------- depends/install_libjxl.sh | 17 +++++++++++++++ docs/installation/building-from-source.rst | 4 +++- 4 files changed, 35 insertions(+), 14 deletions(-) create mode 100755 depends/install_libjxl.sh diff --git a/.ci/install.sh b/.ci/install.sh index 52b821417..ba6e753e2 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -56,5 +56,8 @@ pushd depends && sudo ./install_raqm.sh && popd # libavif pushd depends && sudo ./install_libavif.sh && popd +# libjxl +pushd depends && sudo ./install_libjxl.sh && popd + # extra test images pushd depends && ./install_extra_test_images.sh && popd diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index ff58c0b37..52b380429 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -321,19 +321,6 @@ function build { build_libpng build_lcms2 build_openjpeg - - webp_cflags="-O3 -DNDEBUG" - if [[ -n "$IS_MACOS" ]]; then - webp_cflags="$webp_cflags -Wl,-headerpad_max_install_names" - fi - webp_ldflags="" - if [[ -n "$IOS_SDK" ]]; then - webp_ldflags="$webp_ldflags -llzma -lz" - fi - CFLAGS="$CFLAGS $webp_cflags" LDFLAGS="$LDFLAGS $webp_ldflags" build_simple libwebp $LIBWEBP_VERSION \ - https://storage.googleapis.com/downloads.webmproject.org/releases/webp tar.gz \ - --enable-libwebpmux --enable-libwebpdemux - build_brotli if [[ -n "$IS_MACOS" ]]; then @@ -356,6 +343,18 @@ function build { build_jpegxl fi fi + + webp_cflags="-O3 -DNDEBUG" + if [[ -n "$IS_MACOS" ]]; then + webp_cflags="$webp_cflags -Wl,-headerpad_max_install_names" + fi + webp_ldflags="" + if [[ -n "$IOS_SDK" ]]; then + webp_ldflags="$webp_ldflags -llzma -lz" + fi + CFLAGS="$CFLAGS $webp_cflags" LDFLAGS="$LDFLAGS $webp_ldflags" build_simple libwebp $LIBWEBP_VERSION \ + https://storage.googleapis.com/downloads.webmproject.org/releases/webp tar.gz \ + --enable-libwebpmux --enable-libwebpdemux } function create_meson_cross_config { diff --git a/depends/install_libjxl.sh b/depends/install_libjxl.sh new file mode 100755 index 000000000..0b222a7e3 --- /dev/null +++ b/depends/install_libjxl.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +version=0.11.1 + +./download-and-extract.sh highway-1.3.0 https://github.com/google/highway/archive/1.3.0.tar.gz + +pushd highway-1.3.0 +cmake . +make -j4 install +popd + +./download-and-extract.sh libjxl-$version https://github.com/libjxl/libjxl/archive/v$version.tar.gz + +pushd libjxl-$version +cmake -DCMAKE_INSTALL_PREFIX=/usr -DJPEGXL_ENABLE_SJPEG=OFF -DJPEGXL_ENABLE_SKCMS=OFF -DBUILD_TESTING=OFF . +make -j4 install +popd diff --git a/docs/installation/building-from-source.rst b/docs/installation/building-from-source.rst index 971d961ba..b9d0d172a 100644 --- a/docs/installation/building-from-source.rst +++ b/docs/installation/building-from-source.rst @@ -129,6 +129,8 @@ Many of Pillow's features require external libraries: To install libraqm, ``sudo apt-get install meson`` and then see ``depends/install_raqm.sh``. + To install libjxl, see ``depends/install_libjxl.sh``. + Build prerequisites for libavif on Ubuntu are installed with:: sudo apt-get install cmake ninja-build nasm @@ -166,7 +168,7 @@ Many of Pillow's features require external libraries: The easiest way to install external libraries is via `Homebrew `_. After you install Homebrew, run:: - brew install libavif libjpeg libraqm libtiff little-cms2 openjpeg webp + brew install jpeg-xl libavif libjpeg libraqm libtiff little-cms2 openjpeg webp If you would like to use libavif with more codecs than just aom, then instead of installing libavif through Homebrew directly, you can use