@@ -62,7 +62,7 @@ function build_brotli {
6262
6363function build {
6464 if [[ -n " $IS_MACOS " ]] && [[ " $CIBW_ARCHS " == " arm64" ]]; then
65- export BUILD_PREFIX= " /usr/local"
65+ sudo chown -R runner /usr/local
6666 fi
6767 build_xz
6868 if [ -z " $IS_ALPINE " ] && [ -z " $IS_MACOS " ]; then
@@ -75,8 +75,8 @@ function build {
7575 build_simple xorgproto 2023.2 https://www.x.org/pub/individual/proto
7676 build_simple libXau 1.0.11 https://www.x.org/pub/individual/lib
7777 build_simple libpthread-stubs 0.5 https://xcb.freedesktop.org/dist
78- if [ -f /Library/Frameworks/Python.framework/Versions/Current/share/pkgconfig/xcb-proto.pc ]; then
79- cp /Library/Frameworks/Python.framework/Versions/Current/ share/pkgconfig/xcb-proto.pc /Library/Frameworks/Python.framework/Versions/Current/ lib/pkgconfig/xcb-proto.pc
78+ if [[ " $CIBW_ARCHS " == " arm64 " ] ]; then
79+ cp /usr/local/ share/pkgconfig/xcb-proto.pc /usr/local/ lib/pkgconfig
8080 fi
8181 else
8282 sed s/\$ {pc_sysrootdir\} // /usr/local/share/pkgconfig/xcb-proto.pc > /usr/local/lib/pkgconfig/xcb-proto.pc
@@ -87,11 +87,6 @@ function build {
8787 build_tiff
8888 build_libpng
8989 build_lcms2
90- if [[ -n " $IS_MACOS " ]] && [[ " $CIBW_ARCHS " == " arm64" ]]; then
91- for dylib in libjpeg.dylib libtiff.dylib liblcms2.dylib; do
92- cp $BUILD_PREFIX /lib/$dylib /opt/arm64-builds/lib
93- done
94- fi
9590 build_openjpeg
9691 if [ -f /usr/local/lib64/libopenjp2.so ]; then
9792 cp /usr/local/lib64/libopenjp2.so /usr/local/lib
@@ -131,14 +126,19 @@ curl -fsSL -o pillow-depends-main.zip https://github.com/python-pillow/pillow-de
131126untar pillow-depends-main.zip
132127
133128if [[ -n " $IS_MACOS " ]]; then
134- # webp, libtiff, libxcb cause a conflict with building webp, libtiff, libxcb
129+ # libtiff and libxcb cause a conflict with building libtiff and libxcb
135130 # libxau and libxdmcp cause an issue on macOS < 11
136- # if php is installed, brew tries to reinstall these after installing openblas
137131 # remove cairo to fix building harfbuzz on arm64
138132 # remove lcms2 and libpng to fix building openjpeg on arm64
139- # remove zstd to avoid inclusion on x86_64
133+ # remove jpeg-turbo to avoid inclusion on arm64
134+ # remove webp and zstd to avoid inclusion on x86_64
140135 # curl from brew requires zstd, use system curl
141- brew remove --ignore-dependencies webp libpng libtiff libxcb libxau libxdmcp curl php cairo lcms2 ghostscript zstd
136+ brew remove --ignore-dependencies libpng libtiff libxcb libxau libxdmcp curl cairo lcms2 zstd
137+ if [[ " $CIBW_ARCHS " == " arm64" ]]; then
138+ brew remove --ignore-dependencies jpeg-turbo
139+ else
140+ brew remove --ignore-dependencies webp
141+ fi
142142
143143 brew install pkg-config
144144fi
0 commit comments