--- /dev/null
+From 0acffdd6f443198378012405e7f814f5abf278b3 Mon Sep 17 00:00:00 2001
+From: Adam Tkac <atkac@redhat.com>
+Date: Wed, 15 Sep 2010 15:37:01 +0200
+Subject: [PATCH] Add -dridir parameter to specify DRI drivers directory from command line.
+
+Signed-off-by: Adam Tkac <atkac@redhat.com>
+---
+ glx/glxdri.c | 2 --
+ glx/glxdri2.c | 2 --
+ glx/glxdriswrast.c | 2 --
+ glx/glxext.c | 27 +++++++++++++++++++++++++++
+ glx/glxserver.h | 3 +++
+ os/utils.c | 9 +++++++++
+ 6 files changed, 39 insertions(+), 6 deletions(-)
+
+diff --git a/glx/glxext.c b/glx/glxext.c
+index 89e58b0..5e7cf23 100644
+--- a/glx/glxext.c
++++ b/glx/glxext.c
+@@ -608,3 +608,30 @@ static int __glXDispatch(ClientPtr client)
+
+ return retval;
+ }
++
++char *dri_driver_path = DRI_DRIVER_PATH;
++
++int GlxProcessArguments(int argc, char *argv[], int i)
++{
++ if (strncmp(argv[i], "-dridir", 7) == 0) {
++ if (++i < argc) {
++#if !defined(WIN32) && !defined(__CYGWIN__)
++ if (getuid() != geteuid()) {
++ LogMessage(X_WARNING, "-dridir is not available for setuid X servers\n");
++ return -1;
++ } else
++#endif
++ {
++ if (strlen(argv[i]) < PATH_MAX) {
++ dri_driver_path = argv[i];
++ return 2;
++ } else {
++ LogMessage(X_ERROR, "-dridir pathname too long\n");
++ return -1;
++ }
++ }
++ }
++ }
++
++ return 0;
++}
+diff --git a/glx/glxserver.h b/glx/glxserver.h
+index 1daf977..082ff82 100644
+--- a/glx/glxserver.h
++++ b/glx/glxserver.h
+@@ -251,4 +251,7 @@ extern unsigned glxMinorVersion;
+
+ extern int __glXEventBase;
+
++extern char *dri_driver_path;
++extern int GlxProcessArguments(int argc, char *argv[], int i);
++
+ #endif /* !__GLX_server_h__ */
+diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
+--- a/glx/glxdricommon.c
++++ b/glx/glxdricommon.c
+@@ -209,6 +209,4 @@
+ return head.next;
+ }
+
+-static const char dri_driver_path[] = DRI_DRIVER_PATH;
+-
+ void *
+ glxProbeDriver(const char *driverName,
+diff --git a/os/utils.c b/os/utils.c
+index 13d3b3f..ff97c86 100644
+--- a/os/utils.c
++++ b/os/utils.c
+@@ -139,6 +139,7 @@ Bool noDPMSExtension = FALSE;
+ #ifdef GLXEXT
+ Bool noGlxExtension = FALSE;
+ Bool noGlxVisualInit = FALSE;
++extern int GlxProcessArguments(int argc, char *argv[], int i);
+ #endif
+ #ifdef SCREENSAVER
+ Bool noScreenSaverExtension = FALSE;
+@@ -704,6 +705,14 @@ ProcessCommandLine(int argc, char *argv[])
+ else
+ UseMsg();
+ }
++#ifdef GLXEXT
++ else if ((skip = GlxProcessArguments(argc,argv,i)) != 0) {
++ if (skip > 0)
++ i += skip - 1;
++ else
++ UseMsg();
++ }
++#endif
+ #ifdef RLIMIT_DATA
+ else if (strcmp(argv[i], "-ld") == 0) {
+ if (++i < argc) {
+--
+1.7.3.2
+
--- /dev/null
+From 5e6e99eaef3ca346c78a3e520ed58ec8b8100b41 Mon Sep 17 00:00:00 2001
+From: Adam Tkac <atkac@redhat.com>
+Date: Thu, 2 Sep 2010 17:24:38 +0200
+Subject: [PATCH] Add -xkbcompdir parameter to modify "xkbcomp" path from commandline.
+
+Signed-off-by: Adam Tkac <atkac@redhat.com>
+---
+ xkb/xkbInit.c | 21 +++++++++++++++++++++
+ 1 files changed, 21 insertions(+), 0 deletions(-)
+
+diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
+index fbf8f14..29fb33e 100644
+--- a/xkb/xkbInit.c
++++ b/xkb/xkbInit.c
+@@ -742,7 +742,28 @@ XkbProcessArguments(int argc,char *argv[],int i)
+ }
+ }
+ return j;
++ } else if (strncmp(argv[i], "-xkbcompdir", 11)==0) {
++ if (++i < argc) {
++#if !defined(WIN32) && !defined(__CYGWIN__)
++ if (getuid() != geteuid()) {
++ LogMessage(X_WARNING, "-xkbdir is not available for setuid X servers\n");
++ return -1;
++ } else
++#endif
++ {
++ if (strlen(argv[i]) < PATH_MAX) {
++ XkbBinDirectory = argv[i];
++ return 2;
++ } else {
++ LogMessage(X_ERROR, "-xkbcompdir pathname too long\n");
++ return -1;
++ }
++ }
++ } else {
++ return -1;
++ }
+ }
++
+ if ((strcmp(argv[i], "-ardelay") == 0) || (strcmp(argv[i], "-ar1") == 0)) { /* -ardelay int */
+ if (++i >= argc)
+ UseMsg();
+--
+1.7.2.3
+
Name: tigervnc
Version: @VERSION@
-Release: 7%{?snap:.%{snap}}%{?dist}
+Release: 8%{?snap:.%{snap}}%{?dist}
Summary: A TigerVNC remote display system
Group: User Interface/Desktops
Source204: ftp://ftp.freedesktop.org/pub/mesa/older-versions/9.x/9.2.5/MesaLib-9.2.5.tar.bz2
# NOTE:
# libgcrypt from el5 is not new enough to satisfy newer Xorg requirements for --with-sha1,
-# which causes Xorg to link against libssl.so and introduce about 10 dynamic dependencies.
+# which causes Xorg to link against libssl.so and introduce about 10 dynamic dependencies.
# to prevent this, build a static libsha1 and link against that.
# NOTE:
Source205: https://github.com/dottedmag/libsha1/archive/0.3.tar.gz
# tigervnc patches
Patch4: tigervnc-cookie.patch
Patch12: tigervnc14-static-build-fixes.patch
+Patch13: tigervnc14-Add-dridir-param.patch
+Patch14: tigervnc14-Add-xkbcompdir-param.patch
# fltk patches
Patch15: fltk-1.3.3-static-libs.patch
Patch10002: CVE-2015-0255.diff
# http://www.x.org/wiki/Development/Security/Advisory-2015-03-17/
Patch10003: CVE-2015-1802.diff
-Patch10004: CVE-2015-1803.diff
+Patch10004: CVE-2015-1803.diff
Patch10005: CVE-2015-1804.diff
# http://lists.x.org/archives/xorg-announce/2015-April/002561.html
Patch10006: CVE-2013-7439.diff
chmod -x "$all"
done
patch -p1 < %{_builddir}/%{name}-%{version}%{?snap:-%{snap}}/unix/xserver112.patch
+%patch13 -p1 -b .dridir
+%patch14 -p1 -b .xkbcompdir
popd
# error "unexpected value for __WORDSIZE macro"
#endif
-#endif
+#endif
EOF
popd
find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \;
if [ "${module}" = "libxcb" ]; then
sed 's,@libdir@,%{xorg_buildroot}%{_libdir},;s,@prefix@,%{xorg_buildroot}%{_prefix},;s,@exec_prefix@,%{xorg_buildroot}%{_exec_prefix},' %{SOURCE140} > %{xorg_buildroot}%{_libdir}/pkgconfig/pthread-stubs.pc
- sed -i -e 's/^\(Libs.private:.*\)$/\1 -L${libdir} -lXdmcp -lXau/' %{xorg_buildroot}%{_libdir}/pkgconfig/xcb.pc
+ sed -i -e 's/^\(Libs.private:.*\)$/\1 -L${libdir} -lXdmcp -lXau/' %{xorg_buildroot}%{_libdir}/pkgconfig/xcb.pc
elif [ "${module}" = "libX11" ]; then
- sed -i -e 's/^\(Libs:.*\)$/\1 -ldl/' %{xorg_buildroot}%{_libdir}/pkgconfig/x11.pc
- sed -i -e 's/^\(Libs.private:.*\)$/\1 -L${libdir} -lxcb/' %{xorg_buildroot}%{_libdir}/pkgconfig/x11.pc
+ sed -i -e 's/^\(Libs:.*\)$/\1 -ldl/' %{xorg_buildroot}%{_libdir}/pkgconfig/x11.pc
+ sed -i -e 's/^\(Libs.private:.*\)$/\1 -L${libdir} -lxcb/' %{xorg_buildroot}%{_libdir}/pkgconfig/x11.pc
elif [ "${module}" = "libSM" ]; then
echo 'Libs.private: -L${libdir} -lICE' >> %{xorg_buildroot}%{_libdir}/pkgconfig/sm.pc
fi
%endif
# link libGL statically against any xorg libraries built above
-LDFLAGS="$LDFLAGS -Wl,-Bstatic -lxcb -lX11 -lXdmcp -lXau -lXext -lXxf86vm -ldrm -Wl,-Bdynamic -Wl,-rpath,%{_libdir}/tigervnc:%{_libdir}" \
+LDFLAGS="$LDFLAGS -Wl,-Bstatic -lxcb -lX11 -lXdmcp -lXau -lXext -lXxf86vm -ldrm -Wl,-Bdynamic -Wl,-rpath,"'\$$'"ORIGIN/../..%{_libdir}/tigervnc:%{_libdir}/tigervnc:%{_libdir}" \
PKG_CONFIG="pkg-config --static" ./configure %{common_flags} \
--prefix=%{_prefix} \
--libdir=%{_libdir}/tigervnc \
pushd fltk-*
export CMAKE_PREFIX_PATH="%{xorg_buildroot}%{_prefix}:%{_prefix}"
export CMAKE_EXE_LINKER_FLAGS=$LDFLAGS
-export PKG_CONFIG="pkg-config --static"
+export PKG_CONFIG="pkg-config --static"
CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" ./configure \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--enable-xdbe \
--enable-xfixes \
--enable-xcursor \
- --with-x
+ --with-x
make %{?_smp_mflags}
make DESTDIR=%{xorg_buildroot} install
popd
pushd unix/xserver
export PIXMANINCDIR=%{xorg_buildroot}%{_includedir}/pixman-1
sed -i -e 's/^\(\s*WAYLAND_SCANNER_RULES.*\)/dnl\1/' configure.ac
-autoreconf -fiv
+autoreconf -fiv
chmod +x ./configure
# create a relocatable Xvnc so that we can bundle the custom libGL & swrast w/o overwriting existing libs
-GL_LIBS='-Wl,-Bdynamic -lGL' LDFLAGS="$LDFLAGS -L%{xorg_buildroot}%{_libdir}/tigervnc -Wl,-rpath,%{_libdir}/tigervnc:%{_libdir}" \
+GL_LIBS='-Wl,-Bdynamic -lGL' LDFLAGS="$LDFLAGS -L%{xorg_buildroot}%{_libdir}/tigervnc -Wl,-rpath,"'\$$'"ORIGIN/../..%{_libdir}/tigervnc:%{_libdir}/tigervnc:%{_libdir}" \
%configure \
--prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_datadir}/man \
--sysconfdir=%{_sysconfdir} --localstatedir=%{_localstatedir} \
%{_datadir}/icons/hicolor/*/apps/*
%changelog
+* Sun Sep 12 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.5.80-8
+- Build Xvnc with link path relative to $ORIGIN and apply dridir patch
+ to make it portable.
+
* Sun Aug 09 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.5.80-7
- Patch Xorg sources with latest relevant CVE patches.
- Update libjpeg-turbo, gnutls, libtasn1 to latest upstream versions.
* Sat Mar 30 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-11.20130330svn5066
- Updated to TigerVNC svn 5066
- Updated fltk to 1.3.2 and updated fltk patches per BUILDING.txt
-- Fixed vncserver init script & config file which had been overwritten by
+- Fixed vncserver init script & config file which had been overwritten by
systemd versions.
* Wed Nov 28 2012 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-7.20120915svn4999
-- Changed BuildRequires to cmake28
+- Changed BuildRequires to cmake28
- Set PIXMANINCDIR when building Xvnc
* Tue Sep 18 2012 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-6.20120915svn4999