mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-30 17:14:46 +03:00
Correct handling of vendored fribidi.
This commit is contained in:
parent
51e3623066
commit
e82b5398e7
46
.github/workflows/wheels-dependencies.sh
vendored
46
.github/workflows/wheels-dependencies.sh
vendored
|
@ -1,16 +1,34 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Setup that needs to be done before multibuild utils are invoked
|
# Setup that needs to be done before multibuild utils are invoked
|
||||||
|
PROJECTDIR=$(pwd)
|
||||||
if [[ "$(uname -s)" == "Darwin" ]]; then
|
if [[ "$(uname -s)" == "Darwin" ]]; then
|
||||||
# Build and install macOS builds into the `build/deps` folder.
|
# Safety check - macOS builds require that CIBW_ARCHS is set, and that it
|
||||||
BUILD_PREFIX=$(pwd)/build/deps
|
# only contains a single value (even though cwbuildwheel) allows multiple
|
||||||
|
# values in CIBW_ARCHS.
|
||||||
|
if [[ -z "$CIBW_ARCHS" ]]; then
|
||||||
|
echo "ERROR: Pillow macOS builds require CIBW_ARCHS be defined."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ "$CIBW_ARCHS" == *" "* ]]; then
|
||||||
|
echo "ERROR: Pillow macOS builds only support a single architecture in CIBW_ARCHS."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build macOS dependencies in `build/darwin`
|
||||||
|
# Install them into `build/deps/darwin`
|
||||||
|
WORKDIR=$(pwd)/build/darwin
|
||||||
|
BUILD_PREFIX=$(pwd)/build/deps/darwin
|
||||||
|
PLAT=$CIBW_ARCHS
|
||||||
else
|
else
|
||||||
export MB_ML_LIBC=${AUDITWHEEL_POLICY::9}
|
# Build prefix will default to /usr/local
|
||||||
export MB_ML_VER=${AUDITWHEEL_POLICY:9}
|
WORKDIR=$(pwd)/build
|
||||||
|
PLAT=$CIBW_ARCHS
|
||||||
|
MB_ML_LIBC=${AUDITWHEEL_POLICY::9}
|
||||||
|
MB_ML_VER=${AUDITWHEEL_POLICY:9}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Define custom utilities
|
# Define custom utilities
|
||||||
export PLAT=$CIBW_ARCHS
|
|
||||||
source wheels/multibuild/common_utils.sh
|
source wheels/multibuild/common_utils.sh
|
||||||
source wheels/multibuild/library_builders.sh
|
source wheels/multibuild/library_builders.sh
|
||||||
if [ -z "$IS_MACOS" ]; then
|
if [ -z "$IS_MACOS" ]; then
|
||||||
|
@ -117,9 +135,6 @@ function build {
|
||||||
|
|
||||||
ORIGINAL_CFLAGS=$CFLAGS
|
ORIGINAL_CFLAGS=$CFLAGS
|
||||||
CFLAGS="$CFLAGS -O3 -DNDEBUG"
|
CFLAGS="$CFLAGS -O3 -DNDEBUG"
|
||||||
if [[ -n "$IS_MACOS" ]]; then
|
|
||||||
CFLAGS="$CFLAGS -Wl,-headerpad_max_install_names"
|
|
||||||
fi
|
|
||||||
build_libwebp
|
build_libwebp
|
||||||
CFLAGS=$ORIGINAL_CFLAGS
|
CFLAGS=$ORIGINAL_CFLAGS
|
||||||
|
|
||||||
|
@ -127,7 +142,7 @@ function build {
|
||||||
|
|
||||||
if [ -n "$IS_MACOS" ]; then
|
if [ -n "$IS_MACOS" ]; then
|
||||||
# Custom freetype build
|
# Custom freetype build
|
||||||
build_simple freetype $FREETYPE_VERSION https://download.savannah.gnu.org/releases/freetype tar.gz --with-harfbuzz=no
|
build_simple freetype $FREETYPE_VERSION https://download.savannah.gnu.org/releases/freetype tar.gz --without-harfbuzz
|
||||||
else
|
else
|
||||||
build_freetype
|
build_freetype
|
||||||
fi
|
fi
|
||||||
|
@ -136,17 +151,18 @@ function build {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Perform all dependency builds in the build subfolder.
|
# Perform all dependency builds in the build subfolder.
|
||||||
mkdir -p build
|
mkdir -p $WORKDIR
|
||||||
pushd build > /dev/null
|
pushd $WORKDIR > /dev/null
|
||||||
|
|
||||||
# Any stuff that you need to do before you start building the wheels
|
# Any stuff that you need to do before you start building the wheels
|
||||||
# Runs in the root directory of this repository.
|
# Runs in the root directory of this repository.
|
||||||
if [[ ! -d pillow-depends-main ]]; then
|
if [[ ! -d $WORKDIR/pillow-depends-main ]]; then
|
||||||
if [[ ! -f pillow-depends-main.zip ]]; then
|
if [[ ! -f $PROJECTDIR/pillow-depends-main.zip ]]; then
|
||||||
echo "Download pillow dependency sources..."
|
echo "Download pillow dependency sources..."
|
||||||
curl -fSL -o pillow-depends-main.zip https://github.com/python-pillow/pillow-depends/archive/main.zip
|
curl -fSL -o $PROJECTDIR/pillow-depends-main.zip https://github.com/python-pillow/pillow-depends/archive/main.zip
|
||||||
fi
|
fi
|
||||||
untar pillow-depends-main.zip
|
echo "Unpacking pillow dependency sources..."
|
||||||
|
untar $PROJECTDIR/pillow-depends-main.zip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$IS_MACOS" ]]; then
|
if [[ -n "$IS_MACOS" ]]; then
|
||||||
|
|
8
.github/workflows/wheels-test.sh
vendored
8
.github/workflows/wheels-test.sh
vendored
|
@ -16,8 +16,12 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
fi
|
fi
|
||||||
$HOMEBREW_HOME/bin/brew install fribidi
|
$HOMEBREW_HOME/bin/brew install fribidi
|
||||||
|
|
||||||
# Add the Homebrew lib folder so that vendored libraries can be found.
|
# Add the lib folder for fribidi so that the vendored library can be found.
|
||||||
export DYLD_LIBRARY_PATH=$HOMEBREW_HOME/lib
|
# Don't use /opt/homebrew/lib directly - use the lib folder where the
|
||||||
|
# installed copy of fribidi is cellared. This ensures we don't pick up the
|
||||||
|
# Homebrew version of any other library that we're dependent on (most notably,
|
||||||
|
# freetype).
|
||||||
|
export DYLD_LIBRARY_PATH=$(dirname $(realpath $HOMEBREW_HOME/lib/libfribidi.dylib))
|
||||||
elif [ "${AUDITWHEEL_POLICY::9}" == "musllinux" ]; then
|
elif [ "${AUDITWHEEL_POLICY::9}" == "musllinux" ]; then
|
||||||
apk add curl fribidi
|
apk add curl fribidi
|
||||||
else
|
else
|
||||||
|
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -91,5 +91,9 @@ Tests/images/msp
|
||||||
Tests/images/picins
|
Tests/images/picins
|
||||||
Tests/images/sunraster
|
Tests/images/sunraster
|
||||||
|
|
||||||
|
# Test and dependency downloads
|
||||||
|
pillow-depends-main.zip
|
||||||
|
pillow-test-images.zip
|
||||||
|
|
||||||
# pyinstaller
|
# pyinstaller
|
||||||
*.spec
|
*.spec
|
||||||
|
|
|
@ -96,13 +96,13 @@ build-verbosity = 1
|
||||||
|
|
||||||
config-settings = "raqm=enable raqm=vendor fribidi=vendor imagequant=disable"
|
config-settings = "raqm=enable raqm=vendor fribidi=vendor imagequant=disable"
|
||||||
# Add an explicit dependencies prefix for macOS.
|
# Add an explicit dependencies prefix for macOS.
|
||||||
macos.config-settings = "raqm=enable raqm=vendor fribidi=vendor imagequant=disable dependencies-prefix=./build/deps"
|
macos.config-settings = "raqm=enable raqm=vendor fribidi=vendor imagequant=disable dependencies-prefix=./build/deps/darwin"
|
||||||
|
|
||||||
test-command = "cd {project} && .github/workflows/wheels-test.sh"
|
test-command = "cd {project} && .github/workflows/wheels-test.sh"
|
||||||
test-extras = "tests"
|
test-extras = "tests"
|
||||||
|
|
||||||
[tool.cibuildwheel.macos.environment]
|
[tool.cibuildwheel.macos.environment]
|
||||||
PATH = "$(pwd)/build/deps/bin:$(dirname $(which python3)):/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin"
|
PATH = "$(pwd)/build/deps/darwin/bin:$(dirname $(which python3)):/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin"
|
||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
exclude = "wheels/multibuild"
|
exclude = "wheels/multibuild"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user