Skip to content

Commit 608a5e8

Browse files
committed
Updated harfbuzz to 9.0.0, except on manylinux2014
1 parent 012270d commit 608a5e8

File tree

1 file changed

+34
-13
lines changed

1 file changed

+34
-13
lines changed

.github/workflows/wheels-dependencies.sh

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ ARCHIVE_SDIR=pillow-depends-main
1616

1717
# Package versions for fresh source builds
1818
FREETYPE_VERSION=2.13.2
19-
HARFBUZZ_VERSION=8.5.0
19+
if [[ "$MB_ML_VER" != 2014 ]]; then
20+
HARFBUZZ_VERSION=9.0.0
21+
else
22+
HARFBUZZ_VERSION=8.5.0
23+
fi
2024
LIBPNG_VERSION=1.6.43
2125
JPEGTURBO_VERSION=3.0.3
2226
OPENJPEG_VERSION=2.5.2
@@ -40,7 +44,7 @@ BROTLI_VERSION=1.1.0
4044

4145
if [[ -n "$IS_MACOS" ]] && [[ "$CIBW_ARCHS" == "x86_64" ]]; then
4246
function build_openjpeg {
43-
local out_dir=$(fetch_unpack https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz openjpeg-${OPENJPEG_VERSION}.tar.gz)
47+
local out_dir=$(fetch_unpack https://github.com/uclouvain/openjpeg/archive/v$OPENJPEG_VERSION.tar.gz openjpeg-$OPENJPEG_VERSION.tar.gz)
4448
(cd $out_dir \
4549
&& cmake -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DCMAKE_INSTALL_NAME_DIR=$BUILD_PREFIX/lib . \
4650
&& make install)
@@ -50,7 +54,7 @@ fi
5054

5155
function build_brotli {
5256
local cmake=$(get_modern_cmake)
53-
local out_dir=$(fetch_unpack https://github.com/google/brotli/archive/v$BROTLI_VERSION.tar.gz brotli-1.1.0.tar.gz)
57+
local out_dir=$(fetch_unpack https://github.com/google/brotli/archive/v$BROTLI_VERSION.tar.gz brotli-$BROTLI_VERSION.tar.gz)
5458
(cd $out_dir \
5559
&& $cmake -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DCMAKE_INSTALL_NAME_DIR=$BUILD_PREFIX/lib . \
5660
&& make install)
@@ -60,6 +64,25 @@ function build_brotli {
6064
fi
6165
}
6266

67+
function build_harfbuzz {
68+
if [[ "$HARFBUZZ_VERSION" == 8.5.0 ]]; then
69+
export FREETYPE_LIBS=-lfreetype
70+
export FREETYPE_CFLAGS=-I/usr/local/include/freetype2/
71+
build_simple harfbuzz $HARFBUZZ_VERSION https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION tar.xz --with-freetype=yes --with-glib=no
72+
export FREETYPE_LIBS=""
73+
export FREETYPE_CFLAGS=""
74+
else
75+
local out_dir=$(fetch_unpack https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION/$HARFBUZZ_VERSION.tar.xz harfbuzz-$HARFBUZZ_VERSION.tar.xz)
76+
(cd $out_dir \
77+
&& meson setup build --buildtype=release -Dfreetype=enabled -Dglib=disabled)
78+
(cd $out_dir/build \
79+
&& meson install)
80+
if [[ "$MB_ML_LIBC" == "manylinux" ]]; then
81+
cp /usr/local/lib64/libharfbuzz* /usr/local/lib
82+
fi
83+
fi
84+
}
85+
6386
function build {
6487
if [[ -n "$IS_MACOS" ]] && [[ "$CIBW_ARCHS" == "arm64" ]]; then
6588
sudo chown -R runner /usr/local
@@ -109,15 +132,7 @@ function build {
109132
build_freetype
110133
fi
111134

112-
if [ -z "$IS_MACOS" ]; then
113-
export FREETYPE_LIBS=-lfreetype
114-
export FREETYPE_CFLAGS=-I/usr/local/include/freetype2/
115-
fi
116-
build_simple harfbuzz $HARFBUZZ_VERSION https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION tar.xz --with-freetype=yes --with-glib=no
117-
if [ -z "$IS_MACOS" ]; then
118-
export FREETYPE_LIBS=""
119-
export FREETYPE_CFLAGS=""
120-
fi
135+
build_harfbuzz
121136
}
122137

123138
# Any stuff that you need to do before you start building the wheels
@@ -140,7 +155,13 @@ if [[ -n "$IS_MACOS" ]]; then
140155
brew remove --ignore-dependencies webp
141156
fi
142157

143-
brew install pkg-config
158+
brew install meson pkg-config
159+
elif [[ "$MB_ML_LIBC" == "manylinux" ]]; then
160+
if [[ "$HARFBUZZ_VERSION" != 8.5.0 ]]; then
161+
yum install -y meson
162+
fi
163+
else
164+
apk add meson
144165
fi
145166

146167
wrap_wheel_builder build

0 commit comments

Comments
 (0)