xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mpv_0.34.1.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "Open Source multimedia player"
2*4882a593SmuzhiyunDESCRIPTION = "mpv is a fork of mplayer2 and MPlayer. It shares some features with the former projects while introducing many more."
3*4882a593SmuzhiyunSECTION = "multimedia"
4*4882a593SmuzhiyunHOMEPAGE = "http://www.mpv.io/"
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunDEPENDS = " \
7*4882a593Smuzhiyun    zlib \
8*4882a593Smuzhiyun    ffmpeg \
9*4882a593Smuzhiyun    jpeg \
10*4882a593Smuzhiyun    libv4l \
11*4882a593Smuzhiyun    libass \
12*4882a593Smuzhiyun"
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunDEPENDS += " \
15*4882a593Smuzhiyun    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' virtual/libx11 xsp libxv libxscrnsaver libxinerama', '', d)} \
16*4882a593Smuzhiyun"
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunLICENSE = "GPL-2.0-or-later"
19*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263"
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunSRCREV_mpv = "349e437466163cb52f7d0aa227d4606edd9db501"
22*4882a593SmuzhiyunSRC_URI = "git://github.com/mpv-player/mpv;name=mpv;branch=release/0.34;protocol=https \
23*4882a593Smuzhiyun           https://waf.io/waf-2.0.20;name=waf;subdir=git \
24*4882a593Smuzhiyun           "
25*4882a593SmuzhiyunSRC_URI[waf.sha256sum] = "bf971e98edc2414968a262c6aa6b88541a26c3cd248689c89f4c57370955ee7f"
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunS = "${WORKDIR}/git"
28*4882a593Smuzhiyun
29*4882a593Smuzhiyuninherit waf pkgconfig mime-xdg
30*4882a593Smuzhiyun
31*4882a593SmuzhiyunLDFLAGS:append:riscv64 = " -latomic"
32*4882a593Smuzhiyun
33*4882a593SmuzhiyunLUA ?= "lua"
34*4882a593SmuzhiyunLUA:mips64  = ""
35*4882a593SmuzhiyunLUA:powerpc64  = ""
36*4882a593SmuzhiyunLUA:powerpc64le  = ""
37*4882a593SmuzhiyunLUA:riscv64  = ""
38*4882a593SmuzhiyunLUA:riscv32  = ""
39*4882a593SmuzhiyunLUA:powerpc  = ""
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun# Note: lua is required to get on-screen-display (controls)
42*4882a593SmuzhiyunPACKAGECONFIG ??= " \
43*4882a593Smuzhiyun    ${LUA} \
44*4882a593Smuzhiyun    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland egl', '', d)} \
45*4882a593Smuzhiyun    ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} \
46*4882a593Smuzhiyun    ${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)} \
47*4882a593Smuzhiyun"
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunPACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11"
50*4882a593SmuzhiyunPACKAGECONFIG[xv] = "--enable-xv,--disable-xv,libxv"
51*4882a593SmuzhiyunPACKAGECONFIG[opengl] = "--enable-gl,--disable-gl,virtual/libgl"
52*4882a593SmuzhiyunPACKAGECONFIG[egl] = "--enable-egl,--disable-egl,virtual/egl"
53*4882a593SmuzhiyunPACKAGECONFIG[drm] = "--enable-drm,--disable-drm,libdrm"
54*4882a593SmuzhiyunPACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/libgbm"
55*4882a593SmuzhiyunPACKAGECONFIG[lua] = "--enable-lua,--disable-lua,lua luajit"
56*4882a593SmuzhiyunPACKAGECONFIG[libarchive] = "--enable-libarchive,--disable-libarchive,libarchive"
57*4882a593SmuzhiyunPACKAGECONFIG[jack] = "--enable-jack, --disable-jack, jack"
58*4882a593SmuzhiyunPACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
59*4882a593SmuzhiyunPACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"
60*4882a593SmuzhiyunPACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,wayland wayland-native libxkbcommon"
61*4882a593Smuzhiyun
62*4882a593Smuzhiyunpython __anonymous() {
63*4882a593Smuzhiyun    packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
64*4882a593Smuzhiyun    extras = []
65*4882a593Smuzhiyun    if "x11" in packageconfig and "opengl" in packageconfig:
66*4882a593Smuzhiyun        extras.append(" --enable-gl-x11")
67*4882a593Smuzhiyun    if "x11" in packageconfig and "egl" in packageconfig:
68*4882a593Smuzhiyun        extras.append(" --enable-egl-x11")
69*4882a593Smuzhiyun    if "egl" in packageconfig and "drm" in packageconfig:
70*4882a593Smuzhiyun        extras.append(" --enable-egl-drm")
71*4882a593Smuzhiyun    if "vaapi" in packageconfig and "x11" in packageconfig:
72*4882a593Smuzhiyun        extras.append(" --enable-vaapi-x11")
73*4882a593Smuzhiyun    if "vaapi" in packageconfig and "drm" in packageconfig:
74*4882a593Smuzhiyun        extras.append(" --enable-vaapi-drm")
75*4882a593Smuzhiyun    if "vaapi" in packageconfig and "x11" in packageconfig and "egl" in packageconfig:
76*4882a593Smuzhiyun        extras.append(" --enable-vaapi-x-egl")
77*4882a593Smuzhiyun    if "vdpau" in packageconfig and "opengl" in packageconfig and "x11" in packageconfig:
78*4882a593Smuzhiyun        extras.append(" --enable-vdpau-gl-x11")
79*4882a593Smuzhiyun    if "wayland" in packageconfig and "opengl" in packageconfig:
80*4882a593Smuzhiyun        extras.append(" --enable-gl-wayland")
81*4882a593Smuzhiyun    if "wayland" in packageconfig and "vaapi" in packageconfig:
82*4882a593Smuzhiyun        extras.append(" --enable-vaapi-wayland")
83*4882a593Smuzhiyun    if extras:
84*4882a593Smuzhiyun        d.appendVar("EXTRA_OECONF", "".join(extras))
85*4882a593Smuzhiyun}
86*4882a593Smuzhiyun
87*4882a593SmuzhiyunSIMPLE_TARGET_SYS = "${@'${TARGET_SYS}'.replace('${TARGET_VENDOR}', '')}"
88*4882a593Smuzhiyun
89*4882a593SmuzhiyunEXTRA_OECONF = " \
90*4882a593Smuzhiyun    --prefix=${prefix} \
91*4882a593Smuzhiyun    --target=${SIMPLE_TARGET_SYS} \
92*4882a593Smuzhiyun    --confdir=${sysconfdir} \
93*4882a593Smuzhiyun    --datadir=${datadir} \
94*4882a593Smuzhiyun    --disable-manpage-build \
95*4882a593Smuzhiyun    --disable-libbluray \
96*4882a593Smuzhiyun    --disable-dvdnav \
97*4882a593Smuzhiyun    --disable-cdda \
98*4882a593Smuzhiyun    --disable-uchardet \
99*4882a593Smuzhiyun    --disable-rubberband \
100*4882a593Smuzhiyun    --disable-lcms2 \
101*4882a593Smuzhiyun    --disable-vapoursynth \
102*4882a593Smuzhiyun    ${PACKAGECONFIG_CONFARGS} \
103*4882a593Smuzhiyun"
104*4882a593Smuzhiyun
105*4882a593Smuzhiyunlink_waf() {
106*4882a593Smuzhiyun    ln -s waf-2.0.20 ${S}/waf
107*4882a593Smuzhiyun}
108*4882a593Smuzhiyundo_unpack[postfuncs] += "link_waf"
109*4882a593Smuzhiyun
110*4882a593SmuzhiyunFILES:${PN} += " \
111*4882a593Smuzhiyun    ${datadir}/icons \
112*4882a593Smuzhiyun    ${datadir}/zsh \
113*4882a593Smuzhiyun    ${datadir}/bash-completion \
114*4882a593Smuzhiyun    "
115*4882a593SmuzhiyunEXCLUDE_FROM_WORLD = "${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "0", "1", d)}"
116