diff --git a/x11-packages/gtk2/build.sh b/x11-packages/gtk2/build.sh index af71e571b..7e5833620 100644 --- a/x11-packages/gtk2/build.sh +++ b/x11-packages/gtk2/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="GObject-based multi-platform GUI toolkit (legacy)" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=2.24.32 -TERMUX_PKG_REVISION=17 +TERMUX_PKG_REVISION=18 TERMUX_PKG_SRCURL=https://github.com/GNOME/gtk/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=961678c64ad986029befd7bdd8ed3e3849e2c5e54d24affbc7d49758245c87fa TERMUX_PKG_BUILD_IN_SRC=true diff --git a/x11-packages/gtk2/gdk_x11_gdkimage-x11.c.patch b/x11-packages/gtk2/gdk_x11_gdkimage-x11.c.patch new file mode 100644 index 000000000..f0314309f --- /dev/null +++ b/x11-packages/gtk2/gdk_x11_gdkimage-x11.c.patch @@ -0,0 +1,88 @@ +diff -uNr gtk-2.24.32/gdk/x11/gdkimage-x11.c gtk-2.24.32.mod/gdk/x11/gdkimage-x11.c +--- gtk-2.24.32/gdk/x11/gdkimage-x11.c 2018-01-08 23:35:39.000000000 +0200 ++++ gtk-2.24.32.mod/gdk/x11/gdkimage-x11.c 2020-01-04 23:45:54.651752410 +0200 +@@ -35,7 +35,83 @@ + + #ifdef USE_SHM + #include +-#include ++#include ++#include ++ ++#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); ++} + #endif /* USE_SHM */ + + #include