blob: 973a978b1cb16002fb7d23965bedfaeaef0a67f8 [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 \
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050021 https://waf.io/waf-2.0.20;name=waf;subdir=git \
Andrew Geissler82c905d2020-04-13 13:39:40 -050022"
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050023SRC_URI[waf.sha256sum] = "bf971e98edc2414968a262c6aa6b88541a26c3cd248689c89f4c57370955ee7f"
Andrew Geissler82c905d2020-04-13 13:39:40 -050024
25S = "${WORKDIR}/git"
26
Andrew Geissler89770b02020-06-13 10:40:47 -050027inherit waf pkgconfig mime-xdg
Andrew Geissler82c905d2020-04-13 13:39:40 -050028
29LUA ?= "lua"
30LUA_mips64 = ""
31LUA_aarch64 = ""
32LUA_powerpc64 = ""
33LUA_powerpc64le = ""
34LUA_riscv64 = ""
35LUA_riscv32 = ""
36LUA_powerpc = ""
37
38# Note: both lua and libass are required to get on-screen-display (controls)
39PACKAGECONFIG ??= " \
40 ${LUA} \
41 libass \
42 ${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)} \
43 ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} \
44 ${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)} \
45"
46
Andrew Geissler82c905d2020-04-13 13:39:40 -050047PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11"
48PACKAGECONFIG[xv] = "--enable-xv,--disable-xv,libxv"
49PACKAGECONFIG[opengl] = "--enable-gl,--disable-gl,virtual/libgl"
50PACKAGECONFIG[egl] = "--enable-egl,--disable-egl,"
51PACKAGECONFIG[drm] = "--enable-drm,--disable-drm,libdrm"
52PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/libgbm"
53PACKAGECONFIG[lua] = "--enable-lua,--disable-lua,lua luajit"
54PACKAGECONFIG[libass] = "--enable-libass,--disable-libass,libass"
55PACKAGECONFIG[libarchive] = "--enable-libarchive,--disable-libarchive,libarchive"
56PACKAGECONFIG[jack] = "--enable-jack, --disable-jack, jack"
57PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
58PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"
59PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,wayland wayland-native libxkbcommon"
60
61python __anonymous() {
62 packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
63 extras = []
64 if "x11" in packageconfig and "opengl" in packageconfig:
65 extras.append(" --enable-gl-x11")
66 if "x11" in packageconfig and "egl" in packageconfig:
67 extras.append(" --enable-egl-x11")
68 if "egl" in packageconfig and "drm" in packageconfig:
69 extras.append(" --enable-egl-drm")
70 if "vaapi" in packageconfig and "x11" in packageconfig:
71 extras.append(" --enable-vaapi-x11")
72 if "vaapi" in packageconfig and "drm" in packageconfig:
73 extras.append(" --enable-vaapi-drm")
74 if "vaapi" in packageconfig and "x11" in packageconfig and "egl" in packageconfig:
75 extras.append(" --enable-vaapi-x-egl")
76 if "vdpau" in packageconfig and "opengl" in packageconfig and "x11" in packageconfig:
77 extras.append(" --enable-vdpau-gl-x11")
78 if "wayland" in packageconfig and "opengl" in packageconfig:
79 extras.append(" --enable-gl-wayland")
80 if "wayland" in packageconfig and "vaapi" in packageconfig:
81 extras.append(" --enable-vaapi-wayland")
82 if extras:
83 d.appendVar("EXTRA_OECONF", "".join(extras))
84}
85
86SIMPLE_TARGET_SYS = "${@'${TARGET_SYS}'.replace('${TARGET_VENDOR}', '')}"
87
88EXTRA_OECONF = " \
89 --prefix=${prefix} \
90 --target=${SIMPLE_TARGET_SYS} \
91 --confdir=${sysconfdir} \
92 --datadir=${datadir} \
93 --disable-manpage-build \
94 --disable-libsmbclient \
95 --disable-libbluray \
96 --disable-dvdnav \
97 --disable-cdda \
98 --disable-uchardet \
99 --disable-rubberband \
100 --disable-lcms2 \
101 --disable-vapoursynth \
102 ${PACKAGECONFIG_CONFARGS} \
103"
104
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -0500105link_waf() {
106 ln -s waf-2.0.20 ${S}/waf
Andrew Geissler82c905d2020-04-13 13:39:40 -0500107}
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -0500108do_unpack[postfuncs] += "link_waf"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500109
110FILES_${PN} += " \
111 ${datadir}/icons \
112 ${datadir}/zsh \
113 ${datadir}/bash-completion \
114 "