blob: e5f1096b6af6ef3433736f697dac70a892902cad [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Open Source multimedia player"
2DESCRIPTION = "mpv is a fork of mplayer2 and MPlayer. It shares some features with the former projects while introducing many more."
3SECTION = "multimedia"
4HOMEPAGE = "http://www.mpv.io/"
5
6DEPENDS = "zlib ffmpeg jpeg libv4l"
7
8DEPENDS += " \
9 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' virtual/libx11 xsp libxv libxscrnsaver libxinerama', '', d)} \
10"
11
12LICENSE = "GPLv2+"
13LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=91f1cb870c1cc2d31351a4d2595441cb"
14
15# While this item does not require it, it depends on ffmpeg which does
16LICENSE_FLAGS = "commercial"
17
18SRCREV_mpv = "70b991749df389bcc0a4e145b5687233a03b4ed7"
19SRC_URI = " \
20 git://github.com/mpv-player/mpv;name=mpv \
21"
22
23S = "${WORKDIR}/git"
24
Andrew Geissler89770b02020-06-13 10:40:47 -050025inherit waf pkgconfig mime-xdg
Andrew Geissler82c905d2020-04-13 13:39:40 -050026
27LUA ?= "lua"
28LUA_mips64 = ""
29LUA_aarch64 = ""
30LUA_powerpc64 = ""
31LUA_powerpc64le = ""
32LUA_riscv64 = ""
33LUA_riscv32 = ""
34LUA_powerpc = ""
35
36# Note: both lua and libass are required to get on-screen-display (controls)
37PACKAGECONFIG ??= " \
38 ${LUA} \
39 libass \
40 ${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)} \
41 ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} \
42 ${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)} \
43"
44
45PACKAGECONFIG_remove_aarch64 = "lua"
46PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11"
47PACKAGECONFIG[xv] = "--enable-xv,--disable-xv,libxv"
48PACKAGECONFIG[opengl] = "--enable-gl,--disable-gl,virtual/libgl"
49PACKAGECONFIG[egl] = "--enable-egl,--disable-egl,"
50PACKAGECONFIG[drm] = "--enable-drm,--disable-drm,libdrm"
51PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/libgbm"
52PACKAGECONFIG[lua] = "--enable-lua,--disable-lua,lua luajit"
53PACKAGECONFIG[libass] = "--enable-libass,--disable-libass,libass"
54PACKAGECONFIG[libarchive] = "--enable-libarchive,--disable-libarchive,libarchive"
55PACKAGECONFIG[jack] = "--enable-jack, --disable-jack, jack"
56PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
57PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"
58PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,wayland wayland-native libxkbcommon"
59
60python __anonymous() {
61 packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
62 extras = []
63 if "x11" in packageconfig and "opengl" in packageconfig:
64 extras.append(" --enable-gl-x11")
65 if "x11" in packageconfig and "egl" in packageconfig:
66 extras.append(" --enable-egl-x11")
67 if "egl" in packageconfig and "drm" in packageconfig:
68 extras.append(" --enable-egl-drm")
69 if "vaapi" in packageconfig and "x11" in packageconfig:
70 extras.append(" --enable-vaapi-x11")
71 if "vaapi" in packageconfig and "drm" in packageconfig:
72 extras.append(" --enable-vaapi-drm")
73 if "vaapi" in packageconfig and "x11" in packageconfig and "egl" in packageconfig:
74 extras.append(" --enable-vaapi-x-egl")
75 if "vdpau" in packageconfig and "opengl" in packageconfig and "x11" in packageconfig:
76 extras.append(" --enable-vdpau-gl-x11")
77 if "wayland" in packageconfig and "opengl" in packageconfig:
78 extras.append(" --enable-gl-wayland")
79 if "wayland" in packageconfig and "vaapi" in packageconfig:
80 extras.append(" --enable-vaapi-wayland")
81 if extras:
82 d.appendVar("EXTRA_OECONF", "".join(extras))
83}
84
85SIMPLE_TARGET_SYS = "${@'${TARGET_SYS}'.replace('${TARGET_VENDOR}', '')}"
86
87EXTRA_OECONF = " \
88 --prefix=${prefix} \
89 --target=${SIMPLE_TARGET_SYS} \
90 --confdir=${sysconfdir} \
91 --datadir=${datadir} \
92 --disable-manpage-build \
93 --disable-libsmbclient \
94 --disable-libbluray \
95 --disable-dvdnav \
96 --disable-cdda \
97 --disable-uchardet \
98 --disable-rubberband \
99 --disable-lcms2 \
100 --disable-vapoursynth \
101 ${PACKAGECONFIG_CONFARGS} \
102"
103
104do_patch[postfuncs] += "get_waf"
105
106get_waf() {
107 cd ${S}
108 ./bootstrap.py
109 sed -i -e 's|/usr/bin/env python|/usr/bin/env python3|g' ${S}/waf
110 cd -
111}
112
113FILES_${PN} += " \
114 ${datadir}/icons \
115 ${datadir}/zsh \
116 ${datadir}/bash-completion \
117 "