From 8dfddb0dc7a5e54a07132536fd7fe42f88ab9265 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Fri, 13 May 2022 17:08:40 +0200 Subject: [PATCH] Upgrading xwayland. --- x11-packages/xwayland/build.sh | 78 +++--- .../xwayland/disable-modesetting.patch | 14 -- .../xwayland/statifiing-all-modules.patch | 147 ------------ x11-packages/xwayland/stubmain.c.patch | 19 -- ...org-server-1.20.1_Xext_xf86bigfont.c.patch | 20 -- .../xorg-server-1.20.1_include_site.h.patch | 12 - .../xorg-server-1.20.1_os_access.c.patch | 12 - .../xorg-server-1.20.1_os_backtrace.c.patch | 19 -- .../xorg-server-1.20.1_os_connection.c.patch | 12 - .../xorg-server-1.20.1_os_osinit.c.patch | 12 - .../xorg-server-1.20.1_os_utils.c.patch | 161 ------------- .../xorg-server-1.20.1_xkb_ddxLoad.c.patch | 14 -- .../xwayland/xwayland_disable_glx.patch | 20 -- .../xwayland/xwayland_for_android.patch | 222 ------------------ 14 files changed, 32 insertions(+), 730 deletions(-) delete mode 100644 x11-packages/xwayland/disable-modesetting.patch delete mode 100644 x11-packages/xwayland/statifiing-all-modules.patch delete mode 100644 x11-packages/xwayland/stubmain.c.patch delete mode 100644 x11-packages/xwayland/xorg-server-1.20.1_Xext_xf86bigfont.c.patch delete mode 100644 x11-packages/xwayland/xorg-server-1.20.1_include_site.h.patch delete mode 100644 x11-packages/xwayland/xorg-server-1.20.1_os_access.c.patch delete mode 100644 x11-packages/xwayland/xorg-server-1.20.1_os_backtrace.c.patch delete mode 100644 x11-packages/xwayland/xorg-server-1.20.1_os_connection.c.patch delete mode 100644 x11-packages/xwayland/xorg-server-1.20.1_os_osinit.c.patch delete mode 100644 x11-packages/xwayland/xorg-server-1.20.1_os_utils.c.patch delete mode 100644 x11-packages/xwayland/xorg-server-1.20.1_xkb_ddxLoad.c.patch delete mode 100644 x11-packages/xwayland/xwayland_disable_glx.patch delete mode 100644 x11-packages/xwayland/xwayland_for_android.patch diff --git a/x11-packages/xwayland/build.sh b/x11-packages/xwayland/build.sh index 23bafa5a0..03cceeb23 100644 --- a/x11-packages/xwayland/build.sh +++ b/x11-packages/xwayland/build.sh @@ -2,57 +2,43 @@ TERMUX_PKG_HOMEPAGE=https://xorg.freedesktop.org/wiki/ TERMUX_PKG_DESCRIPTION="Wayland X11 server" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION=1.20.5 +TERMUX_PKG_VERSION=22.1.0 TERMUX_PKG_REVISION=14 -TERMUX_PKG_SRCURL=https://xorg.freedesktop.org/releases/individual/xserver/xorg-server-${TERMUX_PKG_VERSION}.tar.bz2 +TERMUX_PKG_SRCURL=https://gitlab.freedesktop.org/xorg/xserver/-/archive/xwayland-${TERMUX_PKG_VERSION}/xserver-xwayland-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=a81d8243f37e75a03d4f8c55f96d0bc25802be6ec45c3bfa5cb614c6d01bac9d TERMUX_PKG_DEPENDS="libandroid-shmem, libdrm, libpciaccess, libpixman, libx11, libxau, libxfont2, libxinerama, libxkbfile, libxshmfence, mesa, openssl, xkeyboard-config, xorg-xkbcomp, libwayland, libwayland-protocols, libepoxy" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ---enable-composite ---enable-mitshm ---enable-xres ---enable-record ---enable-xv ---enable-xvmc ---enable-dga ---enable-screensaver ---enable-xdmcp ---disable-glx ---disable-dri ---disable-dri2 ---disable-dri3 ---enable-present ---enable-xinerama ---enable-xf86vidmode ---enable-xace ---enable-xcsecurity ---enable-dbe ---enable-xf86bigfont ---disable-xfree86-utils ---disable-vgahw ---disable-vbe ---disable-int10-module ---enable-libdrm ---disable-pciaccess ---disable-linux-acpi ---disable-linux-apm ---disable-xorg ---disable-glamor ---disable-dmx ---disable-xvfb ---disable-xnest ---enable-xwayland ---disable-xwin ---disable-kdrive ---disable-xephyr ---disable-libunwind ---enable-xshmfence ---enable-ipv6 ---with-sha1=libcrypto ---with-fontrootdir=${TERMUX_PREFIX}/share/fonts ---with-xkb-path=${TERMUX_PREFIX}/share/X11/xkb ---with-serverconfig-path=${TERMUX_PREFIX}/etc/xwayland +-Dmitshm=true +-Dxres=true +-Dxv=true +-Dxvmc=true +-Ddga=true +-Dscreensaver=true +-Dxdmcp=true +-Dglx=false +-Ddri=false +-Ddri2=false +-Ddri3=false +-Dxinerama=true +-Dxace=true +-Dxcsecurity=true +-Dxf86bigfont=true +-Dvgahw=false +-Dint10=false +-Ddrm=true +-Dpciaccess=false +-Dlinux_acpi=false +-Dlinux_apm=false +-Dxorg=false +-Dglamor=false +-Dxvfb=false +-Dxnest=false +-Dxwayland=true +-Dxwin=false +-Dsha1=libcrypto +-Ddefault-font_path=${TERMUX_PREFIX}/share/fonts +-Dxkb-dir=${TERMUX_PREFIX}/share/X11/xkb LIBS=-landroid-shmem" # Remove files conflicting with xorg-server: diff --git a/x11-packages/xwayland/disable-modesetting.patch b/x11-packages/xwayland/disable-modesetting.patch deleted file mode 100644 index 391108d9c..000000000 --- a/x11-packages/xwayland/disable-modesetting.patch +++ /dev/null @@ -1,14 +0,0 @@ -+++ ./configure.ac -@@ -2005,9 +2005,9 @@ - XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS" - fi - -- if test "x$DRM" = xyes; then -- XORG_DRIVER_MODESETTING=yes -- fi -+# if test "x$DRM" = xyes; then -+# XORG_DRIVER_MODESETTING=yes -+# fi - - AC_SUBST([XORG_LIBS]) - AC_SUBST([XORG_SYS_LIBS]) diff --git a/x11-packages/xwayland/statifiing-all-modules.patch b/x11-packages/xwayland/statifiing-all-modules.patch deleted file mode 100644 index f02b0a93f..000000000 --- a/x11-packages/xwayland/statifiing-all-modules.patch +++ /dev/null @@ -1,147 +0,0 @@ -+++ ./hw/xfree86/Makefile.am 2018-01-28 10:03:56.740173910 +0200 -@@ -36,8 +36,8 @@ - - SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \ - ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \ -- $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods xkb \ -- fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man \ -+ $(DRI2_SUBDIR) fbdevhw shadowfb . $(VBE_SUBDIR) i2c \ -+ dixmods xkb exa $(XF86UTILS_SUBDIR) doc man \ - $(GLAMOR_EGL_SUBDIR) drivers - - DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ -@@ -45,8 +45,8 @@ - loader dixmods xkb dri dri2 exa modes \ - utils doc man glamor_egl drivers - -+lib_LTLIBRARIES = libXFree86.la - bin_PROGRAMS = Xorg --nodist_Xorg_SOURCES = sdksyms.c - - AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ - AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/parser \ -@@ -75,11 +75,35 @@ - $(top_builddir)/os/libos.la \ - $(top_builddir)/Xext/libXvidmode.la - --Xorg_LDADD = \ -- $(LOCAL_LIBS) \ -- $(XORG_SYS_LIBS) \ -- $(XSERVER_SYS_LIBS) --Xorg_DEPENDENCIES = $(LOCAL_LIBS) -+LIBXFREE86_LIBS = \ -+ $(MAIN_LIB) \ -+ $(XSERVER_LIBS) \ -+ loader/libloader.la \ -+ common/libcommon.la \ -+ os-support/libxorgos.la \ -+ parser/libxf86config.la \ -+ dixmods/libdixmods.la \ -+ modes/libxf86modes.la \ -+ ramdac/libramdac.la \ -+ ddc/libddc.la \ -+ i2c/libi2c.la \ -+ $(XORG_LIBS) \ -+ xkb/libxorgxkb.la \ -+ fbdevhw/libfbdevhw.la \ -+ $(top_builddir)/Xext/libXvidmode.la \ -+ $(top_builddir)/fb/libfb.la \ -+ $(top_builddir)/miext/shadow/libshadow.la -+ -+ -+libXFree86_la_LDFLAGS = $(Xorg_LDFLAGS) -module -avoid-version -Wl,--unresolved-symbols=report-all -rdynamic -+nodist_libXFree86_la_SOURCES = sdksyms.c -+libXFree86_la_SOURCES = -+libXFree86_la_LIBADD = $(LIBXFREE86_LIBS) $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) -+libXFree86_la_CFLAGS = $(AM_CFLAGS) -+libXFree86_la_DEPENDENCIES = $(LOCAL_LIBS) -+ -+Xorg_LDADD = libXFree86.la -+Xorg_SOURCES = $(top_srcdir)/dix/stubmain.c - - Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) - -+++ ./hw/xfree86/shadowfb/Makefile.am 2018-01-28 15:18:06.191501835 +0200 -@@ -1,5 +1,5 @@ - module_LTLIBRARIES = libshadowfb.la --libshadowfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -+libshadowfb_la_LDFLAGS = -module -avoid-version -static $(LD_NO_UNDEFINED_FLAG) - libshadowfb_la_SOURCES = sfbmodule.c shadowfb.c - libshadowfb_la_LIBADD = $(PIXMAN_LIBS) - - -+++ ./miext/shadow/Makefile.am 2018-01-28 15:24:22.836598681 +0200 -@@ -6,6 +6,7 @@ - sdk_HEADERS = shadow.h - endif - -+libshadow_la_LDFLAGS = -module -avoid-version -static - libshadow_la_SOURCES = \ - c2p_core.h \ - shadow.c \ - -+++ ./hw/xfree86/fbdevhw/Makefile.am 2018-01-28 16:04:05.242414784 +0200 -@@ -1,17 +1,11 @@ - SUBDIRS = man - --module_LTLIBRARIES = libfbdevhw.la -+noinst_LTLIBRARIES = libfbdevhw.la - --libfbdevhw_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -+libfbdevhw_la_LDFLAGS = -module -avoid-version -static $(LD_NO_UNDEFINED_FLAG) -- --if FBDEVHW - libfbdevhw_la_SOURCES = fbdevhw.c --else --libfbdevhw_la_SOURCES = fbdevhwstub.c --endif - - AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../i2c -I$(srcdir)/../modes -I$(srcdir)/../ddc -I$(srcdir)/../parser -- - AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) - - sdk_HEADERS = fbdevhw.h - -+++ ./hw/xfree86/dixmods/Makefile.am 2018-01-30 00:09:07.250483502 +0200 -@@ -17,17 +17,17 @@ - -I$(top_srcdir)/miext/shadow \ - -I$(top_srcdir)/glx - --libfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -+libfb_la_LDFLAGS = -module -avoid-version -static $(LD_NO_UNDEFINED_FLAG) - libfb_la_LIBADD = $(top_builddir)/fb/libfb.la - libfb_la_SOURCES = fbmodule.c - libfb_la_CFLAGS = $(AM_CFLAGS) - --libwfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -+libwfb_la_LDFLAGS = -module -avoid-version -static $(LD_NO_UNDEFINED_FLAG) - libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la - libwfb_la_SOURCES = fbmodule.c - libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER - --libglx_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -+libglx_la_LDFLAGS = -module -avoid-version -static $(LD_NO_UNDEFINED_FLAG) - libglx_la_LIBADD = $(top_builddir)/glx/libglx.la $(GLX_SYS_LIBS) - if DRI2 - libglx_la_LIBADD += $(top_builddir)/glx/libglxdri.la -@@ -37,7 +37,7 @@ - endif - libglx_la_SOURCES = glxmodule.c - --libshadow_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) -+libshadow_la_LDFLAGS = -module -avoid-version -static $(LD_NO_UNDEFINED_FLAG) - libshadow_la_LIBADD = $(top_builddir)/miext/shadow/libshadow.la - if NO_UNDEFINED - libshadow_la_LIBADD += libfb.la - -+++ ./include/dix.h 2018-01-25 00:43:05.367766278 +0200 -@@ -307,7 +307,7 @@ - extern _X_EXPORT void - SetVendorString(const char *string); - --int -+_X_EXPORT int - dix_main(int argc, char *argv[], char *envp[]); - - /* events.c */ - diff --git a/x11-packages/xwayland/stubmain.c.patch b/x11-packages/xwayland/stubmain.c.patch deleted file mode 100644 index aba82f76e..000000000 --- a/x11-packages/xwayland/stubmain.c.patch +++ /dev/null @@ -1,19 +0,0 @@ -+++ ./dix/stubmain.c -@@ -23,6 +23,7 @@ - - ******************************************************************/ - -+extern const char *xf86LogFile; - int dix_main(int argc, char *argv[], char *envp[]); - - /* -@@ -31,5 +32,9 @@ - int - main(int argc, char *argv[], char *envp[]) - { -+#ifdef ANDROID -+ xf86LogFile = "/dev/null"; -+#endif -+ - return dix_main(argc, argv, envp); - } diff --git a/x11-packages/xwayland/xorg-server-1.20.1_Xext_xf86bigfont.c.patch b/x11-packages/xwayland/xorg-server-1.20.1_Xext_xf86bigfont.c.patch deleted file mode 100644 index c248c2faa..000000000 --- a/x11-packages/xwayland/xorg-server-1.20.1_Xext_xf86bigfont.c.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -uNr xorg-server-1.20.1/Xext/xf86bigfont.c xorg-server-1.20.1.mod/Xext/xf86bigfont.c ---- xorg-server-1.20.1/Xext/xf86bigfont.c 2018-08-07 19:31:00.000000000 +0300 -+++ xorg-server-1.20.1.mod/Xext/xf86bigfont.c 2018-10-08 21:07:49.005945142 +0300 -@@ -715,16 +715,7 @@ - /* fprintf(stderr, "signature = 0x%08X\n", signature); */ - - FontShmdescIndex = xfont2_allocate_font_private_index(); -- --#if !defined(CSRG_BASED) && !defined(__CYGWIN__) -- pagesize = SHMLBA; --#else --#ifdef _SC_PAGESIZE - pagesize = sysconf(_SC_PAGESIZE); --#else -- pagesize = getpagesize(); --#endif --#endif - #endif - } - } diff --git a/x11-packages/xwayland/xorg-server-1.20.1_include_site.h.patch b/x11-packages/xwayland/xorg-server-1.20.1_include_site.h.patch deleted file mode 100644 index 3a8583a40..000000000 --- a/x11-packages/xwayland/xorg-server-1.20.1_include_site.h.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uNr xorg-server-1.20.1/include/site.h xorg-server-1.20.1.mod/include/site.h ---- xorg-server-1.20.1/include/site.h 2018-08-07 19:31:05.000000000 +0300 -+++ xorg-server-1.20.1.mod/include/site.h 2018-10-08 21:07:16.824256995 +0300 -@@ -72,7 +72,7 @@ - * DO NOT CHANGE THESE VALUES OR THE DIX IMAKEFILE! - */ - #ifndef COMPILEDDEFAULTFONTPATH --#define COMPILEDDEFAULTFONTPATH "/usr/share/fonts/X11/misc/" -+#define COMPILEDDEFAULTFONTPATH "@TERMUX_PREFIX@/share/fonts/X11/misc/" - #endif - - /* diff --git a/x11-packages/xwayland/xorg-server-1.20.1_os_access.c.patch b/x11-packages/xwayland/xorg-server-1.20.1_os_access.c.patch deleted file mode 100644 index 07654eb13..000000000 --- a/x11-packages/xwayland/xorg-server-1.20.1_os_access.c.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uNr xorg-server-1.20.1/os/access.c xorg-server-1.20.1.mod/os/access.c ---- xorg-server-1.20.1/os/access.c 2018-08-07 19:31:05.000000000 +0300 -+++ xorg-server-1.20.1.mod/os/access.c 2018-10-08 21:07:16.834261640 +0300 -@@ -961,7 +961,7 @@ - #if defined WIN32 && defined __MINGW32__ - #define ETC_HOST_PREFIX "X" - #else --#define ETC_HOST_PREFIX "/etc/X" -+#define ETC_HOST_PREFIX "@TERMUX_PREFIX@/etc/X" - #endif - #define ETC_HOST_SUFFIX ".hosts" - fnamelen = strlen(ETC_HOST_PREFIX) + strlen(ETC_HOST_SUFFIX) + diff --git a/x11-packages/xwayland/xorg-server-1.20.1_os_backtrace.c.patch b/x11-packages/xwayland/xorg-server-1.20.1_os_backtrace.c.patch deleted file mode 100644 index fe2c254ea..000000000 --- a/x11-packages/xwayland/xorg-server-1.20.1_os_backtrace.c.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -uNr xorg-server-1.20.1/os/backtrace.c xorg-server-1.20.1.mod/os/backtrace.c ---- xorg-server-1.20.1/os/backtrace.c 2018-08-07 19:31:05.000000000 +0300 -+++ xorg-server-1.20.1.mod/os/backtrace.c 2018-10-08 21:07:16.834261640 +0300 -@@ -244,14 +244,13 @@ - /* CHILD */ - char parent[16]; - -- seteuid(0); - close(STDIN_FILENO); - close(STDOUT_FILENO); - dup2(pipefd[1], STDOUT_FILENO); - closefrom(STDERR_FILENO); - - snprintf(parent, sizeof(parent), "%d", getppid()); -- execle("/usr/bin/pstack", "pstack", parent, NULL); -+ execle("@TERMUX_PREFIX@/bin/pstack", "pstack", parent, NULL); - exit(1); - } - else { diff --git a/x11-packages/xwayland/xorg-server-1.20.1_os_connection.c.patch b/x11-packages/xwayland/xorg-server-1.20.1_os_connection.c.patch deleted file mode 100644 index 840bbeb09..000000000 --- a/x11-packages/xwayland/xorg-server-1.20.1_os_connection.c.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uNr xorg-server-1.20.1/os/connection.c xorg-server-1.20.1.mod/os/connection.c ---- xorg-server-1.20.1/os/connection.c 2018-08-07 19:31:05.000000000 +0300 -+++ xorg-server-1.20.1.mod/os/connection.c 2018-10-08 21:07:16.837596523 +0300 -@@ -996,7 +996,7 @@ - XtransConnInfo ciptr; - const char *display_env = getenv("DISPLAY"); - -- if (display_env && (strncmp(display_env, "/tmp/launch", 11) == 0)) { -+ if (display_env && (strncmp(display_env, "@TERMUX_PREFIX@/tmp/launch", 11) == 0)) { - /* Make the path the launchd socket if our DISPLAY is set right */ - strcpy(port, display_env); - } diff --git a/x11-packages/xwayland/xorg-server-1.20.1_os_osinit.c.patch b/x11-packages/xwayland/xorg-server-1.20.1_os_osinit.c.patch deleted file mode 100644 index d12c8c7f9..000000000 --- a/x11-packages/xwayland/xorg-server-1.20.1_os_osinit.c.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uNr xorg-server-1.20.1/os/osinit.c xorg-server-1.20.1.mod/os/osinit.c ---- xorg-server-1.20.1/os/osinit.c 2018-08-07 19:31:05.000000000 +0300 -+++ xorg-server-1.20.1.mod/os/osinit.c 2018-10-08 21:07:16.840931406 +0300 -@@ -72,7 +72,7 @@ - #endif - - #ifndef ADMPATH --#define ADMPATH "/usr/adm/X%smsgs" -+#define ADMPATH "@TERMUX_PREFIX@/adm/X%smsgs" - #endif - - #ifdef RLIMIT_DATA diff --git a/x11-packages/xwayland/xorg-server-1.20.1_os_utils.c.patch b/x11-packages/xwayland/xorg-server-1.20.1_os_utils.c.patch deleted file mode 100644 index 90c5a73e2..000000000 --- a/x11-packages/xwayland/xorg-server-1.20.1_os_utils.c.patch +++ /dev/null @@ -1,161 +0,0 @@ -diff -uNr xorg-server-1.20.1/os/utils.c xorg-server-1.20.1.mod/os/utils.c ---- xorg-server-1.20.1/os/utils.c 2018-08-07 19:31:05.000000000 +0300 -+++ xorg-server-1.20.1.mod/os/utils.c 2018-10-08 21:07:16.844266287 +0300 -@@ -228,7 +228,7 @@ - * server at a time. This keeps the servers from stomping on each other - * if the user forgets to give them different display numbers. - */ --#define LOCK_DIR "/tmp" -+#define LOCK_DIR "@TERMUX_PREFIX@/tmp" - #define LOCK_TMP_PREFIX "/.tX" - #define LOCK_PREFIX "/.X" - #define LOCK_SUFFIX "-lock" -@@ -320,7 +320,7 @@ - i = 0; - haslock = 0; - while ((!haslock) && (i++ < 3)) { -- haslock = (link(tmp, LockFile) == 0); -+ haslock = (rename(tmp, LockFile) == 0); - if (haslock) { - /* - * We're done. -@@ -1383,11 +1383,7 @@ - p = -1; - break; - case 0: /* child */ -- if (setgid(getgid()) == -1) -- _exit(127); -- if (setuid(getuid()) == -1) -- _exit(127); -- execl("/bin/sh", "sh", "-c", command, (char *) NULL); -+ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", command, (char *) NULL); - _exit(127); - default: /* parent */ - do { -@@ -1453,10 +1449,6 @@ - #endif - return NULL; - case 0: /* child */ -- if (setgid(getgid()) == -1) -- _exit(127); -- if (setuid(getuid()) == -1) -- _exit(127); - if (*type == 'r') { - if (pdes[1] != 1) { - /* stdout */ -@@ -1473,7 +1465,7 @@ - } - close(pdes[1]); - } -- execl("/bin/sh", "sh", "-c", command, (char *) NULL); -+ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", command, (char *) NULL); - _exit(127); - } - -@@ -1531,10 +1523,6 @@ - free(cur); - return NULL; - case 0: /* child */ -- if (setgid(getgid()) == -1) -- _exit(127); -- if (setuid(getuid()) == -1) -- _exit(127); - if (*type == 'r') { - if (pdes[1] != 1) { - /* stdout */ -@@ -1577,20 +1565,7 @@ - - return iop; - #else -- int ruid, euid; -- -- ruid = getuid(); -- euid = geteuid(); -- -- if (seteuid(ruid) == -1) { -- return NULL; -- } - iop = fopen(file, type); -- -- if (seteuid(euid) == -1) { -- fclose(iop); -- return NULL; -- } - return iop; - #endif /* HAS_SAVED_IDS_AND_SETEUID */ - } -@@ -1670,7 +1645,7 @@ - else if (getenv("TMP") != NULL) - return getenv("TMP"); - else -- return "/tmp"; -+ return "@TERMUX_PREFIX@/tmp"; - } - - int -@@ -1722,64 +1697,7 @@ - Bool - PrivsElevated(void) - { -- static Bool privsTested = FALSE; -- static Bool privsElevated = TRUE; -- -- if (!privsTested) { --#if defined(WIN32) -- privsElevated = FALSE; --#else -- if ((getuid() != geteuid()) || (getgid() != getegid())) { -- privsElevated = TRUE; -- } -- else { --#if defined(HAVE_ISSETUGID) -- privsElevated = issetugid(); --#elif defined(HAVE_GETRESUID) -- uid_t ruid, euid, suid; -- gid_t rgid, egid, sgid; -- -- if ((getresuid(&ruid, &euid, &suid) == 0) && -- (getresgid(&rgid, &egid, &sgid) == 0)) { -- privsElevated = (euid != suid) || (egid != sgid); -- } -- else { -- printf("Failed getresuid or getresgid"); -- /* Something went wrong, make defensive assumption */ -- privsElevated = TRUE; -- } --#else -- if (getuid() == 0) { -- /* running as root: uid==euid==0 */ -- privsElevated = FALSE; -- } -- else { -- /* -- * If there are saved ID's the process might still be privileged -- * even though the above test succeeded. If issetugid() and -- * getresgid() aren't available, test this by trying to set -- * euid to 0. -- */ -- unsigned int oldeuid; -- -- oldeuid = geteuid(); -- -- if (seteuid(0) != 0) { -- privsElevated = FALSE; -- } -- else { -- if (seteuid(oldeuid) != 0) { -- FatalError("Failed to drop privileges. Exiting\n"); -- } -- privsElevated = TRUE; -- } -- } --#endif -- } --#endif -- privsTested = TRUE; -- } -- return privsElevated; -+ return FALSE; - } - - /* diff --git a/x11-packages/xwayland/xorg-server-1.20.1_xkb_ddxLoad.c.patch b/x11-packages/xwayland/xorg-server-1.20.1_xkb_ddxLoad.c.patch deleted file mode 100644 index 6bf84f587..000000000 --- a/x11-packages/xwayland/xorg-server-1.20.1_xkb_ddxLoad.c.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -uNr xorg-server-1.20.1/xkb/ddxLoad.c xorg-server-1.20.1.mod/xkb/ddxLoad.c ---- xorg-server-1.20.1/xkb/ddxLoad.c 2018-08-07 19:31:06.000000000 +0300 -+++ xorg-server-1.20.1.mod/xkb/ddxLoad.c 2018-10-08 21:07:16.844266287 +0300 -@@ -76,8 +76,8 @@ - } - else - #endif -- if (strlen("/tmp/") < size) { -- (void) strcpy(outdir, "/tmp/"); -+ if (strlen("@TERMUX_PREFIX@/tmp/") < size) { -+ (void) strcpy(outdir, "@TERMUX_PREFIX@/tmp/"); - } - } - diff --git a/x11-packages/xwayland/xwayland_disable_glx.patch b/x11-packages/xwayland/xwayland_disable_glx.patch deleted file mode 100644 index e1a61d7e5..000000000 --- a/x11-packages/xwayland/xwayland_disable_glx.patch +++ /dev/null @@ -1,20 +0,0 @@ -+++ ./hw/xwayland/Makefile.am 2019-06-26 02:44:24.968986945 +0300 -@@ -24,7 +24,6 @@ - Xwayland_LDADD = \ - $(glamor_lib) \ - $(XWAYLAND_LIBS) \ -- $(top_builddir)/glx/libglxvnd.la \ - $(XWAYLAND_SYS_LIBS) \ - $(top_builddir)/Xext/libXvidmode.la \ - $(XSERVER_SYS_LIBS) - -+++ ./hw/xwayland/Makefile.in 2019-06-26 02:46:04.650920429 +0300 -@@ -640,7 +640,7 @@ - $(top_srcdir)/mi/miinitext.c $(am__append_1) $(am__append_2) \ - $(am__append_3) - Xwayland_LDADD = $(glamor_lib) $(XWAYLAND_LIBS) \ -- $(top_builddir)/glx/libglxvnd.la $(XWAYLAND_SYS_LIBS) \ -+ $(XWAYLAND_SYS_LIBS) \ - $(top_builddir)/Xext/libXvidmode.la $(XSERVER_SYS_LIBS) \ - $(am__append_5) - Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) diff --git a/x11-packages/xwayland/xwayland_for_android.patch b/x11-packages/xwayland/xwayland_for_android.patch deleted file mode 100644 index a2e6ed33f..000000000 --- a/x11-packages/xwayland/xwayland_for_android.patch +++ /dev/null @@ -1,222 +0,0 @@ -diff -Naur ../xserver-1.20.5-orig/hw/xwayland/ashmem.h ./hw/xwayland/ashmem.h ---- ../xserver-1.20.5-orig/hw/xwayland/ashmem.h 1970-01-01 02:00:00.000000000 +0200 -+++ ./hw/xwayland/ashmem.h 2019-07-12 15:00:25.712211695 +0300 -@@ -0,0 +1,47 @@ -+/**************************************************************************** -+ **************************************************************************** -+ *** -+ *** This header was automatically generated from a Linux kernel header -+ *** of the same name, to make information necessary for userspace to -+ *** call into the kernel available to libc. It contains only constants, -+ *** structures, and macros generated from the original header, and thus, -+ *** contains no copyrightable information. -+ *** -+ **************************************************************************** -+ ****************************************************************************/ -+#ifndef _LINUX_ASHMEM_H -+#define _LINUX_ASHMEM_H -+ -+#include -+#include -+#include -+ -+#define ASHMEM_NAME_LEN 256 -+ -+#define ASHMEM_NAME_DEF "dev/ashmem" -+ -+#define ASHMEM_NOT_PURGED 0 -+#define ASHMEM_WAS_PURGED 1 -+ -+#define ASHMEM_IS_UNPINNED 0 -+#define ASHMEM_IS_PINNED 1 -+ -+struct ashmem_pin { -+ uint32_t offset; -+ uint32_t len; -+}; -+ -+#define __ASHMEMIOC 0x77 -+ -+#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN]) -+#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN]) -+#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t) -+#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4) -+#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long) -+#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6) -+#define ASHMEM_PIN _IOW(__ASHMEMIOC, 7, struct ashmem_pin) -+#define ASHMEM_UNPIN _IOW(__ASHMEMIOC, 8, struct ashmem_pin) -+#define ASHMEM_GET_PIN_STATUS _IO(__ASHMEMIOC, 9) -+#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10) -+ -+#endif -diff -Naur ../xserver-1.20.5-orig/hw/xwayland/xwayland-cursor.c ./hw/xwayland/xwayland-cursor.c ---- ../xserver-1.20.5-orig/hw/xwayland/xwayland-cursor.c 2019-07-12 15:14:26.885076932 +0300 -+++ ./hw/xwayland/xwayland-cursor.c 2019-07-12 14:57:25.217524468 +0300 -@@ -66,7 +66,8 @@ - PixmapPtr pixmap; - - pixmap = xwl_shm_create_pixmap(screen, cursor->bits->width, -- cursor->bits->height, 32, 0); -+ cursor->bits->height, 32, -+ CREATE_PIXMAP_USAGE_BACKING_PIXMAP); - dixSetPrivate(&cursor->devPrivates, &xwl_cursor_private_key, pixmap); - - return TRUE; -diff -Naur ../xserver-1.20.5-orig/hw/xwayland/xwayland-glamor-gbm.c ./hw/xwayland/xwayland-glamor-gbm.c ---- ../xserver-1.20.5-orig/hw/xwayland/xwayland-glamor-gbm.c 2019-07-12 15:14:26.885076932 +0300 -+++ ./hw/xwayland/xwayland-glamor-gbm.c 2019-07-12 14:57:38.836704786 +0300 -@@ -212,9 +212,9 @@ - PixmapPtr pixmap = NULL; - - if (width > 0 && height > 0 && depth >= 15 && -- (hint == 0 || -- hint == CREATE_PIXMAP_USAGE_BACKING_PIXMAP || -- hint == CREATE_PIXMAP_USAGE_SHARED)) { -+ (hint == CREATE_PIXMAP_USAGE_BACKING_PIXMAP || -+ hint == CREATE_PIXMAP_USAGE_SHARED || -+ (xwl_screen->rootless && hint == 0))) { - uint32_t format = gbm_format_for_depth(depth); - - #ifdef GBM_BO_WITH_MODIFIERS -diff -Naur ../xserver-1.20.5-orig/hw/xwayland/xwayland-output.c ./hw/xwayland/xwayland-output.c ---- ../xserver-1.20.5-orig/hw/xwayland/xwayland-output.c 2019-07-12 15:14:26.889075146 +0300 -+++ ./hw/xwayland/xwayland-output.c 2019-07-12 14:54:13.242596617 +0300 -@@ -171,6 +171,40 @@ - return 25.4 / DEFAULT_DPI; - } - -+static int -+xwl_set_pixmap_visit_window(WindowPtr window, void *data) -+{ -+ ScreenPtr screen = window->drawable.pScreen; -+ -+ if (screen->GetWindowPixmap(window) == data) { -+ screen->SetWindowPixmap(window, screen->GetScreenPixmap(screen)); -+ return WT_WALKCHILDREN; -+ } -+ -+ return WT_DONTWALKCHILDREN; -+} -+ -+static void -+update_backing_pixmaps(struct xwl_screen *xwl_screen, int width, int height) -+{ -+ ScreenPtr pScreen = xwl_screen->screen; -+ WindowPtr pRoot = pScreen->root; -+ PixmapPtr old_pixmap, new_pixmap; -+ -+ old_pixmap = pScreen->GetScreenPixmap(pScreen); -+ new_pixmap = pScreen->CreatePixmap(pScreen, width, height, -+ pScreen->rootDepth, -+ CREATE_PIXMAP_USAGE_BACKING_PIXMAP); -+ pScreen->SetScreenPixmap(new_pixmap); -+ -+ if (old_pixmap) { -+ TraverseTree(pRoot, xwl_set_pixmap_visit_window, old_pixmap); -+ pScreen->DestroyPixmap(old_pixmap); -+ } -+ -+ pScreen->ResizeWindow(pRoot, 0, 0, width, height, NULL); -+} -+ - static void - update_screen_size(struct xwl_output *xwl_output, int width, int height) - { -@@ -180,6 +214,9 @@ - if (xwl_screen->root_clip_mode == ROOT_CLIP_FULL) - SetRootClip(xwl_screen->screen, ROOT_CLIP_NONE); - -+ if (!xwl_screen->rootless && xwl_screen->screen->root) -+ update_backing_pixmaps (xwl_screen, width, height); -+ - xwl_screen->width = width; - xwl_screen->height = height; - xwl_screen->screen->width = width; -diff -Naur ../xserver-1.20.5-orig/hw/xwayland/xwayland-shm.c ./hw/xwayland/xwayland-shm.c ---- ../xserver-1.20.5-orig/hw/xwayland/xwayland-shm.c 2019-07-12 15:14:26.889075146 +0300 -+++ ./hw/xwayland/xwayland-shm.c 2019-07-12 15:28:09.124589333 +0300 -@@ -40,12 +40,17 @@ - #include - #include - -+#ifdef __ANDROID__ -+#include "ashmem.h" -+#endif -+ - struct xwl_pixmap { - struct wl_buffer *buffer; - void *data; - size_t size; - }; - -+#ifndef __ANDROID__ - #ifndef HAVE_MKOSTEMP - static int - set_cloexec_or_close(int fd) -@@ -172,6 +177,37 @@ - return fd; - } - -+#else // __ANDROID__ -+ -+static int -+os_create_anonymous_file(off_t size) { -+ int fd, ret; -+ long flags; -+ -+ fd = open("/dev/ashmem", O_RDWR); -+ if (fd < 0) -+ return fd; -+ -+ ret = ioctl(fd, ASHMEM_SET_SIZE, size); -+ if (ret < 0) -+ goto err; -+ -+ flags = fcntl(fd, F_GETFD); -+ if (flags == -1) -+ goto err; -+ -+ if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1) -+ goto err; -+ -+ return fd; -+ -+err: -+ close(fd); -+ return ret; -+} -+ -+#endif // __ANDROID__ -+ - static uint32_t - shm_format_for_depth(int depth) - { -@@ -202,6 +238,7 @@ - int fd; - - if (hint == CREATE_PIXMAP_USAGE_GLYPH_PICTURE || -+ (!xwl_screen->rootless && hint != CREATE_PIXMAP_USAGE_BACKING_PIXMAP) || - (width == 0 && height == 0) || depth < 15) - return fbCreatePixmap(screen, width, height, depth, hint); - ---- ./miext/sync/meson.build.orig 2019-07-21 03:56:18.960672711 +0300 -+++ ./miext/sync/meson.build 2019-07-21 04:02:55.926796439 +0300 -@@ -1,6 +1,7 @@ - srcs_miext_sync = [ - 'misync.c', - 'misyncfd.c', -+ 'misyncshm.c', - ] - - hdrs_miext_sync = [ -@@ -10,10 +11,6 @@ - 'misyncstr.h', - ] - --if build_dri3 -- srcs_miext_sync += 'misyncshm.c' --endif -- - libxserver_miext_sync = static_library('libxserver_miext_sync', - srcs_miext_sync, - include_directories: inc,