diff --git a/x11-packages/libneatvnc/0001-getrandom.patch b/x11-packages/libneatvnc/0001-getrandom.patch new file mode 100644 index 0000000000..69c8cf47e5 --- /dev/null +++ b/x11-packages/libneatvnc/0001-getrandom.patch @@ -0,0 +1,14 @@ +--- a/src/crypto-nettle.c ++++ b/src/crypto-nettle.c +@@ -24,6 +24,11 @@ + // TODO: This is linux specific + #include + ++#if defined(__ANDROID__) && __ANDROID_API__ < 28 ++#include ++#define getrandom(buf,buflen,flags) syscall(SYS_getrandom,buf,buflen,flags) ++#endif ++ + #define UDIV_UP(a, b) (((a) + (b) - 1) / (b)) + + struct vec; diff --git a/x11-packages/libneatvnc/0002-aligned_alloc.patch b/x11-packages/libneatvnc/0002-aligned_alloc.patch new file mode 100644 index 0000000000..20bcbbd77f --- /dev/null +++ b/x11-packages/libneatvnc/0002-aligned_alloc.patch @@ -0,0 +1,18 @@ +--- a/src/fb.c ++++ b/src/fb.c +@@ -33,6 +33,15 @@ + #define ALIGN_UP(n, a) (UDIV_UP(n, a) * a) + #define EXPORT __attribute__((visibility("default"))) + ++#if defined(__ANDROID__) && __ANDROID_API__ < 26 ++void *aligned_alloc(size_t align, size_t size) ++{ ++ void *result = NULL; ++ posix_memalign(&result, align, size); ++ return result; ++} ++#endif ++ + EXPORT + struct nvnc_fb* nvnc_fb_new(uint16_t width, uint16_t height, + uint32_t fourcc_format, uint16_t stride) diff --git a/x11-packages/libneatvnc/build.sh b/x11-packages/libneatvnc/build.sh new file mode 100644 index 0000000000..83e1971da2 --- /dev/null +++ b/x11-packages/libneatvnc/build.sh @@ -0,0 +1,15 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/any1/neatvnc +TERMUX_PKG_DESCRIPTION="A liberally licensed VNC server library with a clean interface" +TERMUX_PKG_LICENSE="ISC" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="0.7.0" +TERMUX_PKG_SRCURL=https://github.com/any1/neatvnc/archive/refs/tags/v$TERMUX_PKG_VERSION.tar.gz +TERMUX_PKG_SHA256=38c015e746ed42483107a1b711552cc3fb13a4d71993948d27b19b559746fcf7 +TERMUX_PKG_DEPENDS="libaml, libdrm, libgmp, libgnutls, libjpeg-turbo, libnettle, libpixman, zlib" +TERMUX_PKG_AUTO_UPDATE=true +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Djpeg=enabled +-Dtls=enabled +-Dnettle=enabled +-Dgbm=disabled +"