[packages/tigervnc] - up to 1.7.0; patches updated from FC
arekm
arekm at pld-linux.org
Sun Nov 20 12:06:40 CET 2016
commit 7d6a554b040c49cacc7ffdb09607686d54b86e05
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sun Nov 20 12:06:31 2016 +0100
- up to 1.7.0; patches updated from FC
tigervnc-as-needed.patch | 16 -
tigervnc-cookie.patch | 37 ---
tigervnc-libvnc-os.patch | 20 ++
tigervnc-rh692048.patch | 44 ---
tigervnc-utilize-system-crypto-policies.patch | 13 +
tigervnc-xserver-1.18.patch | 27 --
tigervnc-xserver.patch | 422 ++++++++++++++++++++++++++
tigervnc.spec | 82 +++--
xserver.patch | 63 ++--
9 files changed, 532 insertions(+), 192 deletions(-)
---
diff --git a/tigervnc.spec b/tigervnc.spec
index c2b501f..af3be8d 100644
--- a/tigervnc.spec
+++ b/tigervnc.spec
@@ -3,24 +3,23 @@
Summary: A TigerVNC remote display system
Summary(pl.UTF-8): System zdalnego dostępu TigerVNC
Name: tigervnc
-Version: 1.6.0
-Release: 6
+Version: 1.7.0
+Release: 1
License: GPL v2
Group: X11/Applications/Networking
Source0: https://github.com/TigerVNC/tigervnc/archive/v%{version}.tar.gz?/%{name}-%{version}.tar.gz
-# Source0-md5: 78b736445781d86c48e942465a391ccc
+# Source0-md5: 0930edf4f339283d856ce7027db40308
Source1: %{name}.desktop
Source2: vncserver.init
Source3: vncserver.sysconfig
Source4: vncserver.target
Source5: vncserver-service-generator
-Patch0: %{name}-cookie.patch
-Patch3: %{name}-as-needed.patch
-Patch5: %{name}-rh692048.patch
-Patch8: tigervnc-xstartup.patch
-Patch9: xserver.patch
-Patch10: tigervnc-getmaster.patch
-Patch11: tigervnc-xserver-1.18.patch
+Patch0: %{name}-xserver.patch
+Patch1: %{name}-libvnc-os.patch
+Patch2: %{name}-getmaster.patch
+Patch3: %{name}-utilize-system-crypto-policies.patch
+Patch4: %{name}-xstartup.patch
+Patch100: xserver.patch
URL: http://www.tigervnc.com/
BuildRequires: ImageMagick
BuildRequires: ImageMagick-coder-png
@@ -113,10 +112,10 @@ performance and remote display functionality. Originally this software
was based on the (never released) VNC 4 branch of TightVNC.
%description -l pl.UTF-8
-TigerVNC to zestaw serwerów i klientów VNC, które koncentrują się
-na wydajności i funkcjonalności zdalnego wyświetlania. Pierwotnie
-oprogramowanie oparte było na (nigdy nie wydanej)
-gałęzi VNC 4 TightVNC.
+TigerVNC to zestaw serwerów i klientów VNC, które koncentrują się na
+wydajności i funkcjonalności zdalnego wyświetlania. Pierwotnie
+oprogramowanie oparte było na (nigdy nie wydanej) gałęzi VNC 4
+TightVNC.
%package server
Summary: VNC X server - TigerVNC version
@@ -128,9 +127,9 @@ Requires: xorg-app-rgb
# for vncpasswd tool
Requires: %{name}-utils = %{version}-%{release}
# for mcookie
-Requires: util-linux
Requires: libjpeg-turbo
Requires: systemd-units >= 38
+Requires: util-linux
Requires: xkeyboard-config
Requires: xorg-app-xauth
Requires: xorg-app-xkbcomp
@@ -157,37 +156,36 @@ vncpasswd generates password file (both on server and viewer side).
%description utils -l pl.UTF-8
Ten pakiet zawiera dodatkowe narzędzia do tightvnc: vncconfig i
vncpasswd. vncconfig służy do konfigurowania i kontroli działającej
-instancji Xvnc lub innego serwera X z rozszerzeniem VNC.
-vncpasswd służy to tworzenia pliku z hasłem (zarówno po
-stronie serwera, jak i przeglądarki).
+instancji Xvnc lub innego serwera X z rozszerzeniem VNC. vncpasswd
+służy to tworzenia pliku z hasłem (zarówno po stronie serwera, jak i
+przeglądarki).
%package -n xorg-xserver-libvnc
Summary: TigerVNC module for X.org server
Summary(pl.UTF-8): Moduł TigerVNC dla servera X.org
Group: X11/Servers
-%requires_eq_to xorg-xserver-server xorg-xserver-server-source
+%requires_eq_to xorg-xserver-server xorg-xserver-server-source
Provides: xorg-xserver-module(vnc)
%description -n xorg-xserver-libvnc
-This package contains libvnc.so module for X.org server,
-allowing others to access the desktop on your machine.
+This package contains libvnc.so module for X.org server, allowing
+others to access the desktop on your machine.
%description -n xorg-xserver-libvnc -l pl.UTF-8
-Ten pakiet zawiera moduł libvnc.so dla serwera X.org,
-pozwalający na zdalny dostęp do pulpitu.
+Ten pakiet zawiera moduł libvnc.so dla serwera X.org, pozwalający na
+zdalny dostęp do pulpitu.
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
+%patch2 -p1
%patch3 -p1
-%patch5 -p1
-%patch8 -p1
-%patch10 -p1
+%patch4 -p1
cp -a %{_usrsrc}/xorg-xserver-server-%{_xserverver}/* unix/xserver
cd unix/xserver
-%patch9 -p1
-%patch11 -p3
+%patch100 -p1
%build
%cmake .
@@ -257,22 +255,22 @@ cd unix/xserver/hw/vnc
DESTDIR=$RPM_BUILD_ROOT
cd -
-install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
-install media/icons/tigervnc_16.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/16x16/apps/tigervnc.png
-install media/icons/tigervnc_22.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/22x22/apps/tigervnc.png
-install media/icons/tigervnc_24.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/24x24/apps/tigervnc.png
-install media/icons/tigervnc_32.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/32x32/apps/tigervnc.png
-install media/icons/tigervnc_48.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/48x48/apps/tigervnc.png
-install media/icons/tigervnc.svg $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps/tigervnc.svg
+cp -p media/icons/tigervnc_16.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/16x16/apps/tigervnc.png
+cp -p media/icons/tigervnc_22.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/22x22/apps/tigervnc.png
+cp -p media/icons/tigervnc_24.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/24x24/apps/tigervnc.png
+cp -p media/icons/tigervnc_32.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/32x32/apps/tigervnc.png
+cp -p media/icons/tigervnc_48.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/48x48/apps/tigervnc.png
+cp -p media/icons/tigervnc.svg $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps/tigervnc.svg
install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/vncserver
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/vncserver
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/vncserver
+cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/vncserver
-install -d $RPM_BUILD_ROOT{%{systemdunitdir},/lib/systemd/system-generators}
+install -d $RPM_BUILD_ROOT{%{systemdunitdir},%{systemdunitdir}-generators}
install -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/vncserver.target
-install -p %{SOURCE5} $RPM_BUILD_ROOT/lib/systemd/system-generators/vncserver-service-generator
+install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}-generators/vncserver-service-generator
ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/vncserver.service
%{__rm} -r $RPM_BUILD_ROOT%{_docdir}
@@ -283,11 +281,11 @@ ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/vncserver.service
rm -rf $RPM_BUILD_ROOT
%post
-[ ! -x /usr/bin/update-desktop-database ] || %update_desktop_database_post
+[ ! -x %{_bindir}/update-desktop-database ] || %update_desktop_database_post
%update_icon_cache hicolor
%postun
-[ ! -x /usr/bin/update-desktop-database ] || %update_desktop_database_postun
+[ ! -x %{_bindir}/update-desktop-database ] || %update_desktop_database_postun
%update_icon_cache hicolor
%post server
@@ -329,7 +327,7 @@ fi
%attr(755,root,root) %{_bindir}/x0vncserver
%attr(754,root,root) /etc/rc.d/init.d/vncserver
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/vncserver
-%attr(755,root,root) /lib/systemd/system-generators/vncserver-service-generator
+%attr(755,root,root) %{systemdunitdir}-generators/vncserver-service-generator
%{systemdunitdir}/vncserver.target
%{systemdunitdir}/vncserver.service
%{_mandir}/man1/Xvnc.1*
diff --git a/tigervnc-as-needed.patch b/tigervnc-as-needed.patch
deleted file mode 100644
index 9114eea..0000000
--- a/tigervnc-as-needed.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- tigervnc-1.0.90/unix/xserver/hw/vnc/Makefile.am~ 2011-04-20 13:46:16.993047050 +0200
-+++ tigervnc-1.0.90/unix/xserver/hw/vnc/Makefile.am 2011-04-20 14:03:35.942724608 +0200
-@@ -1,11 +1,12 @@
- TIGERVNC_SRCDIR=${top_srcdir}/../..
- LIB_DIR=${top_builddir}/../../common
-
-+OS_LIB=$(LIB_DIR)/os/libos.a
- RFB_LIB=$(LIB_DIR)/rfb/librfb.la
- RDR_LIB=$(LIB_DIR)/rdr/librdr.la
- NETWORK_LIB=$(LIB_DIR)/network/libnetwork.la
- XREGION_LIB=$(LIB_DIR)/Xregion/libXregion.la
--COMMON_LIBS=$(NETWORK_LIB) $(RFB_LIB) $(RDR_LIB) $(XREGION_LIB)
-+COMMON_LIBS=$(NETWORK_LIB) $(OS_LIB) $(RFB_LIB) $(RDR_LIB) $(XREGION_LIB)
-
- noinst_LTLIBRARIES = libvnccommon.la
-
diff --git a/tigervnc-cookie.patch b/tigervnc-cookie.patch
deleted file mode 100644
index c066a5f..0000000
--- a/tigervnc-cookie.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-diff -up tigervnc-1.0.90-20091221svn3929/unix/vncserver.cookie tigervnc-1.0.90-20091221svn3929/unix/vncserver
---- tigervnc-1.0.90-20091221svn3929/unix/vncserver.cookie 2009-11-12 11:39:54.000000000 +0100
-+++ tigervnc-1.0.90-20091221svn3929/unix/vncserver 2009-12-21 16:15:01.907799091 +0100
-@@ -189,27 +189,12 @@ $vncPort = 5900 + $displayNumber;
- $desktopLog = "$vncUserDir/$host:$displayNumber.log";
- unlink($desktopLog);
-
--# Make an X server cookie - use /dev/urandom on systems that have it,
--# otherwise use perl's random number generator, seeded with the sum
--# of the current time, our PID and part of the encrypted form of the password.
--
--my $cookie = "";
--if (open(URANDOM, '<', '/dev/urandom')) {
-- my $randata;
-- if (sysread(URANDOM, $randata, 16) == 16) {
-- $cookie = unpack 'h*', $randata;
-- }
-- close(URANDOM);
--}
--if ($cookie eq "") {
-- srand(time+$$+unpack("L",`cat $vncUserDir/passwd`));
-- for (1..16) {
-- $cookie .= sprintf("%02x", int(rand(256)) % 256);
-- }
--}
--
--system("xauth -f $xauthorityFile add $host:$displayNumber . $cookie");
--system("xauth -f $xauthorityFile add $host/unix:$displayNumber . $cookie");
-+# Make an X server cookie - use mcookie
-+$cookie = `/usr/bin/mcookie`;
-+open (XAUTH, "|xauth -f $xauthorityFile source -");
-+print XAUTH "add $host:$displayNumber . $cookie\n";
-+print XAUTH "add $host/unix:$displayNumber . $cookie\n";
-+close XAUTH;
-
- if ($opt{'-name'}) {
- $desktopName = $opt{'-name'};
diff --git a/tigervnc-libvnc-os.patch b/tigervnc-libvnc-os.patch
new file mode 100644
index 0000000..0c66755
--- /dev/null
+++ b/tigervnc-libvnc-os.patch
@@ -0,0 +1,20 @@
+diff --git a/unix/xserver/hw/vnc/Makefile.am b/unix/xserver/hw/vnc/Makefile.am
+index d7ab259..fb477c5 100644
+--- a/unix/xserver/hw/vnc/Makefile.am
++++ b/unix/xserver/hw/vnc/Makefile.am
+@@ -5,6 +5,7 @@ RFB_LIB=$(LIB_DIR)/rfb/librfb.la
+ RDR_LIB=$(LIB_DIR)/rdr/librdr.la
+ NETWORK_LIB=$(LIB_DIR)/network/libnetwork.la
+ XREGION_LIB=$(LIB_DIR)/Xregion/libXregion.la
++OS_LIB=$(LIB_DIR)/os/libos.la
+ COMMON_LIBS=$(NETWORK_LIB) $(RFB_LIB) $(RDR_LIB) $(XREGION_LIB)
+
+ noinst_LTLIBRARIES = libvnccommon.la
+@@ -64,6 +65,6 @@ libvnc_la_CPPFLAGS = $(XVNC_CPPFLAGS) -I$(TIGERVNC_SRCDIR)/common -UHAVE_CONFIG_
+
+ libvnc_la_LDFLAGS = -module -avoid-version -Wl,-z,now
+
+-libvnc_la_LIBADD = libvnccommon.la $(COMMON_LIBS)
++libvnc_la_LIBADD = libvnccommon.la $(COMMON_LIBS) $(OS_LIB)
+
+ EXTRA_DIST = Xvnc.man
diff --git a/tigervnc-rh692048.patch b/tigervnc-rh692048.patch
deleted file mode 100644
index 310cb1b..0000000
--- a/tigervnc-rh692048.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff -up tigervnc-1.4.2/common/rfb/SecurityClient.cxx.rh692048 tigervnc-1.4.2/common/rfb/SecurityClient.cxx
---- tigervnc-1.4.2/common/rfb/SecurityClient.cxx.rh692048 2015-02-12 18:32:50.168861186 +0000
-+++ tigervnc-1.4.2/common/rfb/SecurityClient.cxx 2015-02-12 18:33:13.168003696 +0000
-@@ -49,7 +49,7 @@ StringParameter SecurityClient::secTypes
- #endif
- ")",
- #ifdef HAVE_GNUTLS
-- "X509Plain,TLSPlain,X509Vnc,TLSVnc,X509None,TLSNone,VncAuth,None",
-+ "VeNCrypt,X509Plain,TLSPlain,X509Vnc,TLSVnc,X509None,TLSNone,VncAuth,None",
- #else
- "VncAuth,None",
- #endif
-diff -up tigervnc-1.4.2/common/rfb/Security.cxx.rh692048 tigervnc-1.4.2/common/rfb/Security.cxx
---- tigervnc-1.4.2/common/rfb/Security.cxx.rh692048 2015-01-23 23:37:23.000000000 +0000
-+++ tigervnc-1.4.2/common/rfb/Security.cxx 2015-02-12 18:32:50.168861186 +0000
-@@ -68,7 +68,6 @@ const std::list<rdr::U8> Security::GetEn
- list<rdr::U8> result;
- list<U32>::iterator i;
-
-- result.push_back(secTypeVeNCrypt);
- for (i = enabledSecTypes.begin(); i != enabledSecTypes.end(); i++)
- if (*i < 0x100)
- result.push_back(*i);
-@@ -106,8 +105,6 @@ bool Security::IsSupported(U32 secType)
- for (i = enabledSecTypes.begin(); i != enabledSecTypes.end(); i++)
- if (*i == secType)
- return true;
-- if (secType == secTypeVeNCrypt)
-- return true;
-
- return false;
- }
-diff -up tigervnc-1.4.2/common/rfb/SecurityServer.cxx.rh692048 tigervnc-1.4.2/common/rfb/SecurityServer.cxx
---- tigervnc-1.4.2/common/rfb/SecurityServer.cxx.rh692048 2015-02-12 18:32:50.168861186 +0000
-+++ tigervnc-1.4.2/common/rfb/SecurityServer.cxx 2015-02-12 18:33:24.977076868 +0000
-@@ -43,7 +43,7 @@ StringParameter SecurityServer::secTypes
- #endif
- ")",
- #ifdef HAVE_GNUTLS
-- "TLSVnc,VncAuth",
-+ "VncAuth",
- #else
- "VncAuth",
- #endif
diff --git a/tigervnc-utilize-system-crypto-policies.patch b/tigervnc-utilize-system-crypto-policies.patch
new file mode 100644
index 0000000..dbf0dab
--- /dev/null
+++ b/tigervnc-utilize-system-crypto-policies.patch
@@ -0,0 +1,13 @@
+diff --git a/common/rfb/Security.cxx b/common/rfb/Security.cxx
+index e623ab5..4987b29 100644
+--- a/common/rfb/Security.cxx
++++ b/common/rfb/Security.cxx
+@@ -52,7 +52,7 @@ static LogWriter vlog("Security");
+ #ifdef HAVE_GNUTLS
+ StringParameter Security::GnuTLSPriority("GnuTLSPriority",
+ "GnuTLS priority string that controls the TLS session’s handshake algorithms",
+- "NORMAL");
++ "@SYSTEM");
+ #endif
+
+ Security::Security()
diff --git a/tigervnc-xserver-1.18.patch b/tigervnc-xserver-1.18.patch
deleted file mode 100644
index 06e4db6..0000000
--- a/tigervnc-xserver-1.18.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff -Nur tigervnc-49d0629dd87c0eb695d72dec7481e9169f55ae9e.orig/unix/xserver/hw/vnc/xorg-version.h tigervnc-49d0629dd87c0eb695d72dec7481e9169f55ae9e/unix/xserver/hw/vnc/xorg-version.h
---- tigervnc-49d0629dd87c0eb695d72dec7481e9169f55ae9e.orig/unix/xserver/hw/vnc/xorg-version.h 2015-03-01 12:58:35.000000000 -0700
-+++ tigervnc-49d0629dd87c0eb695d72dec7481e9169f55ae9e/unix/xserver/hw/vnc/xorg-version.h 2015-08-04 09:46:14.796336147 -0600
-@@ -48,8 +48,10 @@
- #define XORG 116
- #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (17 * 100000) + (99 * 1000))
- #define XORG 117
-+#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (18 * 100000) + (99 * 1000))
-+#define XORG 118
- #else
--#error "X.Org newer than 1.17 is not supported"
-+#error "X.Org newer than 1.18 is not supported"
- #endif
-
- #endif
-diff --git a/unix/xserver/hw/vnc/Input.c b/unix/xserver/hw/vnc/Input.c
---- a/unix/xserver/hw/vnc/Input.c
-+++ b/unix/xserver/hw/vnc/Input.c
-@@ -301,7 +301,7 @@ static inline void pressKey(DeviceIntPtr dev, int kc, Bool down, const char *msg
- n = GetKeyboardEvents(eventq, dev, action, kc);
- enqueueEvents(dev, n);
- #else
-- QueueKeyboardEvents(dev, action, kc, NULL);
-+ QueueKeyboardEvents(dev, action, kc);
- #endif
- }
-
diff --git a/tigervnc-xserver.patch b/tigervnc-xserver.patch
new file mode 100644
index 0000000..067960b
--- /dev/null
+++ b/tigervnc-xserver.patch
@@ -0,0 +1,422 @@
+diff -up tigervnc-1.7.0/unix/xserver/hw/vnc/vncBlockHandler.c.xserver119 tigervnc-1.7.0/unix/xserver/hw/vnc/vncBlockHandler.c
+--- tigervnc-1.7.0/unix/xserver/hw/vnc/vncBlockHandler.c.xserver119 2016-09-08 12:31:18.000000000 +0200
++++ tigervnc-1.7.0/unix/xserver/hw/vnc/vncBlockHandler.c 2016-10-04 17:17:35.618889747 +0200
+@@ -30,6 +30,23 @@
+
+ #include "vncExtInit.h"
+ #include "vncBlockHandler.h"
++#include "xorg-version.h"
++
++#if XORG >= 119
++
++static void vncBlockHandler(void* data, void* timeout)
++{
++ vncCallBlockHandlers(timeout);
++}
++
++void vncRegisterBlockHandlers(void)
++{
++ if (!RegisterBlockAndWakeupHandlers(vncBlockHandler,
++ (ServerWakeupHandlerProcPtr)NoopDDA, 0))
++ FatalError("RegisterBlockAndWakeupHandlers() failed\n");
++}
++
++#else
+
+ static void vncBlockHandler(void * data, OSTimePtr t, void * readmask);
+ static void vncWakeupHandler(void * data, int nfds, void * readmask);
+@@ -144,3 +161,5 @@ static void vncWriteWakeupHandlerFallbac
+
+ vncWriteWakeupHandler(ret, &fallbackFds);
+ }
++
++#endif
+diff -up tigervnc-1.7.0/unix/xserver/hw/vnc/vncExtInit.cc.xserver119 tigervnc-1.7.0/unix/xserver/hw/vnc/vncExtInit.cc
+--- tigervnc-1.7.0/unix/xserver/hw/vnc/vncExtInit.cc.xserver119 2016-09-08 12:31:18.000000000 +0200
++++ tigervnc-1.7.0/unix/xserver/hw/vnc/vncExtInit.cc 2016-10-04 17:17:35.618889747 +0200
+@@ -241,6 +241,17 @@ int vncExtensionIsActive(int scrIdx)
+ return (desktop[scrIdx] != NULL);
+ }
+
++#if XORG >= 119
++
++void vncCallBlockHandlers(int* timeout)
++{
++ for (int scr = 0; scr < vncGetScreenCount(); scr++)
++ if (desktop[scr])
++ desktop[scr]->blockHandler(timeout);
++}
++
++#else
++
+ void vncCallReadBlockHandlers(fd_set * fds, struct timeval ** timeout)
+ {
+ for (int scr = 0; scr < vncGetScreenCount(); scr++)
+@@ -269,6 +280,8 @@ void vncCallWriteWakeupHandlers(fd_set *
+ desktop[scr]->writeWakeupHandler(fds, nfds);
+ }
+
++#endif
++
+ int vncGetAvoidShiftNumLock(void)
+ {
+ return (bool)avoidShiftNumLock;
+diff -up tigervnc-1.7.0/unix/xserver/hw/vnc/vncExtInit.h.xserver119 tigervnc-1.7.0/unix/xserver/hw/vnc/vncExtInit.h
+--- tigervnc-1.7.0/unix/xserver/hw/vnc/vncExtInit.h.xserver119 2016-09-08 12:31:18.000000000 +0200
++++ tigervnc-1.7.0/unix/xserver/hw/vnc/vncExtInit.h 2016-10-04 17:17:35.618889747 +0200
+@@ -22,6 +22,7 @@
+ #include <stdint.h>
+ #include <stddef.h>
+ #include <sys/select.h>
++#include "xorg-version.h"
+
+ // Only from C++
+ #ifdef __cplusplus
+@@ -52,10 +53,14 @@ extern int vncInetdSock;
+ void vncExtensionInit(void);
+ int vncExtensionIsActive(int scrIdx);
+
++#if XORG >= 119
++void vncCallBlockHandlers(int* timeout);
++#else
+ void vncCallReadBlockHandlers(fd_set * fds, struct timeval ** timeout);
+ void vncCallReadWakeupHandlers(fd_set * fds, int nfds);
+ void vncCallWriteBlockHandlers(fd_set * fds, struct timeval ** timeout);
+ void vncCallWriteWakeupHandlers(fd_set * fds, int nfds);
++#endif
+
+ int vncGetAvoidShiftNumLock(void);
+
+diff -up tigervnc-1.7.0/unix/xserver/hw/vnc/vncHooks.c.xserver119 tigervnc-1.7.0/unix/xserver/hw/vnc/vncHooks.c
+--- tigervnc-1.7.0/unix/xserver/hw/vnc/vncHooks.c.xserver119 2016-09-08 12:31:18.000000000 +0200
++++ tigervnc-1.7.0/unix/xserver/hw/vnc/vncHooks.c 2016-10-04 17:17:35.618889747 +0200
+@@ -128,9 +128,11 @@ static Bool vncHooksDisplayCursor(Device
+ #if XORG <= 112
+ static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout,
+ pointer pReadmask);
+-#else
++#elif XORG <= 118
+ static void vncHooksBlockHandler(ScreenPtr pScreen, void * pTimeout,
+ void * pReadmask);
++#else
++static void vncHooksBlockHandler(ScreenPtr pScreen, void * pTimeout);
+ #endif
+ #ifdef RENDER
+ static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
+@@ -716,9 +718,11 @@ out:
+ #if XORG <= 112
+ static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout,
+ pointer pReadmask)
+-#else
++#elif XORG <= 118
+ static void vncHooksBlockHandler(ScreenPtr pScreen_, void * pTimeout,
+ void * pReadmask)
++#else
++static void vncHooksBlockHandler(ScreenPtr pScreen_, void * pTimeout)
+ #endif
+ {
+ #if XORG <= 112
+@@ -731,8 +735,10 @@ static void vncHooksBlockHandler(ScreenP
+
+ #if XORG <= 112
+ (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+-#else
++#elif XORG <= 118
+ (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
++#else
++ (*pScreen->BlockHandler) (pScreen, pTimeout);
+ #endif
+
+ vncHooksScreen->ignoreHooks--;
+@@ -1033,12 +1039,21 @@ static void vncHooksCopyClip(GCPtr dst,
+
+ // Unwrap and rewrap helpers
+
++#if XORG >= 116
++#define GC_OP_PROLOGUE(pGC, name)\
++ vncHooksGCPtr pGCPriv = vncHooksGCPrivate(pGC);\
++ const GCFuncs *oldFuncs = pGC->funcs;\
++ pGC->funcs = pGCPriv->wrappedFuncs;\
++ pGC->ops = pGCPriv->wrappedOps; \
++ DBGPRINT((stderr,"vncHooks" #name " called\n"))
++#else
+ #define GC_OP_PROLOGUE(pGC, name)\
+ vncHooksGCPtr pGCPriv = vncHooksGCPrivate(pGC);\
+ GCFuncs *oldFuncs = pGC->funcs;\
+ pGC->funcs = pGCPriv->wrappedFuncs;\
+ pGC->ops = pGCPriv->wrappedOps; \
+ DBGPRINT((stderr,"vncHooks" #name " called\n"))
++#endif
+
+ #define GC_OP_EPILOGUE(pGC)\
+ pGCPriv->wrappedOps = pGC->ops;\
+diff -up tigervnc-1.7.0/unix/xserver/hw/vnc/xorg-version.h.xserver119 tigervnc-1.7.0/unix/xserver/hw/vnc/xorg-version.h
+--- tigervnc-1.7.0/unix/xserver/hw/vnc/xorg-version.h.xserver119 2016-09-08 12:31:18.000000000 +0200
++++ tigervnc-1.7.0/unix/xserver/hw/vnc/xorg-version.h 2016-10-04 17:24:51.640654527 +0200
+@@ -50,8 +50,10 @@
+ #define XORG 117
+ #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (18 * 100000) + (99 * 1000))
+ #define XORG 118
++#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (19 * 100000) + (99 * 1000))
++#define XORG 119
+ #else
+-#error "X.Org newer than 1.18 is not supported"
++#error "X.Org newer than 1.19 is not supported"
+ #endif
+
+ #endif
+diff -up tigervnc-1.7.0/unix/xserver/hw/vnc/XserverDesktop.cc.xserver119 tigervnc-1.7.0/unix/xserver/hw/vnc/XserverDesktop.cc
+--- tigervnc-1.7.0/unix/xserver/hw/vnc/XserverDesktop.cc.xserver119 2016-09-08 12:31:18.000000000 +0200
++++ tigervnc-1.7.0/unix/xserver/hw/vnc/XserverDesktop.cc 2016-10-04 17:23:47.171977905 +0200
+@@ -89,6 +89,30 @@ public:
+ XserverDesktop* desktop;
+ };
+
++#if XORG >= 119
++extern "C" {
++/*
++ * xserver NotifyFd callbacks. Note we also expect write notifies to work,
++ * which only works with xserver >= 1.19.
++ */
++#include "os.h"
++
++static void HandleListenFd(int fd, int xevents, void *data)
++{
++ XserverDesktop *desktop = (XserverDesktop *)data;
++
++ desktop->handleListenFd(fd);
++}
++
++static void HandleSocketFd(int fd, int xevents, void *data)
++{
++ XserverDesktop *desktop = (XserverDesktop *)data;
++
++ desktop->handleSocketFd(fd, xevents);
++}
++
++}
++#endif
+
+ XserverDesktop::XserverDesktop(int screenIndex_,
+ std::list<network::TcpListener*> listeners_,
+@@ -110,15 +134,35 @@ XserverDesktop::XserverDesktop(int scree
+
+ if (!httpListeners.empty ())
+ httpServer = new FileHTTPServer(this);
++
++#if XORG >= 119
++ for (std::list<TcpListener*>::iterator i = listeners.begin();
++ i != listeners.end();
++ i++) {
++ SetNotifyFd((*i)->getFd(), HandleListenFd, X_NOTIFY_READ, this);
++ }
++
++ for (std::list<TcpListener*>::iterator i = httpListeners.begin();
++ i != httpListeners.end();
++ i++) {
++ SetNotifyFd((*i)->getFd(), HandleListenFd, X_NOTIFY_READ, this);
++ }
++#endif
+ }
+
+ XserverDesktop::~XserverDesktop()
+ {
+ while (!listeners.empty()) {
++#if XORG >= 119
++ RemoveNotifyFd(listeners.back()->getFd());
++#endif
+ delete listeners.back();
+ listeners.pop_back();
+ }
+ while (!httpListeners.empty()) {
++#if XORG >= 119
++ RemoveNotifyFd(listeners.back()->getFd());
++#endif
+ delete httpListeners.back();
+ httpListeners.pop_back();
+ }
+@@ -388,6 +432,140 @@ void XserverDesktop::add_copied(const rf
+ }
+ }
+
++#if XORG >= 119
++void XserverDesktop::handleListenFd(int fd)
++{
++ std::list<TcpListener*>::iterator i;
++ SocketServer *fd_server = NULL;
++ bool is_http = false;
++
++ for (i = listeners.begin(); i != listeners.end(); i++) {
++ if ((*i)->getFd() == fd) {
++ fd_server = server;
++ break;
++ }
++ }
++ if (httpServer && !fd_server) {
++ for (i = httpListeners.begin(); i != httpListeners.end(); i++) {
++ if ((*i)->getFd() == fd) {
++ fd_server = httpServer;
++ is_http = true;
++ break;
++ }
++ }
++ }
++ if (!fd_server) {
++ vlog.error("XserverDesktop::handleListenFd: Error cannot find fd");
++ return;
++ }
++
++ Socket* sock = (*i)->accept();
++ sock->outStream().setBlocking(false);
++ vlog.debug("new %sclient, sock %d", is_http ? "http " : "", sock->getFd());
++ fd_server->addSocket(sock);
++ SetNotifyFd(sock->getFd(), HandleSocketFd, X_NOTIFY_READ, this);
++}
++
++void XserverDesktop::handleSocketFd(int fd, int xevents)
++{
++ std::list<Socket*> sockets;
++ std::list<Socket*>::iterator i;
++ SocketServer *fd_server = NULL;
++ bool is_http = false;
++
++ server->getSockets(&sockets);
++ for (i = sockets.begin(); i != sockets.end(); i++) {
++ if ((*i)->getFd() == fd) {
++ fd_server = server;
++ break;
++ }
++ }
++ if (httpServer && !fd_server) {
++ httpServer->getSockets(&sockets);
++ for (i = sockets.begin(); i != sockets.end(); i++) {
++ if ((*i)->getFd() == fd) {
++ fd_server = httpServer;
++ is_http = true;
++ break;
++ }
++ }
++ }
++ if (!fd_server) {
++ vlog.error("XserverDesktop::handleSocketFd: Error cannot find fd");
++ return;
++ }
++
++ if (xevents & X_NOTIFY_READ)
++ fd_server->processSocketReadEvent(*i);
++
++ if (xevents & X_NOTIFY_WRITE)
++ fd_server->processSocketWriteEvent(*i);
++
++ if ((*i)->isShutdown()) {
++ vlog.debug("%sclient gone, sock %d", is_http ? "http " : "", fd);
++ RemoveNotifyFd(fd);
++ fd_server->removeSocket(*i);
++ if (!is_http)
++ vncClientGone(fd);
++ delete (*i);
++ }
++}
++
++void XserverDesktop::blockHandler(int* timeout)
++{
++ // We don't have a good callback for when we can init input devices[1],
++ // so we abuse the fact that this routine will be called first thing
++ // once the dix is done initialising.
++ // [1] Technically Xvnc has InitInput(), but libvnc.so has nothing.
++ vncInitInputDevice();
++
++ try {
++ std::list<Socket*> sockets;
++ std::list<Socket*>::iterator i;
++ server->getSockets(&sockets);
++ for (i = sockets.begin(); i != sockets.end(); i++) {
++ int fd = (*i)->getFd();
++ if ((*i)->isShutdown()) {
++ vlog.debug("client gone, sock %d",fd);
++ server->removeSocket(*i);
++ vncClientGone(fd);
++ delete (*i);
++ } else {
++ /* Update existing NotifyFD to listen for write (or not) */
++ if ((*i)->outStream().bufferUsage() > 0)
++ SetNotifyFd(fd, HandleSocketFd, X_NOTIFY_READ | X_NOTIFY_WRITE, this);
++ else
++ SetNotifyFd(fd, HandleSocketFd, X_NOTIFY_READ, this);
++ }
++ }
++ if (httpServer) {
++ httpServer->getSockets(&sockets);
++ for (i = sockets.begin(); i != sockets.end(); i++) {
++ int fd = (*i)->getFd();
++ if ((*i)->isShutdown()) {
++ vlog.debug("http client gone, sock %d",fd);
++ httpServer->removeSocket(*i);
++ delete (*i);
++ } else {
++ /* Update existing NotifyFD to listen for write (or not) */
++ if ((*i)->outStream().bufferUsage() > 0)
++ SetNotifyFd(fd, HandleSocketFd, X_NOTIFY_READ | X_NOTIFY_WRITE, this);
++ else
++ SetNotifyFd(fd, HandleSocketFd, X_NOTIFY_READ, this);
++ }
++ }
++ }
++
++ int nextTimeout = server->checkTimeouts();
++ if (nextTimeout > 0 && (*timeout == -1 || nextTimeout < *timeout))
++ *timeout = nextTimeout;
++ } catch (rdr::Exception& e) {
++ vlog.error("XserverDesktop::blockHandler: %s",e.str());
++ }
++}
++
++#else
++
+ void XserverDesktop::readBlockHandler(fd_set* fds, struct timeval ** timeout)
+ {
+ // We don't have a good callback for when we can init input devices[1],
+@@ -600,10 +778,15 @@ void XserverDesktop::writeWakeupHandler(
+ }
+ }
+
++#endif
++
+ void XserverDesktop::addClient(Socket* sock, bool reverse)
+ {
+ vlog.debug("new client, sock %d reverse %d",sock->getFd(),reverse);
+ server->addSocket(sock, reverse);
++#if XORG >= 119
++ SetNotifyFd(sock->getFd(), HandleSocketFd, X_NOTIFY_READ, this);
++#endif
+ }
+
+ void XserverDesktop::disconnectClients()
+diff -up tigervnc-1.7.0/unix/xserver/hw/vnc/XserverDesktop.h.xserver119 tigervnc-1.7.0/unix/xserver/hw/vnc/XserverDesktop.h
+--- tigervnc-1.7.0/unix/xserver/hw/vnc/XserverDesktop.h.xserver119 2016-09-08 12:31:18.000000000 +0200
++++ tigervnc-1.7.0/unix/xserver/hw/vnc/XserverDesktop.h 2016-10-04 17:17:35.617889712 +0200
+@@ -38,6 +38,7 @@
+ #include <rfb/VNCServerST.h>
+ #include <rdr/SubstitutingInStream.h>
+ #include "Input.h"
++#include "xorg-version.h"
+
+ namespace rfb {
+ class VNCServerST;
+@@ -69,10 +70,16 @@ public:
+ const unsigned char *rgbaData);
+ void add_changed(const rfb::Region ®ion);
+ void add_copied(const rfb::Region &dest, const rfb::Point &delta);
++#if XORG >= 119
++ void handleListenFd(int fd);
++ void handleSocketFd(int fd, int xevents);
++ void blockHandler(int* timeout);
++#else
+ void readBlockHandler(fd_set* fds, struct timeval ** timeout);
+ void readWakeupHandler(fd_set* fds, int nfds);
+ void writeBlockHandler(fd_set* fds, struct timeval ** timeout);
+ void writeWakeupHandler(fd_set* fds, int nfds);
++#endif
+ void addClient(network::Socket* sock, bool reverse);
+ void disconnectClients();
+
diff --git a/xserver.patch b/xserver.patch
index f418680..614f104 100644
--- a/xserver.patch
+++ b/xserver.patch
@@ -1,26 +1,26 @@
-diff -up xserver/configure.ac.vnc xserver/configure.ac
---- xserver/configure.ac.vnc 2012-08-28 15:35:23.778810954 +0200
-+++ xserver/configure.ac 2012-08-28 15:54:46.396743431 +0200
-@@ -73,6 +72,7 @@ dnl forcing an entire recompile.x
+diff -up xserver/configure.ac.xserver116-rebased xserver/configure.ac
+--- xserver/configure.ac.xserver116-rebased 2016-09-29 13:14:45.595441590 +0200
++++ xserver/configure.ac 2016-09-29 13:14:45.631442006 +0200
+@@ -74,6 +74,7 @@ dnl forcing an entire recompile.x
AC_CONFIG_HEADERS(include/version-config.h)
AM_PROG_AS
+AC_PROG_CXX
AC_PROG_LN_S
- AC_LIBTOOL_WIN32_DLL
- AC_DISABLE_STATIC
-@@ -1561,6 +1561,10 @@ if test "x$XVFB" = xyes; then
+ LT_PREREQ([2.2])
+ LT_INIT([disable-static win32-dll])
+@@ -1863,6 +1864,10 @@ if test "x$XVFB" = xyes; then
AC_SUBST([XVFB_SYS_LIBS])
fi
+dnl Xvnc DDX
+AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"])
-+AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $PRESENT_LIB $DRI3_LIB"])
++AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB"])
+AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"])
dnl Xnest DDX
-@@ -1596,6 +1600,8 @@ if test "x$XORG" = xauto; then
+@@ -1898,6 +1903,8 @@ if test "x$XORG" = xauto; then
fi
AC_MSG_RESULT([$XORG])
@@ -29,7 +29,7 @@ diff -up xserver/configure.ac.vnc xserver/configure.ac
if test "x$XORG" = xyes; then
XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
-@@ -1815,7 +1821,6 @@ if test "x$XORG" = xyes; then
+@@ -2116,7 +2123,6 @@ if test "x$XORG" = xyes; then
AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
@@ -37,7 +37,7 @@ diff -up xserver/configure.ac.vnc xserver/configure.ac
AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
-@@ -2280,6 +2285,7 @@ hw/dmx/Makefile
+@@ -2691,6 +2697,7 @@ hw/dmx/Makefile
hw/dmx/man/Makefile
hw/vfb/Makefile
hw/vfb/man/Makefile
@@ -45,10 +45,10 @@ diff -up xserver/configure.ac.vnc xserver/configure.ac
hw/xnest/Makefile
hw/xnest/man/Makefile
hw/xwin/Makefile
-diff -up xserver/hw/Makefile.am.vnc xserver/hw/Makefile.am
---- xserver/hw/Makefile.am.vnc 2012-08-28 15:35:23.856810890 +0200
-+++ xserver/hw/Makefile.am 2012-08-28 15:35:42.272795917 +0200
-@@ -33,7 +33,8 @@ SUBDIRS = \
+diff -up xserver/hw/Makefile.am.xserver116-rebased xserver/hw/Makefile.am
+--- xserver/hw/Makefile.am.xserver116-rebased 2016-09-29 13:14:45.601441659 +0200
++++ xserver/hw/Makefile.am 2016-09-29 13:14:45.631442006 +0200
+@@ -38,7 +38,8 @@ SUBDIRS = \
$(DMX_SUBDIRS) \
$(KDRIVE_SUBDIRS) \
$(XQUARTZ_SUBDIRS) \
@@ -58,10 +58,10 @@ diff -up xserver/hw/Makefile.am.vnc xserver/hw/Makefile.am
DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland
-diff -up xserver/mi/miinitext.c.vnc xserver/mi/miinitext.c
---- xserver/mi/miinitext.c.vnc 2012-08-28 15:35:23.000000000 +0200
-+++ xserver/mi/miinitext.c 2012-09-05 15:07:40.714953972 +0200
-@@ -112,6 +112,10 @@ SOFTWARE.
+diff -up xserver/mi/miinitext.c.xserver116-rebased xserver/mi/miinitext.c
+--- xserver/mi/miinitext.c.xserver116-rebased 2016-09-29 13:14:45.618441855 +0200
++++ xserver/mi/miinitext.c 2016-09-29 13:14:45.631442006 +0200
+@@ -114,6 +114,10 @@ SOFTWARE.
#include "micmap.h"
#include "globals.h"
@@ -72,13 +72,24 @@ diff -up xserver/mi/miinitext.c.vnc xserver/mi/miinitext.c
/* The following is only a small first step towards run-time
* configurable extensions.
*/
-@@ -299,6 +303,9 @@ static ExtensionModule staticExtensions[
- #ifdef XSELINUX
- {SELinuxExtensionInit, SELINUX_EXTENSION_NAME, &noSELinuxExtension},
- #endif
+@@ -238,6 +242,9 @@ EnableDisableExtensionError(const char *
+
+ /* List of built-in (statically linked) extensions */
+ static const ExtensionModule staticExtensions[] = {
+#ifdef TIGERVNC
+ {vncExtensionInit, "VNC-EXTENSION", NULL},
+#endif
- };
-
- static ExtensionModule *ExtensionModuleList = NULL;
+ {GEExtensionInit, "Generic Event Extension", &noGEExtension},
+ {ShapeExtensionInit, "SHAPE", NULL},
+ #ifdef MITSHM
+--- xserver/include/os.h~ 2016-10-03 09:07:29.000000000 +0200
++++ xserver/include/os.h 2016-10-03 14:13:00.013654506 +0200
+@@ -621,7 +621,7 @@
+ extern _X_EXPORT void
+ LogClose(enum ExitCode error);
+ extern _X_EXPORT Bool
+-LogSetParameter(LogParameter param, int value);
++LogSetParameter(enum _LogParameter param, int value);
+ extern _X_EXPORT void
+ LogVWrite(int verb, const char *f, va_list args)
+ _X_ATTRIBUTE_PRINTF(2, 0);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/tigervnc.git/commitdiff/7d6a554b040c49cacc7ffdb09607686d54b86e05
More information about the pld-cvs-commit
mailing list