0% found this document useful (0 votes)
231 views

How To Build MPV & MPV - App On An Apple Silicon Mac GitHub

The document provides instructions for building mpv and mpv.app on an Apple silicon Mac. It outlines required dependencies and steps to clone the mpv repo, run a script to build mpv and bundle it into an app, and optionally make a static build. Code signing the bundled app is also mentioned.

Uploaded by

k0k3k0
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
231 views

How To Build MPV & MPV - App On An Apple Silicon Mac GitHub

The document provides instructions for building mpv and mpv.app on an Apple silicon Mac. It outlines required dependencies and steps to clone the mpv repo, run a script to build mpv and bundle it into an app, and optionally make a static build. Code signing the bundled app is also mentioned.

Uploaded by

k0k3k0
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Instantly share code, notes, and snippets.

dbrookman/build-mpv_silicon.sh
Last active last month
Star Code Revisions 28 Stars 70 Forks 11

How to build mpv & mpv.app on an Apple silicon Mac


readme.md

Preparations
Before you can build mpv & mpv.app on an Apple silicon Mac, there's a couple of
required dependencies you'll need to install if you haven't already:
1. Go to System Preferences > Software Update. If there's anything there to
update, do it.
2. If you don't have the Xcode Command Line Tools installed, run xcode-select -
-install and select Install on the prompt that appears.

3. If you don't have Homebrew installed, follow the instructions here.


4. If you don't have all of mpv's dependencies installed, run brew install --
build-from-source --only-dependencies mpv && brew install libplacebo .

You'll also need a local copy of the mpv repo, which you can get by running git
clone https://github.com/mpv-player/mpv .

You can now run the attached script to build mpv & mpv.app on an Apple silicon Mac
yourself. Just make sure to run it from the root directory of the cloned repo.
Static Build
If you want to bundle a static build of mpv.app, perform these steps following the
ones above.
1. Run brew install dylibbundler .
2. Run the script from the root directory of the cloned repo, but append --static
to the command, like ./build-mpv_silicon.sh --static .
Updating
Going forward, you can update your local copy of the repo by running the following
commands from its root directory:
git reset --hard
git clean --force -d -x
git pull origin master

build-mpv_silicon.sh

1 #!/usr/bin/env bash
2
3 # Builds mpv & mpv.app on Apple silicon Macs.
4 # Run this script from the root directory of the mpv repo.
5
6 # if anything fails, gtfo
7 set -ex
8
9 meson setup build
10 meson compile -C build
11 # test the binary we just built
12 ./build/mpv --version
13
14 ./TOOLS/osxbundle.py --skip-deps build/mpv
15 if [[ $1 == "--static" ]]; then
16 dylibbundler --bundle-deps --dest-dir build/mpv.app/Contents/MacOS/lib/ --insta
17 # test the app binary to make sure all the dylibs made it okay
18 ./build/mpv.app/Contents/MacOS/mpv --version
19 fi

Load earlier comments...


Akczht commented on Aug 9, 2023 • edited
@NathanielH-snek You need to code sign the app too, it could be an mpv issue too, I am
not sure.
Ok how should I be doing that? Apologies I find macOS documentation to be all over the place.
Also would it still crash immediately on open if it were unsigned?
Here you go
codesign --force --deep -s - build/mpv.app , yes It will crash every time you open It when it's
unsigned. Also I don't know much about macOS documentation too @dbrookman helped me with
the above command.
RobertYim commented on Aug 12, 2023 • edited
@sandlst Thanks for the heads up, I added pkg-config to the steps.
@ElhemEnohpi @RobertYim @LampPrinter I think I finally found a (sane) way to create a static
build using dylibbundler, just run the script with --static after it. I don't think I missed
anything, but let me know if it doesn't work for you!
Thanks for the update, I've successfully build a static bundle.
Also, if vapoursynth bugs you, it can be solved by disable it in meson_options.txt, or install the mpv
keg created by IINA instead of the official one, it removes some unused dependencies and reduces
the size of the bundle :
brew tap iina/homebrew-mpv-iina
brew install --only-dependencies mpv-iina

Cheers.

mike-hearn commented on Aug 15, 2023


Re: code signing on Sonoma, someone made (and then deleted) a pull request that added code
signing to the build process, but it seems to work well.
You can manually apply this commit to your mpv repo with:
wget -qO- https://github.com/mpv-
player/mpv/commit/cb9c2f3689271483bb3ac6eb7563a9b84d785bcc.patch | git apply -

After applying, building normally worked for me and I was able to open the app bundle without any
problems.

ddiaconu21 commented on Sep 17, 2023


Hello,
I'm facing this issue on the latest Sonoma RC:
Program /Users/doriandiaconu/mpv/TOOLS/macos-sdk-version.py found: YES
(/Users/doriandiaconu/mpv/TOOLS/macos-sdk-version.py)

meson.build:1490:21: ERROR: Command `/Users/doriandiaconu/mpv/TOOLS/macos-sdk-


version.py` failed with status 1.

-----------
Command line: `cc /Users/doriandiaconu/mpv/build/meson-private/tmp79t_3i4r/testfile.c
-o /Users/doriandiaconu/mpv/build/meson-private/tmp79t_3i4r/output.obj -c -O0 -
Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-
command-line-argument -Werror=ignored-optimization-argument -std=c11` -> 1
stderr:
/Users/doriandiaconu/mpv/build/meson-private/tmp79t_3i4r/testfile.c:2:18: fatal error:
'OpenGLES/ES3/glext.h' file not found
#include <OpenGLES/ES3/glext.h>
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
-----------
Header "OpenGLES/ES3/glext.h" has symbol "GL_RGB32F" : NO
Dependency /opt/vc/lib/pkgconfig/mmal.pc skipped: feature rpi-mmal disabled
Pkg-config binary for 1 is cached.
Determining dependency 'libva' with pkg-config executable '/opt/homebrew/bin/pkg-
config'
env[PKG_CONFIG_PATH]:
-----------
Called: `/opt/homebrew/bin/pkg-config --modversion libva` -> 1
stderr:
Package libva was not found in the pkg-config search path.
Perhaps you should add the directory containing `libva.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libva' found
-----------
Finding framework path by running: cc -v -E -

Looking for framework libva in


/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks
CMake binary for 1 is cached as not found
CMake binary for machine 1 not found. Giving up.
Run-time dependency libva found: NO (tried pkgconfig, framework and cmake)
Dependency libva-drm skipped: feature vaapi-drm disabled
Dependency libva-wayland skipped: feature vaapi-wayland disabled
Dependency libva-x11 skipped: feature vaapi-x11 disabled
Dependency vdpau skipped: feature vdpau disabled
Program /Users/doriandiaconu/mpv/TOOLS/macos-sdk-version.py found: YES
(/Users/doriandiaconu/mpv/TOOLS/macos-sdk-version.py)
Running command: /Users/doriandiaconu/mpv/TOOLS/macos-sdk-version.py
--- stdout ---

--- stderr ---


/Users/doriandiaconu/mpv/TOOLS/macos-sdk-version.py:46: SyntaxWarning: invalid escape
sequence '\d'
verRe = re.compile("(\d+)(\D+)(\d+)")
Traceback (most recent call last):
File "/Users/doriandiaconu/mpv/TOOLS/macos-sdk-version.py", line 11, in <module>
from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'

meson.build:1490:21: ERROR: Command `/Users/doriandiaconu/mpv/TOOLS/macos-sdk-


version.py` failed with status 1.

davnozdu commented on Sep 28, 2023


For Sonoma work solution
rm build/mpv.app/Contents/MacOS/mpv-bundle
mv build/mpv.app/Contents/MacOS/mpv build/mpv.app/Contents/MacOS/mpv-bundle
ln -s mpv-bundle build/mpv.app/Contents/MacOS/mpv
codesign --force --deep -s - build/mpv.app

ddiaconu21 commented on Sep 28, 2023


For Sonoma work solution
rm build/mpv.app/Contents/MacOS/mpv-bundle
mv build/mpv.app/Contents/MacOS/mpv build/mpv.app/Contents/MacOS/mpv-bundle
ln -s mpv-bundle build/mpv.app/Contents/MacOS/mpv
codesign --force --deep -s - build/mpv.app

I managed to fix everything by reinstalling sonoma. I think I might have messed up the python
configuration

Akczht commented on Sep 28, 2023


mpv was insta crashing for me too, after updating to sonoma.

PsyPryss commented on Sep 28, 2023 • edited


I get this when I run the script.
mpv works via command line but can't make the .app
The Meson build system
Version: 1.2.1
Source dir: /opt/homebrew/Cellar/mpv
Build dir: /opt/homebrew/Cellar/mpv/build
Build type: native build
Project name: mpv
Project version: 0.36.0-UNKNOWN
C compiler for the host machine: cc (clang 15.0.0 "Apple clang version 15.0.0 (clang-
1500.0.40.1)")
C linker for the host machine: cc ld64 1015.7
Host machine cpu family: aarch64
Host machine cpu: aarch64
Program python3 found: YES
(/Library/Frameworks/Python.framework/Versions/3.11/bin/python3)
Did not find pkg-config by name 'pkg-config'
Found Pkg-config: NO
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency libavcodec found: NO (tried framework)

meson.build:19:13: ERROR: Dependency lookup for libavcodec with method 'pkgconfig'


failed: Pkg-config binary for machine 1 not found. Giving up.
A full log can be found at /opt/homebrew/Cellar/mpv/build/meson-logs/meson-log.txt

And also, where should the repository be downloaded to?


Thanks.

patrickchoi commented on Sep 28, 2023


For Sonoma work solution
rm build/mpv.app/Contents/MacOS/mpv-bundle
mv build/mpv.app/Contents/MacOS/mpv build/mpv.app/Contents/MacOS/mpv-bundle
ln -s mpv-bundle build/mpv.app/Contents/MacOS/mpv
codesign --force --deep -s - build/mpv.app

This worked for me, thank you

nwparker commented on Oct 14, 2023


Doesn't work for me.
Tried building w/ w/o static
Tried w w/o signing
🤷

alphagumibear commented on Oct 14, 2023


Doesn't work for me. Tried building w/ w/o static Tried w w/o signing 🤷
I tried it last night and got it to work. Where do you get hung up?

nwparker commented on Oct 14, 2023 • edited


Doesn't work for me. Tried building w/ w/o static Tried w w/o signing 🤷
I tried it last night and got it to work. Where do you get hung up?
Thanks for the reply.
It seems to build fine (build log below)
Build log
But if open the mpv.app, it does nothing. Nothing appears to happen at all.
If I first sign it with the workaround mentioned by @davnozdu then I get an error when I try to launch
it:
Error Log

alphagumibear commented on Oct 14, 2023


Sorry I'm not a programmer so I don't know how to interpret the logs, but maybe someone else can
help here.
I can just confirm that the command lines in davnozdu's comment were the final crucial steps to get
it to work for me in sonoma.
Doesn't work for me. Tried building w/ w/o static Tried w w/o signing 🤷
I tried it last night and got it to work. Where do you get hung up?
Thanks for the reply.
It seems to build fine (build log below)
Build log
But if open the mpv.app, it does nothing. Nothing appears to happen at all. If I first sign it with
the workaround mentioned by @davnozdu then I get an error when I try to launch it:
Error Log

nwparker commented on Oct 14, 2023


Good news, doing a brew install lua resolved my issue

donie commented on Oct 24, 2023


Earlier builds works just fine, but when I wanted to update today, and ecountered following message.
Looks like related to OpenGL, still trying to find out how to resolve this. But just want to put here in
case anyone aware of the solution?
subprojects/libplacebo/src/opengl/include/glad/meson.build:11:2: ERROR: Problem
encountered: glad (required: >= 2.0, found: none) was not found in PYTHONPATH or
`3rdparty`. Please run `git submodule update --init` followed by `meson --wipe`.

avatar70t commented on Oct 27, 2023


building log
jianwang@jianwangs-Mac-mini mpv % ./build-mpv_silicon.sh --static + meson setup build Directory
already configured.
Just run your build command (e.g. ninja) and Meson will regenerate as necessary.
If ninja fails, run "ninja reconfigure" or "meson setup --reconfigure"
to force Meson to regenerate.
If build failures persist, run "meson setup --wipe" to rebuild from scratch
using the same options as passed when configuring the build.
To change option values, run "meson configure" instead.
meson compile -C build
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /opt/homebrew/bin/ninja -C
/Users/jianwang/Documents/mpv/build
ninja: Entering directory `/Users/jianwang/Documents/mpv/build'
[0/1] Regenerating build files.
The Meson build system
Version: 1.2.3
Source dir: /Users/jianwang/Documents/mpv
Build dir: /Users/jianwang/Documents/mpv/build
Build type: native build
Project name: mpv
Project version: 0.36.0-UNKNOWN
C compiler for the host machine: cc (clang 15.0.0 "Apple clang version 15.0.0 (clang-
1500.0.40.1)")
C linker for the host machine: cc ld64 1015.7
Host machine cpu family: aarch64
Host machine cpu: aarch64
Program python3 found: YES (/opt/homebrew/bin/python3)
Dependency libavcodec found: YES 60.3.100 (cached)
Dependency libavfilter found: YES 9.3.100 (cached)
Dependency libavformat found: YES 60.3.100 (cached)
Dependency libavutil found: YES 58.2.100 (cached)
Dependency libswresample found: YES 4.10.100 (cached)
Dependency libswscale found: YES 7.1.100 (cached)
Dependency libplacebo found: YES 6.338.1 (cached)
Dependency libass found: YES 0.17.1 (cached)
Compiler for C supports arguments -Werror=implicit-function-declaration: YES (cached)
Compiler for C supports arguments -Wempty-body: YES (cached)
Compiler for C supports arguments -Wdisabled-optimization: YES (cached)
Compiler for C supports arguments -Wstrict-prototypes: YES (cached)
Compiler for C supports arguments -Wno-format-zero-length: YES (cached)
Compiler for C supports arguments -Wno-redundant-decls: YES (cached)
Compiler for C supports arguments -Wvla: YES (cached)
Compiler for C supports arguments -Wno-format-truncation: NO (cached)
Compiler for C supports arguments -Wimplicit-fallthrough: YES (cached)
Compiler for C supports arguments -fno-math-errno: YES (cached)
Compiler for C supports arguments -Wformat -Werror=format-security: YES (cached)
Compiler for C supports link arguments -Wl,-z,noexecstack: NO (cached)
Compiler for C supports link arguments -Wl,--nxcompat,--no-seh,--dynamicbase: NO (cached)
Dependency dl found: YES unknown (cached)
Library atomic found: NO
Compiler for C supports link arguments -rdynamic: YES (cached)
Dependency threads found: YES unknown (cached)
Run-time dependency appleframeworks found: YES (Cocoa, IOKit, QuartzCore)
Checking for function "ppoll" : NO (cached)
Library windowsapp skipped: feature uwp disabled
Checking for function "glob" : YES (cached)
Header "sys/vt.h" has symbol "VT_GETMODE" : NO (cached)
Header "sys/consio.h" has symbol "VT_GETMODE" : NO (cached)
Checking for function "fstatfs" : YES (cached)
Checking for function "fstatfs" : NO (cached)
Checking if "vector check" compiles: YES (cached)
Program /Users/jianwang/Documents/mpv/TOOLS/docutils-wrapper.py found: YES
(/Users/jianwang/Documents/mpv/TOOLS/docutils-wrapper.py)
Program /Users/jianwang/Documents/mpv/TOOLS/file2string.py found: YES
(/Users/jianwang/Documents/mpv/TOOLS/file2string.py)
Program /Users/jianwang/Documents/mpv/TOOLS/matroska.py found: YES
(/Users/jianwang/Documents/mpv/TOOLS/matroska.py)
Dependency libcdio skipped: feature cdda disabled
Dependency libcdio_paranoia skipped: feature cdda disabled
Dependency dvdnav skipped: feature dvdnav disabled
Dependency dvdread skipped: feature dvdnav disabled
Dependency iconv found: YES unknown (cached)
Dependency mujs found: YES 1.3.3 (cached)
Dependency lcms2 found: YES 2.15 (cached)
Found pkg-config: /opt/homebrew/bin/pkg-config (0.29.2)
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency libarchive found: NO (tried pkgconfig, framework and cmake)
Dependency libavdevice found: YES 60.1.100 (cached)
Dependency libbluray found: YES 1.3.4 (cached)
Library m found: YES
Library rt found: NO
Run-time dependency lua found: NO (tried pkgconfig, framework and cmake)
Run-time dependency lua52 found: NO (tried pkgconfig, framework and cmake)
Run-time dependency lua5.2 found: NO (tried pkgconfig, framework and cmake)
Run-time dependency lua-5.2 found: NO (tried pkgconfig, framework and cmake)
Dependency luajit found: YES 2.1.1696795921 (cached)
Dependency rubberband found: YES 3.3.0 (cached)
Dependency sdl2 skipped: feature sdl2 disabled
Dependency uchardet found: YES 0.0.8 (cached)
Dependency vapoursynth found: YES 64 (cached)
Dependency vapoursynth-script found: YES 64 (cached)
Dependency zimg found: YES 3.0.5 (cached)
Dependency zlib found: YES 1.2.12 (cached)
Run-time dependency alsa found: NO (tried pkgconfig, framework and cmake)
Dependency appleframeworks (modules: Foundation, AudioToolbox) found: YES unknown
(cached)
Header "AudioToolbox/AudioToolbox.h" has symbol "kAudioUnitSubType_RemoteIO" : NO
(cached)
Run-time dependency appleframeworks found: YES (CoreFoundation, CoreAudio, AudioUnit,
AudioToolbox)
Run-time dependency jack found: NO (tried pkgconfig, framework and cmake)
Dependency openal skipped: feature openal disabled
Library OpenSLES found: NO
Header "sys/soundcard.h" has symbol "SNDCTL_DSP_HALT" : NO (cached)
Run-time dependency libpipewire-0.3 found: NO (tried pkgconfig, framework and cmake)
Run-time dependency libpulse found: NO (tried pkgconfig, framework and cmake)
Run-time dependency sndio found: NO (tried pkgconfig, framework and cmake)
Header "audioclient.h" has symbol "IAudioClient" : NO (cached)
Run-time dependency caca found: NO (tried pkgconfig, framework and cmake)
Has header "d3d9.h" skipped: feature direct3d disabled
Run-time dependency libdrm found: NO (tried pkgconfig, framework and cmake)
Run-time dependency gbm found: NO (tried pkgconfig, framework and cmake)
Dependency libjpeg found: YES 3.0.0 (cached)
Run-time dependency shaderc found: NO (tried pkgconfig, pkgconfig, pkgconfig and system)
Run-time dependency libsixel found: NO (tried pkgconfig, framework and cmake)
Checking for function "shm_open" : YES (cached)
Run-time dependency spirv-cross-c-shared found: NO (tried pkgconfig, framework and cmake)
Run-time dependency wayland-client found: NO (tried pkgconfig, framework and cmake)
Run-time dependency wayland-cursor found: NO (tried pkgconfig, framework and cmake)
Run-time dependency wayland-protocols found: NO (tried pkgconfig, framework and cmake)
Run-time dependency xkbcommon found: NO (tried pkgconfig, framework and cmake)
Run-time dependency wayland-client found: NO (tried pkgconfig, framework and cmake)
Has header "linux/input-event-codes.h" with dependency wayland-client: NO (cached)
Program wayland-scanner found: NO
Dependency x11 found: YES 1.8.7 (cached)
Run-time dependency xscrnsaver found: NO (tried pkgconfig, framework and cmake)
Dependency xext found: YES 1.3.5 (cached)
Run-time dependency xpresent found: NO (tried pkgconfig, framework and cmake)
Run-time dependency xrandr found: NO (tried pkgconfig, framework and cmake)
Dependency xv skipped: feature xv disabled
Dependency appleframeworks (modules: OpenGL) found: YES unknown (cached)
Library EGL found: NO
Run-time dependency egl found: NO (tried pkgconfig, framework and cmake)
Library EGL skipped: feature egl-android disabled
Run-time dependency wayland-egl found: NO (tried pkgconfig, framework and cmake)
Dependency /opt/vc/lib/pkgconfig/brcmegl.pc skipped: feature rpi disabled
Dependency vulkan found: YES 1.3.268 (cached)
Checking for function "vkCreateDisplayPlaneSurfaceKHR" with dependency vulkan: NO
(cached)
Run-time dependency ffnvcodec found: NO (tried pkgconfig, framework and cmake)
Header "OpenGLES/ES3/glext.h" has symbol "GL_RGB32F" : NO (cached)
Dependency /opt/vc/lib/pkgconfig/mmal.pc skipped: feature rpi-mmal disabled
Run-time dependency libva found: NO (tried pkgconfig, framework and cmake)
Dependency libva-drm skipped: feature vaapi-drm disabled
Dependency libva-wayland skipped: feature vaapi-wayland disabled
Dependency libva-x11 skipped: feature vaapi-x11 disabled
Dependency vdpau skipped: feature vdpau disabled
Program /Users/jianwang/Documents/mpv/TOOLS/macos-sdk-version.py found: YES
(/Users/jianwang/Documents/mpv/TOOLS/macos-sdk-version.py)
Message: Detected macOS sdk path: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
Message: Detected macOS SDK: 14.0
../meson.build:1489: WARNING: add_languages is missing native:, assuming languages are wanted
for both host and build.
Objective-C compiler for the host machine: cc (clang 15.0.0)
Objective-C linker for the host machine: cc ld64 1015.7
Program xcrun found: YES (/usr/bin/xcrun)
Program /Library/Developer/CommandLineTools/usr/bin/swift found: YES
(/Library/Developer/CommandLineTools/usr/bin/swift)
Message: Detected Swift version: 5.9
Program /Users/jianwang/Documents/mpv/TOOLS/macos-swift-lib-directory.py found: YES
(/Users/jianwang/Documents/mpv/TOOLS/macos-swift-lib-directory.py)
Message: Detected Swift library directory:
/Library/Developer/CommandLineTools/usr/lib/swift/macosx
Has header "AppKit/NSTouchBar.h" : YES (cached)
Program rst2man found: YES (/opt/homebrew/bin/rst2man)
Program rst2html rst2html.py skipped: feature html-build disabled
Program rst2pdf skipped: feature pdf-build disabled
Configuring config.h using configuration
Message: List of enabled features: av-channel-layout avif-muxer bsd-fstatfs build-date cocoa
coreaudio cplugins darwin debug ffmpeg gl gl-cocoa glob glob-posix gpl iconv javascript jpeg jpegxl
lavu-uuid lcms2 libass libavdevice libbluray libdl libm libplacebo luajit macos-cocoa-cb macos-
media-player macos-touchbar manpage-build osx-thread-name posix posix-shm rubberband
rubberband-3 swift threads uchardet vapoursynth vector videotoolbox-gl vulkan zimg zimg-st428
zlib
Fetching value of define "MPV_CLIENT_API_VERSION" : (((2) << 16) | (2) | 0UL) (cached)
Compiler for C supports link arguments -Wl,-Bsymbolic: NO (cached)
Build targets in project: 24
mpv 0.36.0-UNKNOWN
d3d11 : NO
javascript: YES
libmpv : NO
lua : YES
opengl : YES
vulkan : YES
wayland : NO
x11 : NO
Found ninja-1.11.1 at /opt/homebrew/bin/ninja
Cleaning... 0 files.
[2/40] Compiling C object libmpv.2.dylib.p/video_out_gpu_next_context.c.o
FAILED: libmpv.2.dylib.p/video_out_gpu_next_context.c.o
cc -Ilibmpv.2.dylib.p -I. -I.. -Icommon -Ietc -Iplayer/javascript -Iplayer/lua -Isub -ITOOLS/osxbundle -
Iosdep -I/opt/homebrew/Cellar/libass/0.17.1/include -I/opt/homebrew/Cellar/libunibreak/5.1/include -
I/opt/homebrew/Cellar/harfbuzz/8.2.2/include/harfbuzz -
I/opt/homebrew/Cellar/glib/2.78.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.78.0/lib/glib-
2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.42/include -
I/opt/homebrew/Cellar/graphite2/1.3.14/include -I/opt/homebrew/Cellar/fribidi/1.0.13/include/fribidi -
I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/opt/libpng/include/libpng16 -
I/opt/homebrew/Cellar/ffmpeg/6.0_1/include -I/opt/homebrew/Cellar/libplacebo/6.338.1/include -
I/opt/homebrew/Cellar/mujs/1.3.3/include -I/opt/homebrew/Cellar/little-cms2/2.15/include -
I/opt/homebrew/Cellar/libbluray/1.3.4/include -I/opt/homebrew/Cellar/fontconfig/2.14.2/include -
I/opt/homebrew/Cellar/luajit/2.1.1696795921/include/luajit-2.1 -
I/opt/homebrew/Cellar/rubberband/3.3.0/include -I/opt/homebrew/Cellar/libsamplerate/0.2.2/include -
I/opt/homebrew/Cellar/uchardet/0.0.8/include/uchardet -
I/opt/homebrew/Cellar/vapoursynth/64/include/vapoursynth -
I/opt/homebrew/Cellar/zimg/3.0.5/include -
I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11 -
I/opt/homebrew/Cellar/jpeg-turbo/3.0.0/include -I/opt/homebrew/Cellar/vulkan-loader/1.3.268/include
-fvisibility=hidden -fcolor-diagnostics -Wall -Winvalid-pch -std=c11 -O2 -g -D_GNU_SOURCE -
D_FILE_OFFSET_BITS=64 -Werror=implicit-function-declaration -Wempty-body -Wdisabled-
optimization -Wstrict-prototypes -Wno-format-zero-length -Wno-redundant-decls -Wvla -Wimplicit-
fallthrough -fno-math-errno -Wformat -Werror=format-security -Wno-logical-op-parentheses -Wno-
switch -Wno-tautological-compare -Wno-pointer-sign -Wno-tautological-constant-out-of-range-
compare -MD -MQ libmpv.2.dylib.p/video_out_gpu_next_context.c.o -MF
libmpv.2.dylib.p/video_out_gpu_next_context.c.o.d -o
libmpv.2.dylib.p/video_out_gpu_next_context.c.o -c ../video/out/gpu_next/context.c
In file included from ../video/out/gpu_next/context.c:50:
In file included from ../video/out/vulkan/context.h:4:
In file included from ../video/out/vulkan/common.h:30:
/opt/homebrew/Cellar/libplacebo/6.338.1/include/libplacebo/vulkan.h:21:10: fatal error:
'vulkan/vulkan.h' file not found
#include <vulkan/vulkan.h>
^~~~~~~~~~~~~~~~~
1 error generated.
[9/40] Compiling Objective-C object li...ylib.p/video_out_cocoa_events_view.m.o
../video/out/cocoa/events_view.m:42:41: warning: 'NSFilenamesPboardType' is deprecated: first
deprecated in macOS 10.14 - Create multiple pasteboard items with NSPasteboardTypeFileURL or
kUTTypeFileURL instead [-Wdeprecated-declarations]
[self registerForDraggedTypes:@[NSFilenamesPboardType,
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.frame
work/Headers/NSPasteboard.h:312:32: note: 'NSFilenamesPboardType' has been explicitly marked
deprecated here
APPKIT_EXTERN NSPasteboardType NSFilenamesPboardType API_DEPRECATED("Create multiple
pasteboard items with NSPasteboardTypeFileURL or kUTTypeFileURL instead", macos(10.0,10.14));
^
../video/out/cocoa/events_view.m:43:41: warning: 'NSURLPboardType' is deprecated: first
deprecated in macOS 10.14 [-Wdeprecated-declarations]
NSURLPboardType]];
^~~~~~~~~~~~~~~
NSPasteboardTypeURL
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.frame
work/Headers/NSPasteboard.h:321:32: note: 'NSURLPboardType' has been explicitly marked
deprecated here
APPKIT_EXTERN NSPasteboardType NSURLPboardType
API_DEPRECATED_WITH_REPLACEMENT("NSPasteboardTypeURL", macos(10.0,10.14));
^
../video/out/cocoa/events_view.m:308:31: warning: 'NSFilenamesPboardType' is deprecated: first
deprecated in macOS 10.14 - Create multiple pasteboard items with NSPasteboardTypeFileURL or
kUTTypeFileURL instead [-Wdeprecated-declarations]
if ([types containsObject:NSFilenamesPboardType] ||
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.frame
work/Headers/NSPasteboard.h:312:32: note: 'NSFilenamesPboardType' has been explicitly marked
deprecated here
APPKIT_EXTERN NSPasteboardType NSFilenamesPboardType API_DEPRECATED("Create multiple
pasteboard items with NSPasteboardTypeFileURL or kUTTypeFileURL instead", macos(10.0,10.14));
^
../video/out/cocoa/events_view.m:309:31: warning: 'NSURLPboardType' is deprecated: first
deprecated in macOS 10.14 [-Wdeprecated-declarations]
[types containsObject:NSURLPboardType]) {
^~~~~~~~~~~~~~~
NSPasteboardTypeURL
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.frame
work/Headers/NSPasteboard.h:321:32: note: 'NSURLPboardType' has been explicitly marked
deprecated here
APPKIT_EXTERN NSPasteboardType NSURLPboardType
API_DEPRECATED_WITH_REPLACEMENT("NSPasteboardTypeURL", macos(10.0,10.14));
^
../video/out/cocoa/events_view.m:319:40: warning: 'NSFilenamesPboardType' is deprecated: first
deprecated in macOS 10.14 - Create multiple pasteboard items with NSPasteboardTypeFileURL or
kUTTypeFileURL instead [-Wdeprecated-declarations]
if ([[pboard types] containsObject:NSFilenamesPboardType]) {
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.frame
work/Headers/NSPasteboard.h:312:32: note: 'NSFilenamesPboardType' has been explicitly marked
deprecated here
APPKIT_EXTERN NSPasteboardType NSFilenamesPboardType API_DEPRECATED("Create multiple
pasteboard items with NSPasteboardTypeFileURL or kUTTypeFileURL instead", macos(10.0,10.14));
^
../video/out/cocoa/events_view.m:320:56: warning: 'NSFilenamesPboardType' is deprecated: first
deprecated in macOS 10.14 - Create multiple pasteboard items with NSPasteboardTypeFileURL or
kUTTypeFileURL instead [-Wdeprecated-declarations]
NSArray *pbitems = [pboard propertyListForType:NSFilenamesPboardType];
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.frame
work/Headers/NSPasteboard.h:312:32: note: 'NSFilenamesPboardType' has been explicitly marked
deprecated here
APPKIT_EXTERN NSPasteboardType NSFilenamesPboardType API_DEPRECATED("Create multiple
pasteboard items with NSPasteboardTypeFileURL or kUTTypeFileURL instead", macos(10.0,10.14));
^
../video/out/cocoa/events_view.m:323:47: warning: 'NSURLPboardType' is deprecated: first
deprecated in macOS 10.14 [-Wdeprecated-declarations]
} else if ([[pboard types] containsObject:NSURLPboardType]) {
^~~~~~~~~~~~~~~
NSPasteboardTypeURL
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.frame
work/Headers/NSPasteboard.h:321:32: note: 'NSURLPboardType' has been explicitly marked
deprecated here
APPKIT_EXTERN NSPasteboardType NSURLPboardType
API_DEPRECATED_WITH_REPLACEMENT("NSPasteboardTypeURL", macos(10.0,10.14));
^
7 warnings generated.
[11/40] Generating manpages with a custom command
ninja: build stopped: subcommand failed.
I'm successed build on sonoma 14.0 , but failed on sonoma 14.1

sandlst commented on Oct 27, 2023


building log
I'm successed build on sonoma 14.0 , but failed on sonoma 14.1
I'm having this too; related bug:
mpv-player/mpv#12673
This build guide works and uses non-homebrew versions of a lot of deps; it makes me wonder if
there is a bug in one of the homebrew Vulkan packages or possibly pkgconf.

LampPrinter commented on Oct 27, 2023 • edited


Getting this on Sonoma 14.1
M1 MacBook
Run-time dependency libplacebo found: NO (tried pkgconfig and framework)
meson.build:26:13: ERROR: Dependency "libplacebo" not found, tried pkgconfig and framework

After installing libplacebo from homebrew getting this


/opt/homebrew/Cellar/libplacebo/6.338.1/include/libplacebo/vulkan.h:21:10: fatal error:
'vulkan/vulkan.h' file not found

Akczht commented on Oct 29, 2023 • edited


has anybody managed to get a working mpv.app with dependencies on sonoma 14.1, I haven't been
able to do so, but unpacked binaries work fine.

mcp73 commented on Nov 1, 2023


After installing libplacebo from homebrew getting this
/opt/homebrew/Cellar/libplacebo/6.338.1/include/libplacebo/vulkan.h:21:10: fatal
error: 'vulkan/vulkan.h' file not found

I'm seeing the exact same error on Ventura 13.6.1

guyman624 commented on Nov 1, 2023 • edited


After installing libplacebo from homebrew getting this
/opt/homebrew/Cellar/libplacebo/6.338.1/include/libplacebo/vulkan.h:21:10: fatal
error: 'vulkan/vulkan.h' file not found

same issue, Sonoma 14.1, M1 Mac, Xcode 15, 15.0.1, 15.1 beta
Edit:
Installing this fixed it : https://vulkan.lunarg.com/sdk/home#mac

LampPrinter commented on Nov 1, 2023 • edited


After installing libplacebo from homebrew getting this
/opt/homebrew/Cellar/libplacebo/6.338.1/include/libplacebo/vulkan.h:21:10: fatal
error: 'vulkan/vulkan.h' file not found

same issue, Sonoma 14.1, M1 Mac, Xcode 15, 15.0.1, 15.1 beta
Edit: Installing this fixed it : https://vulkan.lunarg.com/sdk/home#mac
Explain a bit.
Just installing this file "vulkansdk-macos-1.3.268.1.dmg"?
Edit - Yeah, selecting all the components during install did the trick.

donie commented on Nov 1, 2023


After installing libplacebo from homebrew getting this
/opt/homebrew/Cellar/libplacebo/6.338.1/include/libplacebo/vulkan.h:21:10: fatal
error: 'vulkan/vulkan.h' file not found

same issue, Sonoma 14.1, M1 Mac, Xcode 15, 15.0.1, 15.1 beta
Edit: Installing this fixed it : https://vulkan.lunarg.com/sdk/home#mac
Thanks for this, I followed with installer with the dmg file, basically selected all components, and now
it's working.

spikeh commented on Nov 7, 2023


For Sonoma work solution
rm build/mpv.app/Contents/MacOS/mpv-bundle
mv build/mpv.app/Contents/MacOS/mpv build/mpv.app/Contents/MacOS/mpv-bundle
ln -s mpv-bundle build/mpv.app/Contents/MacOS/mpv
codesign --force --deep -s - build/mpv.app

Thanks, this worked for me.

nickeltingupta commented on Nov 10, 2023


For Sonoma work solution
rm build/mpv.app/Contents/MacOS/mpv-bundle
mv build/mpv.app/Contents/MacOS/mpv build/mpv.app/Contents/MacOS/mpv-bundle
ln -s mpv-bundle build/mpv.app/Contents/MacOS/mpv
codesign --force --deep -s - build/mpv.app

This worked for me on Sonoma. I was having "flashing screen" issue and this fixed it, thanks a lot!

dbrookman commented on Nov 16, 2023 Author


This just got merged, so you shouldn't have to fiddle with mpv-bundle or do any code-signing on
your own any longer.
Also, if you don't have libplacebo installed, you'll need to run brew install libplacebo . I've
updated the instructions accordingly.

sandlst commented on Nov 18, 2023


building log
I'm successed build on sonoma 14.0 , but failed on sonoma 14.1
I'm having this too; related bug: mpv-player/mpv#12673
This build guide works and uses non-homebrew versions of a lot of deps; it makes me wonder if
there is a bug in one of the homebrew Vulkan packages or possibly pkgconf.
In case anyone else is having the same issue:
/opt/homebrew/Cellar/libplacebo/6.338.1_1/include/libplacebo/vulkan.h:21:10: fatal error:
'vulkan/vulkan.h' file not found
when trying to build; I think messing around with the Vulkan-SDK installer and then trying to go back
to homebrew's vulkan/libplacebo was the cause of it for me. After completely removing the vulkan-
sdk and forcing brew to reinstall libplacebo, vulkan-headers, and vulkan-loader I was able to build
mpv again. Even after removing the SDK it was still giving me that error until I force reinstalled those
homebrew packages....I reinstalled all of them at once so I'm not sure which one(s) were responsible.

Akczht commented on Nov 18, 2023


I recently was able to build a standalone mpv app, without any errors after the latest commit bringing
support hw decoding of libplacebo with videotoolbox, all I did was install molten-vk and libplacebo I
got no errors.

PsyPryss commented on Nov 19, 2023


/!\ WARNING : can't get path for '@rpath/libspirv-cross-c-shared.0.dylib'
What other dependencies am I missing. I'm trying to compile a static build.

temberature commented on Dec 7, 2023


The Absolute Beginner's Guide to Installing and Using Meson
https://mesonbuild.com/SimpleStart.html

You might also like