From dc8e9f55b3730efd3db745c3633878c8981c948d Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 30 Oct 2025 13:07:51 -0600 Subject: [PATCH] imlib2: add x11 support --- recipes/wip/libs/other/imlib2/recipe.toml | 23 +++-- recipes/wip/libs/other/imlib2/redox.patch | 104 ++++++++++++++++++++++ 2 files changed, 121 insertions(+), 6 deletions(-) create mode 100644 recipes/wip/libs/other/imlib2/redox.patch diff --git a/recipes/wip/libs/other/imlib2/recipe.toml b/recipes/wip/libs/other/imlib2/recipe.toml index e4e84b31f..9c54f870d 100644 --- a/recipes/wip/libs/other/imlib2/recipe.toml +++ b/recipes/wip/libs/other/imlib2/recipe.toml @@ -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 """ diff --git a/recipes/wip/libs/other/imlib2/redox.patch b/recipes/wip/libs/other/imlib2/redox.patch new file mode 100644 index 000000000..eb82e68ba --- /dev/null +++ b/recipes/wip/libs/other/imlib2/redox.patch @@ -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 + #include + #include ++#if !defined(__redox__) + #include + #include ++#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 + #include + #endif ++#if !defined(__redox__) + #include + #include ++#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); + } +