The time-consuming part is not building MPV itself, but the long list of dependencies requiring a rebuild in order to fully satisfy the deployment target version. Setting MACOSX_DEPLOYMENT_TARGET in the immediate environment doesn't always propagate, resulting in target mix-ups and build failures for some dependencies. The only working solution I've found is to enforce within the formulas themselves. The following script adjusts the bulk of this:
#!/bin/sh
path='/path/to/homebrew/Library/Taps/homebrew/homebrew-core/Formula'
for dep in pkg-config makedepend autoconf automake openssl [email protected] libpng jpeg libtiff youtube-dl little-cms2 gettext libffi pcre libtool freetype fontconfig cairo pixman graphite2 icu4c harfbuzz glib libogg libvorbis flac libsamplerate libsndfile rubberband theora nasm readline sqlite gdbm xz python@2 python gobject-introspection docutils fribidi texi2html libass ffmpeg mujs mpv
do
sed -i.bu $'s/def install/def install\\\n ENV["MACOSX_DEPLOYMENT_TARGET"] = "10.10"\\\n/' $path/$dep.rb
done
...followed by a manual fix:
brew edit python@2 # comment out "args << MACOSX_DEPLOYMENT_TARGET=..."
I do these separately with tests disabled (which comes with some small risk) in order to speed things up since I'm still using pre-2010 hardware:
brew edit libpng # comment out "make test"
brew install --build-from-source pkg-config makedepend autoconf automake
brew install --build-from-source --without-test openssl
Build most of the dependencies (this will take a while):
brew install --build-from-source --without-luarocks [email protected]
brew install --build-from-source libpng jpeg libtiff youtube-dl little-cms2 gettext libffi pcre libtool glib freetype fontconfig pixman cairo libogg libvorbis theora readline sqlite gdbm xz python@2 python gobject-introspection docutils fribidi texi2html nasm flac libsamplerate libsndfile rubberband graphite2 icu4c ragel harfbuzz libass mujs
Build ffmpeg with a few twists - this is not optimal for everyone but I'm still lacking feedback from users:
brew install --build-from-source --with-openssl --with-theora --with-rubberband --without-lame --without-x264 --without-xvid ffmpeg
Finally, build MPV:
brew install --build-from-source --with-bundle mpv
A simple check to make sure all libraries came out with the correct target version:
for l in /path/to/mpv.app/Contents/MacOS/lib/*.dylib; do echo -e "\n$l"; otool -l $l | grep -A 2 LC_VERSION_MIN_MACOSX; done