xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1SUMMARY = "OpenGL (ES) 2.0 benchmark"
2DESCRIPTION = "glmark2 is a benchmark for OpenGL (ES) 2.0. \
3It uses only the subset of the OpenGL 2.0 API that is compatible with OpenGL ES 2.0."
4HOMEPAGE = "https://github.com/glmark2/glmark2"
5BUGTRACKER = "https://github.com/glmark2/glmark2/issues"
6
7LICENSE = "GPL-3.0-or-later & SGI-1"
8LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
9                    file://COPYING.SGI;beginline=5;md5=269cdab4af6748677acce51d9aa13552"
10
11DEPENDS = "libpng jpeg udev"
12DEPENDS:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland-native wayland-protocols', '', d)}"
13
14PV = "2021.12"
15
16SRC_URI = " \
17    git://github.com/glmark2/glmark2.git;protocol=https;branch=master \
18    file://0001-fix-dispmanx-build.patch \
19    file://0002-run-dispmanx-fullscreen.patch \
20    file://0001-libmatrix-Include-missing-utility-header.patch \
21    file://0001-waflib-fix-compatibility-with-python-3.11.patch \
22"
23SRCREV = "0858b450cd88c84a15b99dda9698d44e7f7e8c70"
24
25S = "${WORKDIR}/git"
26
27inherit waf pkgconfig features_check
28
29ANY_OF_DISTRO_FEATURES = "opengl dispmanx"
30
31PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11-gles2', '', d)} \
32                  ${@bb.utils.contains('DISTRO_FEATURES', 'wayland opengl', 'wayland-gles2', '', d)} \
33                  ${@bb.utils.contains('DISTRO_FEATURES', 'dispmanx', 'dispmanx', '', d)} \
34                  drm-gles2 \
35                 "
36
37PACKAGECONFIG[x11-gl] = ",,virtual/libgl virtual/libx11"
38PACKAGECONFIG[x11-gles2] = ",,virtual/libgles2 virtual/libx11"
39PACKAGECONFIG[drm-gl] = ",,virtual/libgl libdrm virtual/libgbm"
40PACKAGECONFIG[drm-gles2] = ",,virtual/libgles2 libdrm virtual/libgbm"
41PACKAGECONFIG[wayland-gl] = ",,virtual/libgl wayland"
42PACKAGECONFIG[wayland-gles2] = ",,virtual/libgles2 wayland"
43PACKAGECONFIG[dispmanx] = ",,virtual/libgles2 virtual/libx11"
44
45python __anonymous() {
46    packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
47    flavors = []
48    if "x11-gles2" in packageconfig:
49        flavors.append("x11-glesv2")
50    if "x11-gl" in packageconfig:
51        flavors.append("x11-gl")
52    if "wayland-gles2" in packageconfig:
53        flavors.append("wayland-glesv2")
54    if "wayland-gl" in packageconfig:
55        flavors.append("wayland-gl")
56    if "drm-gles2" in packageconfig:
57        flavors.append("drm-glesv2")
58    if "drm-gl" in packageconfig:
59        flavors.append("drm-gl")
60    if "dispmanx" in packageconfig:
61        flavors = ["dispmanx-glesv2"]
62    if flavors:
63        d.appendVar("EXTRA_OECONF", " --with-flavors=%s" % ",".join(flavors))
64}
65
66