actions/checkout runs 'git clean -fdx' on the workspace by default, so
when it ran after actions/download-artifact it deleted the freshly
downloaded untracked artifacts/ directory. The publish step then failed
with 'cp: cannot stat artifacts/mpv-natives-linux-x86_64/libmpv.so'.
Swap the two steps so the download runs after the clean.
A reusable workflow only exposes top-level workflow_call outputs to the
caller; job outputs are not visible. release.yml read the version from the
build jobs' outputs, which is empty when called via workflow_call, so the
publish job failed with 'mpv version not set' and the v0.41.0 release was
never published.
Each build-* workflow now exposes the version as a workflow_call output,
and release.yml reads it from needs.<job>.outputs.version instead of the
nested needs.<job>.<inner>.outputs.version path.
mpv is dual-licensed (LGPL-2.1+/GPL-2+). We build it with -Dgpl=false
and FFmpeg without --enable-gpl (every enabled feature - mjpeg/png
encoders, spdif muxer, libdav1d, all decoders - is LGPL-available), so
the resulting library is LGPL-2.1-or-later instead of GPL. That is the
license path applications embedding libmpv in-process (via JNA, as
jlibmpv does) need, since a GPL build's copyleft obligations would
reach into them.
Also ship a LICENSE-NOTICE.txt with each release and fix the release
workflow's reference to the reusable workflows' job outputs (needs.<id>.
<jobname>.outputs). Docs: README license section now states the LGPL
position explicitly.
- Introduce ci/versions.env as the single source of truth for the mpv tag
and every dependency pin; the three build scripts and all workflows now
source it instead of redeclaring versions inline.
- Add release.yml: on a v* tag it reuses the three per-platform build
workflows (workflow_call) and publishes the bare libmpv.so / .dll / .dylib
assets plus a combined checksums.txt as a GitHub Release.
- Rework build-*.yml: trigger on pull_request (PR check) and workflow_call
instead of push to main, and expose the artifact name/version as job
outputs so release.yml can assemble the release assets.
- Route the Linux build through ccache (CC/CXX) so the CI ccache is actually
populated and reused, fixing the 'Path Validation Error' on cache save.
* fix: link libmpv against the system libasound instead of a static build
A statically linked libasound fails at runtime with 'Unknown PCM
cards.pcm.default': the default PCM is resolved dynamically per sound card
(load_for_all_cards hook enumerating cards and loading cards/<driver>.conf),
and that machinery did not work in the vendored archive, so audio produced no
output even though the config file itself was found (the earlier
--with-configdir prefix bug is fixed).
Link libasound.so.2 dynamically from the system (libasound2-dev), exactly like
CoreAudio on macOS and WASAPI on Windows: the OS audio stack stays external,
all video dependencies remain static and self-contained.
The build script no longer builds alsa-lib (the _alsa step, ALSA_VER pin and
the autoreconf dependency it needed are gone); meson resolves the system
'alsa' dependency via pkg-config. The workflow installs libasound2-dev, drops
autoconf/automake/libtool, and verifies ldd shows libasound.so.2 instead of
asserting a baked-in config dir.
* fix: enable PipeWire/Pulse AOs so audio works on PipeWire desktops
On a desktop where PipeWire owns the sound cards, the direct ALSA/dmix
'default' path is broken: snd_pcm_open('default') resolves to a dmix slave
that cannot be opened (verified: aplay -D default fails identically, while
aplay -D pulse works). libmpv with only the ALSA AO therefore got no sound.
mpv auto-probes audio drivers in the order pipewire -> pulse -> alsa, so
enable all three (each linked against its system shared lib, consistent with
CoreAudio/WASAPI). On a PipeWire/Pulse box it now uses the working server
before ever falling back to the direct ALSA path.
The workflow installs libpipewire-0.3-dev and libpulse-dev alongside
libasound2-dev, and the artifact verification now accepts any of the three
system audio libs instead of only libasound.
---------
Co-authored-by: david <david@phoenix.ipv64.de>
Pinning fontconfig's sysconfdir to /etc made the build try to install its
own conf files into the real /etc/fonts/conf.d, which fails without root
on the runner (PermissionError). Revert to the default prefix: the
prefix-baked config paths are harmless because fontconfig falls back to a
built-in config that scans /usr/share/fonts and /usr/local/share/fonts when
no config file exists at the compiled-in path - so libass's font lookup
works on any standard box without env vars.
Also tighten the artifact verification: instead of a broad build-path grep
(which would false-positive on fontconfig's benign prefix strings), assert
the ALSA config dir is the system path and not the build prefix - the
specific regression that broke audio.
Two runtime bugs in the shipped artifact:
1. ALSA: the static libasound carried ALSA_CONFIG_DIR pointing at the
build prefix (linux_prefix/share/alsa), so snd_pcm_open("default")
failed on any machine without that path ("Unknown PCM default",
video worked, audio did not). Build alsa-lib with
--with-configdir=/usr/share/alsa so the compile-time default is the
canonical system location.
2. Size: the release .so still contained ~110 MB of DWARF debug sections
(whole ffmpeg tree); strip --strip-all the artifact in the collect
step, matching the windows build.
Also pin fontconfig's sysconfdir/localstatedir to /etc and /var so the
CONFIGDIR/FONTCONFIG_PATH/FC_CACHEDIR constants compiled into libass's
font stack resolve on any standard install (the runtime config search
falls back to the compiled-in CONFIGDIR and a built-in default config
when no FONTCONFIG_FILE/FONTCONFIG_PATH is set).
The workflow now verifies the artifact: ldd shows only system libs, no
debug sections remain, and no build-machine paths leaked into the
binary.
Add a native x86_64 Linux build (ci/build-libmpv-linux.sh,
build-linux.yml). Every dependency is static and linked into a single
libmpv.so; only glibc/pthread/dl/m and the system zlib remain external.
The Linux-only additions are the font stack (fontconfig -> expat, where
macOS/Windows use CoreText/DirectWrite) and alsa audio output; gl is the
plain render-API support (no X11/Wayland context, since jlibmpv supplies
the GL context via JOGL).
For consistency, ship a single native per platform and no public headers
(jlibmpv loads the library via JNA and never compiles against it). Remove
the accidental header/import-library copies from the Windows build and the
phantom header copy from the macOS build.
meson names the shared library libmpv.2.dylib on macOS, not
libmpv-2.dylib as on Windows. Fix the collect step in the build script
and the lipo inputs in the workflow.
GitHub's macOS runners are all arm64 now, so the two parallel per-arch
jobs are obsolete: one macos-15 runner builds the arm64 slice natively
and the x86_64 slice via clang --target=x86_64-apple-darwin, then lipo
merges both into the universal libmpv.dylib. The build script is now
parameterized by ARCH, installs every meson dependency into its own
macos_prefix-<arch> (meson's macOS default prefix is /opt/homebrew),
uses release buildtype for the static deps, and disables harfbuzz icu
(the brew icu4c on the runner is arm64-only and must not leak into the
x86_64 slice).
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.
Vendor ci/build-libmpv-macos.sh, which builds every dependency statically
for the native runner architecture and links them into a single
self-contained libmpv dylib (coreaudio output, videotoolbox hardware
decode, OpenGL render API; no vulkan/cocoa player). build-macos.yml runs
it on macos-14 (x86_64) and macos-15 (arm64) in parallel and a merge job
combines the two dylibs into one universal libmpv.dylib with lipo, matching
the file name jlibmpv expects on macOS.
The release build type emits DWARF .debug_* sections even for the MinGW
cross build, inflating libmpv-2.dll to ~169 MB. Strip them with
TARGET-strip --strip-all so only code/data remain. Also hand upload-artifact
the folder directly instead of a pre-zipped file, so the artifact is a
single-level archive rather than a zip containing a zip.
Vendored ci/build-libmpv-mingw64.sh builds every dependency statically and
links the single libmpv-2.dll against those archives with a static CRT, so
the artifact depends only on Windows system DLLs. Dependency versions are
pinned to the latest stable tag on the mpv v0.41.0 release date. Vulkan,
shaderc and SPIRV-Cross are dropped (jlibmpv renders through an external
OpenGL context). The workflow no longer needs a Rust toolchain.