summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/libepoxy
diff options
context:
space:
mode:
authorAndreas Müller <schnitzeltony@googlemail.com>2015-05-21 14:42:16 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-24 07:19:18 +0100
commitc1eefc5a4bee25dcf9f8fbe57dc980e9fe352cf7 (patch)
tree5a503e585296293e396c0f4481ff1a771dca6575 /meta/recipes-graphics/libepoxy
parent887fcb565381c59b1cc0b3426e1188baf030f2da (diff)
downloadpoky-c1eefc5a4bee25dcf9f8fbe57dc980e9fe352cf7.tar.gz
libepoxy: make buildable for x11-less environments / update to latest version
* Make glx part configurable by PACKAGECONFIG enabled by 'x11' distro feature * Major upstream enhancement is using pkgconfig for egl. This should make those egl implementations happy that require compiler extra options for their egl headers. Example: meta-fsl-arm/imx-gpu-viv sets -DLINUX (and others) in egl.pc. These are mandatory for proper builds. (From OE-Core rev: 7bbd34c0efd0f7d65edb7187abdde695e45f62e2) Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/libepoxy')
-rw-r--r--meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch128
-rw-r--r--meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch42
-rw-r--r--meta/recipes-graphics/libepoxy/libepoxy_1.2.bb19
-rw-r--r--meta/recipes-graphics/libepoxy/libepoxy_git.bb24
4 files changed, 194 insertions, 19 deletions
diff --git a/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch b/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch
new file mode 100644
index 0000000000..674c8e8330
--- /dev/null
+++ b/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch
@@ -0,0 +1,128 @@
1From 3a93150bc0aec86afdb7d053247dc2448925e09a Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
3Date: Wed, 6 May 2015 10:45:22 +0200
4Subject: [PATCH 1/2] select platforms based on configuration results
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Upstream-Status: Submitted [1]
10
11[1] https://github.com/anholt/libepoxy/pull/52
12
13Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
14---
15 configure.ac | 13 +++++--------
16 src/dispatch_common.c | 9 ++++++---
17 src/dispatch_common.h | 9 +++++----
18 3 files changed, 16 insertions(+), 15 deletions(-)
19
20diff --git a/configure.ac b/configure.ac
21index a52fc58..bdd70da 100644
22--- a/configure.ac
23+++ b/configure.ac
24@@ -58,6 +58,10 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
25 # uintptr_t to a void *") by default. Kill that.
26 XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
27
28+PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
29+
30+AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
31+
32 has_znow=yes
33
34 case $host_os in
35@@ -86,7 +90,7 @@ case $host_os in
36 ;;
37 *)
38 build_egl=yes
39- build_glx=yes
40+ build_glx=$x11
41 build_wgl=no
42 # On platforms with dlopen, we load everything dynamically and
43 # don't link against a specific window system or GL implementation.
44@@ -144,13 +148,6 @@ esac
45
46 AC_SUBST([VISIBILITY_CFLAGS])
47
48-PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
49-if test x$x11 = xno -a x$build_glx = xyes; then
50- AC_MSG_ERROR([libX11 headers (libx11-dev) required to build with GLX support])
51-fi
52-
53-AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
54-
55 PKG_CHECK_MODULES(GL, [gl], [gl=yes], [gl=no])
56
57 AC_CONFIG_FILES([
58diff --git a/src/dispatch_common.c b/src/dispatch_common.c
59index 4e34d6e..2ab84ed 100644
60--- a/src/dispatch_common.c
61+++ b/src/dispatch_common.c
62@@ -615,10 +615,13 @@ epoxy_get_proc_address(const char *name)
63 #elif defined(__APPLE__)
64 return epoxy_gl_dlsym(name);
65 #else
66+#if PLATFORM_HAS_GLX
67 if (epoxy_current_context_is_glx()) {
68 return glXGetProcAddressARB((const GLubyte *)name);
69- } else {
70+ } else
71+#endif /* PLATFORM_HAS_GLX */
72 #if PLATFORM_HAS_EGL
73+ {
74 GLenum egl_api = epoxy_egl_get_current_gl_context_api();
75
76 switch (egl_api) {
77@@ -628,10 +631,10 @@ epoxy_get_proc_address(const char *name)
78 case EGL_NONE:
79 break;
80 }
81-#endif
82 }
83+#endif /* PLATFORM_HAS_EGL */
84 errx(1, "Couldn't find current GLX or EGL context.\n");
85-#endif
86+#endif /* _WIN32 | __APPLE__*/
87 }
88
89 void
90diff --git a/src/dispatch_common.h b/src/dispatch_common.h
91index 6b8503a..82681e4 100644
92--- a/src/dispatch_common.h
93+++ b/src/dispatch_common.h
94@@ -21,12 +21,13 @@
95 * IN THE SOFTWARE.
96 */
97
98+#include <config.h>
99 #include <stdbool.h>
100
101 #ifdef _WIN32
102 #define PLATFORM_HAS_EGL 0
103 #define PLATFORM_HAS_GLX 0
104-#define PLATFORM_HAS_WGL 1
105+#define PLATFORM_HAS_WGL BUILD_WGL
106 #define EPOXY_IMPORTEXPORT __declspec(dllexport)
107 #elif defined(__APPLE__)
108 #define PLATFORM_HAS_EGL 0
109@@ -34,13 +35,13 @@
110 #define PLATFORM_HAS_WGL 0
111 #define EPOXY_IMPORTEXPORT
112 #elif defined(ANDROID)
113-#define PLATFORM_HAS_EGL 1
114+#define PLATFORM_HAS_EGL BUILD_EGL
115 #define PLATFORM_HAS_GLX 0
116 #define PLATFORM_HAS_WGL 0
117 #define EPOXY_IMPORTEXPORT
118 #else
119-#define PLATFORM_HAS_EGL 1
120-#define PLATFORM_HAS_GLX 1
121+#define PLATFORM_HAS_EGL BUILD_EGL
122+#define PLATFORM_HAS_GLX BUILD_GLX
123 #define PLATFORM_HAS_WGL 0
124 #define EPOXY_IMPORTEXPORT
125 #endif
126--
1271.9.3
128
diff --git a/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch b/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch
new file mode 100644
index 0000000000..262d6845f5
--- /dev/null
+++ b/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch
@@ -0,0 +1,42 @@
1From 24868cbfb9dda5f6929dd277c47d35df016e8754 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
3Date: Wed, 6 May 2015 11:05:48 +0200
4Subject: [PATCH 2/2] add an option to disable glx support
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9this option would help us in yocto to get deterministic build results
10
11Upstream-Status: Submitted [1]
12
13[1] https://github.com/anholt/libepoxy/pull/52
14
15Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
16---
17 configure.ac | 9 ++++++++-
18 1 file changed, 8 insertions(+), 1 deletion(-)
19
20diff --git a/configure.ac b/configure.ac
21index bdd70da..6c7153d 100644
22--- a/configure.ac
23+++ b/configure.ac
24@@ -58,7 +58,14 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
25 # uintptr_t to a void *") by default. Kill that.
26 XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
27
28-PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
29+AC_ARG_ENABLE([glx],
30+ [AS_HELP_STRING([--disable-glx],
31+ [disable if you don't want x11/glx support])],
32+ [],
33+ [enable_glx=yes]
34+ )
35+
36+PKG_CHECK_MODULES(X11, [x11], [x11=$enable_glx], [x11=no])
37
38 AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
39
40--
411.9.3
42
diff --git a/meta/recipes-graphics/libepoxy/libepoxy_1.2.bb b/meta/recipes-graphics/libepoxy/libepoxy_1.2.bb
deleted file mode 100644
index 1934fae943..0000000000
--- a/meta/recipes-graphics/libepoxy/libepoxy_1.2.bb
+++ /dev/null
@@ -1,19 +0,0 @@
1SUMMARY = "OpenGL function pointer management library"
2HOMEPAGE = "https://github.com/anholt/libepoxy/"
3SECTION = "libs"
4
5LICENSE = "MIT"
6LIC_FILES_CHKSUM = "file://COPYING;md5=58ef4c80d401e07bd9ee8b6b58cf464b"
7
8
9SRC_URI = "git://github.com/anholt/libepoxy.git"
10SRCREV="7422de5b4be7b19d789136b3bb5f932de42db27c"
11
12S = "${WORKDIR}/git"
13
14inherit autotools pkgconfig distro_features_check
15
16# The virtual/libx11 requires x11 in DISTRO_FEATURES
17REQUIRED_DISTRO_FEATURES = "x11"
18
19DEPENDS = "util-macros virtual/egl virtual/libx11"
diff --git a/meta/recipes-graphics/libepoxy/libepoxy_git.bb b/meta/recipes-graphics/libepoxy/libepoxy_git.bb
new file mode 100644
index 0000000000..9816257495
--- /dev/null
+++ b/meta/recipes-graphics/libepoxy/libepoxy_git.bb
@@ -0,0 +1,24 @@
1SUMMARY = "OpenGL function pointer management library"
2HOMEPAGE = "https://github.com/anholt/libepoxy/"
3SECTION = "libs"
4
5LICENSE = "MIT"
6LIC_FILES_CHKSUM = "file://COPYING;md5=58ef4c80d401e07bd9ee8b6b58cf464b"
7
8
9SRC_URI = " \
10 git://github.com/anholt/libepoxy.git \
11 file://0001-select-platforms-based-on-configuration-results.patch \
12 file://0002-add-an-option-to-disable-glx-support.patch \
13"
14SRCREV="20062c25e7612cab023cdef44d3277ba1bd0b2de"
15PV = "1.2+git${SRCPV}"
16
17S = "${WORKDIR}/git"
18
19inherit autotools pkgconfig
20
21DEPENDS = "util-macros virtual/egl"
22
23PACKAGECONFIG[x11] = "--enable-glx, --disable-glx, virtual/libx11"
24PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"