Skip to content

Commit

Permalink
plat
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 24, 2025
1 parent 72df99c commit 4997e00
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 52 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/wheels-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ function build_harfbuzz {
}

function build {
build_xz
if [ -z "$IS_ALPINE" ] && [ -z "$SANITIZER" ] && [ -z "$IS_MACOS" ]; then
yum remove -y zlib-devel
fi
Expand All @@ -113,51 +112,7 @@ function build {
build_zlib_ng
fi

build_simple xcb-proto 1.17.0 https://xorg.freedesktop.org/archive/individual/proto
if [ -n "$IS_MACOS" ]; then
build_simple xorgproto 2024.1 https://www.x.org/pub/individual/proto
build_simple libXau 1.0.12 https://www.x.org/pub/individual/lib
build_simple libpthread-stubs 0.5 https://xcb.freedesktop.org/dist
else
sed s/\${pc_sysrootdir\}// $BUILD_PREFIX/share/pkgconfig/xcb-proto.pc > $BUILD_PREFIX/lib/pkgconfig/xcb-proto.pc
fi
build_simple libxcb $LIBXCB_VERSION https://www.x.org/releases/individual/lib

build_libjpeg_turbo
if [ -n "$IS_MACOS" ]; then
# Custom tiff build to include jpeg; by default, configure won't include
# headers/libs in the custom macOS prefix. Explicitly disable webp,
# libdeflate and zstd, because on x86_64 macs, it will pick up the
# Homebrew versions of those libraries from /usr/local.
build_simple tiff $TIFF_VERSION https://download.osgeo.org/libtiff tar.gz \
--with-jpeg-include-dir=$BUILD_PREFIX/include --with-jpeg-lib-dir=$BUILD_PREFIX/lib \
--disable-webp --disable-libdeflate --disable-zstd
else
build_tiff
fi

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
CFLAGS="$CFLAGS $webp_cflags" 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
# Custom freetype build
build_simple freetype $FREETYPE_VERSION https://download.savannah.gnu.org/releases/freetype tar.gz --with-harfbuzz=no
else
build_freetype
fi

build_harfbuzz
}

# Perform all dependency builds in the build subfolder.
Expand Down
8 changes: 5 additions & 3 deletions Tests/check_wheel.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from __future__ import annotations

import os
import platform
import sys

from PIL import features

from .helper import is_pypy


def test_wheel_modules() -> None:
expected_modules = {"pil", "tkinter", "freetype2", "littlecms2", "webp"}
Expand Down Expand Up @@ -41,8 +43,8 @@ def test_wheel_features() -> None:

if sys.platform == "win32":
expected_features.remove("xcb")
elif sys.platform == "darwin":
print("torch", os.environ)
elif sys.platform == "darwin" and not is_pypy():
print("torch", platform.processor())
expected_features.remove("zlib_ng")

assert set(features.get_supported_features()) == expected_features
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ version = { attr = "PIL.__version__" }
before-all = ".github/workflows/wheels-dependencies.sh"
build-verbosity = 1

config-settings = "raqm=enable raqm=vendor fribidi=vendor imagequant=disable"
# Disable platform guessing on macOS
macos.config-settings = "raqm=enable raqm=vendor fribidi=vendor imagequant=disable platform-guessing=disable"

test-command = "cd {project} && .github/workflows/wheels-test.sh"
test-extras = "tests"

Expand Down

0 comments on commit 4997e00

Please sign in to comment.