imlib2: add x11 support

This commit is contained in:
Jeremy Soller 2025-10-30 13:07:51 -06:00
parent cd57cda649
commit dc8e9f55b3
No known key found for this signature in database
GPG Key ID: 670FDFB5428E05CA
2 changed files with 121 additions and 6 deletions

View File

@ -1,17 +1,28 @@
#TODO compilation error - unknown type name "sigjmp_buf"
[source]
tar = "https://downloads.sourceforge.net/project/enlightenment/imlib2-src/1.12.1/imlib2-1.12.1.tar.xz"
tar = "https://downloads.sourceforge.net/project/enlightenment/imlib2-src/1.12.5/imlib2-1.12.5.tar.xz"
blake3 = "535b6a986538295af5194e81281a11a1d7e79ae518959ca434f1e53bfa67e86d"
patches = ["redox.patch"]
script = """
DYNAMIC_INIT
autotools_recursive_regenerate
"""
[build]
template = "custom"
dependencies = [
"freetype2",
"libjpeg",
"libpng",
"freetype2",
"libpthread-stubs",
"libx11",
"libxau",
"libxcb",
"libxext",
"x11proto",
"zlib",
]
script = """
COOKBOOK_CONFIGURE_FLAGS+=(
--without-x
)
cookbook_configure
DYNAMIC_INIT
cookbook_configure --without-x-shm-fd
"""

View File

@ -0,0 +1,104 @@
diff -ruwN '--exclude=Makefile.in' source-old/src/lib/x11_grab.c source/src/lib/x11_grab.c
--- source-old/src/lib/x11_grab.c 2024-12-24 07:45:18.000000000 -0700
+++ source/src/lib/x11_grab.c 2025-10-30 12:54:08.011156248 -0600
@@ -4,8 +4,10 @@
#include <X11/Xutil.h>
#include <X11/extensions/shape.h>
#include <X11/extensions/XShm.h>
+#if !defined(__redox__)
#include <sys/ipc.h>
#include <sys/shm.h>
+#endif
#include "x11_grab.h"
#include "x11_ximage.h"
diff -ruwN '--exclude=Makefile.in' source-old/src/lib/x11_rend.c source/src/lib/x11_rend.c
--- source-old/src/lib/x11_rend.c 2025-04-06 07:16:45.000000000 -0600
+++ source/src/lib/x11_rend.c 2025-10-30 12:55:57.324410357 -0600
@@ -474,20 +474,24 @@
gcm = XCreateGC(x11->dpy, m, GCGraphicsExposures, &gcv);
}
/* write the mask */
+#if !defined(__redox__)
if (shm)
/* write shm XImage */
XShmPutImage(x11->dpy, m, gcm, mxim, 0, 0, dx, dy, dw, dh, False);
/* write regular XImage */
else
+#endif
XPutImage(x11->dpy, m, gcm, mxim, 0, 0, dx, dy, dw, dh);
}
/* write the image */
+#if !defined(__redox__)
if (shm)
/* write shm XImage */
XShmPutImage(x11->dpy, w, gc, xim, 0, 0, dx, dy, dw, dh, False);
/* write regular XImage */
else
+#endif
XPutImage(x11->dpy, w, gc, xim, 0, 0, dx, dy, dw, dh);
/* free the XImage and put onto our free list */
diff -ruwN '--exclude=Makefile.in' source-old/src/lib/x11_ximage.c source/src/lib/x11_ximage.c
--- source-old/src/lib/x11_ximage.c 2024-01-02 06:11:28.000000000 -0700
+++ source/src/lib/x11_ximage.c 2025-10-30 12:57:02.128925585 -0600
@@ -11,8 +11,10 @@
#include <xcb/shm.h>
#include <sys/mman.h>
#endif
+#if !defined(__redox__)
#include <sys/ipc.h>
#include <sys/shm.h>
+#endif
#include "x11_ximage.h"
@@ -56,6 +58,7 @@
int val;
/* if its there set x_does_shm flag */
+#if !defined(__redox__)
if (XShmQueryExtension(d))
{
#ifdef HAVE_X11_SHM_FD
@@ -72,6 +75,7 @@
}
/* clear the flag - no shm at all */
else
+#endif
{
x_does_shm = 0;
return;
@@ -121,6 +125,7 @@
return NULL;
/* try create an shm image */
+#if !defined(__redox__)
xim = XShmCreateImage(x11->dpy, x11->vis, depth, ZPixmap, NULL, si, w, h);
if (!xim)
return NULL;
@@ -230,6 +235,7 @@
shmctl(si->shmid, IPC_RMID, 0);
}
}
+#endif
/* couldnt create SHM image ? */
/* destroy previous image */
@@ -243,6 +249,7 @@
XShmSegmentInfo *si)
{
XSync(x11->dpy, False);
+#if !defined(__redox__)
XShmDetach(x11->dpy, si);
#ifdef HAVE_X11_SHM_FD
if (x_does_shm_fd)
@@ -255,6 +262,7 @@
shmdt(si->shmaddr);
shmctl(si->shmid, IPC_RMID, 0);
}
+#endif
XDestroyImage(xim);
}