build: fix macOS CI (brew meson, cocoa/gl-cocoa, system zlib)

pip installs are blocked by PEP 668 on the macOS runners, so install meson
via brew. Enable cocoa and gl-cocoa: on macOS the OpenGL render API
backend of libmpv requires them (system frameworks only). Build no zlib
ourselves - macOS ships it in the system like iconv. Use PKG_CONFIG_PATH
additively instead of overriding PKG_CONFIG_LIBDIR so system pkg-config
files (icu-uc, ...) stay visible.
This commit is contained in:
david
2026-10-01 01:01:22 +02:00
parent 4b385cd92f
commit 4845b5e44f
2 changed files with 9 additions and 21 deletions
+2 -5
View File
@@ -55,11 +55,8 @@ jobs:
- name: Install dependencies
run: |
brew install ccache nasm ninja
python3 -m pip install --user meson
export PATH="$HOME/Library/Python/3.12/bin:$PATH"
# export so meson finds pip-installed tools
echo "$HOME/Library/Python/3.12/bin" >> "$GITHUB_PATH"
# PEP 668: pip installs are blocked on the macOS runner, use brew.
brew install ccache nasm ninja meson
# Run the vendored build script from inside the mpv source tree, so the
# native build writes macos_prefix/ and the meson build next to mpv's
+7 -16
View File
@@ -39,9 +39,9 @@ export RANLIB=ranlib
export CFLAGS="-O2 -pipe -Wall"
export LDFLAGS=""
# anything that uses pkg-config
export PKG_CONFIG_SYSROOT_DIR="$prefix_dir"
export PKG_CONFIG_LIBDIR="$PKG_CONFIG_SYSROOT_DIR/lib/pkgconfig"
# Prefix for the static deps we build ourselves, added additively so the
# system/brew pkg-config files (icu-uc, zlib, ...) are still visible.
export PKG_CONFIG_PATH="$prefix_dir/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
# --- Pinned dependency versions -------------------------------------------
# Latest stable tag on or before the mpv v0.41.0 release (2025-12-21).
@@ -50,7 +50,6 @@ DAV1D_VER=1.5.2
LIBPLACEBO_VER=v7.351.0
LIBASS_VER=0.17.4
LCMS2_VER=lcms2.17
ZLIB_VER=1.3.1
FREETYPE_VER=2.14.1
FRIBIDI_VER=1.0.16
HARFBUZZ_VER=12.2.0
@@ -108,15 +107,7 @@ function build_if_missing {
}
## mpv's dependencies (all static, native build)
_zlib () {
gettar "https://zlib.net/fossils/zlib-${ZLIB_VER}.tar.gz"
builddir zlib-${ZLIB_VER}
CC=cc AR=ar RANLIB=ranlib make -fMakefile.lib \
LIBSUFFIX= PREFIX=/ LIBPATH=$prefix_dir/lib install
popd
}
_zlib_mark=lib/libz.a
# macOS ships zlib and iconv in the system, so neither is built here.
_dav1d () {
gitpin https://code.videolan.org/videolan/dav1d.git dav1d "$DAV1D_VER"
@@ -190,7 +181,7 @@ _libass () {
}
_libass_mark=lib/libass.a
for x in zlib dav1d lcms2; do
for x in dav1d lcms2; do
build_if_missing $x
done
for x in ffmpeg freetype fribidi harfbuzz libass; do
@@ -228,8 +219,8 @@ meson setup $build \
-Dshaderc=disabled \
-Dspirv-cross=disabled \
-Dvulkan=disabled \
-Dcocoa=disabled \
-Dgl-cocoa=disabled \
-Dcocoa=enabled \
-Dgl-cocoa=enabled \
-Dcoreaudio=enabled \
-Dvideotoolbox-pl=enabled
meson compile -C $build