Skip to content

Commit 436ca0b

Browse files
new package: mutter
1 parent 36ea916 commit 436ca0b

File tree

11 files changed

+2466
-0
lines changed

11 files changed

+2466
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--- a/src/wayland/meta-xwayland.c
2+
+++ b/src/wayland/meta-xwayland.c
3+
@@ -63,9 +63,9 @@
4+
#define XWAYLAND_LISTENFD "-listen"
5+
#endif
6+
7+
-#define TMP_UNIX_DIR "/tmp"
8+
-#define X11_TMP_UNIX_DIR "/tmp/.X11-unix"
9+
-#define X11_TMP_UNIX_PATH "/tmp/.X11-unix/X"
10+
+#define TMP_UNIX_DIR "@TERMUX_PREFIX@/tmp"
11+
+#define X11_TMP_UNIX_DIR "@TERMUX_PREFIX@/tmp/.X11-unix"
12+
+#define X11_TMP_UNIX_PATH "@TERMUX_PREFIX@/tmp/.X11-unix/X"
13+
14+
static int display_number_override = -1;
15+
16+
@@ -160,7 +160,7 @@
17+
char *filename;
18+
int fd;
19+
20+
- filename = g_strdup_printf ("/tmp/.X%d-lock", display);
21+
+ filename = g_strdup_printf ("@TERMUX_PREFIX@/tmp/.X%d-lock", display);
22+
23+
again:
24+
fd = open (filename, O_WRONLY | O_CLOEXEC | O_CREAT | O_EXCL, 0444);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
To fix error `dlopen failed: cannot locate symbol "meta_plugin_get_type"`
2+
3+
See https://github.com/android-ndk/ndk/issues/201
4+
5+
--- a/src/compositor/plugins/meson.build
6+
+++ b/src/compositor/plugins/meson.build
7+
@@ -12,6 +12,7 @@
8+
glib_dep,
9+
gsettings_desktop_schemas_dep,
10+
libmutter_clutter_dep,
11+
+ libmutter_dep,
12+
],
13+
install_dir: pkglibdir / 'plugins',
14+
install_rpath: pkglibdir,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--- a/src/core/meta-context-main.c
2+
+++ b/src/core/meta-context-main.c
3+
@@ -25,7 +25,7 @@
4+
#include <glib.h>
5+
#include <gio/gio.h>
6+
7+
-#ifdef HAVE_WAYLAND
8+
+#ifdef HAVE_LOGIND
9+
#include <systemd/sd-login.h>
10+
#endif
11+
12+
--- a/src/backends/native/meta-backend-native.h
13+
+++ b/src/backends/native/meta-backend-native.h
14+
@@ -24,7 +24,9 @@
15+
16+
#include "backends/meta-backend-private.h"
17+
#include "backends/meta-launcher.h"
18+
+#ifdef HAVE_LIBGUDEV
19+
#include "backends/meta-udev.h"
20+
+#endif
21+
#include "backends/native/meta-clutter-backend-native.h"
22+
#include "backends/native/meta-kms-types.h"
23+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--- a/meson.build
2+
+++ b/meson.build
3+
@@ -632,7 +632,7 @@
4+
cdata.set('HAVE_SYS_RANDOM', 1)
5+
elif cc.has_header_symbol('linux/random.h', 'getrandom')
6+
cdata.set('HAVE_LINUX_RANDOM', 1)
7+
- else
8+
+ elif host_machine.system() != 'android'
9+
error('Required function getrandom not found')
10+
endif
11+
12+
--- a/src/wayland/meta-xwayland.c
13+
+++ b/src/wayland/meta-xwayland.c
14+
@@ -36,6 +36,9 @@
15+
#include <sys/random.h>
16+
#elif defined(HAVE_LINUX_RANDOM)
17+
#include <linux/random.h>
18+
+#elif defined(__ANDROID__)
19+
+#include <syscall.h>
20+
+#define getrandom(buf,buflen,flags) syscall(SYS_getrandom,buf,buflen,flags)
21+
#endif
22+
#include <unistd.h>
23+
#include <X11/extensions/Xrandr.h>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--- a/src/backends/meta-screen-cast-stream-src.c
2+
+++ b/src/backends/meta-screen-cast-stream-src.c
3+
@@ -56,6 +56,12 @@
4+
#include "common/meta-drm-timeline.h"
5+
#endif
6+
7+
+#if defined(__ANDROID__) && __ANDROID_API__ < 30
8+
+#include <linux/memfd.h>
9+
+#include <sys/syscall.h>
10+
+#define memfd_create(name,flags) syscall(SYS_memfd_create,name,flags)
11+
+#endif
12+
+
13+
#define PRIVATE_OWNER_FROM_FIELD(TypeName, field_ptr, field_name) \
14+
(TypeName *)((guint8 *)(field_ptr) - G_PRIVATE_OFFSET (TypeName, field_name))
15+
16+
--- a/src/core/meta-anonymous-file.h
17+
+++ b/src/core/meta-anonymous-file.h
18+
@@ -22,6 +22,13 @@
19+
#include "meta/common.h"
20+
#include "core/util-private.h"
21+
22+
+#if defined(__ANDROID__) && __ANDROID_API__ < 30
23+
+#include <linux/memfd.h>
24+
+#include <sys/syscall.h>
25+
+#define memfd_create(name,flags) syscall(SYS_memfd_create,name,flags)
26+
+#define HAVE_MEMFD_CREATE
27+
+#endif
28+
+
29+
typedef struct _MetaAnonymousFile MetaAnonymousFile;
30+
31+
typedef enum _MetaAnonymousFileMapmode
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Fallback to `@TERMUX_PREFIX@/tmp` if env `XDG_RUNTIME_DIR` is not set.
2+
3+
--- a/src/core/meta-anonymous-file.c
4+
+++ b/src/core/meta-anonymous-file.c
5+
@@ -115,6 +115,12 @@
6+
char *name;
7+
8+
path = getenv ("XDG_RUNTIME_DIR");
9+
+#ifdef __TERMUX__
10+
+ if (!path)
11+
+ {
12+
+ path = "@TERMUX_PREFIX@/tmp";
13+
+ }
14+
+#endif
15+
if (!path)
16+
{
17+
errno = ENOENT;

x11-packages/mutter/build.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
TERMUX_PKG_HOMEPAGE=https://mutter.gnome.org/
2+
TERMUX_PKG_DESCRIPTION="A Wayland display server and X11 window manager and compositor library"
3+
TERMUX_PKG_LICENSE="GPL-2.0-or-later"
4+
TERMUX_PKG_MAINTAINER="@termux"
5+
TERMUX_PKG_VERSION="48.1"
6+
TERMUX_PKG_SRCURL="https://download.gnome.org/sources/mutter/${TERMUX_PKG_VERSION%%.*}/mutter-$TERMUX_PKG_VERSION.tar.xz"
7+
TERMUX_PKG_SHA256=e9970b3d81c76aed1e91f3436a82e7b14c5e32cf55949b1c9a18d0f157bacafc
8+
TERMUX_PKG_DEPENDS="atk, fribidi, gdk-pixbuf, glib, gnome-desktop4, gobject-introspection, graphene, gsettings-desktop-schemas, gtk4, harfbuzz, libandroid-shmem, libcairo, libcanberra, libcolord, libdisplay-info, libdrm, libei, libice, libpixman, libsm, libwayland, libx11, libxau, libxcb, libxcomposite, libxcursor, libxdamage, libxext, libxfixes, libxi, libxinerama, libxkbcommon, libxkbfile, libxrandr, libxtst, littlecms, opengl, pango, pipewire, startup-notification, xkeyboard-config, xwayland"
9+
TERMUX_PKG_BUILD_DEPENDS="glib-cross, libwayland-protocols"
10+
TERMUX_PKG_VERSIONED_GIR=false
11+
12+
# TODO: Add libwacom
13+
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
14+
-Dlogind=false
15+
-Dudev=false
16+
-Dnative_backend=false
17+
-Dlibwacom=false
18+
-Dintrospection=true
19+
-Dtests=disabled
20+
-Dinstalled_tests=false
21+
-Dbash_completion=false
22+
-Dprofiler=false
23+
-Dxwayland_path=$TERMUX_PREFIX/bin/Xwayland
24+
"
25+
26+
termux_step_pre_configure() {
27+
termux_setup_gir
28+
termux_setup_glib_cross_pkg_config_wrapper
29+
30+
export TERMUX_MESON_ENABLE_SOVERSION=1
31+
LDFLAGS+=" -landroid-shmem"
32+
}

0 commit comments

Comments
 (0)