-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Isolate macOS wheel builds from Homebrew #8497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
0fe55d6
fc35fcc
00809a2
06dbfed
5a8373e
140a06e
0961d3d
43c34fc
3e4be4b
0855468
8308bf3
c74a5bd
72d81e2
ec214e4
d1a4f80
6d13704
467f120
c6912f8
96ae15c
01270b5
51e3623
e82b539
904416b
4e35852
681a03b
378df7a
9dc6904
0e3eb70
54f2334
96b898c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
#!/bin/bash | ||
|
||
# Setup that needs to be done before multibuild utils are invoked | ||
PROJECTDIR=$(pwd) | ||
if [[ "$(uname -s)" == "Darwin" ]]; then | ||
# Build and install macOS builds into the `build/deps` folder. | ||
BUILD_PREFIX=$(pwd)/build/deps | ||
# Safety check - macOS builds require that CIBW_ARCHS is set, and that it | ||
# 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 | ||
export MB_ML_LIBC=${AUDITWHEEL_POLICY::9} | ||
export MB_ML_VER=${AUDITWHEEL_POLICY:9} | ||
# Build prefix will default to /usr/local | ||
WORKDIR=$(pwd)/build | ||
PLAT=$CIBW_ARCHS | ||
MB_ML_LIBC=${AUDITWHEEL_POLICY::9} | ||
MB_ML_VER=${AUDITWHEEL_POLICY:9} | ||
fi | ||
|
||
# Define custom utilities | ||
export PLAT=$CIBW_ARCHS | ||
source wheels/multibuild/common_utils.sh | ||
source wheels/multibuild/library_builders.sh | ||
if [ -z "$IS_MACOS" ]; then | ||
|
@@ -117,17 +135,14 @@ function build { | |
|
||
ORIGINAL_CFLAGS=$CFLAGS | ||
CFLAGS="$CFLAGS -O3 -DNDEBUG" | ||
if [[ -n "$IS_MACOS" ]]; then | ||
CFLAGS="$CFLAGS -Wl,-headerpad_max_install_names" | ||
fi | ||
radarhere marked this conversation as resolved.
Show resolved
Hide resolved
|
||
build_libwebp | ||
CFLAGS=$ORIGINAL_CFLAGS | ||
|
||
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 | ||
build_simple freetype $FREETYPE_VERSION https://download.savannah.gnu.org/releases/freetype tar.gz --without-harfbuzz | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/builds/unix/configure.raw?ref_type=heads#L429 mentions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "--with/--without" handing is a standard feature of autoconf, AFAIK; I think this change got made when I was trying to diagnose some harfbuzz issues. Happy to revert, as it's code churn with no explicit purpose. |
||
else | ||
build_freetype | ||
fi | ||
|
@@ -136,17 +151,18 @@ function build { | |
} | ||
|
||
# Perform all dependency builds in the build subfolder. | ||
mkdir -p build | ||
pushd build > /dev/null | ||
mkdir -p $WORKDIR | ||
pushd $WORKDIR > /dev/null | ||
|
||
# Any stuff that you need to do before you start building the wheels | ||
# Runs in the root directory of this repository. | ||
if [[ ! -d pillow-depends-main ]]; then | ||
if [[ ! -f pillow-depends-main.zip ]]; then | ||
if [[ ! -d $WORKDIR/pillow-depends-main ]]; then | ||
if [[ ! -f $PROJECTDIR/pillow-depends-main.zip ]]; then | ||
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 | ||
untar pillow-depends-main.zip | ||
echo "Unpacking pillow dependency sources..." | ||
untar $PROJECTDIR/pillow-depends-main.zip | ||
fi | ||
|
||
if [[ -n "$IS_MACOS" ]]; then | ||
|
Uh oh!
There was an error while loading. Please reload this page.