Leonid Plyushch
5 years ago
7 changed files with 181 additions and 0 deletions
@ -0,0 +1,10 @@ |
|||
TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/enlightenment/ |
|||
TERMUX_PKG_DESCRIPTION="Library that does image file loading and saving as well as rendering, manipulation, arbitrary polygon support" |
|||
TERMUX_PKG_LICENSE="BSD" |
|||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>" |
|||
TERMUX_PKG_VERSION=1.5.1 |
|||
TERMUX_PKG_REVISION=10 |
|||
TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/enlightenment/imlib2-${TERMUX_PKG_VERSION}.tar.gz |
|||
TERMUX_PKG_SHA256=b25df9347648cf3dfb784c099139ab24157b1dbd1baa9428f103b683b8a78c61 |
|||
TERMUX_PKG_DEPENDS="freetype, giflib, libandroid-shmem, libbz2, libid3tag, libjpeg-turbo, libpng, libtiff, libxext, zlib" |
|||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="LIBS=-landroid-shmem" |
@ -0,0 +1,24 @@ |
|||
diff -uNr imlib2-1.5.1/src/bin/imlib2_show.c imlib2-1.5.1.mod/src/bin/imlib2_show.c
|
|||
--- imlib2-1.5.1/src/bin/imlib2_show.c 2018-03-16 17:29:59.000000000 +0200
|
|||
+++ imlib2-1.5.1.mod/src/bin/imlib2_show.c 2018-11-14 19:08:41.689118629 +0200
|
|||
@@ -23,6 +23,11 @@
|
|||
*/ |
|||
#include "Imlib2.h" |
|||
|
|||
+static int android_mblen(const char *s, size_t n)
|
|||
+{
|
|||
+ return mbtowc(0, s, n);
|
|||
+}
|
|||
+
|
|||
Display *disp; |
|||
Window win; |
|||
Visual *vis; |
|||
@@ -1276,7 +1281,7 @@
|
|||
char tmp[16]; |
|||
int len; |
|||
|
|||
- len = mblen(str + cp, MB_CUR_MAX);
|
|||
+ len = android_mblen(str + cp, MB_CUR_MAX);
|
|||
if (len < 0) |
|||
len = 1; |
|||
strncpy(tmp, str + cp, len); |
@ -0,0 +1,93 @@ |
|||
diff -uNr imlib2-1.5.1/src/lib/ximage.c imlib2-1.5.1.mod/src/lib/ximage.c
|
|||
--- imlib2-1.5.1/src/lib/ximage.c 2018-03-10 21:31:39.000000000 +0200
|
|||
+++ imlib2-1.5.1.mod/src/lib/ximage.c 2019-09-10 22:24:51.561058349 +0300
|
|||
@@ -9,7 +9,8 @@
|
|||
#include <sys/mman.h> |
|||
#endif |
|||
#include <sys/ipc.h> |
|||
-#include <sys/shm.h>
|
|||
+#include <linux/shm.h>
|
|||
+#include <dlfcn.h>
|
|||
|
|||
#include "ximage.h" |
|||
|
|||
@@ -36,6 +37,79 @@
|
|||
/* temporary X error catcher we use later */ |
|||
static char _x_err = 0; |
|||
|
|||
+#ifndef shmid_ds
|
|||
+# define shmid_ds shmid64_ds
|
|||
+#endif
|
|||
+
|
|||
+static void * (*android_shmat)(int shmid, const void *shmaddr, int shmflg) = NULL;
|
|||
+static int (*android_shmdt)(const void *shmaddr) = NULL;
|
|||
+static int (*android_shmget)(key_t key, size_t size, int shmflg) = NULL;
|
|||
+static int (*android_shmctl)(int shmid, int cmd, struct shmid_ds *buf) = NULL;
|
|||
+
|
|||
+static void * shmat(int shmid, const void *shmaddr, int shmflg) {
|
|||
+ if (!android_shmat) {
|
|||
+ void *handle = dlopen("@TERMUX_PREFIX@/lib/libandroid-shmem.so", RTLD_LOCAL | RTLD_LAZY);
|
|||
+
|
|||
+ if (!handle) {
|
|||
+ abort();
|
|||
+ }
|
|||
+
|
|||
+ android_shmat = dlsym(handle, "shmat");
|
|||
+
|
|||
+ dlclose(handle);
|
|||
+ }
|
|||
+
|
|||
+ return android_shmat(shmid, shmaddr, shmflg);
|
|||
+}
|
|||
+
|
|||
+static int shmdt(const void *shmaddr) {
|
|||
+ if (!android_shmdt) {
|
|||
+ void *handle = dlopen("@TERMUX_PREFIX@/lib/libandroid-shmem.so", RTLD_LOCAL | RTLD_LAZY);
|
|||
+
|
|||
+ if (!handle) {
|
|||
+ abort();
|
|||
+ }
|
|||
+
|
|||
+ android_shmdt = dlsym(handle, "shmdt");
|
|||
+
|
|||
+ dlclose(handle);
|
|||
+ }
|
|||
+
|
|||
+ return android_shmdt(shmaddr);
|
|||
+}
|
|||
+
|
|||
+static int shmget(key_t key, size_t size, int shmflg) {
|
|||
+ if (!android_shmget) {
|
|||
+ void *handle = dlopen("@TERMUX_PREFIX@/lib/libandroid-shmem.so", RTLD_LOCAL | RTLD_LAZY);
|
|||
+
|
|||
+ if (!handle) {
|
|||
+ abort();
|
|||
+ }
|
|||
+
|
|||
+ android_shmget = dlsym(handle, "shmget");
|
|||
+
|
|||
+ dlclose(handle);
|
|||
+ }
|
|||
+
|
|||
+ return android_shmget(key, size, shmflg);
|
|||
+}
|
|||
+
|
|||
+static int shmctl(int shmid, int cmd, struct shmid_ds *buf) {
|
|||
+ if (!android_shmctl) {
|
|||
+ void *handle = dlopen("@TERMUX_PREFIX@/lib/libandroid-shmem.so", RTLD_LOCAL | RTLD_LAZY);
|
|||
+
|
|||
+ if (!handle) {
|
|||
+ abort();
|
|||
+ }
|
|||
+
|
|||
+ android_shmctl = dlsym(handle, "shmctl");
|
|||
+
|
|||
+ dlclose(handle);
|
|||
+ }
|
|||
+
|
|||
+ return android_shmctl(shmid, cmd, buf);
|
|||
+}
|
|||
+
|
|||
/* the function we use for catching the error */ |
|||
static int |
|||
TmpXError(Display * d, XErrorEvent * ev) |
@ -0,0 +1,12 @@ |
|||
diff -uNr imlib2-1.5.1/src/modules/loaders/loader_bz2.c imlib2-1.5.1.mod/src/modules/loaders/loader_bz2.c
|
|||
--- imlib2-1.5.1/src/modules/loaders/loader_bz2.c 2017-12-16 15:03:10.000000000 +0200
|
|||
+++ imlib2-1.5.1.mod/src/modules/loaders/loader_bz2.c 2018-11-14 19:06:26.991364123 +0200
|
|||
@@ -52,7 +52,7 @@
|
|||
ImlibLoader *loader; |
|||
FILE *fp; |
|||
int dest, res; |
|||
- char *file, *p, *q, tmp[] = "/tmp/imlib2_loader_bz2-XXXXXX";
|
|||
+ char *file, *p, *q, tmp[] = "@TERMUX_PREFIX@/tmp/imlib2_loader_bz2-XXXXXX";
|
|||
char *real_ext; |
|||
|
|||
assert(im); |
@ -0,0 +1,12 @@ |
|||
diff -uNr imlib2-1.5.1/src/modules/loaders/loader_id3.c imlib2-1.5.1.mod/src/modules/loaders/loader_id3.c
|
|||
--- imlib2-1.5.1/src/modules/loaders/loader_id3.c 2018-03-10 21:31:39.000000000 +0200
|
|||
+++ imlib2-1.5.1.mod/src/modules/loaders/loader_id3.c 2018-11-14 19:06:26.994697483 +0200
|
|||
@@ -507,7 +507,7 @@
|
|||
|
|||
if (loader) |
|||
{ |
|||
- char *ofile, tmp[] = "/tmp/imlib2_loader_id3-XXXXXX";
|
|||
+ char *ofile, tmp[] = "@TERMUX_PREFIX@/tmp/imlib2_loader_id3-XXXXXX";
|
|||
int dest; |
|||
|
|||
if ((dest = mkstemp(tmp)) < 0) |
@ -0,0 +1,18 @@ |
|||
diff -uNr imlib2-1.5.1/src/modules/loaders/loader_xpm.c imlib2-1.5.1.mod/src/modules/loaders/loader_xpm.c
|
|||
--- imlib2-1.5.1/src/modules/loaders/loader_xpm.c 2018-03-11 09:54:36.000000000 +0200
|
|||
+++ imlib2-1.5.1.mod/src/modules/loaders/loader_xpm.c 2018-11-14 19:06:27.004697564 +0200
|
|||
@@ -51,11 +51,11 @@
|
|||
} |
|||
/* look in rgb txt database */ |
|||
if (!rgb_txt) |
|||
- rgb_txt = fopen("/usr/share/X11/rgb.txt", "r");
|
|||
+ rgb_txt = fopen("@TERMUX_PREFIX@/share/X11/rgb.txt", "r");
|
|||
if (!rgb_txt) |
|||
- rgb_txt = fopen("/usr/X11R6/lib/X11/rgb.txt", "r");
|
|||
+ rgb_txt = fopen("@TERMUX_PREFIX@/X11R6/lib/X11/rgb.txt", "r");
|
|||
if (!rgb_txt) |
|||
- rgb_txt = fopen("/usr/openwin/lib/X11/rgb.txt", "r");
|
|||
+ rgb_txt = fopen("@TERMUX_PREFIX@/openwin/lib/X11/rgb.txt", "r");
|
|||
if (!rgb_txt) |
|||
return; |
|||
fseek(rgb_txt, 0, SEEK_SET); |
@ -0,0 +1,12 @@ |
|||
diff -uNr imlib2-1.5.1/src/modules/loaders/loader_zlib.c imlib2-1.5.1.mod/src/modules/loaders/loader_zlib.c
|
|||
--- imlib2-1.5.1/src/modules/loaders/loader_zlib.c 2017-12-16 15:03:10.000000000 +0200
|
|||
+++ imlib2-1.5.1.mod/src/modules/loaders/loader_zlib.c 2018-11-14 19:06:27.008030924 +0200
|
|||
@@ -44,7 +44,7 @@
|
|||
{ |
|||
ImlibLoader *loader; |
|||
int src, dest, res; |
|||
- char *file, *p, *q, tmp[] = "/tmp/imlib2_loader_zlib-XXXXXX";
|
|||
+ char *file, *p, *q, tmp[] = "@TERMUX_PREFIX@/tmp/imlib2_loader_zlib-XXXXXX";
|
|||
char *real_ext; |
|||
struct stat st; |
|||
|
Loading…
Reference in new issue