Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
matrix:
# make arm64 deps and x86_64 deps
include:
- { macarch: arm64, os: macos-14 }
- { macarch: x86_64, os: macos-13 }
- { macarch: arm64, os: macos-15 }
- { macarch: x86_64, os: macos-15 }

steps:
- uses: actions/[email protected]
Expand Down Expand Up @@ -64,8 +64,8 @@ jobs:
fail-fast: false # if a particular matrix build fails, don't skip the rest
matrix:
include:
- { macarch: arm64, os: macos-14 }
- { macarch: x86_64, os: macos-13 }
- { macarch: arm64, os: macos-15 }
- { macarch: x86_64, os: macos-15 }

env:
MAC_ARCH: ${{ matrix.macarch }}
Expand Down
13 changes: 11 additions & 2 deletions buildconfig/macdependencies/build_mac_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,21 @@ else
# install NASM to generate optimised x86_64 libjpegturbo builds
brew install nasm

# for scripts using ./configure to make x86_64 binaries
export CC="clang -target x86_64-apple-macos10.11"
export CXX="clang++ -target x86_64-apple-macos10.11"

export PG_BASE_CONFIGURE_FLAGS="$PG_BASE_CONFIGURE_FLAGS --host=x86_64-apple-darwin"

# configure cmake to cross-compile
export PG_BASE_CMAKE_FLAGS="$PG_BASE_CMAKE_FLAGS -DCMAKE_OSX_ARCHITECTURES=x86_64"

# SDL 2.26.5 new minimum macos is 10.11, so we build our x86 mac deps
# for 10.11 as well.
export MACOSX_DEPLOYMENT_TARGET=10.11

# needs native-file that has correct macosx deployment target
export PG_BASE_MESON_FLAGS="$PG_BASE_MESON_FLAGS --native-file $(pwd)/macos_x86_64.ini"
# configure meson to cross-compile with correct target
export PG_BASE_MESON_FLAGS="$PG_BASE_MESON_FLAGS --cross-file $(pwd)/macos_x86_64.ini"
fi

cd ../manylinux-build/docker_base
Expand Down
3 changes: 2 additions & 1 deletion buildconfig/macdependencies/clean_usr_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ln -s /usr/bin/git /usr/local/bin/git
ln -s /usr/bin/git /opt/homebrew/bin/git

rm -rf /usr/local/lib/libtiff*
rm -rf /usr/local/lib/libzstd*
rm -rf /usr/local/lib/libzstd* /opt/homebrew/lib/libzstd*
rm -rf /usr/local/lib/libwebp*
rm -rf /usr/local/lib/libdeflate*
rm -rf /usr/local/lib/libsndfile*
Expand All @@ -25,6 +25,7 @@ rm -rf /usr/local/lib/libbrotlidec*
rm -rf /usr/local/lib/libopus*
rm -rf /usr/local/lib/freetype*
rm -rf /usr/local/opt/freetype*
rm -rf /opt/homebrew/lib/libgif*

rm -rf /usr/local/Cellar/libtiff /opt/homebrew/Cellar/libtiff
rm -rf /usr/local/Cellar/libsndfile /opt/homebrew/Cellar/libsndfile
Expand Down
8 changes: 7 additions & 1 deletion buildconfig/macdependencies/macos_x86_64.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
[constants]
macos_ver = ['-mmacosx-version-min=10.11']
macos_ver = ['-target', 'x86_64-apple-macos10.11']

[host_machine]
system = 'darwin'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

[binaries]
c = ['clang']
Expand Down
8 changes: 4 additions & 4 deletions buildconfig/manylinux-build/docker_base/Dockerfile-aarch64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pin version on image for CI stability
FROM quay.io/pypa/manylinux2014_aarch64:2025.07.25-1
FROM quay.io/pypa/manylinux2014_aarch64:2025.09.08-1
ENV MAKEFLAGS="-j 4"
ENV PG_DEP_PREFIX="/usr/local"

Expand Down Expand Up @@ -94,12 +94,12 @@ RUN ["bash", "/libjpegturbo_build/build-jpeg-turbo.sh"]
ADD libpng /libpng_build/
RUN ["bash", "/libpng_build/build-png.sh"]

ADD libwebp /webp_build/
RUN ["bash", "/webp_build/build-webp.sh"]

ADD libtiff /libtiff_build/
RUN ["bash", "/libtiff_build/build-tiff.sh"]

ADD libwebp /webp_build/
RUN ["bash", "/webp_build/build-webp.sh"]

ADD brotli /brotli_build/
RUN ["bash", "/brotli_build/build-brotli.sh"]

Expand Down
8 changes: 4 additions & 4 deletions buildconfig/manylinux-build/docker_base/Dockerfile-i686
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pin version on image for CI stability
FROM quay.io/pypa/manylinux2014_i686:2025.07.25-1
FROM quay.io/pypa/manylinux2014_i686:2025.09.08-1

Check warning on line 2 in buildconfig/manylinux-build/docker_base/Dockerfile-i686

View workflow job for this annotation

GitHub Actions / i686

Base image platform does not match expected target platform

InvalidBaseImagePlatform: Base image quay.io/pypa/manylinux2014_i686:2025.09.08-1 was pulled with platform "linux/386", expected "linux/amd64" for current build
ENV MAKEFLAGS="-j 4"
ENV PG_DEP_PREFIX="/usr/local"

Expand Down Expand Up @@ -94,12 +94,12 @@
ADD libpng /libpng_build/
RUN ["linux32", "bash", "/libpng_build/build-png.sh"]

ADD libwebp /webp_build/
RUN ["linux32", "bash", "/webp_build/build-webp.sh"]

ADD libtiff /libtiff_build/
RUN ["linux32", "bash", "/libtiff_build/build-tiff.sh"]

ADD libwebp /webp_build/
RUN ["linux32", "bash", "/webp_build/build-webp.sh"]

ADD brotli /brotli_build/
RUN ["linux32", "bash", "/brotli_build/build-brotli.sh"]

Expand Down
8 changes: 4 additions & 4 deletions buildconfig/manylinux-build/docker_base/Dockerfile-x86_64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pin version on image for CI stability
FROM quay.io/pypa/manylinux2014_x86_64:2025.07.25-1
FROM quay.io/pypa/manylinux2014_x86_64:2025.09.08-1
ENV MAKEFLAGS="-j 4"
ENV PG_DEP_PREFIX="/usr/local"

Expand Down Expand Up @@ -94,12 +94,12 @@ RUN ["bash", "/libjpegturbo_build/build-jpeg-turbo.sh"]
ADD libpng /libpng_build/
RUN ["bash", "/libpng_build/build-png.sh"]

ADD libwebp /webp_build/
RUN ["bash", "/webp_build/build-webp.sh"]

ADD libtiff /libtiff_build/
RUN ["bash", "/libtiff_build/build-tiff.sh"]

ADD libwebp /webp_build/
RUN ["bash", "/webp_build/build-webp.sh"]

ADD brotli /brotli_build/
RUN ["bash", "/brotli_build/build-brotli.sh"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ set -e -x

cd $(dirname `readlink -f "$0"`)

# TODO: when freetype is updated, we can look into resolving the circular
# dependency between freetype and harfbuzz by using the upcoming freetype
# dynamic harfbuzz loading feature.
FREETYPE="freetype-2.13.3"
HARFBUZZ_VER=11.3.3
FREETYPE="freetype-2.14.0"
HARFBUZZ_VER=11.4.5
HARFBUZZ_NAME="harfbuzz-$HARFBUZZ_VER"

curl -sL --retry 10 https://savannah.nongnu.org/download/freetype/${FREETYPE}.tar.gz > ${FREETYPE}.tar.gz
Expand All @@ -19,19 +16,24 @@ tar xzf ${FREETYPE}.tar.gz
unxz ${HARFBUZZ_NAME}.tar.xz
tar xf ${HARFBUZZ_NAME}.tar

# freetype and harfbuzz have an infamous circular dependency, which is why
# this file is not like the rest of docker_base files

# 1. First compile freetype without harfbuzz support
cd $FREETYPE

./configure $PG_BASE_CONFIGURE_FLAGS --with-harfbuzz=no
make
make install # this freetype is not installed to mac cache dir
# For now bzip2 is only used on macOS, on other platforms there are issues with
# it.
if [[ "$OSTYPE" == "darwin"* ]]; then
export PG_FT_BZ2="-Dbzip2=enabled"
else
export PG_FT_BZ2="-Dbzip2=disabled"
fi

meson setup _build $PG_BASE_MESON_FLAGS -Dbrotli=enabled -Dharfbuzz=dynamic \
-Dpng=enabled -Dzlib=system $PG_FT_BZ2

meson compile -C _build
meson install -C _build

cd ..

# 2. Compile harfbuzz with freetype support
cd ${HARFBUZZ_NAME}

# harfbuzz has a load of optional dependencies but only freetype is important
Expand All @@ -46,28 +48,4 @@ meson setup _build $PG_BASE_MESON_FLAGS -Dfreetype=enabled \
meson compile -C _build
meson install -C _build

if [[ "$OSTYPE" == "darwin"* ]]; then
# We do a little hack...
# When freetype finds harfbuzz with pkg-config, we tell freetype a little
# lie that harfbuzz doesn't depend on freetype (even though it does).
# This ensures no direct circular dylib link happen.
# This is a bit of a brittle hack: This command removes the entire line that
# contains "freetype". This is fine for now when the harfbuzz we are
# building has no other dependencies
sed -i '' '/freetype/d' $PG_DEP_PREFIX/lib/pkgconfig/harfbuzz.pc
fi

cd ..

# 3. Recompile freetype, and this time with harfbuzz support
cd $FREETYPE

# fully clean previous install
make clean
if [[ "$OSTYPE" == "darwin"* ]]; then
make uninstall
fi

./configure $PG_BASE_CONFIGURE_FLAGS --with-harfbuzz=yes
make
make install
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
b7e7e67baed421dbe08c48dcde5d5891c0f7e3c1253be8dc27826c60eaa17ca89f888c3d5a6faf5141b02c154e1cf42d4ed6133b9959ddc359fe6bd41615ae89 freetype-2.13.3.tar.gz
56a971c939522bc5edad5f8a578444844b9101321c6bacfb3d96eadf3b13238144d465dd22171b61ef7b3873af88e43297989c289a5fc37e4d390b64c435cff6 harfbuzz-11.3.3.tar.xz
012e42d8d7f207b4ae4890cfe0507f952e98b2f0d41fa273760a421cfced46d428925545c01b28c2ce1541b002a4b64c26d96ffdb94895f9f81861ceb7e1697b freetype-2.14.0.tar.gz
c0c55a2201538a9e9365b175ccc7d4df2b0e321f9a723c7c83879bdc8b40cb9fac3ed257cecf9960cc3a17ceac0dc0220a6b9dfa976ce3dd7cb03154a55ad868 harfbuzz-11.4.5.tar.xz
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e -x

cd $(dirname `readlink -f "$0"`)

JPEG_VERSION=3.1.1
JPEG_VERSION=3.1.2
JPEG="libjpeg-turbo-${JPEG_VERSION}"

curl -sL --retry 10 https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/${JPEG_VERSION}/${JPEG}.tar.gz > ${JPEG}.tar.gz
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d08c8eb77281c1eee2c93ef9f2eefaf79a4b9adff5172ebcb20c845ccad8896a28fc3d622002cc8b28964ff860dca0a491d6b1b921aaa7aedccd21b909aad4cb libjpeg-turbo-3.1.1.tar.gz
79271ae4ddc12e3753cc7323dc15617f1d82b2d554ef27b555712f6ab5de603323dd33747620815e3b55663a20e07b292a55172aee9f401f9fd3557145967abe libjpeg-turbo-3.1.2.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ sha512sum -c png.sha512
tar xzf ${PNG}.tar.gz
cd $PNG

./configure --with-zlib-prefix=$PG_DEP_PREFIX $PG_BASE_CONFIGURE_FLAGS
cmake . $PG_BASE_CMAKE_FLAGS -DPNG_TESTS=0 -DPNG_TOOLS=0 -DPNG_STATIC=0 -DPNG_FRAMEWORK=0
make
make install
16 changes: 14 additions & 2 deletions buildconfig/manylinux-build/docker_base/libwebp/build-webp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,26 @@ set -e -x

cd $(dirname `readlink -f "$0"`)

WEBP=libwebp-1.5.0
WEBP=libwebp-1.6.0

curl -sL --retry 10 http://storage.googleapis.com/downloads.webmproject.org/releases/webp/${WEBP}.tar.gz > ${WEBP}.tar.gz
sha512sum -c webp.sha512

tar xzf ${WEBP}.tar.gz
cd $WEBP

./configure --enable-libwebpdemux $PG_BASE_CONFIGURE_FLAGS
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# libwebp 1.6.0 introduced SIMD support for speedups. While it works on mac,
# it doesn't compile on manylinux because gcc is too old for a particular SIMD
# function (_mm256_cvtsi256_si32) webp happens to use.
# TODO: enable SIMD when the issue is resolved.
export PG_WEBP_EXTRA_ARGS="-DWEBP_ENABLE_SIMD=NO"
fi

# we don't need to build webp commandline tools.
cmake . $PG_BASE_CMAKE_FLAGS $PG_WEBP_EXTRA_ARGS \
-DWEBP_BUILD_DWEBP=NO -DWEBP_BUILD_CWEBP=NO -DWEBP_BUILD_VWEBP=NO \
-DWEBP_BUILD_ANIM_UTILS=NO -DWEBP_BUILD_GIF2WEBP=NO -DWEBP_BUILD_IMG2WEBP=NO \
-DWEBP_BUILD_WEBPINFO=NO -DWEBP_BUILD_WEBPMUX=NO -DWEBP_BUILD_EXTRAS=NO
make
make install
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7a39594cf5585428f82d555b05e78aa63758a56841a313c0b74dfb4996afe37dddf92498d6123ff2a949a7209fb9097927f10ee75b5a38b481f110c892e5302b libwebp-1.5.0.tar.gz
5c159d9760efcb92749092536daada22c0a73c20926c76097a5f0448ddbf874cf761324ca97925ca5f578b30477564b2b072b47667e504673797128b31cafcbf libwebp-1.6.0.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e -x

cd $(dirname `readlink -f "$0"`)

MPG123="mpg123-1.33.0"
MPG123="mpg123-1.33.2"

curl -sL --retry 10 https://downloads.sourceforge.net/sourceforge/mpg123/${MPG123}.tar.bz2 > ${MPG123}.tar.bz2
sha512sum -c mpg123.sha512
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c2c6a3536f18334e310337dc2cc7d4af141c1f7fffb02fc079d645f46113581d457587c562cf353d39375d721af6716cb4db6a964ef83284e390b597744c52ea mpg123-1.33.0.tar.bz2
9e9a4d6433e9073470c4cee909dfbfcd4717b1f1534eefeee453870993967026155f913c12b6ca187fb96059e73d9184e71df8a62736b43092d3842b9814c980 mpg123-1.33.2.tar.bz2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e -x

cd $(dirname `readlink -f "$0"`)

PORTMIDI_VER="2.0.4"
PORTMIDI_VER="2.0.6"
PORTMIDI="portmidi-${PORTMIDI_VER}"

curl -sL --retry 10 https://github.com/PortMidi/portmidi/archive/refs/tags/v${PORTMIDI_VER}.tar.gz> ${PORTMIDI}.tar.gz
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d9f22d161e1dd9a4bde1971bb2b6e5352da51545f4fe5ecad11c55e7a535f0d88efce18d1c8fd91e93b70a7926150f86a0f53972ad92370e86556a8dd72dc194 portmidi-2.0.4.tar.gz
00d7cec97b58c074d484793b6097f4e60d061a9d680940bbcdb6670b287b78dbc099af378fb2e066c61f1c26e5060ded9c8f78c80fc03518b33e43f830e34a27 portmidi-2.0.6.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ curl -sL --retry 10 https://github.com/libsndfile/libsndfile/releases/download/$
sha512sum -c sndfile.sha512
tar xf ${SNDFILE}
cd $SNDNAME
# autoreconf -fvi

# alsa is only needed for examples here
./configure $PG_BASE_CONFIGURE_FLAGS --disable-mpeg --disable-alsa
cmake . $PG_BASE_CMAKE_FLAGS -DBUILD_PROGRAMS=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5
make
make install
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e -x

cd $(dirname `readlink -f "$0"`)

ZLIB_NG_VER=2.2.4
ZLIB_NG_VER=2.2.5
ZLIB_NG_NAME="zlib-ng-$ZLIB_NG_VER"
curl -sL --retry 10 https://github.com/zlib-ng/zlib-ng/archive/refs/tags/${ZLIB_NG_VER}.tar.gz > ${ZLIB_NG_NAME}.tar.gz

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f49a89497988db55a2f2375f79443e7e2c57470dbd94b35ae38a39d988eb42f8ecc295a1bd68845fc273b59ea508d0e74b142585d85b7e869dd3c01cc6923d8d zlib-ng-2.2.4.tar.gz
b599ea24375d08fa098ed7c3b14548e0d9731a155a024a0904b0ae4a6d3491a69f0c0574d66b6e4af1e40f10e38b6b555d4c4b1fe3589ca83a5f97fbd92f635f zlib-ng-2.2.5.tar.gz
5 changes: 4 additions & 1 deletion test/font_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,10 @@ def test_size(self):

self.assertIsInstance(w, int)
self.assertIsInstance(h, int)
self.assertEqual(s.get_size(), size)

# test width and height match, with a tolerance for 1 pixel errors
self.assertTrue(w - 1 <= s.get_width() <= w + 1)
self.assertTrue(h - 1 <= s.get_height() <= h + 1)
self.assertEqual(f.size(btext), size)

text = "\u212a"
Expand Down
Loading