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 = "GPLv3+ & SGIv1"
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', '', d)}"
13
14PV = "20201114+${SRCPV}"
15
16SRC_URI = " \
17    git://github.com/glmark2/glmark2.git;protocol=https \
18    file://0001-fix-dispmanx-build.patch \
19    file://0002-run-dispmanx-fullscreen.patch \
20    "
21SRCREV = "784aca755a469b144acf3cae180b6e613b7b057a"
22
23S = "${WORKDIR}/git"
24
25inherit waf pkgconfig features_check
26
27ANY_OF_DISTRO_FEATURES = "opengl dispmanx"
28
29PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11-gles2', '', d)} \
30                  ${@bb.utils.contains('DISTRO_FEATURES', 'wayland opengl', 'wayland-gles2', '', d)} \
31                  ${@bb.utils.contains('DISTRO_FEATURES', 'dispmanx', 'dispmanx', '', d)} \
32                  drm-gles2 \
33                 "
34
35PACKAGECONFIG[x11-gl] = ",,virtual/libgl virtual/libx11"
36PACKAGECONFIG[x11-gles2] = ",,virtual/libgles2 virtual/libx11"
37PACKAGECONFIG[drm-gl] = ",,virtual/libgl libdrm virtual/libgbm"
38PACKAGECONFIG[drm-gles2] = ",,virtual/libgles2 libdrm virtual/libgbm"
39PACKAGECONFIG[wayland-gl] = ",,virtual/libgl wayland"
40PACKAGECONFIG[wayland-gles2] = ",,virtual/libgles2 wayland"
41PACKAGECONFIG[dispmanx] = ",,virtual/libgles2 virtual/libx11"
42
43python __anonymous() {
44    packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
45    flavors = []
46    if "x11-gles2" in packageconfig:
47        flavors.append("x11-glesv2")
48    if "x11-gl" in packageconfig:
49        flavors.append("x11-gl")
50    if "wayland-gles2" in packageconfig:
51        flavors.append("wayland-glesv2")
52    if "wayland-gl" in packageconfig:
53        flavors.append("wayland-gl")
54    if "drm-gles2" in packageconfig:
55        flavors.append("drm-glesv2")
56    if "drm-gl" in packageconfig:
57        flavors.append("drm-gl")
58    if "dispmanx" in packageconfig:
59        flavors = ["dispmanx-glesv2"]
60    if flavors:
61        d.appendVar("EXTRA_OECONF", " --with-flavors=%s" % ",".join(flavors))
62}
63
64