Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 4e2c570

Browse files
committed
Switched to libjpeg-turbo
1 parent b5387b4 commit 4e2c570

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

config.sh

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FREETYPE_VERSION=2.11.1
88
HARFBUZZ_VERSION=3.2.0
99
LIBPNG_VERSION=1.6.37
1010
ZLIB_VERSION=1.2.11
11-
JPEG_VERSION=9d
11+
JPEGTURBO_VERSION=2.1.2
1212
OPENJPEG_VERSION=2.4.0
1313
XZ_VERSION=5.2.5
1414
TIFF_VERSION=4.3.0
@@ -18,6 +18,20 @@ LIBWEBP_VERSION=1.2.1
1818
BZIP2_VERSION=1.0.8
1919
LIBXCB_VERSION=1.14
2020

21+
function build_libjpeg_turbo {
22+
local cmake=$(get_modern_cmake)
23+
fetch_unpack https://download.sourceforge.net/libjpeg-turbo/libjpeg-turbo-${JPEGTURBO_VERSION}.tar.gz
24+
(cd libjpeg-turbo-${JPEGTURBO_VERSION} \
25+
&& $cmake -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=/usr/local/lib . \
26+
&& make install)
27+
if [ -n "$IS_MACOS" ]; then
28+
rm /usr/local/lib/libjpeg.dylib
29+
fi
30+
31+
# Prevent build_jpeg
32+
touch jpeg-stamp
33+
}
34+
2135
function pre_build {
2236
# Any stuff that you need to do before you start building the wheels
2337
# Runs in the root directory of this repository.
@@ -51,11 +65,7 @@ function pre_build {
5165
PKG_CONFIG_PATH=$ORIGINAL_PKG_CONFIG_PATH
5266
fi
5367

54-
# Custom flags to include both multibuild and jpeg defaults
55-
ORIGINAL_CFLAGS=$CFLAGS
56-
CFLAGS="$CFLAGS -g -O2"
57-
build_jpeg
58-
CFLAGS=$ORIGINAL_CFLAGS
68+
build_libjpeg_turbo
5969

6070
if [[ -n "$IS_MACOS" ]]; then
6171
TIFF_VERSION=4.2.0
@@ -122,10 +132,10 @@ EXP_CODECS="jpg jpg_2000"
122132
EXP_CODECS="$EXP_CODECS libtiff zlib"
123133
EXP_MODULES="freetype2 littlecms2 pil tkinter webp"
124134
if [ -z "$IS_MACOS" ] && [[ "$MB_PYTHON_VERSION" != pypy3* ]] && [[ "$MACHTYPE" != aarch64* ]]; then
125-
EXP_FEATURES="fribidi harfbuzz raqm transp_webp webp_anim webp_mux xcb"
135+
EXP_FEATURES="fribidi harfbuzz libjpeg_turbo raqm transp_webp webp_anim webp_mux xcb"
126136
else
127137
# can't find FriBiDi
128-
EXP_FEATURES="transp_webp webp_anim webp_mux xcb"
138+
EXP_FEATURES="libjpeg_turbo transp_webp webp_anim webp_mux xcb"
129139
fi
130140

131141
function run_tests {

0 commit comments

Comments
 (0)