summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch70
-rw-r--r--meta/recipes-graphics/libsdl/libsdl_1.2.14.bb3
2 files changed, 72 insertions, 1 deletions
diff --git a/meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch b/meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch
new file mode 100644
index 0000000000..7bab177749
--- /dev/null
+++ b/meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch
@@ -0,0 +1,70 @@
1_XGetRequest API was backported to libx11-1.4.4 in:
2http://git.openembedded.org/openembedded-core/commit/?id=e08604800fe1cb8f240f53c147ceb4ee08a29b91
3
4This breaks e.g. libsdl-image build with:
5| /OE/shr-core/tmp-eglibc/sysroots/qemux86-64/usr/lib/libSDL.so: undefined reference to `_XGetRequest'
6
7For details see: https://bugzilla.redhat.com/show_bug.cgi?id=782251
8
9Upstream-Status: Accepted
10
11@@ -, +, @@
12 added.
13 src/video/x11/SDL_x11dyn.c | 24 ++++++++++++++++++++++++
14 src/video/x11/SDL_x11sym.h | 6 ++++++
15 2 files changed, 30 insertions(+), 0 deletions(-)
16--- a/src/video/x11/SDL_x11dyn.c
17+++ a/src/video/x11/SDL_x11dyn.c
18@@ -109,6 +109,21 @@ char *(*pXGetICValues)(XIC, ...) = NULL;
19 #undef SDL_X11_SYM
20
21
22+static void *SDL_XGetRequest_workaround(Display* dpy, CARD8 type, size_t len)
23+{
24+ xReq *req;
25+ WORD64ALIGN
26+ if (dpy->bufptr + len > dpy->bufmax)
27+ _XFlush(dpy);
28+ dpy->last_req = dpy->bufptr;
29+ req = (xReq*)dpy->bufptr;
30+ req->reqType = type;
31+ req->length = len / 4;
32+ dpy->bufptr += len;
33+ dpy->request++;
34+ return req;
35+}
36+
37 static int x11_load_refcount = 0;
38
39 void SDL_X11_UnloadSymbols(void)
40@@ -168,6 +183,15 @@ int SDL_X11_LoadSymbols(void)
41 X11_GetSym("XGetICValues",&SDL_X11_HAVE_UTF8,(void **)&pXGetICValues);
42 #endif
43
44+ /*
45+ * In case we're built with newer Xlib headers, we need to make sure
46+ * that _XGetRequest() is available, even on older systems.
47+ * Otherwise, various Xlib macros we use will call a NULL pointer.
48+ */
49+ if (!SDL_X11_HAVE_XGETREQUEST) {
50+ p_XGetRequest = SDL_XGetRequest_workaround;
51+ }
52+
53 if (SDL_X11_HAVE_BASEXLIB) { /* all required symbols loaded. */
54 SDL_ClearError();
55 } else {
56--- a/src/video/x11/SDL_x11sym.h
57+++ a/src/video/x11/SDL_x11sym.h
58@@ -170,6 +170,12 @@ SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,
59 #endif
60
61 /*
62+ * libX11 1.4.99.1 added _XGetRequest, and macros use it behind the scenes.
63+ */
64+SDL_X11_MODULE(XGETREQUEST)
65+SDL_X11_SYM(void *,_XGetRequest,(Display* a,CARD8 b,size_t c),(a,b,c),return)
66+
67+/*
68 * These only show up on some variants of Unix.
69 */
70 #if defined(__osf__)
diff --git a/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb b/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb
index f587291b52..5b87f39647 100644
--- a/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb
+++ b/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb
@@ -15,10 +15,11 @@ PROVIDES = "virtual/libsdl"
15DEPENDS = "${@base_contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl', '', d)} virtual/libx11 libxext libxrandr libxrender tslib" 15DEPENDS = "${@base_contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl', '', d)} virtual/libx11 libxext libxrandr libxrender tslib"
16DEPENDS_virtclass-nativesdk = "libx11-nativesdk libxrandr-nativesdk libxrender-nativesdk libxext-nativesdk" 16DEPENDS_virtclass-nativesdk = "libx11-nativesdk libxrandr-nativesdk libxrender-nativesdk libxext-nativesdk"
17 17
18PR = "r4" 18PR = "r5"
19 19
20SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \ 20SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
21 file://configure_tweak.patch \ 21 file://configure_tweak.patch \
22 file://add.XGetRequest.symbol.patch \
22 " 23 "
23 24
24S = "${WORKDIR}/SDL-${PV}" 25S = "${WORKDIR}/SDL-${PV}"