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://launchpad.net/glmark2"
5BUGTRACKER = "https://bugs.launchpad.net/glmark2"
6
7LICENSE = "GPLv3+ & SGIv1"
8LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
9                    file://COPYING.SGI;beginline=5;md5=269cdab4af6748677acce51d9aa13552"
10
11DEPENDS = "libpng jpeg udev"
12
13PV = "20191226+${SRCPV}"
14
15COMPATIBLE_HOST_rpi  = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '.*-linux*', 'null', d)}"
16
17SRC_URI = "git://github.com/glmark2/glmark2.git;protocol=https \
18           file://python3.patch"
19SRCREV = "72dabc5d72b49c6d45badeb8a941ba4d829b0bd6"
20
21S = "${WORKDIR}/git"
22
23inherit waf pkgconfig features_check
24
25REQUIRED_DISTRO_FEATURES += "opengl"
26
27PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11-gl x11-gles2', '', d)} \
28                  ${@bb.utils.contains('DISTRO_FEATURES', 'wayland opengl', 'wayland-gl wayland-gles2', '', d)} \
29                  drm-gl drm-gles2"
30
31PACKAGECONFIG[x11-gl] = ",,virtual/libgl virtual/libx11"
32PACKAGECONFIG[x11-gles2] = ",,virtual/libgles2 virtual/libx11"
33PACKAGECONFIG[drm-gl] = ",,virtual/libgl libdrm virtual/libgbm"
34PACKAGECONFIG[drm-gles2] = ",,virtual/libgles2 libdrm virtual/libgbm"
35PACKAGECONFIG[wayland-gl] = ",,virtual/libgl wayland"
36PACKAGECONFIG[wayland-gles2] = ",,virtual/libgles2 wayland"
37
38python __anonymous() {
39    packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
40    flavors = []
41    if "x11-gles2" in packageconfig:
42        flavors.append("x11-glesv2")
43    if "x11-gl" in packageconfig:
44        flavors.append("x11-gl")
45    if "wayland-gles2" in packageconfig:
46        flavors.append("wayland-glesv2")
47    if "wayland-gl" in packageconfig:
48        flavors.append("wayland-gl")
49    if "drm-gles2" in packageconfig:
50        flavors.append("drm-glesv2")
51    if "drm-gl" in packageconfig:
52        flavors.append("drm-gl")
53    if flavors:
54        d.appendVar("EXTRA_OECONF", " --with-flavors=%s" % ",".join(flavors))
55}
56
57