fs/ubifs: work around fakeroot / sed -i issue on systems with SELinux enabled
[buildroot-gz.git] / package / mpv / mpv.mk
blob4f04fdfc472d1d564baf4d1fa59a488dcb3e7b4a
1 ################################################################################
3 # mpv
5 ################################################################################
7 MPV_VERSION = 0.20.0
8 MPV_WAF_VERSION = 1.8.12
9 MPV_SITE = https://github.com/mpv-player/mpv/archive
10 MPV_SOURCE = v$(MPV_VERSION).tar.gz
11 MPV_EXTRA_DOWNLOADS = https://waf.io/waf-$(MPV_WAF_VERSION)
12 MPV_DEPENDENCIES = \
13 host-pkgconf ffmpeg zlib \
14 $(if $(BR2_PACKAGE_LIBICONV),libiconv)
15 MPV_LICENSE = GPLv2+
16 MPV_LICENSE_FILES = LICENSE
18 # Some of these options need testing and/or tweaks
19 MPV_CONF_OPTS = \
20 --prefix=/usr \
21 --disable-android \
22 --disable-caca \
23 --disable-cdda \
24 --disable-cocoa \
25 --disable-coreaudio \
26 --disable-libguess \
27 --disable-libv4l2 \
28 --disable-opensles \
29 --disable-rpi \
30 --disable-rsound \
31 --disable-rubberband \
32 --disable-uchardet \
33 --disable-vapoursynth \
34 --disable-vapoursynth-lazy \
35 --disable-vdpau
37 # ALSA support requires pcm+mixer
38 ifeq ($(BR2_PACKAGE_ALSA_LIB_MIXER)$(BR2_PACKAGE_ALSA_LIB_PCM),yy)
39 MPV_CONF_OPTS += --enable-alsa
40 MPV_DEPENDENCIES += alsa-lib
41 else
42 MPV_CONF_OPTS += --disable-alsa
43 endif
45 # GBM support is provided by mesa3d when EGL=y
46 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
47 MPV_CONF_OPTS += --enable-gbm
48 MPV_DEPENDENIES += mesa3d
49 else
50 MPV_CONF_OPTS += --disable-gbm
51 endif
53 # jack support
54 # It also requires 64-bit sync intrinsics
55 ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_8)$(BR2_PACKAGE_JACK2),yy)
56 MPV_CONF_OPTS += --enable-jack
57 MPV_DEPENDENCIES += jack2
58 else
59 MPV_CONF_OPTS += --disable-jack
60 endif
62 # jpeg support
63 ifeq ($(BR2_PACKAGE_JPEG),y)
64 MPV_CONF_OPTS += --enable-jpeg
65 MPV_DEPENDENCIES += jpeg
66 else
67 MPV_CONF_OPTS += --disable-jpeg
68 endif
70 # lcms2 support
71 ifeq ($(BR2_PACKAGE_LCMS2),y)
72 MPV_CONF_OPTS += --enable-lcms2
73 MPV_DEPENDENCIES += lcms2
74 else
75 MPV_CONF_OPTS += --disable-lcms2
76 endif
78 # libarchive support
79 ifeq ($(BR2_PACKAGE_LIBARCHIVE),y)
80 MPV_CONF_OPTS += --enable-libarchive
81 MPV_DEPENDENCIES += libarchive
82 else
83 MPV_CONF_OPTS += --disable-libarchive
84 endif
86 # libass subtitle support
87 ifeq ($(BR2_PACKAGE_LIBASS),y)
88 MPV_CONF_OPTS += --enable-libass
89 MPV_DEPENDENCIES += libass
90 else
91 MPV_CONF_OPTS += --disable-libass
92 endif
94 # bluray support
95 ifeq ($(BR2_PACKAGE_LIBBLURAY),y)
96 MPV_CONF_OPTS += --enable-libbluray
97 MPV_DEPENDENCIES += libbluray
98 else
99 MPV_CONF_OPTS += --disable-libbluray
100 endif
102 # libdvdnav
103 ifeq ($(BR2_PACKAGE_LIBDVDNAV),y)
104 MPV_CONF_OPTS += --enable-dvdnav
105 MPV_DEPENDENCIES += libdvdnav
106 else
107 MPV_CONF_OPTS += --disable-dvdnav
108 endif
110 # libdvdread
111 ifeq ($(BR2_PACKAGE_LIBDVDREAD),y)
112 MPV_CONF_OPTS += --enable-dvdread
113 MPV_DEPENDENCIES += libdvdread
114 else
115 MPV_CONF_OPTS += --disable-dvdread
116 endif
118 # libdrm
119 ifeq ($(BR2_PACKAGE_LIBDRM),y)
120 MPV_CONF_OPTS += --enable-drm
121 MPV_DEPENDENCIES += libdrm
122 else
123 MPV_CONF_OPTS += --disable-drm
124 endif
126 # libenca support
127 ifeq ($(BR2_PACKAGE_LIBENCA),y)
128 MPV_CONF_OPTS += --enable-enca
129 MPV_DEPENDENCIES += libenca
130 else
131 MPV_CONF_OPTS += --disable-enca
132 endif
134 # LUA support, only for lua51/lua52/luajit
135 # This enables the controller (OSD) together with libass
136 ifeq ($(BR2_PACKAGE_LUA_5_1)$(BR2_PACKAGE_LUA_5_2)$(BR2_PACKAGE_LUAJIT),y)
137 MPV_CONF_OPTS += --enable-lua
138 MPV_DEPENDENCIES += luainterpreter
139 else
140 MPV_CONF_OPTS += --disable-lua
141 endif
143 # OpenGL support
144 ifeq ($(BR2_PACKAGE_HAS_LIBGL),y)
145 MPV_CONF_OPTS += --enable-gl --enable-standard-gl
146 MPV_DEPENDENCIES += libgl
147 else
148 MPV_CONF_OPTS += --disable-gl --disable-standard-gl
149 endif
151 # pulseaudio support
152 ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
153 MPV_CONF_OPTS += --enable-pulse
154 MPV_DEPENDENCIES += pulseaudio
155 else
156 MPV_CONF_OPTS += --disable-pulse
157 endif
159 # samba support
160 ifeq ($(BR2_PACKAGE_SAMBA4),y)
161 MPV_CONF_OPTS += --enable-libsmbclient
162 MPV_DEPENDENCIES += samba4
163 else
164 MPV_CONF_OPTS += --disable-libsmbclient
165 endif
167 # SDL support
168 # Both can't be used at the same time, prefer newer API
169 # It also requires 64-bit sync intrinsics
170 ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_8)$(BR2_PACKAGE_SDL2),yy)
171 MPV_CONF_OPTS += --enable-sdl2 --disable-sdl1
172 MPV_DEPENDENCIES += sdl2
173 else ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_8)$(BR2_PACKAGE_SDL),yy)
174 MPV_CONF_OPTS += --enable-sdl1 --disable-sdl2
175 MPV_DEPENDENCIES += sdl
176 else
177 MPV_CONF_OPTS += --disable-sdl1 --disable-sdl2
178 endif
180 # va-api support
181 # This requires one or more of the egl-drm, wayland, x11 backends
182 # For now we support wayland and x11
183 ifeq ($(BR2_PACKAGE_LIBVA),y)
184 ifneq ($(BR2_PACKAGE_WAYLAND)$(BR2_PACKAGE_XLIB_LIBX11),)
185 MPV_CONF_OPTS += --enable-vaapi
186 MPV_DEPENDENCIES += libva
187 else
188 MPV_CONF_OPTS += --disable-vaapi
189 endif
190 else
191 MPV_CONF_OPTS += --disable-vaapi
192 endif
194 # wayland support
195 ifeq ($(BR2_PACKAGE_WAYLAND),y)
196 MPV_CONF_OPTS += --enable-wayland
197 MPV_DEPENDENCIES += libxkbcommon wayland
198 else
199 MPV_CONF_OPTS += --disable-wayland
200 endif
202 # Base X11 support
203 ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y)
204 MPV_CONF_OPTS += --enable-x11 --disable-xss
205 MPV_DEPENDENCIES += xlib_libX11
206 # xext
207 ifeq ($(BR2_PACKAGE_XLIB_LIBXEXT),y)
208 MPV_CONF_OPTS += --enable-xext
209 MPV_DEPENDENCIES += xlib_libXext
210 else
211 MPV_CONF_OPTS += --disable-xext
212 endif
213 # xinerama
214 ifeq ($(BR2_PACKAGE_XLIB_LIBXINERAMA),y)
215 MPV_CONF_OPTS += --enable-xinerama
216 MPV_DEPENDENCIES += xlib_libXinerama
217 else
218 MPV_CONF_OPTS += --disable-xinerama
219 endif
220 # xrandr
221 ifeq ($(BR2_PACKAGE_XLIB_LIBXRANDR),y)
222 MPV_CONF_OPTS += --enable-xrandr
223 MPV_DEPENDENCIES += xlib_libXrandr
224 else
225 MPV_CONF_OPTS += --disable-xrandr
226 endif
227 # XVideo
228 ifeq ($(BR2_PACKAGE_XLIB_LIBXV),y)
229 MPV_CONF_OPTS += --enable-xv
230 MPV_DEPENDENCIES += xlib_libXv
231 else
232 MPV_CONF_OPTS += --disable-xv
233 endif
234 else
235 MPV_CONF_OPTS += --disable-x11
236 endif
238 define MPV_COPY_WAF
239 $(INSTALL) -m 0755 $(DL_DIR)/waf-$(MPV_WAF_VERSION) $(@D)/waf
240 endef
241 MPV_POST_EXTRACT_HOOKS += MPV_COPY_WAF
243 define MPV_CONFIGURE_CMDS
244 cd $(@D); \
245 $(TARGET_CONFIGURE_OPTS) \
246 ./waf configure $(MPV_CONF_OPTS)
247 endef
249 define MPV_BUILD_CMDS
250 cd $(@D); \
251 $(TARGET_MAKE_ENV) \
252 ./waf build
253 endef
255 define MPV_INSTALL_TARGET_CMDS
256 cd $(@D); \
257 $(TARGET_MAKE_ENV) \
258 DESTDIR=$(TARGET_DIR) \
259 ./waf install
260 endef
262 $(eval $(generic-package))