From a6c27d42261217dad08bdc9cb004c8fad38a4513 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Wed, 4 Apr 2018 19:34:29 +0200 Subject: [PATCH] Fix build against Xorg 1.20 --- tigervnc-support-xorg120.patch | 36 ++++++++++++++++++++++++++++++++++ tigervnc-xserver119.patch | 32 +++++++++++++----------------- tigervnc.spec | 8 +++++--- 3 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 tigervnc-support-xorg120.patch diff --git a/tigervnc-support-xorg120.patch b/tigervnc-support-xorg120.patch new file mode 100644 index 0000000..1f1c5b6 --- /dev/null +++ b/tigervnc-support-xorg120.patch @@ -0,0 +1,36 @@ +diff --git a/unix/xserver/hw/vnc/xorg-version.h b/unix/xserver/hw/vnc/xorg-version.h +index 9d1c0eb..79ff79a 100644 +--- a/unix/xserver/hw/vnc/xorg-version.h ++++ b/unix/xserver/hw/vnc/xorg-version.h +@@ -52,8 +52,10 @@ + #define XORG 118 + #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (19 * 100000) + (99 * 1000)) + #define XORG 119 ++#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (20 * 100000) + (99 * 1000)) ++#define XORG 120 + #else +-#error "X.Org newer than 1.19 is not supported" ++#error "X.Org newer than 1.20 is not supported" + #endif + + #endif +diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c +index 93d8af4..1517809 100644 +--- a/unix/xserver/hw/vnc/xvnc.c ++++ b/unix/xserver/hw/vnc/xvnc.c +@@ -202,6 +202,7 @@ vfbBitsPerPixel(int depth) + + static void vfbFreeFramebufferMemory(vfbFramebufferInfoPtr pfb); + ++#if XORG < 120 + #ifdef DPMSExtension + /* Why support DPMS? Because stupid modern desktop environments + such as Unity 2D on Ubuntu 11.10 crashes if DPMS is not +@@ -219,6 +220,7 @@ Bool DPMSSupported(void) + return FALSE; + } + #endif ++#endif + + #if XORG < 111 + void ddxGiveUp() diff --git a/tigervnc-xserver119.patch b/tigervnc-xserver119.patch index 614f104..e7eae3c 100644 --- a/tigervnc-xserver119.patch +++ b/tigervnc-xserver119.patch @@ -3,7 +3,7 @@ diff -up xserver/configure.ac.xserver116-rebased xserver/configure.ac +++ 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 @@ -12,18 +12,18 @@ diff -up xserver/configure.ac.xserver116-rebased xserver/configure.ac @@ -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 $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 - + @@ -1898,6 +1903,8 @@ if test "x$XORG" = xauto; then fi AC_MSG_RESULT([$XORG]) - + +AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) + if test "x$XORG" = xyes; then @@ -55,25 +55,21 @@ diff -up xserver/hw/Makefile.am.xserver116-rebased xserver/hw/Makefile.am - $(XWAYLAND_SUBDIRS) + $(XWAYLAND_SUBDIRS) \ + vnc - + DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland - -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" + +diff --git xserver/mi/miinitext.c xserver/mi/miinitext.c +index 5596e21..003fc3c 100644 +--- xserver/mi/miinitext.c ++++ xserver/mi/miinitext.c +@@ -107,8 +107,15 @@ SOFTWARE. + #include "os.h" #include "globals.h" - + +#ifdef TIGERVNC +extern void vncExtensionInit(INITARGS); +#endif + - /* The following is only a small first step towards run-time - * configurable extensions. - */ -@@ -238,6 +242,9 @@ EnableDisableExtensionError(const char * - /* List of built-in (statically linked) extensions */ static const ExtensionModule staticExtensions[] = { +#ifdef TIGERVNC diff --git a/tigervnc.spec b/tigervnc.spec index 4cd08de..a92bfcb 100644 --- a/tigervnc.spec +++ b/tigervnc.spec @@ -19,7 +19,7 @@ BuildRequires: libX11-devel, automake, autoconf, libtool, gettext, gettext-auto BuildRequires: libXext-devel, xorg-x11-server-source, libXi-devel BuildRequires: xorg-x11-xtrans-devel, xorg-x11-util-macros, libXtst-devel BuildRequires: libxkbfile-devel, openssl-devel, libpciaccess-devel -BuildRequires: mesa-libGL-devel, libXinerama-devel, ImageMagick +BuildRequires: mesa-libGL-devel, libXinerama-devel, BuildRequires: freetype-devel, libXdmcp-devel, libxshmfence-devel BuildRequires: desktop-file-utils, java-devel, jpackage-utils BuildRequires: libjpeg-turbo-devel, gnutls-devel, pam-devel @@ -55,6 +55,7 @@ Patch8: tigervnc-getmaster.patch Patch9: tigervnc-shebang.patch Patch14: tigervnc-xstartup.patch Patch18: tigervnc-utilize-system-crypto-policies.patch +Patch19: tigervnc-support-xorg120.patch # This is tigervnc-%%{version}/unix/xserver116.patch rebased on the latest xorg Patch100: tigervnc-xserver119.patch @@ -167,8 +168,9 @@ popd %patch14 -p1 -b .xstartup # Utilize system-wide crypto policies -%patch18 -p1 -b .utilize-system-crypto-policies.patch +%patch18 -p1 -b .utilize-system-crypto-policies +%patch19 -p1 -b .tigervnc-support-xorg120 %build %ifarch sparcv9 sparc64 s390 s390x @@ -191,7 +193,7 @@ autoreconf -fiv --with-fontdir=%{_datadir}/X11/fonts \ --with-xkb-output=%{_localstatedir}/lib/xkb \ --enable-install-libxf86config \ - --enable-glx --disable-dri --enable-dri2 --enable-dri3 \ + --enable-glx --disable-dri --enable-dri2 --disable-dri3 \ --disable-unit-tests \ --disable-config-hal \ --disable-config-udev \