summaryrefslogtreecommitdiffstats
path: root/meta-gnome/recipes-graphics/cogl
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-05-26 15:36:04 +0100
committerKhem Raj <raj.khem@gmail.com>2021-05-28 06:55:33 -0700
commit4b6175892985a6016df1a38824ccbb5989f00b33 (patch)
tree32718c4c55dbaf254632068deb91db73d9a81373 /meta-gnome/recipes-graphics/cogl
parentba8309fbb7880b1a2782b43e7f8b203aab4d5c11 (diff)
downloadmeta-openembedded-4b6175892985a6016df1a38824ccbb5989f00b33.tar.gz
meta-gnome: add Cogl/Clutter from oe-core
Nothing in openembedded-core needs Clutter now, and Clutter is abandoned upstream. Move it to meta-gnome as there are still a few users of Clutter in Gnome. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-gnome/recipes-graphics/cogl')
-rw-r--r--meta-gnome/recipes-graphics/cogl/cogl-1.0.inc84
-rw-r--r--meta-gnome/recipes-graphics/cogl/cogl-1.0/0001-configure.ac-don-t-require-eglmesaext.h.patch92
-rw-r--r--meta-gnome/recipes-graphics/cogl/cogl-1.0_1.22.8.bb6
3 files changed, 182 insertions, 0 deletions
diff --git a/meta-gnome/recipes-graphics/cogl/cogl-1.0.inc b/meta-gnome/recipes-graphics/cogl/cogl-1.0.inc
new file mode 100644
index 000000000..d581ad1c0
--- /dev/null
+++ b/meta-gnome/recipes-graphics/cogl/cogl-1.0.inc
@@ -0,0 +1,84 @@
1SUMMARY = "Modern 3D graphics API with associated utility APIs"
2DESCRIPTION = "Cogl is a small open source library for using 3D graphics \
3hardware for rendering. The API departs from the flat state machine style of \
4OpenGL and is designed to make it easy to write orthogonal components that \
5can render without stepping on each others toes."
6HOMEPAGE = "https://gitlab.gnome.org/GNOME/cogl"
7LICENSE = "MIT"
8
9inherit clutter features_check upstream-version-is-even gobject-introspection
10# cogl-1.0 needs opengl to build
11REQUIRED_DISTRO_FEATURES ?= "opengl"
12
13DEPENDS = "glib-2.0 gdk-pixbuf"
14PACKAGES =+ "${PN}-examples \
15 libcogl libcogl-gles2 libcogl-pango libcogl-path \
16 "
17AUTOTOOLS_AUXDIR = "${S}/build"
18
19# Extra DEPENDS for PACKAGECONFIG
20EDEPENDS_GL = "virtual/libgl libdrm"
21EDEPENDS_GLES2 = "virtual/libgles2"
22EDEPENDS_KMS = "libdrm virtual/egl"
23EDEPENDS_EGL = "virtual/egl"
24EDEPENDS_X11 = "virtual/libx11 libxcomposite libxdamage libxfixes libxrandr"
25EDEPENDS_WAYLAND = "virtual/egl virtual/libgles2 wayland"
26
27# Extra RDEPENDS for PACKAGECONFIG
28# This has to be explictly listed, because cogl dlopens the backends
29ERDEPENDS_GL = "libgl"
30ERDEPENDS_GLES2 = "libgles2"
31
32# GLESv1 is rarely tested, so disable it
33EXTRA_OECONF += "--enable-examples-install \
34 --enable-debug \
35 --disable-gles1 \
36 --disable-cairo \
37 "
38DEBUG_OPTIMIZATION_append = " -Wno-error=maybe-uninitialized"
39
40# OpenGL/GLX
41PACKAGECONFIG[glx] = "--enable-gl --enable-glx,--disable-gl --disable-glx,${EDEPENDS_GL} ${EDEPENDS_X11},${ERDEPENDS_GL}"
42
43# GLESv2
44PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,${EDEPENDS_GLES2}, ${ERDEPENDS_GLES2}"
45
46# EGL backends
47PACKAGECONFIG[egl-kms] = "--enable-kms-egl-platform,--disable-kms-egl-platform,${EDEPENDS_KMS}"
48PACKAGECONFIG[egl-null] = "--enable-null-egl-platform,--disable-null-egl-platform"
49PACKAGECONFIG[egl-x11] = "--enable-xlib-egl-platform,--disable-xlib-egl-platform,${EDEPENDS_X11} ${EDEPENDS_EGL}"
50PACKAGECONFIG[egl-wayland] = "--enable-wayland-egl-platform,--disable-wayland-egl-platform,${EDEPENDS_WAYLAND}"
51
52# Wayland (server-side)
53PACKAGECONFIG[wayland-server] = "--enable-wayland-egl-server,--disable-wayland-egl-server,${EDEPENDS_WAYLAND}"
54
55# Support rendering text directly with Pango
56PACKAGECONFIG[cogl-pango] = "--enable-cogl-pango,--disable-cogl-pango,pango"
57
58# Respect the DISTRO_FEATURES to pull in GLX or Wayland as appropriate by
59# default.
60PACKAGECONFIG ??= "cogl-pango gles2 \
61 ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'egl-wayland', '', d)} \
62 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'glx egl-x11', '', d)} \
63 "
64
65do_compile_prepend() {
66 export GIR_EXTRA_LIBS_PATH="${B}/cogl/.libs"
67}
68
69FILES_${PN} = ""
70FILES_${PN}-examples = "${bindir}/* ${datadir}/cogl/examples-data/*"
71FILES_libcogl = "${libdir}/libcogl${SOLIBS} ${libdir}/girepository-1.0/Cogl-*.typelib"
72FILES_libcogl-gles2 = "${libdir}/libcogl-gles2${SOLIBS}"
73FILES_libcogl-pango = "${libdir}/libcogl-pango${SOLIBS} ${libdir}/girepository-1.0/CoglPango*.typelib"
74
75FILES_libcogl-path = "${libdir}/libcogl-path${SOLIBS}"
76
77# For backwards compatibility after Debian-renaming
78RPROVIDES_libcogl = "cogl-1.0"
79RCONFLICTS_libcogl = "cogl-1.0"
80RREPLACES_libcogl = "cogl-1.0"
81
82RDEPENDS_${PN}-dev = "libcogl"
83
84COMPATIBLE_HOST_armv4 = 'null'
diff --git a/meta-gnome/recipes-graphics/cogl/cogl-1.0/0001-configure.ac-don-t-require-eglmesaext.h.patch b/meta-gnome/recipes-graphics/cogl/cogl-1.0/0001-configure.ac-don-t-require-eglmesaext.h.patch
new file mode 100644
index 000000000..328984a63
--- /dev/null
+++ b/meta-gnome/recipes-graphics/cogl/cogl-1.0/0001-configure.ac-don-t-require-eglmesaext.h.patch
@@ -0,0 +1,92 @@
1From bb9765a926588ebfe1eb324fbbe8fc22d419eebe Mon Sep 17 00:00:00 2001
2From: Max Krummenacher <max.krummenacher@toradex.com>
3Date: Thu, 25 Jun 2020 11:27:40 +0000
4Subject: [PATCH] configure.ac: don't require eglmesaext.h
5
6E.g. the Vivante EGL implementation does not provide eglmesaext.h.
7
8The commit moves the check for header file existence outside of the
9check for existence of a egl packageconfig and makes the existence
10of eglmesaext.h optional.
11
12fixes commit fb1acfec ("Fix building against libglvnd-provided EGL headers")
13Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
14
15Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/cogl/-/merge_requests/28]
16Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
17---
18 configure.ac | 51 ++++++++++++++++++++++++++++++++-------------------
19 1 file changed, 32 insertions(+), 19 deletions(-)
20
21diff --git a/configure.ac b/configure.ac
22index b7ba95d..0d1d8de 100644
23--- a/configure.ac
24+++ b/configure.ac
25@@ -1212,22 +1212,6 @@ AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"],
26 PKG_CHECK_EXISTS([egl],
27 [COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES egl"],
28 [
29- AC_CHECK_HEADERS(
30- [EGL/egl.h],
31- [],
32- [AC_MSG_ERROR([Unable to locate required EGL headers])])
33- AC_CHECK_HEADERS(
34- [EGL/eglext.h],
35- [],
36- [AC_MSG_ERROR([Unable to locate required EGL headers])],
37- [#include <EGL/egl.h>])
38- AC_CHECK_HEADERS(
39- [EGL/eglmesaext.h],
40- [],
41- [AC_MSG_ERROR([Unable to locate required EGL headers])],
42- [#include <EGL/egl.h>
43-#include <EGL/eglext.h>])
44-
45 AC_CHECK_LIB(EGL, [eglInitialize],
46 [COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"],
47 [AC_MSG_ERROR([Unable to locate required EGL library])])
48@@ -1236,9 +1220,38 @@ AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"],
49 ]
50 )
51
52- COGL_EGL_INCLUDES="#include <EGL/egl.h>
53-#include <EGL/eglext.h>
54-#include <EGL/eglmesaext.h>"
55+dnl Test for the existence of egl headers.
56+dnl egl*.h includes eglplatform.h which on __unix__ defaults to a X11 platform.
57+dnl In that case AC_CHECK_HEADERS failes if X11 headers are not available.
58+dnl Set the usual include guard define and, if the EGL implementation doesn't
59+dnl use that guard fall back to USE_OZONE and EGL_NO_X11 platforms which don't
60+dnl require additional headers.
61+ AC_CHECK_HEADERS(
62+ [EGL/egl.h],
63+ [COGL_EGL_INCLUDES="#include <EGL/egl.h>"],
64+ [AC_MSG_ERROR([Unable to locate required EGL headers])],
65+ [#define __egl_h_
66+ #define USE_OZONE
67+ #define EGL_NO_X11])
68+ AC_CHECK_HEADERS(
69+ [EGL/eglext.h],
70+ [COGL_EGL_INCLUDES="$COGL_EGL_INCLUDES
71+#include <EGL/eglext.h>"],
72+ [AC_MSG_ERROR([Unable to locate required EGL headers])],
73+ [#define __eglext_h_
74+ #define USE_OZONE
75+ #define EGL_NO_X11
76+$COGL_EGL_INCLUDES])
77+ AC_CHECK_HEADERS(
78+ [EGL/eglmesaext.h],
79+ [COGL_EGL_INCLUDES="$COGL_EGL_INCLUDES
80+#include <EGL/eglmesaext.h>"],
81+ [],
82+ [#define __eglmesaext_h_
83+#define USE_OZONE
84+#define EGL_NO_X11
85+$COGL_EGL_INCLUDES])
86+
87 AC_SUBST([COGL_EGL_INCLUDES])
88 ])
89
90--
912.20.1
92
diff --git a/meta-gnome/recipes-graphics/cogl/cogl-1.0_1.22.8.bb b/meta-gnome/recipes-graphics/cogl/cogl-1.0_1.22.8.bb
new file mode 100644
index 000000000..b9446fab3
--- /dev/null
+++ b/meta-gnome/recipes-graphics/cogl/cogl-1.0_1.22.8.bb
@@ -0,0 +1,6 @@
1require cogl-1.0.inc
2
3SRC_URI += "file://0001-configure.ac-don-t-require-eglmesaext.h.patch"
4SRC_URI[archive.sha256sum] = "a805b2b019184710ff53d0496f9f0ce6dcca420c141a0f4f6fcc02131581d759"
5
6LIC_FILES_CHKSUM = "file://COPYING;md5=1b1a508d91d25ca607c83f92f3e31c84"