1################################################################################
2#
3# mpv
4#
5################################################################################
6
7MPV_VERSION = 0.35.1
8MPV_SITE = $(call github,mpv-player,mpv,v$(MPV_VERSION))
9MPV_DEPENDENCIES = \
10	host-pkgconf ffmpeg libass zlib \
11	$(if $(BR2_PACKAGE_LIBICONV),libiconv)
12MPV_LICENSE = GPL-2.0+
13MPV_LICENSE_FILES = LICENSE.GPL
14MPV_CPE_ID_VENDOR = mpv
15MPV_INSTALL_STAGING = YES
16
17MPV_NEEDS_EXTERNAL_WAF = YES
18
19# Some of these options need testing and/or tweaks
20MPV_CONF_OPTS = \
21	--prefix=/usr \
22	--disable-android \
23	--disable-caca \
24	--disable-cocoa \
25	--disable-coreaudio \
26	--disable-cuda-hwaccel \
27	--disable-opensles \
28	--disable-rubberband \
29	--disable-uchardet \
30	--disable-vapoursynth
31
32ifeq ($(BR2_REPRODUCIBLE),y)
33MPV_CONF_OPTS += --disable-build-date
34endif
35
36ifeq ($(BR2_STATIC_LIBS),y)
37MPV_CONF_OPTS += --disable-libmpv-shared --enable-libmpv-static
38else
39MPV_CONF_OPTS += --enable-libmpv-shared --disable-libmpv-static
40endif
41
42ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
43MPV_CONF_OPTS += --enable-alsa
44MPV_DEPENDENCIES += alsa-lib
45else
46MPV_CONF_OPTS += --disable-alsa
47endif
48
49ifeq ($(BR2_PACKAGE_MESA3D_GBM),y)
50MPV_CONF_OPTS += --enable-gbm
51MPV_DEPENDENCIES += mesa3d
52ifeq ($(BR2_PACKAGE_LIBDRM),y)
53MPV_CONF_OPTS += --enable-egl-drm
54else
55MPV_CONF_OPTS += --disable-egl-drm
56endif
57else
58MPV_CONF_OPTS += --disable-gbm --disable-egl-drm
59endif
60
61# jack support
62# It also requires 64-bit sync intrinsics
63ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_8)$(BR2_PACKAGE_JACK2),yy)
64MPV_CONF_OPTS += --enable-jack
65MPV_DEPENDENCIES += jack2
66else
67MPV_CONF_OPTS += --disable-jack
68endif
69
70# jpeg support
71ifeq ($(BR2_PACKAGE_JPEG),y)
72MPV_CONF_OPTS += --enable-jpeg
73MPV_DEPENDENCIES += jpeg
74else
75MPV_CONF_OPTS += --disable-jpeg
76endif
77
78# lcms2 support
79ifeq ($(BR2_PACKAGE_LCMS2),y)
80MPV_CONF_OPTS += --enable-lcms2
81MPV_DEPENDENCIES += lcms2
82else
83MPV_CONF_OPTS += --disable-lcms2
84endif
85
86# libarchive support
87ifeq ($(BR2_PACKAGE_LIBARCHIVE),y)
88MPV_CONF_OPTS += --enable-libarchive
89MPV_DEPENDENCIES += libarchive
90else
91MPV_CONF_OPTS += --disable-libarchive
92endif
93
94# bluray support
95ifeq ($(BR2_PACKAGE_LIBBLURAY),y)
96MPV_CONF_OPTS += --enable-libbluray
97MPV_DEPENDENCIES += libbluray
98else
99MPV_CONF_OPTS += --disable-libbluray
100endif
101
102# libcdio-paranoia
103ifeq ($(BR2_PACKAGE_LIBCDIO_PARANOIA),y)
104MPV_CONF_OPTS += --enable-cdda
105MPV_DEPENDENCIES += libcdio-paranoia
106else
107MPV_CONF_OPTS += --disable-cdda
108endif
109
110# libdvdnav
111ifeq ($(BR2_PACKAGE_LIBDVDNAV),y)
112MPV_CONF_OPTS += --enable-dvdnav
113MPV_DEPENDENCIES += libdvdnav
114else
115MPV_CONF_OPTS += --disable-dvdnav
116endif
117
118# libdrm
119ifeq ($(BR2_PACKAGE_LIBDRM),y)
120MPV_CONF_OPTS += --enable-drm
121MPV_DEPENDENCIES += libdrm
122else
123MPV_CONF_OPTS += --disable-drm
124endif
125
126# libvdpau
127ifeq ($(BR2_PACKAGE_LIBVDPAU),y)
128MPV_CONF_OPTS += --enable-vdpau
129MPV_DEPENDENCIES += libvdpau
130else
131MPV_CONF_OPTS += --disable-vdpau
132endif
133
134# LUA support, only for lua51/lua52/luajit
135# This enables the controller (OSD) together with libass
136ifeq ($(BR2_PACKAGE_LUA_5_1)$(BR2_PACKAGE_LUAJIT),y)
137MPV_CONF_OPTS += --enable-lua
138MPV_DEPENDENCIES += luainterpreter
139else
140MPV_CONF_OPTS += --disable-lua
141endif
142
143# OpenGL support
144ifeq ($(BR2_PACKAGE_HAS_LIBGL),y)
145MPV_CONF_OPTS += --enable-gl
146MPV_DEPENDENCIES += libgl
147else ifeq ($(BR2_PACKAGE_HAS_LIBGLES),y)
148MPV_CONF_OPTS += --enable-gl
149MPV_DEPENDENCIES += libgles
150else ifeq ($(BR2_PACKAGE_HAS_LIBEGL),y)
151MPV_CONF_OPTS += --enable-gl
152MPV_DEPENDENCIES += libegl
153else
154MPV_CONF_OPTS += --disable-gl
155endif
156
157# pulseaudio support
158ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
159MPV_CONF_OPTS += --enable-pulse
160MPV_DEPENDENCIES += pulseaudio
161else
162MPV_CONF_OPTS += --disable-pulse
163endif
164
165# SDL support
166# Sdl2 requires 64-bit sync intrinsics
167ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_8)$(BR2_PACKAGE_SDL2),yy)
168MPV_CONF_OPTS += --enable-sdl2
169MPV_DEPENDENCIES += sdl2
170else
171MPV_CONF_OPTS += --disable-sdl2
172endif
173
174# Raspberry Pi support
175ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
176MPV_CONF_OPTS += --enable-rpi --enable-gl
177MPV_DEPENDENCIES += rpi-userland
178else
179MPV_CONF_OPTS += --disable-rpi
180endif
181
182# va-api support
183ifeq ($(BR2_PACKAGE_LIBVA)$(BR2_PACKAGE_MPV_SUPPORTS_VAAPI),yy)
184MPV_CONF_OPTS += --enable-vaapi
185MPV_DEPENDENCIES += libva
186ifeq ($(BR2_PACKAGE_LIBDRM)$(BR2_PACKAGE_MESA3D_OPENGL_EGL),yy)
187MPV_CONF_OPTS += --enable-vaapi-drm
188else
189MPV_CONF_OPTS += --disable-vaapi-drm
190endif
191else
192MPV_CONF_OPTS += --disable-vaapi --disable-vaapi-drm
193endif
194
195# wayland support
196ifeq ($(BR2_PACKAGE_WAYLAND),y)
197MPV_CONF_OPTS += --enable-wayland
198MPV_DEPENDENCIES += libxkbcommon wayland wayland-protocols
199else
200MPV_CONF_OPTS += --disable-wayland
201endif
202
203# Base X11 support. Config.in ensures that if BR2_PACKAGE_XORG7 is
204# enabled, xlib_libX11, xlib_libXext, xlib_libXinerama,
205# xlib_libXrandr, xlib_libXScrnSaver.
206ifeq ($(BR2_PACKAGE_XORG7),y)
207MPV_CONF_OPTS += --enable-x11
208MPV_DEPENDENCIES += \
209	xlib_libX11 \
210	xlib_libXext \
211	xlib_libXinerama \
212	xlib_libXpresent \
213	xlib_libXrandr \
214	xlib_libXScrnSaver
215# XVideo
216ifeq ($(BR2_PACKAGE_XLIB_LIBXV),y)
217MPV_CONF_OPTS += --enable-xv
218MPV_DEPENDENCIES += xlib_libXv
219else
220MPV_CONF_OPTS += --disable-xv
221endif
222else
223MPV_CONF_OPTS += --disable-x11
224endif
225
226ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
227MPV_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -latomic"
228endif
229
230$(eval $(waf-package))
231