aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Weiss <luca@z3ntu.xyz>2020-08-03 09:37:02 +0200
committerLeo <thinkabit.ukim@gmail.com>2020-08-03 11:37:50 +0000
commita0683b311da7797d8293ff2a2848dc11f96f2197 (patch)
tree4a3457b8d44e28dd99376784f4476a9a6a526378
parent06675825406626b3a13759aecb7173707f01df03 (diff)
downloadaports-a0683b311da7797d8293ff2a2848dc11f96f2197.tar.gz
aports-a0683b311da7797d8293ff2a2848dc11f96f2197.tar.bz2
aports-a0683b311da7797d8293ff2a2848dc11f96f2197.tar.xz
community/x11vnc: fix build on 32-bit arches
-rw-r--r--community/x11vnc/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch108
-rw-r--r--community/x11vnc/APKBUILD8
2 files changed, 113 insertions, 3 deletions
diff --git a/community/x11vnc/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch b/community/x11vnc/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch
new file mode 100644
index 0000000000..6c7a3704f0
--- /dev/null
+++ b/community/x11vnc/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch
@@ -0,0 +1,108 @@
+From daecf59cc8b294265666482a4766aaa3148c308b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 30 Nov 2019 11:43:32 -0800
+Subject: [PATCH] Fix build on 32bit arches with 64bit time_t
+
+time element is deprecated on new input_event structure in kernel's
+input.h [1]
+
+[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f
+---
+ src/uinput.c | 25 +++++++++++++++++++++----
+ 1 file changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/src/uinput.c b/src/uinput.c
+index 28fbad3..d71bcde 100644
+--- a/src/uinput.c
++++ b/src/uinput.c
+@@ -54,6 +54,11 @@ so, delete this exception statement from your version.
+ #include <linux/input.h>
+ #include <linux/uinput.h>
+
++#ifndef input_event_sec
++#define input_event_sec time.tv_sec
++#define input_event_usec time.tv_usec
++#endif
++
+ #if !defined(EV_SYN) || !defined(SYN_REPORT)
+ #undef UINPUT_OK
+ #endif
+@@ -710,6 +715,7 @@ void parse_uinput_str(char *in) {
+ static void ptr_move(int dx, int dy) {
+ #ifdef UINPUT_OK
+ struct input_event ev;
++ struct timeval tval;
+ int d = direct_rel_fd < 0 ? fd : direct_rel_fd;
+
+ if (injectable && strchr(injectable, 'M') == NULL) {
+@@ -720,7 +726,9 @@ static void ptr_move(int dx, int dy) {
+
+ if (db) fprintf(stderr, "ptr_move(%d, %d) fd=%d\n", dx, dy, d);
+
+- gettimeofday(&ev.time, NULL);
++ gettimeofday(&tval, NULL);
++ ev.input_event_sec = tval.tv_sec;
++ ev.input_event_usec = tval.tv_usec;
+ ev.type = EV_REL;
+ ev.code = REL_Y;
+ ev.value = dy;
+@@ -755,6 +763,7 @@ static void apply_tslib(int *x, int *y) {
+ static void ptr_abs(int x, int y, int p) {
+ #ifdef UINPUT_OK
+ struct input_event ev;
++ struct timeval tval;
+ int x0, y0;
+ int d = direct_abs_fd < 0 ? fd : direct_abs_fd;
+
+@@ -773,7 +782,9 @@ static void ptr_abs(int x, int y, int p) {
+
+ if (db) fprintf(stderr, "ptr_abs(%d, %d => %d %d, p=%d) fd=%d\n", x0, y0, x, y, p, d);
+
+- gettimeofday(&ev.time, NULL);
++ gettimeofday(&tval, NULL);
++ ev.input_event_sec = tval.tv_sec;
++ ev.input_event_usec = tval.tv_usec;
+ ev.type = EV_ABS;
+ ev.code = ABS_Y;
+ ev.value = y;
+@@ -950,6 +961,7 @@ if (0) {usleep(100*1000) ;}
+ static void button_click(int down, int btn) {
+ #ifdef UINPUT_OK
+ struct input_event ev;
++ struct timeval tval;
+ int d = direct_btn_fd < 0 ? fd : direct_btn_fd;
+
+ if (injectable && strchr(injectable, 'B') == NULL) {
+@@ -959,7 +971,9 @@ static void button_click(int down, int btn) {
+ if (db) fprintf(stderr, "button_click: btn %d %s fd=%d\n", btn, down ? "down" : "up", d);
+
+ memset(&ev, 0, sizeof(ev));
+- gettimeofday(&ev.time, NULL);
++ gettimeofday(&tval, NULL);
++ ev.input_event_sec = tval.tv_sec;
++ ev.input_event_usec = tval.tv_usec;
+ ev.type = EV_KEY;
+ ev.value = down;
+
+@@ -1230,6 +1244,7 @@ void uinput_pointer_command(int mask, int x, int y, rfbClientPtr client) {
+ void uinput_key_command(int down, int keysym, rfbClientPtr client) {
+ #ifdef UINPUT_OK
+ struct input_event ev;
++ struct timeval tval;
+ int scancode;
+ allowed_input_t input;
+ int d = direct_key_fd < 0 ? fd : direct_key_fd;
+@@ -1253,7 +1268,9 @@ void uinput_key_command(int down, int keysym, rfbClientPtr client) {
+ if (db) fprintf(stderr, "uinput_key_command: %d -> %d %s fd=%d\n", keysym, scancode, down ? "down" : "up", d);
+
+ memset(&ev, 0, sizeof(ev));
+- gettimeofday(&ev.time, NULL);
++ gettimeofday(&tval, NULL);
++ ev.input_event_sec = tval.tv_sec;
++ ev.input_event_usec = tval.tv_usec;
+ ev.type = EV_KEY;
+ ev.code = (unsigned char) scancode;
+ ev.value = down;
+--
+2.27.0
+
diff --git a/community/x11vnc/APKBUILD b/community/x11vnc/APKBUILD
index 365911685f..c3d5039698 100644
--- a/community/x11vnc/APKBUILD
+++ b/community/x11vnc/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Tuan M. Hoang <tmhoang@flatglobe.org>
pkgname=x11vnc
pkgver=0.9.16
-pkgrel=0
+pkgrel=1
pkgdesc="VNC server for real X displays"
url="http://www.karlrunge.com/x11vnc/"
arch="all"
@@ -10,7 +10,8 @@ license="GPL-2.0-or-later"
makedepends="openssl-dev libjpeg-turbo-dev avahi-dev libvncserver-dev
automake autoconf"
subpackages="$pkgname-doc"
-source="x11vnc-$pkgver.tar.gz::https://github.com/LibVNC/x11vnc/archive/$pkgver.tar.gz"
+source="x11vnc-$pkgver.tar.gz::https://github.com/LibVNC/x11vnc/archive/$pkgver.tar.gz
+ 0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch"
prepare() {
default_prepare
@@ -37,4 +38,5 @@ check() {
make check
}
-sha512sums="69f65ee312f8dede6051b401304987502a213c6c28c7f41e855734f11de1fae14d5d493dc9c28b2e4b7c0be55f8dbd3b35dd2610aae910183772c3e626736fec x11vnc-0.9.16.tar.gz"
+sha512sums="69f65ee312f8dede6051b401304987502a213c6c28c7f41e855734f11de1fae14d5d493dc9c28b2e4b7c0be55f8dbd3b35dd2610aae910183772c3e626736fec x11vnc-0.9.16.tar.gz
+7752f125b083ec2d8c778dcc460853d29cf62cd354dc454aa132d3eb1671ad4592923cca5360884cf86f25d989fa04db04120d5d70782d65164821d463107e2e 0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch"