#!/usr/bin/env bash set -ex # run this script from the root directory of the mpv repo ./bootstrap.py LUAJIT_PKG_CONFIG_PATH="$(brew --prefix luajit-openresty)/lib/pkgconfig" export PKG_CONFIG_PATH="$LUAJIT_PKG_CONFIG_PATH" # if we only have ffmpeg@4, and not the latest ffmpeg, point to ffmpeg@4 if [[ -z "$(brew ls --versions ffmpeg)" && -n "$(brew ls --versions ffmpeg@4)" ]]; then FFMPEG4_PKG_CONFIG_PATH="$(brew --prefix ffmpeg@4)/lib/pkgconfig" export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$FFMPEG4_PKG_CONFIG_PATH" # if we have neither version of ffmpeg, gtfo elif [[ -z "$(brew ls --versions ffmpeg ffmpeg@4)" ]]; then exit 1 fi ./waf configure --lua=luajit ./waf build ./TOOLS/osxbundle.py -s build/mpv