xref: /OK3568_Linux_fs/buildroot/package/mpv/mpv.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# mpv
4#
5################################################################################
6
7MPV_VERSION = 0.33.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
42# ALSA support requires pcm+mixer
43ifeq ($(BR2_PACKAGE_ALSA_LIB_MIXER)$(BR2_PACKAGE_ALSA_LIB_PCM),yy)
44MPV_CONF_OPTS += --enable-alsa
45MPV_DEPENDENCIES += alsa-lib
46else
47MPV_CONF_OPTS += --disable-alsa
48endif
49
50ifeq ($(BR2_PACKAGE_MESA3D_GBM),y)
51MPV_CONF_OPTS += --enable-gbm
52MPV_DEPENDENCIES += mesa3d
53ifeq ($(BR2_PACKAGE_LIBDRM),y)
54MPV_CONF_OPTS += --enable-egl-drm
55else
56MPV_CONF_OPTS += --disable-egl-drm
57endif
58else
59MPV_CONF_OPTS += --disable-gbm --disable-egl-drm
60endif
61
62# jack support
63# It also requires 64-bit sync intrinsics
64ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_8)$(BR2_PACKAGE_JACK2),yy)
65MPV_CONF_OPTS += --enable-jack
66MPV_DEPENDENCIES += jack2
67else
68MPV_CONF_OPTS += --disable-jack
69endif
70
71# jpeg support
72ifeq ($(BR2_PACKAGE_JPEG),y)
73MPV_CONF_OPTS += --enable-jpeg
74MPV_DEPENDENCIES += jpeg
75else
76MPV_CONF_OPTS += --disable-jpeg
77endif
78
79# lcms2 support
80ifeq ($(BR2_PACKAGE_LCMS2),y)
81MPV_CONF_OPTS += --enable-lcms2
82MPV_DEPENDENCIES += lcms2
83else
84MPV_CONF_OPTS += --disable-lcms2
85endif
86
87# libarchive support
88ifeq ($(BR2_PACKAGE_LIBARCHIVE),y)
89MPV_CONF_OPTS += --enable-libarchive
90MPV_DEPENDENCIES += libarchive
91else
92MPV_CONF_OPTS += --disable-libarchive
93endif
94
95# bluray support
96ifeq ($(BR2_PACKAGE_LIBBLURAY),y)
97MPV_CONF_OPTS += --enable-libbluray
98MPV_DEPENDENCIES += libbluray
99else
100MPV_CONF_OPTS += --disable-libbluray
101endif
102
103# libcdio-paranoia
104ifeq ($(BR2_PACKAGE_LIBCDIO_PARANOIA),y)
105MPV_CONF_OPTS += --enable-cdda
106MPV_DEPENDENCIES += libcdio-paranoia
107else
108MPV_CONF_OPTS += --disable-cdda
109endif
110
111# libdvdnav
112ifeq ($(BR2_PACKAGE_LIBDVDNAV),y)
113MPV_CONF_OPTS += --enable-dvdnav
114MPV_DEPENDENCIES += libdvdnav
115else
116MPV_CONF_OPTS += --disable-dvdnav
117endif
118
119# libdrm
120ifeq ($(BR2_PACKAGE_LIBDRM),y)
121MPV_CONF_OPTS += --enable-drm
122MPV_DEPENDENCIES += libdrm
123else
124MPV_CONF_OPTS += --disable-drm
125endif
126
127# libvdpau
128ifeq ($(BR2_PACKAGE_LIBVDPAU),y)
129MPV_CONF_OPTS += --enable-vdpau
130MPV_DEPENDENCIES += libvdpau
131else
132MPV_CONF_OPTS += --disable-vdpau
133endif
134
135# LUA support, only for lua51/lua52/luajit
136# This enables the controller (OSD) together with libass
137ifeq ($(BR2_PACKAGE_LUA_5_1)$(BR2_PACKAGE_LUAJIT),y)
138MPV_CONF_OPTS += --enable-lua
139MPV_DEPENDENCIES += luainterpreter
140else
141MPV_CONF_OPTS += --disable-lua
142endif
143
144# OpenGL support
145ifeq ($(BR2_PACKAGE_HAS_LIBGL),y)
146MPV_CONF_OPTS += --enable-gl
147MPV_DEPENDENCIES += libgl
148else ifeq ($(BR2_PACKAGE_HAS_LIBGLES),y)
149MPV_CONF_OPTS += --enable-gl
150MPV_DEPENDENCIES += libgles
151else ifeq ($(BR2_PACKAGE_HAS_LIBEGL),y)
152MPV_CONF_OPTS += --enable-gl
153MPV_DEPENDENCIES += libegl
154else
155MPV_CONF_OPTS += --disable-gl
156endif
157
158# pulseaudio support
159ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
160MPV_CONF_OPTS += --enable-pulse
161MPV_DEPENDENCIES += pulseaudio
162else
163MPV_CONF_OPTS += --disable-pulse
164endif
165
166# SDL support
167# Sdl2 requires 64-bit sync intrinsics
168ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_8)$(BR2_PACKAGE_SDL2),yy)
169MPV_CONF_OPTS += --enable-sdl2
170MPV_DEPENDENCIES += sdl2
171else
172MPV_CONF_OPTS += --disable-sdl2
173endif
174
175# Raspberry Pi support
176ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
177MPV_CONF_OPTS += --enable-rpi --enable-gl
178MPV_DEPENDENCIES += rpi-userland
179else
180MPV_CONF_OPTS += --disable-rpi
181endif
182
183# va-api support
184ifeq ($(BR2_PACKAGE_LIBVA)$(BR2_PACKAGE_MPV_SUPPORTS_VAAPI),yy)
185MPV_CONF_OPTS += --enable-vaapi
186MPV_DEPENDENCIES += libva
187ifeq ($(BR2_PACKAGE_LIBDRM)$(BR2_PACKAGE_MESA3D_OPENGL_EGL),yy)
188MPV_CONF_OPTS += --enable-vaapi-drm
189else
190MPV_CONF_OPTS += --disable-vaapi-drm
191endif
192else
193MPV_CONF_OPTS += --disable-vaapi --disable-vaapi-drm
194endif
195
196# wayland support
197ifeq ($(BR2_PACKAGE_WAYLAND),y)
198MPV_CONF_OPTS += --enable-wayland
199MPV_DEPENDENCIES += libxkbcommon wayland wayland-protocols
200else
201MPV_CONF_OPTS += --disable-wayland
202endif
203
204# Base X11 support. Config.in ensures that if BR2_PACKAGE_XORG7 is
205# enabled, xlib_libX11, xlib_libXext, xlib_libXinerama,
206# xlib_libXrandr, xlib_libXScrnSaver.
207ifeq ($(BR2_PACKAGE_XORG7),y)
208MPV_CONF_OPTS += --enable-x11
209MPV_DEPENDENCIES += xlib_libX11 xlib_libXext xlib_libXinerama xlib_libXrandr xlib_libXScrnSaver
210# XVideo
211ifeq ($(BR2_PACKAGE_XLIB_LIBXV),y)
212MPV_CONF_OPTS += --enable-xv
213MPV_DEPENDENCIES += xlib_libXv
214else
215MPV_CONF_OPTS += --disable-xv
216endif
217else
218MPV_CONF_OPTS += --disable-x11
219endif
220
221ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
222MPV_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -latomic"
223endif
224
225$(eval $(waf-package))
226