new package: tigervnc-viewer

This commit is contained in:
Tee KOBAYASHI 2022-11-14 03:09:47 +09:00 committed by xtkoba
parent 9cc5781a71
commit b228bf6132
5 changed files with 147 additions and 0 deletions

View File

@ -0,0 +1,18 @@
TERMUX_PKG_HOMEPAGE=https://tigervnc.org/
TERMUX_PKG_DESCRIPTION="A viewer (client) for Virtual Network Computing"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.12.0
TERMUX_PKG_SRCURL=https://github.com/TigerVNC/tigervnc/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=9ff3f3948f2a4e8cc06ee598ee4b1096beb62094c13e0b1462bff78587bed789
TERMUX_PKG_DEPENDS="fltk, libandroid-shmem, libc++, libgnutls, libjpeg-turbo, libpixman, libx11, libxext, libxi, libxrandr, libxrender, zlib"
TERMUX_PKG_CONFLICTS="tigervnc (<< 1.9.0-4)"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DBUILD_SERVER=OFF
-DENABLE_NLS=OFF
-DFLTK_MATH_LIBRARY=
"
termux_step_pre_configure() {
LDFLAGS+=" -landroid-shmem"
}

View File

@ -0,0 +1,11 @@
--- a/common/os/CMakeLists.txt
+++ b/common/os/CMakeLists.txt
@@ -6,7 +6,7 @@
w32tiger.c
os.cxx)
-if(UNIX)
+if(UNIX AND NOT ANDROID)
target_link_libraries(os pthread)
endif()

View File

@ -0,0 +1,45 @@
--- a/common/os/Thread.cxx
+++ b/common/os/Thread.cxx
@@ -29,6 +29,14 @@
#include <os/Mutex.h>
#include <os/Thread.h>
+#ifdef __ANDROID__
+#include <string.h>
+static void threadSignalHandler(int signum)
+{
+ pthread_exit(0);
+}
+#endif
+
using namespace os;
Thread::Thread() : running(false), threadId(NULL)
@@ -48,7 +56,11 @@
delete (HANDLE*)threadId;
#else
if (isRunning())
+#ifdef __ANDROID__
+ pthread_kill(*(pthread_t*)threadId, SIGUSR2);
+#else
pthread_cancel(*(pthread_t*)threadId);
+#endif
delete (pthread_t*)threadId;
#endif
@@ -148,6 +160,15 @@
void* Thread::startRoutine(void* data)
#endif
{
+#ifdef __ANDROID__
+ struct sigaction actions;
+ memset(&actions, 0, sizeof(actions));
+ sigemptyset(&actions.sa_mask);
+ actions.sa_flags = 0;
+ actions.sa_handler = threadSignalHandler;
+ sigaction(SIGUSR2, &actions, NULL);
+#endif
+
Thread *self;
self = (Thread*)data;

View File

@ -0,0 +1,14 @@
--- a/common/rfb/util.h
+++ b/common/rfb/util.h
@@ -31,7 +31,11 @@
#include <limits.h>
#include <string.h>
+#ifdef __ANDROID__
+#include <sys/time.h>
+#else
struct timeval;
+#endif
#ifdef __GNUC__
# define __printf_attr(a, b) __attribute__((__format__ (__printf__, a, b)))

View File

@ -0,0 +1,59 @@
Borrowed from https://github.com/gentoo/gentoo/blob/12dbbe21e6bc8b67510f80b376860e6352c3a7ea/net-misc/tigervnc/files/tigervnc-1.12.0-disable-server-and-pam.patch
See https://bugs.gentoo.org/852830
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -234,6 +234,7 @@
add_subdirectory(java)
endif()
+option(BUILD_SERVER "Build TigerVNC server" ON)
option(BUILD_VIEWER "Build TigerVNC viewer" ON)
if(BUILD_VIEWER)
# Check for FLTK
@@ -276,7 +277,7 @@
endif()
# Check for PAM library
-if(UNIX AND NOT APPLE)
+if(BUILD_SERVER AND UNIX AND NOT APPLE)
check_include_files(security/pam_appl.h HAVE_PAM_H)
set(CMAKE_REQUIRED_LIBRARIES -lpam)
check_function_exists(pam_start HAVE_PAM_START)
@@ -315,9 +316,6 @@
add_subdirectory(media)
endif()
-add_subdirectory(tests)
-
-
if(BUILD_VIEWER)
add_subdirectory(release)
endif()
--- a/common/rfb/CMakeLists.txt
+++ b/common/rfb/CMakeLists.txt
@@ -75,7 +75,7 @@
set(RFB_LIBRARIES ${JPEG_LIBRARIES} ${PIXMAN_LIBRARY} os rdr)
-if(UNIX AND NOT APPLE)
+if(BUILD_SERVER AND UNIX AND NOT APPLE)
set(RFB_SOURCES ${RFB_SOURCES} UnixPasswordValidator.cxx
UnixPasswordValidator.h pam.c pam.h)
set(RFB_LIBRARIES ${RFB_LIBRARIES} ${PAM_LIBS})
--- a/unix/CMakeLists.txt
+++ b/unix/CMakeLists.txt
@@ -1,6 +1,8 @@
add_subdirectory(tx)
add_subdirectory(common)
-add_subdirectory(vncconfig)
-add_subdirectory(vncpasswd)
-add_subdirectory(vncserver)
-add_subdirectory(x0vncserver)
+if(BUILD_SERVER)
+ add_subdirectory(vncconfig)
+ add_subdirectory(vncpasswd)
+ add_subdirectory(vncserver)
+ add_subdirectory(x0vncserver)
+endif()