blob: 1a9150479fe9724ecd02f4b29ddbcc8f9e877ede [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
William A. Kennington IIIb95905d2021-06-02 12:40:56 -07006DEPENDS = " \
7 zlib \
8 ffmpeg \
9 jpeg \
10 libv4l \
11 libass \
12"
Andrew Geissler82c905d2020-04-13 13:39:40 -050013
14DEPENDS += " \
15 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' virtual/libx11 xsp libxv libxscrnsaver libxinerama', '', d)} \
16"
17
18LICENSE = "GPLv2+"
19LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=91f1cb870c1cc2d31351a4d2595441cb"
20
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070021SRCREV_mpv = "b5d3e43198b9d57af5620b63537885aaa41fa8cd"
Andrew Geissler82c905d2020-04-13 13:39:40 -050022SRC_URI = " \
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070023 git://github.com/mpv-player/mpv;name=mpv;branch=release/0.33;protocol=https \
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050024 https://waf.io/waf-2.0.20;name=waf;subdir=git \
Andrew Geissler82c905d2020-04-13 13:39:40 -050025"
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050026SRC_URI[waf.sha256sum] = "bf971e98edc2414968a262c6aa6b88541a26c3cd248689c89f4c57370955ee7f"
Andrew Geissler82c905d2020-04-13 13:39:40 -050027
28S = "${WORKDIR}/git"
29
Andrew Geissler89770b02020-06-13 10:40:47 -050030inherit waf pkgconfig mime-xdg
Andrew Geissler82c905d2020-04-13 13:39:40 -050031
Andrew Geissler32b11992021-03-31 13:37:05 -050032LDFLAGS_append_riscv64 = " -latomic"
33
Andrew Geissler82c905d2020-04-13 13:39:40 -050034LUA ?= "lua"
35LUA_mips64 = ""
Andrew Geissler82c905d2020-04-13 13:39:40 -050036LUA_powerpc64 = ""
37LUA_powerpc64le = ""
38LUA_riscv64 = ""
39LUA_riscv32 = ""
40LUA_powerpc = ""
41
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070042# Note: lua is required to get on-screen-display (controls)
Andrew Geissler82c905d2020-04-13 13:39:40 -050043PACKAGECONFIG ??= " \
44 ${LUA} \
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070045 ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland egl', '', d)} \
Andrew Geissler82c905d2020-04-13 13:39:40 -050046 ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} \
47 ${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)} \
48"
49
Andrew Geissler82c905d2020-04-13 13:39:40 -050050PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11"
51PACKAGECONFIG[xv] = "--enable-xv,--disable-xv,libxv"
52PACKAGECONFIG[opengl] = "--enable-gl,--disable-gl,virtual/libgl"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070053PACKAGECONFIG[egl] = "--enable-egl,--disable-egl,virtual/egl"
Andrew Geissler82c905d2020-04-13 13:39:40 -050054PACKAGECONFIG[drm] = "--enable-drm,--disable-drm,libdrm"
55PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/libgbm"
56PACKAGECONFIG[lua] = "--enable-lua,--disable-lua,lua luajit"
Andrew Geissler82c905d2020-04-13 13:39:40 -050057PACKAGECONFIG[libarchive] = "--enable-libarchive,--disable-libarchive,libarchive"
58PACKAGECONFIG[jack] = "--enable-jack, --disable-jack, jack"
59PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
60PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"
61PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,wayland wayland-native libxkbcommon"
62
63python __anonymous() {
64 packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
65 extras = []
66 if "x11" in packageconfig and "opengl" in packageconfig:
67 extras.append(" --enable-gl-x11")
68 if "x11" in packageconfig and "egl" in packageconfig:
69 extras.append(" --enable-egl-x11")
70 if "egl" in packageconfig and "drm" in packageconfig:
71 extras.append(" --enable-egl-drm")
72 if "vaapi" in packageconfig and "x11" in packageconfig:
73 extras.append(" --enable-vaapi-x11")
74 if "vaapi" in packageconfig and "drm" in packageconfig:
75 extras.append(" --enable-vaapi-drm")
76 if "vaapi" in packageconfig and "x11" in packageconfig and "egl" in packageconfig:
77 extras.append(" --enable-vaapi-x-egl")
78 if "vdpau" in packageconfig and "opengl" in packageconfig and "x11" in packageconfig:
79 extras.append(" --enable-vdpau-gl-x11")
80 if "wayland" in packageconfig and "opengl" in packageconfig:
81 extras.append(" --enable-gl-wayland")
82 if "wayland" in packageconfig and "vaapi" in packageconfig:
83 extras.append(" --enable-vaapi-wayland")
84 if extras:
85 d.appendVar("EXTRA_OECONF", "".join(extras))
86}
87
88SIMPLE_TARGET_SYS = "${@'${TARGET_SYS}'.replace('${TARGET_VENDOR}', '')}"
89
90EXTRA_OECONF = " \
91 --prefix=${prefix} \
92 --target=${SIMPLE_TARGET_SYS} \
93 --confdir=${sysconfdir} \
94 --datadir=${datadir} \
95 --disable-manpage-build \
Andrew Geissler82c905d2020-04-13 13:39:40 -050096 --disable-libbluray \
97 --disable-dvdnav \
98 --disable-cdda \
99 --disable-uchardet \
100 --disable-rubberband \
101 --disable-lcms2 \
102 --disable-vapoursynth \
103 ${PACKAGECONFIG_CONFARGS} \
104"
105
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -0500106link_waf() {
107 ln -s waf-2.0.20 ${S}/waf
Andrew Geissler82c905d2020-04-13 13:39:40 -0500108}
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -0500109do_unpack[postfuncs] += "link_waf"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500110
111FILES_${PN} += " \
112 ${datadir}/icons \
113 ${datadir}/zsh \
114 ${datadir}/bash-completion \
115 "
Andrew Geissler32b11992021-03-31 13:37:05 -0500116EXCLUDE_FROM_WORLD = "${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "0", "1", d)}"