#!/usr/bin/env bash # Builds mpv & mpv.app on Apple silicon (M1 / M2) Macs. # Run this script from the root directory of the mpv repo. BUNDLE_STATIC=false if [[ $1 == "--static" ]]; then BUNDLE_STATIC=true fi # if anything fails, gtfo set -ex meson setup build meson compile -C build # test the binary we just built ./build/mpv --version ./TOOLS/osxbundle.py --skip-deps build/mpv if $BUNDLE_STATIC; then dylibbundler --bundle-deps --dest-dir ./build/mpv.app/Contents/lib/ --create-dir --install-path @executable_path/../lib/ --fix-file ./build/mpv.app/Contents/MacOS/mpv # test the app binary to make sure all the dylibs made it okay ./build/mpv.app/Contents/MacOS/mpv --version fi