diff options
author | Pierre Ossman <ossman@cendio.se> | 2019-01-22 11:02:38 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2019-01-22 11:02:38 +0100 |
commit | ef894eb06646fd7eab5ee23887e3311ef33a5d84 (patch) | |
tree | 75eba7fa0ad33b814050f7a727754f760aad4ddb | |
parent | ab22bc0aabae1fc742b808e6316cd3ce2ca81f23 (diff) | |
parent | 9371e4b467af3d3bf4ec88896706521070cb2e48 (diff) | |
download | tigervnc-ef894eb06646fd7eab5ee23887e3311ef33a5d84.tar.gz tigervnc-ef894eb06646fd7eab5ee23887e3311ef33a5d84.zip |
Merge branch 'docker' of https://github.com/CendioOssman/tigervnc
114 files changed, 337 insertions, 13952 deletions
diff --git a/.travis.yml b/.travis.yml index ceafcbb7..6b104c72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,31 @@ -language: - - c++ - - java +dist: xenial +language: minimal -# Travis is still stuck on Ubuntu 14.04, which has too old crap -before_install: -# GnuTLS 3.x - - sudo apt-get install -y libgnutls28-dev -# FLTK 1.3.4 - - wget http://fltk.org/pub/fltk/1.3.4/fltk-1.3.4-2-source.tar.gz - - tar -xvf fltk-1.3.4-2-source.tar.gz - - pushd fltk-1.3.4-2 - - ./configure --prefix=/usr --enable-shared - - make -j2 - - sudo make install - - popd +env: + - DOCKER=centos6 + - DOCKER=centos7 + - DOCKER=trusty + - DOCKER=xenial + +matrix: + include: + - language: c++ + env: + before_install: + - sudo apt-get install -y libgnutls-dev libfltk1.3-dev fluid + - sudo apt-get install -y libxtst-dev libxdamage-dev libxfixes-dev libxrandr-dev + script: + - cmake -DCMAKE_BUILD_TYPE=Debug . && make + - language: java + # We're not compatible with the newer java + dist: trusty + env: + before_install: skip + script: + - cd java && cmake . && make + +before_install: + - docker build -t tigervnc/$DOCKER .travis/$DOCKER script: - - cmake -DCMAKE_BUILD_TYPE=Debug . && make - - cd java && cmake . && make + - .travis/$DOCKER/build.sh diff --git a/.travis/centos6/Dockerfile b/.travis/centos6/Dockerfile new file mode 100644 index 00000000..e223b439 --- /dev/null +++ b/.travis/centos6/Dockerfile @@ -0,0 +1,13 @@ +FROM centos:6 + +RUN yum -y groupinstall 'Development Tools' +RUN yum -y install yum-utils + +RUN yum -y install sudo + +RUN useradd -s /bin/bash -m rpm +RUN echo >> /etc/sudoers +RUN echo "rpm ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + +USER rpm +WORKDIR /home/rpm diff --git a/.travis/centos6/build.sh b/.travis/centos6/build.sh new file mode 100755 index 00000000..c219f35d --- /dev/null +++ b/.travis/centos6/build.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -e +set -x + +## Basic variables + +CURDIR=$(dirname $(readlink -f $0)) +TOPDIR=$(git rev-parse --show-toplevel 2>/dev/null) + +RPMDIR=${TOPDIR}/contrib/packages/rpm/el6 + +VERSION=$(grep '^set(VERSION ' ${TOPDIR}/CMakeLists.txt | sed 's@^set(VERSION \(.*\))@\1@') + +## Prepare the build directory + +rm -rf ${CURDIR}/rpmbuild +mkdir -p ${CURDIR}/rpmbuild/{BUILD,BUILDROOT,SRPMS,SOURCES,SPECS,RPMS} +chmod a+w ${CURDIR}/rpmbuild/{BUILD,BUILDROOT,SRPMS,RPMS} +[ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled && chcon -Rt container_file_t ${CURDIR}/rpmbuild + +## Copy over the packaging files + +cp ${RPMDIR}/SOURCES/* ${CURDIR}/rpmbuild/SOURCES +cp ${RPMDIR}/SPECS/tigervnc.spec ${CURDIR}/rpmbuild/SPECS +sed -i "s/@VERSION@/${VERSION}/" ${CURDIR}/rpmbuild/SPECS/tigervnc.spec + +# Extra dependencies built because the distribution lacks what we need + +curl -L -o ${CURDIR}/rpmbuild/SOURCES/fltk-1.3.4-2-source.tar.gz https://www.fltk.org/pub/fltk/1.3.4/fltk-1.3.4-2-source.tar.gz +curl -L -o ${CURDIR}/rpmbuild/SOURCES/libpng-1.6.34.tar.gz https://downloads.sourceforge.net/project/libpng/libpng16/1.6.34/libpng-1.6.34.tar.gz +curl -L -o ${CURDIR}/rpmbuild/SOURCES/gmp-6.1.2.tar.bz2 https://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2 +curl -L -o ${CURDIR}/rpmbuild/SOURCES/libtasn1-4.13.tar.gz https://ftp.gnu.org/gnu/libtasn1/libtasn1-4.13.tar.gz +curl -L -o ${CURDIR}/rpmbuild/SOURCES/nettle-3.4.tar.gz https://ftp.gnu.org/gnu/nettle/nettle-3.4.tar.gz +curl -L -o ${CURDIR}/rpmbuild/SOURCES/gnutls-3.3.30.tar.xz https://www.gnupg.org/ftp/gcrypt/gnutls/v3.3/gnutls-3.3.30.tar.xz + +## Copy over the source code + +(cd ${TOPDIR} && git archive --prefix tigervnc-${VERSION}/ HEAD) | bzip2 > ${CURDIR}/rpmbuild/SOURCES/tigervnc-${VERSION}.tar.bz2 + +## Start the build + +docker run --volume ${CURDIR}/rpmbuild:/home/rpm/rpmbuild --interactive --tty --rm tigervnc/${DOCKER} \ + bash -c " + sudo yum-builddep -y ~/rpmbuild/SPECS/tigervnc.spec && + sudo chown 0.0 ~/rpmbuild/SOURCES/* && + sudo chown 0.0 ~/rpmbuild/SPECS/* && + rpmbuild -ba ~/rpmbuild/SPECS/tigervnc.spec + " diff --git a/.travis/centos7/Dockerfile b/.travis/centos7/Dockerfile new file mode 100644 index 00000000..36e86fbd --- /dev/null +++ b/.travis/centos7/Dockerfile @@ -0,0 +1,13 @@ +FROM centos:7 + +RUN yum -y groupinstall 'Development Tools' +RUN yum -y install centos-packager + +RUN yum -y install sudo + +RUN useradd -s /bin/bash -m rpm +RUN echo >> /etc/sudoers +RUN echo "rpm ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + +USER rpm +WORKDIR /home/rpm diff --git a/.travis/centos7/build.sh b/.travis/centos7/build.sh new file mode 100755 index 00000000..f5b4de03 --- /dev/null +++ b/.travis/centos7/build.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +set -e +set -x + +## Basic variables + +CURDIR=$(dirname $(readlink -f $0)) +TOPDIR=$(git rev-parse --show-toplevel 2>/dev/null) + +RPMDIR=${TOPDIR}/contrib/packages/rpm/el7 + +VERSION=$(grep '^set(VERSION ' ${TOPDIR}/CMakeLists.txt | sed 's@^set(VERSION \(.*\))@\1@') + +## Prepare the build directory + +rm -rf ${CURDIR}/rpmbuild +mkdir -p ${CURDIR}/rpmbuild/{BUILD,BUILDROOT,SRPMS,SOURCES,SPECS,RPMS} +chmod a+w ${CURDIR}/rpmbuild/{BUILD,BUILDROOT,SRPMS,RPMS} +[ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled && chcon -Rt container_file_t ${CURDIR}/rpmbuild + +## Copy over the packaging files + +cp ${RPMDIR}/SOURCES/* ${CURDIR}/rpmbuild/SOURCES +cp ${RPMDIR}/SPECS/tigervnc.spec ${CURDIR}/rpmbuild/SPECS +sed -i "s/@VERSION@/${VERSION}/" ${CURDIR}/rpmbuild/SPECS/tigervnc.spec + +## Copy over the source code + +(cd ${TOPDIR} && git archive --prefix tigervnc-${VERSION}/ HEAD) | bzip2 > ${CURDIR}/rpmbuild/SOURCES/tigervnc-${VERSION}.tar.bz2 + +## Start the build + +docker run --volume ${CURDIR}/rpmbuild:/home/rpm/rpmbuild --interactive --tty --rm tigervnc/${DOCKER} \ + bash -c " + sudo yum-builddep -y ~/rpmbuild/SPECS/tigervnc.spec && + sudo chown 0.0 ~/rpmbuild/SOURCES/* && + sudo chown 0.0 ~/rpmbuild/SPECS/* && + rpmbuild -ba ~/rpmbuild/SPECS/tigervnc.spec + " diff --git a/.travis/trusty/Dockerfile b/.travis/trusty/Dockerfile new file mode 100644 index 00000000..0a41647b --- /dev/null +++ b/.travis/trusty/Dockerfile @@ -0,0 +1,11 @@ +FROM ubuntu:trusty + +RUN apt-get update +RUN apt-get -y install packaging-dev equivs + +RUN useradd -s /bin/bash -m deb +RUN echo >> /etc/sudoers +RUN echo "deb ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + +USER deb +WORKDIR /home/deb diff --git a/.travis/trusty/build.sh b/.travis/trusty/build.sh new file mode 100755 index 00000000..08076da3 --- /dev/null +++ b/.travis/trusty/build.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +set -e +set -x + +## Basic variables + +CURDIR=$(dirname $(readlink -f $0)) +TOPDIR=$(git rev-parse --show-toplevel 2>/dev/null) + +DEBDIR=${TOPDIR}/contrib/packages/deb/ubuntu-trusty + +VERSION=$(grep '^set(VERSION ' ${TOPDIR}/CMakeLists.txt | sed 's@^set(VERSION \(.*\))@\1@') + +## Prepare the build directory + +rm -rf ${CURDIR}/build +mkdir -p ${CURDIR}/build +chmod a+w ${CURDIR}/build +[ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled && chcon -Rt container_file_t ${CURDIR}/build + +## Copy over the source code + +(cd ${TOPDIR} && git archive --prefix tigervnc-${VERSION}/ HEAD) | xz > ${CURDIR}/build/tigervnc-${VERSION}.tar.xz + +# Extra dependencies built because the distribution lacks what we need + +curl -L -o ${CURDIR}/build/fltk-1.3.4-2-source.tar.gz https://www.fltk.org/pub/fltk/1.3.4/fltk-1.3.4-2-source.tar.gz + +# Bundle up everything + +tar -C ${CURDIR}/build -axf ${CURDIR}/build/tigervnc-${VERSION}.tar.xz +tar -C ${CURDIR}/build/tigervnc-${VERSION} -axf ${CURDIR}/build/fltk-1.3.4-2-source.tar.gz +tar -C ${CURDIR}/build -acf ${CURDIR}/build/tigervnc_${VERSION}.orig.tar.xz tigervnc-${VERSION} +rm -rf ${CURDIR}/build/tigervnc-${VERSION} + +## Copy over the packaging files + +cp -r ${DEBDIR}/debian ${CURDIR}/build/debian + +chmod a+x ${CURDIR}/build/debian/rules + +# Assemble a fake changelog entry to get the correct version + +cat - > ${CURDIR}/build/debian/changelog << EOT +tigervnc (${VERSION}-1ubuntu1) UNRELEASED; urgency=low + + * Automated build for TigerVNC + + -- Build bot <tigervncbot@tigervnc.org> $(date -R) + +EOT +cat ${DEBDIR}/debian/changelog >> ${CURDIR}/build/debian/changelog + +## Start the build + +docker run --volume ${CURDIR}/build:/home/deb/build --interactive --tty --rm tigervnc/${DOCKER} \ + bash -c " + tar -C ~/build -axf ~/build/tigervnc_${VERSION}.orig.tar.xz && + cp -a ~/build/debian ~/build/tigervnc-${VERSION}/debian && + mk-build-deps ~/build/tigervnc-${VERSION}/debian/control && + sudo dpkg --unpack ~/tigervnc-build-deps_*.deb && + sudo apt-get -f install -y && + cd ~/build/tigervnc-${VERSION} && dpkg-buildpackage + " diff --git a/.travis/xenial/Dockerfile b/.travis/xenial/Dockerfile new file mode 100644 index 00000000..ad5414fd --- /dev/null +++ b/.travis/xenial/Dockerfile @@ -0,0 +1,11 @@ +FROM ubuntu:xenial + +RUN apt-get update +RUN apt-get -y install packaging-dev equivs + +RUN useradd -s /bin/bash -m deb +RUN echo >> /etc/sudoers +RUN echo "deb ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + +USER deb +WORKDIR /home/deb diff --git a/.travis/xenial/build.sh b/.travis/xenial/build.sh new file mode 100755 index 00000000..5c140f9d --- /dev/null +++ b/.travis/xenial/build.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +set -e +set -x + +## Basic variables + +CURDIR=$(dirname $(readlink -f $0)) +TOPDIR=$(git rev-parse --show-toplevel 2>/dev/null) + +DEBDIR=${TOPDIR}/contrib/packages/deb/ubuntu-xenial + +VERSION=$(grep '^set(VERSION ' ${TOPDIR}/CMakeLists.txt | sed 's@^set(VERSION \(.*\))@\1@') + +## Prepare the build directory + +rm -rf ${CURDIR}/build +mkdir -p ${CURDIR}/build +chmod a+w ${CURDIR}/build +[ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled && chcon -Rt container_file_t ${CURDIR}/build + +## Copy over the source code + +(cd ${TOPDIR} && git archive --prefix tigervnc-${VERSION}/ HEAD) | xz > ${CURDIR}/build/tigervnc_${VERSION}.orig.tar.xz + +## Copy over the packaging files + +cp -r ${DEBDIR}/debian ${CURDIR}/build/debian + +chmod a+x ${CURDIR}/build/debian/rules + +# Assemble a fake changelog entry to get the correct version + +cat - > ${CURDIR}/build/debian/changelog << EOT +tigervnc (${VERSION}-1ubuntu1) UNRELEASED; urgency=low + + * Automated build for TigerVNC + + -- Build bot <tigervncbot@tigervnc.org> $(date -R) + +EOT +cat ${DEBDIR}/debian/changelog >> ${CURDIR}/build/debian/changelog + +## Start the build + +docker run --volume ${CURDIR}/build:/home/deb/build --interactive --tty --rm tigervnc/${DOCKER} \ + bash -c " + tar -C ~/build -axf ~/build/tigervnc_${VERSION}.orig.tar.xz && + cp -a ~/build/debian ~/build/tigervnc-${VERSION}/debian && + mk-build-deps ~/build/tigervnc-${VERSION}/debian/control && + sudo dpkg --unpack ~/tigervnc-build-deps_*.deb && + sudo apt-get -f install -y && + cd ~/build/tigervnc-${VERSION} && dpkg-buildpackage + " diff --git a/contrib/fltk/01-str2636-fltk-1.3.x-clipboard.patch b/contrib/fltk/01-str2636-fltk-1.3.x-clipboard.patch deleted file mode 100644 index 3f12bc53..00000000 --- a/contrib/fltk/01-str2636-fltk-1.3.x-clipboard.patch +++ /dev/null @@ -1,106 +0,0 @@ -diff -up fltk-1.3.x-r8659/FL/Fl.H.orig fltk-1.3.x-r8659/FL/Fl.H ---- fltk-1.3.x-r8659/FL/Fl.H.orig 2011-05-17 16:25:56.671744548 +0200 -+++ fltk-1.3.x-r8659/FL/Fl.H 2011-05-17 16:26:05.709101536 +0200 -@@ -108,6 +108,9 @@ typedef int (*Fl_Args_Handler)(int argc, - \see Fl::event_dispatch(Fl_Event_Dispatch) */ - typedef int (*Fl_Event_Dispatch)(int event, Fl_Window *w); - -+/** Signature of add_clipboard_notify functions passed as parameters */ -+typedef void (*Fl_Clipboard_Notify_Handler)(int source, void *data); -+ - /** @} */ /* group callback_functions */ - - -@@ -744,6 +747,19 @@ public: - */ - static void paste(Fl_Widget &receiver, int source /*=0*/); // platform dependent - /** -+ FLTK will call the registered callback whenever there is a change to the -+ selection buffer or the clipboard. The source argument indicates which -+ of the two has changed. Only changes by other applications are reported. -+ \note Some systems require polling to monitor the clipboard and may -+ therefore have some delay in detecting changes. -+ */ -+ static void add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data); -+ /** -+ Stop calling the specified callback when there are changes to the selection -+ buffer or the clipboard. -+ */ -+ static void remove_clipboard_notify(Fl_Clipboard_Notify_Handler h); -+ /** - Initiate a Drag And Drop operation. The selection buffer should be - filled with relevant data before calling this method. FLTK will - then initiate the system wide drag and drop handling. Dropped data -diff -up fltk-1.3.x-r8659/src/Fl.cxx.orig fltk-1.3.x-r8659/src/Fl.cxx ---- fltk-1.3.x-r8659/src/Fl.cxx.orig 2011-05-18 15:20:26.667291459 +0200 -+++ fltk-1.3.x-r8659/src/Fl.cxx 2011-05-18 16:31:15.522026086 +0200 -@@ -430,6 +430,69 @@ static char in_idle; - #endif - - //////////////////////////////////////////////////////////////// -+// Clipboard notifications -+ -+struct Clipboard_Notify { -+ Fl_Clipboard_Notify_Handler handler; -+ void *data; -+ struct Clipboard_Notify *next; -+}; -+ -+static struct Clipboard_Notify *clip_notify_list = NULL; -+ -+extern void fl_clipboard_notify_change(); // in Fl_<platform>.cxx -+ -+void Fl::add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data) { -+ struct Clipboard_Notify *node; -+ -+ remove_clipboard_notify(h); -+ -+ node = new Clipboard_Notify; -+ -+ node->handler = h; -+ node->data = data; -+ node->next = clip_notify_list; -+ -+ clip_notify_list = node; -+ -+ fl_clipboard_notify_change(); -+} -+ -+void Fl::remove_clipboard_notify(Fl_Clipboard_Notify_Handler h) { -+ struct Clipboard_Notify *node, **prev; -+ -+ node = clip_notify_list; -+ prev = &clip_notify_list; -+ while (node != NULL) { -+ if (node->handler == h) { -+ *prev = node->next; -+ delete node; -+ -+ fl_clipboard_notify_change(); -+ -+ return; -+ } -+ -+ prev = &node->next; -+ node = node->next; -+ } -+} -+ -+bool fl_clipboard_notify_empty(void) { -+ return clip_notify_list == NULL; -+} -+ -+void fl_trigger_clipboard_notify(int source) { -+ struct Clipboard_Notify *node; -+ -+ node = clip_notify_list; -+ while (node != NULL) { -+ node->handler(source, node->data); -+ node = node->next; -+ } -+} -+ -+//////////////////////////////////////////////////////////////// - // wait/run/check/ready: - - void (*Fl::idle)(); // see Fl::add_idle.cxx for the add/remove functions diff --git a/contrib/fltk/02-str2636-fltk-1.3.x-clipboard-x11.patch b/contrib/fltk/02-str2636-fltk-1.3.x-clipboard-x11.patch deleted file mode 100644 index 9e253a3f..00000000 --- a/contrib/fltk/02-str2636-fltk-1.3.x-clipboard-x11.patch +++ /dev/null @@ -1,355 +0,0 @@ -diff -up fltk-1.3.2/CMakeLists.txt.clp-x11 fltk-1.3.2/CMakeLists.txt ---- fltk-1.3.2/CMakeLists.txt.clp-x11 2012-09-13 16:19:01.000000000 +0200 -+++ fltk-1.3.2/CMakeLists.txt 2013-01-30 15:56:25.810663430 +0100 -@@ -515,6 +515,20 @@ else() - endif(OPTION_USE_XINERAMA) - - ####################################################################### -+if(X11_Xfixes_FOUND) -+ option(OPTION_USE_XFIXES "use lib XFIXES" ON) -+endif(X11_Xfixes_FOUND) -+ -+if(OPTION_USE_XFIXES) -+ set(HAVE_XFIXES ${X11_Xfixes_FOUND}) -+ include_directories(${X11_Xfixes_INCLUDE_PATH}) -+ list(APPEND FLTK_LDLIBS -lXfixes) -+ set(FLTK_XFIXES_FOUND TRUE) -+else() -+ set(FLTK_XFIXES_FOUND FALSE) -+endif(OPTION_USE_XFIXES) -+ -+####################################################################### - if(X11_Xft_FOUND) - option(OPTION_USE_XFT "use lib Xft" ON) - endif(X11_Xft_FOUND) -diff -up fltk-1.3.2/configh.cmake.in.clp-x11 fltk-1.3.2/configh.cmake.in ---- fltk-1.3.2/configh.cmake.in.clp-x11 2011-07-19 06:49:30.000000000 +0200 -+++ fltk-1.3.2/configh.cmake.in 2013-01-30 15:56:25.810663430 +0100 -@@ -108,6 +108,14 @@ - #define USE_XDBE HAVE_XDBE - - /* -+ * HAVE_XFIXES: -+ * -+ * Do we have the X fixes extension? -+ */ -+ -+#cmakedefine01 HAVE_XFIXES -+ -+/* - * __APPLE_QUARTZ__: - * - * If __APPLE_QUARTZ__ is defined, FLTK will be -diff -up fltk-1.3.2/configh.in.clp-x11 fltk-1.3.2/configh.in ---- fltk-1.3.2/configh.in.clp-x11 2011-10-04 11:21:47.000000000 +0200 -+++ fltk-1.3.2/configh.in 2013-01-30 15:56:25.810663430 +0100 -@@ -108,6 +108,14 @@ - #define USE_XDBE HAVE_XDBE - - /* -+ * HAVE_XFIXES: -+ * -+ * Do we have the X fixes extension? -+ */ -+ -+#define HAVE_XFIXES 0 -+ -+/* - * __APPLE_QUARTZ__: - * - * All Apple implementations are now based on Quartz and Cocoa, -diff -up fltk-1.3.2/configure.in.clp-x11 fltk-1.3.2/configure.in ---- fltk-1.3.2/configure.in.clp-x11 2013-01-30 15:56:25.802663573 +0100 -+++ fltk-1.3.2/configure.in 2013-01-30 15:56:25.810663430 +0100 -@@ -999,6 +999,16 @@ case $uname_GUI in - LIBS="-lXext $LIBS") - fi - -+ dnl Check for the Xfixes extension unless disabled... -+ AC_ARG_ENABLE(xfixes, [ --enable-xfixes turn on Xfixes support [default=yes]]) -+ -+ if test x$enable_xfixes != xno; then -+ AC_CHECK_HEADER(X11/extensions/Xfixes.h, AC_DEFINE(HAVE_XFIXES),, -+ [#include <X11/Xlib.h>]) -+ AC_CHECK_LIB(Xfixes, XFixesQueryExtension, -+ LIBS="-lXfixes $LIBS") -+ fi -+ - dnl Check for overlay visuals... - AC_PATH_PROG(XPROP, xprop) - AC_CACHE_CHECK(for X overlay visuals, ac_cv_have_overlay, -diff -up fltk-1.3.2/fluid/CMakeLists.txt.clp-x11 fltk-1.3.2/fluid/CMakeLists.txt -diff -up fltk-1.3.2/src/CMakeLists.txt.clp-x11 fltk-1.3.2/src/CMakeLists.txt ---- fltk-1.3.2/src/CMakeLists.txt.clp-x11 2013-01-30 16:06:00.785430590 +0100 -+++ fltk-1.3.2/src/CMakeLists.txt 2013-01-30 16:06:17.883126642 +0100 -@@ -243,6 +243,10 @@ if(HAVE_XINERAMA) - target_link_libraries(fltk ${X11_Xinerama_LIB}) - endif(HAVE_XINERAMA) - -+if(HAVE_XFIXES) -+ target_link_libraries(fltk ${X11_Xfixes_LIB}) -+endif(HAVE_XFIXES) -+ - if(USE_XFT) - target_link_libraries(fltk ${X11_Xft_LIB}) - endif(USE_XFT) -diff -up fltk-1.3.2/src/Fl_x.cxx.clp-x11 fltk-1.3.2/src/Fl_x.cxx ---- fltk-1.3.2/src/Fl_x.cxx.clp-x11 2013-01-30 15:56:25.793663733 +0100 -+++ fltk-1.3.2/src/Fl_x.cxx 2013-01-30 16:03:37.355981103 +0100 -@@ -53,6 +53,12 @@ static XRRUpdateConfiguration_type XRRUp - static int randrEventBase; // base of RandR-defined events - #endif - -+# if HAVE_XFIXES -+# include <X11/extensions/Xfixes.h> -+static int xfixes_event_base = 0; -+static bool have_xfixes = false; -+# endif -+ - static Fl_Xlib_Graphics_Driver fl_xlib_driver; - static Fl_Display_Device fl_xlib_display(&fl_xlib_driver); - Fl_Display_Device *Fl_Display_Device::_display = &fl_xlib_display;// the platform display -@@ -307,6 +313,9 @@ static Atom WM_PROTOCOLS; - static Atom fl_MOTIF_WM_HINTS; - static Atom TARGETS; - static Atom CLIPBOARD; -+static Atom TIMESTAMP; -+static Atom PRIMARY_TIMESTAMP; -+static Atom CLIPBOARD_TIMESTAMP; - Atom fl_XdndAware; - Atom fl_XdndSelection; - Atom fl_XdndEnter; -@@ -667,6 +676,9 @@ void fl_open_display(Display* d) { - fl_MOTIF_WM_HINTS = XInternAtom(d, "_MOTIF_WM_HINTS", 0); - TARGETS = XInternAtom(d, "TARGETS", 0); - CLIPBOARD = XInternAtom(d, "CLIPBOARD", 0); -+ TIMESTAMP = XInternAtom(d, "TIMESTAMP", 0); -+ PRIMARY_TIMESTAMP = XInternAtom(d, "PRIMARY_TIMESTAMP", 0); -+ CLIPBOARD_TIMESTAMP = XInternAtom(d, "CLIPBOARD_TIMESTAMP", 0); - fl_XdndAware = XInternAtom(d, "XdndAware", 0); - fl_XdndSelection = XInternAtom(d, "XdndSelection", 0); - fl_XdndEnter = XInternAtom(d, "XdndEnter", 0); -@@ -713,6 +725,15 @@ void fl_open_display(Display* d) { - #if !USE_COLORMAP - Fl::visual(FL_RGB); - #endif -+ -+#if HAVE_XFIXES -+ int error_base; -+ if (XFixesQueryExtension(fl_display, &xfixes_event_base, &error_base)) -+ have_xfixes = true; -+ else -+ have_xfixes = false; -+#endif -+ - #if USE_XRANDR - void *libxrandr_addr = dlopen("libXrandr.so.2", RTLD_LAZY); - if (!libxrandr_addr) libxrandr_addr = dlopen("libXrandr.so", RTLD_LAZY); -@@ -901,6 +922,107 @@ void Fl::copy(const char *stuff, int len - } - - //////////////////////////////////////////////////////////////// -+// Code for tracking clipboard changes: -+ -+static Time primary_timestamp = -1; -+static Time clipboard_timestamp = -1; -+ -+extern bool fl_clipboard_notify_empty(void); -+extern void fl_trigger_clipboard_notify(int source); -+ -+static void poll_clipboard_owner(void) { -+ Window xid; -+ -+#if HAVE_XFIXES -+ // No polling needed with Xfixes -+ if (have_xfixes) -+ return; -+#endif -+ -+ // No one is interested, so no point polling -+ if (fl_clipboard_notify_empty()) -+ return; -+ -+ // We need a window for this to work -+ if (!Fl::first_window()) -+ return; -+ xid = fl_xid(Fl::first_window()); -+ if (!xid) -+ return; -+ -+ // Request an update of the selection time for both the primary and -+ // clipboard selections. Magic continues when we get a SelectionNotify. -+ if (!fl_i_own_selection[0]) -+ XConvertSelection(fl_display, XA_PRIMARY, TIMESTAMP, PRIMARY_TIMESTAMP, -+ xid, fl_event_time); -+ if (!fl_i_own_selection[1]) -+ XConvertSelection(fl_display, CLIPBOARD, TIMESTAMP, CLIPBOARD_TIMESTAMP, -+ xid, fl_event_time); -+} -+ -+static void clipboard_timeout(void *data) -+{ -+ // No one is interested, so stop polling -+ if (fl_clipboard_notify_empty()) -+ return; -+ -+ poll_clipboard_owner(); -+ -+ Fl::repeat_timeout(0.5, clipboard_timeout); -+} -+ -+static void handle_clipboard_timestamp(int clipboard, Time time) -+{ -+ Time *timestamp; -+ -+ timestamp = clipboard ? &clipboard_timestamp : &primary_timestamp; -+ -+#if HAVE_XFIXES -+ if (!have_xfixes) -+#endif -+ { -+ // Initial scan, just store the value -+ if (*timestamp == (Time)-1) { -+ *timestamp = time; -+ return; -+ } -+ } -+ -+ // Same selection -+ if (time == *timestamp) -+ return; -+ -+ *timestamp = time; -+ -+ // The clipboard change is the event that caused us to request -+ // the clipboard data, so use that time as the latest event. -+ if (time > fl_event_time) -+ fl_event_time = time; -+ -+ // Something happened! Let's tell someone! -+ fl_trigger_clipboard_notify(clipboard); -+} -+ -+void fl_clipboard_notify_change() { -+ // Reset the timestamps if we've going idle so that you don't -+ // get a bogus immediate trigger next time they're activated. -+ if (fl_clipboard_notify_empty()) { -+ primary_timestamp = -1; -+ clipboard_timestamp = -1; -+ } else { -+#if HAVE_XFIXES -+ if (!have_xfixes) -+#endif -+ { -+ poll_clipboard_owner(); -+ -+ if (!Fl::has_timeout(clipboard_timeout)) -+ Fl::add_timeout(0.5, clipboard_timeout); -+ } -+ } -+} -+ -+//////////////////////////////////////////////////////////////// - - const XEvent* fl_xevent; // the current x event - ulong fl_event_time; // the last timestamp from an x event -@@ -1024,7 +1141,6 @@ int fl_handle(const XEvent& thisevent) - return 0; - - case SelectionNotify: { -- if (!fl_selection_requestor) return 0; - static unsigned char* buffer = 0; - if (buffer) {XFree(buffer); buffer = 0;} - long bytesread = 0; -@@ -1040,6 +1156,19 @@ int fl_handle(const XEvent& thisevent) - bytesread/4, 65536, 1, 0, - &actual, &format, &count, &remaining, - &portion)) break; // quit on error -+ -+ if ((fl_xevent->xselection.property == PRIMARY_TIMESTAMP) || -+ (fl_xevent->xselection.property == CLIPBOARD_TIMESTAMP)) { -+ if (portion && format == 32 && count == 1) { -+ Time t = *(unsigned int*)portion; -+ if (fl_xevent->xselection.property == CLIPBOARD_TIMESTAMP) -+ handle_clipboard_timestamp(1, t); -+ else -+ handle_clipboard_timestamp(0, t); -+ } -+ return true; -+ } -+ - if (actual == TARGETS || actual == XA_ATOM) { - Atom type = XA_STRING; - for (unsigned i = 0; i<count; i++) { -@@ -1076,6 +1205,9 @@ int fl_handle(const XEvent& thisevent) - buffer[bytesread] = 0; - convert_crlf(buffer, bytesread); - } -+ -+ if (!fl_selection_requestor) return 0; -+ - Fl::e_text = buffer ? (char*)buffer : (char *)""; - Fl::e_length = bytesread; - int old_event = Fl::e_number; -@@ -1096,6 +1228,7 @@ int fl_handle(const XEvent& thisevent) - case SelectionClear: { - int clipboard = fl_xevent->xselectionclear.selection == CLIPBOARD; - fl_i_own_selection[clipboard] = 0; -+ poll_clipboard_owner(); - return 1;} - - case SelectionRequest: { -@@ -1308,6 +1441,9 @@ int fl_handle(const XEvent& thisevent) - case FocusIn: - if (fl_xim_ic) XSetICFocus(fl_xim_ic); - event = FL_FOCUS; -+ // If the user has toggled from another application to this one, -+ // then it's a good time to check for clipboard changes. -+ poll_clipboard_owner(); - break; - - case FocusOut: -@@ -1676,6 +1812,25 @@ int fl_handle(const XEvent& thisevent) - } - } - -+#if HAVE_XFIXES -+ switch (xevent.type - xfixes_event_base) { -+ case XFixesSelectionNotify: { -+ // Someone feeding us bogus events? -+ if (!have_xfixes) -+ return true; -+ -+ XFixesSelectionNotifyEvent *selection_notify = (XFixesSelectionNotifyEvent *)&xevent; -+ -+ if ((selection_notify->selection == XA_PRIMARY) && !fl_i_own_selection[0]) -+ handle_clipboard_timestamp(0, selection_notify->selection_timestamp); -+ else if ((selection_notify->selection == CLIPBOARD) && !fl_i_own_selection[1]) -+ handle_clipboard_timestamp(1, selection_notify->selection_timestamp); -+ -+ return true; -+ } -+ } -+#endif -+ - return Fl::handle(event, window); - } - -@@ -1995,6 +2150,16 @@ void Fl_X::make_xid(Fl_Window* win, XVis - XChangeProperty(fl_display, xp->xid, net_wm_type, XA_ATOM, 32, PropModeReplace, (unsigned char*)&net_wm_type_kind, 1); - } - -+#if HAVE_XFIXES -+ // register for clipboard change notifications -+ if (have_xfixes && !win->parent()) { -+ XFixesSelectSelectionInput(fl_display, xp->xid, XA_PRIMARY, -+ XFixesSetSelectionOwnerNotifyMask); -+ XFixesSelectSelectionInput(fl_display, xp->xid, CLIPBOARD, -+ XFixesSetSelectionOwnerNotifyMask); -+ } -+#endif -+ - XMapWindow(fl_display, xp->xid); - if (showit) { - win->set_visible(); -diff -up fltk-1.3.2/test/CMakeLists.txt.clp-x11 fltk-1.3.2/test/CMakeLists.txt diff --git a/contrib/fltk/03-str2636-fltk-1.3.x-clipboard-win32-fix.patch b/contrib/fltk/03-str2636-fltk-1.3.x-clipboard-win32-fix.patch deleted file mode 100644 index b41af794..00000000 --- a/contrib/fltk/03-str2636-fltk-1.3.x-clipboard-win32-fix.patch +++ /dev/null @@ -1,135 +0,0 @@ -diff -ur fltk-1.3.0r9110.org/src/Fl_win32.cxx fltk-1.3.0r9110/src/Fl_win32.cxx ---- fltk-1.3.0r9110.org/src/Fl_win32.cxx 2012-06-17 19:42:02.169422400 +0200 -+++ fltk-1.3.0r9110/src/Fl_win32.cxx 2012-06-17 19:43:38.286031455 +0200 -@@ -543,6 +543,37 @@ - const char* GetValue() const { return(out); } - }; - -+void fl_update_clipboard(void) { -+ Fl_Window *w1 = Fl::first_window(); -+ if (!w1) -+ return; -+ -+ HWND hwnd = fl_xid(w1); -+ -+ if (!OpenClipboard(hwnd)) -+ return; -+ -+ EmptyClipboard(); -+ -+ int utf16_len = fl_utf8toUtf16(fl_selection_buffer[1], -+ fl_selection_length[1], 0, 0); -+ -+ HGLOBAL hMem = GlobalAlloc(GHND, utf16_len * 2 + 2); // moveable and zero'ed mem alloc. -+ LPVOID memLock = GlobalLock(hMem); -+ -+ fl_utf8toUtf16(fl_selection_buffer[1], fl_selection_length[1], -+ (unsigned short*) memLock, utf16_len + 1); -+ -+ GlobalUnlock(hMem); -+ SetClipboardData(CF_UNICODETEXT, hMem); -+ -+ CloseClipboard(); -+ -+ // In case Windows managed to lob of a WM_DESTROYCLIPBOARD during -+ // the above. -+ fl_i_own_selection[1] = 1; -+} -+ - // call this when you create a selection: - void Fl::copy(const char *stuff, int len, int clipboard) { - if (!stuff || len<0) return; -@@ -560,25 +591,9 @@ - memcpy(fl_selection_buffer[clipboard], stuff, len); - fl_selection_buffer[clipboard][len] = 0; // needed for direct paste - fl_selection_length[clipboard] = len; -- if (clipboard) { -- // set up for "delayed rendering": -- if (OpenClipboard(NULL)) { -- // if the system clipboard works, use it -- int utf16_len = fl_utf8toUtf16(fl_selection_buffer[clipboard], fl_selection_length[clipboard], 0, 0); -- EmptyClipboard(); -- HGLOBAL hMem = GlobalAlloc(GHND, utf16_len * 2 + 2); // moveable and zero'ed mem alloc. -- LPVOID memLock = GlobalLock(hMem); -- fl_utf8toUtf16(fl_selection_buffer[clipboard], fl_selection_length[clipboard], (unsigned short*) memLock, utf16_len + 1); -- GlobalUnlock(hMem); -- SetClipboardData(CF_UNICODETEXT, hMem); -- CloseClipboard(); -- GlobalFree(hMem); -- fl_i_own_selection[clipboard] = 0; -- } else { -- // only if it fails, instruct paste() to use the internal buffers -- fl_i_own_selection[clipboard] = 1; -- } -- } -+ fl_i_own_selection[clipboard] = 1; -+ if (clipboard) -+ fl_update_clipboard(); - } - - // Call this when a "paste" operation happens: -@@ -1307,33 +1322,6 @@ - fl_i_own_selection[1] = 0; - return 1; - -- case WM_RENDERALLFORMATS: -- fl_i_own_selection[1] = 0; -- // Windoze seems unhappy unless I do these two steps. Documentation -- // seems to vary on whether opening the clipboard is necessary or -- // is in fact wrong: -- CloseClipboard(); -- OpenClipboard(NULL); -- // fall through... -- case WM_RENDERFORMAT: { -- HANDLE h; -- --// int l = fl_utf_nb_char((unsigned char*)fl_selection_buffer[1], fl_selection_length[1]); -- int l = fl_utf8toUtf16(fl_selection_buffer[1], fl_selection_length[1], NULL, 0); // Pass NULL buffer to query length required -- h = GlobalAlloc(GHND, (l+1) * sizeof(unsigned short)); -- if (h) { -- unsigned short *g = (unsigned short*) GlobalLock(h); --// fl_utf2unicode((unsigned char *)fl_selection_buffer[1], fl_selection_length[1], (xchar*)g); -- l = fl_utf8toUtf16(fl_selection_buffer[1], fl_selection_length[1], g, (l+1)); -- g[l] = 0; -- GlobalUnlock(h); -- SetClipboardData(CF_UNICODETEXT, h); -- } -- -- // Windoze also seems unhappy if I don't do this. Documentation very -- // unclear on what is correct: -- if (fl_msg.message == WM_RENDERALLFORMATS) CloseClipboard(); -- return 1;} - case WM_DISPLAYCHANGE: // occurs when screen configuration (number, position) changes - Fl::call_screen_init(); - Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL); -diff -ur fltk-1.3.0r9110.org/src/Fl.cxx fltk-1.3.0r9110/src/Fl.cxx ---- fltk-1.3.0r9110.org/src/Fl.cxx 2012-06-17 19:42:02.173422595 +0200 -+++ fltk-1.3.0r9110/src/Fl.cxx 2012-06-17 19:42:02.317429497 +0200 -@@ -1420,7 +1420,9 @@ - //////////////////////////////////////////////////////////////// - // hide() destroys the X window, it does not do unmap! - --#if !defined(WIN32) && USE_XFT -+#if defined(WIN32) -+extern void fl_update_clipboard(void); -+#elif USE_XFT - extern void fl_destroy_xft_draw(Window); - #endif - -@@ -1467,14 +1469,8 @@ - #if defined(WIN32) - // this little trick keeps the current clipboard alive, even if we are about - // to destroy the window that owns the selection. -- if (GetClipboardOwner()==ip->xid) { -- Fl_Window *w1 = Fl::first_window(); -- if (w1 && OpenClipboard(fl_xid(w1))) { -- EmptyClipboard(); -- SetClipboardData(CF_TEXT, NULL); -- CloseClipboard(); -- } -- } -+ if (GetClipboardOwner()==ip->xid) -+ fl_update_clipboard(); - // Send a message to myself so that I'll get out of the event loop... - PostMessage(ip->xid, WM_APP, 0, 0); - if (ip->private_dc) fl_release_dc(ip->xid, ip->private_dc); diff --git a/contrib/fltk/04-str2636-fltk-1.3.x-clipboard-win32.patch b/contrib/fltk/04-str2636-fltk-1.3.x-clipboard-win32.patch deleted file mode 100644 index ac94779c..00000000 --- a/contrib/fltk/04-str2636-fltk-1.3.x-clipboard-win32.patch +++ /dev/null @@ -1,99 +0,0 @@ -diff -ur fltk-1.3.0r9110.org/src/Fl.cxx fltk-1.3.0r9110/src/Fl.cxx ---- fltk-1.3.0r9110.org/src/Fl.cxx 2012-06-17 19:47:09.988183253 +0200 -+++ fltk-1.3.0r9110/src/Fl.cxx 2012-06-17 19:47:10.127189919 +0200 -@@ -1421,6 +1421,7 @@ - // hide() destroys the X window, it does not do unmap! - - #if defined(WIN32) -+extern void fl_clipboard_notify_untarget(HWND wnd); - extern void fl_update_clipboard(void); - #elif USE_XFT - extern void fl_destroy_xft_draw(Window); -@@ -1471,6 +1472,8 @@ - // to destroy the window that owns the selection. - if (GetClipboardOwner()==ip->xid) - fl_update_clipboard(); -+ // Make sure we unlink this window from the clipboard chain -+ fl_clipboard_notify_untarget(ip->xid); - // Send a message to myself so that I'll get out of the event loop... - PostMessage(ip->xid, WM_APP, 0, 0); - if (ip->private_dc) fl_release_dc(ip->xid, ip->private_dc); -diff -ur fltk-1.3.0r9110.org/src/Fl_win32.cxx fltk-1.3.0r9110/src/Fl_win32.cxx ---- fltk-1.3.0r9110.org/src/Fl_win32.cxx 2012-06-17 19:47:09.987183205 +0200 -+++ fltk-1.3.0r9110/src/Fl_win32.cxx 2012-06-17 19:47:19.069618739 +0200 -@@ -646,6 +646,38 @@ - } - } - -+static HWND clipboard_wnd = 0; -+static HWND next_clipboard_wnd = 0; -+ -+static bool initial_clipboard = true; -+ -+void fl_clipboard_notify_change() { -+ // No need to do anything here... -+} -+ -+void fl_clipboard_notify_target(HWND wnd) { -+ if (clipboard_wnd) -+ return; -+ -+ // We get one fake WM_DRAWCLIPBOARD immediately, which we therefore -+ // need to ignore. -+ initial_clipboard = true; -+ -+ clipboard_wnd = wnd; -+ next_clipboard_wnd = SetClipboardViewer(wnd); -+} -+ -+void fl_clipboard_notify_untarget(HWND wnd) { -+ if (wnd != clipboard_wnd) -+ return; -+ -+ ChangeClipboardChain(wnd, next_clipboard_wnd); -+ clipboard_wnd = next_clipboard_wnd = 0; -+ -+ if (Fl::first_window()) -+ fl_clipboard_notify_target(fl_xid(Fl::first_window())); -+} -+ - //////////////////////////////////////////////////////////////// - char fl_is_ime = 0; - void fl_get_codepage() -@@ -1327,6 +1359,27 @@ - Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL); - return 0; - -+ case WM_CHANGECBCHAIN: -+ if ((hWnd == clipboard_wnd) && -+ (next_clipboard_wnd == (HWND)wParam)) { -+ next_clipboard_wnd = (HWND)lParam; -+ return 0; -+ } -+ break; -+ -+ case WM_DRAWCLIPBOARD: -+ // When the clipboard moves between two FLTK windows, -+ // fl_i_own_selection will temporarily be false as we are -+ // processing this message. Hence the need to use fl_find(). -+ if (!initial_clipboard && !fl_find(GetClipboardOwner())) -+ fl_trigger_clipboard_notify(1); -+ initial_clipboard = false; -+ -+ if (next_clipboard_wnd) -+ SendMessage(next_clipboard_wnd, WM_DRAWCLIPBOARD, wParam, lParam); -+ -+ return 0; -+ - default: - if (Fl::handle(0,0)) return 0; - break; -@@ -1685,6 +1738,8 @@ - x->next = Fl_X::first; - Fl_X::first = x; - -+ fl_clipboard_notify_target(x->xid); -+ - x->wait_for_expose = 1; - if (fl_show_iconic) {showit = 0; fl_show_iconic = 0;} - if (showit) { diff --git a/contrib/fltk/05-str2636-fltk-1.3.x-clipboard-osx.patch b/contrib/fltk/05-str2636-fltk-1.3.x-clipboard-osx.patch deleted file mode 100644 index 22e69396..00000000 --- a/contrib/fltk/05-str2636-fltk-1.3.x-clipboard-osx.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff -bur fltk-1.3.0r9619.org/src/Fl_cocoa.mm fltk-1.3.0r9619/src/Fl_cocoa.mm ---- fltk-1.3.0r9619.org/src/Fl_cocoa.mm 2012-06-18 19:24:30.971688769 +0200 -+++ fltk-1.3.0r9619/src/Fl_cocoa.mm 2012-06-18 19:25:25.700310375 +0200 -@@ -1319,9 +1319,13 @@ - } - @end - -+static void clipboard_check(void); -+ - @implementation FLApplication - + (void)sendEvent:(NSEvent *)theEvent - { -+ // update clipboard status -+ clipboard_check(); - NSEventType type = [theEvent type]; - if (type == NSLeftMouseDown) { - fl_lock_function(); -@@ -2790,6 +2794,26 @@ - PasteboardCreate(kPasteboardClipboard, &myPasteboard); - } - -+extern void fl_trigger_clipboard_notify(int source); -+ -+void fl_clipboard_notify_change() { -+ // No need to do anything here... -+} -+ -+static void clipboard_check(void) -+{ -+ PasteboardSyncFlags flags; -+ -+ allocatePasteboard(); -+ flags = PasteboardSynchronize(myPasteboard); -+ -+ if (!(flags & kPasteboardModified)) -+ return; -+ if (flags & kPasteboardClientIsOwner) -+ return; -+ -+ fl_trigger_clipboard_notify(1); -+} - - /* - * create a selection diff --git a/contrib/fltk/06-str2659-pixmap.patch b/contrib/fltk/06-str2659-pixmap.patch deleted file mode 100644 index 30315138..00000000 --- a/contrib/fltk/06-str2659-pixmap.patch +++ /dev/null @@ -1,554 +0,0 @@ -diff -ur fltk-1.3.2.org/FL/Fl_Image.H fltk-1.3.2/FL/Fl_Image.H ---- fltk-1.3.2.org/FL/Fl_Image.H 2012-11-09 17:02:08.000000000 +0100 -+++ fltk-1.3.2/FL/Fl_Image.H 2013-01-16 14:40:51.543230638 +0100 -@@ -26,6 +26,7 @@ - #include <stdlib.h> - - class Fl_Widget; -+class Fl_Pixmap; - struct Fl_Menu_Item; - struct Fl_Label; - -@@ -203,6 +204,7 @@ - */ - Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0) : - Fl_Image(W,H,D), array(bits), alloc_array(0), id_(0), mask_(0) {data((const char **)&array, 1); ld(LD);} -+ Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg=FL_GRAY); - virtual ~Fl_RGB_Image(); - virtual Fl_Image *copy(int W, int H); - Fl_Image *copy() { return copy(w(), h()); } -diff -ur fltk-1.3.2.org/src/fl_draw_pixmap.cxx fltk-1.3.2/src/fl_draw_pixmap.cxx ---- fltk-1.3.2.org/src/fl_draw_pixmap.cxx 2012-04-22 05:09:31.000000000 +0200 -+++ fltk-1.3.2/src/fl_draw_pixmap.cxx 2013-01-16 14:40:51.542230588 +0100 -@@ -58,99 +58,6 @@ - return 1; - } - --#ifdef U64 -- --// The callback from fl_draw_image to get a row of data passes this: --struct pixmap_data { -- int w, h; -- const uchar*const* data; -- union { -- U64 colors[256]; -- U64* byte1[256]; -- }; --}; -- --// callback for 1 byte per pixel: --static void cb1(void*v, int x, int y, int w, uchar* buf) { -- pixmap_data& d = *(pixmap_data*)v; -- const uchar* p = d.data[y]+x; -- U64* q = (U64*)buf; -- for (int X=w; X>0; X-=2, p += 2) { -- if (X>1) { --# if WORDS_BIGENDIAN -- *q++ = (d.colors[p[0]]<<32) | d.colors[p[1]]; --# else -- *q++ = (d.colors[p[1]]<<32) | d.colors[p[0]]; --# endif -- } else { --# if WORDS_BIGENDIAN -- *q++ = d.colors[p[0]]<<32; --# else -- *q++ = d.colors[p[0]]; --# endif -- } -- } --} -- --// callback for 2 bytes per pixel: --static void cb2(void*v, int x, int y, int w, uchar* buf) { -- pixmap_data& d = *(pixmap_data*)v; -- const uchar* p = d.data[y]+2*x; -- U64* q = (U64*)buf; -- for (int X=w; X>0; X-=2) { -- U64* colors = d.byte1[*p++]; -- int index = *p++; -- if (X>1) { -- U64* colors1 = d.byte1[*p++]; -- int index1 = *p++; --# if WORDS_BIGENDIAN -- *q++ = (colors[index]<<32) | colors1[index1]; --# else -- *q++ = (colors1[index1]<<32) | colors[index]; --# endif -- } else { --# if WORDS_BIGENDIAN -- *q++ = colors[index]<<32; --# else -- *q++ = colors[index]; --# endif -- } -- } --} -- --#else // U32 -- --// The callback from fl_draw_image to get a row of data passes this: --struct pixmap_data { -- int w, h; -- const uchar*const* data; -- union { -- U32 colors[256]; -- U32* byte1[256]; -- }; --}; -- --// callback for 1 byte per pixel: --static void cb1(void*v, int x, int y, int w, uchar* buf) { -- pixmap_data& d = *(pixmap_data*)v; -- const uchar* p = d.data[y]+x; -- U32* q = (U32*)buf; -- for (int X=w; X--;) *q++ = d.colors[*p++]; --} -- --// callback for 2 bytes per pixel: --static void cb2(void*v, int x, int y, int w, uchar* buf) { -- pixmap_data& d = *(pixmap_data*)v; -- const uchar* p = d.data[y]+2*x; -- U32* q = (U32*)buf; -- for (int X=w; X--;) { -- U32* colors = d.byte1[*p++]; -- *q++ = colors[*p++]; -- } --} -- --#endif // U64 else U32 -- - uchar **fl_mask_bitmap; // if non-zero, create bitmap and store pointer here - - /** -@@ -200,34 +107,33 @@ - } - #endif - --/** -- Draw XPM image data, with the top-left corner at the given position. -- \see fl_draw_pixmap(char* const* data, int x, int y, Fl_Color bg) -- */ --int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) { -- pixmap_data d; -- if (!fl_measure_pixmap(cdata, d.w, d.h)) return 0; -+int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg) { -+ int w, h; - const uchar*const* data = (const uchar*const*)(cdata+1); - int transparent_index = -1; -+ -+ if (!fl_measure_pixmap(cdata, w, h)) -+ return 0; -+ -+ if ((chars_per_pixel < 1) || (chars_per_pixel > 2)) -+ return 0; -+ -+ uchar colors[1<<(chars_per_pixel*8)][4]; -+ - #ifdef WIN32 - uchar *transparent_c = (uchar *)0; // such that transparent_c[0,1,2] are the RGB of the transparent color - color_count = 0; - used_colors = (uchar *)malloc(abs(ncolors)*3*sizeof(uchar)); - #endif - -- if (ncolors < 0) { // FLTK (non standard) compressed colormap -+ if (ncolors < 0) { -+ // FLTK (non standard) compressed colormap - ncolors = -ncolors; - const uchar *p = *data++; - // if first color is ' ' it is transparent (put it later to make - // it not be transparent): - if (*p == ' ') { -- uchar* c = (uchar*)&d.colors[(int)' ']; --#ifdef U64 -- *(U64*)c = 0; --# if WORDS_BIGENDIAN -- c += 4; --# endif --#endif -+ uchar* c = colors[(int)' ']; - transparent_index = ' '; - Fl::get_color(bg, c[0], c[1], c[2]); c[3] = 0; - #ifdef WIN32 -@@ -238,13 +144,7 @@ - } - // read all the rest of the colors: - for (int i=0; i < ncolors; i++) { -- uchar* c = (uchar*)&d.colors[*p++]; --#ifdef U64 -- *(U64*)c = 0; --# if WORDS_BIGENDIAN -- c += 4; --# endif --#endif -+ uchar* c = colors[*p++]; - #ifdef WIN32 - used_colors[3*color_count] = *p; - used_colors[3*color_count+1] = *(p+1); -@@ -254,69 +154,44 @@ - *c++ = *p++; - *c++ = *p++; - *c++ = *p++; --#ifdef __APPLE_QUARTZ__ - *c = 255; --#else -- *c = 0; --#endif - } -- } else { // normal XPM colormap with names -- if (chars_per_pixel>1) memset(d.byte1, 0, sizeof(d.byte1)); -+ } else { -+ // normal XPM colormap with names - for (int i=0; i<ncolors; i++) { - const uchar *p = *data++; - // the first 1 or 2 characters are the color index: - int ind = *p++; - uchar* c; -- if (chars_per_pixel>1) { --#ifdef U64 -- U64* colors = d.byte1[ind]; -- if (!colors) colors = d.byte1[ind] = new U64[256]; --#else -- U32* colors = d.byte1[ind]; -- if (!colors) colors = d.byte1[ind] = new U32[256]; --#endif -- c = (uchar*)&colors[*p]; -- ind = (ind<<8)|*p++; -- } else { -- c = (uchar *)&d.colors[ind]; -- } -+ if (chars_per_pixel>1) -+ ind = (ind<<8)|*p++; -+ c = colors[ind]; - // look for "c word", or last word if none: - const uchar *previous_word = p; - for (;;) { -- while (*p && isspace(*p)) p++; -- uchar what = *p++; -- while (*p && !isspace(*p)) p++; -- while (*p && isspace(*p)) p++; -- if (!*p) {p = previous_word; break;} -- if (what == 'c') break; -- previous_word = p; -- while (*p && !isspace(*p)) p++; -+ while (*p && isspace(*p)) p++; -+ uchar what = *p++; -+ while (*p && !isspace(*p)) p++; -+ while (*p && isspace(*p)) p++; -+ if (!*p) {p = previous_word; break;} -+ if (what == 'c') break; -+ previous_word = p; -+ while (*p && !isspace(*p)) p++; - } --#ifdef U64 -- *(U64*)c = 0; --# if WORDS_BIGENDIAN -- c += 4; --# endif --#endif --#ifdef __APPLE_QUARTZ__ -- c[3] = 255; --#endif - int parse = fl_parse_color((const char*)p, c[0], c[1], c[2]); -+ c[3] = 255; - if (parse) { - #ifdef WIN32 -- used_colors[3*color_count] = c[0]; -- used_colors[3*color_count+1] = c[1]; -- used_colors[3*color_count+2] = c[2]; -- color_count++; -+ used_colors[3*color_count] = c[0]; -+ used_colors[3*color_count+1] = c[1]; -+ used_colors[3*color_count+2] = c[2]; -+ color_count++; - #endif -- } -- else { -+ } else { - // assume "None" or "#transparent" for any errors -- // "bg" should be transparent... -- Fl::get_color(bg, c[0], c[1], c[2]); --#ifdef __APPLE_QUARTZ__ -+ // "bg" should be transparent... -+ Fl::get_color(bg, c[0], c[1], c[2]); - c[3] = 0; --#endif - transparent_index = ind; - #ifdef WIN32 - transparent_c = c; -@@ -324,7 +199,6 @@ - } - } - } -- d.data = data; - #ifdef WIN32 - if (transparent_c) { - make_unused_color(transparent_c[0], transparent_c[1], transparent_c[2]); -@@ -334,77 +208,76 @@ - make_unused_color(r, g, b); - } - #endif -+ -+ U32 *q = (U32*)out; -+ for (int Y = 0; Y < h; Y++) { -+ const uchar* p = data[Y]; -+ if (chars_per_pixel <= 1) { -+ for (int X = 0; X < w; X++) -+ memcpy(q++, colors[*p++], 4); -+ } else { -+ for (int X = 0; X < w; X++) { -+ int ind = (*p++)<<8; -+ ind |= *p++; -+ memcpy(q++, colors[ind], 4); -+ } -+ } -+ } - -+ return 1; -+} -+ -+/** -+ Draw XPM image data, with the top-left corner at the given position. -+ \see fl_draw_pixmap(char* const* data, int x, int y, Fl_Color bg) -+ */ -+int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) { -+ int w, h; -+ -+ if (!fl_measure_pixmap(cdata, w, h)) -+ return 0; -+ -+ uchar buffer[w*h*4]; -+ -+ if (!fl_convert_pixmap(cdata, buffer, bg)) -+ return 0; -+ -+ // FIXME: Hack until fl_draw_image() supports alpha properly - #ifdef __APPLE_QUARTZ__ - if (Fl_Surface_Device::surface() == Fl_Display_Device::display_device()) { -- U32 *array = new U32[d.w * d.h], *q = array; -- for (int Y = 0; Y < d.h; Y++) { -- const uchar* p = data[Y]; -- if (chars_per_pixel <= 1) { -- for (int X = 0; X < d.w; X++) { -- *q++ = d.colors[*p++]; -- } -- } else { -- for (int X = 0; X < d.w; X++) { -- U32* colors = (U32*)d.byte1[*p++]; -- *q++ = colors[*p++]; -- } -- } -- } -- Fl_RGB_Image* rgb = new Fl_RGB_Image((uchar*)array, d.w, d.h, 4); -+ Fl_RGB_Image* rgb = new Fl_RGB_Image(buffer, w, h, 4); - rgb->draw(x, y); - delete rgb; -- delete[] array; -- } -- else { -+ } else { - #endif // __APPLE_QUARTZ__ -- - // build the mask bitmap used by Fl_Pixmap: -- if (fl_mask_bitmap && transparent_index >= 0) { -- int W = (d.w+7)/8; -- uchar* bitmap = new uchar[W * d.h]; -+ if (fl_mask_bitmap) { -+ int W = (w+7)/8; -+ uchar* bitmap = new uchar[W * h]; - *fl_mask_bitmap = bitmap; -- for (int Y = 0; Y < d.h; Y++) { -- const uchar* p = data[Y]; -- if (chars_per_pixel <= 1) { -- int dw = d.w; -- for (int X = 0; X < W; X++) { -- uchar b = (dw-->0 && *p++ != transparent_index); -- if (dw-->0 && *p++ != transparent_index) b |= 2; -- if (dw-->0 && *p++ != transparent_index) b |= 4; -- if (dw-->0 && *p++ != transparent_index) b |= 8; -- if (dw-->0 && *p++ != transparent_index) b |= 16; -- if (dw-->0 && *p++ != transparent_index) b |= 32; -- if (dw-->0 && *p++ != transparent_index) b |= 64; -- if (dw-->0 && *p++ != transparent_index) b |= 128; -+ const uchar *p = &buffer[3]; -+ uchar b = 0; -+ for (int Y = 0; Y < h; Y++) { -+ b = 0; -+ for (int X = 0, bit = 1; X < w; X++, p += 4) { -+ if (*p > 127) b |= bit; -+ bit <<= 1; -+ if (bit > 0x80 || X == w-1) { - *bitmap++ = b; -- } -- } else { -- uchar b = 0, bit = 1; -- for (int X = 0; X < d.w; X++) { -- int ind = *p++; -- ind = (ind<<8) | (*p++); -- if (ind != transparent_index) b |= bit; -- -- if (bit < 128) bit <<= 1; -- else { -- *bitmap++ = b; -- b = 0; -- bit = 1; -+ bit = 1; -+ b = 0; - } - } -- -- if (bit > 1) *bitmap++ = b; - } -- } -+ - } - -- fl_draw_image(chars_per_pixel==1 ? cb1 : cb2, &d, x, y, d.w, d.h, 4); -+ fl_draw_image(buffer, x, y, w, h, 4); -+ - #ifdef __APPLE_QUARTZ__ - } - #endif - -- if (chars_per_pixel > 1) for (int i = 0; i < 256; i++) delete[] d.byte1[i]; - return 1; - } - -diff -ur fltk-1.3.2.org/src/Fl_Image.cxx fltk-1.3.2/src/Fl_Image.cxx ---- fltk-1.3.2.org/src/Fl_Image.cxx 2012-11-09 17:02:08.000000000 +0100 -+++ fltk-1.3.2/src/Fl_Image.cxx 2013-01-16 14:41:38.404162795 +0100 -@@ -165,7 +165,22 @@ - // - size_t Fl_RGB_Image::max_size_ = ~((size_t)0); - --/** The destructor free all memory and server resources that are used by the image. */ -+int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg); -+ -+/** The constructor creates a new RGBA image from the specified Fl_Pixmap. -+ -+ The RGBA image is built fully opaque except for the transparent area -+ of the pixmap that is assigned the \par bg color with full transparency */ -+Fl_RGB_Image::Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg): -+ Fl_Image(pxm->w(), pxm->h(), 4), id_(0), mask_(0) -+{ -+ array = new uchar[w() * h() * d()]; -+ alloc_array = 1; -+ fl_convert_pixmap(pxm->data(), (uchar*)array, bg); -+ data((const char **)&array, 1); -+} -+ -+/** The destructor frees all memory and server resources that are used by the image. */ - Fl_RGB_Image::~Fl_RGB_Image() { - uncache(); - if (alloc_array) delete[] (uchar *)array; -diff -ur fltk-1.3.2.org/src/ps_image.cxx fltk-1.3.2/src/ps_image.cxx ---- fltk-1.3.2.org/src/ps_image.cxx 2011-07-19 06:49:30.000000000 +0200 -+++ fltk-1.3.2/src/ps_image.cxx 2013-01-16 14:40:51.541228080 +0100 -@@ -185,72 +185,38 @@ - - extern uchar **fl_mask_bitmap; - -+struct callback_data { -+ const uchar *data; -+ int D, LD; -+}; - --void Fl_PostScript_Graphics_Driver::draw_image(const uchar *data, int ix, int iy, int iw, int ih, int D, int LD) { -- double x = ix, y = iy, w = iw, h = ih; - -- if (D<3){ //mono -- draw_image_mono(data, ix, iy, iw, ih, D, LD); -- return; -- } -+static void draw_image_cb(void *data, int x, int y, int w, uchar *buf) { -+ struct callback_data *cb_data; -+ const uchar *curdata; - -+ cb_data = (struct callback_data*)data; -+ curdata = cb_data->data + x*cb_data->D + y*cb_data->LD; - -- int i,j, k; -+ memcpy(buf, curdata, w*cb_data->D); -+} - -- fprintf(output,"save\n"); - -- const char * interpol; -- if (lang_level_>1){ -- if (interpolate_) -- interpol="true"; -- else -- interpol="false"; -- if (mask && lang_level_>2) -- fprintf(output, "%g %g %g %g %i %i %i %i %s CIM\n", x , y+h , w , -h , iw , ih, mx, my, interpol); -- else -- fprintf(output, "%g %g %g %g %i %i %s CII\n", x , y+h , w , -h , iw , ih, interpol); -- } else -- fprintf(output , "%g %g %g %g %i %i CI", x , y+h , w , -h , iw , ih); -+void Fl_PostScript_Graphics_Driver::draw_image(const uchar *data, int ix, int iy, int iw, int ih, int D, int LD) { -+ if (D<3){ //mono -+ draw_image_mono(data, ix, iy, iw, ih, D, LD); -+ return; -+ } - -+ struct callback_data cb_data; - - if (!LD) LD = iw*D; -- uchar *curmask=mask; -- -- for (j=0; j<ih;j++){ -- if (mask){ -- -- for (k=0;k<my/ih;k++){ -- for (i=0; i<((mx+7)/8);i++){ -- if (!(i%80)) fprintf(output, "\n"); -- fprintf(output, "%.2x",swap_byte(*curmask)); -- curmask++; -- } -- fprintf(output,"\n"); -- } -- } -- const uchar *curdata=data+j*LD; -- for (i=0 ; i<iw ; i++) { -- uchar r = curdata[0]; -- uchar g = curdata[1]; -- uchar b = curdata[2]; -- if (lang_level_<3 && D>3) { //can do mixing using bg_* colors) -- unsigned int a2 = curdata[3]; //must be int -- unsigned int a = 255-a2; -- r = (a2 * r + bg_r * a)/255; -- g = (a2 * g + bg_g * a)/255; -- b = (a2 * b + bg_b * a)/255; -- } -- if (!(i%40)) fprintf(output, "\n"); -- fprintf(output, "%.2x%.2x%.2x", r, g, b); -- curdata +=D; -- } -- fprintf(output,"\n"); -- -- } -- -- fprintf(output," >\nrestore\n" ); - -+ cb_data.data = data; -+ cb_data.D = D; -+ cb_data.LD = LD; - -+ draw_image(draw_image_cb, &cb_data, ix, iy, iw, ih, D); - } - - void Fl_PostScript_Graphics_Driver::draw_image(Fl_Draw_Image_Cb call, void *data, int ix, int iy, int iw, int ih, int D) { -@@ -325,6 +291,14 @@ - uchar g = curdata[1]; - uchar b = curdata[2]; - -+ if (lang_level_<3 && D>3) { //can do mixing using bg_* colors) -+ unsigned int a2 = curdata[3]; //must be int -+ unsigned int a = 255-a2; -+ r = (a2 * r + bg_r * a)/255; -+ g = (a2 * g + bg_g * a)/255; -+ b = (a2 * b + bg_b * a)/255; -+ } -+ - if (!(i%40)) fputs("\n", output); - fprintf(output, "%.2x%.2x%.2x", r, g, b); - diff --git a/contrib/fltk/07-str2660-fltk-1.3.x-cursor.patch b/contrib/fltk/07-str2660-fltk-1.3.x-cursor.patch deleted file mode 100644 index 8e990505..00000000 --- a/contrib/fltk/07-str2660-fltk-1.3.x-cursor.patch +++ /dev/null @@ -1,1623 +0,0 @@ -diff -up fltk-1.3.2/CMakeLists.txt.cursor fltk-1.3.2/CMakeLists.txt ---- fltk-1.3.2/CMakeLists.txt.cursor 2013-01-30 16:07:59.510320246 +0100 -+++ fltk-1.3.2/CMakeLists.txt 2013-01-30 16:07:59.528319926 +0100 -@@ -529,6 +529,20 @@ else() - endif(OPTION_USE_XFIXES) - - ####################################################################### -+if(X11_Xcursor_FOUND) -+ option(OPTION_USE_XCURSOR "use lib XCURSOR" ON) -+endif(X11_Xcursor_FOUND) -+ -+if(OPTION_USE_XCURSOR) -+ set(HAVE_XCURSOR ${X11_Xcursor_FOUND}) -+ include_directories(${X11_Xcursor_INCLUDE_PATH}) -+ list(APPEND FLTK_LDLIBS -lXcursor) -+ set(FLTK_XCURSOR_FOUND TRUE) -+else() -+ set(FLTK_XCURSOR_FOUND FALSE) -+endif(OPTION_USE_XCURSOR) -+ -+####################################################################### - if(X11_Xft_FOUND) - option(OPTION_USE_XFT "use lib Xft" ON) - endif(X11_Xft_FOUND) -diff -up fltk-1.3.2/configh.cmake.in.cursor fltk-1.3.2/configh.cmake.in ---- fltk-1.3.2/configh.cmake.in.cursor 2013-01-30 16:07:59.510320246 +0100 -+++ fltk-1.3.2/configh.cmake.in 2013-01-30 16:07:59.529319908 +0100 -@@ -116,6 +116,14 @@ - #cmakedefine01 HAVE_XFIXES - - /* -+ * HAVE_XCURSOR: -+ * -+ * Do we have the X cursor library? -+ */ -+ -+#cmakedefine01 HAVE_XCURSOR -+ -+/* - * __APPLE_QUARTZ__: - * - * If __APPLE_QUARTZ__ is defined, FLTK will be -diff -up fltk-1.3.2/configh.in.cursor fltk-1.3.2/configh.in ---- fltk-1.3.2/configh.in.cursor 2013-01-30 16:07:59.510320246 +0100 -+++ fltk-1.3.2/configh.in 2013-01-30 16:07:59.529319908 +0100 -@@ -116,6 +116,14 @@ - #define HAVE_XFIXES 0 - - /* -+ * HAVE_XCURSOR: -+ * -+ * Do we have the X cursor library? -+ */ -+ -+#define HAVE_XCURSOR 0 -+ -+/* - * __APPLE_QUARTZ__: - * - * All Apple implementations are now based on Quartz and Cocoa, -diff -up fltk-1.3.2/configure.in.cursor fltk-1.3.2/configure.in ---- fltk-1.3.2/configure.in.cursor 2013-01-30 16:07:59.511320228 +0100 -+++ fltk-1.3.2/configure.in 2013-01-30 16:07:59.529319908 +0100 -@@ -1009,6 +1009,16 @@ case $uname_GUI in - LIBS="-lXfixes $LIBS") - fi - -+ dnl Check for the Xcursor library unless disabled... -+ AC_ARG_ENABLE(xcursor, [ --enable-xcursor turn on Xcursor support [default=yes]]) -+ -+ if test x$enable_xcursor != xno; then -+ AC_CHECK_HEADER(X11/Xcursor/Xcursor.h, AC_DEFINE(HAVE_XCURSOR),, -+ [#include <X11/Xlib.h>]) -+ AC_CHECK_LIB(Xcursor, XcursorImageCreate, -+ LIBS="-lXcursor $LIBS") -+ fi -+ - dnl Check for overlay visuals... - AC_PATH_PROG(XPROP, xprop) - AC_CACHE_CHECK(for X overlay visuals, ac_cv_have_overlay, -diff -up fltk-1.3.2/FL/Enumerations.H.cursor fltk-1.3.2/FL/Enumerations.H ---- fltk-1.3.2/FL/Enumerations.H.cursor 2013-01-30 16:07:59.486320673 +0100 -+++ fltk-1.3.2/FL/Enumerations.H 2013-01-30 16:07:59.530319891 +0100 -@@ -879,35 +879,36 @@ inline Fl_Color fl_color_cube(int r, int - - /** The following constants define the mouse cursors that are available in FLTK. - -- The double-headed arrows are bitmaps provided by FLTK on X, the others -- are provided by system-defined cursors. -+ Cursors are provided by the system when available, or bitmaps built into -+ FLTK as a fallback. - - \todo enum Fl_Cursor needs maybe an image. - */ - enum Fl_Cursor { - FL_CURSOR_DEFAULT = 0, /**< the default cursor, usually an arrow. */ -- FL_CURSOR_ARROW = 35, /**< an arrow pointer. */ -- FL_CURSOR_CROSS = 66, /**< crosshair. */ -- FL_CURSOR_WAIT = 76, /**< watch or hourglass. */ -- FL_CURSOR_INSERT = 77, /**< I-beam. */ -- FL_CURSOR_HAND = 31, /**< hand (uparrow on MSWindows). */ -- FL_CURSOR_HELP = 47, /**< question mark. */ -- FL_CURSOR_MOVE = 27, /**< 4-pointed arrow. */ -- // fltk provides bitmaps for these: -- FL_CURSOR_NS = 78, /**< up/down arrow. */ -- FL_CURSOR_WE = 79, /**< left/right arrow. */ -- FL_CURSOR_NWSE = 80, /**< diagonal arrow. */ -- FL_CURSOR_NESW = 81, /**< diagonal arrow. */ -- FL_CURSOR_NONE =255, /**< invisible. */ -- // for back compatibility (non MSWindows ones): -- FL_CURSOR_N = 70, /**< for back compatibility. */ -- FL_CURSOR_NE = 69, /**< for back compatibility. */ -- FL_CURSOR_E = 49, /**< for back compatibility. */ -- FL_CURSOR_SE = 8, /**< for back compatibility. */ -- FL_CURSOR_S = 9, /**< for back compatibility. */ -- FL_CURSOR_SW = 7, /**< for back compatibility. */ -- FL_CURSOR_W = 36, /**< for back compatibility. */ -- FL_CURSOR_NW = 68 /**< for back compatibility. */ -+ FL_CURSOR_ARROW = 1, /**< an arrow pointer. */ -+ FL_CURSOR_CROSS = 2, /**< crosshair. */ -+ FL_CURSOR_WAIT = 3, /**< busy indicator (e.g. hourglass). */ -+ FL_CURSOR_INSERT = 4, /**< I-beam. */ -+ FL_CURSOR_HAND = 5, /**< pointing hand. */ -+ FL_CURSOR_HELP = 6, /**< question mark pointer. */ -+ FL_CURSOR_MOVE = 7, /**< 4-pointed arrow or hand. */ -+ -+ /* Resize indicators */ -+ FL_CURSOR_NS = 101, /**< up/down resize. */ -+ FL_CURSOR_WE = 102, /**< left/right resize. */ -+ FL_CURSOR_NWSE = 103, /**< diagonal resize. */ -+ FL_CURSOR_NESW = 104, /**< diagonal resize. */ -+ FL_CURSOR_NE = 110, /**< upwards, right resize. */ -+ FL_CURSOR_N = 111, /**< upwards resize. */ -+ FL_CURSOR_NW = 112, /**< upwards, left resize. */ -+ FL_CURSOR_E = 113, /**< leftwards resize. */ -+ FL_CURSOR_W = 114, /**< rightwards resize. */ -+ FL_CURSOR_SE = 115, /**< downwards, right resize. */ -+ FL_CURSOR_S = 116, /**< downwards resize. */ -+ FL_CURSOR_SW = 117, /**< downwards, left resize. */ -+ -+ FL_CURSOR_NONE = 255, /**< invisible. */ - }; - /*@}*/ // group: Cursors - -diff -up fltk-1.3.2/FL/fl_draw.H.cursor fltk-1.3.2/FL/fl_draw.H ---- fltk-1.3.2/FL/fl_draw.H.cursor 2012-05-08 18:15:34.000000000 +0200 -+++ fltk-1.3.2/FL/fl_draw.H 2013-01-30 16:07:59.530319891 +0100 -@@ -751,7 +751,8 @@ FL_EXPORT const char* fl_shortcut_label( - FL_EXPORT unsigned int fl_old_shortcut(const char* s); - FL_EXPORT void fl_overlay_rect(int x,int y,int w,int h); - FL_EXPORT void fl_overlay_clear(); --FL_EXPORT void fl_cursor(Fl_Cursor, Fl_Color fg=FL_BLACK, Fl_Color bg=FL_WHITE); -+FL_EXPORT void fl_cursor(Fl_Cursor); -+FL_EXPORT void fl_cursor(Fl_Cursor, Fl_Color fg, Fl_Color bg=FL_WHITE); - FL_EXPORT const char* fl_expand_text(const char* from, char* buf, int maxbuf, - double maxw, int& n, double &width, - int wrap, int draw_symbols = 0); -diff -up fltk-1.3.2/FL/Fl_Window.H.cursor fltk-1.3.2/FL/Fl_Window.H ---- fltk-1.3.2/FL/Fl_Window.H.cursor 2012-11-06 21:46:14.000000000 +0100 -+++ fltk-1.3.2/FL/Fl_Window.H 2013-01-30 16:07:59.531319873 +0100 -@@ -28,6 +28,7 @@ - #define FL_DOUBLE_WINDOW 0xF1 ///< double window type id - - class Fl_X; -+class Fl_RGB_Image; - - /** - This widget produces an actual window. This can either be a main -@@ -81,7 +82,6 @@ class FL_EXPORT Fl_Window : public Fl_Gr - uchar size_range_set; - // cursor stuff - Fl_Cursor cursor_default; -- Fl_Color cursor_fg, cursor_bg; - void size_range_(); - void _Fl_Window(); // constructor innards - void fullscreen_x(); // platform-specific part of sending a window to full screen -@@ -466,14 +466,17 @@ public: - is different. - - The type Fl_Cursor is an enumeration defined in <FL/Enumerations.H>. -- (Under X you can get any XC_cursor value by passing -- Fl_Cursor((XC_foo/2)+1)). The colors only work on X, they are -- not implemented on WIN32. - -- For back compatibility only. -+ \see cursor(const Fl_RGB_Image*, int, int), default_cursor() - */ -- void cursor(Fl_Cursor, Fl_Color=FL_BLACK, Fl_Color=FL_WHITE); // platform dependent -- void default_cursor(Fl_Cursor, Fl_Color=FL_BLACK, Fl_Color=FL_WHITE); -+ void cursor(Fl_Cursor); -+ void cursor(const Fl_RGB_Image*, int, int); -+ void default_cursor(Fl_Cursor); -+ -+ /* for legacy compatibility */ -+ void cursor(Fl_Cursor c, Fl_Color, Fl_Color=FL_WHITE); -+ void default_cursor(Fl_Cursor c, Fl_Color, Fl_Color=FL_WHITE); -+ - static void default_callback(Fl_Window*, void* v); - - /** Returns the window width including any frame added by the window manager. -diff -up fltk-1.3.2/FL/mac.H.cursor fltk-1.3.2/FL/mac.H ---- fltk-1.3.2/FL/mac.H.cursor 2012-11-13 15:45:42.000000000 +0100 -+++ fltk-1.3.2/FL/mac.H 2013-01-30 16:07:59.531319873 +0100 -@@ -120,7 +120,8 @@ public: - void collapse(void); - WindowRef window_ref(void); - void set_key_window(void); -- void set_cursor(Fl_Cursor); -+ int set_cursor(Fl_Cursor); -+ int set_cursor(const Fl_RGB_Image*, int, int); - static CGImageRef CGImage_from_window_rect(Fl_Window *win, int x, int y, int w, int h); - static unsigned char *bitmap_from_window_rect(Fl_Window *win, int x, int y, int w, int h, int *bytesPerPixel); - static Fl_Region intersect_region_and_rect(Fl_Region current, int x,int y,int w, int h); -diff -up fltk-1.3.2/FL/win32.H.cursor fltk-1.3.2/FL/win32.H ---- fltk-1.3.2/FL/win32.H.cursor 2012-03-12 12:55:50.000000000 +0100 -+++ fltk-1.3.2/FL/win32.H 2013-01-30 16:07:59.531319873 +0100 -@@ -73,6 +73,7 @@ public: - int wait_for_expose; - HDC private_dc; // used for OpenGL - HCURSOR cursor; -+ int custom_cursor; - HDC saved_hdc; // saves the handle of the DC currently loaded - // static variables, static functions and member functions - static Fl_X* first; -@@ -83,6 +84,8 @@ public: - void flush() {w->flush();} - void set_minmax(LPMINMAXINFO minmax); - void mapraise(); -+ int set_cursor(Fl_Cursor); -+ int set_cursor(const Fl_RGB_Image*, int, int); - static Fl_X* make(Fl_Window*); - }; - extern FL_EXPORT HCURSOR fl_default_cursor; -diff -up fltk-1.3.2/FL/x.H.cursor fltk-1.3.2/FL/x.H ---- fltk-1.3.2/FL/x.H.cursor 2012-03-23 17:47:53.000000000 +0100 -+++ fltk-1.3.2/FL/x.H 2013-01-30 16:07:59.532319855 +0100 -@@ -154,6 +154,8 @@ public: - static Fl_X* i(const Fl_Window* wi) {return wi->i;} - void setwindow(Fl_Window* wi) {w=wi; wi->i=this;} - void sendxjunk(); -+ int set_cursor(Fl_Cursor); -+ int set_cursor(const Fl_RGB_Image*, int, int); - static void make_xid(Fl_Window*,XVisualInfo* =fl_visual, Colormap=fl_colormap); - static Fl_X* set_xid(Fl_Window*, Window); - // kludges to get around protection: -diff -up fltk-1.3.2/src/CMakeLists.txt.cursor fltk-1.3.2/src/CMakeLists.txt ---- fltk-1.3.2/src/CMakeLists.txt.cursor 2013-01-30 16:09:11.981032475 +0100 -+++ fltk-1.3.2/src/CMakeLists.txt 2013-01-30 16:09:26.497774461 +0100 -@@ -247,6 +247,10 @@ if(HAVE_XFIXES) - target_link_libraries(fltk ${X11_Xfixes_LIB}) - endif(HAVE_XFIXES) - -+if(HAVE_XCURSOR) -+ target_link_libraries(fltk ${X11_Xcursor_LIB}) -+endif(HAVE_XCURSOR) -+ - if(USE_XFT) - target_link_libraries(fltk ${X11_Xft_LIB}) - endif(USE_XFT) -diff -up fltk-1.3.2/src/Fl_cocoa.mm.cursor fltk-1.3.2/src/Fl_cocoa.mm ---- fltk-1.3.2/src/Fl_cocoa.mm.cursor 2013-01-30 16:07:59.522320033 +0100 -+++ fltk-1.3.2/src/Fl_cocoa.mm 2013-01-30 16:07:59.533319837 +0100 -@@ -98,7 +98,6 @@ Fl_Display_Device *Fl_Display_Device::_d - CGContextRef fl_gc = 0; - void *fl_system_menu; // this is really a NSMenu* - Fl_Sys_Menu_Bar *fl_sys_menu_bar = 0; --void *fl_default_cursor; // this is really a NSCursor* - void *fl_capture = 0; // (NSWindow*) we need this to compensate for a missing(?) mouse capture - bool fl_show_iconic; // true if called from iconize() - shows the next created window in collapsed state - //int fl_disable_transient_for; // secret method of removing TRANSIENT_FOR -@@ -1392,8 +1391,6 @@ void fl_open_display() { - dequeue:YES]; - while (ign_event); - -- fl_default_cursor = [NSCursor arrowCursor]; -- - // bring the application into foreground without a 'CARB' resource - Boolean same_psn; - ProcessSerialNumber cur_psn, front_psn; -@@ -1698,6 +1695,7 @@ static void q_set_window_title(NSWindow - - (void)drawRect:(NSRect)rect; - - (BOOL)acceptsFirstResponder; - - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent; -+- (void)resetCursorRects; - - (BOOL)performKeyEquivalent:(NSEvent*)theEvent; - - (void)mouseUp:(NSEvent *)theEvent; - - (void)rightMouseUp:(NSEvent *)theEvent; -@@ -1756,6 +1754,16 @@ static void q_set_window_title(NSWindow - Fl_Window *first = Fl::first_window(); - return (first == w || !first->modal()); - } -+- (void)resetCursorRects { -+ Fl_Window *w = [(FLWindow*)[self window] getFl_Window]; -+ Fl_X *i = Fl_X::i(w); -+ // We have to have at least one cursor rect for invalidateCursorRectsForView -+ // to work, hence the "else" clause. -+ if (i->cursor) -+ [self addCursorRect:[self visibleRect] cursor:(NSCursor*)i->cursor]; -+ else -+ [self addCursorRect:[self visibleRect] cursor:[NSCursor arrowCursor]]; -+} - - (void)mouseUp:(NSEvent *)theEvent { - cocoaMouseHandler(theEvent); - } -@@ -2331,7 +2339,7 @@ void Fl_X::make(Fl_Window* w) - x->other_xid = 0; - x->region = 0; - x->subRegion = 0; -- x->cursor = fl_default_cursor; -+ x->cursor = NULL; - x->gc = 0; // stay 0 for Quickdraw; fill with CGContext for Quartz - Fl_Window *win = w->window(); - Fl_X *xo = Fl_X::i(win); -@@ -2427,7 +2435,7 @@ void Fl_X::make(Fl_Window* w) - x->other_xid = 0; // room for doublebuffering image map. On OS X this is only used by overlay windows - x->region = 0; - x->subRegion = 0; -- x->cursor = fl_default_cursor; -+ x->cursor = NULL; - x->xidChildren = 0; - x->xidNext = 0; - x->gc = 0; -@@ -2974,6 +2982,10 @@ void Fl_X::map() { - Fl_X::relink(w, w->window() ); - w->redraw(); - } -+ if (cursor) { -+ [(NSCursor*)cursor release]; -+ cursor = NULL; -+ } - } - - void Fl_X::unmap() { -@@ -3078,68 +3090,106 @@ static NSImage *CGBitmapContextToNSImage - return [image autorelease]; - } - --static NSCursor *PrepareCursor(NSCursor *cursor, CGContextRef (*f)() ) -+int Fl_X::set_cursor(Fl_Cursor c) - { -- if (cursor == nil) { -- CGContextRef c = f(); -- NSImage *image = CGBitmapContextToNSImage(c); -- fl_delete_offscreen( (Fl_Offscreen)c ); -- NSPoint pt = {[image size].width/2, [image size].height/2}; -- cursor = [[NSCursor alloc] initWithImage:image hotSpot:pt]; -+ if (cursor) { -+ [(NSCursor*)cursor release]; -+ cursor = NULL; - } -- return cursor; --} - --void Fl_X::set_cursor(Fl_Cursor c) --{ -- NSCursor *icrsr; - switch (c) { -- case FL_CURSOR_CROSS: icrsr = [NSCursor crosshairCursor]; break; -- case FL_CURSOR_WAIT: -- static NSCursor *watch = nil; -- watch = PrepareCursor(watch, &Fl_X::watch_cursor_image); -- icrsr = watch; -- break; -- case FL_CURSOR_INSERT: icrsr = [NSCursor IBeamCursor]; break; -- case FL_CURSOR_N: icrsr = [NSCursor resizeUpCursor]; break; -- case FL_CURSOR_S: icrsr = [NSCursor resizeDownCursor]; break; -- case FL_CURSOR_NS: icrsr = [NSCursor resizeUpDownCursor]; break; -- case FL_CURSOR_HELP: -- static NSCursor *help = nil; -- help = PrepareCursor(help, &Fl_X::help_cursor_image); -- icrsr = help; -- break; -- case FL_CURSOR_HAND: icrsr = [NSCursor pointingHandCursor]; break; -- case FL_CURSOR_MOVE: icrsr = [NSCursor openHandCursor]; break; -- case FL_CURSOR_NE: -- case FL_CURSOR_SW: -- case FL_CURSOR_NESW: -- static NSCursor *nesw = nil; -- nesw = PrepareCursor(nesw, &Fl_X::nesw_cursor_image); -- icrsr = nesw; -- break; -- case FL_CURSOR_E: icrsr = [NSCursor resizeRightCursor]; break; -- case FL_CURSOR_W: icrsr = [NSCursor resizeLeftCursor]; break; -- case FL_CURSOR_WE: icrsr = [NSCursor resizeLeftRightCursor]; break; -- case FL_CURSOR_SE: -- case FL_CURSOR_NW: -- case FL_CURSOR_NWSE: -- static NSCursor *nwse = nil; -- nwse = PrepareCursor(nwse, &Fl_X::nwse_cursor_image); -- icrsr = nwse; -- break; -- case FL_CURSOR_NONE: -- static NSCursor *none = nil; -- none = PrepareCursor(none, &Fl_X::none_cursor_image); -- icrsr = none; -- break; -- case FL_CURSOR_ARROW: -- case FL_CURSOR_DEFAULT: -- default: icrsr = [NSCursor arrowCursor]; -- break; -+ case FL_CURSOR_ARROW: cursor = [NSCursor arrowCursor]; break; -+ case FL_CURSOR_CROSS: cursor = [NSCursor crosshairCursor]; break; -+ case FL_CURSOR_INSERT: cursor = [NSCursor IBeamCursor]; break; -+ case FL_CURSOR_HAND: cursor = [NSCursor pointingHandCursor]; break; -+ case FL_CURSOR_MOVE: cursor = [NSCursor openHandCursor]; break; -+ case FL_CURSOR_NS: cursor = [NSCursor resizeUpDownCursor]; break; -+ case FL_CURSOR_WE: cursor = [NSCursor resizeLeftRightCursor]; break; -+ case FL_CURSOR_N: cursor = [NSCursor resizeUpCursor]; break; -+ case FL_CURSOR_E: cursor = [NSCursor resizeRightCursor]; break; -+ case FL_CURSOR_W: cursor = [NSCursor resizeLeftCursor]; break; -+ case FL_CURSOR_S: cursor = [NSCursor resizeDownCursor]; break; -+ default: -+ return 0; -+ } -+ -+ [(NSCursor*)cursor retain]; -+ -+ [(NSWindow*)xid invalidateCursorRectsForView:[(NSWindow*)xid contentView]]; -+ -+ return 1; -+} -+ -+int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) { -+ if (cursor) { -+ [(NSCursor*)cursor release]; -+ cursor = NULL; -+ } -+ -+ if ((hotx < 0) || (hotx >= image->w())) -+ return 0; -+ if ((hoty < 0) || (hoty >= image->h())) -+ return 0; -+ -+ // OS X >= 10.6 can create a NSImage from a CGImage, but we need to -+ // support older versions, hence this pesky handling. -+ -+ NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc] -+ initWithBitmapDataPlanes:NULL -+ pixelsWide:image->w() -+ pixelsHigh:image->h() -+ bitsPerSample:8 -+ samplesPerPixel:image->d() -+ hasAlpha:!(image->d() & 1) -+ isPlanar:NO -+ colorSpaceName:(image->d()<=2) ? NSDeviceWhiteColorSpace : NSDeviceRGBColorSpace -+ bytesPerRow:(image->w() * image->d()) -+ bitsPerPixel:(image->d()*8)]; -+ -+ // Alpha needs to be premultiplied for this format -+ -+ const uchar *i = (const uchar*)*image->data(); -+ unsigned char *o = [bitmap bitmapData]; -+ for (int y = 0;y < image->h();y++) { -+ if (image->d() & 1) { -+ for (int x = 0;x < image->w();x++) { -+ unsigned int alpha; -+ if (image->d() == 4) { -+ alpha = i[3]; -+ *o++ = (unsigned char)((unsigned int)*i++ * alpha / 255); -+ *o++ = (unsigned char)((unsigned int)*i++ * alpha / 255); -+ } -+ -+ alpha = i[1]; -+ *o++ = (unsigned char)((unsigned int)*i++ * alpha / 255); -+ *o++ = alpha; -+ i++; -+ } -+ } else { -+ // No alpha, so we can just copy everything directly. -+ int len = image->w() * image->d(); -+ memcpy(o, i, len); -+ o += len; -+ i += len; -+ } -+ i += image->ld(); - } -- [icrsr set]; -- cursor = icrsr; -+ -+ NSImage *nsimage = [[NSImage alloc] -+ initWithSize:NSMakeSize(image->w(), image->h())]; -+ -+ [nsimage addRepresentation:bitmap]; -+ -+ cursor = [[NSCursor alloc] -+ initWithImage:nsimage -+ hotSpot:NSMakePoint(hotx, hoty)]; -+ -+ [(NSWindow*)xid invalidateCursorRectsForView:[(NSWindow*)xid contentView]]; -+ -+ [bitmap release]; -+ [nsimage release]; -+ -+ return 1; - } - - @interface FLaboutItemTarget : NSObject -diff -up fltk-1.3.2/src/fl_cursor.cxx.cursor fltk-1.3.2/src/fl_cursor.cxx ---- fltk-1.3.2/src/fl_cursor.cxx.cursor 2012-03-12 12:55:50.000000000 +0100 -+++ fltk-1.3.2/src/fl_cursor.cxx 2013-01-30 16:07:59.534319820 +0100 -@@ -24,297 +24,165 @@ - - #include <FL/Fl.H> - #include <FL/Fl_Window.H> -+#include <FL/Fl_Pixmap.H> -+#include <FL/Fl_RGB_Image.H> - #include <FL/x.H> --#if !defined(WIN32) && !defined(__APPLE__) --# include <X11/cursorfont.h> --#endif - #include <FL/fl_draw.H> - -+#include "fl_cursor_wait.xpm" -+#include "fl_cursor_help.xpm" -+#include "fl_cursor_nwse.xpm" -+#include "fl_cursor_nesw.xpm" -+#include "fl_cursor_none.xpm" -+ - /** - Sets the cursor for the current window to the specified shape and colors. - The cursors are defined in the <FL/Enumerations.H> header file. - */ -+void fl_cursor(Fl_Cursor c) { -+ if (Fl::first_window()) Fl::first_window()->cursor(c); -+} -+ -+/* For back compatibility only. */ - void fl_cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) { -- if (Fl::first_window()) Fl::first_window()->cursor(c,fg,bg); -+ fl_cursor(c); - } -+ -+ - /** -- Sets the default window cursor as well as its color. -+ Sets the default window cursor. This is the cursor that will be used -+ after the mouse pointer leaves a widget with a custom cursor set. - -- For back compatibility only. -+ \see cursor(const Fl_RGB_Image*, int, int), default_cursor() - */ --void Fl_Window::default_cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) { --// if (c == FL_CURSOR_DEFAULT) c = FL_CURSOR_ARROW; -- -+void Fl_Window::default_cursor(Fl_Cursor c) { - cursor_default = c; -- cursor_fg = fg; -- cursor_bg = bg; -+ cursor(c); -+} -+ -+ -+void fallback_cursor(Fl_Window *w, Fl_Cursor c) { -+ const char **xpm; -+ int hotx, hoty; -+ -+ // The standard arrow is our final fallback, so something is broken -+ // if we get called back here with that as an argument. -+ if (c == FL_CURSOR_ARROW) -+ return; -+ -+ switch (c) { -+ case FL_CURSOR_WAIT: -+ xpm = (const char**)fl_cursor_wait_xpm; -+ hotx = 8; -+ hoty = 15; -+ break; -+ case FL_CURSOR_HELP: -+ xpm = (const char**)fl_cursor_help_xpm; -+ hotx = 1; -+ hoty = 3; -+ break; -+ case FL_CURSOR_NWSE: -+ xpm = (const char**)fl_cursor_nwse_xpm; -+ hotx = 7; -+ hoty = 7; -+ break; -+ case FL_CURSOR_NESW: -+ xpm = (const char**)fl_cursor_nesw_xpm; -+ hotx = 7; -+ hoty = 7; -+ break; -+ case FL_CURSOR_NONE: -+ xpm = (const char**)fl_cursor_none_xpm; -+ hotx = 0; -+ hoty = 0; -+ break; -+ default: -+ w->cursor(FL_CURSOR_ARROW); -+ return; -+ } - -- cursor(c, fg, bg); -+ Fl_Pixmap pxm(xpm); -+ Fl_RGB_Image image(&pxm); -+ -+ w->cursor(&image, hotx, hoty); - } - --#ifdef WIN32 - --# ifndef IDC_HAND --# define IDC_HAND MAKEINTRESOURCE(32649) --# endif // !IDC_HAND -+void Fl_Window::cursor(Fl_Cursor c) { -+ int ret; - --void Fl_Window::cursor(Fl_Cursor c, Fl_Color c1, Fl_Color c2) { -- if (!shown()) return; - // the cursor must be set for the top level window, not for subwindows - Fl_Window *w = window(), *toplevel = this; -- while (w) { toplevel = w; w = w->window(); } -- if (toplevel != this) { toplevel->cursor(c, c1, c2); return; } -- // now set the actual cursor -- if (c == FL_CURSOR_DEFAULT) { -- c = cursor_default; -- } -- if (c > FL_CURSOR_NESW) { -- i->cursor = 0; -- } else if (c == FL_CURSOR_DEFAULT) { -- i->cursor = fl_default_cursor; -- } else { -- LPSTR n; -- switch (c) { -- case FL_CURSOR_ARROW: n = IDC_ARROW; break; -- case FL_CURSOR_CROSS: n = IDC_CROSS; break; -- case FL_CURSOR_WAIT: n = IDC_WAIT; break; -- case FL_CURSOR_INSERT: n = IDC_IBEAM; break; -- case FL_CURSOR_HELP: n = IDC_HELP; break; -- case FL_CURSOR_HAND: { -- OSVERSIONINFO osvi; -- -- // Get the OS version: Windows 98 and 2000 have a standard -- // hand cursor. -- memset(&osvi, 0, sizeof(OSVERSIONINFO)); -- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); -- GetVersionEx(&osvi); -- -- if (osvi.dwMajorVersion > 4 || -- (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion > 0 && -- osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)) n = IDC_HAND; -- else n = IDC_UPARROW; -- } break; -- case FL_CURSOR_MOVE: n = IDC_SIZEALL; break; -- case FL_CURSOR_N: -- case FL_CURSOR_S: -- case FL_CURSOR_NS: n = IDC_SIZENS; break; -- case FL_CURSOR_NE: -- case FL_CURSOR_SW: -- case FL_CURSOR_NESW: n = IDC_SIZENESW; break; -- case FL_CURSOR_E: -- case FL_CURSOR_W: -- case FL_CURSOR_WE: n = IDC_SIZEWE; break; -- case FL_CURSOR_SE: -- case FL_CURSOR_NW: -- case FL_CURSOR_NWSE: n = IDC_SIZENWSE; break; -- default: n = IDC_NO; break; -- } -- i->cursor = LoadCursor(NULL, n); -+ -+ while (w) { -+ toplevel = w; -+ w = w->window(); - } -- SetCursor(i->cursor); --} - --#elif defined(__APPLE__) -+ if (toplevel != this) { -+ toplevel->cursor(c); -+ return; -+ } - --#ifdef __BIG_ENDIAN__ --# define E(x) x --#elif defined __LITTLE_ENDIAN__ --// Don't worry. This will be resolved at compile time --# define E(x) (x>>8)|((x<<8)&0xff00) --#else --# error "Either __LITTLE_ENDIAN__ or __BIG_ENDIAN__ must be defined" --#endif -- --CGContextRef Fl_X::help_cursor_image(void) --{ -- int w = 20, h = 20; -- Fl_Offscreen off = Fl_Quartz_Graphics_Driver::create_offscreen_with_alpha(w, h); -- fl_begin_offscreen(off); -- CGContextSetRGBFillColor( (CGContextRef)off, 0,0,0,0); -- fl_rectf(0,0,w,h); -- fl_color(FL_BLACK); -- fl_font(FL_COURIER_BOLD, 20); -- fl_draw("?", 1, h-1); -- fl_end_offscreen(); -- return (CGContextRef)off; --} -+ if (c == FL_CURSOR_DEFAULT) -+ c = cursor_default; - --CGContextRef Fl_X::none_cursor_image(void) --{ -- int w = 20, h = 20; -- Fl_Offscreen off = Fl_Quartz_Graphics_Driver::create_offscreen_with_alpha(w, h); -- fl_begin_offscreen(off); -- CGContextSetRGBFillColor( (CGContextRef)off, 0,0,0,0); -- fl_rectf(0,0,w,h); -- fl_end_offscreen(); -- return (CGContextRef)off; --} -+ if (!i) -+ return; - --CGContextRef Fl_X::watch_cursor_image(void) --{ -- int w, h, r = 5; -- w = 2*r+6; -- h = 4*r; -- Fl_Offscreen off = Fl_Quartz_Graphics_Driver::create_offscreen_with_alpha(w, h); -- fl_begin_offscreen(off); -- CGContextSetRGBFillColor( (CGContextRef)off, 0,0,0,0); -- fl_rectf(0,0,w,h); -- CGContextTranslateCTM( (CGContextRef)off, w/2, h/2); -- fl_color(FL_WHITE); -- fl_circle(0, 0, r+1); -- fl_color(FL_BLACK); -- fl_rectf(int(-r*0.7), int(-r*1.7), int(1.4*r), int(3.4*r)); -- fl_rectf(r-1, -1, 3, 3); -- fl_color(FL_WHITE); -- fl_pie(-r, -r, 2*r, 2*r, 0, 360); -- fl_color(FL_BLACK); -- fl_circle(0,0,r); -- fl_xyline(0, 0, int(-r*.7)); -- fl_xyline(0, 0, 0, int(-r*.7)); -- fl_end_offscreen(); -- return (CGContextRef)off; --} -+ ret = i->set_cursor(c); -+ if (ret) -+ return; - --CGContextRef Fl_X::nesw_cursor_image(void) --{ -- int c = 7, r = 2*c; -- int w = r, h = r; -- Fl_Offscreen off = Fl_Quartz_Graphics_Driver::create_offscreen_with_alpha(w, h); -- fl_begin_offscreen(off); -- CGContextSetRGBFillColor( (CGContextRef)off, 0,0,0,0); -- fl_rectf(0,0,w,h); -- CGContextTranslateCTM( (CGContextRef)off, 0, h); -- CGContextScaleCTM( (CGContextRef)off, 1, -1); -- fl_color(FL_BLACK); -- fl_polygon(0, 0, c, 0, 0, c); -- fl_polygon(r, r, r, r-c, r-c, r); -- fl_line_style(FL_SOLID, 2, 0); -- fl_line(0,1, r,r+1); -- fl_line_style(FL_SOLID, 0, 0); -- fl_end_offscreen(); -- return (CGContextRef)off; -+ fallback_cursor(this, c); - } - --CGContextRef Fl_X::nwse_cursor_image(void) --{ -- int c = 7, r = 2*c; -- int w = r, h = r; -- Fl_Offscreen off = Fl_Quartz_Graphics_Driver::create_offscreen_with_alpha(w, h); -- fl_begin_offscreen(off); -- CGContextSetRGBFillColor( (CGContextRef)off, 0,0,0,0); -- fl_rectf(0,0,w,h); -- CGContextTranslateCTM( (CGContextRef)off, 0, h); -- CGContextScaleCTM( (CGContextRef)off, 1, -1); -- fl_color(FL_BLACK); -- fl_polygon(r-1, 0, r-1, c, r-1-c, 0); -- fl_polygon(-1, r, c-1, r, -1, r-c); -- fl_line_style(FL_SOLID, 2, 0); -- fl_line(r-1,1, -1,r+1); -- fl_line_style(FL_SOLID, 0, 0); -- fl_end_offscreen(); -- return (CGContextRef)off; --} -- --void Fl_Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) { -- if (c == FL_CURSOR_DEFAULT) { -- c = cursor_default; -- } -- if (i) i->set_cursor(c); --} -+/** -+ Changes the cursor for this window. This always calls the system, if -+ you are changing the cursor a lot you may want to keep track of how -+ you set it in a static variable and call this only if the new cursor -+ is different. - --#else -+ The default cursor will be used if the provided image cannot be used -+ as a cursor. - --// I like the MSWindows resize cursors, so I duplicate them here: -+ \see cursor(Fl_Cursor), default_cursor() -+*/ -+void Fl_Window::cursor(const Fl_RGB_Image *image, int hotx, int hoty) { -+ int ret; - --#define CURSORSIZE 16 --#define HOTXY 7 --static struct TableEntry { -- uchar bits[CURSORSIZE*CURSORSIZE/8]; -- uchar mask[CURSORSIZE*CURSORSIZE/8]; -- Cursor cursor; --} table[] = { -- {{ // FL_CURSOR_NS -- 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0x80, 0x01, 0x80, 0x01, -- 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, -- 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00}, -- { -- 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf0, 0x0f, 0xc0, 0x03, -- 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xf0, 0x0f, -- 0xf0, 0x0f, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01}}, -- {{ // FL_CURSOR_EW -- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, -- 0x0c, 0x30, 0xfe, 0x7f, 0xfe, 0x7f, 0x0c, 0x30, 0x08, 0x10, 0x00, 0x00, -- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, -- { -- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x1c, 0x38, -- 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0x1c, 0x38, 0x18, 0x18, -- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, -- {{ // FL_CURSOR_NWSE -- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x38, 0x00, 0x78, 0x00, -- 0xe8, 0x00, 0xc0, 0x01, 0x80, 0x03, 0x00, 0x17, 0x00, 0x1e, 0x00, 0x1c, -- 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, -- { -- 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0xfc, 0x00, 0x7c, 0x00, 0xfc, 0x00, -- 0xfc, 0x01, 0xec, 0x03, 0xc0, 0x37, 0x80, 0x3f, 0x00, 0x3f, 0x00, 0x3e, -- 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00}}, -- {{ // FL_CURSOR_NESW -- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x1c, 0x00, 0x1e, -- 0x00, 0x17, 0x80, 0x03, 0xc0, 0x01, 0xe8, 0x00, 0x78, 0x00, 0x38, 0x00, -- 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, -- { -- 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3e, 0x00, 0x3f, -- 0x80, 0x3f, 0xc0, 0x37, 0xec, 0x03, 0xfc, 0x01, 0xfc, 0x00, 0x7c, 0x00, -- 0xfc, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00}}, -- {{0}, {0}} // FL_CURSOR_NONE & unknown --}; -+ // the cursor must be set for the top level window, not for subwindows -+ Fl_Window *w = window(), *toplevel = this; - --void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) { -- if (!shown()) return; -- Cursor xc; -- int deleteit = 0; -- if (c == FL_CURSOR_DEFAULT) { -- c = cursor_default; -- fg = cursor_fg; -- bg = cursor_bg; -+ while (w) { -+ toplevel = w; -+ w = w->window(); - } - -- if (!c) { -- xc = None; -- } else { -- if (c >= FL_CURSOR_NS) { -- TableEntry *q = (c > FL_CURSOR_NESW) ? table+4 : table+(c-FL_CURSOR_NS); -- if (!(q->cursor)) { -- XColor dummy = { 0 }; -- Pixmap p = XCreateBitmapFromData(fl_display, -- RootWindow(fl_display, fl_screen), (const char*)(q->bits), -- CURSORSIZE, CURSORSIZE); -- Pixmap m = XCreateBitmapFromData(fl_display, -- RootWindow(fl_display, fl_screen), (const char*)(q->mask), -- CURSORSIZE, CURSORSIZE); -- q->cursor = XCreatePixmapCursor(fl_display, p,m,&dummy, &dummy, -- HOTXY, HOTXY); -- XFreePixmap(fl_display, m); -- XFreePixmap(fl_display, p); -- } -- xc = q->cursor; -- } else { -- xc = XCreateFontCursor(fl_display, (c-1)*2); -- deleteit = 1; -- } -- XColor fgc; -- uchar r,g,b; -- Fl::get_color(fg,r,g,b); -- fgc.red = r<<8; fgc.green = g<<8; fgc.blue = b<<8; -- XColor bgc; -- Fl::get_color(bg,r,g,b); -- bgc.red = r<<8; bgc.green = g<<8; bgc.blue = b<<8; -- XRecolorCursor(fl_display, xc, &fgc, &bgc); -+ if (toplevel != this) { -+ toplevel->cursor(image, hotx, hoty); -+ return; - } -- XDefineCursor(fl_display, fl_xid(this), xc); -- if (deleteit) XFreeCursor(fl_display, xc); -+ -+ if (!i) -+ return; -+ -+ ret = i->set_cursor(image, hotx, hoty); -+ if (ret) -+ return; -+ -+ cursor(FL_CURSOR_DEFAULT); - } - --#endif -+/* For back compatibility only. */ -+void Fl_Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) { -+ cursor(c); -+}; -+ -+void Fl_Window::default_cursor(Fl_Cursor c, Fl_Color, Fl_Color) { -+ default_cursor(c); -+}; -+ - - // - // End of "$Id: fl_cursor.cxx 9278 2012-03-12 11:55:50Z manolo $". -diff -up fltk-1.3.2/src/fl_cursor_help.xpm.cursor fltk-1.3.2/src/fl_cursor_help.xpm ---- fltk-1.3.2/src/fl_cursor_help.xpm.cursor 2013-01-30 16:07:59.534319820 +0100 -+++ fltk-1.3.2/src/fl_cursor_help.xpm 2013-01-30 16:07:59.534319820 +0100 -@@ -0,0 +1,95 @@ -+/* XPM */ -+static const char * fl_cursor_help_xpm[] = { -+"16 27 65 1", -+" c None", -+". c #FFFFFF", -+"+ c #E2E2E2", -+"@ c #1C1C1C", -+"# c #E7E7E7", -+"$ c #000000", -+"% c #212121", -+"& c #EAEAEA", -+"* c #262626", -+"= c #EDEDED", -+"- c #2C2C2C", -+"; c #F0F0F0", -+"> c #333333", -+", c #F1F1F1", -+"' c #393939", -+") c #F3F3F3", -+"! c #404040", -+"~ c #484848", -+"{ c #F4F4F4", -+"] c #050505", -+"^ c #202020", -+"/ c #707070", -+"( c #F5F5F5", -+"_ c #040404", -+": c #E1E1E1", -+"< c #EEEEEE", -+"[ c #EFEFEF", -+"} c #FEFEFE", -+"| c #3D3D3D", -+"1 c #7E7E7E", -+"2 c #696969", -+"3 c #414141", -+"4 c #131313", -+"5 c #080808", -+"6 c #454545", -+"7 c #F2F2F2", -+"8 c #878787", -+"9 c #7D7D7D", -+"0 c #101010", -+"a c #111111", -+"b c #FDFDFD", -+"c c #8A8A8A", -+"d c #E6E6E6", -+"e c #7B7B7B", -+"f c #4C4C4C", -+"g c #5C5C5C", -+"h c #9F9F9F", -+"i c #F9F9F9", -+"j c #F7F7F7", -+"k c #B1B1B1", -+"l c #2E2E2E", -+"m c #767676", -+"n c #DCDCDC", -+"o c #DEDEDE", -+"p c #C7C7C7", -+"q c #1B1B1B", -+"r c #6B6B6B", -+"s c #575757", -+"t c #797979", -+"u c #020202", -+"v c #010101", -+"w c #FBFBFB", -+"x c #D7D7D7", -+"y c #D8D8D8", -+"z c #060606", -+" ", -+". ", -+".+ ", -+".@# ", -+".$%& ", -+".$$*= ", -+".$$$-; ", -+".$$$$>, ", -+".$$$$$') ", -+".$$$$$$!) ", -+".$$$$$$$~{ ", -+".$$$$]^^^/( ", -+".$$$$_:(<<[} ", -+".$$|1$2< ", -+".$3,(45[ ", -+".67 78$9, ", -+".7 {0a( .... ", -+"b ,c5[defgh, ", -+" )ijk_la$m.", -+" no.p$q.", -+" .r$s.", -+" .t$-= ", -+" 7uv+ ", -+" wxy. ", -+" :$z. ", -+" :$z. ", -+" .... "}; -diff -up fltk-1.3.2/src/fl_cursor_nesw.xpm.cursor fltk-1.3.2/src/fl_cursor_nesw.xpm ---- fltk-1.3.2/src/fl_cursor_nesw.xpm.cursor 2013-01-30 16:07:59.534319820 +0100 -+++ fltk-1.3.2/src/fl_cursor_nesw.xpm 2013-01-30 16:07:59.534319820 +0100 -@@ -0,0 +1,46 @@ -+/* XPM */ -+static const char * fl_cursor_nesw_xpm[] = { -+"15 15 28 1", -+" c None", -+". c #FFFFFF", -+"+ c #767676", -+"@ c #000000", -+"# c #4E4E4E", -+"$ c #0C0C0C", -+"% c #494949", -+"& c #4D4D4D", -+"* c #1B1B1B", -+"= c #515151", -+"- c #646464", -+"; c #363636", -+"> c #6A6A6A", -+", c #545454", -+"' c #585858", -+") c #242424", -+"! c #797979", -+"~ c #2E2E2E", -+"{ c #444444", -+"] c #3B3B3B", -+"^ c #0A0A0A", -+"/ c #595959", -+"( c #F7F7F7", -+"_ c #080808", -+": c #6B6B6B", -+"< c #FDFDFD", -+"[ c #FCFCFC", -+"} c #FEFEFE", -+" ..........", -+" .+@@@@@@.", -+" .#@@@@@.", -+" .$@@@@.", -+" .%@@@@@.", -+". .&@@@*@@.", -+".. .=@@@-.;@.", -+".>. .,@@@'. .).", -+".@!.'@@@#. ..", -+".@@~@@@{. .", -+".@@@@@]. ", -+".@@@@^. ", -+".@@@@@/( ", -+".______:( ", -+"<[[[[[[[[} "}; -diff -up fltk-1.3.2/src/fl_cursor_none.xpm.cursor fltk-1.3.2/src/fl_cursor_none.xpm ---- fltk-1.3.2/src/fl_cursor_none.xpm.cursor 2013-01-30 16:07:59.534319820 +0100 -+++ fltk-1.3.2/src/fl_cursor_none.xpm 2013-01-30 16:07:59.534319820 +0100 -@@ -0,0 +1,19 @@ -+/* XPM */ -+static const char * fl_cursor_none_xpm[] = { -+"15 15 1 1", -+" c None", -+" ", -+" ", -+" ", -+" ", -+" ", -+" ", -+" ", -+" ", -+" ", -+" ", -+" ", -+" ", -+" ", -+" ", -+" "}; -diff -up fltk-1.3.2/src/fl_cursor_nwse.xpm.cursor fltk-1.3.2/src/fl_cursor_nwse.xpm ---- fltk-1.3.2/src/fl_cursor_nwse.xpm.cursor 2013-01-30 16:07:59.534319820 +0100 -+++ fltk-1.3.2/src/fl_cursor_nwse.xpm 2013-01-30 16:07:59.535319802 +0100 -@@ -0,0 +1,46 @@ -+/* XPM */ -+static const char * fl_cursor_nwse_xpm[] = { -+"15 15 28 1", -+" c None", -+". c #FFFFFF", -+"+ c #000000", -+"@ c #767676", -+"# c #4E4E4E", -+"$ c #0C0C0C", -+"% c #494949", -+"& c #1B1B1B", -+"* c #4D4D4D", -+"= c #363636", -+"- c #646464", -+"; c #515151", -+"> c #242424", -+", c #585858", -+"' c #545454", -+") c #6A6A6A", -+"! c #797979", -+"~ c #444444", -+"{ c #2E2E2E", -+"] c #3B3B3B", -+"^ c #0A0A0A", -+"/ c #F7F7F7", -+"( c #595959", -+"_ c #6B6B6B", -+": c #080808", -+"< c #FEFEFE", -+"[ c #FCFCFC", -+"} c #FDFDFD", -+".......... ", -+".++++++@. ", -+".+++++#. ", -+".++++$. ", -+".+++++%. ", -+".++&+++*. .", -+".+=.-+++;. ..", -+".>. .,+++'. .).", -+".. .#+++,.!+.", -+". .~+++{++.", -+" .]+++++.", -+" .^++++.", -+" /(+++++.", -+" /_::::::.", -+" <[[[[[[[[}"}; -diff -up fltk-1.3.2/src/fl_cursor_wait.xpm.cursor fltk-1.3.2/src/fl_cursor_wait.xpm ---- fltk-1.3.2/src/fl_cursor_wait.xpm.cursor 2013-01-30 16:07:59.535319802 +0100 -+++ fltk-1.3.2/src/fl_cursor_wait.xpm 2013-01-30 16:07:59.535319802 +0100 -@@ -0,0 +1,72 @@ -+/* XPM */ -+static const char * fl_cursor_wait_xpm[] = { -+"17 32 37 1", -+" c None", -+". c #FFFFFF", -+"+ c #2E2E2E", -+"@ c #202020", -+"# c #F1F1F1", -+"$ c #2D2D2D", -+"% c #000000", -+"& c #EDEDED", -+"* c #585858", -+"= c #575757", -+"- c #FBFBFB", -+"; c #848484", -+"> c #B8B8B8", -+", c #E5E5E5", -+"' c #F7F7F7", -+") c #181818", -+"! c #F0F0F0", -+"~ c #616161", -+"{ c #B7B7B7", -+"] c #F5F5F5", -+"^ c #050505", -+"/ c #D4D4D4", -+"( c #EEEEEE", -+"_ c #595959", -+": c #7B7B7B", -+"< c #E9E9E9", -+"[ c #131313", -+"} c #E3E3E3", -+"| c #767676", -+"1 c #505050", -+"2 c #F3F3F3", -+"3 c #2A2A2A", -+"4 c #070707", -+"5 c #343434", -+"6 c #939393", -+"7 c #191919", -+"8 c #6A6A6A", -+".................", -+".+@@@@@@@@@@@@@+.", -+".................", -+" #$%%%%%%%%%%%$# ", -+" &*%%%%%%%%%%%=& ", -+" -;%%%%%%%%%%%;- ", -+" >%%%%%%%%%%%> ", -+" ,%%%%%%%%%%%, ", -+" ')%%%%%%%%%)' ", -+" !~%%%%%%%%%~! ", -+" {%%%%%%%%%{ ", -+" ]^/...../^] ", -+" (_:.....:_( ", -+" <[}...}[< ", -+" !|1...1|! ", -+" 2[3.3[2 ", -+" 2[%.%[2 ", -+" !|%%.%%|! ", -+" <4%%.%%4< ", -+" (_%%%.%%%_( ", -+" ]^%%%.%%%^] ", -+" {%%%%.%%%%{ ", -+" !~%%%%.%%%%~! ", -+" ')%%%%.%%%%)' ", -+" ,%%56{.{65%%, ", -+" >%*.......*%> ", -+" -;7&.......&7;- ", -+" &*8.........8=& ", -+" #$%%%%%%%%%%%$# ", -+".................", -+".+@@@@@@@@@@@@@+.", -+"................."}; -diff -up fltk-1.3.2/src/Fl_win32.cxx.cursor fltk-1.3.2/src/Fl_win32.cxx ---- fltk-1.3.2/src/Fl_win32.cxx.cursor 2013-01-30 16:07:59.519320086 +0100 -+++ fltk-1.3.2/src/Fl_win32.cxx 2013-01-30 16:07:59.536319784 +0100 -@@ -1633,7 +1633,6 @@ void fl_fix_focus(); // in Fl.cxx - - char fl_show_iconic; // hack for Fl_Window::iconic() - // int fl_background_pixel = -1; // color to use for background --HCURSOR fl_default_cursor; - UINT fl_wake_msg = 0; - int fl_disable_transient_for; // secret method of removing TRANSIENT_FOR - -@@ -1682,7 +1681,7 @@ Fl_X* Fl_X::make(Fl_Window* w) { - if (!w->icon()) - w->icon((void *)LoadIcon(NULL, IDI_APPLICATION)); - wcw.hIcon = wcw.hIconSm = (HICON)w->icon(); -- wcw.hCursor = fl_default_cursor = LoadCursor(NULL, IDC_ARROW); -+ wcw.hCursor = LoadCursor(NULL, IDC_ARROW); - //uchar r,g,b; Fl::get_color(FL_GRAY,r,g,b); - //wc.hbrBackground = (HBRUSH)CreateSolidBrush(RGB(r,g,b)); - wcw.hbrBackground = NULL; -@@ -1774,7 +1773,8 @@ Fl_X* Fl_X::make(Fl_Window* w) { - x->setwindow(w); - x->region = 0; - x->private_dc = 0; -- x->cursor = fl_default_cursor; -+ x->cursor = LoadCursor(NULL, IDC_ARROW); -+ x->custom_cursor = 0; - if (!fl_codepage) fl_get_codepage(); - - WCHAR *lab = NULL; -@@ -2025,6 +2025,153 @@ void Fl_Window::label(const char *name,c - } - - //////////////////////////////////////////////////////////////// -+ -+#ifndef IDC_HAND -+# define IDC_HAND MAKEINTRESOURCE(32649) -+#endif // !IDC_HAND -+ -+int Fl_X::set_cursor(Fl_Cursor c) { -+ LPSTR n; -+ HCURSOR new_cursor; -+ -+ if (c == FL_CURSOR_NONE) -+ new_cursor = NULL; -+ else { -+ switch (c) { -+ case FL_CURSOR_ARROW: n = IDC_ARROW; break; -+ case FL_CURSOR_CROSS: n = IDC_CROSS; break; -+ case FL_CURSOR_WAIT: n = IDC_WAIT; break; -+ case FL_CURSOR_INSERT: n = IDC_IBEAM; break; -+ case FL_CURSOR_HAND: n = IDC_HAND; break; -+ case FL_CURSOR_HELP: n = IDC_HELP; break; -+ case FL_CURSOR_MOVE: n = IDC_SIZEALL; break; -+ case FL_CURSOR_N: -+ case FL_CURSOR_S: -+ // FIXME: Should probably have fallbacks for these instead -+ case FL_CURSOR_NS: n = IDC_SIZENS; break; -+ case FL_CURSOR_NE: -+ case FL_CURSOR_SW: -+ // FIXME: Dito. -+ case FL_CURSOR_NESW: n = IDC_SIZENESW; break; -+ case FL_CURSOR_E: -+ case FL_CURSOR_W: -+ // FIXME: Dito. -+ case FL_CURSOR_WE: n = IDC_SIZEWE; break; -+ case FL_CURSOR_SE: -+ case FL_CURSOR_NW: -+ // FIXME: Dito. -+ case FL_CURSOR_NWSE: n = IDC_SIZENWSE; break; -+ default: -+ return 0; -+ } -+ -+ new_cursor = LoadCursor(NULL, n); -+ if (new_cursor == NULL) -+ return 0; -+ } -+ -+ if ((cursor != NULL) && custom_cursor) -+ DestroyIcon(cursor); -+ -+ cursor = new_cursor; -+ custom_cursor = 0; -+ -+ SetCursor(cursor); -+ -+ return 1; -+} -+ -+int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) { -+ BITMAPV5HEADER bi; -+ HBITMAP bitmap, mask; -+ DWORD *bits; -+ HCURSOR new_cursor; -+ -+ if ((hotx < 0) || (hotx >= image->w())) -+ return 0; -+ if ((hoty < 0) || (hoty >= image->h())) -+ return 0; -+ -+ memset(&bi, 0, sizeof(BITMAPV5HEADER)); -+ -+ bi.bV5Size = sizeof(BITMAPV5HEADER); -+ bi.bV5Width = image->w(); -+ bi.bV5Height = -image->h(); // Negative for top-down -+ bi.bV5Planes = 1; -+ bi.bV5BitCount = 32; -+ bi.bV5Compression = BI_BITFIELDS; -+ bi.bV5RedMask = 0x00FF0000; -+ bi.bV5GreenMask = 0x0000FF00; -+ bi.bV5BlueMask = 0x000000FF; -+ bi.bV5AlphaMask = 0xFF000000; -+ -+ HDC hdc; -+ -+ hdc = GetDC(NULL); -+ bitmap = CreateDIBSection(hdc, (BITMAPINFO*)&bi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); -+ ReleaseDC(NULL, hdc); -+ -+ if (bits == NULL) -+ return 0; -+ -+ const uchar *i = (const uchar*)*image->data(); -+ for (int y = 0;y < image->h();y++) { -+ for (int x = 0;x < image->w();x++) { -+ switch (image->d()) { -+ case 1: -+ *bits = (0xff<<24) | (i[0]<<16) | (i[0]<<8) | i[0]; -+ break; -+ case 2: -+ *bits = (i[1]<<24) | (i[0]<<16) | (i[0]<<8) | i[0]; -+ break; -+ case 3: -+ *bits = (0xff<<24) | (i[0]<<16) | (i[1]<<8) | i[2]; -+ break; -+ case 4: -+ *bits = (i[3]<<24) | (i[0]<<16) | (i[1]<<8) | i[2]; -+ break; -+ } -+ i += image->d(); -+ bits++; -+ } -+ i += image->ld(); -+ } -+ -+ // A mask bitmap is still needed even though it isn't used -+ mask = CreateBitmap(image->w(),image->h(),1,1,NULL); -+ if (mask == NULL) { -+ DeleteObject(bitmap); -+ return 0; -+ } -+ -+ ICONINFO ii; -+ -+ ii.fIcon = FALSE; -+ ii.xHotspot = hotx; -+ ii.yHotspot = hoty; -+ ii.hbmMask = mask; -+ ii.hbmColor = bitmap; -+ -+ new_cursor = CreateIconIndirect(&ii); -+ -+ DeleteObject(bitmap); -+ DeleteObject(mask); -+ -+ if (new_cursor == NULL) -+ return 0; -+ -+ if ((cursor != NULL) && custom_cursor) -+ DestroyIcon(cursor); -+ -+ cursor = new_cursor; -+ custom_cursor = 1; -+ -+ SetCursor(cursor); -+ -+ return 1; -+} -+ -+//////////////////////////////////////////////////////////////// - // Implement the virtual functions for the base Fl_Window class: - - // If the box is a filled rectangle, we can make the redisplay *look* -diff -up fltk-1.3.2/src/Fl_Window.cxx.cursor fltk-1.3.2/src/Fl_Window.cxx ---- fltk-1.3.2/src/Fl_Window.cxx.cursor 2012-11-06 21:46:14.000000000 +0100 -+++ fltk-1.3.2/src/Fl_Window.cxx 2013-01-30 16:07:59.536319784 +0100 -@@ -62,8 +62,6 @@ void Fl_Window::_Fl_Window() { - Fl_Window::Fl_Window(int X,int Y,int W, int H, const char *l) - : Fl_Group(X, Y, W, H, l) { - cursor_default = FL_CURSOR_DEFAULT; -- cursor_fg = FL_BLACK; -- cursor_bg = FL_WHITE; - - _Fl_Window(); - set_flag(FORCE_POSITION); -@@ -73,8 +71,6 @@ Fl_Window::Fl_Window(int W, int H, const - // fix common user error of a missing end() with current(0): - : Fl_Group((Fl_Group::current(0),0), 0, W, H, l) { - cursor_default = FL_CURSOR_DEFAULT; -- cursor_fg = FL_BLACK; -- cursor_bg = FL_WHITE; - - _Fl_Window(); - clear_visible(); -diff -up fltk-1.3.2/src/Fl_x.cxx.cursor fltk-1.3.2/src/Fl_x.cxx ---- fltk-1.3.2/src/Fl_x.cxx.cursor 2013-01-30 16:07:59.512320211 +0100 -+++ fltk-1.3.2/src/Fl_x.cxx 2013-01-30 16:07:59.537319766 +0100 -@@ -59,6 +59,11 @@ static int xfixes_event_base = 0; - static bool have_xfixes = false; - # endif - -+# include <X11/cursorfont.h> -+ -+# if HAVE_XCURSOR -+# include <X11/Xcursor/Xcursor.h> -+# endif - static Fl_Xlib_Graphics_Driver fl_xlib_driver; - static Fl_Display_Device fl_xlib_display(&fl_xlib_driver); - Fl_Display_Device *Fl_Display_Device::_display = &fl_xlib_display;// the platform display -@@ -2259,6 +2264,94 @@ void Fl_Window::size_range_() { - } - - //////////////////////////////////////////////////////////////// -+ -+int Fl_X::set_cursor(Fl_Cursor c) { -+ unsigned int shape; -+ Cursor xc; -+ -+ switch (c) { -+ case FL_CURSOR_ARROW: shape = XC_left_ptr; break; -+ case FL_CURSOR_CROSS: shape = XC_tcross; break; -+ case FL_CURSOR_WAIT: shape = XC_watch; break; -+ case FL_CURSOR_INSERT: shape = XC_xterm; break; -+ case FL_CURSOR_HAND: shape = XC_hand2; break; -+ case FL_CURSOR_HELP: shape = XC_question_arrow; break; -+ case FL_CURSOR_MOVE: shape = XC_fleur; break; -+ case FL_CURSOR_NS: shape = XC_sb_v_double_arrow; break; -+ case FL_CURSOR_WE: shape = XC_sb_h_double_arrow; break; -+ case FL_CURSOR_NE: shape = XC_top_right_corner; break; -+ case FL_CURSOR_N: shape = XC_top_side; break; -+ case FL_CURSOR_NW: shape = XC_top_left_corner; break; -+ case FL_CURSOR_E: shape = XC_right_side; break; -+ case FL_CURSOR_W: shape = XC_left_side; break; -+ case FL_CURSOR_SE: shape = XC_bottom_right_corner; break; -+ case FL_CURSOR_S: shape = XC_bottom_side; break; -+ case FL_CURSOR_SW: shape = XC_bottom_left_corner; break; -+ default: -+ return 0; -+ } -+ -+ xc = XCreateFontCursor(fl_display, shape); -+ XDefineCursor(fl_display, xid, xc); -+ XFreeCursor(fl_display, xc); -+ -+ return 1; -+} -+ -+int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) { -+#if ! HAVE_XCURSOR -+ return 0; -+#else -+ XcursorImage *cursor; -+ Cursor xc; -+ -+ if ((hotx < 0) || (hotx >= image->w())) -+ return 0; -+ if ((hoty < 0) || (hoty >= image->h())) -+ return 0; -+ -+ cursor = XcursorImageCreate(image->w(), image->h()); -+ if (!cursor) -+ return 0; -+ -+ const uchar *i = (const uchar*)*image->data(); -+ XcursorPixel *o = cursor->pixels; -+ for (int y = 0;y < image->h();y++) { -+ for (int x = 0;x < image->w();x++) { -+ switch (image->d()) { -+ case 1: -+ *o = (0xff<<24) | (i[0]<<16) | (i[0]<<8) | i[0]; -+ break; -+ case 2: -+ *o = (i[1]<<24) | (i[0]<<16) | (i[0]<<8) | i[0]; -+ break; -+ case 3: -+ *o = (0xff<<24) | (i[0]<<16) | (i[1]<<8) | i[2]; -+ break; -+ case 4: -+ *o = (i[3]<<24) | (i[0]<<16) | (i[1]<<8) | i[2]; -+ break; -+ } -+ i += image->d(); -+ o++; -+ } -+ i += image->ld(); -+ } -+ -+ cursor->xhot = hotx; -+ cursor->yhot = hoty; -+ -+ xc = XcursorImageLoadCursor(fl_display, cursor); -+ XDefineCursor(fl_display, xid, xc); -+ XFreeCursor(fl_display, xc); -+ -+ XcursorImageDestroy(cursor); -+ -+ return 1; -+#endif -+} -+ -+//////////////////////////////////////////////////////////////// - - // returns pointer to the filename, or null if name ends with '/' - const char *fl_filename_name(const char *name) { -diff -up fltk-1.3.2/test/cursor.cxx.cursor fltk-1.3.2/test/cursor.cxx ---- fltk-1.3.2/test/cursor.cxx.cursor 2011-07-19 06:49:30.000000000 +0200 -+++ fltk-1.3.2/test/cursor.cxx 2013-01-30 16:07:59.537319766 +0100 -@@ -23,8 +23,6 @@ - #include <FL/fl_draw.H> - #include <FL/Fl_Box.H> - --Fl_Color fg = FL_BLACK; --Fl_Color bg = FL_WHITE; - Fl_Cursor cursor = FL_CURSOR_DEFAULT; - - Fl_Hor_Value_Slider *cursor_slider; -@@ -32,7 +30,7 @@ Fl_Hor_Value_Slider *cursor_slider; - void choice_cb(Fl_Widget *, void *v) { - cursor = (Fl_Cursor)(fl_intptr_t)v; - cursor_slider->value(cursor); -- fl_cursor(cursor,fg,bg); -+ fl_cursor(cursor); - } - - Fl_Menu_Item choices[] = { -@@ -48,8 +46,6 @@ Fl_Menu_Item choices[] = { - {"FL_CURSOR_WE",0,choice_cb,(void*)FL_CURSOR_WE}, - {"FL_CURSOR_NWSE",0,choice_cb,(void*)FL_CURSOR_NWSE}, - {"FL_CURSOR_NESW",0,choice_cb,(void*)FL_CURSOR_NESW}, -- {"FL_CURSOR_NONE",0,choice_cb,(void*)FL_CURSOR_NONE}, --#if 0 - {"FL_CURSOR_N",0,choice_cb,(void*)FL_CURSOR_N}, - {"FL_CURSOR_NE",0,choice_cb,(void*)FL_CURSOR_NE}, - {"FL_CURSOR_E",0,choice_cb,(void*)FL_CURSOR_E}, -@@ -58,26 +54,14 @@ Fl_Menu_Item choices[] = { - {"FL_CURSOR_SW",0,choice_cb,(void*)FL_CURSOR_SW}, - {"FL_CURSOR_W",0,choice_cb,(void*)FL_CURSOR_W}, - {"FL_CURSOR_NW",0,choice_cb,(void*)FL_CURSOR_NW}, --#endif -+ {"FL_CURSOR_NONE",0,choice_cb,(void*)FL_CURSOR_NONE}, - {0} - }; - - void setcursor(Fl_Widget *o, void *) { - Fl_Hor_Value_Slider *slider = (Fl_Hor_Value_Slider *)o; - cursor = Fl_Cursor((int)slider->value()); -- fl_cursor(cursor,fg,bg); --} -- --void setfg(Fl_Widget *o, void *) { -- Fl_Hor_Value_Slider *slider = (Fl_Hor_Value_Slider *)o; -- fg = Fl_Color((int)slider->value()); -- fl_cursor(cursor,fg,bg); --} -- --void setbg(Fl_Widget *o, void *) { -- Fl_Hor_Value_Slider *slider = (Fl_Hor_Value_Slider *)o; -- bg = Fl_Color((int)slider->value()); -- fl_cursor(cursor,fg,bg); -+ fl_cursor(cursor); - } - - // draw the label without any ^C or \nnn conversions: -@@ -103,29 +87,11 @@ int main(int argc, char **argv) { - slider1.align(FL_ALIGN_LEFT); - slider1.step(1); - slider1.precision(0); -- slider1.bounds(0,100); -+ slider1.bounds(0,255); - slider1.value(0); - slider1.callback(setcursor); - slider1.value(cursor); - -- Fl_Hor_Value_Slider slider2(80,220,310,30,"fgcolor:"); -- slider2.align(FL_ALIGN_LEFT); -- slider2.step(1); -- slider2.precision(0); -- slider2.bounds(0,255); -- slider2.value(0); -- slider2.callback(setfg); -- slider2.value(fg); -- -- Fl_Hor_Value_Slider slider3(80,260,310,30,"bgcolor:"); -- slider3.align(FL_ALIGN_LEFT); -- slider3.step(1); -- slider3.precision(0); -- slider3.bounds(0,255); -- slider3.value(0); -- slider3.callback(setbg); -- slider3.value(bg); -- - #if 0 - // draw the manual's diagram of cursors... - window.size(400,800); diff --git a/contrib/fltk/08-str2802-fltk-1.3.0-modal.patch b/contrib/fltk/08-str2802-fltk-1.3.0-modal.patch deleted file mode 100644 index 7b1b7913..00000000 --- a/contrib/fltk/08-str2802-fltk-1.3.0-modal.patch +++ /dev/null @@ -1,75 +0,0 @@ -diff -bur fltk-1.3.0r9619.org/src/Fl_cocoa.mm fltk-1.3.0r9619/src/Fl_cocoa.mm ---- fltk-1.3.0r9619.org/src/Fl_cocoa.mm 2012-06-19 12:54:43.694231638 +0200 -+++ fltk-1.3.0r9619/src/Fl_cocoa.mm 2012-06-19 12:57:05.899048602 +0200 -@@ -697,12 +697,9 @@ - return NO; // prevent the caption to be redrawn as active on click - // when another modal window is currently the key win - -- return !(w->tooltip_window() || w->menu_window()); -+ return !w->tooltip_window(); - } - --// TODO see if we really need a canBecomeMainWindow ... --#if 0 -- - - (BOOL)canBecomeMainWindow - { - if (Fl::modal_ && (Fl::modal_ != w)) -@@ -711,7 +708,6 @@ - - return !(w->tooltip_window() || w->menu_window()); - } --#endif - - @end - -diff -bur fltk-1.3.0r9619.org/src/Fl_win32.cxx fltk-1.3.0r9619/src/Fl_win32.cxx ---- fltk-1.3.0r9619.org/src/Fl_win32.cxx 2012-06-19 12:54:43.696231735 +0200 -+++ fltk-1.3.0r9619/src/Fl_win32.cxx 2012-06-19 12:54:43.803236862 +0200 -@@ -1065,6 +1065,10 @@ - break; - - case WM_SETFOCUS: -+ if ((Fl::modal_) && (Fl::modal_ != window)) { -+ SetFocus(fl_xid(Fl::modal_)); -+ return 0; -+ } - Fl::handle(FL_FOCUS, window); - break; - -@@ -1826,6 +1830,11 @@ - Fl::e_number = old_event; - w->redraw(); // force draw to happen - } -+ -+ // Needs to be done before ShowWindow() to get the correct behaviour -+ // when we get WM_SETFOCUS. -+ if (w->modal()) {Fl::modal_ = w; fl_fix_focus();} -+ - // If we've captured the mouse, we dont want to activate any - // other windows from the code, or we lose the capture. - ShowWindow(x->xid, !showit ? SW_SHOWMINNOACTIVE : -@@ -1843,7 +1852,6 @@ - } - } - -- if (w->modal()) {Fl::modal_ = w; fl_fix_focus();} - return x; - } - -diff -bur fltk-1.3.0r9619.org/src/Fl_x.cxx fltk-1.3.0r9619/src/Fl_x.cxx ---- fltk-1.3.0r9619.org/src/Fl_x.cxx 2012-06-19 12:54:43.697231783 +0200 -+++ fltk-1.3.0r9619/src/Fl_x.cxx 2012-06-19 12:54:43.804236911 +0200 -@@ -2101,6 +2101,12 @@ - while (wp->parent()) wp = wp->window(); - XSetTransientForHint(fl_display, xp->xid, fl_xid(wp)); - if (!wp->visible()) showit = 0; // guess that wm will not show it -+ if (win->modal()) { -+ Atom net_wm_state = XInternAtom (fl_display, "_NET_WM_STATE", 0); -+ Atom net_wm_state_skip_taskbar = XInternAtom (fl_display, "_NET_WM_STATE_MODAL", 0); -+ XChangeProperty (fl_display, xp->xid, net_wm_state, XA_ATOM, 32, -+ PropModeAppend, (unsigned char*) &net_wm_state_skip_taskbar, 1); -+ } - } - - // Make sure that borderless windows do not show in the task bar diff --git a/contrib/fltk/09-str2816-fltk-1.3.0-icons.patch b/contrib/fltk/09-str2816-fltk-1.3.0-icons.patch deleted file mode 100644 index 20b30b8b..00000000 --- a/contrib/fltk/09-str2816-fltk-1.3.0-icons.patch +++ /dev/null @@ -1,645 +0,0 @@ -diff -ur fltk-1.3.2.org/FL/Fl_Window.H fltk-1.3.2/FL/Fl_Window.H ---- fltk-1.3.2.org/FL/Fl_Window.H 2013-01-16 10:49:40.904228200 +0100 -+++ fltk-1.3.2/FL/Fl_Window.H 2013-01-16 10:49:55.554353925 +0100 -@@ -22,6 +22,10 @@ - #ifndef Fl_Window_H - #define Fl_Window_H - -+#ifdef WIN32 -+#include <windows.h> -+#endif -+ - #include "Fl_Group.H" - - #define FL_WINDOW 0xF0 ///< window type id all subclasses have type() >= this -@@ -73,9 +77,19 @@ - friend class Fl_X; - Fl_X *i; // points at the system-specific stuff - -+ struct icon_data { -+ const void *legacy_icon; -+ Fl_RGB_Image **icons; -+ int count; -+#ifdef WIN32 -+ HICON big_icon; -+ HICON small_icon; -+#endif -+ }; -+ - const char* iconlabel_; - char* xclass_; -- const void* icon_; -+ struct icon_data *icon_; - // size_range stuff: - int minw, minh, maxw, maxh; - int dw, dh, aspect; -@@ -121,6 +135,8 @@ - */ - int force_position() const { return ((flags() & FORCE_POSITION)?1:0); } - -+ void free_icons(); -+ - public: - - /** -@@ -350,6 +366,18 @@ - static const char *default_xclass(); - const char* xclass() const; - void xclass(const char* c); -+ -+ static void default_icon(const Fl_RGB_Image*); -+ static void default_icons(const Fl_RGB_Image*[], int); -+ void icon(const Fl_RGB_Image*); -+ void icons(const Fl_RGB_Image*[], int); -+ -+#ifdef WIN32 -+ static void default_icons(HICON big_icon, HICON small_icon); -+ void icons(HICON big_icon, HICON small_icon); -+#endif -+ -+ /* for legacy compatibility */ - const void* icon() const; - void icon(const void * ic); - -diff -ur fltk-1.3.2.org/FL/mac.H fltk-1.3.2/FL/mac.H ---- fltk-1.3.2.org/FL/mac.H 2013-01-16 10:49:40.904228200 +0100 -+++ fltk-1.3.2/FL/mac.H 2013-01-16 10:49:55.554353925 +0100 -@@ -120,6 +120,9 @@ - void collapse(void); - WindowRef window_ref(void); - void set_key_window(void); -+ // OS X doesn't have per window icons -+ static void set_default_icons(const Fl_RGB_Image*[], int) {}; -+ void set_icons() {}; - int set_cursor(Fl_Cursor); - int set_cursor(const Fl_RGB_Image*, int, int); - static CGImageRef CGImage_from_window_rect(Fl_Window *win, int x, int y, int w, int h); -diff -ur fltk-1.3.2.org/FL/win32.H fltk-1.3.2/FL/win32.H ---- fltk-1.3.2.org/FL/win32.H 2013-01-16 10:49:40.904228200 +0100 -+++ fltk-1.3.2/FL/win32.H 2013-01-16 10:49:55.555355617 +0100 -@@ -84,6 +84,9 @@ - void flush() {w->flush();} - void set_minmax(LPMINMAXINFO minmax); - void mapraise(); -+ static void set_default_icons(const Fl_RGB_Image*[], int); -+ static void set_default_icons(HICON, HICON); -+ void set_icons(); - int set_cursor(Fl_Cursor); - int set_cursor(const Fl_RGB_Image*, int, int); - static Fl_X* make(Fl_Window*); -diff -ur fltk-1.3.2.org/FL/x.H fltk-1.3.2/FL/x.H ---- fltk-1.3.2.org/FL/x.H 2013-01-16 10:49:40.904228200 +0100 -+++ fltk-1.3.2/FL/x.H 2013-01-16 10:49:55.555355617 +0100 -@@ -154,6 +154,8 @@ - static Fl_X* i(const Fl_Window* wi) {return wi->i;} - void setwindow(Fl_Window* wi) {w=wi; wi->i=this;} - void sendxjunk(); -+ static void set_default_icons(const Fl_RGB_Image*[], int); -+ void set_icons(); - int set_cursor(Fl_Cursor); - int set_cursor(const Fl_RGB_Image*, int, int); - static void make_xid(Fl_Window*,XVisualInfo* =fl_visual, Colormap=fl_colormap); -diff -ur fltk-1.3.2.org/src/Fl.cxx fltk-1.3.2/src/Fl.cxx ---- fltk-1.3.2.org/src/Fl.cxx 2013-01-16 10:49:40.895228113 +0100 -+++ fltk-1.3.2/src/Fl.cxx 2013-01-16 10:49:55.556137979 +0100 -@@ -1530,6 +1530,8 @@ - if (xclass_) { - free(xclass_); - } -+ free_icons(); -+ delete icon_; - } - - // FL_SHOW and FL_HIDE are called whenever the visibility of this widget -diff -ur fltk-1.3.2.org/src/Fl_win32.cxx fltk-1.3.2/src/Fl_win32.cxx ---- fltk-1.3.2.org/src/Fl_win32.cxx 2013-01-16 10:49:40.911227539 +0100 -+++ fltk-1.3.2/src/Fl_win32.cxx 2013-01-16 10:49:55.556137979 +0100 -@@ -1804,6 +1804,8 @@ - ); - if (lab) free(lab); - -+ x->set_icons(); -+ - if (w->fullscreen_active()) { - /* We need to make sure that the fullscreen is created on the - default monitor, ie the desktop where the shortcut is located -@@ -2034,71 +2036,19 @@ - - //////////////////////////////////////////////////////////////// - --#ifndef IDC_HAND --# define IDC_HAND MAKEINTRESOURCE(32649) --#endif // !IDC_HAND -- --int Fl_X::set_cursor(Fl_Cursor c) { -- LPSTR n; -- HCURSOR new_cursor; -- -- if (c == FL_CURSOR_NONE) -- new_cursor = NULL; -- else { -- switch (c) { -- case FL_CURSOR_ARROW: n = IDC_ARROW; break; -- case FL_CURSOR_CROSS: n = IDC_CROSS; break; -- case FL_CURSOR_WAIT: n = IDC_WAIT; break; -- case FL_CURSOR_INSERT: n = IDC_IBEAM; break; -- case FL_CURSOR_HAND: n = IDC_HAND; break; -- case FL_CURSOR_HELP: n = IDC_HELP; break; -- case FL_CURSOR_MOVE: n = IDC_SIZEALL; break; -- case FL_CURSOR_N: -- case FL_CURSOR_S: -- // FIXME: Should probably have fallbacks for these instead -- case FL_CURSOR_NS: n = IDC_SIZENS; break; -- case FL_CURSOR_NE: -- case FL_CURSOR_SW: -- // FIXME: Dito. -- case FL_CURSOR_NESW: n = IDC_SIZENESW; break; -- case FL_CURSOR_E: -- case FL_CURSOR_W: -- // FIXME: Dito. -- case FL_CURSOR_WE: n = IDC_SIZEWE; break; -- case FL_CURSOR_SE: -- case FL_CURSOR_NW: -- // FIXME: Dito. -- case FL_CURSOR_NWSE: n = IDC_SIZENWSE; break; -- default: -- return 0; -- } -- -- new_cursor = LoadCursor(NULL, n); -- if (new_cursor == NULL) -- return 0; -- } -- -- if ((cursor != NULL) && custom_cursor) -- DestroyIcon(cursor); -- -- cursor = new_cursor; -- custom_cursor = 0; -- -- SetCursor(cursor); -- -- return 1; --} -- --int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) { -+static HICON image_to_icon(const Fl_RGB_Image *image, bool is_icon=true, -+ int hotx = 0, int hoty = 0) { - BITMAPV5HEADER bi; - HBITMAP bitmap, mask; - DWORD *bits; -- HCURSOR new_cursor; -+ HICON icon; - -+ if (!is_icon) { - if ((hotx < 0) || (hotx >= image->w())) -- return 0; -+ return NULL; - if ((hoty < 0) || (hoty >= image->h())) -- return 0; -+ return NULL; -+ } - - memset(&bi, 0, sizeof(BITMAPV5HEADER)); - -@@ -2120,7 +2070,7 @@ - ReleaseDC(NULL, hdc); - - if (bits == NULL) -- return 0; -+ return NULL; - - const uchar *i = (const uchar*)*image->data(); - for (int y = 0;y < image->h();y++) { -@@ -2149,22 +2099,206 @@ - mask = CreateBitmap(image->w(),image->h(),1,1,NULL); - if (mask == NULL) { - DeleteObject(bitmap); -- return 0; -+ return NULL; - } - - ICONINFO ii; - -- ii.fIcon = FALSE; -+ ii.fIcon = is_icon; - ii.xHotspot = hotx; - ii.yHotspot = hoty; - ii.hbmMask = mask; - ii.hbmColor = bitmap; - -- new_cursor = CreateIconIndirect(&ii); -+ icon = CreateIconIndirect(&ii); - - DeleteObject(bitmap); - DeleteObject(mask); - -+ if (icon == NULL) -+ return NULL; -+ -+ return icon; -+} -+ -+//////////////////////////////////////////////////////////////// -+ -+static HICON default_big_icon = NULL; -+static HICON default_small_icon = NULL; -+ -+const Fl_RGB_Image *find_best_icon(int ideal_width, -+ const Fl_RGB_Image *icons[], int count) { -+ const Fl_RGB_Image *best; -+ -+ best = NULL; -+ -+ for (int i = 0;i < count;i++) { -+ if (best == NULL) -+ best = icons[i]; -+ else { -+ if (best->w() < ideal_width) { -+ if (icons[i]->w() > best->w()) -+ best = icons[i]; -+ } else { -+ if ((icons[i]->w() >= ideal_width) && -+ (icons[i]->w() < best->w())) -+ best = icons[i]; -+ } -+ } -+ } -+ -+ return best; -+} -+ -+void Fl_X::set_default_icons(const Fl_RGB_Image *icons[], int count) { -+ const Fl_RGB_Image *best_big, *best_small; -+ -+ if (default_big_icon != NULL) -+ DestroyIcon(default_big_icon); -+ if (default_small_icon != NULL) -+ DestroyIcon(default_small_icon); -+ -+ best_big = find_best_icon(GetSystemMetrics(SM_CXICON), icons, count); -+ best_small = find_best_icon(GetSystemMetrics(SM_CXSMICON), icons, count); -+ -+ if (best_big != NULL) -+ default_big_icon = image_to_icon(best_big); -+ else -+ default_big_icon = NULL; -+ -+ if (best_small != NULL) -+ default_small_icon = image_to_icon(best_small); -+ else -+ default_small_icon = NULL; -+} -+ -+void Fl_X::set_default_icons(HICON big_icon, HICON small_icon) { -+ if (default_big_icon != NULL) -+ DestroyIcon(default_big_icon); -+ if (default_small_icon != NULL) -+ DestroyIcon(default_small_icon); -+ -+ if (big_icon != NULL) -+ default_big_icon = CopyIcon(big_icon); -+ if (small_icon != NULL) -+ default_small_icon = CopyIcon(small_icon); -+} -+ -+void Fl_X::set_icons() { -+ HICON big_icon, small_icon; -+ -+ big_icon = NULL; -+ small_icon = NULL; -+ -+ if (w->icon_->count) { -+ const Fl_RGB_Image *best_big, *best_small; -+ -+ best_big = find_best_icon(GetSystemMetrics(SM_CXICON), -+ (const Fl_RGB_Image **)w->icon_->icons, -+ w->icon_->count); -+ best_small = find_best_icon(GetSystemMetrics(SM_CXSMICON), -+ (const Fl_RGB_Image **)w->icon_->icons, -+ w->icon_->count); -+ -+ if (best_big != NULL) -+ big_icon = image_to_icon(best_big); -+ if (best_small != NULL) -+ small_icon = image_to_icon(best_small); -+ } else { -+ big_icon = default_big_icon; -+ small_icon = default_small_icon; -+ } -+ -+ if (big_icon != NULL) -+ SendMessage(xid, WM_SETICON, ICON_BIG, (LPARAM)big_icon); -+ if (small_icon != NULL) -+ SendMessage(xid, WM_SETICON, ICON_SMALL, (LPARAM)small_icon); -+ -+ if (w->icon_->count) { -+ if (big_icon != NULL) -+ DestroyIcon(big_icon); -+ if (small_icon != NULL) -+ DestroyIcon(small_icon); -+ } -+} -+ -+void Fl_Window::default_icons(HICON big_icon, HICON small_icon) { -+ Fl_X::set_default_icons(big_icon, small_icon); -+} -+ -+void Fl_Window::icons(HICON big_icon, HICON small_icon) { -+ free_icons(); -+ -+ if (big_icon != NULL) -+ icon_->big_icon = CopyIcon(big_icon); -+ if (small_icon != NULL) -+ icon_->small_icon = CopyIcon(small_icon); -+ -+ if (i) -+ i->set_icons(); -+} -+ -+//////////////////////////////////////////////////////////////// -+ -+#ifndef IDC_HAND -+# define IDC_HAND MAKEINTRESOURCE(32649) -+#endif // !IDC_HAND -+ -+int Fl_X::set_cursor(Fl_Cursor c) { -+ LPSTR n; -+ HCURSOR new_cursor; -+ -+ if (c == FL_CURSOR_NONE) -+ new_cursor = NULL; -+ else { -+ switch (c) { -+ case FL_CURSOR_ARROW: n = IDC_ARROW; break; -+ case FL_CURSOR_CROSS: n = IDC_CROSS; break; -+ case FL_CURSOR_WAIT: n = IDC_WAIT; break; -+ case FL_CURSOR_INSERT: n = IDC_IBEAM; break; -+ case FL_CURSOR_HAND: n = IDC_HAND; break; -+ case FL_CURSOR_HELP: n = IDC_HELP; break; -+ case FL_CURSOR_MOVE: n = IDC_SIZEALL; break; -+ case FL_CURSOR_N: -+ case FL_CURSOR_S: -+ // FIXME: Should probably have fallbacks for these instead -+ case FL_CURSOR_NS: n = IDC_SIZENS; break; -+ case FL_CURSOR_NE: -+ case FL_CURSOR_SW: -+ // FIXME: Dito. -+ case FL_CURSOR_NESW: n = IDC_SIZENESW; break; -+ case FL_CURSOR_E: -+ case FL_CURSOR_W: -+ // FIXME: Dito. -+ case FL_CURSOR_WE: n = IDC_SIZEWE; break; -+ case FL_CURSOR_SE: -+ case FL_CURSOR_NW: -+ // FIXME: Dito. -+ case FL_CURSOR_NWSE: n = IDC_SIZENWSE; break; -+ default: -+ return 0; -+ } -+ -+ new_cursor = LoadCursor(NULL, n); -+ if (new_cursor == NULL) -+ return 0; -+ } -+ -+ if ((cursor != NULL) && custom_cursor) -+ DestroyIcon(cursor); -+ -+ cursor = new_cursor; -+ custom_cursor = 0; -+ -+ SetCursor(cursor); -+ -+ return 1; -+} -+ -+int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) { -+ HCURSOR new_cursor; -+ -+ new_cursor = image_to_icon(image, false, hotx, hoty); - if (new_cursor == NULL) - return 0; - -diff -ur fltk-1.3.2.org/src/Fl_Window.cxx fltk-1.3.2/src/Fl_Window.cxx ---- fltk-1.3.2.org/src/Fl_Window.cxx 2013-01-16 10:49:40.908130903 +0100 -+++ fltk-1.3.2/src/Fl_Window.cxx 2013-01-16 10:49:55.557353865 +0100 -@@ -23,6 +23,7 @@ - #include <config.h> - #include <FL/Fl.H> - #include <FL/x.H> -+#include <FL/Fl_RGB_Image.H> - #include <FL/Fl_Window.H> - #include <stdlib.h> - #include "flstring.h" -@@ -45,7 +46,8 @@ - } - i = 0; - xclass_ = 0; -- icon_ = 0; -+ icon_ = new icon_data; -+ memset(icon_, 0, sizeof(*icon_)); - iconlabel_ = 0; - resizable(0); - size_range_set = 0; -@@ -264,16 +266,68 @@ - } - } - -+void Fl_Window::default_icon(const Fl_RGB_Image *icon) { -+ default_icons(&icon, 1); -+} -+ -+void Fl_Window::default_icons(const Fl_RGB_Image **icons, int count) { -+ Fl_X::set_default_icons(icons, count); -+} -+ -+void Fl_Window::icon(const Fl_RGB_Image *icon) { -+ icons(&icon, 1); -+} -+ -+void Fl_Window::icons(const Fl_RGB_Image **icons, int count) { -+ free_icons(); -+ -+ if (count > 0) { -+ icon_->icons = new Fl_RGB_Image*[count]; -+ icon_->count = count; -+ // FIXME: Fl_RGB_Image lacks const modifiers on methods -+ for (int i = 0;i < count;i++) -+ icon_->icons[i] = (Fl_RGB_Image*)((Fl_RGB_Image*)icons[i])->copy(); -+ } -+ -+ if (i) -+ i->set_icons(); -+} -+ - /** Gets the current icon window target dependent data. */ - const void *Fl_Window::icon() const { -- return icon_; -+ return icon_->legacy_icon; - } - - /** Sets the current icon window target dependent data. */ - void Fl_Window::icon(const void * ic) { -- icon_ = ic; -+ free_icons(); -+ icon_->legacy_icon = ic; - } - -+void Fl_Window::free_icons() { -+ int i; -+ -+ icon_->legacy_icon = 0L; -+ -+ if (icon_->icons) { -+ for (i = 0;i < icon_->count;i++) -+ delete icon_->icons[i]; -+ delete [] icon_->icons; -+ icon_->icons = 0L; -+ } -+ -+ icon_->count = 0; -+ -+#ifdef WIN32 -+ if (icon_->big_icon) -+ DestroyIcon(icon_->big_icon); -+ if (icon_->small_icon) -+ DestroyIcon(icon_->small_icon); -+ -+ icon_->big_icon = NULL; -+ icon_->small_icon = NULL; -+#endif -+} - - // - // End of "$Id: Fl_Window.cxx 9706 2012-11-06 20:46:14Z matt $". -diff -ur fltk-1.3.2.org/src/Fl_x.cxx fltk-1.3.2/src/Fl_x.cxx ---- fltk-1.3.2.org/src/Fl_x.cxx 2013-01-16 10:49:40.912227213 +0100 -+++ fltk-1.3.2/src/Fl_x.cxx 2013-01-16 10:49:55.558137113 +0100 -@@ -345,6 +345,7 @@ - Atom fl_NET_WM_STATE; - Atom fl_NET_WM_STATE_FULLSCREEN; - Atom fl_NET_WORKAREA; -+Atom fl_NET_WM_ICON; - - /* - X defines 32-bit-entities to have a format value of max. 32, -@@ -709,6 +710,7 @@ - fl_NET_WM_STATE = XInternAtom(d, "_NET_WM_STATE", 0); - fl_NET_WM_STATE_FULLSCREEN = XInternAtom(d, "_NET_WM_STATE_FULLSCREEN", 0); - fl_NET_WORKAREA = XInternAtom(d, "_NET_WORKAREA", 0); -+ fl_NET_WM_ICON = XInternAtom(d, "_NET_WM_ICON", 0); - - if (sizeof(Atom) < 4) - atom_bits = sizeof(Atom) * 8; -@@ -2138,12 +2140,14 @@ - fl_show_iconic = 0; - showit = 0; - } -- if (win->icon()) { -- hints->icon_pixmap = (Pixmap)win->icon(); -+ if (win->icon_->legacy_icon) { -+ hints->icon_pixmap = (Pixmap)win->icon_->legacy_icon; - hints->flags |= IconPixmapHint; - } - XSetWMHints(fl_display, xp->xid, hints); - XFree(hints); -+ -+ xp->set_icons(); - } - - // set the window type for menu and tooltip windows to avoid animations (compiz) -@@ -2263,6 +2267,93 @@ - - //////////////////////////////////////////////////////////////// - -+static unsigned long *default_net_wm_icons = 0L; -+static size_t default_net_wm_icons_size = 0; -+ -+void icons_to_property(const Fl_RGB_Image *icons[], int count, -+ unsigned long **property, size_t *len) { -+ size_t sz; -+ unsigned long *data; -+ -+ sz = 0; -+ for (int i = 0;i < count;i++) -+ sz += 2 + icons[i]->w() * icons[i]->h(); -+ -+ // FIXME: Might want to sort the icons -+ -+ *property = data = new unsigned long[sz]; -+ *len = sz; -+ -+ for (int i = 0;i < count;i++) { -+ const Fl_RGB_Image *image; -+ -+ image = icons[i]; -+ -+ data[0] = image->w(); -+ data[1] = image->h(); -+ data += 2; -+ -+ const uchar *in = (const uchar*)*image->data(); -+ for (int y = 0;y < image->h();y++) { -+ for (int x = 0;x < image->w();x++) { -+ switch (image->d()) { -+ case 1: -+ *data = ( 0xff<<24) | (in[0]<<16) | (in[0]<<8) | in[0]; -+ break; -+ case 2: -+ *data = (in[1]<<24) | (in[0]<<16) | (in[0]<<8) | in[0]; -+ break; -+ case 3: -+ *data = ( 0xff<<24) | (in[0]<<16) | (in[1]<<8) | in[2]; -+ break; -+ case 4: -+ *data = (in[3]<<24) | (in[0]<<16) | (in[1]<<8) | in[2]; -+ break; -+ } -+ in += image->d(); -+ data++; -+ } -+ in += image->ld(); -+ } -+ } -+} -+ -+void Fl_X::set_default_icons(const Fl_RGB_Image *icons[], int count) { -+ if (default_net_wm_icons) { -+ delete [] default_net_wm_icons; -+ default_net_wm_icons = 0L; -+ default_net_wm_icons_size = 0; -+ } -+ -+ if (count > 0) -+ icons_to_property(icons, count, -+ &default_net_wm_icons, &default_net_wm_icons_size); -+} -+ -+void Fl_X::set_icons() { -+ unsigned long *net_wm_icons; -+ size_t net_wm_icons_size; -+ -+ if (w->icon_->count) { -+ icons_to_property((const Fl_RGB_Image **)w->icon_->icons, w->icon_->count, -+ &net_wm_icons, &net_wm_icons_size); -+ } else { -+ net_wm_icons = default_net_wm_icons; -+ net_wm_icons_size = default_net_wm_icons_size; -+ } -+ -+ XChangeProperty (fl_display, xid, fl_NET_WM_ICON, XA_CARDINAL, 32, -+ PropModeReplace, (unsigned char*) net_wm_icons, net_wm_icons_size); -+ -+ if (w->icon_->count) { -+ delete [] net_wm_icons; -+ net_wm_icons = 0L; -+ net_wm_icons_size = 0; -+ } -+} -+ -+//////////////////////////////////////////////////////////////// -+ - int Fl_X::set_cursor(Fl_Cursor c) { - unsigned int shape; - Cursor xc; diff --git a/contrib/fltk/10-str2860-fltk-1.3.x-screen_num.patch b/contrib/fltk/10-str2860-fltk-1.3.x-screen_num.patch deleted file mode 100644 index c157af61..00000000 --- a/contrib/fltk/10-str2860-fltk-1.3.x-screen_num.patch +++ /dev/null @@ -1,131 +0,0 @@ -diff -up fltk-1.3.0r9619/FL/Fl.H.screen_num fltk-1.3.0r9619/FL/Fl.H ---- fltk-1.3.0r9619/FL/Fl.H.screen_num 2012-07-03 13:49:28.663085580 +0200 -+++ fltk-1.3.0r9619/FL/Fl.H 2012-07-03 13:49:28.731084402 +0200 -@@ -806,6 +806,8 @@ public: - static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my); - static void screen_xywh(int &X, int &Y, int &W, int &H, int n); - static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh); -+ static int screen_num(int x, int y); -+ static int screen_num(int x, int y, int w, int h); - static void screen_dpi(float &h, float &v, int n=0); - static void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my); - static void screen_work_area(int &X, int &Y, int &W, int &H, int n); -diff -up fltk-1.3.0r9619/src/screen_xywh.cxx.screen_num fltk-1.3.0r9619/src/screen_xywh.cxx ---- fltk-1.3.0r9619/src/screen_xywh.cxx.screen_num 2012-03-23 17:47:53.000000000 +0100 -+++ fltk-1.3.0r9619/src/screen_xywh.cxx 2012-07-03 13:58:01.947195396 +0200 -@@ -215,21 +215,6 @@ int Fl::screen_count() { - return num_screens ? num_screens : 1; - } - --static int find_screen_with_point(int mx, int my) { -- int screen = 0; -- if (num_screens < 0) screen_init(); -- -- for (int i = 0; i < num_screens; i ++) { -- int sx, sy, sw, sh; -- Fl::screen_xywh(sx, sy, sw, sh, i); -- if ((mx >= sx) && (mx < (sx+sw)) && (my >= sy) && (my < (sy+sh))) { -- screen = i; -- break; -- } -- } -- return screen; --} -- - /** - Gets the bounding box of a screen - that contains the specified screen position \p mx, \p my -@@ -237,7 +222,7 @@ static int find_screen_with_point(int mx - \param[in] mx, my the absolute screen position - */ - void Fl::screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my) { -- screen_xywh(X, Y, W, H, find_screen_with_point(mx, my)); -+ screen_xywh(X, Y, W, H, screen_num(mx, my)); - } - - -@@ -248,7 +233,7 @@ void Fl::screen_xywh(int &X, int &Y, int - \param[in] mx, my the absolute screen position - */ - void Fl::screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my) { -- screen_work_area(X, Y, W, H, find_screen_with_point(mx, my)); -+ screen_work_area(X, Y, W, H, screen_num(mx, my)); - } - - /** -@@ -321,6 +306,38 @@ void Fl::screen_xywh(int &X, int &Y, int - #endif // WIN32 - } - -+/** -+ Gets the screen bounding rect for the screen -+ which intersects the most with the rectangle -+ defined by \p mx, \p my, \p mw, \p mh. -+ \param[out] X,Y,W,H the corresponding screen bounding box -+ \param[in] mx, my, mw, mh the rectangle to search for intersection with -+ \see void screen_xywh(int &X, int &Y, int &W, int &H, int n) -+ */ -+void Fl::screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh) { -+ screen_xywh(X, Y, W, H, screen_num(mx, my, mw, mh)); -+} -+ -+/** -+ Gets the screen number of a screen -+ that contains the specified screen position \p x, \p y -+ \param[in] x, y the absolute screen position -+*/ -+int Fl::screen_num(int x, int y) { -+ int screen = 0; -+ if (num_screens < 0) screen_init(); -+ -+ for (int i = 0; i < num_screens; i ++) { -+ int sx, sy, sw, sh; -+ Fl::screen_xywh(sx, sy, sw, sh, i); -+ if ((x >= sx) && (x < (sx+sw)) && (y >= sy) && (y < (sy+sh))) { -+ screen = i; -+ break; -+ } -+ } -+ return screen; -+} -+ - static inline float fl_intersection(int x1, int y1, int w1, int h1, - int x2, int y2, int w2, int h2) { - if(x1+w1 < x2 || x2+w2 < x1 || y1+h1 < y2 || y2+h2 < y1) -@@ -333,30 +350,27 @@ static inline float fl_intersection(int - } - - /** -- Gets the screen bounding rect for the screen -+ Gets the screen number for the screen - which intersects the most with the rectangle -- defined by \p mx, \p my, \p mw, \p mh. -- \param[out] X,Y,W,H the corresponding screen bounding box -- \param[in] mx, my, mw, mh the rectangle to search for intersection with -- \see void screen_xywh(int &X, int &Y, int &W, int &H, int n) -+ defined by \p x, \p y, \p w, \p h. -+ \param[in] x, y, w, h the rectangle to search for intersection with - */ --void Fl::screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh) { -+int Fl::screen_num(int x, int y, int w, int h) { - int best_screen = 0; - float best_intersection = 0.; - for(int i = 0; i < Fl::screen_count(); i++) { - int sx, sy, sw, sh; - Fl::screen_xywh(sx, sy, sw, sh, i); -- float sintersection = fl_intersection(mx, my, mw, mh, sx, sy, sw, sh); -+ float sintersection = fl_intersection(x, y, w, h, sx, sy, sw, sh); - if(sintersection > best_intersection) { - best_screen = i; - best_intersection = sintersection; - } - } -- screen_xywh(X, Y, W, H, best_screen); -+ return best_screen; - } - - -- - /** - Gets the screen resolution in dots-per-inch for the given screen. - \param[out] h, v horizontal and vertical resolution diff --git a/contrib/fltk/11-str2860-fltk-1.3.x-multihead.patch b/contrib/fltk/11-str2860-fltk-1.3.x-multihead.patch deleted file mode 100644 index e4a010aa..00000000 --- a/contrib/fltk/11-str2860-fltk-1.3.x-multihead.patch +++ /dev/null @@ -1,468 +0,0 @@ -diff -urp fltk-1.3.2.org/FL/Fl_Window.H fltk-1.3.2/FL/Fl_Window.H ---- fltk-1.3.2.org/FL/Fl_Window.H 2013-01-16 10:52:33.017228122 +0100 -+++ fltk-1.3.2/FL/Fl_Window.H 2013-01-16 10:52:47.876478968 +0100 -@@ -54,7 +54,7 @@ class Fl_RGB_Image; - class FL_EXPORT Fl_Window : public Fl_Group { - - static char *default_xclass_; -- // Note: we must use separate statements for each of the following 4 variables, -+ // Note: we must use separate statements for each of the following 8 variables, - // with the static attribute, otherwise MS VC++ 2008/2010 complains :-( - // AlbrechtS 04/2012 - #if FLTK_ABI_VERSION < 10301 -@@ -73,6 +73,22 @@ class FL_EXPORT Fl_Window : public Fl_Gr - static // when these members are static, ABI compatibility with 1.3.0 is respected - #endif - int no_fullscreen_h; -+#if FLTK_ABI_VERSION < 10302 -+ static // when these members are static, ABI compatibility with 1.3.0 is respected -+#endif -+ int fullscreen_screen_top; -+#if FLTK_ABI_VERSION < 10302 -+ static // when these members are static, ABI compatibility with 1.3.0 is respected -+#endif -+ int fullscreen_screen_bottom; -+#if FLTK_ABI_VERSION < 10302 -+ static // when these members are static, ABI compatibility with 1.3.0 is respected -+#endif -+ int fullscreen_screen_left; -+#if FLTK_ABI_VERSION < 10302 -+ static // when these members are static, ABI compatibility with 1.3.0 is respected -+#endif -+ int fullscreen_screen_right; - - friend class Fl_X; - Fl_X *i; // points at the system-specific stuff -@@ -430,13 +446,15 @@ public: - */ - void show(int argc, char **argv); - /** -- Makes the window completely fill the screen, without any window -- manager border visible. You must use fullscreen_off() to undo -- this. -+ Makes the window completely fill one or more screens, without any -+ window manager border visible. You must use fullscreen_off() to -+ undo this. - - \note On some platforms, this can result in the keyboard being - grabbed. The window may also be recreated, meaning hide() and - show() will be called. -+ -+ \see void Fl_Window::fullscreen_screens() - */ - void fullscreen(); - /** -@@ -453,6 +471,17 @@ public: - */ - unsigned int fullscreen_active() const { return flags() & FULLSCREEN; } - /** -+ Sets which screens should be used when this window is in fullscreen -+ mode. The window will be resized to the top of the screen with index -+ \p top, the bottom of the screen with index \p bottom, etc. -+ -+ If this method is never called, or if any argument is < 0, then the -+ window will be resized to fill the screen it is currently on. -+ -+ \see void Fl_Window::fullscreen() -+ */ -+ void fullscreen_screens(int top, int bottom, int left, int right); -+ /** - Iconifies the window. If you call this when shown() is false - it will show() it as an icon. If the window is already - iconified this does nothing. -diff -urp fltk-1.3.2.org/FL/win32.H fltk-1.3.2/FL/win32.H ---- fltk-1.3.2.org/FL/win32.H 2013-01-16 10:52:33.017228122 +0100 -+++ fltk-1.3.2/FL/win32.H 2013-01-16 10:52:47.876478968 +0100 -@@ -80,6 +80,7 @@ public: - static Fl_X* i(const Fl_Window* w) {return w->i;} - static int fake_X_wm(const Fl_Window* w,int &X, int &Y, - int &bt,int &bx,int &by); -+ void make_fullscreen(int X, int Y, int W, int H); - void setwindow(Fl_Window* wi) {w=wi; wi->i=this;} - void flush() {w->flush();} - void set_minmax(LPMINMAXINFO minmax); -diff -urp fltk-1.3.2.org/src/Fl_cocoa.mm fltk-1.3.2/src/Fl_cocoa.mm ---- fltk-1.3.2.org/src/Fl_cocoa.mm 2013-01-16 10:52:33.014229574 +0100 -+++ fltk-1.3.2/src/Fl_cocoa.mm 2013-01-16 10:52:47.877480606 +0100 -@@ -2438,9 +2438,32 @@ void Fl_X::make(Fl_Window* w) - - NSRect crect; - if (w->fullscreen_active()) { -- int sx, sy, sw, sh; -- Fl::screen_xywh(sx, sy, sw, sh, w->x(), w->y(), w->w(), w->h()); -- w->resize(sx, sy, sw, sh); -+ int top, bottom, left, right; -+ int sx, sy, sw, sh, X, Y, W, H; -+ -+ top = w->fullscreen_screen_top; -+ bottom = w->fullscreen_screen_bottom; -+ left = w->fullscreen_screen_left; -+ right = w->fullscreen_screen_right; -+ -+ if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) { -+ top = Fl::screen_num(w->x(), w->y(), w->w(), w->h()); -+ bottom = top; -+ left = top; -+ right = top; -+ } -+ -+ Fl::screen_xywh(sx, sy, sw, sh, top); -+ Y = sy; -+ Fl::screen_xywh(sx, sy, sw, sh, bottom); -+ H = sy + sh - Y; -+ Fl::screen_xywh(sx, sy, sw, sh, left); -+ X = sx; -+ Fl::screen_xywh(sx, sy, sw, sh, right); -+ W = sx + sw - X; -+ -+ w->resize(X, Y, W, H); -+ - winstyle = NSBorderlessWindowMask; - winlevel = NSStatusWindowLevel; - } -diff -urp fltk-1.3.2.org/src/Fl_win32.cxx fltk-1.3.2/src/Fl_win32.cxx ---- fltk-1.3.2.org/src/Fl_win32.cxx 2013-01-16 10:52:33.019230734 +0100 -+++ fltk-1.3.2/src/Fl_win32.cxx 2013-01-16 10:52:47.878480504 +0100 -@@ -1493,7 +1493,6 @@ int Fl_X::fake_X_wm(const Fl_Window* w,i - Y+=yoff; - - if (w->fullscreen_active()) { -- X = Y = 0; - bx = by = bt = 0; - } - -@@ -1547,19 +1546,42 @@ void Fl_Window::resize(int X,int Y,int W - } - } - --static void make_fullscreen(Fl_Window *w, Window xid, int X, int Y, int W, int H) { -+void Fl_X::make_fullscreen(int X, int Y, int W, int H) { -+ int top, bottom, left, right; - int sx, sy, sw, sh; -- Fl::screen_xywh(sx, sy, sw, sh, X, Y, W, H); -+ -+ top = w->fullscreen_screen_top; -+ bottom = w->fullscreen_screen_bottom; -+ left = w->fullscreen_screen_left; -+ right = w->fullscreen_screen_right; -+ -+ if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) { -+ top = Fl::screen_num(X, Y, W, H); -+ bottom = top; -+ left = top; -+ right = top; -+ } -+ -+ Fl::screen_xywh(sx, sy, sw, sh, top); -+ Y = sy; -+ Fl::screen_xywh(sx, sy, sw, sh, bottom); -+ H = sy + sh - Y; -+ Fl::screen_xywh(sx, sy, sw, sh, left); -+ X = sx; -+ Fl::screen_xywh(sx, sy, sw, sh, right); -+ W = sx + sw - X; -+ - DWORD flags = GetWindowLong(xid, GWL_STYLE); - flags = flags & ~(WS_THICKFRAME|WS_CAPTION); - SetWindowLong(xid, GWL_STYLE, flags); -+ - // SWP_NOSENDCHANGING is so that we can override size limits -- SetWindowPos(xid, HWND_TOP, sx, sy, sw, sh, SWP_NOSENDCHANGING | SWP_FRAMECHANGED); -+ SetWindowPos(xid, HWND_TOP, X, Y, W, H, SWP_NOSENDCHANGING | SWP_FRAMECHANGED); - } - - void Fl_Window::fullscreen_x() { - _set_fullscreen(); -- make_fullscreen(this, fl_xid(this), x(), y(), w(), h()); -+ i->make_fullscreen(x(), y(), w(), h()); - Fl::handle(FL_FULLSCREEN, this); - } - -@@ -1814,8 +1836,8 @@ Fl_X* Fl_X::make(Fl_Window* w) { - monitor the window was placed on. */ - RECT rect; - GetWindowRect(x->xid, &rect); -- make_fullscreen(w, x->xid, rect.left, rect.top, -- rect.right - rect.left, rect.bottom - rect.top); -+ x->make_fullscreen(rect.left, rect.top, -+ rect.right - rect.left, rect.bottom - rect.top); - } - - x->next = Fl_X::first; -diff -urp fltk-1.3.2.org/src/Fl_Window_fullscreen.cxx fltk-1.3.2/src/Fl_Window_fullscreen.cxx ---- fltk-1.3.2.org/src/Fl_Window_fullscreen.cxx 2012-11-06 21:46:14.000000000 +0100 -+++ fltk-1.3.2/src/Fl_Window_fullscreen.cxx 2013-01-16 10:52:47.879480608 +0100 -@@ -36,6 +36,10 @@ int Fl_Window::no_fullscreen_x = 0; - int Fl_Window::no_fullscreen_y = 0; - int Fl_Window::no_fullscreen_w = 0; - int Fl_Window::no_fullscreen_h = 0; -+int Fl_Window::fullscreen_screen_top = -1; -+int Fl_Window::fullscreen_screen_bottom = -1; -+int Fl_Window::fullscreen_screen_left = -1; -+int Fl_Window::fullscreen_screen_right = -1; - #endif - - void Fl_Window::border(int b) { -@@ -95,6 +99,23 @@ void Fl_Window::fullscreen_off() { - fullscreen_off(no_fullscreen_x, no_fullscreen_y, no_fullscreen_w, no_fullscreen_h); - } - -+void Fl_Window::fullscreen_screens(int top, int bottom, int left, int right) { -+ if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) { -+ fullscreen_screen_top = -1; -+ fullscreen_screen_bottom = -1; -+ fullscreen_screen_left = -1; -+ fullscreen_screen_right = -1; -+ } else { -+ fullscreen_screen_top = top; -+ fullscreen_screen_bottom = bottom; -+ fullscreen_screen_left = left; -+ fullscreen_screen_right = right; -+ } -+ -+ if (shown() && (flags() & Fl_Widget::FULLSCREEN)) -+ fullscreen_x(); -+} -+ - - // - // End of "$Id: Fl_Window_fullscreen.cxx 9706 2012-11-06 20:46:14Z matt $". -diff -urp fltk-1.3.2.org/src/Fl_x.cxx fltk-1.3.2/src/Fl_x.cxx ---- fltk-1.3.2.org/src/Fl_x.cxx 2013-01-16 10:52:33.020228202 +0100 -+++ fltk-1.3.2/src/Fl_x.cxx 2013-01-16 10:52:47.880480556 +0100 -@@ -344,6 +344,7 @@ Atom fl_NET_WM_ICON_NAME; // utf8 aware - Atom fl_NET_SUPPORTING_WM_CHECK; - Atom fl_NET_WM_STATE; - Atom fl_NET_WM_STATE_FULLSCREEN; -+Atom fl_NET_WM_FULLSCREEN_MONITORS; - Atom fl_NET_WORKAREA; - Atom fl_NET_WM_ICON; - -@@ -709,6 +710,7 @@ void fl_open_display(Display* d) { - fl_NET_SUPPORTING_WM_CHECK = XInternAtom(d, "_NET_SUPPORTING_WM_CHECK", 0); - fl_NET_WM_STATE = XInternAtom(d, "_NET_WM_STATE", 0); - fl_NET_WM_STATE_FULLSCREEN = XInternAtom(d, "_NET_WM_STATE_FULLSCREEN", 0); -+ fl_NET_WM_FULLSCREEN_MONITORS = XInternAtom(d, "_NET_WM_FULLSCREEN_MONITORS", 0); - fl_NET_WORKAREA = XInternAtom(d, "_NET_WORKAREA", 0); - fl_NET_WM_ICON = XInternAtom(d, "_NET_WM_ICON", 0); - -@@ -1872,22 +1874,30 @@ void Fl_Window::resize(int X,int Y,int W - #define _NET_WM_STATE_ADD 1 /* add/set property */ - #define _NET_WM_STATE_TOGGLE 2 /* toggle property */ - --static void send_wm_state_event(Window wnd, int add, Atom prop) { -+static void send_wm_event(Window wnd, Atom message, -+ unsigned long d0, unsigned long d1=0, -+ unsigned long d2=0, unsigned long d3=0, -+ unsigned long d4=0) { - XEvent e; - e.xany.type = ClientMessage; - e.xany.window = wnd; -- e.xclient.message_type = fl_NET_WM_STATE; -+ e.xclient.message_type = message; - e.xclient.format = 32; -- e.xclient.data.l[0] = add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE; -- e.xclient.data.l[1] = prop; -- e.xclient.data.l[2] = 0; -- e.xclient.data.l[3] = 0; -- e.xclient.data.l[4] = 0; -+ e.xclient.data.l[0] = d0; -+ e.xclient.data.l[1] = d1; -+ e.xclient.data.l[2] = d2; -+ e.xclient.data.l[3] = d3; -+ e.xclient.data.l[4] = d4; - XSendEvent(fl_display, RootWindow(fl_display, fl_screen), - 0, SubstructureNotifyMask | SubstructureRedirectMask, - &e); - } - -+static void send_wm_state_event(Window wnd, int add, Atom prop) { -+ send_wm_event(wnd, fl_NET_WM_STATE, -+ add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE, prop); -+} -+ - int Fl_X::ewmh_supported() { - static int result = -1; - -@@ -1911,6 +1921,22 @@ int Fl_X::ewmh_supported() { - /* Change an existing window to fullscreen */ - void Fl_Window::fullscreen_x() { - if (Fl_X::ewmh_supported()) { -+ int top, bottom, left, right; -+ -+ top = fullscreen_screen_top; -+ bottom = fullscreen_screen_bottom; -+ left = fullscreen_screen_left; -+ right = fullscreen_screen_right; -+ -+ if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) { -+ top = Fl::screen_num(x(), y(), w(), h()); -+ bottom = top; -+ left = top; -+ right = top; -+ } -+ -+ send_wm_event(fl_xid(this), fl_NET_WM_FULLSCREEN_MONITORS, -+ top, bottom, left, right); - send_wm_state_event(fl_xid(this), 1, fl_NET_WM_STATE_FULLSCREEN); - } else { - _set_fullscreen(); -@@ -1997,7 +2023,7 @@ void Fl_X::make_xid(Fl_Window* win, XVis - // force the window to be on-screen. Usually the X window manager - // does this, but a few don't, so we do it here for consistency: - int scr_x, scr_y, scr_w, scr_h; -- Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h, X, Y); -+ Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h, X, Y, W, H); - - if (win->border()) { - // ensure border is on screen: -@@ -2026,6 +2052,23 @@ void Fl_X::make_xid(Fl_Window* win, XVis - return; - } - -+ // Compute which screen(s) we should be on if we want to go fullscreen -+ int fullscreen_top, fullscreen_bottom, fullscreen_left, fullscreen_right; -+ -+ fullscreen_top = win->fullscreen_screen_top; -+ fullscreen_bottom = win->fullscreen_screen_bottom; -+ fullscreen_left = win->fullscreen_screen_left; -+ fullscreen_right = win->fullscreen_screen_right; -+ -+ if ((fullscreen_top < 0) || (fullscreen_bottom < 0) || -+ (fullscreen_left < 0) || (fullscreen_right < 0)) { -+ fullscreen_top = Fl::screen_num(X, Y, W, H); -+ fullscreen_bottom = fullscreen_top; -+ fullscreen_left = fullscreen_top; -+ fullscreen_right = fullscreen_top; -+ } -+ -+ - ulong root = win->parent() ? - fl_xid(win->window()) : RootWindow(fl_display, fl_screen); - -@@ -2049,9 +2092,17 @@ void Fl_X::make_xid(Fl_Window* win, XVis - // border, and cannot grab without an existing window. Besides, - // there is no clear_override(). - if (win->flags() & Fl_Widget::FULLSCREEN && !Fl_X::ewmh_supported()) { -+ int sx, sy, sw, sh; - attr.override_redirect = 1; - mask |= CWOverrideRedirect; -- Fl::screen_xywh(X, Y, W, H, X, Y, W, H); -+ Fl::screen_xywh(sx, sy, sw, sh, fullscreen_left); -+ X = sx; -+ Fl::screen_xywh(sx, sy, sw, sh, fullscreen_right); -+ W = sx + sw - X; -+ Fl::screen_xywh(sx, sy, sw, sh, fullscreen_top); -+ Y = sy; -+ Fl::screen_xywh(sx, sy, sw, sh, fullscreen_bottom); -+ H = sy + sh - Y; - } - - if (fl_background_pixel >= 0) { -@@ -2122,6 +2173,13 @@ void Fl_X::make_xid(Fl_Window* win, XVis - - // If asked for, create fullscreen - if (win->flags() & Fl_Widget::FULLSCREEN && Fl_X::ewmh_supported()) { -+ unsigned long data[4]; -+ data[0] = fullscreen_top; -+ data[1] = fullscreen_bottom; -+ data[2] = fullscreen_left; -+ data[3] = fullscreen_right; -+ XChangeProperty (fl_display, xp->xid, fl_NET_WM_FULLSCREEN_MONITORS, XA_ATOM, 32, -+ PropModeReplace, (unsigned char*) data, 4); - XChangeProperty (fl_display, xp->xid, fl_NET_WM_STATE, XA_ATOM, 32, - PropModeAppend, (unsigned char*) &fl_NET_WM_STATE_FULLSCREEN, 1); - } -diff -urp fltk-1.3.2.org/test/fullscreen.cxx fltk-1.3.2/test/fullscreen.cxx ---- fltk-1.3.2.org/test/fullscreen.cxx 2012-06-14 17:09:46.000000000 +0200 -+++ fltk-1.3.2/test/fullscreen.cxx 2013-01-16 10:52:47.881104801 +0100 -@@ -127,7 +127,7 @@ class fullscreen_window : public Fl_Sing - fullscreen_window(int W, int H, const char *t=0); - int handle (int e); - Fl_Toggle_Light_Button *b3; -- -+ Fl_Toggle_Light_Button *b4; - }; - - fullscreen_window::fullscreen_window(int W, int H, const char *t) : Fl_Single_Window(W, H, t) { -@@ -170,23 +170,54 @@ void border_cb(Fl_Widget *o, void *p) { - #endif - } - --int px,py,pw,ph; - Fl_Button *border_button; - void fullscreen_cb(Fl_Widget *o, void *p) { - Fl_Window *w = (Fl_Window *)p; - int d = ((Fl_Button *)o)->value(); - if (d) { -- px = w->x(); -- py = w->y(); -- pw = w->w(); -- ph = w->h(); -+ if (((fullscreen_window*)w)->b4->value()) { -+ int top, bottom, left, right; -+ int top_y, bottom_y, left_x, right_x; -+ -+ int sx, sy, sw, sh; -+ -+ top = bottom = left = right = 0; -+ -+ Fl::screen_xywh(sx, sy, sw, sh, 0); -+ top_y = sy; -+ bottom_y = sy + sh; -+ left_x = sx; -+ right_x = sx + sw; -+ -+ for (int i = 1;i < Fl::screen_count();i++) { -+ Fl::screen_xywh(sx, sy, sw, sh, i); -+ if (sy < top_y) { -+ top = i; -+ top_y = sy; -+ } -+ if ((sy + sh) > bottom_y) { -+ bottom = i; -+ bottom_y = sy + sh; -+ } -+ if (sx < left_x) { -+ left = i; -+ left_x = sx; -+ } -+ if ((sx + sw) > right_x) { -+ right = i; -+ right_x = sx + sw; -+ } -+ } -+ -+ w->fullscreen_screens(top, bottom, left, right); -+ } else { -+ w->fullscreen_screens(-1, -1, -1, -1); -+ } - w->fullscreen(); -- w->override(); - #ifndef WIN32 // update our border state in case border was turned off - border_button->value(w->border()); - #endif - } else { -- //w->fullscreen_off(px,py,pw,ph); - w->fullscreen_off(); - } - } -@@ -219,7 +250,7 @@ void exit_cb(Fl_Widget *, void *) { - exit(0); - } - --#define NUMB 7 -+#define NUMB 8 - - int twowindow = 0; - int initfull = 0; -@@ -284,6 +315,9 @@ int main(int argc, char **argv) { - window.b3->callback(fullscreen_cb,w); - y+=30; - -+ window.b4 = new Fl_Toggle_Light_Button(50,y,window.w()-60,30,"All Screens"); -+ y+=30; -+ - Fl_Button eb(50,y,window.w()-60,30,"Exit"); - eb.callback(exit_cb); - y+=30; diff --git a/contrib/fltk/12-fltk-1.3.2-xhandlers.patch b/contrib/fltk/12-fltk-1.3.2-xhandlers.patch deleted file mode 100644 index 2d25d343..00000000 --- a/contrib/fltk/12-fltk-1.3.2-xhandlers.patch +++ /dev/null @@ -1,203 +0,0 @@ -diff -up fltk-1.3.2/FL/Fl.H.xhandlers fltk-1.3.2/FL/Fl.H ---- fltk-1.3.2/FL/Fl.H.xhandlers 2014-07-22 15:23:18.087334467 +0200 -+++ fltk-1.3.2/FL/Fl.H 2014-07-22 15:23:18.094334589 +0200 -@@ -96,6 +96,9 @@ typedef void (*Fl_FD_Handler)(FL_SOCKET - /** Signature of add_handler functions passed as parameters */ - typedef int (*Fl_Event_Handler)(int event); - -+/** Signature of add_system_handler functions passed as parameters */ -+typedef int (*Fl_System_Handler)(void *event, void *data); -+ - /** Signature of set_abort functions passed as parameters */ - typedef void (*Fl_Abort_Handler)(const char *format,...); - -@@ -712,6 +715,8 @@ public: - static void focus(Fl_Widget*); - static void add_handler(Fl_Event_Handler h); - static void remove_handler(Fl_Event_Handler h); -+ static void add_system_handler(Fl_System_Handler h, void *data); -+ static void remove_system_handler(Fl_System_Handler h); - static void event_dispatch(Fl_Event_Dispatch d); - static Fl_Event_Dispatch event_dispatch(); - /** @} */ -diff -up fltk-1.3.2/src/Fl_cocoa.mm.xhandlers fltk-1.3.2/src/Fl_cocoa.mm ---- fltk-1.3.2/src/Fl_cocoa.mm.xhandlers 2014-07-22 15:23:18.089334502 +0200 -+++ fltk-1.3.2/src/Fl_cocoa.mm 2014-07-22 15:23:18.095334607 +0200 -@@ -1269,6 +1269,8 @@ void fl_open_callback(void (*cb)(const c - } - @end - -+extern int fl_send_system_handlers(void *e); -+ - static void clipboard_check(void); - - @implementation FLApplication -@@ -1276,6 +1278,10 @@ static void clipboard_check(void); - { - // update clipboard status - clipboard_check(); -+ -+ if (fl_send_system_handlers(theEvent)) -+ return; -+ - NSEventType type = [theEvent type]; - if (type == NSLeftMouseDown) { - fl_lock_function(); -diff -up fltk-1.3.2/src/Fl.cxx.xhandlers fltk-1.3.2/src/Fl.cxx ---- fltk-1.3.2/src/Fl.cxx.xhandlers 2014-07-22 15:23:18.085334432 +0200 -+++ fltk-1.3.2/src/Fl.cxx 2014-07-22 15:23:18.095334607 +0200 -@@ -891,6 +891,83 @@ static int send_handlers(int e) { - return 0; - } - -+ -+//////////////////////////////////////////////////////////////// -+// System event handlers: -+ -+ -+struct system_handler_link { -+ Fl_System_Handler handle; -+ void *data; -+ system_handler_link *next; -+}; -+ -+ -+static system_handler_link *sys_handlers = 0; -+ -+ -+/** -+ \brief Install a function to intercept system events. -+ -+ FLTK calls each of these functions as soon as a new system event is -+ received. The processing will stop at the first function to return -+ non-zero. If all functions return zero then the event is passed on -+ for normal handling by FLTK. -+ -+ Each function will be called with a pointer to the system event as -+ the first argument and \p data as the second argument. The system -+ event pointer will always be void *, but will point to different -+ objects depending on the platform: -+ - X11: XEvent -+ - Windows: MSG -+ - OS X: NSEvent -+ -+ \param ha The event handler function to register -+ \param data User data to include on each call -+ -+ \see Fl::remove_system_handler(Fl_System_Handler) -+*/ -+void Fl::add_system_handler(Fl_System_Handler ha, void *data) { -+ system_handler_link *l = new system_handler_link; -+ l->handle = ha; -+ l->data = data; -+ l->next = sys_handlers; -+ sys_handlers = l; -+} -+ -+ -+/** -+ Removes a previously added system event handler. -+ -+ \param ha The event handler function to remove -+ -+ \see Fl::add_system_handler(Fl_System_Handler) -+*/ -+void Fl::remove_system_handler(Fl_System_Handler ha) { -+ system_handler_link *l, *p; -+ -+ // Search for the handler in the list... -+ for (l = sys_handlers, p = 0; l && l->handle != ha; p = l, l = l->next); -+ -+ if (l) { -+ // Found it, so remove it from the list... -+ if (p) p->next = l->next; -+ else sys_handlers = l->next; -+ -+ // And free the record... -+ delete l; -+ } -+} -+ -+int fl_send_system_handlers(void *e) { -+ for (const system_handler_link *hl = sys_handlers; hl; hl = hl->next) { -+ if (hl->handle(e, hl->data)) -+ return 1; -+ } -+ return 0; -+} -+ -+ - //////////////////////////////////////////////////////////////// - - Fl_Widget* fl_oldfocus; // kludge for Fl_Group... -diff -up fltk-1.3.2/src/Fl_win32.cxx.xhandlers fltk-1.3.2/src/Fl_win32.cxx ---- fltk-1.3.2/src/Fl_win32.cxx.xhandlers 2014-07-22 15:23:18.092334554 +0200 -+++ fltk-1.3.2/src/Fl_win32.cxx 2014-07-22 15:24:44.682843610 +0200 -@@ -336,6 +336,8 @@ void* Fl::thread_message() { - return r; - } - -+extern int fl_send_system_handlers(void *e); -+ - IActiveIMMApp *fl_aimm = NULL; - MSG fl_msg; - -@@ -401,23 +403,21 @@ int fl_wait(double time_to_wait) { - - // Execute the message we got, and all other pending messages: - // have_message = PeekMessage(&fl_msg, NULL, 0, 0, PM_REMOVE); -- have_message = PeekMessageW(&fl_msg, NULL, 0, 0, PM_REMOVE); -- if (have_message > 0) { -- while (have_message != 0 && have_message != -1) { -- if (fl_msg.message == fl_wake_msg) { -- // Used for awaking wait() from another thread -- thread_message_ = (void*)fl_msg.wParam; -- Fl_Awake_Handler func; -- void *data; -- while (Fl::get_awake_handler_(func, data)==0) { -- func(data); -- } -- } -- -- TranslateMessage(&fl_msg); -- DispatchMessageW(&fl_msg); -- have_message = PeekMessageW(&fl_msg, NULL, 0, 0, PM_REMOVE); -+ while ((have_message = PeekMessageW(&fl_msg, NULL, 0, 0, PM_REMOVE)) > 0) { -+ if (fl_send_system_handlers(&fl_msg)) -+ continue; -+ -+ if (fl_msg.message == fl_wake_msg) { -+ // Used for awaking wait() from another thread -+ thread_message_ = (void*)fl_msg.wParam; -+ Fl_Awake_Handler func; -+ void *data; -+ while (Fl::get_awake_handler_(func, data)==0) -+ func(data); - } -+ -+ TranslateMessage(&fl_msg); -+ DispatchMessageW(&fl_msg); - } - Fl::flush(); - -diff -up fltk-1.3.2/src/Fl_x.cxx.xhandlers fltk-1.3.2/src/Fl_x.cxx ---- fltk-1.3.2/src/Fl_x.cxx.xhandlers 2014-07-22 15:23:18.093334572 +0200 -+++ fltk-1.3.2/src/Fl_x.cxx 2014-07-22 15:23:18.096334624 +0200 -@@ -188,6 +188,8 @@ void Fl::remove_fd(int n) { - remove_fd(n, -1); - } - -+extern int fl_send_system_handlers(void *e); -+ - #if CONSOLIDATE_MOTION - static Fl_Window* send_motion; - extern Fl_Window* fl_xmousewin; -@@ -198,6 +200,8 @@ static void do_queued_events() { - while (XEventsQueued(fl_display,QueuedAfterReading)) { - XEvent xevent; - XNextEvent(fl_display, &xevent); -+ if (fl_send_system_handlers(&xevent)) -+ continue; - fl_handle(xevent); - } - // we send FL_LEAVE only if the mouse did not enter some other window: diff --git a/contrib/fltk/13-fltk-1.3.2-im.patch b/contrib/fltk/13-fltk-1.3.2-im.patch deleted file mode 100644 index efacc42b..00000000 --- a/contrib/fltk/13-fltk-1.3.2-im.patch +++ /dev/null @@ -1,582 +0,0 @@ -diff -up fltk-1.3.2/FL/Fl.H.im fltk-1.3.2/FL/Fl.H ---- fltk-1.3.2/FL/Fl.H.im 2014-09-10 14:40:05.193265424 +0200 -+++ fltk-1.3.2/FL/Fl.H 2014-09-10 14:40:05.196265471 +0200 -@@ -699,6 +699,17 @@ public: - static int event_inside(const Fl_Widget*); - static int test_shortcut(Fl_Shortcut); - -+ /** -+ Enables the system input methods facilities. This is the default. -+ \see disable_im() -+ */ -+ static void enable_im(); -+ /** -+ Disables the system input methods facilities. -+ \see enable_im() -+ */ -+ static void disable_im(); -+ - // event destinations: - static int handle(int, Fl_Window*); - static int handle_(int, Fl_Window*); -diff -up fltk-1.3.2/FL/win32.H.im fltk-1.3.2/FL/win32.H ---- fltk-1.3.2/FL/win32.H.im 2014-09-10 14:40:05.186265315 +0200 -+++ fltk-1.3.2/FL/win32.H 2014-09-10 14:40:05.196265471 +0200 -@@ -102,6 +102,8 @@ extern FL_EXPORT void fl_save_dc( HWND w - - inline Window fl_xid(const Fl_Window* w) { Fl_X *temp = Fl_X::i(w); return temp ? temp->xid : 0; } - -+extern FL_EXPORT void fl_open_display(); -+ - #else - FL_EXPORT Window fl_xid_(const Fl_Window* w); - #define fl_xid(w) fl_xid_(w) -diff -up fltk-1.3.2/src/Fl_cocoa.mm.im fltk-1.3.2/src/Fl_cocoa.mm ---- fltk-1.3.2/src/Fl_cocoa.mm.im 2014-09-10 14:40:05.193265424 +0200 -+++ fltk-1.3.2/src/Fl_cocoa.mm 2014-09-10 14:43:41.103642243 +0200 -@@ -88,6 +88,7 @@ static void createAppleMenu(void); - static Fl_Region MacRegionMinusRect(Fl_Region r, int x,int y,int w,int h); - static void cocoaMouseHandler(NSEvent *theEvent); - static int calc_mac_os_version(); -+static void im_update(void); - - static Fl_Quartz_Graphics_Driver fl_quartz_driver; - static Fl_Display_Device fl_quartz_display(&fl_quartz_driver); -@@ -108,6 +109,30 @@ int fl_mac_os_version = calc_mac_os_vers - static int got_events = 0; - static Fl_Window* resize_from_system; - static int main_screen_height; // height of menubar-containing screen used to convert between Cocoa and FLTK global screen coordinates -+static int im_enabled = -1; -+ -+// Carbon functions and definitions -+ -+typedef void *TSMDocumentID; -+ -+extern "C" enum { -+ kTSMDocumentEnabledInputSourcesPropertyTag = 'enis' // from Carbon/TextServices.h -+}; -+ -+// Undocumented voodoo. Taken from Mozilla. -+static const int smEnableRomanKybdsOnly = -23; -+ -+typedef TSMDocumentID (*TSMGetActiveDocument_type)(void); -+static TSMGetActiveDocument_type TSMGetActiveDocument; -+typedef OSStatus (*TSMSetDocumentProperty_type)(TSMDocumentID, OSType, UInt32, void*); -+static TSMSetDocumentProperty_type TSMSetDocumentProperty; -+typedef OSStatus (*TSMRemoveDocumentProperty_type)(TSMDocumentID, OSType); -+static TSMRemoveDocumentProperty_type TSMRemoveDocumentProperty; -+typedef CFArrayRef (*TISCreateASCIICapableInputSourceList_type)(void); -+static TISCreateASCIICapableInputSourceList_type TISCreateASCIICapableInputSourceList; -+ -+typedef void (*KeyScript_type)(short); -+static KeyScript_type KeyScript; - - #if CONSOLIDATE_MOTION - static Fl_Window* send_motion; -@@ -978,6 +1003,7 @@ void fl_open_callback(void (*cb)(const c - #endif - { - BOOL seen_open_file; -+ TSMDocumentID currentDoc; - } - - (void)windowDidMove:(NSNotification *)notif; - - (void)windowDidResize:(NSNotification *)notif; -@@ -991,6 +1017,7 @@ void fl_open_callback(void (*cb)(const c - - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender; - - (void)applicationDidBecomeActive:(NSNotification *)notify; - - (void)applicationDidChangeScreenParameters:(NSNotification *)aNotification; -+- (void)applicationDidUpdate:(NSNotification *)aNotification; - - (void)applicationWillResignActive:(NSNotification *)notify; - - (void)applicationWillHide:(NSNotification *)notify; - - (void)applicationWillUnhide:(NSNotification *)notify; -@@ -1175,6 +1202,23 @@ void fl_open_callback(void (*cb)(const c - } - Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL); - } -+- (void)applicationDidUpdate:(NSNotification *)aNotification -+{ -+ if ((fl_mac_os_version >= 100500) && (im_enabled != -1) && -+ (TSMGetActiveDocument != NULL)) { -+ TSMDocumentID newDoc; -+ // It is extremely unclear when Cocoa decides to create/update -+ // the input context, but debugging reveals that it is done -+ // by NSApplication:updateWindows. So check if the input context -+ // has shifted after each such run so that we can update our -+ // input methods status. -+ newDoc = TSMGetActiveDocument(); -+ if (newDoc != currentDoc) { -+ im_update(); -+ currentDoc = newDoc; -+ } -+ } -+} - - (void)applicationWillResignActive:(NSNotification *)notify - { - fl_lock_function(); -@@ -1322,6 +1365,13 @@ void fl_open_display() { - static char beenHereDoneThat = 0; - if ( !beenHereDoneThat ) { - beenHereDoneThat = 1; -+ -+ TSMGetActiveDocument = (TSMGetActiveDocument_type)Fl_X::get_carbon_function("TSMGetActiveDocument"); -+ TSMSetDocumentProperty = (TSMSetDocumentProperty_type)Fl_X::get_carbon_function("TSMSetDocumentProperty"); -+ TSMRemoveDocumentProperty = (TSMRemoveDocumentProperty_type)Fl_X::get_carbon_function("TSMRemoveDocumentProperty"); -+ TISCreateASCIICapableInputSourceList = (TISCreateASCIICapableInputSourceList_type)Fl_X::get_carbon_function("TISCreateASCIICapableInputSourceList"); -+ -+ KeyScript = (KeyScript_type)Fl_X::get_carbon_function("KeyScript"); - - BOOL need_new_nsapp = (NSApp == nil); - if (need_new_nsapp) [NSApplication sharedApplication]; -@@ -1390,6 +1440,66 @@ void fl_open_display() { - void fl_close_display() { - } - -+// Force a "Roman" or "ASCII" keyboard, which both the Mozilla and -+// Safari people seem to think implies turning off advanced IME stuff -+// (see nsTSMManager::SyncKeyScript in Mozilla and enableSecureTextInput -+// in Safari/Webcore). Should be good enough for us then... -+ -+static void im_update(void) { -+ if (fl_mac_os_version >= 100500) { -+ TSMDocumentID doc; -+ -+ if ((TSMGetActiveDocument == NULL) || -+ (TSMSetDocumentProperty == NULL) || -+ (TSMRemoveDocumentProperty == NULL) || -+ (TISCreateASCIICapableInputSourceList == NULL)) -+ return; -+ -+ doc = TSMGetActiveDocument(); -+ -+ if (im_enabled) -+ TSMRemoveDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag); -+ else { -+ CFArrayRef inputSources; -+ -+ inputSources = TISCreateASCIICapableInputSourceList(); -+ TSMSetDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag, -+ sizeof(CFArrayRef), &inputSources); -+ CFRelease(inputSources); -+ } -+ } else { -+ if (KeyScript == NULL) -+ return; -+ -+ if (im_enabled) -+ KeyScript(smKeyEnableKybds); -+ else -+ KeyScript(smEnableRomanKybdsOnly); -+ } -+} -+ -+void Fl::enable_im() { -+ fl_open_display(); -+ -+ im_enabled = 1; -+ -+ if (fl_mac_os_version >= 100500) -+ [NSApp updateWindows]; -+ else -+ im_update(); -+} -+ -+void Fl::disable_im() { -+ fl_open_display(); -+ -+ im_enabled = 0; -+ -+ if (fl_mac_os_version >= 100500) -+ [NSApp updateWindows]; -+ else -+ im_update(); -+} -+ - - // Gets the border sizes and the titlebar size - static void get_window_frame_sizes(int &bx, int &by, int &bt) { -diff -up fltk-1.3.2/src/Fl.cxx.im fltk-1.3.2/src/Fl.cxx ---- fltk-1.3.2/src/Fl.cxx.im 2014-09-10 14:40:05.194265440 +0200 -+++ fltk-1.3.2/src/Fl.cxx 2014-09-10 14:40:05.197265486 +0200 -@@ -593,45 +593,6 @@ int Fl::run() { - return 0; - } - --#ifdef WIN32 -- --// Function to initialize COM/OLE for usage. This must be done only once. --// We define a flag to register whether we called it: --static char oleInitialized = 0; -- --// This calls the Windows function OleInitialize() exactly once. --void fl_OleInitialize() { -- if (!oleInitialized) { -- OleInitialize(0L); -- oleInitialized = 1; -- } --} -- --// This calls the Windows function OleUninitialize() only, if --// OleInitialize has been called before. --void fl_OleUninitialize() { -- if (oleInitialized) { -- OleUninitialize(); -- oleInitialized = 0; -- } --} -- --class Fl_Win32_At_Exit { --public: -- Fl_Win32_At_Exit() { } -- ~Fl_Win32_At_Exit() { -- fl_free_fonts(); // do some WIN32 cleanup -- fl_cleanup_pens(); -- fl_OleUninitialize(); -- fl_brush_action(1); -- fl_cleanup_dc_list(); -- } --}; --static Fl_Win32_At_Exit win32_at_exit; --#endif -- -- -- - /** - Waits until "something happens" and then returns. Call this - repeatedly to "run" your program. You can also check what happened -diff -up fltk-1.3.2/src/Fl_Native_File_Chooser_WIN32.cxx.im fltk-1.3.2/src/Fl_Native_File_Chooser_WIN32.cxx ---- fltk-1.3.2/src/Fl_Native_File_Chooser_WIN32.cxx.im 2012-06-26 09:03:46.000000000 +0200 -+++ fltk-1.3.2/src/Fl_Native_File_Chooser_WIN32.cxx 2014-09-10 14:40:05.197265486 +0200 -@@ -34,6 +34,7 @@ LPCWSTR utf8towchar(const char *in); //M - char *wchartoutf8(LPCWSTR in); //MG - - #include <FL/Fl_Native_File_Chooser.H> -+#include <FL/x.H> - - #define LCURLY_CHR '{' - #define RCURLY_CHR '}' -@@ -41,8 +42,6 @@ char *wchartoutf8(LPCWSTR in); //MG - #define RBRACKET_CHR ']' - #define MAXFILTERS 80 - --void fl_OleInitialize(); // in Fl.cxx (Windows only) -- - // STATIC: PRINT WINDOWS 'DOUBLE NULL' STRING (DEBUG) - #ifdef DEBUG - static void dnullprint(char *wp) { -@@ -471,7 +470,7 @@ int CALLBACK Fl_Native_File_Chooser::Dir - // SHOW DIRECTORY BROWSER - int Fl_Native_File_Chooser::showdir() { - // initialize OLE only once -- fl_OleInitialize(); // init needed by BIF_USENEWUI -+ fl_open_display(); // init needed by BIF_USENEWUI - ClearBINF(); - clear_pathnames(); - // PARENT WINDOW -diff -up fltk-1.3.2/src/Fl_win32.cxx.im fltk-1.3.2/src/Fl_win32.cxx ---- fltk-1.3.2/src/Fl_win32.cxx.im 2014-09-10 14:40:05.194265440 +0200 -+++ fltk-1.3.2/src/Fl_win32.cxx 2014-09-10 14:40:05.197265486 +0200 -@@ -60,8 +60,6 @@ - #include <ole2.h> - #include <shellapi.h> - --#include "aimm.h" -- - // - // USE_ASYNC_SELECT - define it if you have WSAAsyncSelect()... - // USE_ASYNC_SELECT is OBSOLETED in 1.3 for the following reasons: -@@ -121,27 +119,24 @@ static HMODULE get_wsock_mod() { - * size and link dependencies. - */ - static HMODULE s_imm_module = 0; -+typedef BOOL (WINAPI* flTypeImmAssociateContextEx)(HWND, HIMC, DWORD); -+static flTypeImmAssociateContextEx flImmAssociateContextEx = 0; - typedef HIMC (WINAPI* flTypeImmGetContext)(HWND); - static flTypeImmGetContext flImmGetContext = 0; - typedef BOOL (WINAPI* flTypeImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM); - static flTypeImmSetCompositionWindow flImmSetCompositionWindow = 0; - typedef BOOL (WINAPI* flTypeImmReleaseContext)(HWND, HIMC); - static flTypeImmReleaseContext flImmReleaseContext = 0; --typedef BOOL (WINAPI* flTypeImmIsIME)(HKL); --static flTypeImmIsIME flImmIsIME = 0; - --static HMODULE get_imm_module() { -- if (!s_imm_module) { -- s_imm_module = LoadLibrary("IMM32.DLL"); -- if (!s_imm_module) -- Fl::fatal("FLTK Lib Error: IMM32.DLL file not found!\n\n" -- "Please check your input method manager library accessibility."); -- flImmGetContext = (flTypeImmGetContext)GetProcAddress(s_imm_module, "ImmGetContext"); -- flImmSetCompositionWindow = (flTypeImmSetCompositionWindow)GetProcAddress(s_imm_module, "ImmSetCompositionWindow"); -- flImmReleaseContext = (flTypeImmReleaseContext)GetProcAddress(s_imm_module, "ImmReleaseContext"); -- flImmIsIME = (flTypeImmIsIME)GetProcAddress(s_imm_module, "ImmIsIME"); -- } -- return s_imm_module; -+static void get_imm_module() { -+ s_imm_module = LoadLibrary("IMM32.DLL"); -+ if (!s_imm_module) -+ Fl::fatal("FLTK Lib Error: IMM32.DLL file not found!\n\n" -+ "Please check your input method manager library accessibility."); -+ flImmAssociateContextEx = (flTypeImmAssociateContextEx)GetProcAddress(s_imm_module, "ImmAssociateContextEx"); -+ flImmGetContext = (flTypeImmGetContext)GetProcAddress(s_imm_module, "ImmGetContext"); -+ flImmSetCompositionWindow = (flTypeImmSetCompositionWindow)GetProcAddress(s_imm_module, "ImmSetCompositionWindow"); -+ flImmReleaseContext = (flTypeImmReleaseContext)GetProcAddress(s_imm_module, "ImmReleaseContext"); - } - - // USE_TRACK_MOUSE - define NO_TRACK_MOUSE if you don't have -@@ -259,7 +254,9 @@ void fl_set_spot(int font, int size, int - Fl_Window* tw = win; - while (tw->parent()) tw = tw->window(); // find top level window - -- get_imm_module(); -+ if (!tw->shown()) -+ return; -+ - HIMC himc = flImmGetContext(fl_xid(tw)); - - if (himc) { -@@ -338,7 +335,6 @@ void* Fl::thread_message() { - - extern int fl_send_system_handlers(void *e); - --IActiveIMMApp *fl_aimm = NULL; - MSG fl_msg; - - // This is never called with time_to_wait < 0.0. -@@ -441,6 +437,58 @@ int fl_ready() { - return get_wsock_mod() ? s_wsock_select(0,&fdt[0],&fdt[1],&fdt[2],&t) : 0; - } - -+void fl_open_display() { -+ static char beenHereDoneThat = 0; -+ -+ if (beenHereDoneThat) -+ return; -+ -+ beenHereDoneThat = 1; -+ -+ OleInitialize(0L); -+ -+ get_imm_module(); -+} -+ -+class Fl_Win32_At_Exit { -+public: -+ Fl_Win32_At_Exit() { } -+ ~Fl_Win32_At_Exit() { -+ fl_free_fonts(); // do some WIN32 cleanup -+ fl_cleanup_pens(); -+ OleUninitialize(); -+ fl_brush_action(1); -+ fl_cleanup_dc_list(); -+ } -+}; -+static Fl_Win32_At_Exit win32_at_exit; -+ -+static char im_enabled = 1; -+ -+void Fl::enable_im() { -+ fl_open_display(); -+ -+ Fl_X* i = Fl_X::first; -+ while (i) { -+ flImmAssociateContextEx(i->xid, 0, IACE_DEFAULT); -+ i = i->next; -+ } -+ -+ im_enabled = 1; -+} -+ -+void Fl::disable_im() { -+ fl_open_display(); -+ -+ Fl_X* i = Fl_X::first; -+ while (i) { -+ flImmAssociateContextEx(i->xid, 0, 0); -+ i = i->next; -+ } -+ -+ im_enabled = 0; -+} -+ - //////////////////////////////////////////////////////////////// - - int Fl::x() -@@ -683,7 +731,6 @@ void fl_clipboard_notify_untarget(HWND w - } - - //////////////////////////////////////////////////////////////// --char fl_is_ime = 0; - void fl_get_codepage() - { - HKL hkl = GetKeyboardLayout(0); -@@ -691,14 +738,8 @@ void fl_get_codepage() - - GetLocaleInfo (LOWORD(hkl), LOCALE_IDEFAULTANSICODEPAGE, ld, 6); - DWORD ccp = atol(ld); -- fl_is_ime = 0; - - fl_codepage = ccp; -- if (fl_aimm) { -- fl_aimm->GetCodePageA(GetKeyboardLayout(0), &fl_codepage); -- } else if (get_imm_module() && flImmIsIME(hkl)) { -- fl_is_ime = 1; -- } - } - - HWND fl_capture; -@@ -1564,6 +1605,8 @@ int fl_disable_transient_for; // secret - Fl_X* Fl_X::make(Fl_Window* w) { - Fl_Group::current(0); // get rid of very common user bug: forgot end() - -+ fl_open_display(); -+ - // if the window is a subwindow and our parent is not mapped yet, we - // mark this window visible, so that mapping the parent at a later - // point in time will call this function again to finally map the subwindow. -@@ -1767,16 +1810,10 @@ Fl_X* Fl_X::make(Fl_Window* w) { - (Fl::grab() || (styleEx & WS_EX_TOOLWINDOW)) ? SW_SHOWNOACTIVATE : SW_SHOWNORMAL); - - // Register all windows for potential drag'n'drop operations -- fl_OleInitialize(); - RegisterDragDrop(x->xid, flIDropTarget); - -- if (!fl_aimm) { -- CoCreateInstance(CLSID_CActiveIMM, NULL, CLSCTX_INPROC_SERVER, -- IID_IActiveIMMApp, (void**) &fl_aimm); -- if (fl_aimm) { -- fl_aimm->Activate(TRUE); -- } -- } -+ if (!im_enabled) -+ flImmAssociateContextEx(x->xid, 0, 0); - - return x; - } -diff -up fltk-1.3.2/src/Fl_x.cxx.im fltk-1.3.2/src/Fl_x.cxx ---- fltk-1.3.2/src/Fl_x.cxx.im 2014-09-10 14:40:05.194265440 +0200 -+++ fltk-1.3.2/src/Fl_x.cxx 2014-09-10 14:40:05.198265502 +0200 -@@ -313,6 +313,7 @@ XVisualInfo *fl_visual; - Colormap fl_colormap; - XIM fl_xim_im = 0; - XIC fl_xim_ic = 0; -+Window fl_xim_win = 0; - char fl_is_over_the_spot = 0; - static XRectangle status_area; - -@@ -603,6 +604,55 @@ void fl_init_xim() { - if(xim_styles) XFree(xim_styles); - } - -+void fl_xim_deactivate(void); -+ -+void fl_xim_activate(Window xid) { -+ if (!fl_xim_im) -+ return; -+ -+ // If the focused window has changed, then use the brute force method -+ // of completely recreating the input context. -+ if (fl_xim_win != xid) { -+ fl_xim_deactivate(); -+ -+ fl_new_ic(); -+ fl_xim_win = xid; -+ -+ XSetICValues(fl_xim_ic, -+ XNFocusWindow, fl_xim_win, -+ XNClientWindow, fl_xim_win, -+ NULL); -+ } -+ -+ fl_set_spot(spotf, spots, spot.x, spot.y, spot.width, spot.height); -+} -+ -+void fl_xim_deactivate(void) { -+ if (!fl_xim_ic) -+ return; -+ -+ XDestroyIC(fl_xim_ic); -+ fl_xim_ic = NULL; -+ -+ fl_xim_win = 0; -+} -+ -+void Fl::enable_im() { -+ Fl_Window *win; -+ -+ win = Fl::first_window(); -+ if (win && win->shown()) { -+ fl_xim_activate(fl_xid(win)); -+ XSetICFocus(fl_xim_ic); -+ } else { -+ fl_new_ic(); -+ } -+} -+ -+void Fl::disable_im() { -+ fl_xim_deactivate(); -+} -+ - void fl_open_display() { - if (fl_display) return; - -@@ -1053,10 +1103,9 @@ int fl_handle(const XEvent& thisevent) - XEvent xevent = thisevent; - fl_xevent = &thisevent; - Window xid = xevent.xany.window; -- static Window xim_win = 0; - - if (fl_xim_ic && xevent.type == DestroyNotify && -- xid != xim_win && !fl_find(xid)) -+ xid != fl_xim_win && !fl_find(xid)) - { - XIM xim_im; - xim_im = XOpenIM(fl_display, NULL, NULL, NULL); -@@ -1072,46 +1121,9 @@ int fl_handle(const XEvent& thisevent) - } - - if (fl_xim_ic && (xevent.type == FocusIn)) -- { --#define POOR_XIM --#ifdef POOR_XIM -- if (xim_win != xid) -- { -- xim_win = xid; -- XDestroyIC(fl_xim_ic); -- fl_xim_ic = NULL; -- fl_new_ic(); -- XSetICValues(fl_xim_ic, -- XNFocusWindow, xevent.xclient.window, -- XNClientWindow, xid, -- NULL); -- } -- fl_set_spot(spotf, spots, spot.x, spot.y, spot.width, spot.height); --#else -- if (Fl::first_window() && Fl::first_window()->modal()) { -- Window x = fl_xid(Fl::first_window()); -- if (x != xim_win) { -- xim_win = x; -- XSetICValues(fl_xim_ic, -- XNFocusWindow, xim_win, -- XNClientWindow, xim_win, -- NULL); -- fl_set_spot(spotf, spots, spot.x, spot.y, spot.width, spot.height); -- } -- } else if (xim_win != xid && xid) { -- xim_win = xid; -- XSetICValues(fl_xim_ic, -- XNFocusWindow, xevent.xclient.window, -- XNClientWindow, xid, -- //XNFocusWindow, xim_win, -- //XNClientWindow, xim_win, -- NULL); -- fl_set_spot(spotf, spots, spot.x, spot.y, spot.width, spot.height); -- } --#endif -- } -+ fl_xim_activate(xid); - -- if ( XFilterEvent((XEvent *)&xevent, 0) ) -+ if (fl_xim_ic && XFilterEvent((XEvent *)&xevent, 0)) - return(1); - - #if USE_XRANDR diff --git a/contrib/fltk/fixes/0001-Add-BUILD_STATIC-feature-from-TigerVNC-to-optionally.patch b/contrib/fltk/fixes/0001-Add-BUILD_STATIC-feature-from-TigerVNC-to-optionally.patch deleted file mode 100644 index 9aac0372..00000000 --- a/contrib/fltk/fixes/0001-Add-BUILD_STATIC-feature-from-TigerVNC-to-optionally.patch +++ /dev/null @@ -1,67 +0,0 @@ ->From 7a15d1c9a908afe429c1aba1c27516d18bdea299 Mon Sep 17 00:00:00 2001 -From: DRC <information@virtualgl.org> -Date: Tue, 26 Feb 2013 03:37:12 -0600 -Subject: [PATCH 1/4] Add BUILD_STATIC feature from TigerVNC to (optionally) - prevent FLTK from depending on libgcc and libstdc++ - ---- - CMakeLists.txt | 43 +++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 43 insertions(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a1ee285..7d9d94b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -150,6 +150,49 @@ mark_as_advanced(LIB_CAIRO LIB_fontconfig LIB_freetype) - mark_as_advanced(LIB_GL LIB_MesaGL) - mark_as_advanced(LIB_jpeg LIB_png LIB_zlib) - -+# This ensures that we don't depend on libstdc++ or libgcc -+if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE AND NOT CYGWIN) -+ option(BUILD_STATIC -+ "Link statically against libgcc and libstdc++, if possible" OFF) -+ if(BUILD_STATIC) -+ # For some reason, simply passing ${CMAKE_CXX_FLAGS} to the compiler in -+ # execute_process() doesn't work. Grrr... -+ if(CMAKE_SIZEOF_VOID_P MATCHES 8) -+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -m64 -+ --print-file-name=libstdc++.a OUTPUT_VARIABLE LIBSTDCPLUSPLUS -+ RESULT_VARIABLE RESULT) -+ else() -+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -m32 -+ --print-file-name=libstdc++.a OUTPUT_VARIABLE LIBSTDCPLUSPLUS -+ RESULT_VARIABLE RESULT) -+ endif() -+ string(REGEX REPLACE "\n" "" LIBSTDCPLUSPLUS ${LIBSTDCPLUSPLUS}) -+ if(RESULT MATCHES 0 AND LIBSTDCPLUSPLUS) -+ message(STATUS "Linking with static libstdc++:\n ${LIBSTDCPLUSPLUS}") -+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/staticlib) -+ execute_process(COMMAND ${CMAKE_COMMAND} -E remove -+ ${CMAKE_BINARY_DIR}/staticlib/libstdc++.a) -+ if(MINGW) -+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy -+ ${LIBSTDCPLUSPLUS} ${CMAKE_BINARY_DIR}/staticlib/libstdc++.a) -+ else() -+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink -+ ${LIBSTDCPLUSPLUS} ${CMAKE_BINARY_DIR}/staticlib/libstdc++.a) -+ endif() -+ set(CMAKE_EXE_LINKER_FLAGS -+ "${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_BINARY_DIR}/staticlib") -+ set(CMAKE_SHARED_LINKER_FLAGS -+ "${CMAKE_SHARED_LINKER_FLAGS} -L${CMAKE_BINARY_DIR}/staticlib") -+ else() -+ message(WARNING Cannot find static libstdc++. TigerVNC will depend on dynamic libstdc++.) -+ endif() -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc") -+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc") -+ set(CMAKE_SHARED_LINKER_FLAGS -+ "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc") -+ endif() -+endif() -+ - ####################################################################### - # functions - include(CheckFunctionExists) --- -1.8.1.3 - diff --git a/contrib/fltk/fixes/0002-Fl_cocoa.mm-depends-on-some-Carbon-functions-so-we-n.patch b/contrib/fltk/fixes/0002-Fl_cocoa.mm-depends-on-some-Carbon-functions-so-we-n.patch deleted file mode 100644 index 6607d578..00000000 --- a/contrib/fltk/fixes/0002-Fl_cocoa.mm-depends-on-some-Carbon-functions-so-we-n.patch +++ /dev/null @@ -1,26 +0,0 @@ ->From bf06cdf83375c11a47bddc3683143b3e2c0fdfcb Mon Sep 17 00:00:00 2001 -From: DRC <information@virtualgl.org> -Date: Tue, 26 Feb 2013 03:38:45 -0600 -Subject: [PATCH 2/4] Fl_cocoa.mm depends on some Carbon functions, so we need - to include that framework. - ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7d9d94b..cae895e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -51,7 +51,7 @@ if(APPLE) - set(HAVE_STRTOLL 1) - set(HAVE_STRCASECMP 1) - set(HAVE_DIRENT_H 1) -- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa") -+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa -framework Carbon") - endif(APPLE) - - if(WIN32) --- -1.8.1.3 - diff --git a/contrib/fltk/fixes/0003-We-need-to-unset-CMAKE_REQUIRED_LIBRARIES-after-chec.patch b/contrib/fltk/fixes/0003-We-need-to-unset-CMAKE_REQUIRED_LIBRARIES-after-chec.patch deleted file mode 100644 index 4d824d75..00000000 --- a/contrib/fltk/fixes/0003-We-need-to-unset-CMAKE_REQUIRED_LIBRARIES-after-chec.patch +++ /dev/null @@ -1,30 +0,0 @@ ->From bb02d8426a9a279df76376313349c17774030753 Mon Sep 17 00:00:00 2001 -From: DRC <information@virtualgl.org> -Date: Tue, 26 Feb 2013 04:01:36 -0600 -Subject: [PATCH 3/4] We need to unset CMAKE_REQUIRED_LIBRARIES after checking - for the libpng functions. Otherwise, under certain circumstances (known to - be an issue when building on OS X with the in-tree libpng implementation), - the scandir() function check will fail, leaving HAVE_SCANDIR unset, and the - build will subsequently fail. - ---- - CMakeLists.txt | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cae895e..0984aae 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -210,6 +210,9 @@ if(LIB_png) - endif(LIB_png) - CHECK_FUNCTION_EXISTS(png_get_valid HAVE_PNG_GET_VALID) - CHECK_FUNCTION_EXISTS(png_set_tRNS_to_alpha HAVE_PNG_SET_TRNS_TO_ALPHA) -+if(LIB_png) -+ set(CMAKE_REQUIRED_LIBRARIES "") -+endif(LIB_png) - - CHECK_FUNCTION_EXISTS(scandir HAVE_SCANDIR) - CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF) --- -1.8.1.3 - diff --git a/contrib/fltk/fixes/0004-str-2917-fix-macosx-10.6-build-issue.patch b/contrib/fltk/fixes/0004-str-2917-fix-macosx-10.6-build-issue.patch deleted file mode 100644 index 6ebc4089..00000000 --- a/contrib/fltk/fixes/0004-str-2917-fix-macosx-10.6-build-issue.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- fltk-1.3.2.org/src/Fl_cocoa.mm 2013-01-16 11:32:11.788478228 +0100 -+++ fltk-1.3.2/src/Fl_cocoa.mm 2013-01-16 11:32:55.824101285 +0100 -@@ -3727,7 +3727,7 @@ CGImageRef Fl_X::CGImage_from_window_rec - CGImageRef img; - if (fl_mac_os_version >= 100500) { - NSBitmapImageRep *bitmap = rect_to_NSBitmapImageRep(win, x, y, w, h); -- img = [bitmap CGImage]; // requires Mac OS 10.5 -+ img = (CGImageRef)[bitmap CGImage]; // requires Mac OS 10.5 - CGImageRetain(img); - [bitmap release]; - } diff --git a/contrib/fltk/fltk-1.3.x-osx-clip.patch b/contrib/fltk/fltk-1.3.x-osx-clip.patch deleted file mode 100644 index 9e3fcdc5..00000000 --- a/contrib/fltk/fltk-1.3.x-osx-clip.patch +++ /dev/null @@ -1,77 +0,0 @@ -diff -up fltk-1.3.3/src/Fl_cocoa.mm.clip fltk-1.3.3/src/Fl_cocoa.mm
---- fltk-1.3.3/src/Fl_cocoa.mm.clip 2014-11-02 22:06:07.000000000 +0100
-+++ fltk-1.3.3/src/Fl_cocoa.mm 2015-04-20 13:45:03.526688921 +0200
-@@ -3061,6 +3061,14 @@ static void clipboard_check(void)
- fl_trigger_clipboard_notify(1);
- }
-
-+static void resize_selection_buffer(int len, int clipboard) {
-+ if (len <= fl_selection_buffer_length[clipboard])
-+ return;
-+ delete[] fl_selection_buffer[clipboard];
-+ fl_selection_buffer[clipboard] = new char[len+100];
-+ fl_selection_buffer_length[clipboard] = len+100;
-+}
-+
- /*
- * create a selection
- * stuff: pointer to selected data
-@@ -3069,11 +3077,7 @@ static void clipboard_check(void)
- */
- void Fl::copy(const char *stuff, int len, int clipboard, const char *type) {
- if (!stuff || len<0) return;
-- if (len+1 > fl_selection_buffer_length[clipboard]) {
-- delete[] fl_selection_buffer[clipboard];
-- fl_selection_buffer[clipboard] = new char[len+100];
-- fl_selection_buffer_length[clipboard] = len+100;
-- }
-+ resize_selection_buffer(len+1, clipboard);
- memcpy(fl_selection_buffer[clipboard], stuff, len);
- fl_selection_buffer[clipboard][len] = 0; // needed for direct paste
- fl_selection_length[clipboard] = len;
-@@ -3087,7 +3091,7 @@ void Fl::copy(const char *stuff, int len
- }
- }
-
--static int get_plain_text_from_clipboard(char **buffer, int previous_length)
-+static int get_plain_text_from_clipboard(int clipboard)
- {
- NSInteger length = 0;
- NSPasteboard *clip = [NSPasteboard generalPasteboard];
-@@ -3109,21 +3113,17 @@ static int get_plain_text_from_clipboard
- len = strlen(aux_c) + 1;
- }
- else len = [data length] + 1;
-- if ( len >= previous_length ) {
-- length = len;
-- delete[] *buffer;
-- *buffer = new char[len];
-- }
-+ resize_selection_buffer(len, clipboard);
- if (![found isEqualToString:utf8_format]) {
-- strcpy(*buffer, aux_c);
-- free(aux_c);
-+ strcpy(fl_selection_buffer[clipboard], aux_c);
-+ free(aux_c);
- }
- else {
-- [data getBytes:*buffer];
-+ [data getBytes:fl_selection_buffer[clipboard]];
- }
-- (*buffer)[len - 1] = 0;
-+ fl_selection_buffer[clipboard][len - 1] = 0;
- length = len - 1;
-- convert_crlf(*buffer, len - 1); // turn all \r characters into \n:
-+ convert_crlf(fl_selection_buffer[clipboard], len - 1); // turn all \r characters into \n:
- Fl::e_clipboard_type = Fl::clipboard_plain_text;
- }
- }
-@@ -3218,7 +3218,7 @@ void Fl::paste(Fl_Widget &receiver, int
- if (clipboard) {
- Fl::e_clipboard_type = "";
- if (strcmp(type, Fl::clipboard_plain_text) == 0) {
-- fl_selection_length[1] = get_plain_text_from_clipboard( &fl_selection_buffer[1], fl_selection_length[1]);
-+ fl_selection_length[1] = get_plain_text_from_clipboard(1);
- }
- else if (strcmp(type, Fl::clipboard_image) == 0) {
- Fl::e_clipboard_data = get_image_from_clipboard( );
diff --git a/contrib/packages/deb/ubuntu-precise/debian/changelog b/contrib/packages/deb/ubuntu-precise/debian/changelog deleted file mode 100644 index 28fc3c92..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/changelog +++ /dev/null @@ -1,31 +0,0 @@ -tigervnc (1.3.0-3ubuntu1) precise; urgency=low - - * Build Xvnc against native upstream xorg sources, using native config - options. Use distro-specific fltk1.3 sources. - - -- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 14 Jul 2013 15:22:28 -0400 - -tigervnc (1.3.0-3) precise; urgency=low - - * Additional dependencies (derived from ldd | dpkg -S). - - -- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 11:01:33 -0400 - -tigervnc (1.3.0-2) precise; urgency=low - - * Added build dependencies to improve font support in viewer. - - -- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 10:44:05 -0400 - -tigervnc (1.3.0-1) precise; urgency=low - - * Removed java viewer from server package. Fixed typo in server - dependencies. - - -- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 09:55:44 -0400 - -tigervnc (1.3.0) precise; urgency=low - - * Initial release. - - -- Brian P. Hinz <bphinz@users.sourceforge.net> Fri, 05 Jul 2013 00:47:02 -0400 diff --git a/contrib/packages/deb/ubuntu-precise/debian/compat b/contrib/packages/deb/ubuntu-precise/debian/compat deleted file mode 100644 index ec635144..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/contrib/packages/deb/ubuntu-precise/debian/control b/contrib/packages/deb/ubuntu-precise/debian/control deleted file mode 100644 index b29222e7..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/control +++ /dev/null @@ -1,70 +0,0 @@ -Source: tigervnc -Section: x11 -Priority: optional -Maintainer: Brian P. Hinz <bphinz@users.sourceforge.net> -Standards-Version: 3.8.4 -Build-Depends: debhelper (>> 7.1), zlib1g-dev, libjpeg-turbo8-dev, libxaw7-dev (>> 4.1.0), perl-modules, xfonts-base, xutils-dev, libx11-dev, libxau-dev, libxext-dev, libxi-dev, libxkbfile-dev, libxmu-dev, libxt-dev, x11proto-core-dev, cmake (>> 2.8), libgnutls28-dev, libpam0g-dev, libpng-dev, automake, autoconf, libtool, pkg-config, libpixman-1-dev, x11proto-bigreqs-dev, x11proto-composite-dev, x11proto-damage-dev, x11proto-dri2-dev, x11proto-fixes-dev, x11proto-fonts-dev, x11proto-gl-dev, x11proto-input-dev, x11proto-kb-dev, x11proto-randr-dev, x11proto-render-dev, x11proto-resource-dev, x11proto-scrnsaver-dev, x11proto-video-dev, x11proto-xcmisc-dev, x11proto-xext-dev, x11proto-xf86bigfont-dev, x11proto-xf86dga-dev, x11proto-xf86dri-dev, x11proto-xf86misc-dev, x11proto-xf86vidmode-dev, x11proto-xinerama-dev, libosmesa6-dev, libgl1-mesa-dev, libgl1-mesa-dri, libgl1-mesa-glx, libxfont-dev, x11proto-record-dev, default-jdk, libxtst-dev, libxft-dev, libexpat1-dev, libfontconfig1-dev, libxrender-dev, libt1-dev, libpciaccess-dev, curl, bzip2, quilt, libglu1-mesa-dev, libxcursor-dev, libxinerama-dev, libxfixes-dev, libxdamage-dev, libgcrypt11-dev -Homepage: http://www.tigervnc.com - -Package: tigervncserver -Architecture: any -Provides: xserver, vnc-server -Depends: x11-common | xserver-common, x11-utils, xauth, libbz2-1.0, libc6, libfontenc1, libfreetype6, libgcc1, libgl1-mesa-dri, libgnutls28, libjpeg-turbo8, libp11-kit0, libpam0g, libpixman-1-0, libstdc++6, libtasn1-3, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxfont1, libxtst6, zlib1g, libglu1-mesa, libxcursor1, libxinerama1, libxfixes3, x11-xkb-utils, libgcrypt11 -Recommends: xfonts-base, x11-xserver-utils -Suggests: xtigervncviewer, tigervnc-java -Description: virtual network computing server software - Virtual Network Computing (VNC) is a remote display system which allows you to - view and interact with a virtual desktop environment that is running on another - computer on the network. Using VNC, you can run graphical applications on a - remote machine and send only the display from these applications to your local - machine. VNC is platform-independent and supports a wide variety of operating - systems and architectures as both servers and clients. - . - TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code - bases. TigerVNC started as a next-generation development effort for TightVNC - on Unix and Linux platforms, but it split from its parent project in early 2009 - so that TightVNC could focus on Windows platforms. TigerVNC supports a variant - of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo - JPEG codec. - -Package: xtigervncviewer -Architecture: any -Provides: vncviewer, vnc-viewer -Depends: libc6, libexpat1, libfontconfig1, libfreetype6, libgcc1, libgnutls28, libjpeg-turbo8, libp11-kit0, libpng12-0, libstdc++6, libtasn1-3, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxft2, libxrender1, zlib1g, libglu1-mesa -Recommends: xfonts-base -Suggests: tigervncserver, ssh -Description: virtual network computing client software for X - Virtual Network Computing (VNC) is a remote display system which allows you to - view and interact with a virtual desktop environment that is running on another - computer on the network. Using VNC, you can run graphical applications on a - remote machine and send only the display from these applications to your local - machine. VNC is platform-independent and supports a wide variety of operating - systems and architectures as both servers and clients. - . - TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code - bases. TigerVNC started as a next-generation development effort for TightVNC - on Unix and Linux platforms, but it split from its parent project in early 2009 - so that TightVNC could focus on Windows platforms. TigerVNC supports a variant - of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo - JPEG codec. - -Package: tigervnc-java -Architecture: any -Suggests: tigervncserver -Provides: vncviewer, vnc-viewer -Depends: default-jre -Description: TigerVNC java applet - Virtual Network Computing (VNC) is a remote display system which allows you to - view and interact with a virtual desktop environment that is running on another - computer on the network. Using VNC, you can run graphical applications on a - remote machine and send only the display from these applications to your local - machine. VNC is platform-independent and supports a wide variety of operating - systems and architectures as both servers and clients. - . - TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code - bases. TigerVNC started as a next-generation development effort for TightVNC - on Unix and Linux platforms, but it split from its parent project in early 2009 - so that TightVNC could focus on Windows platforms. TigerVNC supports a variant - of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo - JPEG codec. - diff --git a/contrib/packages/deb/ubuntu-precise/debian/copyright b/contrib/packages/deb/ubuntu-precise/debian/copyright deleted file mode 100644 index 290fbdf9..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/copyright +++ /dev/null @@ -1,116 +0,0 @@ -This package was packaged for Debian by Brian P. Hinz <bphinz@users.sourceforge.net> -on Tue, 02 Jul 2013 21:33:24 +0500 using the tightvnc package as a base. - -It was downloaded from: - https://www.tigervnc.org/ - -COPYRIGHT: -========== - -TigerVNC is - - Copyright (C) 1999 AT&T Laboratories Cambridge - Copyright (C) 2002-2005 RealVNC Ltd. - Copyright (C) 2000-2006 TightVNC Group - Copyright (C) 2005-2006 Martin Koegler - Copyright (C) 2005-2006 Sun Microsystems, Inc. - Copyright (C) 2006 OCCAM Financial Technology - Copyright (C) 2000-2008 Constantin Kaplinsky - Copyright (C) 2004-2009 Peter Astrand for Cendio AB - Copyright (C) 2010 Antoine Martin - Copyright (C) 2010 m-privacy GmbH - Copyright (C) 2009-2011 D. R. Commander - Copyright (C) 2009-2011 Pierre Ossman for Cendio AB - Copyright (C) 2004, 2009-2011 Red Hat, Inc. - Copyright (C) 2009-2011 TigerVNC Team - All Rights Reserved. - -This software is distributed under the GNU General Public Licence as published -by the Free Software Foundation. See the file LICENCE.TXT for the conditions -under which this software is made available. TigerVNC also contains code from -other sources. See the Acknowledgements section below, and the individual -source files, for details of the conditions under which they are made -available. - -ACKNOWLEDGEMENTS -================ - -This distribution contains zlib compression software. This is: - - Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). - - -This distribution contains public domain DES software by Richard Outerbridge. -This is: - - Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge. - (GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992. - - -This distribution contains software from the X Window System. This is: - - Copyright 1987, 1988, 1998 The Open Group - - Permission to use, copy, modify, distribute, and sell this software and its - documentation for any purpose is hereby granted without fee, provided that - the above copyright notice appear in all copies and that both that - copyright notice and this permission notice appear in supporting - documentation. - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name of The Open Group shall not be - used in advertising or otherwise to promote the sale, use or other dealings - in this Software without prior written authorization from The Open Group. - - - Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - - Permission to use, copy, modify, and distribute this software and its - documentation for any purpose and without fee is hereby granted, - provided that the above copyright notice appear in all copies and that - both that copyright notice and this permission notice appear in - supporting documentation, and that the name of Digital not be - used in advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - SOFTWARE. diff --git a/contrib/packages/deb/ubuntu-precise/debian/get-orig-source.sh b/contrib/packages/deb/ubuntu-precise/debian/get-orig-source.sh deleted file mode 100755 index 64b26155..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/get-orig-source.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -#curl -L -o tigervnc-1.3.0.tar.bz2 "http://downloads.sourceforge.net/project/tigervnc/tigervnc/1.3.0/tigervnc-1.3.0.tar.bz2" -#tar xjf tigervnc-*.tar.bz2 -#rm tigervnc-*.tar.bz2 -curl -OL http://sourceforge.net/code-snapshots/svn/t/ti/tigervnc/code/tigervnc-code-5136-trunk.zip -unzip tigervnc-code-*-trunk.zip -mv tigervnc-code-*-trunk tigervnc-1.3.80 -rm tigervnc-code-*-trunk.zip -pushd tigervnc-* -curl -L -o fltk-1.3.2-source.tar.gz 'http://anonscm.debian.org/gitweb/?p=users/ucko/fltk1.3.git;a=snapshot;h=HEAD;sf=tgz' -tar xzf fltk-*-source.tar.gz -rm fltk-*-source.tar.gz -mv fltk1.3-* fltk-1.3.2 -pushd fltk-* -sh ../../debian/patch_fltk.sh -find . -name "*.orig" -exec rm {} \; -popd -curl -L -o xorg-server-1.11.4-0ubuntu10.3.tar.gz 'http://anonscm.debian.org/gitweb/?p=pkg-xorg/xserver/xorg-server.git;a=snapshot;h=cbf435a091906484112f5c4cf35b17738e779ce9;sf=tgz' -tar xzf xorg-server-*.tar.gz -rm xorg-server-*.tar.gz -pushd xorg-server-* -QUILT_PATCHES=debian/patches quilt push -a -popd -cp -r xorg-server-*/* unix/xserver -rm -rf xorg-server-* -pushd unix/xserver -for all in `find . -type f -perm -001`; do - chmod -x "$all" -done -patch -p1 -b --suffix .vnc < ../xserver111.patch -popd -popd -if [ -e tigervnc_1.3.80.orig.tar.gz ] ; then - rm tigervnc_1.3.80.orig.tar.gz -fi -tar czf tigervnc_1.3.80.orig.tar.gz tigervnc-1.3.80 -rm -rf tigervnc-1.3.80 diff --git a/contrib/packages/deb/ubuntu-precise/debian/local/vncserver.service b/contrib/packages/deb/ubuntu-precise/debian/local/vncserver.service deleted file mode 100644 index 86a8a910..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/local/vncserver.service +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -# -# Init file for TigerVNC Server -# -# chkconfig: - 91 35 -# description: TigerVNC remote X administration daemon. -# -# processname: Xvnc - -### BEGIN INIT INFO -# Provides: vncservers -# Required-Start: networking -# Required-Stop: networking -# Default-Start: -# Default-Stop: 0 1 2 3 4 5 6 -# Short-Description: Starts and stops vncserver -# Description: Used to provide remote X administration services. -### END INIT INFO - -# Source function library. -. /lib/lsb/init-functions - -### Default variables -SYSCONFIG="/etc/default/vncservers" -VNCSERVERS="" - -### Read configuration -[ -r "$SYSCONFIG" ] && . "$SYSCONFIG" - -RETVAL=0 -prog=$"VNC server" - -start() { - echo -n $"Starting $prog: " - ulimit -S -c 0 >/dev/null 2>&1 - for display in ${VNCSERVERS}; do - echo -n "${display} " - if [ -r $(eval echo ~${display##*:})/.vnc/passwd ]; then - unset BASH_ENV ENV - log_begin_msg "Starting VNC Server for user ${display##*:}:" - su ${display##*:} -c "cd ~${display##*:} && [ -f .vnc/passwd ] && vncserver :${display%%:*} ${VNCSERVERARGS[${display%:*}]}" - RETVAL="$?" - if [ "$RETVAL" -ne 0 ]; then - log_end_msg 1 - break - else - log_end_msg 0 - fi - else - log_begin_msg "Not starting VNC Server for user ${display##*:}.\n File \"~${display##*:}/.vnc/passwd\" not found.\n Create a password file for the VNC server with vncpasswd" - log_end_msg 1 - fi - done - echo - [ "$RETVAL" -eq 0 ] && touch "/var/lock/vncserver" - return $RETVAL -} - -stop() { - echo -n $"Shutting down $desc: " - for display in ${VNCSERVERS}; do - echo -n "${display} " - unset BASH_ENV ENV - log_begin_msg "Shutting down VNC Server for user ${display##*:}: " - su ${display##*:} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1 - RETVAL="$?" - [ "$RETVAL" -eq 0 ] && log_end_msg 0 || log_end_msg 1 - done - echo - [ "$RETVAL" -eq 0 ] && rm -f "/var/lock/vncserver" - return $RETVAL -} - -restart() { - stop - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - restart - ;; - *) - echo $"Usage: $0 {start|stop|restart}" - RETVAL=1 -esac - -exit $RETVAL diff --git a/contrib/packages/deb/ubuntu-precise/debian/local/vncserver.sysconfig b/contrib/packages/deb/ubuntu-precise/debian/local/vncserver.sysconfig deleted file mode 100644 index 5940a1e7..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/local/vncserver.sysconfig +++ /dev/null @@ -1,19 +0,0 @@ -# The VNCSERVERS variable is a list of display:user pairs. -# -# Uncomment the lines below to start a VNC server on display :2 -# as my 'myusername' (adjust this to your own). You will also -# need to set a VNC password; run 'man vncpasswd' to see how -# to do that. -# -# DO NOT RUN THIS SERVICE if your local area network is -# untrusted! For a secure way of using VNC, see this URL: -# http://kbase.redhat.com/faq/docs/DOC-7028 - -# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP. - -# Use "-localhost" to prevent remote VNC clients connecting except when -# doing so through a secure tunnel. See the "-via" option in the -# `man vncviewer' manual page. - -# VNCSERVERS="2:myusername" -# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost" diff --git a/contrib/packages/deb/ubuntu-precise/debian/patch_fltk.sh b/contrib/packages/deb/ubuntu-precise/debian/patch_fltk.sh deleted file mode 100755 index a2dc0f08..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/patch_fltk.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -set -e -apply_patch() -{ - rm -f $2 - curl -OL http://www.fltk.org/strfiles/$1/$2 - patch -p1 < $2 -} - -# Export dead key information from FLTK to the apps -# http://www.fltk.org/str.php?L2599 -apply_patch 2599 fltk-1_v4.3.x-keyboard-x11.patch -apply_patch 2599 fltk-1_v4.3.x-keyboard-win32.patch -apply_patch 2599 fltk-1_v6.3.x-keyboard-osx.patch - -# Notify applications of changes to the clipboard -# http://www.fltk.org/str.php?L2636 -apply_patch 2636 fltk-1.3.x-clipboard.patch -apply_patch 2636 fltk-1_v6.3.x-clipboard-x11.patch -apply_patch 2636 fltk-1_v3.3.x-clipboard-win32-fix.patch -apply_patch 2636 fltk-1_v2.3.x-clipboard-win32.patch -apply_patch 2636 fltk-1_v2.3.x-clipboard-osx.patch - -# Ability to convert a Fl_Pixmap to a Fl_RGB_Image -# http://www.fltk.org/str.php?L2659 -apply_patch 2659 pixmap_v2.patch - -# Support for custom cursors -# http://www.fltk.org/str.php?L2660 -apply_patch 2660 fltk-1_v5.3.x-cursor.patch - -# Improve modality interaction with WM -# http://www.fltk.org/str.php?L2802 -apply_patch 2802 fltk-1_v2.3.0-modal.patch - -# Window icons -# http://www.fltk.org/str.php?L2816 -apply_patch 2816 fltk-1_v3.3.0-icons.patch - -# Multihead -# http://fltk.org/str.php?L2860 -apply_patch 2860 fltk-1.3.x-screen_num.patch -apply_patch 2860 fltk-1_v3.3.x-multihead.patch - -# Apply DRC's patches to FLTK -curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=1' -o 0001-Add-BUILD_STATIC-feature-from-TigerVNC-to-optionally.patch -curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=2' -o 0002-Fl_cocoa.mm-depends-on-some-Carbon-functions-so-we-n.patch -curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=3' -o 0003-We-need-to-unset-CMAKE_REQUIRED_LIBRARIES-after-chec.patch - -patch -p1 -i 0001-Add-BUILD_STATIC-feature-from-TigerVNC-to-optionally.patch -patch -p1 -i 0002-Fl_cocoa.mm-depends-on-some-Carbon-functions-so-we-n.patch -patch -p1 -i 0003-We-need-to-unset-CMAKE_REQUIRED_LIBRARIES-after-chec.patch diff --git a/contrib/packages/deb/ubuntu-precise/debian/patches/series b/contrib/packages/deb/ubuntu-precise/debian/patches/series deleted file mode 100644 index b57b12ad..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/patches/series +++ /dev/null @@ -1,8 +0,0 @@ -## Patches with a number < 100 are applied in debian. -## Ubuntu patches start with 100. - -# Ubuntu patches -100_rethrow_signals.patch - -# Upstream patches -516_tigervnc-xorg-manpages.patch diff --git a/contrib/packages/deb/ubuntu-precise/debian/rules b/contrib/packages/deb/ubuntu-precise/debian/rules deleted file mode 100755 index e7432832..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/rules +++ /dev/null @@ -1,277 +0,0 @@ -#!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 by Joey Hess. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -# These are used for cross-compiling and for saving the configure script -# from having to guess our platform (since we know it already) -#DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -#DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) -DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) -ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) - confflags += --build=$(DEB_HOST_GNU_TYPE) -else - confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) -endif -SOURCE_NAME := tigervnc -SOURCE_VERSION := $(shell dpkg-parsechangelog | awk -F': ' '/^Version: / {print $$2}') -BUILDER=For technical support please see http://sourceforge.net/projects/tigervnc/support - - -ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) - CFLAGS += -g -O2 -fPIC -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif - -export CC = gcc - -get-orig-source: $(SOURCE_NAME)_$(SOURCE_VERSION).orig.tar.gz - @ - -$(SOURCE_NAME)_$(SOURCE_VERSION).orig.tar.gz: - $(CURDIR)/get-orig-source.sh - -configure: config-stamp -config-stamp: - dh_testdir - # Add here commands to configure the package. - (cd fltk-*;cmake -G"Unix Makefiles" \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_BUILD_TYPE=Release \ - -DOPTION_PREFIX_LIB=/usr/lib \ - -DOPTION_PREFIX_CONFIG=/usr/lib \ - -DOPTION_BUILD_EXAMPLES=off \ - -DOPTION_USE_SYSTEM_LIBPNG=on;make) - cmake -G"Unix Makefiles" \ - -DBUILD_STATIC=off \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DFLTK_LIBRARIES="$(CURDIR)/fltk-1.3.4-1/lib/libfltk.a;$(CURDIR)/fltk-1.3.4-1/lib/libfltk_images.a;-lpng" \ - -DFLTK_INCLUDE_DIR=$(CURDIR)/fltk-1.3.4-1 - (cd unix/xserver; \ - export PIXMANINCDIR=/usr/include/pixman-1; \ - autoreconf -fiv; \ - patch -p1 -i ../../debian/patches/debian_libtool.patch; \ - ./configure --prefix=/usr \ - --disable-silent-rules \ - --disable-static \ - --without-dtrace \ - --disable-strict-compilation \ - --disable-debug \ - --disable-unit-tests \ - --with-int10=x86emu \ - --with-extra-module-dir="/usr/lib/${DEB_HOST_MULTIARCH}/xorg/extra-modules,/usr/lib/xorg/extra-modules" \ - --with-os-vendor="$(VENDOR)" \ - --with-builderstring="$(SOURCE_NAME) $(SOURCE_VERSION) ($(BUILDER))" \ - --with-xkb-path=/usr/share/X11/xkb \ - --with-xkb-output=/var/lib/xkb \ - --with-default-xkb-rules=evdev \ - --disable-devel-docs \ - --disable-install-libxf86config \ - --enable-mitshm \ - --enable-xres \ - --disable-xcsecurity \ - --disable-xcalibrate \ - --disable-tslib \ - --enable-dbe \ - --disable-xf86bigfont \ - --disable-dpms \ - --disable-config-dbus \ - --disable-config-hal \ - --disable-config-udev \ - --disable-xorg \ - --disable-xquartz \ - --disable-xwin \ - --disable-xfake \ - --disable-install-setuid \ - --enable-gestures \ - --with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,built-ins" \ - --enable-aiglx \ - --enable-glx-tls \ - --enable-registry \ - --enable-composite \ - --enable-record \ - --enable-xv \ - --enable-xvmc \ - --enable-dga \ - --enable-screensaver \ - --enable-xdmcp \ - --enable-xdm-auth-1 \ - --enable-glx \ - --disable-dri --enable-dri2 \ - --enable-xinerama \ - --enable-xf86vidmode \ - --enable-xace \ - --disable-selinux \ - --enable-xfree86-utils \ - --disable-dmx \ - --disable-xvfb \ - --disable-xnest \ - --disable-kdrive \ - --disable-xephyr \ - --enable-xfbdev \ - --with-sha1=libgcrypt \ - --enable-xcsecurity \ - --disable-docs \ - --disable-selective-werror) - touch config-stamp - -build-arch: config-stamp build-arch-stamp -build-arch-stamp: - dh_testdir - - # Add here command to compile/build the package. - # Build first things. - # Build Xvnc - make LDFLAGS="-lpng" - (cd unix/xserver;make) - - touch build-arch-stamp - -build-indep: config-stamp build-indep-stamp -build-indep-stamp: - dh_testdir - - # Add here command to compile/build the arch indep package. - # It's ok not to do anything here, if you don't need to build - # anything for this package. - #/usr/bin/docbook-to-man debian/vnc.sgml > vnc.1 - (cd media;make) - (cd java;cmake -G"Unix Makefiles";make) - - touch build-indep-stamp - -build: build-arch build-indep - -clean: - dh_testdir - dh_testroot - rm -f build-arch-stamp build-indep-stamp config-stamp - - # Add here commands to clean up after the build process. - dh_clean - -install: DH_OPTIONS= -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_prep - dh_installdirs - # Add here commands to install the package into debian/vnc. - # tigervncserver - make install DESTDIR=$(CURDIR)/debian/tigervncserver - (cd unix/xserver/hw/vnc; make install DESTDIR=$(CURDIR)/debian/tigervncserver) - mv $(CURDIR)/debian/tigervncserver/usr/bin/Xvnc \ - $(CURDIR)/debian/tigervncserver/usr/bin/Xtigervnc - mv $(CURDIR)/debian/tigervncserver/usr/bin/vncconfig \ - $(CURDIR)/debian/tigervncserver/usr/bin/tigervncconfig - mv $(CURDIR)/debian/tigervncserver/usr/bin/vncpasswd \ - $(CURDIR)/debian/tigervncserver/usr/bin/tigervncpasswd - mv $(CURDIR)/debian/tigervncserver/usr/bin/vncserver \ - $(CURDIR)/debian/tigervncserver/usr/bin/tigervncserver - mv $(CURDIR)/debian/tigervncserver/usr/bin/x0vncserver \ - $(CURDIR)/debian/tigervncserver/usr/bin/x0tigervncserver - mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncconfig.1 \ - $(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncconfig.1 - mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncpasswd.1 \ - $(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncpasswd.1 - mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncserver.1 \ - $(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncserver.1 - mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/x0vncserver.1 \ - $(CURDIR)/debian/tigervncserver/usr/share/man/man1/x0tigervncserver.1 - mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/Xvnc.1 \ - $(CURDIR)/debian/tigervncserver/usr/share/man/man1/Xtigervnc.1 - mv $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-* \ - $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervncserver - rm $(CURDIR)/debian/tigervncserver/usr/lib/xorg/modules/extensions/libvnc.la - rm $(CURDIR)/debian/tigervncserver/usr/bin/vncviewer - rm $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncviewer.1 - install -o root -g root -m 755 -D $(CURDIR)/debian/local/vncserver.service \ - $(CURDIR)/debian/tigervncserver/etc/init.d/vncserver - install -o root -g root -m 644 -D $(CURDIR)/debian/local/vncserver.sysconfig \ - $(CURDIR)/debian/tigervncserver/etc/default/vncservers - # xtigervncviewer - (cd vncviewer; make install DESTDIR=$(CURDIR)/debian/xtigervncviewer) - # Install desktop stuff - mv $(CURDIR)/debian/xtigervncviewer/usr/bin/vncviewer \ - $(CURDIR)/debian/xtigervncviewer/usr/bin/xtigervncviewer - mv $(CURDIR)/debian/xtigervncviewer/usr/share/man/man1/vncviewer.1 \ - $(CURDIR)/debian/xtigervncviewer/usr/share/man/man1/xtigervncviewer.1 - # tigervnc-java - mkdir -p $(CURDIR)/debian/tigervnc-java/usr/share - (cd java; make install DESTDIR=$(CURDIR)/debian/tigervnc-java/usr/share) - #dh_movefiles - -# Build architecture-independent files here. -# Pass -i to all debhelper commands in this target to reduce clutter. -binary-indep: build install - -binary-indep-keep: - dh_testdir -i - dh_testroot -i -# dh_installdebconf -i - dh_install - dh_installdocs -i - dh_installexamples -i - dh_installmenu -i -# dh_installlogrotate -i -# dh_installemacsen -i -# dh_installpam -i -# dh_installmime -i -# dh_installinit -i - dh_installcron -i - dh_installman -i - dh_installinfo -i -# dh_undocumented -i - dh_installchangelogs -i - dh_link -i - dh_compress -i - dh_fixperms -i - dh_installdeb -i - dh_perl -i - dh_gencontrol -i - dh_md5sums -i - dh_builddeb -i - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir -a - dh_testroot -a -# dh_installdebconf -a - dh_installdocs -a -# dh_installexamples -a - dh_installmenu -a -# dh_installlogrotate -a -# dh_installemacsen -a -# dh_installpam -a -# dh_installmime -a - dh_install - dh_installinit -a -# dh_installcron -a - dh_installman -a - dh_installinfo -a -# dh_undocumented -a - dh_installchangelogs -a - # Remove empty directories - dh_strip -a - dh_link -a - dh_compress -a - dh_fixperms -a - dh_makeshlibs -a - dh_installdeb -a - dh_perl -a - dh_shlibdeps -a - dh_gencontrol -a - dh_md5sums -a - dh_builddeb -a - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install get-orig-source diff --git a/contrib/packages/deb/ubuntu-precise/debian/source/format b/contrib/packages/deb/ubuntu-precise/debian/source/format deleted file mode 100644 index 163aaf8d..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/contrib/packages/deb/ubuntu-precise/debian/tigervncserver.postinst b/contrib/packages/deb/ubuntu-precise/debian/tigervncserver.postinst deleted file mode 100644 index aaed2f6b..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/tigervncserver.postinst +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -e - -if [ "$1" = "configure" ]; then - MAN=/usr/share/man/man1 - BIN=/usr/bin - update-alternatives --install \ - $BIN/vncserver vncserver $BIN/tigervncserver 64 \ - --slave \ - $MAN/vncserver.1.gz vncserver.1.gz $MAN/tigervncserver.1.gz - update-alternatives --install \ - $BIN/Xvnc Xvnc $BIN/Xtigervnc 74 \ - --slave \ - $MAN/Xvnc.1.gz Xvnc.1.gz $MAN/Xtigervnc.1.gz - update-alternatives --install \ - $BIN/x0vncserver x0vncserver $BIN/x0tigervncserver 74 \ - --slave \ - $MAN/x0vncserver.1.gz x0vncserver.1.gz $MAN/x0tigervncserver.1.gz - update-alternatives --install \ - $BIN/vncpasswd vncpasswd $BIN/tigervncpasswd 74 \ - --slave \ - $MAN/vncpasswd.1.gz vncpasswd.1.gz $MAN/tigervncpasswd.1.gz - update-alternatives --install \ - $BIN/vncconfig vncconfig $BIN/tigervncconfig 64 \ - --slave \ - $MAN/vncconfig.1.gz vncconfig.1.gz $MAN/tigervncconfig.1.gz -fi - -#DEBHELPER# - -exit 0 diff --git a/contrib/packages/deb/ubuntu-precise/debian/tigervncserver.prerm b/contrib/packages/deb/ubuntu-precise/debian/tigervncserver.prerm deleted file mode 100644 index 108b177d..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/tigervncserver.prerm +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -e - -if [ "$1" = "remove" ] ; then - BIN=/usr/bin - update-alternatives --remove \ - vncserver $BIN/tigervncserver - update-alternatives --remove \ - Xvnc $BIN/Xtigervnc - update-alternatives --remove \ - x0vncserver $BIN/x0tigervncserver - update-alternatives --remove \ - vncpasswd $BIN/tigervncpasswd - update-alternatives --remove \ - tigervncconfig $BIN/tigervncconfig -fi - -#DEBHELPER# - -exit 0 diff --git a/contrib/packages/deb/ubuntu-precise/debian/xtigervncviewer.menu b/contrib/packages/deb/ubuntu-precise/debian/xtigervncviewer.menu deleted file mode 100644 index aac942ca..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/xtigervncviewer.menu +++ /dev/null @@ -1,5 +0,0 @@ -?package(xtigervncviewer):needs="x11" \ - section="Applications/Network/Communication" \ - hints="VNC,remote-control"\ - title="xtigervncviewer" \ - command="/usr/bin/xtigervncviewer" diff --git a/contrib/packages/deb/ubuntu-precise/debian/xtigervncviewer.postinst b/contrib/packages/deb/ubuntu-precise/debian/xtigervncviewer.postinst deleted file mode 100644 index 4df0c65f..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/xtigervncviewer.postinst +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -e - -if [ "$1" = "configure" ]; then - MAN=/usr/share/man/man1 - BIN=/usr/bin - update-alternatives --install \ - $BIN/vncviewer vncviewer $BIN/xtigervncviewer 74 \ - --slave \ - $MAN/vncviewer.1.gz vncviewer.1.gz $MAN/xtigervncviewer.1.gz \ - --slave \ - $MAN/xvncviewer.1.gz xvncviewer.1.gz $MAN/xtigervncviewer.1.gz \ - --slave \ - $BIN/xvncviewer xvncviewer $BIN/xtigervncviewer -fi - -#DEBHELPER# - -exit 0 diff --git a/contrib/packages/deb/ubuntu-precise/debian/xtigervncviewer.prerm b/contrib/packages/deb/ubuntu-precise/debian/xtigervncviewer.prerm deleted file mode 100644 index 7a51fd2c..00000000 --- a/contrib/packages/deb/ubuntu-precise/debian/xtigervncviewer.prerm +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -e - -if [ "$1" = "remove" ] ; then - BIN=/usr/bin - update-alternatives --remove \ - vncviewer $BIN/xtigervncviewer -fi - -#DEBHELPER# - -exit 0 diff --git a/contrib/packages/deb/ubuntu-trusty/debian/changelog b/contrib/packages/deb/ubuntu-trusty/debian/changelog index 28fc3c92..9d37a27a 100644 --- a/contrib/packages/deb/ubuntu-trusty/debian/changelog +++ b/contrib/packages/deb/ubuntu-trusty/debian/changelog @@ -1,3 +1,9 @@ +tigervnc (1.9.80-1) trusty; urgency=low + + * Build Xvnc against distro xorg sources. + + -- Pierre Ossman <ossman@cendio.se> Fri, 18 Jan 2019 15:42:46 +0100 + tigervnc (1.3.0-3ubuntu1) precise; urgency=low * Build Xvnc against native upstream xorg sources, using native config diff --git a/contrib/packages/deb/ubuntu-trusty/debian/control b/contrib/packages/deb/ubuntu-trusty/debian/control index f1cf906a..20d5995c 100644 --- a/contrib/packages/deb/ubuntu-trusty/debian/control +++ b/contrib/packages/deb/ubuntu-trusty/debian/control @@ -3,7 +3,7 @@ Section: x11 Priority: optional Maintainer: Brian P. Hinz <bphinz@users.sourceforge.net> Standards-Version: 3.8.4 -Build-Depends: debhelper (>> 7.1), zlib1g-dev, libjpeg-turbo8-dev, libxaw7-dev (>> 4.1.0), perl-modules, xfonts-base, xutils-dev, libx11-dev, libxau-dev, libxext-dev, libxi-dev, libxkbfile-dev, libxmu-dev, libxt-dev, x11proto-core-dev, cmake (>> 2.8), libgnutls28-dev, libpam0g-dev, libpng-dev, automake, autoconf, libtool, pkg-config, libpixman-1-dev, x11proto-bigreqs-dev, x11proto-composite-dev, x11proto-damage-dev, x11proto-dri2-dev, x11proto-fixes-dev, x11proto-fonts-dev, x11proto-gl-dev, x11proto-input-dev, x11proto-kb-dev, x11proto-randr-dev, x11proto-render-dev, x11proto-resource-dev, x11proto-scrnsaver-dev, x11proto-video-dev, x11proto-xext-dev, x11proto-xf86bigfont-dev, x11proto-xf86dga-dev, x11proto-xf86dri-dev, x11proto-xf86vidmode-dev, x11proto-xinerama-dev, libosmesa6-dev, libgl1-mesa-dev, libgl1-mesa-dri, libgl1-mesa-glx, libxfont-dev, x11proto-record-dev, default-jdk, libxtst-dev, libxft-dev, libexpat1-dev, libfontconfig1-dev, libxrender-dev, libt1-dev, libpciaccess-dev, curl, bzip2, quilt, libglu1-mesa-dev, libxcursor-dev, libxinerama-dev, libxfixes-dev, libcairo2-dev, x11proto-dri3-dev, libgcrypt20-dev, x11proto-xcmisc-dev, x11proto-present-dev, libtasn1-dev +Build-Depends: debhelper (>> 7.1), zlib1g-dev, libjpeg-turbo8-dev, libxaw7-dev (>> 4.1.0), perl-modules, xfonts-base, xutils-dev, libx11-dev, libxau-dev, libxext-dev, libxi-dev, libxkbfile-dev, libxmu-dev, libxt-dev, x11proto-core-dev, cmake (>> 2.8), libgnutls28-dev, libpam0g-dev, libpng-dev, automake, autoconf, libtool, pkg-config, libpixman-1-dev, x11proto-bigreqs-dev, x11proto-composite-dev, x11proto-damage-dev, x11proto-dri2-dev, x11proto-fixes-dev, x11proto-fonts-dev, x11proto-gl-dev, x11proto-input-dev, x11proto-kb-dev, x11proto-randr-dev, x11proto-render-dev, x11proto-resource-dev, x11proto-scrnsaver-dev, x11proto-video-dev, x11proto-xext-dev, x11proto-xf86bigfont-dev, x11proto-xf86dga-dev, x11proto-xf86dri-dev, x11proto-xf86vidmode-dev, x11proto-xinerama-dev, libosmesa6-dev, libgl1-mesa-dev, libgl1-mesa-dri, libgl1-mesa-glx, libxfont-dev, x11proto-record-dev, default-jdk, libxtst-dev, libxft-dev, libexpat1-dev, libfontconfig1-dev, libxrender-dev, libt1-dev, libpciaccess-dev, curl, bzip2, quilt, libglu1-mesa-dev, libxcursor-dev, libxinerama-dev, libxfixes-dev, libxrandr-dev, libcairo2-dev, x11proto-dri3-dev, libgcrypt20-dev, x11proto-xcmisc-dev, x11proto-present-dev, libtasn1-dev, xorg-server-source Homepage: http://www.tigervnc.com Package: tigervncserver diff --git a/contrib/packages/deb/ubuntu-trusty/debian/get-orig-source.sh b/contrib/packages/deb/ubuntu-trusty/debian/get-orig-source.sh deleted file mode 100755 index 64b26155..00000000 --- a/contrib/packages/deb/ubuntu-trusty/debian/get-orig-source.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -#curl -L -o tigervnc-1.3.0.tar.bz2 "http://downloads.sourceforge.net/project/tigervnc/tigervnc/1.3.0/tigervnc-1.3.0.tar.bz2" -#tar xjf tigervnc-*.tar.bz2 -#rm tigervnc-*.tar.bz2 -curl -OL http://sourceforge.net/code-snapshots/svn/t/ti/tigervnc/code/tigervnc-code-5136-trunk.zip -unzip tigervnc-code-*-trunk.zip -mv tigervnc-code-*-trunk tigervnc-1.3.80 -rm tigervnc-code-*-trunk.zip -pushd tigervnc-* -curl -L -o fltk-1.3.2-source.tar.gz 'http://anonscm.debian.org/gitweb/?p=users/ucko/fltk1.3.git;a=snapshot;h=HEAD;sf=tgz' -tar xzf fltk-*-source.tar.gz -rm fltk-*-source.tar.gz -mv fltk1.3-* fltk-1.3.2 -pushd fltk-* -sh ../../debian/patch_fltk.sh -find . -name "*.orig" -exec rm {} \; -popd -curl -L -o xorg-server-1.11.4-0ubuntu10.3.tar.gz 'http://anonscm.debian.org/gitweb/?p=pkg-xorg/xserver/xorg-server.git;a=snapshot;h=cbf435a091906484112f5c4cf35b17738e779ce9;sf=tgz' -tar xzf xorg-server-*.tar.gz -rm xorg-server-*.tar.gz -pushd xorg-server-* -QUILT_PATCHES=debian/patches quilt push -a -popd -cp -r xorg-server-*/* unix/xserver -rm -rf xorg-server-* -pushd unix/xserver -for all in `find . -type f -perm -001`; do - chmod -x "$all" -done -patch -p1 -b --suffix .vnc < ../xserver111.patch -popd -popd -if [ -e tigervnc_1.3.80.orig.tar.gz ] ; then - rm tigervnc_1.3.80.orig.tar.gz -fi -tar czf tigervnc_1.3.80.orig.tar.gz tigervnc-1.3.80 -rm -rf tigervnc-1.3.80 diff --git a/contrib/packages/deb/ubuntu-trusty/debian/patch_fltk.sh b/contrib/packages/deb/ubuntu-trusty/debian/patch_fltk.sh deleted file mode 100755 index a2dc0f08..00000000 --- a/contrib/packages/deb/ubuntu-trusty/debian/patch_fltk.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -set -e -apply_patch() -{ - rm -f $2 - curl -OL http://www.fltk.org/strfiles/$1/$2 - patch -p1 < $2 -} - -# Export dead key information from FLTK to the apps -# http://www.fltk.org/str.php?L2599 -apply_patch 2599 fltk-1_v4.3.x-keyboard-x11.patch -apply_patch 2599 fltk-1_v4.3.x-keyboard-win32.patch -apply_patch 2599 fltk-1_v6.3.x-keyboard-osx.patch - -# Notify applications of changes to the clipboard -# http://www.fltk.org/str.php?L2636 -apply_patch 2636 fltk-1.3.x-clipboard.patch -apply_patch 2636 fltk-1_v6.3.x-clipboard-x11.patch -apply_patch 2636 fltk-1_v3.3.x-clipboard-win32-fix.patch -apply_patch 2636 fltk-1_v2.3.x-clipboard-win32.patch -apply_patch 2636 fltk-1_v2.3.x-clipboard-osx.patch - -# Ability to convert a Fl_Pixmap to a Fl_RGB_Image -# http://www.fltk.org/str.php?L2659 -apply_patch 2659 pixmap_v2.patch - -# Support for custom cursors -# http://www.fltk.org/str.php?L2660 -apply_patch 2660 fltk-1_v5.3.x-cursor.patch - -# Improve modality interaction with WM -# http://www.fltk.org/str.php?L2802 -apply_patch 2802 fltk-1_v2.3.0-modal.patch - -# Window icons -# http://www.fltk.org/str.php?L2816 -apply_patch 2816 fltk-1_v3.3.0-icons.patch - -# Multihead -# http://fltk.org/str.php?L2860 -apply_patch 2860 fltk-1.3.x-screen_num.patch -apply_patch 2860 fltk-1_v3.3.x-multihead.patch - -# Apply DRC's patches to FLTK -curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=1' -o 0001-Add-BUILD_STATIC-feature-from-TigerVNC-to-optionally.patch -curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=2' -o 0002-Fl_cocoa.mm-depends-on-some-Carbon-functions-so-we-n.patch -curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=3' -o 0003-We-need-to-unset-CMAKE_REQUIRED_LIBRARIES-after-chec.patch - -patch -p1 -i 0001-Add-BUILD_STATIC-feature-from-TigerVNC-to-optionally.patch -patch -p1 -i 0002-Fl_cocoa.mm-depends-on-some-Carbon-functions-so-we-n.patch -patch -p1 -i 0003-We-need-to-unset-CMAKE_REQUIRED_LIBRARIES-after-chec.patch diff --git a/contrib/packages/deb/ubuntu-trusty/debian/patches/100_rethrow_signals.patch b/contrib/packages/deb/ubuntu-trusty/debian/patches/100_rethrow_signals.patch deleted file mode 100644 index b40b1483..00000000 --- a/contrib/packages/deb/ubuntu-trusty/debian/patches/100_rethrow_signals.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/unix/xserver/hw/vnc/xvnc.c 2013-07-14 14:05:29.963390223 -0400 -+++ b/unix/xserver/hw/vnc/xvnc.c 2013-07-14 14:04:12.840357191 -0400 -@@ -250,7 +250,7 @@ - #if XORG < 111 - AbortDDX() - #else --AbortDDX(enum ExitCode error) -+SigAbortDDX(int signo, enum ExitCode error) - #endif - { - #if XORG < 111 -@@ -260,6 +260,14 @@ - #endif - } - -+#if XORG >= 111 -+void -+AbortDDX(enum ExitCode error) -+{ -+ SigAbortDDX(0, error); -+} -+#endif -+ - #ifdef __DARWIN__ - void - DarwinHandleGUI(int argc, char *argv[]) diff --git a/contrib/packages/deb/ubuntu-trusty/debian/patches/516_tigervnc-xorg-manpages.patch b/contrib/packages/deb/ubuntu-trusty/debian/patches/516_tigervnc-xorg-manpages.patch deleted file mode 100644 index 4575f6a9..00000000 --- a/contrib/packages/deb/ubuntu-trusty/debian/patches/516_tigervnc-xorg-manpages.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/unix/xserver/man/Makefile.am 2013-03-30 17:51:01.707258746 -0400 -+++ b/unix/xserver/man/Makefile.am 2013-03-30 17:51:47.606569692 -0400 -@@ -2,5 +2,7 @@ - # (i.e. those handled in the os/utils.c options processing instead of in - # the DDX-level options processing) - -+if ENABLE_DOCS - include $(top_srcdir)/manpages.am - appman_PRE = Xserver.man -+endif ENABLE_DOCS diff --git a/contrib/packages/deb/ubuntu-trusty/debian/patches/debian_libtool.patch b/contrib/packages/deb/ubuntu-trusty/debian/patches/debian_libtool.patch deleted file mode 100644 index 7be0ba2b..00000000 --- a/contrib/packages/deb/ubuntu-trusty/debian/patches/debian_libtool.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- a/ltmain.sh 2016-05-11 23:23:25.796742323 -0400 -+++ b/ltmain.sh 2016-05-11 23:24:47.173010324 -0400 -@@ -6447,6 +6447,9 @@ - # It is a libtool convenience library, so add in its objects. - func_append convenience " $ladir/$objdir/$old_library" - func_append old_convenience " $ladir/$objdir/$old_library" -+ elif test "$linkmode" != prog && test "$linkmode" != lib; then -+ func_fatal_error "\`$lib' is not a convenience library" -+ fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" -@@ -6457,9 +6460,6 @@ - fi - func_append tmp_libs " $deplib" - done -- elif test "$linkmode" != prog && test "$linkmode" != lib; then -- func_fatal_error "\`$lib' is not a convenience library" -- fi - continue - fi # $pass = conv - ---- a/m4/libtool.m4 2016-05-11 23:26:23.801328557 -0400 -+++ b/m4/libtool.m4 2016-05-11 23:27:12.701489603 -0400 -@@ -4589,9 +4589,6 @@ - ;; - esac - ;; -- linux* | k*bsd*-gnu | gnu*) -- _LT_TAGVAR(link_all_deplibs, $1)=no -- ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; -@@ -4654,9 +4651,6 @@ - openbsd*) - with_gnu_ld=no - ;; -- linux* | k*bsd*-gnu | gnu*) -- _LT_TAGVAR(link_all_deplibs, $1)=no -- ;; - esac - - _LT_TAGVAR(ld_shlibs, $1)=yes -@@ -5055,7 +5049,6 @@ - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi -- _LT_TAGVAR(link_all_deplibs, $1)=no - else - # not using gcc - if test "$host_cpu" = ia64; then diff --git a/contrib/packages/deb/ubuntu-trusty/debian/patches/series b/contrib/packages/deb/ubuntu-trusty/debian/patches/series deleted file mode 100644 index b57b12ad..00000000 --- a/contrib/packages/deb/ubuntu-trusty/debian/patches/series +++ /dev/null @@ -1,8 +0,0 @@ -## Patches with a number < 100 are applied in debian. -## Ubuntu patches start with 100. - -# Ubuntu patches -100_rethrow_signals.patch - -# Upstream patches -516_tigervnc-xorg-manpages.patch diff --git a/contrib/packages/deb/ubuntu-trusty/debian/rules b/contrib/packages/deb/ubuntu-trusty/debian/rules index ea9f1437..a84e86b9 100755 --- a/contrib/packages/deb/ubuntu-trusty/debian/rules +++ b/contrib/packages/deb/ubuntu-trusty/debian/rules @@ -10,6 +10,8 @@ LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) export CFLAGS CPPFLAGS CXXFLAGS LDFLAGS +NUMJOBS := -j$(shell nproc) + # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -42,30 +44,38 @@ endif export CC = gcc -XCFLAGS = -Wall -Wunused -Wno-format-y2k -fPIE -fno-strict-aliasing +# use xorg sources as shipped in xorg-server-source package +XORG_SOURCE_ARCHIVE = /usr/src/xorg-server.tar.xz -get-orig-source: $(SOURCE_NAME)_$(SOURCE_VERSION).orig.tar.gz - @ +xorg-source-stamp: $(XORG_SOURCE_ARCHIVE) + tar -C unix/xserver -axf $(XORG_SOURCE_ARCHIVE) --strip-components=1 + cd unix/xserver && patch -p1 < ../xserver115.patch + patch -p1 < debian/xorg-source-patches/100_rethrow_signals.patch + patch -p1 < debian/xorg-source-patches/516_tigervnc-xorg-manpages.patch + touch xorg-source-stamp + +XCFLAGS = -Wall -Wunused -Wno-format-y2k -fPIE -fno-strict-aliasing -$(SOURCE_NAME)_$(SOURCE_VERSION).orig.tar.gz: - $(CURDIR)/get-orig-source.sh +fltk-stamp: + (cd fltk-*;DSOFLAGS="$(filter-out -fPIE -pie,$(LDFLAGS))" \ + ./configure --enable-shared=no --enable-cairo --enable-cp936 \ + --with-optim="$(CFLAGS) $(XCFLAGS)" --libdir=$(libdir)) + make $(NUMJOBS) -C fltk-* + touch fltk-stamp configure: config-stamp -config-stamp: +config-stamp: xorg-source-stamp fltk-stamp dh_testdir # Add here commands to configure the package. - (cd fltk-*;DSOFLAGS="$(filter-out -fPIE -pie,$(LDFLAGS))" \ - ./configure --enable-shared=no --enable-cairo --enable-cp936 \ - --with-optim="$(CFLAGS) $(XCFLAGS)" --libdir=$(libdir);make) cmake -G"Unix Makefiles" \ -DBUILD_STATIC=off \ -DCMAKE_INSTALL_PREFIX=/usr \ - -DFLTK_LIBRARIES="$(CURDIR)/fltk-1.3.4-1/lib/libfltk.a;$(CURDIR)/fltk-1.3.4-1/lib/libfltk_images.a;-lpng" \ - -DFLTK_INCLUDE_DIR=$(CURDIR)/fltk-1.3.4-1 + -DFLTK_LIBRARIES="$(CURDIR)/fltk-1.3.4-2/lib/libfltk.a;$(CURDIR)/fltk-1.3.4-2/lib/libfltk_images.a;-lpng;-ldl" \ + -DFLTK_INCLUDE_DIR=$(CURDIR)/fltk-1.3.4-2 (cd unix/xserver; \ export PIXMANINCDIR=/usr/include/pixman-1; \ autoreconf -fiv; \ - patch -p1 -i ../../debian/patches/debian_libtool.patch; \ + patch -p1 -i ../../debian/xorg-source-patches/debian_libtool.patch; \ ./configure --prefix=/usr \ --disable-silent-rules \ --disable-static \ @@ -137,8 +147,8 @@ build-arch-stamp: # Add here command to compile/build the package. # Build first things. # Build Xvnc - make LDFLAGS="-lpng" - (cd unix/xserver;make) + make $(NUMJOBS) LDFLAGS="-lpng" + make $(NUMJOBS) -C unix/xserver touch build-arch-stamp @@ -281,4 +291,4 @@ binary-arch: build install dh_builddeb -a binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install get-orig-source +.PHONY: build clean binary-indep binary-arch binary install diff --git a/contrib/packages/deb/ubuntu-precise/debian/patches/100_rethrow_signals.patch b/contrib/packages/deb/ubuntu-trusty/debian/xorg-source-patches/100_rethrow_signals.patch index b40b1483..b40b1483 100644 --- a/contrib/packages/deb/ubuntu-precise/debian/patches/100_rethrow_signals.patch +++ b/contrib/packages/deb/ubuntu-trusty/debian/xorg-source-patches/100_rethrow_signals.patch diff --git a/contrib/packages/deb/ubuntu-precise/debian/patches/516_tigervnc-xorg-manpages.patch b/contrib/packages/deb/ubuntu-trusty/debian/xorg-source-patches/516_tigervnc-xorg-manpages.patch index 4575f6a9..4575f6a9 100644 --- a/contrib/packages/deb/ubuntu-precise/debian/patches/516_tigervnc-xorg-manpages.patch +++ b/contrib/packages/deb/ubuntu-trusty/debian/xorg-source-patches/516_tigervnc-xorg-manpages.patch diff --git a/contrib/packages/deb/ubuntu-precise/debian/patches/debian_libtool.patch b/contrib/packages/deb/ubuntu-trusty/debian/xorg-source-patches/debian_libtool.patch index 7be0ba2b..7be0ba2b 100644 --- a/contrib/packages/deb/ubuntu-precise/debian/patches/debian_libtool.patch +++ b/contrib/packages/deb/ubuntu-trusty/debian/xorg-source-patches/debian_libtool.patch diff --git a/contrib/packages/deb/ubuntu-xenial/debian/control b/contrib/packages/deb/ubuntu-xenial/debian/control index c947f45a..e4a94045 100644 --- a/contrib/packages/deb/ubuntu-xenial/debian/control +++ b/contrib/packages/deb/ubuntu-xenial/debian/control @@ -3,7 +3,7 @@ Section: x11 Priority: optional Maintainer: Brian P. Hinz <bphinz@users.sourceforge.net> Standards-Version: 3.8.4 -Build-Depends: debhelper (>> 7.1), zlib1g-dev, libjpeg-turbo8-dev, libxaw7-dev (>> 4.1.0), perl-modules, xfonts-base, xutils-dev, libx11-dev, libxau-dev, libxext-dev, libxi-dev, libxkbfile-dev, libxmu-dev, libxt-dev, x11proto-core-dev, cmake (>> 2.8), libgnutls-dev, libpam0g-dev, libpng12-dev, automake, autoconf, libtool, pkg-config, libpixman-1-dev, x11proto-bigreqs-dev, x11proto-composite-dev, x11proto-damage-dev, x11proto-dri2-dev, x11proto-fixes-dev, x11proto-fonts-dev, x11proto-gl-dev, x11proto-input-dev, x11proto-kb-dev, x11proto-randr-dev, x11proto-render-dev, x11proto-resource-dev, x11proto-scrnsaver-dev, x11proto-video-dev, x11proto-xext-dev, x11proto-xf86bigfont-dev, x11proto-xf86dga-dev, x11proto-xf86dri-dev, x11proto-xf86vidmode-dev, x11proto-xinerama-dev, libosmesa6-dev, libgl1-mesa-dev, libgl1-mesa-dri, libgl1-mesa-glx, libxfont-dev, x11proto-record-dev, default-jdk, libxtst-dev, libxft-dev, libexpat1-dev, libfontconfig1-dev, libxrender-dev, libpciaccess-dev, curl, bzip2, quilt, libglu1-mesa-dev, libxcursor-dev, libxinerama-dev, libxfixes-dev, libcairo2-dev, x11proto-dri3-dev, libgcrypt20-dev, x11proto-xcmisc-dev, x11proto-present-dev, xorg-server-source, libfltk1.3-dev, fluid +Build-Depends: debhelper (>> 7.1), zlib1g-dev, libjpeg-turbo8-dev, libxaw7-dev (>> 4.1.0), perl-modules, xfonts-base, xutils-dev, libx11-dev, libxau-dev, libxext-dev, libxi-dev, libxkbfile-dev, libxmu-dev, libxt-dev, x11proto-core-dev, cmake (>> 2.8), libgnutls-dev, libpam0g-dev, libpng12-dev, automake, autoconf, libtool, pkg-config, libpixman-1-dev, x11proto-bigreqs-dev, x11proto-composite-dev, x11proto-damage-dev, x11proto-dri2-dev, x11proto-fixes-dev, x11proto-fonts-dev, x11proto-gl-dev, x11proto-input-dev, x11proto-kb-dev, x11proto-randr-dev, x11proto-render-dev, x11proto-resource-dev, x11proto-scrnsaver-dev, x11proto-video-dev, x11proto-xext-dev, x11proto-xf86bigfont-dev, x11proto-xf86dga-dev, x11proto-xf86dri-dev, x11proto-xf86vidmode-dev, x11proto-xinerama-dev, libosmesa6-dev, libgl1-mesa-dev, libgl1-mesa-dri, libgl1-mesa-glx, libxfont-dev, x11proto-record-dev, default-jdk, libxtst-dev, libxft-dev, libexpat1-dev, libfontconfig1-dev, libxrender-dev, libpciaccess-dev, curl, bzip2, quilt, libglu1-mesa-dev, libxcursor-dev, libxinerama-dev, libxfixes-dev, libxfont1-dev, libxrandr-dev, libcairo2-dev, x11proto-dri3-dev, libgcrypt20-dev, x11proto-xcmisc-dev, x11proto-present-dev, xorg-server-source, libfltk1.3-dev, fluid Homepage: http://www.tigervnc.com Package: tigervncserver diff --git a/contrib/packages/deb/ubuntu-xenial/debian/rules b/contrib/packages/deb/ubuntu-xenial/debian/rules index 7509e7b4..3d58d282 100644 --- a/contrib/packages/deb/ubuntu-xenial/debian/rules +++ b/contrib/packages/deb/ubuntu-xenial/debian/rules @@ -10,6 +10,8 @@ LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) export CFLAGS CPPFLAGS CXXFLAGS LDFLAGS +NUMJOBS := -j$(shell nproc) + # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -124,8 +126,8 @@ build-arch-stamp: # Add here command to compile/build the package. # Build first things. # Build Xvnc - make LDFLAGS="-lpng" - (cd unix/xserver;make) + make $(NUMJOBS) LDFLAGS="-lpng" + make $(NUMJOBS) -C unix/xserver touch build-arch-stamp diff --git a/contrib/packages/rpm/el5/SOURCES/16_CVE-2014-mult.diff b/contrib/packages/rpm/el5/SOURCES/16_CVE-2014-mult.diff deleted file mode 100644 index 2a754202..00000000 --- a/contrib/packages/rpm/el5/SOURCES/16_CVE-2014-mult.diff +++ /dev/null @@ -1,3387 +0,0 @@ -diff -Naur xorg-server-1.12.4.orig/dbe/dbe.c xorg-server-1.12.4/dbe/dbe.c ---- xorg-server-1.12.4.orig/dbe/dbe.c 2012-05-17 19:09:01.000000000 +0200 -+++ xorg-server-1.12.4/dbe/dbe.c 2014-11-28 09:50:59.185807584 +0100 -@@ -453,18 +453,20 @@ - DbeSwapInfoPtr swapInfo; - xDbeSwapInfo *dbeSwapInfo; - int error; -- register int i, j; -- int nStuff; -+ unsigned int i, j; -+ unsigned int nStuff; - - REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq); - nStuff = stuff->n; /* use local variable for performance. */ - - if (nStuff == 0) { -+ REQUEST_SIZE_MATCH(xDbeSwapBuffersReq); - return Success; - } - - if (nStuff > UINT32_MAX / sizeof(DbeSwapInfoRec)) - return BadAlloc; -+ REQUEST_FIXED_SIZE(xDbeSwapBuffersReq, nStuff * sizeof(xDbeSwapInfo)); - - /* Get to the swap info appended to the end of the request. */ - dbeSwapInfo = (xDbeSwapInfo *) &stuff[1]; -@@ -955,13 +957,16 @@ - SProcDbeSwapBuffers(ClientPtr client) - { - REQUEST(xDbeSwapBuffersReq); -- register int i; -+ unsigned int i; - xDbeSwapInfo *pSwapInfo; - - swaps(&stuff->length); - REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq); - - swapl(&stuff->n); -+ if (stuff->n > UINT32_MAX / sizeof(DbeSwapInfoRec)) -+ return BadAlloc; -+ REQUEST_FIXED_SIZE(xDbeSwapBuffersReq, stuff->n * sizeof(xDbeSwapInfo)); - - if (stuff->n != 0) { - pSwapInfo = (xDbeSwapInfo *) stuff + 1; -diff -Naur xorg-server-1.12.4.orig/dix/dispatch.c xorg-server-1.12.4/dix/dispatch.c ---- xorg-server-1.12.4.orig/dix/dispatch.c 2012-05-17 19:09:01.000000000 +0200 -+++ xorg-server-1.12.4/dix/dispatch.c 2014-11-28 09:50:37.761568914 +0100 -@@ -1952,6 +1952,9 @@ - tmpImage = (char *) &stuff[1]; - lengthProto = length; - -+ if (lengthProto >= (INT32_MAX / stuff->height)) -+ return BadLength; -+ - if ((bytes_to_int32(lengthProto * stuff->height) + - bytes_to_int32(sizeof(xPutImageReq))) != client->req_len) - return BadLength; -diff -Naur xorg-server-1.12.4.orig/dix/region.c xorg-server-1.12.4/dix/region.c ---- xorg-server-1.12.4.orig/dix/region.c 2012-05-17 19:09:02.000000000 +0200 -+++ xorg-server-1.12.4/dix/region.c 2014-11-28 09:50:45.169651442 +0100 -@@ -169,7 +169,6 @@ - ((r1)->y1 <= (r2)->y1) && \ - ((r1)->y2 >= (r2)->y2) ) - --#define xallocData(n) malloc(RegionSizeof(n)) - #define xfreeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data) - - #define RECTALLOC_BAIL(pReg,n,bail) \ -@@ -205,8 +204,9 @@ - #define DOWNSIZE(reg,numRects) \ - if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \ - { \ -- RegDataPtr NewData; \ -- NewData = (RegDataPtr)realloc((reg)->data, RegionSizeof(numRects)); \ -+ size_t NewSize = RegionSizeof(numRects); \ -+ RegDataPtr NewData = \ -+ (NewSize > 0) ? realloc((reg)->data, NewSize) : NULL ; \ - if (NewData) \ - { \ - NewData->size = (numRects); \ -@@ -330,17 +330,20 @@ - RegionRectAlloc(RegionPtr pRgn, int n) - { - RegDataPtr data; -+ size_t rgnSize; - - if (!pRgn->data) { - n++; -- pRgn->data = xallocData(n); -+ rgnSize = RegionSizeof(n); -+ pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL; - if (!pRgn->data) - return RegionBreak(pRgn); - pRgn->data->numRects = 1; - *RegionBoxptr(pRgn) = pRgn->extents; - } - else if (!pRgn->data->size) { -- pRgn->data = xallocData(n); -+ rgnSize = RegionSizeof(n); -+ pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL; - if (!pRgn->data) - return RegionBreak(pRgn); - pRgn->data->numRects = 0; -@@ -352,7 +355,8 @@ - n = 250; - } - n += pRgn->data->numRects; -- data = (RegDataPtr) realloc(pRgn->data, RegionSizeof(n)); -+ rgnSize = RegionSizeof(n); -+ data = (rgnSize > 0) ? realloc(pRgn->data, rgnSize) : NULL; - if (!data) - return RegionBreak(pRgn); - pRgn->data = data; -@@ -1297,6 +1301,7 @@ - { - - RegionPtr pRgn; -+ size_t rgnSize; - RegDataPtr pData; - BoxPtr pBox; - int i; -@@ -1323,7 +1328,8 @@ - } - return pRgn; - } -- pData = xallocData(nrects); -+ rgnSize = RegionSizeof(nrects); -+ pData = (rgnSize > 0) ? malloc(rgnSize) : NULL; - if (!pData) { - RegionBreak(pRgn); - return pRgn; -diff -Naur xorg-server-1.12.4.orig/glx/glxcmds.c xorg-server-1.12.4/glx/glxcmds.c ---- xorg-server-1.12.4.orig/glx/glxcmds.c 2012-08-02 02:59:23.000000000 +0200 -+++ xorg-server-1.12.4/glx/glxcmds.c 2014-11-28 09:51:59.834483171 +0100 -@@ -1948,7 +1948,7 @@ - left = (req->length << 2) - sz_xGLXRenderReq; - while (left > 0) { - __GLXrenderSizeData entry; -- int extra; -+ int extra = 0; - __GLXdispatchRenderProcPtr proc; - int err; - -@@ -1967,6 +1967,9 @@ - cmdlen = hdr->length; - opcode = hdr->opcode; - -+ if (left < cmdlen) -+ return BadLength; -+ - /* - ** Check for core opcodes and grab entry data. - */ -@@ -1980,24 +1983,20 @@ - return __glXError(GLXBadRenderRequest); - } - -+ if (cmdlen < entry.bytes) { -+ return BadLength; -+ } -+ - if (entry.varsize) { - /* variable size command */ - extra = (*entry.varsize) (pc + __GLX_RENDER_HDR_SIZE, - client->swapped); - if (extra < 0) { -- extra = 0; -- } -- if (cmdlen != __GLX_PAD(entry.bytes + extra)) { -- return BadLength; -- } -- } -- else { -- /* constant size command */ -- if (cmdlen != __GLX_PAD(entry.bytes)) { - return BadLength; - } - } -- if (left < cmdlen) { -+ -+ if (cmdlen != safe_pad(safe_add(entry.bytes, extra))) { - return BadLength; - } - -@@ -2102,7 +2101,7 @@ - extra = (*entry.varsize) (pc + __GLX_RENDER_LARGE_HDR_SIZE, - client->swapped); - if (extra < 0) { -- extra = 0; -+ return BadLength; - } - /* large command's header is 4 bytes longer, so add 4 */ - if (cmdlen != __GLX_PAD(entry.bytes + 4 + extra)) { -diff -Naur xorg-server-1.12.4.orig/glx/glxcmdsswap.c xorg-server-1.12.4/glx/glxcmdsswap.c ---- xorg-server-1.12.4.orig/glx/glxcmdsswap.c 2012-05-17 19:09:02.000000000 +0200 -+++ xorg-server-1.12.4/glx/glxcmdsswap.c 2014-11-28 09:52:11.210609886 +0100 -@@ -962,11 +962,13 @@ - int - __glXDispSwap_VendorPrivate(__GLXclientState * cl, GLbyte * pc) - { -+ ClientPtr client = cl->client; - xGLXVendorPrivateReq *req; - GLint vendorcode; - __GLXdispatchVendorPrivProcPtr proc; - - __GLX_DECLARE_SWAP_VARIABLES; -+ REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq); - - req = (xGLXVendorPrivateReq *) pc; - __GLX_SWAP_SHORT(&req->length); -@@ -989,11 +991,13 @@ - int - __glXDispSwap_VendorPrivateWithReply(__GLXclientState * cl, GLbyte * pc) - { -+ ClientPtr client = cl->client; - xGLXVendorPrivateWithReplyReq *req; - GLint vendorcode; - __GLXdispatchVendorPrivProcPtr proc; - - __GLX_DECLARE_SWAP_VARIABLES; -+ REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateWithReplyReq); - - req = (xGLXVendorPrivateWithReplyReq *) pc; - __GLX_SWAP_SHORT(&req->length); -diff -Naur xorg-server-1.12.4.orig/glx/glxserver.h xorg-server-1.12.4/glx/glxserver.h ---- xorg-server-1.12.4.orig/glx/glxserver.h 2012-05-17 19:09:02.000000000 +0200 -+++ xorg-server-1.12.4/glx/glxserver.h 2014-11-28 09:51:56.474445744 +0100 -@@ -218,6 +218,47 @@ - * Routines for computing the size of variably-sized rendering commands. - */ - -+static _X_INLINE int -+safe_add(int a, int b) -+{ -+ if (a < 0 || b < 0) -+ return -1; -+ -+ if (INT_MAX - a < b) -+ return -1; -+ -+ return a + b; -+} -+ -+static _X_INLINE int -+safe_mul(int a, int b) -+{ -+ if (a < 0 || b < 0) -+ return -1; -+ -+ if (a == 0 || b == 0) -+ return 0; -+ -+ if (a > INT_MAX / b) -+ return -1; -+ -+ return a * b; -+} -+ -+static _X_INLINE int -+safe_pad(int a) -+{ -+ int ret; -+ -+ if (a < 0) -+ return -1; -+ -+ if ((ret = safe_add(a, 3)) < 0) -+ return -1; -+ -+ return ret & (GLuint)~3; -+} -+ - extern int __glXTypeSize(GLenum enm); - extern int __glXImageSize(GLenum format, GLenum type, - GLenum target, GLsizei w, GLsizei h, GLsizei d, -diff -Naur xorg-server-1.12.4.orig/glx/indirect_program.c xorg-server-1.12.4/glx/indirect_program.c ---- xorg-server-1.12.4.orig/glx/indirect_program.c 2012-05-17 19:09:02.000000000 +0200 -+++ xorg-server-1.12.4/glx/indirect_program.c 2014-11-28 09:52:15.138653638 +0100 -@@ -69,6 +69,8 @@ - __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); - ClientPtr client = cl->client; - -+ REQUEST_FIXED_SIZE(xGLXVendorPrivateWithReplyReq, 8); -+ - pc += __GLX_VENDPRIV_HDR_SIZE; - if (cx != NULL) { - GLenum target; -diff -Naur xorg-server-1.12.4.orig/glx/indirect_util.c xorg-server-1.12.4/glx/indirect_util.c ---- xorg-server-1.12.4.orig/glx/indirect_util.c 2012-05-17 19:09:02.000000000 +0200 -+++ xorg-server-1.12.4/glx/indirect_util.c 2014-11-28 09:52:18.662692891 +0100 -@@ -78,12 +78,17 @@ - void *local_buffer, size_t local_size, unsigned alignment) - { - void *buffer = local_buffer; -- const unsigned mask = alignment - 1; -+ const intptr_t mask = alignment - 1; - - if (local_size < required_size) { -- const size_t worst_case_size = required_size + alignment; -+ size_t worst_case_size; - intptr_t temp_buf; - -+ if (required_size < SIZE_MAX - alignment) -+ worst_case_size = required_size + alignment; -+ else -+ return NULL; -+ - if (cl->returnBufSize < worst_case_size) { - void *temp = realloc(cl->returnBuf, worst_case_size); - -diff -Naur xorg-server-1.12.4.orig/glx/rensize.c xorg-server-1.12.4/glx/rensize.c ---- xorg-server-1.12.4.orig/glx/rensize.c 2012-05-17 19:09:02.000000000 +0200 -+++ xorg-server-1.12.4/glx/rensize.c 2014-11-28 09:52:04.398534008 +0100 -@@ -43,19 +43,11 @@ - (((a & 0xff000000U)>>24) | ((a & 0xff0000U)>>8) | \ - ((a & 0xff00U)<<8) | ((a & 0xffU)<<24)) - --static int --Map1Size(GLint k, GLint order) --{ -- if (order <= 0 || k < 0) -- return -1; -- return k * order; --} -- - int - __glXMap1dReqSize(const GLbyte * pc, Bool swap) - { - GLenum target; -- GLint order, k; -+ GLint order; - - target = *(GLenum *) (pc + 16); - order = *(GLint *) (pc + 20); -@@ -63,15 +55,16 @@ - target = SWAPL(target); - order = SWAPL(order); - } -- k = __glMap1d_size(target); -- return 8 * Map1Size(k, order); -+ if (order < 1) -+ return -1; -+ return safe_mul(8, safe_mul(__glMap1d_size(target), order)); - } - - int - __glXMap1fReqSize(const GLbyte * pc, Bool swap) - { - GLenum target; -- GLint order, k; -+ GLint order; - - target = *(GLenum *) (pc + 0); - order = *(GLint *) (pc + 12); -@@ -79,23 +72,24 @@ - target = SWAPL(target); - order = SWAPL(order); - } -- k = __glMap1f_size(target); -- return 4 * Map1Size(k, order); -+ if (order < 1) -+ return -1; -+ return safe_mul(4, safe_mul(__glMap1f_size(target), order)); - } - - static int - Map2Size(int k, int majorOrder, int minorOrder) - { -- if (majorOrder <= 0 || minorOrder <= 0 || k < 0) -+ if (majorOrder < 1 || minorOrder < 1) - return -1; -- return k * majorOrder * minorOrder; -+ return safe_mul(k, safe_mul(majorOrder, minorOrder)); - } - - int - __glXMap2dReqSize(const GLbyte * pc, Bool swap) - { - GLenum target; -- GLint uorder, vorder, k; -+ GLint uorder, vorder; - - target = *(GLenum *) (pc + 32); - uorder = *(GLint *) (pc + 36); -@@ -105,15 +99,14 @@ - uorder = SWAPL(uorder); - vorder = SWAPL(vorder); - } -- k = __glMap2d_size(target); -- return 8 * Map2Size(k, uorder, vorder); -+ return safe_mul(8, Map2Size(__glMap2d_size(target), uorder, vorder)); - } - - int - __glXMap2fReqSize(const GLbyte * pc, Bool swap) - { - GLenum target; -- GLint uorder, vorder, k; -+ GLint uorder, vorder; - - target = *(GLenum *) (pc + 0); - uorder = *(GLint *) (pc + 12); -@@ -123,8 +116,7 @@ - uorder = SWAPL(uorder); - vorder = SWAPL(vorder); - } -- k = __glMap2f_size(target); -- return 4 * Map2Size(k, uorder, vorder); -+ return safe_mul(4, Map2Size(__glMap2f_size(target), uorder, vorder)); - } - - /** -@@ -175,14 +167,16 @@ - GLint bytesPerElement, elementsPerGroup, groupsPerRow; - GLint groupSize, rowSize, padding, imageSize; - -+ if (w == 0 || h == 0 || d == 0) -+ return 0; -+ - if (w < 0 || h < 0 || d < 0 || - (type == GL_BITMAP && - (format != GL_COLOR_INDEX && format != GL_STENCIL_INDEX))) { - return -1; - } -- if (w == 0 || h == 0 || d == 0) -- return 0; - -+ /* proxy targets have no data */ - switch (target) { - case GL_PROXY_TEXTURE_1D: - case GL_PROXY_TEXTURE_2D: -@@ -199,6 +193,12 @@ - return 0; - } - -+ /* real data has to have real sizes */ -+ if (imageHeight < 0 || rowLength < 0 || skipImages < 0 || skipRows < 0) -+ return -1; -+ if (alignment != 1 && alignment != 2 && alignment != 4 && alignment != 8) -+ return -1; -+ - if (type == GL_BITMAP) { - if (rowLength > 0) { - groupsPerRow = rowLength; -@@ -207,11 +207,14 @@ - groupsPerRow = w; - } - rowSize = bits_to_bytes(groupsPerRow); -+ if (rowSize < 0) -+ return -1; - padding = (rowSize % alignment); - if (padding) { - rowSize += alignment - padding; - } -- return ((h + skipRows) * rowSize); -+ -+ return safe_mul(safe_add(h, skipRows), rowSize); - } - else { - switch (format) { -@@ -224,6 +227,11 @@ - case GL_ALPHA: - case GL_LUMINANCE: - case GL_INTENSITY: -+ case GL_RED_INTEGER_EXT: -+ case GL_GREEN_INTEGER_EXT: -+ case GL_BLUE_INTEGER_EXT: -+ case GL_ALPHA_INTEGER_EXT: -+ case GL_LUMINANCE_INTEGER_EXT: - elementsPerGroup = 1; - break; - case GL_422_EXT: -@@ -234,14 +242,19 @@ - case GL_DEPTH_STENCIL_MESA: - case GL_YCBCR_MESA: - case GL_LUMINANCE_ALPHA: -+ case GL_LUMINANCE_ALPHA_INTEGER_EXT: - elementsPerGroup = 2; - break; - case GL_RGB: - case GL_BGR: -+ case GL_RGB_INTEGER_EXT: -+ case GL_BGR_INTEGER_EXT: - elementsPerGroup = 3; - break; - case GL_RGBA: - case GL_BGRA: -+ case GL_RGBA_INTEGER_EXT: -+ case GL_BGRA_INTEGER_EXT: - case GL_ABGR_EXT: - elementsPerGroup = 4; - break; -@@ -293,6 +306,7 @@ - default: - return -1; - } -+ /* known safe by the switches above, not checked */ - groupSize = bytesPerElement * elementsPerGroup; - if (rowLength > 0) { - groupsPerRow = rowLength; -@@ -300,18 +314,21 @@ - else { - groupsPerRow = w; - } -- rowSize = groupsPerRow * groupSize; -+ -+ if ((rowSize = safe_mul(groupsPerRow, groupSize)) < 0) -+ return -1; - padding = (rowSize % alignment); - if (padding) { - rowSize += alignment - padding; - } -- if (imageHeight > 0) { -- imageSize = (imageHeight + skipRows) * rowSize; -- } -- else { -- imageSize = (h + skipRows) * rowSize; -- } -- return ((d + skipImages) * imageSize); -+ -+ if (imageHeight > 0) -+ h = imageHeight; -+ h = safe_add(h, skipRows); -+ -+ imageSize = safe_mul(h, rowSize); -+ -+ return safe_mul(safe_add(d, skipImages), imageSize); - } - } - -@@ -435,9 +452,7 @@ - /* XXX Should rowLength be used for either or both image? */ - image1size = __glXImageSize(format, type, 0, w, 1, 1, - 0, rowLength, 0, 0, alignment); -- image1size = __GLX_PAD(image1size); - image2size = __glXImageSize(format, type, 0, h, 1, 1, - 0, rowLength, 0, 0, alignment); -- return image1size + image2size; -- -+ return safe_add(safe_pad(image1size), image2size); - } -diff -Naur xorg-server-1.12.4.orig/glx/singlepix.c xorg-server-1.12.4/glx/singlepix.c ---- xorg-server-1.12.4.orig/glx/singlepix.c 2012-05-17 19:09:02.000000000 +0200 -+++ xorg-server-1.12.4/glx/singlepix.c 2014-11-28 09:51:46.254331903 +0100 -@@ -69,7 +69,7 @@ - lsbFirst = *(GLboolean *) (pc + 25); - compsize = __glReadPixels_size(format, type, width, height); - if (compsize < 0) -- compsize = 0; -+ return BadLength; - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes)); - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_LSB_FIRST, lsbFirst)); -@@ -134,7 +134,7 @@ - compsize = - __glGetTexImage_size(target, level, format, type, width, height, depth); - if (compsize < 0) -- compsize = 0; -+ return BadLength; - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes)); - __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); -@@ -232,9 +232,9 @@ - compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1); - - if (compsize < 0) -- compsize = 0; -+ return BadLength; - if (compsize2 < 0) -- compsize2 = 0; -+ return BadLength; - compsize = __GLX_PAD(compsize); - compsize2 = __GLX_PAD(compsize2); - -@@ -315,7 +315,7 @@ - */ - compsize = __glGetTexImage_size(target, 1, format, type, width, height, 1); - if (compsize < 0) -- compsize = 0; -+ return BadLength; - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes)); - __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); -@@ -386,7 +386,7 @@ - */ - compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); - if (compsize < 0) -- compsize = 0; -+ return BadLength; - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes)); - __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); -@@ -447,7 +447,7 @@ - - compsize = __glGetTexImage_size(target, 1, format, type, 2, 1, 1); - if (compsize < 0) -- compsize = 0; -+ return BadLength; - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes)); - __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); -@@ -513,7 +513,7 @@ - */ - compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); - if (compsize < 0) -- compsize = 0; -+ return BadLength; - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes)); - __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); -diff -Naur xorg-server-1.12.4.orig/glx/singlepixswap.c xorg-server-1.12.4/glx/singlepixswap.c ---- xorg-server-1.12.4.orig/glx/singlepixswap.c 2012-05-17 19:09:02.000000000 +0200 -+++ xorg-server-1.12.4/glx/singlepixswap.c 2014-11-28 09:51:46.254331903 +0100 -@@ -79,7 +79,7 @@ - lsbFirst = *(GLboolean *) (pc + 25); - compsize = __glReadPixels_size(format, type, width, height); - if (compsize < 0) -- compsize = 0; -+ return BadLength; - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes)); - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_LSB_FIRST, lsbFirst)); -@@ -155,7 +155,7 @@ - compsize = - __glGetTexImage_size(target, level, format, type, width, height, depth); - if (compsize < 0) -- compsize = 0; -+ return BadLength; - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes)); - __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); -@@ -267,9 +267,9 @@ - compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1); - - if (compsize < 0) -- compsize = 0; -+ return BadLength; - if (compsize2 < 0) -- compsize2 = 0; -+ return BadLength; - compsize = __GLX_PAD(compsize); - compsize2 = __GLX_PAD(compsize2); - -@@ -358,7 +358,7 @@ - */ - compsize = __glGetTexImage_size(target, 1, format, type, width, height, 1); - if (compsize < 0) -- compsize = 0; -+ return BadLength; - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes)); - __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); -@@ -437,7 +437,7 @@ - */ - compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); - if (compsize < 0) -- compsize = 0; -+ return BadLength; - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes)); - __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); -@@ -505,7 +505,7 @@ - - compsize = __glGetTexImage_size(target, 1, format, type, 2, 1, 1); - if (compsize < 0) -- compsize = 0; -+ return BadLength; - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes)); - __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); -@@ -577,7 +577,7 @@ - */ - compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); - if (compsize < 0) -- compsize = 0; -+ return BadLength; - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes)); - __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); -diff -Naur xorg-server-1.12.4.orig/glx/swap_interval.c xorg-server-1.12.4/glx/swap_interval.c ---- xorg-server-1.12.4.orig/glx/swap_interval.c 2012-05-17 19:09:02.000000000 +0200 -+++ xorg-server-1.12.4/glx/swap_interval.c 2014-11-28 09:52:15.138653638 +0100 -@@ -50,6 +50,8 @@ - __GLXcontext *cx; - GLint interval; - -+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 4); -+ - cx = __glXLookupContextByTag(cl, tag); - - if ((cx == NULL) || (cx->pGlxScreen == NULL)) { -diff -Naur xorg-server-1.12.4.orig/glx/unpack.h xorg-server-1.12.4/glx/unpack.h ---- xorg-server-1.12.4.orig/glx/unpack.h 2012-05-17 19:09:02.000000000 +0200 -+++ xorg-server-1.12.4/glx/unpack.h 2014-11-28 09:51:49.594369108 +0100 -@@ -83,7 +83,8 @@ - ** pointer. - */ - #define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \ -- if ((size) > sizeof(answerBuffer)) { \ -+ if (size < 0) return BadLength; \ -+ else if ((size) > sizeof(answerBuffer)) { \ - int bump; \ - if ((cl)->returnBufSize < (size)+(align)) { \ - (cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \ -diff -Naur xorg-server-1.12.4.orig/hw/xfree86/dri2/dri2ext.c xorg-server-1.12.4/hw/xfree86/dri2/dri2ext.c ---- xorg-server-1.12.4.orig/hw/xfree86/dri2/dri2ext.c 2012-05-17 19:09:03.000000000 +0200 -+++ xorg-server-1.12.4/hw/xfree86/dri2/dri2ext.c 2014-11-28 09:50:54.413754423 +0100 -@@ -263,6 +263,9 @@ - unsigned int *attachments; - - REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * 4); -+ if (stuff->count > (INT_MAX / 4)) -+ return BadLength; -+ - if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, - &pDrawable, &status)) - return status; -diff -Naur xorg-server-1.12.4.orig/include/dix.h xorg-server-1.12.4/include/dix.h ---- xorg-server-1.12.4.orig/include/dix.h 2012-05-17 19:09:04.000000000 +0200 -+++ xorg-server-1.12.4/include/dix.h 2014-11-28 09:50:49.805703089 +0100 -@@ -74,7 +74,8 @@ - - #define REQUEST_FIXED_SIZE(req, n)\ - if (((sizeof(req) >> 2) > client->req_len) || \ -- (((sizeof(req) + (n) + 3) >> 2) != client->req_len)) \ -+ ((n >> 2) >= client->req_len) || \ -+ ((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len)) \ - return(BadLength) - - #define LEGAL_NEW_RESOURCE(id,client)\ -diff -Naur xorg-server-1.12.4.orig/include/regionstr.h xorg-server-1.12.4/include/regionstr.h ---- xorg-server-1.12.4.orig/include/regionstr.h 2012-05-17 19:09:04.000000000 +0200 -+++ xorg-server-1.12.4/include/regionstr.h 2014-11-28 09:50:45.169651442 +0100 -@@ -127,7 +127,10 @@ - static inline size_t - RegionSizeof(int n) - { -- return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))); -+ if (n < ((INT_MAX - sizeof(RegDataRec)) / sizeof(BoxRec))) -+ return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))); -+ else -+ return 0; - } - - static inline void -@@ -138,9 +141,10 @@ - (_pReg)->data = (RegDataPtr) NULL; - } - else { -+ size_t rgnSize; - (_pReg)->extents = RegionEmptyBox; -- if (((_size) > 1) && ((_pReg)->data = -- (RegDataPtr) malloc(RegionSizeof(_size)))) { -+ if (((_size) > 1) && ((rgnSize = RegionSizeof(_size)) > 0) && -+ (((_pReg)->data = malloc(rgnSize)) != NULL)) { - (_pReg)->data->size = (_size); - (_pReg)->data->numRects = 0; - } -diff -Naur xorg-server-1.12.4.orig/os/access.c xorg-server-1.12.4/os/access.c ---- xorg-server-1.12.4.orig/os/access.c 2012-05-17 19:09:04.000000000 +0200 -+++ xorg-server-1.12.4/os/access.c 2014-11-28 09:50:41.409609554 +0100 -@@ -1331,6 +1331,10 @@ - for (host = validhosts; host; host = host->next) { - nHosts++; - n += pad_to_int32(host->len) + sizeof(xHostEntry); -+ /* Could check for INT_MAX, but in reality having more than 1mb of -+ hostnames in the access list is ridiculous */ -+ if (n >= 1048576) -+ break; - } - if (n) { - *data = ptr = malloc(n); -@@ -1339,6 +1343,8 @@ - } - for (host = validhosts; host; host = host->next) { - len = host->len; -+ if ((ptr + sizeof(xHostEntry) + len) > (data + n)) -+ break; - ((xHostEntry *) ptr)->family = host->family; - ((xHostEntry *) ptr)->length = len; - ptr += sizeof(xHostEntry); -diff -Naur xorg-server-1.12.4.orig/os/rpcauth.c xorg-server-1.12.4/os/rpcauth.c ---- xorg-server-1.12.4.orig/os/rpcauth.c 2012-05-17 19:09:04.000000000 +0200 -+++ xorg-server-1.12.4/os/rpcauth.c 2014-11-28 09:50:32.861514326 +0100 -@@ -66,6 +66,10 @@ - SVCXPRT xprt; - - temp_inmsg = malloc(len); -+ if (temp_inmsg == NULL) { -+ why = AUTH_FAILED; /* generic error, since there is no AUTH_BADALLOC */ -+ return NULL; -+ } - memmove(temp_inmsg, inmsg, len); - - memset((char *) &msg, 0, sizeof(msg)); -diff -Naur xorg-server-1.12.4.orig/randr/rrsdispatch.c xorg-server-1.12.4/randr/rrsdispatch.c ---- xorg-server-1.12.4.orig/randr/rrsdispatch.c 2012-05-17 19:09:05.000000000 +0200 -+++ xorg-server-1.12.4/randr/rrsdispatch.c 2014-11-28 09:51:10.885937921 +0100 -@@ -27,6 +27,7 @@ - { - REQUEST(xRRQueryVersionReq); - -+ REQUEST_SIZE_MATCH(xRRQueryVersionReq); - swaps(&stuff->length); - swapl(&stuff->majorVersion); - swapl(&stuff->minorVersion); -@@ -38,6 +39,7 @@ - { - REQUEST(xRRGetScreenInfoReq); - -+ REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); - swaps(&stuff->length); - swapl(&stuff->window); - return (*ProcRandrVector[stuff->randrReqType]) (client); -@@ -69,6 +71,7 @@ - { - REQUEST(xRRSelectInputReq); - -+ REQUEST_SIZE_MATCH(xRRSelectInputReq); - swaps(&stuff->length); - swapl(&stuff->window); - swaps(&stuff->enable); -@@ -152,6 +155,7 @@ - { - REQUEST(xRRConfigureOutputPropertyReq); - -+ REQUEST_AT_LEAST_SIZE(xRRConfigureOutputPropertyReq); - swaps(&stuff->length); - swapl(&stuff->output); - swapl(&stuff->property); -diff -Naur xorg-server-1.12.4.orig/render/render.c xorg-server-1.12.4/render/render.c ---- xorg-server-1.12.4.orig/render/render.c 2012-08-02 02:59:23.000000000 +0200 -+++ xorg-server-1.12.4/render/render.c 2014-11-28 09:51:16.878004670 +0100 -@@ -1994,7 +1994,7 @@ - SProcRenderQueryVersion(ClientPtr client) - { - REQUEST(xRenderQueryVersionReq); -- -+ REQUEST_SIZE_MATCH(xRenderQueryVersionReq); - swaps(&stuff->length); - swapl(&stuff->majorVersion); - swapl(&stuff->minorVersion); -@@ -2005,6 +2005,7 @@ - SProcRenderQueryPictFormats(ClientPtr client) - { - REQUEST(xRenderQueryPictFormatsReq); -+ REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq); - swaps(&stuff->length); - return (*ProcRenderVector[stuff->renderReqType]) (client); - } -@@ -2013,6 +2014,7 @@ - SProcRenderQueryPictIndexValues(ClientPtr client) - { - REQUEST(xRenderQueryPictIndexValuesReq); -+ REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq); - swaps(&stuff->length); - swapl(&stuff->format); - return (*ProcRenderVector[stuff->renderReqType]) (client); -@@ -2028,6 +2030,7 @@ - SProcRenderCreatePicture(ClientPtr client) - { - REQUEST(xRenderCreatePictureReq); -+ REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - swaps(&stuff->length); - swapl(&stuff->pid); - swapl(&stuff->drawable); -@@ -2041,6 +2044,7 @@ - SProcRenderChangePicture(ClientPtr client) - { - REQUEST(xRenderChangePictureReq); -+ REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); - swaps(&stuff->length); - swapl(&stuff->picture); - swapl(&stuff->mask); -@@ -2052,6 +2056,7 @@ - SProcRenderSetPictureClipRectangles(ClientPtr client) - { - REQUEST(xRenderSetPictureClipRectanglesReq); -+ REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - swaps(&stuff->length); - swapl(&stuff->picture); - swaps(&stuff->xOrigin); -@@ -2064,6 +2069,7 @@ - SProcRenderFreePicture(ClientPtr client) - { - REQUEST(xRenderFreePictureReq); -+ REQUEST_SIZE_MATCH(xRenderFreePictureReq); - swaps(&stuff->length); - swapl(&stuff->picture); - return (*ProcRenderVector[stuff->renderReqType]) (client); -@@ -2073,6 +2079,7 @@ - SProcRenderComposite(ClientPtr client) - { - REQUEST(xRenderCompositeReq); -+ REQUEST_SIZE_MATCH(xRenderCompositeReq); - swaps(&stuff->length); - swapl(&stuff->src); - swapl(&stuff->mask); -@@ -2092,6 +2099,7 @@ - SProcRenderScale(ClientPtr client) - { - REQUEST(xRenderScaleReq); -+ REQUEST_SIZE_MATCH(xRenderScaleReq); - swaps(&stuff->length); - swapl(&stuff->src); - swapl(&stuff->dst); -@@ -2192,6 +2200,7 @@ - SProcRenderCreateGlyphSet(ClientPtr client) - { - REQUEST(xRenderCreateGlyphSetReq); -+ REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq); - swaps(&stuff->length); - swapl(&stuff->gsid); - swapl(&stuff->format); -@@ -2202,6 +2211,7 @@ - SProcRenderReferenceGlyphSet(ClientPtr client) - { - REQUEST(xRenderReferenceGlyphSetReq); -+ REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq); - swaps(&stuff->length); - swapl(&stuff->gsid); - swapl(&stuff->existing); -@@ -2212,6 +2222,7 @@ - SProcRenderFreeGlyphSet(ClientPtr client) - { - REQUEST(xRenderFreeGlyphSetReq); -+ REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); - swaps(&stuff->length); - swapl(&stuff->glyphset); - return (*ProcRenderVector[stuff->renderReqType]) (client); -@@ -2226,6 +2237,7 @@ - xGlyphInfo *gi; - - REQUEST(xRenderAddGlyphsReq); -+ REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq); - swaps(&stuff->length); - swapl(&stuff->glyphset); - swapl(&stuff->nglyphs); -@@ -2260,6 +2272,7 @@ - SProcRenderFreeGlyphs(ClientPtr client) - { - REQUEST(xRenderFreeGlyphsReq); -+ REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); - swaps(&stuff->length); - swapl(&stuff->glyphset); - SwapRestL(stuff); -@@ -2277,6 +2290,7 @@ - int size; - - REQUEST(xRenderCompositeGlyphsReq); -+ REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - - switch (stuff->renderReqType) { - default: -diff -Naur xorg-server-1.12.4.orig/test/misc.c xorg-server-1.12.4/test/misc.c ---- xorg-server-1.12.4.orig/test/misc.c 2012-05-17 19:09:05.000000000 +0200 -+++ xorg-server-1.12.4/test/misc.c 2014-11-28 09:51:33.354188205 +0100 -@@ -28,6 +28,8 @@ - #include <stdint.h> - #include "misc.h" - #include "scrnintstr.h" -+#include "dix.h" -+#include "dixstruct.h" - - ScreenInfo screenInfo; - -@@ -155,11 +157,46 @@ - assert_dimensions(-w2, -h2, w2, h2); - } - -+static int -+dix_request_fixed_size_overflow(ClientRec *client) -+{ -+ xReq req = { 0 }; -+ -+ client->req_len = req.length = 1; -+ REQUEST_FIXED_SIZE(req, SIZE_MAX); -+ return Success; -+} -+ -+static int -+dix_request_fixed_size_match(ClientRec *client) -+{ -+ xReq req = { 0 }; -+ -+ client->req_len = req.length = 9; -+ REQUEST_FIXED_SIZE(req, 30); -+ return Success; -+} -+ -+static void -+dix_request_size_checks(void) -+{ -+ ClientRec client = { 0 }; -+ int rc; -+ -+ rc = dix_request_fixed_size_overflow(&client); -+ assert(rc == BadLength); -+ -+ rc = dix_request_fixed_size_match(&client); -+ assert(rc == Success); -+} -+ -+ - int - main(int argc, char **argv) - { - dix_version_compare(); - dix_update_desktop_dimensions(); -+ dix_request_size_checks(); - - return 0; - } -diff -Naur xorg-server-1.12.4.orig/test/xi2/protocol-xigetclientpointer.c xorg-server-1.12.4/test/xi2/protocol-xigetclientpointer.c ---- xorg-server-1.12.4.orig/test/xi2/protocol-xigetclientpointer.c 2012-05-17 19:09:05.000000000 +0200 -+++ xorg-server-1.12.4/test/xi2/protocol-xigetclientpointer.c 2014-11-28 09:51:28.970139371 +0100 -@@ -124,6 +124,11 @@ - request.win = INVALID_WINDOW_ID; - request_XIGetClientPointer(&client_request, &request, BadWindow); - -+ printf("Testing invalid length\n"); -+ client_request.req_len -= 4; -+ request_XIGetClientPointer(&client_request, &request, BadLength); -+ client_request.req_len += 4; -+ - test_data.cp_is_set = FALSE; - - printf("Testing window None, unset ClientPointer.\n"); -diff -Naur xorg-server-1.12.4.orig/test/xi2/protocol-xipassivegrabdevice.c xorg-server-1.12.4/test/xi2/protocol-xipassivegrabdevice.c ---- xorg-server-1.12.4.orig/test/xi2/protocol-xipassivegrabdevice.c 2012-05-17 19:09:05.000000000 +0200 -+++ xorg-server-1.12.4/test/xi2/protocol-xipassivegrabdevice.c 2014-11-28 09:51:28.970139371 +0100 -@@ -137,6 +137,7 @@ - int rc; - int modifiers; - -+ client_request.req_len = req->length; - rc = ProcXIPassiveGrabDevice(&client_request); - assert(rc == error); - -@@ -187,6 +188,13 @@ - request_XIPassiveGrabDevice(&client_request, request, BadDevice, - request->deviceid); - -+ printf("Testing invalid length\n"); -+ request->length -= 2; -+ request_XIPassiveGrabDevice(&client_request, request, BadLength, -+ client_request.errorValue); -+ /* re-init request since swapped length test leaves some values swapped */ -+ request_init(request, XIPassiveGrabDevice); -+ request->grab_window = CLIENT_WINDOW_ID; - request->deviceid = XIAllMasterDevices; - - printf("Testing invalid grab types\n"); -diff -Naur xorg-server-1.12.4.orig/test/xi2/protocol-xiquerypointer.c xorg-server-1.12.4/test/xi2/protocol-xiquerypointer.c ---- xorg-server-1.12.4.orig/test/xi2/protocol-xiquerypointer.c 2012-05-17 19:09:05.000000000 +0200 -+++ xorg-server-1.12.4/test/xi2/protocol-xiquerypointer.c 2014-11-28 09:51:28.970139371 +0100 -@@ -200,6 +200,10 @@ - test_data.dev = devices.mouse; - request.deviceid = devices.mouse->id; - request_XIQueryPointer(&client_request, &request, Success); -+ -+ /* test REQUEST_SIZE_MATCH */ -+ client_request.req_len -= 4; -+ request_XIQueryPointer(&client_request, &request, BadLength); - } - - int -diff -Naur xorg-server-1.12.4.orig/test/xi2/protocol-xiwarppointer.c xorg-server-1.12.4/test/xi2/protocol-xiwarppointer.c ---- xorg-server-1.12.4.orig/test/xi2/protocol-xiwarppointer.c 2012-05-17 19:09:05.000000000 +0200 -+++ xorg-server-1.12.4/test/xi2/protocol-xiwarppointer.c 2014-11-28 09:51:28.974139415 +0100 -@@ -197,6 +197,9 @@ - request_XIWarpPointer(&client_request, &request, Success); - - /* FIXME: src_x/y checks */ -+ -+ client_request.req_len -= 2; /* invalid length */ -+ request_XIWarpPointer(&client_request, &request, BadLength); - } - - int -diff -Naur xorg-server-1.12.4.orig/Xext/xcmisc.c xorg-server-1.12.4/Xext/xcmisc.c ---- xorg-server-1.12.4.orig/Xext/xcmisc.c 2012-05-17 19:09:01.000000000 +0200 -+++ xorg-server-1.12.4/Xext/xcmisc.c 2014-11-28 09:51:03.837859407 +0100 -@@ -161,6 +161,7 @@ - SProcXCMiscGetXIDList(ClientPtr client) - { - REQUEST(xXCMiscGetXIDListReq); -+ REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq); - - swaps(&stuff->length); - swapl(&stuff->count); -diff -Naur xorg-server-1.12.4.orig/Xext/xvdisp.c xorg-server-1.12.4/Xext/xvdisp.c ---- xorg-server-1.12.4.orig/Xext/xvdisp.c 2012-05-17 19:09:01.000000000 +0200 -+++ xorg-server-1.12.4/Xext/xvdisp.c 2014-11-28 09:51:07.413899243 +0100 -@@ -1202,6 +1202,7 @@ - SProcXvQueryExtension(ClientPtr client) - { - REQUEST(xvQueryExtensionReq); -+ REQUEST_SIZE_MATCH(xvQueryExtensionReq); - swaps(&stuff->length); - return XvProcVector[xv_QueryExtension] (client); - } -@@ -1210,6 +1211,7 @@ - SProcXvQueryAdaptors(ClientPtr client) - { - REQUEST(xvQueryAdaptorsReq); -+ REQUEST_SIZE_MATCH(xvQueryAdaptorsReq); - swaps(&stuff->length); - swapl(&stuff->window); - return XvProcVector[xv_QueryAdaptors] (client); -@@ -1219,6 +1221,7 @@ - SProcXvQueryEncodings(ClientPtr client) - { - REQUEST(xvQueryEncodingsReq); -+ REQUEST_SIZE_MATCH(xvQueryEncodingsReq); - swaps(&stuff->length); - swapl(&stuff->port); - return XvProcVector[xv_QueryEncodings] (client); -@@ -1228,6 +1231,7 @@ - SProcXvGrabPort(ClientPtr client) - { - REQUEST(xvGrabPortReq); -+ REQUEST_SIZE_MATCH(xvGrabPortReq); - swaps(&stuff->length); - swapl(&stuff->port); - swapl(&stuff->time); -@@ -1238,6 +1242,7 @@ - SProcXvUngrabPort(ClientPtr client) - { - REQUEST(xvUngrabPortReq); -+ REQUEST_SIZE_MATCH(xvUngrabPortReq); - swaps(&stuff->length); - swapl(&stuff->port); - swapl(&stuff->time); -@@ -1248,6 +1253,7 @@ - SProcXvPutVideo(ClientPtr client) - { - REQUEST(xvPutVideoReq); -+ REQUEST_SIZE_MATCH(xvPutVideoReq); - swaps(&stuff->length); - swapl(&stuff->port); - swapl(&stuff->drawable); -@@ -1267,6 +1273,7 @@ - SProcXvPutStill(ClientPtr client) - { - REQUEST(xvPutStillReq); -+ REQUEST_SIZE_MATCH(xvPutStillReq); - swaps(&stuff->length); - swapl(&stuff->port); - swapl(&stuff->drawable); -@@ -1286,6 +1293,7 @@ - SProcXvGetVideo(ClientPtr client) - { - REQUEST(xvGetVideoReq); -+ REQUEST_SIZE_MATCH(xvGetVideoReq); - swaps(&stuff->length); - swapl(&stuff->port); - swapl(&stuff->drawable); -@@ -1305,6 +1313,7 @@ - SProcXvGetStill(ClientPtr client) - { - REQUEST(xvGetStillReq); -+ REQUEST_SIZE_MATCH(xvGetStillReq); - swaps(&stuff->length); - swapl(&stuff->port); - swapl(&stuff->drawable); -@@ -1324,6 +1333,7 @@ - SProcXvPutImage(ClientPtr client) - { - REQUEST(xvPutImageReq); -+ REQUEST_AT_LEAST_SIZE(xvPutImageReq); - swaps(&stuff->length); - swapl(&stuff->port); - swapl(&stuff->drawable); -@@ -1347,6 +1357,7 @@ - SProcXvShmPutImage(ClientPtr client) - { - REQUEST(xvShmPutImageReq); -+ REQUEST_SIZE_MATCH(xvShmPutImageReq); - swaps(&stuff->length); - swapl(&stuff->port); - swapl(&stuff->drawable); -@@ -1374,6 +1385,7 @@ - SProcXvSelectVideoNotify(ClientPtr client) - { - REQUEST(xvSelectVideoNotifyReq); -+ REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq); - swaps(&stuff->length); - swapl(&stuff->drawable); - return XvProcVector[xv_SelectVideoNotify] (client); -@@ -1383,6 +1395,7 @@ - SProcXvSelectPortNotify(ClientPtr client) - { - REQUEST(xvSelectPortNotifyReq); -+ REQUEST_SIZE_MATCH(xvSelectPortNotifyReq); - swaps(&stuff->length); - swapl(&stuff->port); - return XvProcVector[xv_SelectPortNotify] (client); -@@ -1392,6 +1405,7 @@ - SProcXvStopVideo(ClientPtr client) - { - REQUEST(xvStopVideoReq); -+ REQUEST_SIZE_MATCH(xvStopVideoReq); - swaps(&stuff->length); - swapl(&stuff->port); - swapl(&stuff->drawable); -@@ -1402,6 +1416,7 @@ - SProcXvSetPortAttribute(ClientPtr client) - { - REQUEST(xvSetPortAttributeReq); -+ REQUEST_SIZE_MATCH(xvSetPortAttributeReq); - swaps(&stuff->length); - swapl(&stuff->port); - swapl(&stuff->attribute); -@@ -1413,6 +1428,7 @@ - SProcXvGetPortAttribute(ClientPtr client) - { - REQUEST(xvGetPortAttributeReq); -+ REQUEST_SIZE_MATCH(xvGetPortAttributeReq); - swaps(&stuff->length); - swapl(&stuff->port); - swapl(&stuff->attribute); -@@ -1423,6 +1439,7 @@ - SProcXvQueryBestSize(ClientPtr client) - { - REQUEST(xvQueryBestSizeReq); -+ REQUEST_SIZE_MATCH(xvQueryBestSizeReq); - swaps(&stuff->length); - swapl(&stuff->port); - swaps(&stuff->vid_w); -@@ -1436,6 +1453,7 @@ - SProcXvQueryPortAttributes(ClientPtr client) - { - REQUEST(xvQueryPortAttributesReq); -+ REQUEST_SIZE_MATCH(xvQueryPortAttributesReq); - swaps(&stuff->length); - swapl(&stuff->port); - return XvProcVector[xv_QueryPortAttributes] (client); -@@ -1445,6 +1463,7 @@ - SProcXvQueryImageAttributes(ClientPtr client) - { - REQUEST(xvQueryImageAttributesReq); -+ REQUEST_SIZE_MATCH(xvQueryImageAttributesReq); - swaps(&stuff->length); - swapl(&stuff->port); - swapl(&stuff->id); -@@ -1457,6 +1476,7 @@ - SProcXvListImageFormats(ClientPtr client) - { - REQUEST(xvListImageFormatsReq); -+ REQUEST_SIZE_MATCH(xvListImageFormatsReq); - swaps(&stuff->length); - swapl(&stuff->port); - return XvProcVector[xv_ListImageFormats] (client); -diff -Naur xorg-server-1.12.4.orig/xfixes/select.c xorg-server-1.12.4/xfixes/select.c ---- xorg-server-1.12.4.orig/xfixes/select.c 2012-05-17 19:09:05.000000000 +0200 -+++ xorg-server-1.12.4/xfixes/select.c 2014-11-28 09:51:22.470066963 +0100 -@@ -204,6 +204,7 @@ - { - REQUEST(xXFixesSelectSelectionInputReq); - -+ REQUEST_SIZE_MATCH(xXFixesSelectSelectionInputReq); - swaps(&stuff->length); - swapl(&stuff->window); - swapl(&stuff->selection); -diff -aur xorg-server-1.12.4.orig/render/render.c xorg-server-1.12.4/render/render.c ---- xorg-server-1.12.4.orig/render/render.c 2014-11-28 09:51:16.878004670 +0100 -+++ xorg-server-1.12.4/render/render.c 2014-11-28 10:00:10.899950898 +0100 -@@ -271,10 +271,11 @@ - - REQUEST(xRenderQueryVersionReq); - -+ REQUEST_SIZE_MATCH(xRenderQueryVersionReq); -+ - pRenderClient->major_version = stuff->majorVersion; - pRenderClient->minor_version = stuff->minorVersion; - -- REQUEST_SIZE_MATCH(xRenderQueryVersionReq); - memset(&rep, 0, sizeof(xRenderQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; -diff -Naur xorg-server-1.12.4.orig/glx/glxcmds.c xorg-server-1.12.4/glx/glxcmds.c ---- xorg-server-1.12.4.orig/glx/glxcmds.c 2014-11-28 10:01:44.068987817 +0100 -+++ xorg-server-1.12.4/glx/glxcmds.c 2014-11-28 10:05:07.515246883 +0100 -@@ -2032,6 +2032,8 @@ - - __GLX_DECLARE_SWAP_VARIABLES; - -+ REQUEST_AT_LEAST_SIZE(xGLXRenderLargeReq); -+ - req = (xGLXRenderLargeReq *) pc; - if (client->swapped) { - __GLX_SWAP_SHORT(&req->length); -@@ -2047,12 +2049,14 @@ - __glXResetLargeCommandStatus(cl); - return error; - } -+ if (safe_pad(req->dataBytes) < 0) -+ return BadLength; - dataBytes = req->dataBytes; - - /* - ** Check the request length. - */ -- if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) { -+ if ((req->length << 2) != safe_pad(dataBytes) + sz_xGLXRenderLargeReq) { - client->errorValue = req->length; - /* Reset in case this isn't 1st request. */ - __glXResetLargeCommandStatus(cl); -@@ -2062,7 +2066,7 @@ - - if (cl->largeCmdRequestsSoFar == 0) { - __GLXrenderSizeData entry; -- int extra; -+ int extra = 0; - size_t cmdlen; - int err; - -@@ -2075,13 +2079,17 @@ - return __glXError(GLXBadLargeRequest); - } - -+ if (dataBytes < __GLX_RENDER_LARGE_HDR_SIZE) -+ return BadLength; -+ - hdr = (__GLXrenderLargeHeader *) pc; - if (client->swapped) { - __GLX_SWAP_INT(&hdr->length); - __GLX_SWAP_INT(&hdr->opcode); - } -- cmdlen = hdr->length; - opcode = hdr->opcode; -+ if ((cmdlen = safe_pad(hdr->length)) < 0) -+ return BadLength; - - /* - ** Check for core opcodes and grab entry data. -@@ -2103,17 +2111,13 @@ - if (extra < 0) { - return BadLength; - } -- /* large command's header is 4 bytes longer, so add 4 */ -- if (cmdlen != __GLX_PAD(entry.bytes + 4 + extra)) { -- return BadLength; -- } - } -- else { -- /* constant size command */ -- if (cmdlen != __GLX_PAD(entry.bytes + 4)) { -- return BadLength; -- } -+ -+ /* the +4 is safe because we know entry.bytes is small */ -+ if (cmdlen != safe_pad(safe_add(entry.bytes + 4, extra))) { -+ return BadLength; - } -+ - /* - ** Make enough space in the buffer, then copy the entire request. - */ -@@ -2143,6 +2147,7 @@ - ** We are receiving subsequent (i.e. not the first) requests of a - ** multi request command. - */ -+ int bytesSoFar; /* including this packet */ - - /* - ** Check the request number and the total request count. -@@ -2161,11 +2166,18 @@ - /* - ** Check that we didn't get too much data. - */ -- if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) { -+ if ((bytesSoFar = safe_add(cl->largeCmdBytesSoFar, dataBytes)) < 0) { - client->errorValue = dataBytes; - __glXResetLargeCommandStatus(cl); - return __glXError(GLXBadLargeRequest); - } -+ -+ if (bytesSoFar > cl->largeCmdBytesTotal) { -+ client->errorValue = dataBytes; -+ __glXResetLargeCommandStatus(cl); -+ return __glXError(GLXBadLargeRequest); -+ } -+ - memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes); - cl->largeCmdBytesSoFar += dataBytes; - cl->largeCmdRequestsSoFar++; -@@ -2186,8 +2198,7 @@ - ** the padding done below fixes a bug that did not allow - ** large commands of odd sizes to be accepted by the server. - */ -- if (__GLX_PAD(cl->largeCmdBytesSoFar) != -- __GLX_PAD(cl->largeCmdBytesTotal)) { -+ if (safe_pad(cl->largeCmdBytesSoFar) != cl->largeCmdBytesTotal) { - client->errorValue = dataBytes; - __glXResetLargeCommandStatus(cl); - return __glXError(GLXBadLargeRequest); -diff -Naur xorg-server-1.12.4.orig/glx/indirect_texture_compression.c xorg-server-1.12.4/glx/indirect_texture_compression.c ---- xorg-server-1.12.4.orig/glx/indirect_texture_compression.c 2012-05-17 19:09:02.000000000 +0200 -+++ xorg-server-1.12.4/glx/indirect_texture_compression.c 2014-11-28 10:26:39.461548117 +0100 -@@ -47,6 +47,8 @@ - __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); - ClientPtr client = cl->client; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 8); -+ - pc += __GLX_SINGLE_HDR_SIZE; - if (cx != NULL) { - const GLenum target = *(GLenum *) (pc + 0); -@@ -93,6 +95,8 @@ - __glXForceCurrent(cl, bswap_32(req->contextTag), &error); - ClientPtr client = cl->client; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 8); -+ - pc += __GLX_SINGLE_HDR_SIZE; - if (cx != NULL) { - const GLenum target = (GLenum) bswap_32(*(int *) (pc + 0)); -diff -Naur xorg-server-1.12.4.orig/glx/single2.c xorg-server-1.12.4/glx/single2.c ---- xorg-server-1.12.4.orig/glx/single2.c 2012-05-17 19:09:02.000000000 +0200 -+++ xorg-server-1.12.4/glx/single2.c 2014-11-28 10:26:39.461548117 +0100 -@@ -49,11 +49,14 @@ - int - __glXDisp_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc) - { -+ ClientPtr client = cl->client; - GLsizei size; - GLenum type; - __GLXcontext *cx; - int error; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 8); -+ - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { - return error; -@@ -80,10 +83,13 @@ - int - __glXDisp_SelectBuffer(__GLXclientState * cl, GLbyte * pc) - { -+ ClientPtr client = cl->client; - __GLXcontext *cx; - GLsizei size; - int error; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4); -+ - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { - return error; -@@ -108,7 +114,7 @@ - int - __glXDisp_RenderMode(__GLXclientState * cl, GLbyte * pc) - { -- ClientPtr client; -+ ClientPtr client = cl->client; - xGLXRenderModeReply reply; - __GLXcontext *cx; - GLint nitems = 0, retBytes = 0, retval, newModeCheck; -@@ -116,6 +122,8 @@ - GLenum newMode; - int error; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4); -+ - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { - return error; -@@ -192,7 +200,6 @@ - ** selection array, as per the API for glRenderMode itself. - */ - noChangeAllowed:; -- client = cl->client; - reply.length = nitems; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; -@@ -209,9 +216,12 @@ - int - __glXDisp_Flush(__GLXclientState * cl, GLbyte * pc) - { -+ ClientPtr client = cl->client; - __GLXcontext *cx; - int error; - -+ REQUEST_SIZE_MATCH(xGLXSingleReq); -+ - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { - return error; -@@ -225,10 +235,12 @@ - int - __glXDisp_Finish(__GLXclientState * cl, GLbyte * pc) - { -+ ClientPtr client = cl->client; - __GLXcontext *cx; -- ClientPtr client; - int error; - -+ REQUEST_SIZE_MATCH(xGLXSingleReq); -+ - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { - return error; -@@ -319,7 +331,7 @@ - int - DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap) - { -- ClientPtr client; -+ ClientPtr client = cl->client; - __GLXcontext *cx; - GLenum name; - const char *string; -@@ -329,6 +341,8 @@ - char *buf = NULL, *buf1 = NULL; - GLint length = 0; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4); -+ - /* If the client has the opposite byte order, swap the contextTag and - * the name. - */ -@@ -345,7 +359,6 @@ - pc += __GLX_SINGLE_HDR_SIZE; - name = *(GLenum *) (pc + 0); - string = (const char *) CALL_GetString(GET_DISPATCH(), (name)); -- client = cl->client; - - if (string == NULL) - string = ""; -diff -Naur xorg-server-1.12.4.orig/glx/single2swap.c xorg-server-1.12.4/glx/single2swap.c ---- xorg-server-1.12.4.orig/glx/single2swap.c 2012-05-17 19:09:02.000000000 +0200 -+++ xorg-server-1.12.4/glx/single2swap.c 2014-11-28 10:26:39.465548161 +0100 -@@ -45,6 +45,7 @@ - int - __glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc) - { -+ ClientPtr client = cl->client; - GLsizei size; - GLenum type; - -@@ -52,6 +53,8 @@ - __GLXcontext *cx; - int error; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 8); -+ - __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { -@@ -81,12 +84,15 @@ - int - __glXDispSwap_SelectBuffer(__GLXclientState * cl, GLbyte * pc) - { -+ ClientPtr client = cl->client; - __GLXcontext *cx; - GLsizei size; - - __GLX_DECLARE_SWAP_VARIABLES; - int error; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4); -+ - __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { -@@ -113,7 +119,7 @@ - int - __glXDispSwap_RenderMode(__GLXclientState * cl, GLbyte * pc) - { -- ClientPtr client; -+ ClientPtr client = cl->client; - __GLXcontext *cx; - xGLXRenderModeReply reply; - GLint nitems = 0, retBytes = 0, retval, newModeCheck; -@@ -124,6 +130,8 @@ - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - int error; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4); -+ - __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { -@@ -204,7 +212,6 @@ - ** selection array, as per the API for glRenderMode itself. - */ - noChangeAllowed:; -- client = cl->client; - reply.length = nitems; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; -@@ -226,11 +233,14 @@ - int - __glXDispSwap_Flush(__GLXclientState * cl, GLbyte * pc) - { -+ ClientPtr client = cl->client; - __GLXcontext *cx; - int error; - - __GLX_DECLARE_SWAP_VARIABLES; - -+ REQUEST_SIZE_MATCH(xGLXSingleReq); -+ - __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { -@@ -245,12 +255,14 @@ - int - __glXDispSwap_Finish(__GLXclientState * cl, GLbyte * pc) - { -+ ClientPtr client = cl->client; - __GLXcontext *cx; -- ClientPtr client; - int error; - - __GLX_DECLARE_SWAP_VARIABLES; - -+ REQUEST_SIZE_MATCH(xGLXSingleReq); -+ - __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { -@@ -262,7 +274,6 @@ - cx->hasUnflushedCommands = GL_FALSE; - - /* Send empty reply packet to indicate finish is finished */ -- client = cl->client; - __GLX_BEGIN_REPLY(0); - __GLX_PUT_RETVAL(0); - __GLX_SWAP_REPLY_HEADER(); -diff -Naur xorg-server-1.12.4.orig/glx/singlepix.c xorg-server-1.12.4/glx/singlepix.c ---- xorg-server-1.12.4.orig/glx/singlepix.c 2014-11-28 10:06:28.116140360 +0100 -+++ xorg-server-1.12.4/glx/singlepix.c 2014-11-28 10:26:39.465548161 +0100 -@@ -55,6 +55,8 @@ - int error; - char *answer, answerBuffer[200]; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 28); -+ - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { - return error; -@@ -107,6 +109,8 @@ - char *answer, answerBuffer[200]; - GLint width = 0, height = 0, depth = 1; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 20); -+ - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { - return error; -@@ -169,6 +173,8 @@ - GLubyte answerBuffer[200]; - char *answer; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4); -+ - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { - return error; -@@ -231,15 +237,15 @@ - compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); - compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1); - -- if (compsize < 0) -+ if ((compsize = safe_pad(compsize)) < 0) - return BadLength; -- if (compsize2 < 0) -+ -+ if ((compsize2 = safe_pad(compsize2)) < 0) - return BadLength; -- compsize = __GLX_PAD(compsize); -- compsize2 = __GLX_PAD(compsize2); - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes)); -- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize + compsize2, 1); -+ __GLX_GET_ANSWER_BUFFER(answer, cl, safe_add(compsize, compsize2), 1); -+ - __glXClearErrorOccured(); - CALL_GetSeparableFilter(GET_DISPATCH(), (*(GLenum *) (pc + 0), - *(GLenum *) (pc + 4), -@@ -265,7 +271,8 @@ - __glXDisp_GetSeparableFilter(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); -- -+ ClientPtr client = cl->client; -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16); - return GetSeparableFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); - } - -@@ -273,7 +280,8 @@ - __glXDisp_GetSeparableFilterEXT(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); -- -+ ClientPtr client = cl->client; -+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); - return GetSeparableFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); - } - -@@ -343,7 +351,8 @@ - __glXDisp_GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); -- -+ ClientPtr client = cl->client; -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16); - return GetConvolutionFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); - } - -@@ -351,7 +360,8 @@ - __glXDisp_GetConvolutionFilterEXT(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); -- -+ ClientPtr client = cl->client; -+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); - return GetConvolutionFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); - } - -@@ -411,7 +421,8 @@ - __glXDisp_GetHistogram(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); -- -+ ClientPtr client = cl->client; -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16); - return GetHistogram(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); - } - -@@ -419,7 +430,8 @@ - __glXDisp_GetHistogramEXT(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); -- -+ ClientPtr client = cl->client; -+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); - return GetHistogram(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); - } - -@@ -471,7 +483,8 @@ - __glXDisp_GetMinmax(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); -- -+ ClientPtr client = cl->client; -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16); - return GetMinmax(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); - } - -@@ -479,7 +492,8 @@ - __glXDisp_GetMinmaxEXT(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); -- -+ ClientPtr client = cl->client; -+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); - return GetMinmax(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); - } - -@@ -540,7 +554,8 @@ - __glXDisp_GetColorTable(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); -- -+ ClientPtr client = cl->client; -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16); - return GetColorTable(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); - } - -@@ -548,6 +563,7 @@ - __glXDisp_GetColorTableSGI(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); -- -+ ClientPtr client = cl->client; -+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); - return GetColorTable(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); - } -diff -Naur xorg-server-1.12.4.orig/glx/singlepixswap.c xorg-server-1.12.4/glx/singlepixswap.c ---- xorg-server-1.12.4.orig/glx/singlepixswap.c 2014-11-28 10:06:28.116140360 +0100 -+++ xorg-server-1.12.4/glx/singlepixswap.c 2014-11-28 10:26:39.465548161 +0100 -@@ -57,6 +57,8 @@ - int error; - char *answer, answerBuffer[200]; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 28); -+ - __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { -@@ -122,6 +124,8 @@ - char *answer, answerBuffer[200]; - GLint width = 0, height = 0, depth = 1; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 20); -+ - __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { -@@ -197,6 +201,8 @@ - - __GLX_DECLARE_SWAP_VARIABLES; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 4); -+ - __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag); - cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); - if (!cx) { -@@ -266,15 +272,13 @@ - compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); - compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1); - -- if (compsize < 0) -+ if ((compsize = safe_pad(compsize)) < 0) - return BadLength; -- if (compsize2 < 0) -+ if ((compsize2 = safe_pad(compsize2)) < 0) - return BadLength; -- compsize = __GLX_PAD(compsize); -- compsize2 = __GLX_PAD(compsize2); - - CALL_PixelStorei(GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes)); -- __GLX_GET_ANSWER_BUFFER(answer, cl, compsize + compsize2, 1); -+ __GLX_GET_ANSWER_BUFFER(answer, cl, safe_add(compsize, compsize2), 1); - __glXClearErrorOccured(); - CALL_GetSeparableFilter(GET_DISPATCH(), (*(GLenum *) (pc + 0), - *(GLenum *) (pc + 4), -@@ -302,7 +306,9 @@ - __glXDispSwap_GetSeparableFilter(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); -+ ClientPtr client = cl->client; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16); - return GetSeparableFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); - } - -@@ -310,7 +316,9 @@ - __glXDispSwap_GetSeparableFilterEXT(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); -+ ClientPtr client = cl->client; - -+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); - return GetSeparableFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); - } - -@@ -388,7 +396,9 @@ - __glXDispSwap_GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); -+ ClientPtr client = cl->client; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16); - return GetConvolutionFilter(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); - } - -@@ -396,7 +406,9 @@ - __glXDispSwap_GetConvolutionFilterEXT(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); -+ ClientPtr client = cl->client; - -+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); - return GetConvolutionFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); - } - -@@ -463,7 +475,9 @@ - __glXDispSwap_GetHistogram(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); -+ ClientPtr client = cl->client; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16); - return GetHistogram(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); - } - -@@ -471,7 +485,9 @@ - __glXDispSwap_GetHistogramEXT(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); -+ ClientPtr client = cl->client; - -+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); - return GetHistogram(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); - } - -@@ -529,7 +545,9 @@ - __glXDispSwap_GetMinmax(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); -+ ClientPtr client = cl->client; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16); - return GetMinmax(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); - } - -@@ -537,7 +555,9 @@ - __glXDispSwap_GetMinmaxEXT(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); -+ ClientPtr client = cl->client; - -+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); - return GetMinmax(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); - } - -@@ -605,7 +625,9 @@ - __glXDispSwap_GetColorTable(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc); -+ ClientPtr client = cl->client; - -+ REQUEST_FIXED_SIZE(xGLXSingleReq, 16); - return GetColorTable(cl, pc + __GLX_SINGLE_HDR_SIZE, tag); - } - -@@ -613,6 +635,8 @@ - __glXDispSwap_GetColorTableSGI(__GLXclientState * cl, GLbyte * pc) - { - const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc); -+ ClientPtr client = cl->client; - -+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16); - return GetColorTable(cl, pc + __GLX_VENDPRIV_HDR_SIZE, tag); - } -diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c -index ff5d69a..e87df42 100644 ---- a/Xi/chgdctl.c -+++ b/Xi/chgdctl.c -@@ -78,7 +78,7 @@ SProcXChangeDeviceControl(ClientPtr client) - - REQUEST(xChangeDeviceControlReq); - swaps(&stuff->length); -- REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq); -+ REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl)); - swaps(&stuff->control); - ctl = (xDeviceCtl *) &stuff[1]; - swaps(&ctl->control); -@@ -116,7 +116,7 @@ ProcXChangeDeviceControl(ClientPtr client) - devicePresenceNotify dpn; - - REQUEST(xChangeDeviceControlReq); -- REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq); -+ REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl)); - - len = stuff->length - bytes_to_int32(sizeof(xChangeDeviceControlReq)); - ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); -@@ -184,6 +184,10 @@ ProcXChangeDeviceControl(ClientPtr client) - break; - case DEVICE_ENABLE: - e = (xDeviceEnableCtl *) &stuff[1]; -+ if ((len != bytes_to_int32(sizeof(xDeviceEnableCtl)))) { -+ ret = BadLength; -+ goto out; -+ } - - status = ChangeDeviceControl(client, dev, (xDeviceCtl *) e); - -diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c -index 6dcf60c..224c2ba 100644 ---- a/Xi/chgfctl.c -+++ b/Xi/chgfctl.c -@@ -467,6 +467,8 @@ ProcXChangeFeedbackControl(ClientPtr client) - xStringFeedbackCtl *f = ((xStringFeedbackCtl *) &stuff[1]); - - if (client->swapped) { -+ if (len < bytes_to_int32(sizeof(xStringFeedbackCtl))) -+ return BadLength; - swaps(&f->num_keysyms); - } - if (len != -diff --git a/Xi/sendexev.c b/Xi/sendexev.c -index 3c21386..183f88d 100644 ---- a/Xi/sendexev.c -+++ b/Xi/sendexev.c -@@ -135,6 +135,9 @@ ProcXSendExtensionEvent(ClientPtr client) - if (ret != Success) - return ret; - -+ if (stuff->num_events == 0) -+ return ret; -+ - /* The client's event type must be one defined by an extension. */ - - first = ((xEvent *) &stuff[1]); -diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c -index 62a0727..156c738 100644 ---- a/Xi/xiallowev.c -+++ b/Xi/xiallowev.c -@@ -48,6 +48,7 @@ int - SProcXIAllowEvents(ClientPtr client) - { - REQUEST(xXIAllowEventsReq); -+ REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq); - - swaps(&stuff->length); - swaps(&stuff->deviceid); -@@ -55,6 +56,7 @@ SProcXIAllowEvents(ClientPtr client) - if (stuff->length > 3) { - xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff; - -+ REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq); - swapl(&req_xi22->touchid); - swapl(&req_xi22->grab_window); - } -diff --git a/Xi/xichangecursor.c b/Xi/xichangecursor.c -index 0be6bc0..33e9e9c 100644 ---- a/Xi/xichangecursor.c -+++ b/Xi/xichangecursor.c -@@ -57,11 +57,11 @@ int - SProcXIChangeCursor(ClientPtr client) - { - REQUEST(xXIChangeCursorReq); -+ REQUEST_SIZE_MATCH(xXIChangeCursorReq); - swaps(&stuff->length); - swapl(&stuff->win); - swapl(&stuff->cursor); - swaps(&stuff->deviceid); -- REQUEST_SIZE_MATCH(xXIChangeCursorReq); - return (ProcXIChangeCursor(client)); - } - -diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c -index 756aaac..d2244cf 100644 ---- a/Xi/xichangehierarchy.c -+++ b/Xi/xichangehierarchy.c -@@ -407,7 +407,7 @@ int - ProcXIChangeHierarchy(ClientPtr client) - { - xXIAnyHierarchyChangeInfo *any; -- int required_len = sizeof(xXIChangeHierarchyReq); -+ size_t len; /* length of data remaining in request */ - int rc = Success; - int flags[MAXDEVICES] = { 0 }; - -@@ -417,21 +417,46 @@ ProcXIChangeHierarchy(ClientPtr client) - if (!stuff->num_changes) - return rc; - -+ if (stuff->length > (INT_MAX >> 2)) -+ return BadAlloc; -+ len = (stuff->length << 2) - sizeof(xXIAnyHierarchyChangeInfo); -+ - any = (xXIAnyHierarchyChangeInfo *) &stuff[1]; - while (stuff->num_changes--) { -+ if (len < sizeof(xXIAnyHierarchyChangeInfo)) { -+ rc = BadLength; -+ goto unwind; -+ } -+ - SWAPIF(swaps(&any->type)); - SWAPIF(swaps(&any->length)); - -- required_len += any->length; -- if ((stuff->length * 4) < required_len) -+ if ((any->length > (INT_MAX >> 2)) || (len < (any->length << 2))) - return BadLength; - -+#define CHANGE_SIZE_MATCH(type) \ -+ do { \ -+ if ((len < sizeof(type)) || (any->length != (sizeof(type) >> 2))) { \ -+ rc = BadLength; \ -+ goto unwind; \ -+ } \ -+ } while(0) -+ - switch (any->type) { - case XIAddMaster: - { - xXIAddMasterInfo *c = (xXIAddMasterInfo *) any; - -+ /* Variable length, due to appended name string */ -+ if (len < sizeof(xXIAddMasterInfo)) { -+ rc = BadLength; -+ goto unwind; -+ } - SWAPIF(swaps(&c->name_len)); -+ if (c->name_len > (len - sizeof(xXIAddMasterInfo))) { -+ rc = BadLength; -+ goto unwind; -+ } - - rc = add_master(client, c, flags); - if (rc != Success) -@@ -442,6 +467,7 @@ ProcXIChangeHierarchy(ClientPtr client) - { - xXIRemoveMasterInfo *r = (xXIRemoveMasterInfo *) any; - -+ CHANGE_SIZE_MATCH(xXIRemoveMasterInfo); - rc = remove_master(client, r, flags); - if (rc != Success) - goto unwind; -@@ -451,6 +477,7 @@ ProcXIChangeHierarchy(ClientPtr client) - { - xXIDetachSlaveInfo *c = (xXIDetachSlaveInfo *) any; - -+ CHANGE_SIZE_MATCH(xXIDetachSlaveInfo); - rc = detach_slave(client, c, flags); - if (rc != Success) - goto unwind; -@@ -460,6 +487,7 @@ ProcXIChangeHierarchy(ClientPtr client) - { - xXIAttachSlaveInfo *c = (xXIAttachSlaveInfo *) any; - -+ CHANGE_SIZE_MATCH(xXIAttachSlaveInfo); - rc = attach_slave(client, c, flags); - if (rc != Success) - goto unwind; -@@ -467,6 +495,7 @@ ProcXIChangeHierarchy(ClientPtr client) - break; - } - -+ len -= any->length * 4; - any = (xXIAnyHierarchyChangeInfo *) ((char *) any + any->length * 4); - } - -diff --git a/Xi/xigetclientpointer.c b/Xi/xigetclientpointer.c -index 07dbf18..a066497 100644 ---- a/Xi/xigetclientpointer.c -+++ b/Xi/xigetclientpointer.c -@@ -50,6 +50,7 @@ int - SProcXIGetClientPointer(ClientPtr client) - { - REQUEST(xXIGetClientPointerReq); -+ REQUEST_SIZE_MATCH(xXIGetClientPointerReq); - - swaps(&stuff->length); - swapl(&stuff->win); -diff --git a/Xi/xigrabdev.c b/Xi/xigrabdev.c -index 8d2cf0b..3dafbbd 100644 ---- a/Xi/xigrabdev.c -+++ b/Xi/xigrabdev.c -@@ -47,6 +47,11 @@ int - SProcXIGrabDevice(ClientPtr client) - { - REQUEST(xXIGrabDeviceReq); -+ /* -+ * Check here for at least the length of the struct we swap, then -+ * let ProcXIGrabDevice check the full size after we swap mask_len. -+ */ -+ REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq); - - swaps(&stuff->length); - swaps(&stuff->deviceid); -@@ -69,7 +74,7 @@ ProcXIGrabDevice(ClientPtr client) - int mask_len; - - REQUEST(xXIGrabDeviceReq); -- REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq); -+ REQUEST_FIXED_SIZE(xXIGrabDeviceReq, ((size_t) stuff->mask_len) * 4); - - ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); - if (ret != Success) -@@ -118,6 +123,7 @@ int - SProcXIUngrabDevice(ClientPtr client) - { - REQUEST(xXIUngrabDeviceReq); -+ REQUEST_SIZE_MATCH(xXIUngrabDeviceReq); - - swaps(&stuff->length); - swaps(&stuff->deviceid); -@@ -135,6 +141,7 @@ ProcXIUngrabDevice(ClientPtr client) - TimeStamp time; - - REQUEST(xXIUngrabDeviceReq); -+ REQUEST_SIZE_MATCH(xXIUngrabDeviceReq); - - ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); - if (ret != Success) -diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c -index 7130328..06f44d7 100644 ---- a/Xi/xipassivegrab.c -+++ b/Xi/xipassivegrab.c -@@ -53,6 +53,7 @@ SProcXIPassiveGrabDevice(ClientPtr client) - xXIModifierInfo *mods; - - REQUEST(xXIPassiveGrabDeviceReq); -+ REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq); - - swaps(&stuff->length); - swaps(&stuff->deviceid); -@@ -63,7 +64,9 @@ SProcXIPassiveGrabDevice(ClientPtr client) - swaps(&stuff->mask_len); - swaps(&stuff->num_modifiers); - -- mods = (xXIModifierInfo *) &stuff[1]; -+ REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq, -+ ((uint32_t) stuff->mask_len + stuff->num_modifiers) *4); -+ mods = (uint32_t *) &stuff[1] + stuff->mask_len; - - for (i = 0; i < stuff->num_modifiers; i++, mods++) { - swapl(&mods->base_mods); -@@ -88,7 +91,8 @@ ProcXIPassiveGrabDevice(ClientPtr client) - int mask_len; - - REQUEST(xXIPassiveGrabDeviceReq); -- REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq); -+ REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq, -+ ((uint32_t) stuff->mask_len + stuff->num_modifiers) * 4); - - if (stuff->deviceid == XIAllDevices) - dev = inputInfo.all_devices; -@@ -250,6 +254,7 @@ SProcXIPassiveUngrabDevice(ClientPtr client) - uint32_t *modifiers; - - REQUEST(xXIPassiveUngrabDeviceReq); -+ REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq); - - swaps(&stuff->length); - swapl(&stuff->grab_window); -@@ -257,6 +262,8 @@ SProcXIPassiveUngrabDevice(ClientPtr client) - swapl(&stuff->detail); - swaps(&stuff->num_modifiers); - -+ REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq, -+ ((uint32_t) stuff->num_modifiers) << 2); - modifiers = (uint32_t *) &stuff[1]; - - for (i = 0; i < stuff->num_modifiers; i++, modifiers++) -@@ -275,7 +282,8 @@ ProcXIPassiveUngrabDevice(ClientPtr client) - int i, rc; - - REQUEST(xXIPassiveUngrabDeviceReq); -- REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq); -+ REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq, -+ ((uint32_t) stuff->num_modifiers) << 2); - - if (stuff->deviceid == XIAllDevices) - dev = inputInfo.all_devices; -diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c -index e51aadb..37dc0c6 100644 ---- a/Xi/xiproperty.c -+++ b/Xi/xiproperty.c -@@ -1007,10 +1007,9 @@ int - SProcXListDeviceProperties(ClientPtr client) - { - REQUEST(xListDevicePropertiesReq); -+ REQUEST_SIZE_MATCH(xListDevicePropertiesReq); - - swaps(&stuff->length); -- -- REQUEST_SIZE_MATCH(xListDevicePropertiesReq); - return (ProcXListDeviceProperties(client)); - } - -@@ -1031,10 +1030,10 @@ int - SProcXDeleteDeviceProperty(ClientPtr client) - { - REQUEST(xDeleteDevicePropertyReq); -+ REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq); - - swaps(&stuff->length); - swapl(&stuff->property); -- REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq); - return (ProcXDeleteDeviceProperty(client)); - } - -@@ -1042,13 +1041,13 @@ int - SProcXGetDeviceProperty(ClientPtr client) - { - REQUEST(xGetDevicePropertyReq); -+ REQUEST_SIZE_MATCH(xGetDevicePropertyReq); - - swaps(&stuff->length); - swapl(&stuff->property); - swapl(&stuff->type); - swapl(&stuff->longOffset); - swapl(&stuff->longLength); -- REQUEST_SIZE_MATCH(xGetDevicePropertyReq); - return (ProcXGetDeviceProperty(client)); - } - -@@ -1243,11 +1242,10 @@ int - SProcXIListProperties(ClientPtr client) - { - REQUEST(xXIListPropertiesReq); -+ REQUEST_SIZE_MATCH(xXIListPropertiesReq); - - swaps(&stuff->length); - swaps(&stuff->deviceid); -- -- REQUEST_SIZE_MATCH(xXIListPropertiesReq); - return (ProcXIListProperties(client)); - } - -@@ -1269,11 +1267,11 @@ int - SProcXIDeleteProperty(ClientPtr client) - { - REQUEST(xXIDeletePropertyReq); -+ REQUEST_SIZE_MATCH(xXIDeletePropertyReq); - - swaps(&stuff->length); - swaps(&stuff->deviceid); - swapl(&stuff->property); -- REQUEST_SIZE_MATCH(xXIDeletePropertyReq); - return (ProcXIDeleteProperty(client)); - } - -@@ -1281,6 +1279,7 @@ int - SProcXIGetProperty(ClientPtr client) - { - REQUEST(xXIGetPropertyReq); -+ REQUEST_SIZE_MATCH(xXIGetPropertyReq); - - swaps(&stuff->length); - swaps(&stuff->deviceid); -@@ -1288,7 +1287,6 @@ SProcXIGetProperty(ClientPtr client) - swapl(&stuff->type); - swapl(&stuff->offset); - swapl(&stuff->len); -- REQUEST_SIZE_MATCH(xXIGetPropertyReq); - return (ProcXIGetProperty(client)); - } - -diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c -index 15c8b2a..5e5c875 100644 ---- a/Xi/xiquerydevice.c -+++ b/Xi/xiquerydevice.c -@@ -54,6 +54,7 @@ int - SProcXIQueryDevice(ClientPtr client) - { - REQUEST(xXIQueryDeviceReq); -+ REQUEST_SIZE_MATCH(xXIQueryDeviceReq); - - swaps(&stuff->length); - swaps(&stuff->deviceid); -diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c -index 169436e..e61fa04 100644 ---- a/Xi/xiquerypointer.c -+++ b/Xi/xiquerypointer.c -@@ -62,6 +62,8 @@ int - SProcXIQueryPointer(ClientPtr client) - { - REQUEST(xXIQueryPointerReq); -+ REQUEST_SIZE_MATCH(xXIQueryPointerReq); -+ - swaps(&stuff->length); - swaps(&stuff->deviceid); - swapl(&stuff->win); -diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c -index 07d3218..fc02034 100644 ---- a/Xi/xiselectev.c -+++ b/Xi/xiselectev.c -@@ -63,6 +63,7 @@ int - SProcXISelectEvents(ClientPtr client) - { - int i; -+ int len; - xXIEventMask *evmask; - - REQUEST(xXISelectEventsReq); -@@ -71,10 +72,17 @@ SProcXISelectEvents(ClientPtr client) - swapl(&stuff->win); - swaps(&stuff->num_masks); - -+ len = stuff->length - bytes_to_int32(sizeof(xXISelectEventsReq)); - evmask = (xXIEventMask *) &stuff[1]; - for (i = 0; i < stuff->num_masks; i++) { -+ if (len < bytes_to_int32(sizeof(xXIEventMask))) -+ return BadLength; -+ len -= bytes_to_int32(sizeof(xXIEventMask)); - swaps(&evmask->deviceid); - swaps(&evmask->mask_len); -+ if (len < evmask->mask_len) -+ return BadLength; -+ len -= evmask->mask_len; - evmask = - (xXIEventMask *) (((char *) &evmask[1]) + evmask->mask_len * 4); - } -diff --git a/Xi/xisetclientpointer.c b/Xi/xisetclientpointer.c -index 38ff51e..24d4a53 100644 ---- a/Xi/xisetclientpointer.c -+++ b/Xi/xisetclientpointer.c -@@ -51,10 +51,11 @@ int - SProcXISetClientPointer(ClientPtr client) - { - REQUEST(xXISetClientPointerReq); -+ REQUEST_SIZE_MATCH(xXISetClientPointerReq); -+ - swaps(&stuff->length); - swapl(&stuff->win); - swaps(&stuff->deviceid); -- REQUEST_SIZE_MATCH(xXISetClientPointerReq); - return (ProcXISetClientPointer(client)); - } - -diff --git a/Xi/xisetdevfocus.c b/Xi/xisetdevfocus.c -index b52c9cc..a32ccb1 100644 ---- a/Xi/xisetdevfocus.c -+++ b/Xi/xisetdevfocus.c -@@ -44,6 +44,8 @@ int - SProcXISetFocus(ClientPtr client) - { - REQUEST(xXISetFocusReq); -+ REQUEST_AT_LEAST_SIZE(xXISetFocusReq); -+ - swaps(&stuff->length); - swaps(&stuff->deviceid); - swapl(&stuff->focus); -@@ -56,6 +58,8 @@ int - SProcXIGetFocus(ClientPtr client) - { - REQUEST(xXIGetFocusReq); -+ REQUEST_AT_LEAST_SIZE(xXIGetFocusReq); -+ - swaps(&stuff->length); - swaps(&stuff->deviceid); - -diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c -index 3f051f7..780758a 100644 ---- a/Xi/xiwarppointer.c -+++ b/Xi/xiwarppointer.c -@@ -56,6 +56,8 @@ int - SProcXIWarpPointer(ClientPtr client) - { - REQUEST(xXIWarpPointerReq); -+ REQUEST_SIZE_MATCH(xXIWarpPointerReq); -+ - swaps(&stuff->length); - swapl(&stuff->src_win); - swapl(&stuff->dst_win); -diff --git a/glx/glxcmds.c b/glx/glxcmds.c -index badc2cf..1479634 100644 ---- a/glx/glxcmds.c -+++ b/glx/glxcmds.c -@@ -1990,7 +1990,8 @@ __glXDisp_Render(__GLXclientState * cl, GLbyte * pc) - if (entry.varsize) { - /* variable size command */ - extra = (*entry.varsize) (pc + __GLX_RENDER_HDR_SIZE, -- client->swapped); -+ client->swapped, -+ left - __GLX_RENDER_HDR_SIZE); - if (extra < 0) { - return BadLength; - } -@@ -2067,6 +2068,7 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) - if (cl->largeCmdRequestsSoFar == 0) { - __GLXrenderSizeData entry; - int extra = 0; -+ int left = (req->length << 2) - sz_xGLXRenderLargeReq; - size_t cmdlen; - int err; - -@@ -2107,7 +2109,8 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) - ** will be in the 1st request, so it's okay to do this. - */ - extra = (*entry.varsize) (pc + __GLX_RENDER_LARGE_HDR_SIZE, -- client->swapped); -+ client->swapped, -+ left - __GLX_RENDER_LARGE_HDR_SIZE); - if (extra < 0) { - return BadLength; - } -diff --git a/glx/glxserver.h b/glx/glxserver.h -index 9bffcd8..ccb895e 100644 ---- a/glx/glxserver.h -+++ b/glx/glxserver.h -@@ -167,7 +167,7 @@ typedef int (*__GLXprocPtr) (__GLXclientState *, char *pc); - /* - * Tables for computing the size of each rendering command. - */ --typedef int (*gl_proto_size_func) (const GLbyte *, Bool); -+typedef int (*gl_proto_size_func) (const GLbyte *, Bool, int); - - typedef struct { - int bytes; -diff --git a/glx/indirect_reqsize.c b/glx/indirect_reqsize.c -index 86ea970..ce58214 100644 ---- a/glx/indirect_reqsize.c -+++ b/glx/indirect_reqsize.c -@@ -31,24 +31,22 @@ - #include "indirect_size.h" - #include "indirect_reqsize.h" - --#define __GLX_PAD(x) (((x) + 3) & ~3) -- - #if defined(__CYGWIN__) || defined(__MINGW32__) - #undef HAVE_ALIAS - #endif - #ifdef HAVE_ALIAS - #define ALIAS2(from,to) \ -- GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \ -+ GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap, int reqlen ) \ - __attribute__ ((alias( # to ))); - #define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize ) - #else - #define ALIAS(from,to) \ -- GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \ -- { return __glX ## to ## ReqSize( pc, swap ); } -+ GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap, int reqlen ) \ -+ { return __glX ## to ## ReqSize( pc, swap, reqlen ); } - #endif - - int --__glXCallListsReqSize(const GLbyte * pc, Bool swap) -+__glXCallListsReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei n = *(GLsizei *) (pc + 0); - GLenum type = *(GLenum *) (pc + 4); -@@ -60,11 +58,11 @@ __glXCallListsReqSize(const GLbyte * pc, Bool swap) - } - - compsize = __glCallLists_size(type); -- return __GLX_PAD((compsize * n)); -+ return safe_pad(safe_mul(compsize, n)); - } - - int --__glXBitmapReqSize(const GLbyte * pc, Bool swap) -+__glXBitmapReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -@@ -88,7 +86,7 @@ __glXBitmapReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXFogfvReqSize(const GLbyte * pc, Bool swap) -+__glXFogfvReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum pname = *(GLenum *) (pc + 0); - GLsizei compsize; -@@ -98,11 +96,11 @@ __glXFogfvReqSize(const GLbyte * pc, Bool swap) - } - - compsize = __glFogfv_size(pname); -- return __GLX_PAD((compsize * 4)); -+ return safe_pad(safe_mul(compsize, 4)); - } - - int --__glXLightfvReqSize(const GLbyte * pc, Bool swap) -+__glXLightfvReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; -@@ -112,11 +110,11 @@ __glXLightfvReqSize(const GLbyte * pc, Bool swap) - } - - compsize = __glLightfv_size(pname); -- return __GLX_PAD((compsize * 4)); -+ return safe_pad(safe_mul(compsize, 4)); - } - - int --__glXLightModelfvReqSize(const GLbyte * pc, Bool swap) -+__glXLightModelfvReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum pname = *(GLenum *) (pc + 0); - GLsizei compsize; -@@ -126,11 +124,11 @@ __glXLightModelfvReqSize(const GLbyte * pc, Bool swap) - } - - compsize = __glLightModelfv_size(pname); -- return __GLX_PAD((compsize * 4)); -+ return safe_pad(safe_mul(compsize, 4)); - } - - int --__glXMaterialfvReqSize(const GLbyte * pc, Bool swap) -+__glXMaterialfvReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; -@@ -140,11 +138,11 @@ __glXMaterialfvReqSize(const GLbyte * pc, Bool swap) - } - - compsize = __glMaterialfv_size(pname); -- return __GLX_PAD((compsize * 4)); -+ return safe_pad(safe_mul(compsize, 4)); - } - - int --__glXPolygonStippleReqSize(const GLbyte * pc, Bool swap) -+__glXPolygonStippleReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -@@ -164,7 +162,7 @@ __glXPolygonStippleReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXTexParameterfvReqSize(const GLbyte * pc, Bool swap) -+__glXTexParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; -@@ -174,11 +172,11 @@ __glXTexParameterfvReqSize(const GLbyte * pc, Bool swap) - } - - compsize = __glTexParameterfv_size(pname); -- return __GLX_PAD((compsize * 4)); -+ return safe_pad(safe_mul(compsize, 4)); - } - - int --__glXTexImage1DReqSize(const GLbyte * pc, Bool swap) -+__glXTexImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -@@ -206,7 +204,7 @@ __glXTexImage1DReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXTexImage2DReqSize(const GLbyte * pc, Bool swap) -+__glXTexImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -@@ -236,7 +234,7 @@ __glXTexImage2DReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXTexEnvfvReqSize(const GLbyte * pc, Bool swap) -+__glXTexEnvfvReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; -@@ -246,11 +244,11 @@ __glXTexEnvfvReqSize(const GLbyte * pc, Bool swap) - } - - compsize = __glTexEnvfv_size(pname); -- return __GLX_PAD((compsize * 4)); -+ return safe_pad(safe_mul(compsize, 4)); - } - - int --__glXTexGendvReqSize(const GLbyte * pc, Bool swap) -+__glXTexGendvReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; -@@ -260,11 +258,11 @@ __glXTexGendvReqSize(const GLbyte * pc, Bool swap) - } - - compsize = __glTexGendv_size(pname); -- return __GLX_PAD((compsize * 8)); -+ return safe_pad(safe_mul(compsize, 8)); - } - - int --__glXTexGenfvReqSize(const GLbyte * pc, Bool swap) -+__glXTexGenfvReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; -@@ -274,11 +272,11 @@ __glXTexGenfvReqSize(const GLbyte * pc, Bool swap) - } - - compsize = __glTexGenfv_size(pname); -- return __GLX_PAD((compsize * 4)); -+ return safe_pad(safe_mul(compsize, 4)); - } - - int --__glXPixelMapfvReqSize(const GLbyte * pc, Bool swap) -+__glXPixelMapfvReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei mapsize = *(GLsizei *) (pc + 4); - -@@ -286,11 +284,11 @@ __glXPixelMapfvReqSize(const GLbyte * pc, Bool swap) - mapsize = bswap_32(mapsize); - } - -- return __GLX_PAD((mapsize * 4)); -+ return safe_pad(safe_mul(mapsize, 4)); - } - - int --__glXPixelMapusvReqSize(const GLbyte * pc, Bool swap) -+__glXPixelMapusvReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei mapsize = *(GLsizei *) (pc + 4); - -@@ -298,11 +296,11 @@ __glXPixelMapusvReqSize(const GLbyte * pc, Bool swap) - mapsize = bswap_32(mapsize); - } - -- return __GLX_PAD((mapsize * 2)); -+ return safe_pad(safe_mul(mapsize, 2)); - } - - int --__glXDrawPixelsReqSize(const GLbyte * pc, Bool swap) -+__glXDrawPixelsReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -@@ -330,7 +328,7 @@ __glXDrawPixelsReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXPrioritizeTexturesReqSize(const GLbyte * pc, Bool swap) -+__glXPrioritizeTexturesReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei n = *(GLsizei *) (pc + 0); - -@@ -338,11 +336,11 @@ __glXPrioritizeTexturesReqSize(const GLbyte * pc, Bool swap) - n = bswap_32(n); - } - -- return __GLX_PAD((n * 4) + (n * 4)); -+ return safe_pad(safe_add(safe_mul(n, 4), safe_mul(n, 4))); - } - - int --__glXTexSubImage1DReqSize(const GLbyte * pc, Bool swap) -+__glXTexSubImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -@@ -370,7 +368,7 @@ __glXTexSubImage1DReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXTexSubImage2DReqSize(const GLbyte * pc, Bool swap) -+__glXTexSubImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -@@ -400,7 +398,7 @@ __glXTexSubImage2DReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXColorTableReqSize(const GLbyte * pc, Bool swap) -+__glXColorTableReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -@@ -428,7 +426,7 @@ __glXColorTableReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXColorTableParameterfvReqSize(const GLbyte * pc, Bool swap) -+__glXColorTableParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; -@@ -438,11 +436,11 @@ __glXColorTableParameterfvReqSize(const GLbyte * pc, Bool swap) - } - - compsize = __glColorTableParameterfv_size(pname); -- return __GLX_PAD((compsize * 4)); -+ return safe_pad(safe_mul(compsize, 4)); - } - - int --__glXColorSubTableReqSize(const GLbyte * pc, Bool swap) -+__glXColorSubTableReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -@@ -470,7 +468,7 @@ __glXColorSubTableReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXConvolutionFilter1DReqSize(const GLbyte * pc, Bool swap) -+__glXConvolutionFilter1DReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -@@ -498,7 +496,7 @@ __glXConvolutionFilter1DReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXConvolutionFilter2DReqSize(const GLbyte * pc, Bool swap) -+__glXConvolutionFilter2DReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -@@ -528,7 +526,7 @@ __glXConvolutionFilter2DReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXConvolutionParameterfvReqSize(const GLbyte * pc, Bool swap) -+__glXConvolutionParameterfvReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; -@@ -538,11 +536,11 @@ __glXConvolutionParameterfvReqSize(const GLbyte * pc, Bool swap) - } - - compsize = __glConvolutionParameterfv_size(pname); -- return __GLX_PAD((compsize * 4)); -+ return safe_pad(safe_mul(compsize, 4)); - } - - int --__glXTexImage3DReqSize(const GLbyte * pc, Bool swap) -+__glXTexImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLint row_length = *(GLint *) (pc + 4); - GLint image_height = *(GLint *) (pc + 8); -@@ -579,7 +577,7 @@ __glXTexImage3DReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXTexSubImage3DReqSize(const GLbyte * pc, Bool swap) -+__glXTexSubImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLint row_length = *(GLint *) (pc + 4); - GLint image_height = *(GLint *) (pc + 8); -@@ -613,7 +611,7 @@ __glXTexSubImage3DReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXCompressedTexImage1DARBReqSize(const GLbyte * pc, Bool swap) -+__glXCompressedTexImage1DARBReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei imageSize = *(GLsizei *) (pc + 20); - -@@ -621,11 +619,11 @@ __glXCompressedTexImage1DARBReqSize(const GLbyte * pc, Bool swap) - imageSize = bswap_32(imageSize); - } - -- return __GLX_PAD(imageSize); -+ return safe_pad(imageSize); - } - - int --__glXCompressedTexImage2DARBReqSize(const GLbyte * pc, Bool swap) -+__glXCompressedTexImage2DARBReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei imageSize = *(GLsizei *) (pc + 24); - -@@ -633,11 +631,11 @@ __glXCompressedTexImage2DARBReqSize(const GLbyte * pc, Bool swap) - imageSize = bswap_32(imageSize); - } - -- return __GLX_PAD(imageSize); -+ return safe_pad(imageSize); - } - - int --__glXCompressedTexImage3DARBReqSize(const GLbyte * pc, Bool swap) -+__glXCompressedTexImage3DARBReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei imageSize = *(GLsizei *) (pc + 28); - -@@ -645,11 +643,11 @@ __glXCompressedTexImage3DARBReqSize(const GLbyte * pc, Bool swap) - imageSize = bswap_32(imageSize); - } - -- return __GLX_PAD(imageSize); -+ return safe_pad(imageSize); - } - - int --__glXCompressedTexSubImage3DARBReqSize(const GLbyte * pc, Bool swap) -+__glXCompressedTexSubImage3DARBReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei imageSize = *(GLsizei *) (pc + 36); - -@@ -657,11 +655,11 @@ __glXCompressedTexSubImage3DARBReqSize(const GLbyte * pc, Bool swap) - imageSize = bswap_32(imageSize); - } - -- return __GLX_PAD(imageSize); -+ return safe_pad(imageSize); - } - - int --__glXProgramStringARBReqSize(const GLbyte * pc, Bool swap) -+__glXProgramStringARBReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei len = *(GLsizei *) (pc + 8); - -@@ -669,11 +667,11 @@ __glXProgramStringARBReqSize(const GLbyte * pc, Bool swap) - len = bswap_32(len); - } - -- return __GLX_PAD(len); -+ return safe_pad(len); - } - - int --__glXDrawBuffersARBReqSize(const GLbyte * pc, Bool swap) -+__glXDrawBuffersARBReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei n = *(GLsizei *) (pc + 0); - -@@ -681,11 +679,11 @@ __glXDrawBuffersARBReqSize(const GLbyte * pc, Bool swap) - n = bswap_32(n); - } - -- return __GLX_PAD((n * 4)); -+ return safe_pad(safe_mul(n, 4)); - } - - int --__glXPointParameterfvEXTReqSize(const GLbyte * pc, Bool swap) -+__glXPointParameterfvEXTReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum pname = *(GLenum *) (pc + 0); - GLsizei compsize; -@@ -695,11 +693,11 @@ __glXPointParameterfvEXTReqSize(const GLbyte * pc, Bool swap) - } - - compsize = __glPointParameterfvEXT_size(pname); -- return __GLX_PAD((compsize * 4)); -+ return safe_pad(safe_mul(compsize, 4)); - } - - int --__glXProgramParameters4dvNVReqSize(const GLbyte * pc, Bool swap) -+__glXProgramParameters4dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei num = *(GLsizei *) (pc + 8); - -@@ -707,11 +705,11 @@ __glXProgramParameters4dvNVReqSize(const GLbyte * pc, Bool swap) - num = bswap_32(num); - } - -- return __GLX_PAD((num * 32)); -+ return safe_pad(safe_mul(num, 32)); - } - - int --__glXProgramParameters4fvNVReqSize(const GLbyte * pc, Bool swap) -+__glXProgramParameters4fvNVReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei num = *(GLsizei *) (pc + 8); - -@@ -719,11 +717,11 @@ __glXProgramParameters4fvNVReqSize(const GLbyte * pc, Bool swap) - num = bswap_32(num); - } - -- return __GLX_PAD((num * 16)); -+ return safe_pad(safe_mul(num, 16)); - } - - int --__glXVertexAttribs1dvNVReqSize(const GLbyte * pc, Bool swap) -+__glXVertexAttribs1dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei n = *(GLsizei *) (pc + 4); - -@@ -731,11 +729,11 @@ __glXVertexAttribs1dvNVReqSize(const GLbyte * pc, Bool swap) - n = bswap_32(n); - } - -- return __GLX_PAD((n * 8)); -+ return safe_pad(safe_mul(n, 8)); - } - - int --__glXVertexAttribs2dvNVReqSize(const GLbyte * pc, Bool swap) -+__glXVertexAttribs2dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei n = *(GLsizei *) (pc + 4); - -@@ -743,11 +741,11 @@ __glXVertexAttribs2dvNVReqSize(const GLbyte * pc, Bool swap) - n = bswap_32(n); - } - -- return __GLX_PAD((n * 16)); -+ return safe_pad(safe_mul(n, 16)); - } - - int --__glXVertexAttribs3dvNVReqSize(const GLbyte * pc, Bool swap) -+__glXVertexAttribs3dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei n = *(GLsizei *) (pc + 4); - -@@ -755,11 +753,11 @@ __glXVertexAttribs3dvNVReqSize(const GLbyte * pc, Bool swap) - n = bswap_32(n); - } - -- return __GLX_PAD((n * 24)); -+ return safe_pad(safe_mul(n, 24)); - } - - int --__glXVertexAttribs3fvNVReqSize(const GLbyte * pc, Bool swap) -+__glXVertexAttribs3fvNVReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei n = *(GLsizei *) (pc + 4); - -@@ -767,11 +765,11 @@ __glXVertexAttribs3fvNVReqSize(const GLbyte * pc, Bool swap) - n = bswap_32(n); - } - -- return __GLX_PAD((n * 12)); -+ return safe_pad(safe_mul(n, 12)); - } - - int --__glXVertexAttribs3svNVReqSize(const GLbyte * pc, Bool swap) -+__glXVertexAttribs3svNVReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei n = *(GLsizei *) (pc + 4); - -@@ -779,11 +777,11 @@ __glXVertexAttribs3svNVReqSize(const GLbyte * pc, Bool swap) - n = bswap_32(n); - } - -- return __GLX_PAD((n * 6)); -+ return safe_pad(safe_mul(n, 6)); - } - - int --__glXVertexAttribs4dvNVReqSize(const GLbyte * pc, Bool swap) -+__glXVertexAttribs4dvNVReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei n = *(GLsizei *) (pc + 4); - -@@ -791,11 +789,11 @@ __glXVertexAttribs4dvNVReqSize(const GLbyte * pc, Bool swap) - n = bswap_32(n); - } - -- return __GLX_PAD((n * 32)); -+ return safe_pad(safe_mul(n, 32)); - } - - int --__glXProgramNamedParameter4fvNVReqSize(const GLbyte * pc, Bool swap) -+__glXProgramNamedParameter4fvNVReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLsizei len = *(GLsizei *) (pc + 4); - -@@ -803,7 +801,7 @@ __glXProgramNamedParameter4fvNVReqSize(const GLbyte * pc, Bool swap) - len = bswap_32(len); - } - -- return __GLX_PAD(len); -+ return safe_pad(len); - } - - ALIAS(Fogiv, Fogfv) -diff --git a/glx/indirect_reqsize.h b/glx/indirect_reqsize.h -index d2c1da7..22e1350 100644 ---- a/glx/indirect_reqsize.h -+++ b/glx/indirect_reqsize.h -@@ -36,128 +36,128 @@ - #define PURE - #endif - --extern PURE _X_HIDDEN int __glXCallListsReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXBitmapReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXFogfvReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXFogivReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXLightfvReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXLightivReqSize(const GLbyte * pc, Bool swap); -+extern PURE _X_HIDDEN int __glXCallListsReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXBitmapReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXFogfvReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXFogivReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXLightfvReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXLightivReqSize(const GLbyte * pc, Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXLightModelfvReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXLightModelivReqSize(const GLbyte * pc, -- Bool swap); --extern PURE _X_HIDDEN int __glXMaterialfvReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXMaterialivReqSize(const GLbyte * pc, Bool swap); -+ Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXMaterialfvReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXMaterialivReqSize(const GLbyte * pc, Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXPolygonStippleReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXTexParameterfvReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXTexParameterivReqSize(const GLbyte * pc, -- Bool swap); --extern PURE _X_HIDDEN int __glXTexImage1DReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXTexImage2DReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXTexEnvfvReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXTexEnvivReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXTexGendvReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXTexGenfvReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXTexGenivReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXMap1dReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXMap1fReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXMap2dReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXMap2fReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXPixelMapfvReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXPixelMapuivReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXPixelMapusvReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXDrawPixelsReqSize(const GLbyte * pc, Bool swap); --extern PURE _X_HIDDEN int __glXDrawArraysReqSize(const GLbyte * pc, Bool swap); -+ Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXTexImage1DReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXTexImage2DReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXTexEnvfvReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXTexEnvivReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXTexGendvReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXTexGenfvReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXTexGenivReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXMap1dReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXMap1fReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXMap2dReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXMap2fReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXPixelMapfvReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXPixelMapuivReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXPixelMapusvReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXDrawPixelsReqSize(const GLbyte * pc, Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXDrawArraysReqSize(const GLbyte * pc, Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXPrioritizeTexturesReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXTexSubImage1DReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXTexSubImage2DReqSize(const GLbyte * pc, -- Bool swap); --extern PURE _X_HIDDEN int __glXColorTableReqSize(const GLbyte * pc, Bool swap); -+ Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXColorTableReqSize(const GLbyte * pc, Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXColorTableParameterfvReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXColorTableParameterivReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXColorSubTableReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXConvolutionFilter1DReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXConvolutionFilter2DReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXConvolutionParameterfvReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXConvolutionParameterivReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXSeparableFilter2DReqSize(const GLbyte * pc, -- Bool swap); --extern PURE _X_HIDDEN int __glXTexImage3DReqSize(const GLbyte * pc, Bool swap); -+ Bool swap, int reqlen); -+extern PURE _X_HIDDEN int __glXTexImage3DReqSize(const GLbyte * pc, Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXTexSubImage3DReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXCompressedTexImage1DARBReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXCompressedTexImage2DARBReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXCompressedTexImage3DARBReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXCompressedTexSubImage1DARBReqSize(const GLbyte * -- pc, Bool swap); -+ pc, Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXCompressedTexSubImage2DARBReqSize(const GLbyte * -- pc, Bool swap); -+ pc, Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXCompressedTexSubImage3DARBReqSize(const GLbyte * -- pc, Bool swap); -+ pc, Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXProgramStringARBReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXDrawBuffersARBReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXPointParameterfvEXTReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXLoadProgramNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXProgramParameters4dvNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXProgramParameters4fvNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXRequestResidentProgramsNVReqSize(const GLbyte * -- pc, Bool swap); -+ pc, Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXVertexAttribs1dvNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXVertexAttribs1fvNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXVertexAttribs1svNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXVertexAttribs2dvNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXVertexAttribs2fvNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXVertexAttribs2svNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXVertexAttribs3dvNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXVertexAttribs3fvNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXVertexAttribs3svNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXVertexAttribs4dvNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXVertexAttribs4fvNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXVertexAttribs4svNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXVertexAttribs4ubvNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXPointParameterivNVReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXProgramNamedParameter4dvNVReqSize(const GLbyte * -- pc, Bool swap); -+ pc, Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXProgramNamedParameter4fvNVReqSize(const GLbyte * -- pc, Bool swap); -+ pc, Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXDeleteFramebuffersEXTReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - extern PURE _X_HIDDEN int __glXDeleteRenderbuffersEXTReqSize(const GLbyte * pc, -- Bool swap); -+ Bool swap, int reqlen); - - #undef PURE - -diff --git a/glx/rensize.c b/glx/rensize.c -index 6ee0f9c..a532467 100644 ---- a/glx/rensize.c -+++ b/glx/rensize.c -@@ -44,7 +44,7 @@ - ((a & 0xff00U)<<8) | ((a & 0xffU)<<24)) - - int --__glXMap1dReqSize(const GLbyte * pc, Bool swap) -+__glXMap1dReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum target; - GLint order; -@@ -61,7 +61,7 @@ __glXMap1dReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXMap1fReqSize(const GLbyte * pc, Bool swap) -+__glXMap1fReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum target; - GLint order; -@@ -86,7 +86,7 @@ Map2Size(int k, int majorOrder, int minorOrder) - } - - int --__glXMap2dReqSize(const GLbyte * pc, Bool swap) -+__glXMap2dReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum target; - GLint uorder, vorder; -@@ -103,7 +103,7 @@ __glXMap2dReqSize(const GLbyte * pc, Bool swap) - } - - int --__glXMap2fReqSize(const GLbyte * pc, Bool swap) -+__glXMap2fReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - GLenum target; - GLint uorder, vorder; -@@ -359,13 +359,14 @@ __glXTypeSize(GLenum enm) - } - - int --__glXDrawArraysReqSize(const GLbyte * pc, Bool swap) -+__glXDrawArraysReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *) pc; - __GLXdispatchDrawArraysComponentHeader *compHeader; - GLint numVertexes = hdr->numVertexes; - GLint numComponents = hdr->numComponents; - GLint arrayElementSize = 0; -+ GLint x, size; - int i; - - if (swap) { -@@ -374,6 +375,13 @@ __glXDrawArraysReqSize(const GLbyte * pc, Bool swap) - } - - pc += sizeof(__GLXdispatchDrawArraysHeader); -+ reqlen -= sizeof(__GLXdispatchDrawArraysHeader); -+ -+ size = safe_mul(sizeof(__GLXdispatchDrawArraysComponentHeader), -+ numComponents); -+ if (size < 0 || reqlen < 0 || reqlen < size) -+ return -1; -+ - compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc; - - for (i = 0; i < numComponents; i++) { -@@ -417,17 +425,18 @@ __glXDrawArraysReqSize(const GLbyte * pc, Bool swap) - return -1; - } - -- arrayElementSize += __GLX_PAD(numVals * __glXTypeSize(datatype)); -+ x = safe_pad(safe_mul(numVals, __glXTypeSize(datatype))); -+ if ((arrayElementSize = safe_add(arrayElementSize, x)) < 0) -+ return -1; - - pc += sizeof(__GLXdispatchDrawArraysComponentHeader); - } - -- return ((numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader)) + -- (numVertexes * arrayElementSize)); -+ return safe_add(size, safe_mul(numVertexes, arrayElementSize)); - } - - int --__glXSeparableFilter2DReqSize(const GLbyte * pc, Bool swap) -+__glXSeparableFilter2DReqSize(const GLbyte * pc, Bool swap, int reqlen) - { - __GLXdispatchConvolutionFilterHeader *hdr = - (__GLXdispatchConvolutionFilterHeader *) pc; -diff --git a/include/dix.h b/include/dix.h -index ea9d2cc..b48d828 100644 ---- a/include/dix.h -+++ b/include/dix.h -@@ -72,6 +72,10 @@ SOFTWARE. - if ((sizeof(req) >> 2) > client->req_len )\ - return(BadLength) - -+#define REQUEST_AT_LEAST_EXTRA_SIZE(req, extra) \ -+ if (((sizeof(req) + ((uint64_t) extra)) >> 2) > client->req_len ) \ -+ return(BadLength) -+ - #define REQUEST_FIXED_SIZE(req, n)\ - if (((sizeof(req) >> 2) > client->req_len) || \ - ((n >> 2) >= client->req_len) || \ -diff --git a/test/xi2/protocol-xipassivegrabdevice.c b/test/xi2/protocol-xipassivegrabdevice.c -index ff9aec5..25eb6e9 100644 ---- a/test/xi2/protocol-xipassivegrabdevice.c -+++ b/test/xi2/protocol-xipassivegrabdevice.c -@@ -136,6 +136,7 @@ request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq * req, - { - int rc; - int modifiers; -+ int mask_len; - - client_request.req_len = req->length; - rc = ProcXIPassiveGrabDevice(&client_request); -@@ -153,10 +154,11 @@ request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq * req, - swaps(&req->deviceid); - modifiers = req->num_modifiers; - swaps(&req->num_modifiers); -+ mask_len = req->mask_len; - swaps(&req->mask_len); - - while (modifiers--) { -- CARD32 *mod = ((CARD32 *) (req + 1)) + modifiers; -+ CARD32 *mod = (CARD32 *) (req + 1) + mask_len + modifiers; - - swapl(mod); - } -@@ -235,6 +237,11 @@ test_XIPassiveGrabDevice(void) - request->detail = XIAnyButton; - request_XIPassiveGrabDevice(&client_request, request, Success, 0); - -+ /* Set a few random masks to make sure we handle modifiers correctly */ -+ SetBit(mask, XI_ButtonPress); -+ SetBit(mask, XI_KeyPress); -+ SetBit(mask, XI_Enter); -+ - /* some modifiers */ - request->num_modifiers = N_MODS; - request->length += N_MODS; diff --git a/contrib/packages/rpm/el5/SOURCES/17_CVE-regressions.diff b/contrib/packages/rpm/el5/SOURCES/17_CVE-regressions.diff deleted file mode 100644 index c274d144..00000000 --- a/contrib/packages/rpm/el5/SOURCES/17_CVE-regressions.diff +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/include/dix.h b/include/dix.h -index 21176a8..921156b 100644 ---- a/include/dix.h -+++ b/include/dix.h -@@ -80,7 +80,7 @@ SOFTWARE. - - #define REQUEST_FIXED_SIZE(req, n)\ - if (((sizeof(req) >> 2) > client->req_len) || \ -- ((n >> 2) >= client->req_len) || \ -+ (((n) >> 2) >= client->req_len) || \ - ((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len)) \ - return(BadLength) - -diff --git a/os/access.c b/os/access.c -index f393c8d..28f2d32 100644 ---- a/os/access.c -+++ b/os/access.c -@@ -1308,7 +1308,7 @@ GetHosts(void **data, int *pnHosts, int *pLen, BOOL * pEnabled) - } - for (host = validhosts; host; host = host->next) { - len = host->len; -- if ((ptr + sizeof(xHostEntry) + len) > (data + n)) -+ if ((ptr + sizeof(xHostEntry) + len) > ((unsigned char *) *data + n)) - break; - ((xHostEntry *) ptr)->family = host->family; - ((xHostEntry *) ptr)->length = len; diff --git a/contrib/packages/rpm/el5/SOURCES/CVE-2013-7439.diff b/contrib/packages/rpm/el5/SOURCES/CVE-2013-7439.diff deleted file mode 100644 index 1037fa51..00000000 --- a/contrib/packages/rpm/el5/SOURCES/CVE-2013-7439.diff +++ /dev/null @@ -1,80 +0,0 @@ -From 39547d600a13713e15429f49768e54c3173c828d Mon Sep 17 00:00:00 2001 -From: Karl Tomlinson <xmail@karlt.net> -Date: Mon, 18 Feb 2013 01:25:34 +0000 -Subject: MakeBigReq: don't move the last word, already handled by Data32 - -MakeBigReq inserts a length field after the first 4 bytes of the request -(after req->length), pushing everything else back by 4 bytes. - -The current memmove moves everything but the first 4 bytes back. -If a request aligns to the end of the buffer pointer when MakeBigReq is -invoked for that request, this runs over the buffer. -Instead, we need to memmove minus the first 4 bytes (which aren't moved), -minus the last 4 bytes (so we still align to the previous tail). - -The 4 bytes that fell out are already handled with Data32, which will -handle the buffermax correctly. - -The case where req->length = 1 was already not functional. - -Reported by Abhishek Arya <inferno@chromium.org>. - -https://bugzilla.mozilla.org/show_bug.cgi?id=803762 - -Reviewed-by: Jeff Muizelaar <jmuizelaar@mozilla.com> -Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> -Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> - -diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h -index 40965c4..06395b3 100644 ---- a/include/X11/Xlibint.h -+++ b/include/X11/Xlibint.h -@@ -486,6 +486,14 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); - req = (xReq *) _XGetRequest(dpy, X_/**/name, SIZEOF(xReq)) - #endif - -+/* -+ * MakeBigReq sets the CARD16 "req->length" to 0 and inserts a new CARD32 -+ * length, after req->length, before the data in the request. The new length -+ * includes the "n" extra 32-bit words. -+ * -+ * Do not use MakeBigReq if there is no data already in the request. -+ * req->length must already be >= 2. -+ */ - #ifdef WORD64 - #define MakeBigReq(req,n) \ - { \ -@@ -493,7 +501,7 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); - CARD32 _BRlen = req->length - 1; \ - req->length = 0; \ - _BRdat = ((CARD32 *)req)[_BRlen]; \ -- memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ -+ memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \ - ((CARD32 *)req)[1] = _BRlen + n + 2; \ - Data32(dpy, &_BRdat, 4); \ - } -@@ -504,13 +512,20 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); - CARD32 _BRlen = req->length - 1; \ - req->length = 0; \ - _BRdat = ((CARD32 *)req)[_BRlen]; \ -- memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ -+ memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \ - ((CARD32 *)req)[1] = _BRlen + n + 2; \ - Data32(dpy, &_BRdat, 4); \ - } - #endif - #endif - -+/* -+ * SetReqLen increases the count of 32-bit words in the request by "n", -+ * or by "badlen" if "n" is too large. -+ * -+ * Do not use SetReqLen if "req" does not already have data after the -+ * xReq header. req->length must already be >= 2. -+ */ - #ifndef __clang_analyzer__ - #define SetReqLen(req,n,badlen) \ - if ((req->length + n) > (unsigned)65535) { \ --- -cgit v0.10.2 - diff --git a/contrib/packages/rpm/el5/SOURCES/CVE-2015-0255.diff b/contrib/packages/rpm/el5/SOURCES/CVE-2015-0255.diff deleted file mode 100644 index 32e56812..00000000 --- a/contrib/packages/rpm/el5/SOURCES/CVE-2015-0255.diff +++ /dev/null @@ -1,240 +0,0 @@ -From 81c90dc8f0aae3b65730409b1b615b5fa7280ebd Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan <ofourdan@redhat.com> -Date: Fri, 16 Jan 2015 20:08:59 +0100 -Subject: xkb: Don't swap XkbSetGeometry data in the input buffer - -The XkbSetGeometry request embeds data which needs to be swapped when the -server and the client have different endianess. - -_XkbSetGeometry() invokes functions that swap these data directly in the -input buffer. - -However, ProcXkbSetGeometry() may call _XkbSetGeometry() more than once -(if there is more than one keyboard), thus causing on swapped clients the -same data to be swapped twice in memory, further causing a server crash -because the strings lengths on the second time are way off bounds. - -To allow _XkbSetGeometry() to run reliably more than once with swapped -clients, do not swap the data in the buffer, use variables instead. - -Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> -Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> - -diff --git a/xkb/xkb.c b/xkb/xkb.c -index 15c7f34..b9a3ac4 100644 ---- a/xkb/xkb.c -+++ b/xkb/xkb.c -@@ -4961,14 +4961,13 @@ static char * - _GetCountedString(char **wire_inout, Bool swap) - { - char *wire, *str; -- CARD16 len, *plen; -+ CARD16 len; - - wire = *wire_inout; -- plen = (CARD16 *) wire; -+ len = *(CARD16 *) wire; - if (swap) { -- swaps(plen); -+ swaps(&len); - } -- len = *plen; - str = malloc(len + 1); - if (str) { - memcpy(str, &wire[2], len); -@@ -4985,25 +4984,28 @@ _CheckSetDoodad(char **wire_inout, - { - char *wire; - xkbDoodadWireDesc *dWire; -+ xkbAnyDoodadWireDesc any; -+ xkbTextDoodadWireDesc text; - XkbDoodadPtr doodad; - - dWire = (xkbDoodadWireDesc *) (*wire_inout); -+ any = dWire->any; - wire = (char *) &dWire[1]; - if (client->swapped) { -- swapl(&dWire->any.name); -- swaps(&dWire->any.top); -- swaps(&dWire->any.left); -- swaps(&dWire->any.angle); -+ swapl(&any.name); -+ swaps(&any.top); -+ swaps(&any.left); -+ swaps(&any.angle); - } - CHK_ATOM_ONLY(dWire->any.name); -- doodad = XkbAddGeomDoodad(geom, section, dWire->any.name); -+ doodad = XkbAddGeomDoodad(geom, section, any.name); - if (!doodad) - return BadAlloc; - doodad->any.type = dWire->any.type; - doodad->any.priority = dWire->any.priority; -- doodad->any.top = dWire->any.top; -- doodad->any.left = dWire->any.left; -- doodad->any.angle = dWire->any.angle; -+ doodad->any.top = any.top; -+ doodad->any.left = any.left; -+ doodad->any.angle = any.angle; - switch (doodad->any.type) { - case XkbOutlineDoodad: - case XkbSolidDoodad: -@@ -5026,12 +5028,13 @@ _CheckSetDoodad(char **wire_inout, - dWire->text.colorNdx); - return BadMatch; - } -+ text = dWire->text; - if (client->swapped) { -- swaps(&dWire->text.width); -- swaps(&dWire->text.height); -+ swaps(&text.width); -+ swaps(&text.height); - } -- doodad->text.width = dWire->text.width; -- doodad->text.height = dWire->text.height; -+ doodad->text.width = text.width; -+ doodad->text.height = text.height; - doodad->text.color_ndx = dWire->text.colorNdx; - doodad->text.text = _GetCountedString(&wire, client->swapped); - doodad->text.font = _GetCountedString(&wire, client->swapped); --- -cgit v0.10.2 - -From 20079c36cf7d377938ca5478447d8b9045cb7d43 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan <ofourdan@redhat.com> -Date: Fri, 16 Jan 2015 08:44:45 +0100 -Subject: xkb: Check strings length against request size - -Ensure that the given strings length in an XkbSetGeometry request remain -within the limits of the size of the request. - -Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> -Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> -Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> - -diff --git a/xkb/xkb.c b/xkb/xkb.c -index b9a3ac4..f3988f9 100644 ---- a/xkb/xkb.c -+++ b/xkb/xkb.c -@@ -4957,25 +4957,29 @@ ProcXkbGetGeometry(ClientPtr client) - - /***====================================================================***/ - --static char * --_GetCountedString(char **wire_inout, Bool swap) -+static Status -+_GetCountedString(char **wire_inout, ClientPtr client, char **str) - { -- char *wire, *str; -+ char *wire, *next; - CARD16 len; - - wire = *wire_inout; - len = *(CARD16 *) wire; -- if (swap) { -+ if (client->swapped) { - swaps(&len); - } -- str = malloc(len + 1); -- if (str) { -- memcpy(str, &wire[2], len); -- str[len] = '\0'; -- } -- wire += XkbPaddedSize(len + 2); -- *wire_inout = wire; -- return str; -+ next = wire + XkbPaddedSize(len + 2); -+ /* Check we're still within the size of the request */ -+ if (client->req_len < -+ bytes_to_int32(next - (char *) client->requestBuffer)) -+ return BadValue; -+ *str = malloc(len + 1); -+ if (!*str) -+ return BadAlloc; -+ memcpy(*str, &wire[2], len); -+ *(*str + len) = '\0'; -+ *wire_inout = next; -+ return Success; - } - - static Status -@@ -4987,6 +4991,7 @@ _CheckSetDoodad(char **wire_inout, - xkbAnyDoodadWireDesc any; - xkbTextDoodadWireDesc text; - XkbDoodadPtr doodad; -+ Status status; - - dWire = (xkbDoodadWireDesc *) (*wire_inout); - any = dWire->any; -@@ -5036,8 +5041,14 @@ _CheckSetDoodad(char **wire_inout, - doodad->text.width = text.width; - doodad->text.height = text.height; - doodad->text.color_ndx = dWire->text.colorNdx; -- doodad->text.text = _GetCountedString(&wire, client->swapped); -- doodad->text.font = _GetCountedString(&wire, client->swapped); -+ status = _GetCountedString(&wire, client, &doodad->text.text); -+ if (status != Success) -+ return status; -+ status = _GetCountedString(&wire, client, &doodad->text.font); -+ if (status != Success) { -+ free (doodad->text.text); -+ return status; -+ } - break; - case XkbIndicatorDoodad: - if (dWire->indicator.onColorNdx >= geom->num_colors) { -@@ -5072,7 +5083,9 @@ _CheckSetDoodad(char **wire_inout, - } - doodad->logo.color_ndx = dWire->logo.colorNdx; - doodad->logo.shape_ndx = dWire->logo.shapeNdx; -- doodad->logo.logo_name = _GetCountedString(&wire, client->swapped); -+ status = _GetCountedString(&wire, client, &doodad->logo.logo_name); -+ if (status != Success) -+ return status; - break; - default: - client->errorValue = _XkbErrCode2(0x4F, dWire->any.type); -@@ -5304,18 +5317,20 @@ _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client) - char *wire; - - wire = (char *) &req[1]; -- geom->label_font = _GetCountedString(&wire, client->swapped); -+ status = _GetCountedString(&wire, client, &geom->label_font); -+ if (status != Success) -+ return status; - - for (i = 0; i < req->nProperties; i++) { - char *name, *val; - -- name = _GetCountedString(&wire, client->swapped); -- if (!name) -- return BadAlloc; -- val = _GetCountedString(&wire, client->swapped); -- if (!val) { -+ status = _GetCountedString(&wire, client, &name); -+ if (status != Success) -+ return status; -+ status = _GetCountedString(&wire, client, &val); -+ if (status != Success) { - free(name); -- return BadAlloc; -+ return status; - } - if (XkbAddGeomProperty(geom, name, val) == NULL) { - free(name); -@@ -5349,9 +5364,9 @@ _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client) - for (i = 0; i < req->nColors; i++) { - char *name; - -- name = _GetCountedString(&wire, client->swapped); -- if (!name) -- return BadAlloc; -+ status = _GetCountedString(&wire, client, &name); -+ if (status != Success) -+ return status; - if (!XkbAddGeomColor(geom, name, geom->num_colors)) { - free(name); - return BadAlloc; --- -cgit v0.10.2 - diff --git a/contrib/packages/rpm/el5/SOURCES/CVE-2015-1802.diff b/contrib/packages/rpm/el5/SOURCES/CVE-2015-1802.diff deleted file mode 100644 index 1d873336..00000000 --- a/contrib/packages/rpm/el5/SOURCES/CVE-2015-1802.diff +++ /dev/null @@ -1,30 +0,0 @@ -From 2deda9906480f9c8ae07b8c2a5510cc7e4c59a8e Mon Sep 17 00:00:00 2001 -From: Alan Coopersmith <alan.coopersmith@oracle.com> -Date: Fri, 6 Feb 2015 15:50:45 -0800 -Subject: bdfReadProperties: property count needs range check [CVE-2015-1802] - -Avoid integer overflow or underflow when allocating memory arrays -by multiplying the number of properties reported for a BDF font. - -Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> -Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> -Reviewed-by: Julien Cristau <jcristau@debian.org> - -diff --git a/src/bitmap/bdfread.c b/src/bitmap/bdfread.c -index 914a024..6387908 100644 ---- a/src/bitmap/bdfread.c -+++ b/src/bitmap/bdfread.c -@@ -604,7 +604,9 @@ bdfReadProperties(FontFilePtr file, FontPtr pFont, bdfFileState *pState) - bdfError("missing 'STARTPROPERTIES'\n"); - return (FALSE); - } -- if (sscanf((char *) line, "STARTPROPERTIES %d", &nProps) != 1) { -+ if ((sscanf((char *) line, "STARTPROPERTIES %d", &nProps) != 1) || -+ (nProps <= 0) || -+ (nProps > ((INT32_MAX / sizeof(FontPropRec)) - BDF_GENPROPS))) { - bdfError("bad 'STARTPROPERTIES'\n"); - return (FALSE); - } --- -cgit v0.10.2 - diff --git a/contrib/packages/rpm/el5/SOURCES/CVE-2015-1803.diff b/contrib/packages/rpm/el5/SOURCES/CVE-2015-1803.diff deleted file mode 100644 index 22d2d5b7..00000000 --- a/contrib/packages/rpm/el5/SOURCES/CVE-2015-1803.diff +++ /dev/null @@ -1,33 +0,0 @@ -From 78c2e3d70d29698244f70164428bd2868c0ab34c Mon Sep 17 00:00:00 2001 -From: Alan Coopersmith <alan.coopersmith@oracle.com> -Date: Fri, 6 Feb 2015 15:54:00 -0800 -Subject: bdfReadCharacters: bailout if a char's bitmap cannot be read - [CVE-2015-1803] - -Previously would charge on ahead with a NULL pointer in ci->bits, and -then crash later in FontCharInkMetrics() trying to access the bits. - -Found with afl-1.23b. - -Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> -Reviewed-by: Julien Cristau <jcristau@debian.org> - -diff --git a/src/bitmap/bdfread.c b/src/bitmap/bdfread.c -index 6387908..1b29b81 100644 ---- a/src/bitmap/bdfread.c -+++ b/src/bitmap/bdfread.c -@@ -458,7 +458,10 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState, - ci->metrics.descent = -bb; - ci->metrics.characterWidth = wx; - ci->bits = NULL; -- bdfReadBitmap(ci, file, bit, byte, glyph, scan, bitmapsSizes); -+ if (!bdfReadBitmap(ci, file, bit, byte, glyph, scan, bitmapsSizes)) { -+ bdfError("could not read bitmap for character '%s'\n", charName); -+ goto BAILOUT; -+ } - ci++; - ndx++; - } else --- -cgit v0.10.2 - diff --git a/contrib/packages/rpm/el5/SOURCES/CVE-2015-1804.diff b/contrib/packages/rpm/el5/SOURCES/CVE-2015-1804.diff deleted file mode 100644 index dd8d5be4..00000000 --- a/contrib/packages/rpm/el5/SOURCES/CVE-2015-1804.diff +++ /dev/null @@ -1,73 +0,0 @@ -From 2351c83a77a478b49cba6beb2ad386835e264744 Mon Sep 17 00:00:00 2001 -From: Alan Coopersmith <alan.coopersmith@oracle.com> -Date: Fri, 6 Mar 2015 22:54:58 -0800 -Subject: bdfReadCharacters: ensure metrics fit into xCharInfo struct - [CVE-2015-1804] - -We use 32-bit ints to read from the bdf file, but then try to stick -into a 16-bit int in the xCharInfo struct, so make sure they won't -overflow that range. - -Found by afl-1.24b. - -v2: Verify that additions won't overflow 32-bit int range either. -v3: As Julien correctly observes, the previous check for bh & bw not - being < 0 reduces the number of cases we need to check for overflow. - -Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> -Reviewed-by: Julien Cristau <jcristau@debian.org> - -diff --git a/src/bitmap/bdfread.c b/src/bitmap/bdfread.c -index 1b29b81..a0ace8f 100644 ---- a/src/bitmap/bdfread.c -+++ b/src/bitmap/bdfread.c -@@ -62,8 +62,16 @@ from The Open Group. - - #if HAVE_STDINT_H - #include <stdint.h> --#elif !defined(INT32_MAX) --#define INT32_MAX 0x7fffffff -+#else -+# ifndef INT32_MAX -+# define INT32_MAX 0x7fffffff -+# endif -+# ifndef INT16_MAX -+# define INT16_MAX 0x7fff -+# endif -+# ifndef INT16_MIN -+# define INT16_MIN (0 - 0x8000) -+# endif - #endif - - #define INDICES 256 -@@ -417,6 +425,12 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState, - bdfError("DWIDTH y value must be zero\n"); - goto BAILOUT; - } -+ /* xCharInfo metrics are stored as INT16 */ -+ if ((wx < 0) || (wx > INT16_MAX)) { -+ bdfError("character '%s' has out of range width, %d\n", -+ charName, wx); -+ goto BAILOUT; -+ } - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if ((!line) || (sscanf((char *) line, "BBX %d %d %d %d", &bw, &bh, &bl, &bb) != 4)) { - bdfError("bad 'BBX'\n"); -@@ -427,6 +441,14 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState, - charName, bw, bh); - goto BAILOUT; - } -+ /* xCharInfo metrics are read as int, but stored as INT16 */ -+ if ((bl > INT16_MAX) || (bl < INT16_MIN) || -+ (bb > INT16_MAX) || (bb < INT16_MIN) || -+ (bw > (INT16_MAX - bl)) || (bh > (INT16_MAX - bb))) { -+ bdfError("character '%s' has out of range metrics, %d %d %d %d\n", -+ charName, bl, (bl+bw), (bh+bb), -bb); -+ goto BAILOUT; -+ } - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if ((line) && (bdfIsPrefix(line, "ATTRIBUTES"))) { - for (p = line + strlen("ATTRIBUTES "); --- -cgit v0.10.2 - diff --git a/contrib/packages/rpm/el5/SOURCES/FindX11.cmake b/contrib/packages/rpm/el5/SOURCES/FindX11.cmake deleted file mode 100644 index 21cb7324..00000000 --- a/contrib/packages/rpm/el5/SOURCES/FindX11.cmake +++ /dev/null @@ -1,511 +0,0 @@ -# - Find X11 installation -# Try to find X11 on UNIX systems. The following values are defined -# X11_FOUND - True if X11 is available -# X11_INCLUDE_DIR - include directories to use X11 -# X11_LIBRARIES - link against these to use X11 -# -# and also the following more fine grained variables: -# Include paths: X11_ICE_INCLUDE_PATH, X11_ICE_LIB, X11_ICE_FOUND -# X11_SM_INCLUDE_PATH, X11_SM_LIB, X11_SM_FOUND -# X11_X11_INCLUDE_PATH, X11_X11_LIB -# X11_Xaccessrules_INCLUDE_PATH, X11_Xaccess_FOUND -# X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND -# X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND -# X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND -# X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND -# X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND -# X11_Xdmcp_INCLUDE_PATH, X11_Xdmcp_LIB, X11_Xdmcp_FOUND -# X11_Xext_LIB, X11_Xext_FOUND -# X11_dpms_INCLUDE_PATH, (in X11_Xext_LIB), X11_dpms_FOUND -# X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND -# X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND -# X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND -# X11_xf86vmode_INCLUDE_PATH, X11_Xxf86vm_LIB X11_xf86vmode_FOUND -# X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND -# X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND -# X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND -# X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND -# X11_Xinput_INCLUDE_PATH, X11_Xinput_LIB, X11_Xinput_FOUND -# X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND -# X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND -# X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND -# X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND -# X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND -# X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND -# X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND -# X11_Xrender_INCLUDE_PATH, X11_Xrender_LIB, X11_Xrender_FOUND -# X11_Xscreensaver_INCLUDE_PATH, X11_Xscreensaver_LIB, X11_Xscreensaver_FOUND -# X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND -# X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND -# X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND -# X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND - - -#============================================================================= -# Copyright 2001-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -if (UNIX) - set(X11_FOUND 0) - # X11 is never a framework and some header files may be - # found in tcl on the mac - set(CMAKE_FIND_FRAMEWORK_SAVE ${CMAKE_FIND_FRAMEWORK}) - set(CMAKE_FIND_FRAMEWORK NEVER) - set(X11_INC_SEARCH_PATH - @_includedir@ - /usr/pkg/xorg/include - /usr/X11R6/include - /usr/X11R7/include - /usr/include/X11 - /usr/openwin/include - /usr/openwin/share/include - /opt/graphics/OpenGL/include - ) - - - set(X11_LIB_SEARCH_PATH - @_libdir@ - @_libdir@/tigervnc - /usr/pkg/xorg/lib - /usr/X11R6/lib - /usr/X11R7/lib - /usr/openwin/lib - ) - - find_path(X11_X11_INCLUDE_PATH X11/X.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xlib_INCLUDE_PATH X11/Xlib.h ${X11_INC_SEARCH_PATH}) - - # Look for includes; keep the list sorted by name of the cmake *_INCLUDE_PATH - # variable (which doesn't need to match the include file name). - - # Solaris lacks XKBrules.h, so we should skip kxkbd there. - find_path(X11_ICE_INCLUDE_PATH X11/ICE/ICE.h ${X11_INC_SEARCH_PATH}) - find_path(X11_SM_INCLUDE_PATH X11/SM/SM.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xau_INCLUDE_PATH X11/Xauth.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xcomposite_INCLUDE_PATH X11/extensions/Xcomposite.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xdmcp_INCLUDE_PATH X11/Xdmcp.h ${X11_INC_SEARCH_PATH}) - find_path(X11_dpms_INCLUDE_PATH X11/extensions/dpms.h ${X11_INC_SEARCH_PATH}) - find_path(X11_xf86misc_INCLUDE_PATH X11/extensions/xf86misc.h ${X11_INC_SEARCH_PATH}) - find_path(X11_xf86vmode_INCLUDE_PATH X11/extensions/xf86vmode.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xfixes_INCLUDE_PATH X11/extensions/Xfixes.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xft_INCLUDE_PATH X11/Xft/Xft.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xi_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xpm_INCLUDE_PATH X11/xpm.h ${X11_INC_SEARCH_PATH}) - find_path(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH}) - find_path(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xrandr_INCLUDE_PATH X11/extensions/Xrandr.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xrender_INCLUDE_PATH X11/extensions/Xrender.h ${X11_INC_SEARCH_PATH}) - find_path(X11_XRes_INCLUDE_PATH X11/extensions/XRes.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xscreensaver_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xshape_INCLUDE_PATH X11/extensions/shape.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xutil_INCLUDE_PATH X11/Xutil.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xt_INCLUDE_PATH X11/Intrinsic.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h ${X11_INC_SEARCH_PATH}) - find_path(X11_XSync_INCLUDE_PATH X11/extensions/sync.h ${X11_INC_SEARCH_PATH}) - find_path(X11_xcb_INCLUDE_PATH X11/xcb.h ${X11_INC_SEARCH_PATH}) - - - find_library(X11_X11_LIB X11 ${X11_LIB_SEARCH_PATH}) - - # Find additional X libraries. Keep list sorted by library name. - find_library(X11_ICE_LIB ICE ${X11_LIB_SEARCH_PATH}) - find_library(X11_SM_LIB SM ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xau_LIB Xau ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xcomposite_LIB Xcomposite ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xcursor_LIB Xcursor ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xdamage_LIB Xdamage ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xdmcp_LIB Xdmcp ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xext_LIB Xext ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xfixes_LIB Xfixes ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xft_LIB Xft ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xi_LIB Xi ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xmu_LIB Xmu ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH}) - find_library(X11_XRes_LIB XRes ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xscreensaver_LIB Xss ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xt_LIB Xt ${X11_LIB_SEARCH_PATH}) - find_library(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xv_LIB Xv ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xxf86misc_LIB Xxf86misc ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xxf86vm_LIB Xxf86vm ${X11_LIB_SEARCH_PATH}) - find_library(X11_xcb_LIB xcb ${X11_LIB_SEARCH_PATH}) - - set(X11_LIBRARY_DIR "") - if(X11_X11_LIB) - get_filename_component(X11_LIBRARY_DIR ${X11_X11_LIB} PATH) - endif() - - set(X11_INCLUDE_DIR) # start with empty list - if(X11_X11_INCLUDE_PATH) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH}) - endif() - - if(X11_Xlib_INCLUDE_PATH) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH}) - endif() - - if(X11_Xutil_INCLUDE_PATH) - set(X11_Xutil_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH}) - endif() - - if(X11_Xshape_INCLUDE_PATH) - set(X11_Xshape_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xshape_INCLUDE_PATH}) - endif() - - set(X11_LIBRARIES) # start with empty list - if(X11_X11_LIB) - set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB} ${X11_xcb_LIB}) - endif() - - if(X11_Xext_LIB) - set(X11_Xext_FOUND TRUE) - set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIB}) - endif() - - if(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH) - set(X11_Xt_FOUND TRUE) - endif() - - if(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH) - set(X11_Xft_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xft_INCLUDE_PATH}) - endif() - - if(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH) - set(X11_Xv_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xv_INCLUDE_PATH}) - endif() - - if (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH) - set(X11_Xau_FOUND TRUE) - set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xau_LIB}) - endif () - - if (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB) - set(X11_Xdmcp_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdmcp_INCLUDE_PATH}) - set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xdmcp_LIB}) - endif () - - if (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH) - set(X11_Xaccess_FOUND TRUE) - set(X11_Xaccess_INCLUDE_PATH ${X11_Xaccessstr_INCLUDE_PATH}) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xaccess_INCLUDE_PATH}) - endif () - - if (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB) - set(X11_Xpm_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xpm_INCLUDE_PATH}) - endif () - - if (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB) - set(X11_Xcomposite_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcomposite_INCLUDE_PATH}) - endif () - - if (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB) - set(X11_Xdamage_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdamage_INCLUDE_PATH}) - endif () - - if (X11_XShm_INCLUDE_PATH) - set(X11_XShm_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XShm_INCLUDE_PATH}) - endif () - - if (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB) - set(X11_XTest_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH}) - endif () - - if (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB) - set(X11_Xi_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xi_INCLUDE_PATH}) - endif () - - if (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB) - set(X11_Xinerama_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH}) - endif () - - if (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB) - set(X11_Xfixes_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xfixes_INCLUDE_PATH}) - endif () - - if (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB) - set(X11_Xrender_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH}) - endif () - - if (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB) - set(X11_XRes_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XRes_INCLUDE_PATH}) - endif () - - if (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB) - set(X11_Xrandr_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH}) - endif () - - if (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB) - set(X11_xf86misc_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH}) - endif () - - if (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB) - set(X11_xf86vmode_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH}) - endif () - - if (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB) - set(X11_Xcursor_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcursor_INCLUDE_PATH}) - endif () - - if (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB) - set(X11_Xscreensaver_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xscreensaver_INCLUDE_PATH}) - endif () - - if (X11_dpms_INCLUDE_PATH) - set(X11_dpms_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_dpms_INCLUDE_PATH}) - endif () - - if (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH) - set(X11_Xkb_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} ) - endif () - - if (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH) - set(X11_Xkbfile_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} ) - endif () - - if (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB) - set(X11_Xmu_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH}) - endif () - - if (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB) - set(X11_Xinput_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH}) - endif () - - if (X11_XSync_INCLUDE_PATH) - set(X11_XSync_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH}) - endif () - - if(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH) - set(X11_ICE_FOUND TRUE) - endif() - - if(X11_SM_LIB AND X11_SM_INCLUDE_PATH) - set(X11_SM_FOUND TRUE) - endif() - - if(X11_xcb_LIB AND X11_xcb_INCLUDE_PATH) - set(X11_xcb_FOUND TRUE) - endif() - - # Most of the X11 headers will be in the same directories, avoid - # creating a huge list of duplicates. - if (X11_INCLUDE_DIR) - list(REMOVE_DUPLICATES X11_INCLUDE_DIR) - endif () - - # Deprecated variable for backwards compatibility with CMake 1.4 - if (X11_X11_INCLUDE_PATH AND X11_LIBRARIES) - set(X11_FOUND 1) - endif () - - if(X11_FOUND) - include(/usr/share/cmake28/Modules/CheckFunctionExists.cmake) - include(/usr/share/cmake28/Modules/CheckLibraryExists.cmake) - - # Translated from an autoconf-generated configure script. - # See libs.m4 in autoconf's m4 directory. - if($ENV{ISC} MATCHES "^yes$") - set(X11_X_EXTRA_LIBS -lnsl_s -linet) - else() - set(X11_X_EXTRA_LIBS "-Wl,-Bdynamic -ldl") - - # See if XOpenDisplay in X11 works by itself. - CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO) - if(NOT X11_LIB_X11_SOLO) - # Find library needed for dnet_ntoa. - CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA) - if (X11_LIB_DNET_HAS_DNET_NTOA) - set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet) - else () - CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA) - if (X11_LIB_DNET_STUB_HAS_DNET_NTOA) - set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub) - endif () - endif () - endif() - - # Find library needed for gethostbyname. - CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME) - if(NOT CMAKE_HAVE_GETHOSTBYNAME) - CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) - if (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) - set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl) - else () - CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) - if (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) - set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd) - endif () - endif () - endif() - - # Find library needed for connect. - CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT) - if(NOT CMAKE_HAVE_CONNECT) - CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT) - if (CMAKE_LIB_SOCKET_HAS_CONNECT) - set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS}) - endif () - endif() - - # Find library needed for remove. - CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE) - if(NOT CMAKE_HAVE_REMOVE) - CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE) - if (CMAKE_LIB_POSIX_HAS_REMOVE) - set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix) - endif () - endif() - - # Find library needed for shmat. - CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT) - if(NOT CMAKE_HAVE_SHMAT) - CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT) - if (CMAKE_LIB_IPS_HAS_SHMAT) - set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc) - endif () - endif() - endif() - - if (X11_ICE_FOUND) - CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}" - CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER) - if(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER) - set (X11_X_PRE_LIBS ${X11_ICE_LIB}) - if(X11_SM_LIB) - set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS}) - endif() - endif() - endif () - - # Build the final list of libraries. - set(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS}) - - include(/usr/share/cmake28/Modules/FindPackageMessage.cmake) - FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}" - "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]") - else () - if (X11_FIND_REQUIRED) - message(FATAL_ERROR "Could not find X11") - endif () - endif () - - mark_as_advanced( - X11_X11_INCLUDE_PATH - X11_X11_LIB - X11_Xext_LIB - X11_Xau_LIB - X11_Xau_INCLUDE_PATH - X11_Xlib_INCLUDE_PATH - X11_Xutil_INCLUDE_PATH - X11_Xcomposite_INCLUDE_PATH - X11_Xcomposite_LIB - X11_Xaccess_INCLUDE_PATH - X11_Xfixes_LIB - X11_Xfixes_INCLUDE_PATH - X11_Xrandr_LIB - X11_Xrandr_INCLUDE_PATH - X11_Xdamage_LIB - X11_Xdamage_INCLUDE_PATH - X11_Xrender_LIB - X11_Xrender_INCLUDE_PATH - X11_XRes_LIB - X11_XRes_INCLUDE_PATH - X11_Xxf86misc_LIB - X11_xf86misc_INCLUDE_PATH - X11_Xxf86vm_LIB - X11_xf86vmode_INCLUDE_PATH - X11_Xi_LIB - X11_Xi_INCLUDE_PATH - X11_Xinerama_LIB - X11_Xinerama_INCLUDE_PATH - X11_XTest_LIB - X11_XTest_INCLUDE_PATH - X11_Xcursor_LIB - X11_Xcursor_INCLUDE_PATH - X11_dpms_INCLUDE_PATH - X11_Xt_LIB - X11_Xt_INCLUDE_PATH - X11_Xdmcp_LIB - X11_LIBRARIES - X11_Xaccessrules_INCLUDE_PATH - X11_Xaccessstr_INCLUDE_PATH - X11_Xdmcp_INCLUDE_PATH - X11_Xkb_INCLUDE_PATH - X11_Xkblib_INCLUDE_PATH - X11_Xkbfile_INCLUDE_PATH - X11_Xkbfile_LIB - X11_Xmu_INCLUDE_PATH - X11_Xmu_LIB - X11_Xscreensaver_INCLUDE_PATH - X11_Xscreensaver_LIB - X11_Xpm_INCLUDE_PATH - X11_Xpm_LIB - X11_Xinput_LIB - X11_Xinput_INCLUDE_PATH - X11_Xft_LIB - X11_Xft_INCLUDE_PATH - X11_Xshape_INCLUDE_PATH - X11_Xv_LIB - X11_Xv_INCLUDE_PATH - X11_XShm_INCLUDE_PATH - X11_ICE_LIB - X11_ICE_INCLUDE_PATH - X11_SM_LIB - X11_SM_INCLUDE_PATH - X11_xcb_LIB - X11_xcb_INCLUDE_PATH - X11_XSync_INCLUDE_PATH - ) - set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE}) -endif () - -# X11_FIND_REQUIRED_<component> could be checked too diff --git a/contrib/packages/rpm/el5/SOURCES/fltk-1.3.3-static-libs.patch b/contrib/packages/rpm/el5/SOURCES/fltk-1.3.3-static-libs.patch deleted file mode 100644 index f26b31d9..00000000 --- a/contrib/packages/rpm/el5/SOURCES/fltk-1.3.3-static-libs.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/configure 2015-02-22 16:20:48.000000000 -0500 -+++ b/configure 2015-02-22 16:21:52.000000000 -0500 -@@ -6793,7 +6793,7 @@ - # See if we find them without any special options. - # Don't add to $LIBS permanently. - ac_save_LIBS=$LIBS -- LIBS="-lX11 $LIBS" -+ LIBS="-lX11 -lfreetype -lexpat -lXext -lXrender -lxcb -lXdmcp -lXau -lz $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include <X11/Xlib.h> -@@ -6935,7 +6935,7 @@ - # Martyn Johnson says this is needed for Ultrix, if the X - # libraries were built with DECnet support. And Karl Berry says - # the Alpha needs dnet_stub (dnet does not exist). -- ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" -+ ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lfreetype -lexpat -lX11 -lXext -lXrender -lxcb -lXdmcp -lXau -lz" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -7359,7 +7359,7 @@ - $as_echo "$as_me: WARNING: Ignoring libraries \"$X_PRE_LIBS\" requested by configure." >&2;} - fi - -- LIBS="$LIBS -lX11 $X_EXTRA_LIBS" -+ LIBS="$LIBS -lfreetype -lexpat -lX11 -lXext -lXrender -lxcb -lXdmcp -lXau -lz $X_EXTRA_LIBS" - CFLAGS="$CFLAGS $X_CFLAGS" - CXXFLAGS="$CXXFLAGS $X_CFLAGS" - LDFLAGS="$X_LIBS $LDFLAGS" diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.1.10-enable-ft2-bci.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.1.10-enable-ft2-bci.patch deleted file mode 100644 index b1766a0c..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.1.10-enable-ft2-bci.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- freetype-2.1.10/include/freetype/config/ftoption.h.enable-ft2-bci 2005-10-12 13:50:40.000000000 -0400 -+++ freetype-2.1.10/include/freetype/config/ftoption.h 2005-10-12 14:18:50.000000000 -0400 -@@ -436,7 +436,7 @@ - /* Do not #undef this macro here, since the build system might */ - /* define it for certain configurations only. */ - /* */ --/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ -+#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER - - - /*************************************************************************/ diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.2.1-enable-valid.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.2.1-enable-valid.patch deleted file mode 100644 index c78b6b70..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.2.1-enable-valid.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- freetype-2.2.1/modules.cfg.orig 2006-07-07 21:01:09.000000000 -0400 -+++ freetype-2.2.1/modules.cfg 2006-07-07 21:01:54.000000000 -0400 -@@ -110,7 +110,7 @@ - AUX_MODULES += cache - - # TrueType GX/AAT table validation. Needs ftgxval.c below. --# AUX_MODULES += gxvalid -+AUX_MODULES += gxvalid - - # Support for streams compressed with gzip (files with suffix .gz). - # -@@ -124,7 +124,7 @@ - - # OpenType table validation. Needs ftotval.c below. - # --# AUX_MODULES += otvalid -+AUX_MODULES += otvalid - - # Auxiliary PostScript driver component to share common code. - # diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.0-enable-spr.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.0-enable-spr.patch deleted file mode 100644 index 8432e28a..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.0-enable-spr.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- freetype-2.3.0/include/freetype/config/ftoption.h.spf 2007-01-18 14:27:34.000000000 -0500 -+++ freetype-2.3.0/include/freetype/config/ftoption.h 2007-01-18 14:27:48.000000000 -0500 -@@ -92,7 +92,7 @@ - /* This is done to allow FreeType clients to run unmodified, forcing */ - /* them to display normal gray-level anti-aliased glyphs. */ - /* */ --/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ -+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING - - - /*************************************************************************/ diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-1797.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-1797.patch deleted file mode 100644 index c2d79d1d..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-1797.patch +++ /dev/null @@ -1,101 +0,0 @@ ---- freetype-2.3.11/src/cff/cffgload.c.CVE-2010-1797-2 2009-09-10 17:52:21.000000000 +0200 -+++ freetype-2.3.11/src/cff/cffgload.c 2010-08-11 13:39:32.000000000 +0200 -@@ -2358,8 +2358,11 @@ - return CFF_Err_Unimplemented_Feature; - } - -- decoder->top = args; -+ decoder->top = args; - -+ if ( decoder->top - stack >= CFF_MAX_OPERANDS ) -+ goto Stack_Overflow; -+ - } /* general operator processing */ - - } /* while ip < limit */ -@@ -2627,48 +2630,54 @@ - /* now load the unscaled outline */ - error = cff_get_glyph_data( face, glyph_index, - &charstring, &charstring_len ); -- if ( !error ) -- { -- error = cff_decoder_prepare( &decoder, size, glyph_index ); -- if ( !error ) -- { -- error = cff_decoder_parse_charstrings( &decoder, -- charstring, -- charstring_len ); -+ if ( error ) -+ goto Glyph_Build_Finished; -+ -+ error = cff_decoder_prepare( &decoder, size, glyph_index ); -+ if ( error ) -+ goto Glyph_Build_Finished; - -- cff_free_glyph_data( face, &charstring, charstring_len ); -+ error = cff_decoder_parse_charstrings( &decoder, -+ charstring, -+ charstring_len ); -+ -+ cff_free_glyph_data( face, &charstring, charstring_len ); -+ -+ if ( error ) -+ goto Glyph_Build_Finished; - - - #ifdef FT_CONFIG_OPTION_INCREMENTAL -- /* Control data and length may not be available for incremental */ -- /* fonts. */ -- if ( face->root.internal->incremental_interface ) -- { -- glyph->root.control_data = 0; -- glyph->root.control_len = 0; -- } -- else -+ /* Control data and length may not be available for incremental */ -+ /* fonts. */ -+ if ( face->root.internal->incremental_interface ) -+ { -+ glyph->root.control_data = 0; -+ glyph->root.control_len = 0; -+ } -+ else - #endif /* FT_CONFIG_OPTION_INCREMENTAL */ - -- /* We set control_data and control_len if charstrings is loaded. */ -- /* See how charstring loads at cff_index_access_element() in */ -- /* cffload.c. */ -- { -- CFF_Index csindex = &cff->charstrings_index; -+ /* We set control_data and control_len if charstrings is loaded. */ -+ /* See how charstring loads at cff_index_access_element() in */ -+ /* cffload.c. */ -+ { -+ CFF_Index csindex = &cff->charstrings_index; - - -- if ( csindex->offsets ) -- { -- glyph->root.control_data = csindex->bytes + -- csindex->offsets[glyph_index] - 1; -- glyph->root.control_len = charstring_len; -- } -- } -+ if ( csindex->offsets ) -+ { -+ glyph->root.control_data = csindex->bytes + -+ csindex->offsets[glyph_index] - 1; -+ glyph->root.control_len = charstring_len; - } - } - -- /* save new glyph tables */ -- cff_builder_done( &decoder.builder ); -+ Glyph_Build_Finished: -+ /* save new glyph tables, if no error */ -+ if ( !error ) -+ cff_builder_done( &decoder.builder ); -+ /* XXX: anything to do for broken glyph entry? */ - } - - #ifdef FT_CONFIG_OPTION_INCREMENTAL diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2498.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2498.patch deleted file mode 100644 index fede8423..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2498.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- freetype-2.3.11/src/pshinter/pshalgo.c 2009-07-03 15:28:24.000000000 +0200 -+++ freetype-2.3.11/src/pshinter/pshalgo.c 2010-07-13 13:14:22.000000000 +0200 -@@ -4,7 +4,8 @@ - /* */ - /* PostScript hinting algorithm (body). */ - /* */ --/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ -+/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 */ -+/* by */ - /* David Turner, Robert Wilhelm, and Werner Lemberg. */ - /* */ - /* This file is part of the FreeType project, and may only be used */ -@@ -1690,7 +1691,10 @@ - /* process secondary hints to `selected' points */ - if ( num_masks > 1 && glyph->num_points > 0 ) - { -- first = mask->end_point; -+ /* the `endchar' op can reduce the number of points */ -+ first = mask->end_point > glyph->num_points -+ ? glyph->num_points -+ : mask->end_point; - mask++; - for ( ; num_masks > 1; num_masks--, mask++ ) - { -@@ -1698,7 +1702,9 @@ - FT_Int count; - - -- next = mask->end_point; -+ next = mask->end_point > glyph->num_points -+ ? glyph->num_points -+ : mask->end_point; - count = next - first; - if ( count > 0 ) - { diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2499.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2499.patch deleted file mode 100644 index 5455fa04..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2499.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- freetype-2.3.11/src/base/ftobjs.c 2009-09-02 08:42:41.000000000 +0200 -+++ freetype-2.3.11/src/base/ftobjs.c 2010-07-12 16:39:13.000000000 +0200 -@@ -1531,6 +1531,8 @@ - len += rlen; - else - { -+ if ( pfb_lenpos + 3 > pfb_len + 2 ) -+ goto Exit2; - pfb_data[pfb_lenpos ] = (FT_Byte)( len ); - pfb_data[pfb_lenpos + 1] = (FT_Byte)( len >> 8 ); - pfb_data[pfb_lenpos + 2] = (FT_Byte)( len >> 16 ); -@@ -1539,6 +1541,8 @@ - if ( ( flags >> 8 ) == 5 ) /* End of font mark */ - break; - -+ if ( pfb_pos + 6 > pfb_len + 2 ) -+ goto Exit2; - pfb_data[pfb_pos++] = 0x80; - - type = flags >> 8; -@@ -1553,12 +1557,18 @@ - } - - error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen ); -+ if ( error ) -+ goto Exit2; - pfb_pos += rlen; - } - -+ if ( pfb_pos + 2 > pfb_len + 2 ) -+ goto Exit2; - pfb_data[pfb_pos++] = 0x80; - pfb_data[pfb_pos++] = 3; - -+ if ( pfb_lenpos + 3 > pfb_len + 2 ) -+ goto Exit2; - pfb_data[pfb_lenpos ] = (FT_Byte)( len ); - pfb_data[pfb_lenpos + 1] = (FT_Byte)( len >> 8 ); - pfb_data[pfb_lenpos + 2] = (FT_Byte)( len >> 16 ); diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2500.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2500.patch deleted file mode 100644 index afc906d8..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2500.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- freetype-2.3.11/src/smooth/ftgrays.c 2009-07-31 18:45:19.000000000 +0200 -+++ freetype-2.3.11/src/smooth/ftgrays.c 2010-07-13 10:26:58.000000000 +0200 -@@ -1189,7 +1189,7 @@ - /* first of all, compute the scanline offset */ - p = (unsigned char*)map->buffer - y * map->pitch; - if ( map->pitch >= 0 ) -- p += ( map->rows - 1 ) * map->pitch; -+ p += (unsigned)( ( map->rows - 1 ) * map->pitch ); - - for ( ; count > 0; count--, spans++ ) - { ---- freetype-2.3.11/src/smooth/ftsmooth.c 2009-07-31 18:45:19.000000000 +0200 -+++ freetype-2.3.11/src/smooth/ftsmooth.c 2010-07-13 10:26:58.000000000 +0200 -@@ -4,7 +4,7 @@ - /* */ - /* Anti-aliasing renderer interface (body). */ - /* */ --/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009 by */ -+/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by */ - /* David Turner, Robert Wilhelm, and Werner Lemberg. */ - /* */ - /* This file is part of the FreeType project, and may only be used, */ -@@ -200,7 +200,7 @@ - - /* Required check is ( pitch * height < FT_ULONG_MAX ), */ - /* but we care realistic cases only. Always pitch <= width. */ -- if ( width > 0xFFFFU || height > 0xFFFFU ) -+ if ( width > 0x7FFFU || height > 0x7FFFU ) - { - FT_ERROR(( "ft_smooth_render_generic: glyph too large: %d x %d\n", - width, height )); diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2519.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2519.patch deleted file mode 100644 index 49a639c1..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2519.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- freetype-2.3.11/src/base/ftobjs.c 2010-07-12 17:03:47.000000000 +0200 -+++ freetype-2.3.11/src/base/ftobjs.c 2010-07-12 17:07:06.000000000 +0200 -@@ -1526,7 +1526,19 @@ - goto Exit; - if ( FT_READ_USHORT( flags ) ) - goto Exit; -- rlen -= 2; /* the flags are part of the resource */ -+ FT_TRACE3(( "POST fragment[%d]: offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n", -+ i, offsets[i], rlen, flags )); -+ -+ if ( ( flags >> 8 ) == 0 ) /* Comment, should not be loaded */ -+ continue; -+ -+ /* the flags are part of the resource, so rlen >= 2. */ -+ /* but some fonts declare rlen = 0 for empty fragment */ -+ if ( rlen > 2 ) -+ rlen -= 2; -+ else -+ rlen = 0; -+ - if ( ( flags >> 8 ) == type ) - len += rlen; - else diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2520.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2520.patch deleted file mode 100644 index 32cd3d8e..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2520.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- freetype-2.3.11/src/truetype/ttinterp.c 2009-07-31 18:45:19.000000000 +0200 -+++ freetype-2.3.11/src/truetype/ttinterp.c 2010-07-15 14:44:23.000000000 +0200 -@@ -6466,8 +6466,8 @@ - end_point = CUR.pts.contours[contour] - CUR.pts.first_point; - first_point = point; - -- if ( CUR.pts.n_points <= end_point ) -- end_point = CUR.pts.n_points; -+ if ( BOUNDS ( end_point, CUR.pts.n_points ) ) -+ end_point = CUR.pts.n_points - 1; - - while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) - point++; diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2527.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2527.patch deleted file mode 100644 index ed7ed1e2..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2527.patch +++ /dev/null @@ -1,154 +0,0 @@ ---- freetype-2.3.11/ft2demos-2.3.11/src/ftdiff.c 2009-04-30 18:07:48.000000000 +0200 -+++ freetype-2.3.11/ft2demos-2.3.11/src/ftdiff.c 2010-07-22 18:18:06.000000000 +0200 -@@ -1054,11 +1054,11 @@ - - state->message = state->message0; - if ( total > 1 ) -- sprintf( state->message0, "%s %d/%d @ %5.1fpt", -+ sprintf( state->message0, "%.100s %d/%d @ %5.1fpt", - state->filename, idx + 1, total, - state->char_size ); - else -- sprintf( state->message0, "%s @ %5.1fpt", -+ sprintf( state->message0, "%.100s @ %5.1fpt", - state->filename, - state->char_size ); - } ---- freetype-2.3.11/ft2demos-2.3.11/src/ftgrid.c 2009-04-30 18:15:21.000000000 +0200 -+++ freetype-2.3.11/ft2demos-2.3.11/src/ftgrid.c 2010-07-22 18:18:06.000000000 +0200 -@@ -2,7 +2,7 @@ - /* */ - /* The FreeType project -- a free and portable quality TrueType renderer. */ - /* */ --/* Copyright 1996-2000, 2003, 2004, 2005, 2006, 2007, 2009 by */ -+/* Copyright 1996-2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ - /* D. Turner, R.Wilhelm, and W. Lemberg */ - /* */ - /* */ -@@ -787,22 +787,22 @@ grid_status_draw_outline( GridStatus - switch ( error_code ) - { - case FT_Err_Ok: -- sprintf( status.header_buffer, "%s %s (file `%s')", -+ sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", - face->family_name, face->style_name, basename ); - break; - - case FT_Err_Invalid_Pixel_Size: -- sprintf( status.header_buffer, "Invalid pixel size (file `%s')", -+ sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", - basename ); - break; - - case FT_Err_Invalid_PPem: -- sprintf( status.header_buffer, "Invalid ppem value (file `%s')", -+ sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", - basename ); - break; - - default: -- sprintf( status.header_buffer, "File `%s': error 0x%04x", -+ sprintf( status.header_buffer, "File `%.100s': error 0x%04x", - basename, (FT_UShort)error_code ); - break; - } ---- freetype-2.3.11/ft2demos-2.3.11/src/ftmulti.c 2009-03-14 14:58:28.000000000 +0100 -+++ freetype-2.3.11/ft2demos-2.3.11/src/ftmulti.c 2010-07-22 18:18:39.000000000 +0200 -@@ -2,7 +2,7 @@ - /* */ - /* The FreeType project -- a free and portable quality TrueType renderer. */ - /* */ --/* Copyright 1996-2000, 2003, 2004, 2005 by */ -+/* Copyright 1996-2000, 2003, 2004, 2005, 2010 by */ - /* D. Turner, R.Wilhelm, and W. Lemberg */ - /* */ - /* */ -@@ -34,7 +34,7 @@ - - #define MAXPTSIZE 500 /* dtp */ - -- char Header[128]; -+ char Header[256]; - char* new_header = 0; - - const unsigned char* Text = (unsigned char*) -@@ -795,7 +795,7 @@ - Render_All( Num, ptsize ); - } - -- sprintf( Header, "%s %s (file %s)", -+ sprintf( Header, "%.50s %.50s (file %.100s)", - face->family_name, - face->style_name, - ft_basename( argv[file] ) ); -@@ -830,7 +830,7 @@ - } - else - { -- sprintf( Header, "%s: not an MM font file, or could not be opened", -+ sprintf( Header, "%.100s: not an MM font file, or could not be opened", - ft_basename( argv[file] ) ); - } - ---- freetype-2.3.11/ft2demos-2.3.11/src/ftstring.c 2009-03-14 14:58:28.000000000 +0100 -+++ freetype-2.3.11/ft2demos-2.3.11/src/ftstring.c 2010-07-22 18:18:06.000000000 +0200 -@@ -2,7 +2,7 @@ - /* */ - /* The FreeType project -- a free and portable quality TrueType renderer. */ - /* */ --/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ -+/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ - /* D. Turner, R.Wilhelm, and W. Lemberg */ - /* */ - /* */ -@@ -413,19 +413,20 @@ - switch ( error_code ) - { - case FT_Err_Ok: -- sprintf( status.header_buffer, "%s %s (file `%s')", face->family_name, -+ sprintf( status.header_buffer, -+ "%.50s %.50s (file `%.100s')", face->family_name, - face->style_name, basename ); - break; - case FT_Err_Invalid_Pixel_Size: -- sprintf( status.header_buffer, "Invalid pixel size (file `%s')", -+ sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", - basename ); - break; - case FT_Err_Invalid_PPem: -- sprintf( status.header_buffer, "Invalid ppem value (file `%s')", -+ sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", - basename ); - break; - default: -- sprintf( status.header_buffer, "File `%s': error 0x%04x", basename, -+ sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename, - (FT_UShort)error_code ); - break; - } ---- freetype-2.3.11/ft2demos-2.3.11/src/ftview.c 2009-04-30 20:08:25.000000000 +0200 -+++ freetype-2.3.11/ft2demos-2.3.11/src/ftview.c 2010-07-22 18:18:06.000000000 +0200 -@@ -1086,19 +1086,19 @@ - switch ( error_code ) - { - case FT_Err_Ok: -- sprintf( status.header_buffer, "%s %s (file `%s')", -+ sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')", - face->family_name, face->style_name, basename ); - break; - case FT_Err_Invalid_Pixel_Size: -- sprintf( status.header_buffer, "Invalid pixel size (file `%s')", -+ sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')", - basename ); - break; - case FT_Err_Invalid_PPem: -- sprintf( status.header_buffer, "Invalid ppem value (file `%s')", -+ sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')", - basename ); - break; - default: -- sprintf( status.header_buffer, "File `%s': error 0x%04x", -+ sprintf( status.header_buffer, "File `%.100s': error 0x%04x", - basename, (FT_UShort)error_code ); - break; - } diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2805.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2805.patch deleted file mode 100644 index 74ff6be9..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2805.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- freetype-2.3.11/src/base/ftstream.c 2009-08-03 19:51:40.000000000 +0200 -+++ freetype-2.3.11/src/base/ftstream.c 2010-09-30 13:46:08.000000000 +0200 -@@ -275,7 +275,7 @@ - { - /* check current and new position */ - if ( stream->pos >= stream->size || -- stream->pos + count > stream->size ) -+ stream->size - stream->pos < count ) - { - FT_ERROR(( "FT_Stream_EnterFrame:" - " invalid i/o; pos = 0x%lx, count = %lu, size = 0x%lx\n", diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2806.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2806.patch deleted file mode 100644 index 564d6d3a..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2806.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- freetype-2.3.11/src/type42/t42parse.c 2009-07-03 15:28:24.000000000 +0200 -+++ freetype-2.3.11/src/type42/t42parse.c 2010-09-23 12:15:56.000000000 +0200 -@@ -4,7 +4,7 @@ - /* */ - /* Type 42 font parser (body). */ - /* */ --/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ -+/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */ - /* Roberto Alameda. */ - /* */ - /* This file is part of the FreeType project, and may only be used, */ -@@ -575,6 +575,12 @@ - } - - string_size = T1_ToInt( parser ); -+ if ( string_size < 0 ) -+ { -+ FT_ERROR(( "t42_parse_sfnts: invalid string size\n" )); -+ error = T42_Err_Invalid_File_Format; -+ goto Fail; -+ } - - T1_Skip_PS_Token( parser ); /* `RD' */ - if ( parser->root.error ) -@@ -582,13 +588,14 @@ - - string_buf = parser->root.cursor + 1; /* one space after `RD' */ - -- parser->root.cursor += string_size + 1; -- if ( parser->root.cursor >= limit ) -+ if ( limit - parser->root.cursor < string_size ) - { - FT_ERROR(( "t42_parse_sfnts: too many binary data\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } -+ else -+ parser->root.cursor += string_size + 1; - } - - if ( !string_buf ) diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2808.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2808.patch deleted file mode 100644 index a68a06fe..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-2808.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- freetype-2.3.11/src/base/ftobjs.c 2010-09-30 13:58:50.000000000 +0200 -+++ freetype-2.3.11/src/base/ftobjs.c 2010-09-30 13:59:31.000000000 +0200 -@@ -1529,6 +1529,7 @@ - FT_TRACE3(( "POST fragment[%d]: offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n", - i, offsets[i], rlen, flags )); - -+ /* postpone the check of rlen longer than buffer until FT_Stream_Read() */ - if ( ( flags >> 8 ) == 0 ) /* Comment, should not be loaded */ - continue; - -@@ -1568,6 +1569,10 @@ - pfb_data[pfb_pos++] = 0; - } - -+ error = FT_Err_Cannot_Open_Resource; -+ if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len ) -+ goto Exit2; -+ - error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen ); - if ( error ) - goto Exit2; diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-3311.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-3311.patch deleted file mode 100644 index 36455910..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-3311.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- freetype-2.3.11/src/base/ftstream.c 2010-09-30 14:12:38.000000000 +0200 -+++ freetype-2.3.11/src/base/ftstream.c 2010-09-30 14:12:59.000000000 +0200 -@@ -59,8 +59,17 @@ - { - FT_Error error = FT_Err_Ok; - -+ /* note that seeking to the first position after the file is valid */ -+ if ( pos > stream->size ) -+ { -+ FT_ERROR(( "FT_Stream_Seek:" -+ " invalid i/o; pos = 0x%lx, size = 0x%lx\n", -+ pos, stream->size )); - -- if ( stream->read ) -+ error = FT_Err_Invalid_Stream_Operation; -+ } -+ -+ if ( !error && stream->read ) - { - if ( stream->read( stream, pos, 0, 0 ) ) - { -@@ -71,15 +80,6 @@ - error = FT_Err_Invalid_Stream_Operation; - } - } -- /* note that seeking to the first position after the file is valid */ -- else if ( pos > stream->size ) -- { -- FT_ERROR(( "FT_Stream_Seek:" -- " invalid i/o; pos = 0x%lx, size = 0x%lx\n", -- pos, stream->size )); -- -- error = FT_Err_Invalid_Stream_Operation; -- } - - if ( !error ) - stream->pos = pos; diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-3855.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-3855.patch deleted file mode 100644 index 31c61443..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2010-3855.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- freetype-2.3.11/src/truetype/ttgxvar.c.orig 2009-07-31 18:45:19.000000000 +0200 -+++ freetype-2.3.11/src/truetype/ttgxvar.c 2010-10-22 08:52:37.000000000 +0200 -@@ -157,7 +157,7 @@ - runcnt = runcnt & GX_PT_POINT_RUN_COUNT_MASK; - first = points[i++] = FT_GET_USHORT(); - -- if ( runcnt < 1 ) -+ if ( runcnt < 1 || i + runcnt >= n ) - goto Exit; - - /* first point not included in runcount */ -@@ -168,7 +168,7 @@ - { - first = points[i++] = FT_GET_BYTE(); - -- if ( runcnt < 1 ) -+ if ( runcnt < 1 || i + runcnt >= n ) - goto Exit; - - for ( j = 0; j < runcnt; ++j ) diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2011-0226.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2011-0226.patch deleted file mode 100644 index d610b90f..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2011-0226.patch +++ /dev/null @@ -1,108 +0,0 @@ ---- freetype-2.3.11/src/psaux/t1decode.c 2009-09-29 19:51:31.000000000 +0200 -+++ freetype-2.3.11/src/psaux/t1decode.c 2011-07-20 14:39:24.000000000 +0200 -@@ -4,7 +4,7 @@ - /* */ - /* PostScript Type 1 decoding routines (body). */ - /* */ --/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ -+/* Copyright 2000-2011 by */ - /* David Turner, Robert Wilhelm, and Werner Lemberg. */ - /* */ - /* This file is part of the FreeType project, and may only be used, */ -@@ -27,6 +27,8 @@ - - #include "psauxerr.h" - -+/* ensure proper sign extension */ -+#define Fix2Int( f ) ( (FT_Int)(FT_Short)( (f) >> 16 ) ) - - /*************************************************************************/ - /* */ -@@ -665,7 +667,7 @@ - if ( large_int ) - FT_TRACE4(( " %ld", value )); - else -- FT_TRACE4(( " %ld", (FT_Int32)( value >> 16 ) )); -+ FT_TRACE4(( " %ld", Fix2Int( value ) )); - #endif - - *top++ = value; -@@ -687,8 +689,8 @@ - - top -= 2; - -- subr_no = (FT_Int)( top[1] >> 16 ); -- arg_cnt = (FT_Int)( top[0] >> 16 ); -+ subr_no = Fix2Int( top[1] ); -+ arg_cnt = Fix2Int( top[0] ); - - /***********************************************************/ - /* */ -@@ -861,7 +863,7 @@ - if ( arg_cnt != 1 || blend == NULL ) - goto Unexpected_OtherSubr; - -- idx = (FT_Int)( top[0] >> 16 ); -+ idx = Fix2Int( top[0] ); - - if ( idx < 0 || - idx + blend->num_designs > decoder->len_buildchar ) -@@ -929,7 +931,7 @@ - if ( arg_cnt != 2 || blend == NULL ) - goto Unexpected_OtherSubr; - -- idx = (FT_Int)( top[1] >> 16 ); -+ idx = Fix2Int( top[1] ); - - if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar ) - goto Unexpected_OtherSubr; -@@ -950,7 +952,7 @@ - if ( arg_cnt != 1 || blend == NULL ) - goto Unexpected_OtherSubr; - -- idx = (FT_Int)( top[0] >> 16 ); -+ idx = Fix2Int( top[0] ); - - if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar ) - goto Unexpected_OtherSubr; -@@ -1008,11 +1010,15 @@ - break; - - default: -- FT_ERROR(( "t1_decoder_parse_charstrings:" -- " unknown othersubr [%d %d], wish me luck\n", -- arg_cnt, subr_no )); -- unknown_othersubr_result_cnt = arg_cnt; -- break; -+ if ( arg_cnt >= 0 && subr_no >= 0 ) -+ { -+ FT_ERROR(( "t1_decoder_parse_charstrings:" -+ " unknown othersubr [%d %d], wish me luck\n", -+ arg_cnt, subr_no )); -+ unknown_othersubr_result_cnt = arg_cnt; -+ break; -+ } -+ /* fall through */ - - Unexpected_OtherSubr: - FT_ERROR(( "t1_decoder_parse_charstrings:" -@@ -1138,8 +1144,8 @@ - top[0], - top[1], - top[2], -- (FT_Int)( top[3] >> 16 ), -- (FT_Int)( top[4] >> 16 ) ); -+ Fix2Int( top[3] ), -+ Fix2Int( top[4] ) ); - - case op_sbw: - FT_TRACE4(( " sbw" )); -@@ -1313,7 +1319,7 @@ - - FT_TRACE4(( " callsubr" )); - -- idx = (FT_Int)( top[0] >> 16 ); -+ idx = Fix2Int( top[0] ); - if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs ) - { - FT_ERROR(( "t1_decoder_parse_charstrings:" diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2011-3256.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2011-3256.patch deleted file mode 100644 index d81f442d..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2011-3256.patch +++ /dev/null @@ -1,92 +0,0 @@ ---- freetype-2.3.11/src/base/ftbitmap.c 2009-07-31 18:45:18.000000000 +0200 -+++ freetype-2.3.11/src/base/ftbitmap.c 2011-10-19 12:25:26.000000000 +0200 -@@ -4,7 +4,7 @@ - /* */ - /* FreeType utility functions for bitmaps (body). */ - /* */ --/* Copyright 2004, 2005, 2006, 2007, 2008, 2009 by */ -+/* Copyright 2004-2009, 2011 by */ - /* David Turner, Robert Wilhelm, and Werner Lemberg. */ - /* */ - /* This file is part of the FreeType project, and may only be used, */ -@@ -417,6 +417,10 @@ - - target->pitch = source->width + pad; - -+ if ( target->pitch > 0 && -+ target->rows > FT_ULONG_MAX / target->pitch ) -+ return FT_Err_Invalid_Argument; -+ - if ( target->rows * target->pitch > old_size && - FT_QREALLOC( target->buffer, - old_size, target->rows * target->pitch ) ) ---- freetype-2.3.11/src/psaux/t1decode.c 2011-10-19 12:25:26.000000000 +0200 -+++ freetype-2.3.11/src/psaux/t1decode.c 2011-10-19 12:25:26.000000000 +0200 -@@ -748,6 +748,13 @@ - if ( arg_cnt != 0 ) - goto Unexpected_OtherSubr; - -+ if ( decoder->flex_state == 0 ) -+ { -+ FT_ERROR(( "t1_decoder_parse_charstrings:" -+ " missing flex start\n" )); -+ goto Syntax_Error; -+ } -+ - /* note that we should not add a point for index 0; */ - /* this will move our current position to the flex */ - /* point without adding any point to the outline */ ---- freetype-2.3.11/src/raster/ftrend1.c 2009-07-03 15:28:24.000000000 +0200 -+++ freetype-2.3.11/src/raster/ftrend1.c 2011-10-19 13:26:02.000000000 +0200 -@@ -4,7 +4,7 @@ - /* */ - /* The FreeType glyph rasterizer interface (body). */ - /* */ --/* Copyright 1996-2001, 2002, 2003, 2005, 2006 by */ -+/* Copyright 1996-2003, 2005, 2006, 2011 by */ - /* David Turner, Robert Wilhelm, and Werner Lemberg. */ - /* */ - /* This file is part of the FreeType project, and may only be used, */ -@@ -25,6 +25,7 @@ - - #include "rasterrs.h" - -+#define FT_USHORT_MAX USHRT_MAX - - /* initialize renderer -- init its raster */ - static FT_Error -@@ -168,6 +169,13 @@ - - width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 ); - height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 ); -+ -+ if ( width > FT_USHORT_MAX || height > FT_USHORT_MAX ) -+ { -+ error = Raster_Err_Invalid_Argument; -+ goto Exit; -+ } -+ - bitmap = &slot->bitmap; - memory = render->root.memory; - ---- freetype-2.3.11/src/truetype/ttgxvar.c 2011-10-19 12:25:26.000000000 +0200 -+++ freetype-2.3.11/src/truetype/ttgxvar.c 2011-10-19 12:25:26.000000000 +0200 -@@ -4,7 +4,7 @@ - /* */ - /* TrueType GX Font Variation loader */ - /* */ --/* Copyright 2004, 2005, 2006, 2007, 2008, 2009 by */ -+/* Copyright 2004-2011 by */ - /* David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. */ - /* */ - /* This file is part of the FreeType project, and may only be used, */ -@@ -1473,6 +1473,9 @@ - { - for ( j = 0; j < point_count; ++j ) - { -+ if ( localpoints[j] >= n_points ) -+ continue; -+ - delta_xy[localpoints[j]].x += FT_MulFix( deltas_x[j], apply ); - delta_xy[localpoints[j]].y += FT_MulFix( deltas_y[j], apply ); - } diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2011-3439.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2011-3439.patch deleted file mode 100644 index ee365b25..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2011-3439.patch +++ /dev/null @@ -1,76 +0,0 @@ ---- freetype-2.3.11/src/cid/cidload.c 2009-07-03 15:28:24.000000000 +0200 -+++ freetype-2.3.11/src/cid/cidload.c 2011-11-15 12:58:41.000000000 +0100 -@@ -4,7 +4,7 @@ - /* */ - /* CID-keyed Type1 font loader (body). */ - /* */ --/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2009 by */ -+/* Copyright 1996-2006, 2009, 2011 by */ - /* David Turner, Robert Wilhelm, and Werner Lemberg. */ - /* */ - /* This file is part of the FreeType project, and may only be used, */ -@@ -110,7 +110,7 @@ - CID_FaceDict dict; - - -- if ( parser->num_dict < 0 ) -+ if ( parser->num_dict < 0 || parser->num_dict >= cid->num_dicts ) - { - FT_ERROR(( "cid_load_keyword: invalid use of `%s'\n", - keyword->ident )); -@@ -158,7 +158,7 @@ - FT_Fixed temp_scale; - - -- if ( parser->num_dict >= 0 ) -+ if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts ) - { - dict = face->cid.font_dicts + parser->num_dict; - matrix = &dict->font_matrix; -@@ -249,7 +249,7 @@ - CID_FaceDict dict; - - -- if ( parser->num_dict >= 0 ) -+ if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts ) - { - dict = face->cid.font_dicts + parser->num_dict; - -@@ -413,12 +413,25 @@ - FT_Byte* p; - - -+ /* Check for possible overflow. */ -+ if ( num_subrs == FT_UINT_MAX ) -+ { -+ error = CID_Err_Syntax_Error; -+ goto Fail; -+ } -+ - /* reallocate offsets array if needed */ - if ( num_subrs + 1 > max_offsets ) - { - FT_UInt new_max = FT_PAD_CEIL( num_subrs + 1, 4 ); - - -+ if ( new_max <= max_offsets ) -+ { -+ error = CID_Err_Syntax_Error; -+ goto Fail; -+ } -+ - if ( FT_RENEW_ARRAY( offsets, max_offsets, new_max ) ) - goto Fail; - -@@ -436,6 +449,11 @@ - - FT_FRAME_EXIT(); - -+ /* offsets must be ordered */ -+ for ( count = 1; count <= num_subrs; count++ ) -+ if ( offsets[count - 1] > offsets[count] ) -+ goto Fail; -+ - /* now, compute the size of subrs charstrings, */ - /* allocate, and read them */ - data_len = offsets[num_subrs] - offsets[0]; diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1126.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1126.patch deleted file mode 100644 index 2a2e0c58..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1126.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- freetype-2.3.11/src/bdf/bdflib.c 2009-09-12 23:14:25.000000000 +0200 -+++ freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:19:23.000000000 +0200 -@@ -1,6 +1,6 @@ - /* - * Copyright 2000 Computing Research Labs, New Mexico State University -- * Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 -+ * Copyright 2001-2012 - * Francesco Zappa Nardelli - * - * Permission is hereby granted, free of charge, to any person obtaining a -@@ -1235,7 +1235,8 @@ - ep = line + linelen; - - /* Trim the leading whitespace if it exists. */ -- *sp++ = 0; -+ if ( *sp ) -+ *sp++ = 0; - while ( *sp && - ( *sp == ' ' || *sp == '\t' ) ) - sp++; diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1127.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1127.patch deleted file mode 100644 index a529f190..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1127.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:20:31.000000000 +0200 -+++ freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:22:28.000000000 +0200 -@@ -1092,6 +1092,7 @@ - #define ACMSG13 "Glyph %ld extra rows removed.\n" - #define ACMSG14 "Glyph %ld extra columns removed.\n" - #define ACMSG15 "Incorrect glyph count: %ld indicated but %ld found.\n" -+#define ACMSG16 "Glyph %ld missing columns padded with zero bits.\n" - - /* Error messages. */ - #define ERRMSG1 "[line %ld] Missing \"%s\" line.\n" -@@ -1695,18 +1696,31 @@ - for ( i = 0; i < nibbles; i++ ) - { - c = line[i]; -+ if ( !c ) -+ break; - *bp = (FT_Byte)( ( *bp << 4 ) + a2i[c] ); - if ( i + 1 < nibbles && ( i & 1 ) ) - *++bp = 0; - } - -+ /* If any line has not enough columns, */ -+ /* indicate they have been padded with zero bits. */ -+ if ( i < nibbles && -+ !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) ) -+ { -+ FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG16, glyph->encoding )); -+ p->flags |= _BDF_GLYPH_WIDTH_CHECK; -+ font->modified = 1; -+ } -+ - /* Remove possible garbage at the right. */ - mask_index = ( glyph->bbx.width * p->font->bpp ) & 7; - if ( glyph->bbx.width ) - *bp &= nibble_mask[mask_index]; - - /* If any line has extra columns, indicate they have been removed. */ -- if ( ( line[nibbles] == '0' || a2i[(int)line[nibbles]] != 0 ) && -+ if ( i == nibbles && -+ ( line[nibbles] == '0' || a2i[(int)line[nibbles]] != 0 ) && - !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) ) - { - FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG14, glyph->encoding )); diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1130.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1130.patch deleted file mode 100644 index 4d2f9a87..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1130.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- freetype-2.3.11/src/pcf/pcfread.c 2009-10-10 19:32:28.000000000 +0200 -+++ freetype-2.3.11/src/pcf/pcfread.c 2012-03-28 10:29:54.000000000 +0200 -@@ -2,7 +2,7 @@ - - FreeType font driver for pcf fonts - -- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by -+ Copyright 2000-2010, 2012 by - Francesco Zappa Nardelli - - Permission is hereby granted, free of charge, to any person obtaining a copy -@@ -495,7 +495,8 @@ THE SOFTWARE. - goto Bail; - } - -- if ( FT_NEW_ARRAY( strings, string_size ) ) -+ /* allocate one more byte so that we have a final null byte */ -+ if ( FT_NEW_ARRAY( strings, string_size + 1 ) ) - goto Bail; - - error = FT_Stream_Read( stream, (FT_Byte*)strings, string_size ); diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1131.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1131.patch deleted file mode 100644 index cfbd7488..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1131.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- freetype-2.3.11/src/smooth/ftsmooth.c 2012-03-28 10:30:52.000000000 +0200 -+++ freetype-2.3.11/src/smooth/ftsmooth.c 2012-03-28 10:33:13.000000000 +0200 -@@ -4,7 +4,7 @@ - /* */ - /* Anti-aliasing renderer interface (body). */ - /* */ --/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by */ -+/* Copyright 2000-2006, 2009-2012 by */ - /* David Turner, Robert Wilhelm, and Werner Lemberg. */ - /* */ - /* This file is part of the FreeType project, and may only be used, */ -@@ -105,7 +105,7 @@ - FT_Error error; - FT_Outline* outline = NULL; - FT_BBox cbox; -- FT_UInt width, height, height_org, width_org, pitch; -+ FT_Pos width, height, height_org, width_org, pitch; - FT_Bitmap* bitmap; - FT_Memory memory; - FT_Int hmul = mode == FT_RENDER_MODE_LCD; -@@ -140,8 +140,8 @@ - cbox.xMax = FT_PIX_CEIL( cbox.xMax ); - cbox.yMax = FT_PIX_CEIL( cbox.yMax ); - -- width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 ); -- height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 ); -+ width = ( cbox.xMax - cbox.xMin ) >> 6; -+ height = ( cbox.yMax - cbox.yMin ) >> 6; - bitmap = &slot->bitmap; - memory = render->root.memory; - -@@ -200,7 +200,7 @@ - - /* Required check is ( pitch * height < FT_ULONG_MAX ), */ - /* but we care realistic cases only. Always pitch <= width. */ -- if ( width > 0x7FFFU || height > 0x7FFFU ) -+ if ( width > 0x7FFF || height > 0x7FFF ) - { - FT_ERROR(( "ft_smooth_render_generic: glyph too large: %d x %d\n", - width, height )); diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1132.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1132.patch deleted file mode 100644 index 550da7fa..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1132.patch +++ /dev/null @@ -1,130 +0,0 @@ ---- freetype-2.3.11/src/psaux/psobjs.c 2009-07-31 18:45:18.000000000 +0200 -+++ freetype-2.3.11/src/psaux/psobjs.c 2012-04-03 13:14:05.000000000 +0200 -@@ -4,7 +4,7 @@ - /* */ - /* Auxiliary functions for PostScript fonts (body). */ - /* */ --/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ -+/* Copyright 1996-2012 by */ - /* David Turner, Robert Wilhelm, and Werner Lemberg. */ - /* */ - /* This file is part of the FreeType project, and may only be used, */ -@@ -589,7 +589,7 @@ - } - - Exit: -- if ( cur == parser->cursor ) -+ if ( cur < limit && cur == parser->cursor ) - { - FT_ERROR(( "ps_parser_skip_PS_token:" - " current token is `%c' which is self-delimiting\n" ---- freetype-2.3.11/src/type1/t1load.c 2009-09-01 08:07:32.000000000 +0200 -+++ freetype-2.3.11/src/type1/t1load.c 2012-04-03 13:14:30.000000000 +0200 -@@ -71,6 +71,13 @@ - #include "t1errors.h" - - -+#ifdef FT_CONFIG_OPTION_INCREMENTAL -+#define IS_INCREMENTAL ( face->root.internal->incremental_interface != 0 ) -+#else -+#define IS_INCREMENTAL 0 -+#endif -+ -+ - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ -@@ -1027,7 +1034,8 @@ - static int - read_binary_data( T1_Parser parser, - FT_Long* size, -- FT_Byte** base ) -+ FT_Byte** base, -+ FT_Bool incremental ) - { - FT_Byte* cur; - FT_Byte* limit = parser->root.limit; -@@ -1057,8 +1065,12 @@ - return !parser->root.error; - } - -- FT_ERROR(( "read_binary_data: invalid size field\n" )); -- parser->root.error = T1_Err_Invalid_File_Format; -+ if( !incremental ) -+ { -+ FT_ERROR(( "read_binary_data: invalid size field\n" )); -+ parser->root.error = T1_Err_Invalid_File_Format; -+ } -+ - return 0; - } - -@@ -1379,15 +1391,17 @@ - FT_Byte* base; - - -- /* If the next token isn't `dup' we are done. */ -- if ( ft_strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 ) -+ /* If we are out of data, or if the next token isn't `dup', */ -+ /* we are done. */ -+ if ( parser->root.cursor + 4 >= parser->root.limit || -+ ft_strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 ) - break; - - T1_Skip_PS_Token( parser ); /* `dup' */ - - idx = T1_ToInt( parser ); - -- if ( !read_binary_data( parser, &size, &base ) ) -+ if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) ) - return; - - /* The binary string is followed by one token, e.g. `NP' */ -@@ -1399,7 +1413,8 @@ - return; - T1_Skip_Spaces ( parser ); - -- if ( ft_strncmp( (char*)parser->root.cursor, "put", 3 ) == 0 ) -+ if ( parser->root.cursor + 4 < parser->root.limit && -+ ft_strncmp( (char*)parser->root.cursor, "put", 3 ) == 0 ) - { - T1_Skip_PS_Token( parser ); /* skip `put' */ - T1_Skip_Spaces ( parser ); -@@ -1572,7 +1587,7 @@ - cur++; /* skip `/' */ - len = parser->root.cursor - cur; - -- if ( !read_binary_data( parser, &size, &base ) ) -+ if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) ) - return; - - /* for some non-standard fonts like `Optima' which provides */ -@@ -1861,7 +1876,7 @@ - - - parser->root.cursor = start_binary; -- if ( !read_binary_data( parser, &s, &b ) ) -+ if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) ) - return T1_Err_Invalid_File_Format; - have_integer = 0; - } -@@ -1874,7 +1889,7 @@ - - - parser->root.cursor = start_binary; -- if ( !read_binary_data( parser, &s, &b ) ) -+ if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) ) - return T1_Err_Invalid_File_Format; - have_integer = 0; - } -@@ -2148,9 +2163,7 @@ - type1->subrs_len = loader.subrs.lengths; - } - --#ifdef FT_CONFIG_OPTION_INCREMENTAL -- if ( !face->root.internal->incremental_interface ) --#endif -+ if ( !IS_INCREMENTAL ) - if ( !loader.charstrings.init ) - { - FT_ERROR(( "T1_Open_Face: no `/CharStrings' array in face\n" )); diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1134.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1134.patch deleted file mode 100644 index ca51f26f..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1134.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- freetype-2.3.11/src/type1/t1parse.c 2009-07-03 15:28:24.000000000 +0200 -+++ freetype-2.3.11/src/type1/t1parse.c 2012-03-28 10:39:25.000000000 +0200 -@@ -4,7 +4,7 @@ - /* */ - /* Type 1 parser (body). */ - /* */ --/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009 by */ -+/* Copyright 1996-2005, 2008, 2009, 2012 by */ - /* David Turner, Robert Wilhelm, and Werner Lemberg. */ - /* */ - /* This file is part of the FreeType project, and may only be used, */ -@@ -464,6 +464,14 @@ - /* we now decrypt the encoded binary private dictionary */ - psaux->t1_decrypt( parser->private_dict, parser->private_len, 55665U ); - -+ if ( parser->private_len < 4 ) -+ { -+ FT_ERROR(( "T1_Get_Private_Dict:" -+ " invalid private dictionary section\n" )); -+ error = T1_Err_Invalid_File_Format; -+ goto Fail; -+ } -+ - /* replace the four random bytes at the beginning with whitespace */ - parser->private_dict[0] = ' '; - parser->private_dict[1] = ' '; diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1136.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1136.patch deleted file mode 100644 index fb017b64..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1136.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:40:25.000000000 +0200 -+++ freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:44:30.000000000 +0200 -@@ -1736,12 +1736,7 @@ - if ( ft_memcmp( line, "SWIDTH", 6 ) == 0 ) - { - if ( !( p->flags & _BDF_ENCODING ) ) -- { -- /* Missing ENCODING field. */ -- FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENCODING" )); -- error = BDF_Err_Missing_Encoding_Field; -- goto Exit; -- } -+ goto Missing_Encoding; - - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); - if ( error ) -@@ -1756,6 +1751,9 @@ - /* Expect the DWIDTH (scalable width) field next. */ - if ( ft_memcmp( line, "DWIDTH", 6 ) == 0 ) - { -+ if ( !( p->flags & _BDF_ENCODING ) ) -+ goto Missing_Encoding; -+ - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); - if ( error ) - goto Exit; -@@ -1781,6 +1779,9 @@ - /* Expect the BBX field next. */ - if ( ft_memcmp( line, "BBX", 3 ) == 0 ) - { -+ if ( !( p->flags & _BDF_ENCODING ) ) -+ goto Missing_Encoding; -+ - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); - if ( error ) - goto Exit; -@@ -1880,6 +1881,12 @@ - } - - error = BDF_Err_Invalid_File_Format; -+ goto Exit; -+ -+ Missing_Encoding: -+ /* Missing ENCODING field. */ -+ FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENCODING" )); -+ error = BDF_Err_Missing_Encoding_Field; - - Exit: - return error; diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1137.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1137.patch deleted file mode 100644 index 9086a78d..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1137.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:46:09.000000000 +0200 -+++ freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:45:50.000000000 +0200 -@@ -424,7 +424,7 @@ - if ( num_items > list->size ) - { - unsigned long oldsize = list->size; /* same as _bdf_list_t.size */ -- unsigned long newsize = oldsize + ( oldsize >> 1 ) + 4; -+ unsigned long newsize = oldsize + ( oldsize >> 1 ) + 5; - unsigned long bigsize = (unsigned long)( FT_INT_MAX / sizeof ( char* ) ); - FT_Memory memory = list->memory; - diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1139.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1139.patch deleted file mode 100644 index 4b27341f..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1139.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:49:56.000000000 +0200 -+++ freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 10:51:40.000000000 +0200 -@@ -785,7 +785,7 @@ - }; - - --#define isdigok( m, d ) (m[(d) >> 3] & ( 1 << ( (d) & 7 ) ) ) -+#define isdigok( m, d ) (m[(unsigned char)(d) >> 3] & ( 1 << ( (d) & 7 ) ) ) - - - /* Routine to convert an ASCII string into an unsigned long integer. */ -@@ -1696,7 +1696,7 @@ - for ( i = 0; i < nibbles; i++ ) - { - c = line[i]; -- if ( !c ) -+ if ( !isdigok( hdigits, c ) ) - break; - *bp = (FT_Byte)( ( *bp << 4 ) + a2i[c] ); - if ( i + 1 < nibbles && ( i & 1 ) ) -@@ -1719,9 +1719,9 @@ - *bp &= nibble_mask[mask_index]; - - /* If any line has extra columns, indicate they have been removed. */ -- if ( i == nibbles && -- ( line[nibbles] == '0' || a2i[(int)line[nibbles]] != 0 ) && -- !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) ) -+ if ( i == nibbles && -+ isdigok( hdigits, line[nibbles] ) && -+ !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) ) - { - FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG14, glyph->encoding )); - p->flags |= _BDF_GLYPH_WIDTH_CHECK; diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1140.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1140.patch deleted file mode 100644 index 91381275..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1140.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- freetype-2.3.11/src/psaux/psconv.c 2009-07-31 18:45:18.000000000 +0200 -+++ freetype-2.3.11/src/psaux/psconv.c 2012-03-28 10:55:16.000000000 +0200 -@@ -4,7 +4,7 @@ - /* */ - /* Some convenience conversions (body). */ - /* */ --/* Copyright 2006, 2008, 2009 by */ -+/* Copyright 2006, 2008, 2009, 2012 by */ - /* David Turner, Robert Wilhelm, and Werner Lemberg. */ - /* */ - /* This file is part of the FreeType project, and may only be used, */ -@@ -79,7 +79,7 @@ - FT_Bool sign = 0; - - -- if ( p == limit || base < 2 || base > 36 ) -+ if ( p >= limit || base < 2 || base > 36 ) - return 0; - - if ( *p == '-' || *p == '+' ) -@@ -150,7 +150,7 @@ - FT_Bool sign = 0; - - -- if ( p == limit ) -+ if ( p >= limit ) - return 0; - - if ( *p == '-' || *p == '+' ) -@@ -346,7 +346,11 @@ - - #if 1 - -- p = *cursor; -+ p = *cursor; -+ -+ if ( p >= limit ) -+ return 0; -+ - if ( n > (FT_UInt)( limit - p ) ) - n = (FT_UInt)( limit - p ); - -@@ -434,6 +438,10 @@ - #if 1 - - p = *cursor; -+ -+ if ( p >= limit ) -+ return 0; -+ - if ( n > (FT_UInt)(limit - p) ) - n = (FT_UInt)(limit - p); - diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1141.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1141.patch deleted file mode 100644 index 2a6f29ca..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1141.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 11:53:32.000000000 +0200 -+++ freetype-2.3.11/src/bdf/bdflib.c 2012-03-28 11:54:12.000000000 +0200 -@@ -520,6 +520,14 @@ - - /* Initialize the list. */ - list->used = 0; -+ if ( list->size ) -+ { -+ list->field[0] = (char*)empty; -+ list->field[1] = (char*)empty; -+ list->field[2] = (char*)empty; -+ list->field[3] = (char*)empty; -+ list->field[4] = (char*)empty; -+ } - - /* If the line is empty, then simply return. */ - if ( linelen == 0 || line[0] == 0 ) diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1142.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1142.patch deleted file mode 100644 index 5337d4bb..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1142.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- freetype-2.3.11/src/winfonts/winfnt.c 2009-07-31 18:45:19.000000000 +0200 -+++ freetype-2.3.11/src/winfonts/winfnt.c 2012-03-28 11:57:05.000000000 +0200 -@@ -4,7 +4,7 @@ - /* */ - /* FreeType font driver for Windows FNT/FON files */ - /* */ --/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by */ -+/* Copyright 1996-2004, 2006-2012 by */ - /* David Turner, Robert Wilhelm, and Werner Lemberg. */ - /* Copyright 2003 Huw D M Davies for Codeweavers */ - /* Copyright 2007 Dmitry Timoshkov for Codeweavers */ -@@ -825,7 +825,14 @@ - root->charmap = root->charmaps[0]; - } - -- /* setup remaining flags */ -+ /* set up remaining flags */ -+ -+ if ( font->header.last_char < font->header.first_char ) -+ { -+ FT_TRACE2(( "invalid number of glyphs\n" )); -+ error = FNT_Err_Invalid_File_Format; -+ goto Fail; -+ } - - /* reserve one slot for the .notdef glyph at index 0 */ - root->num_glyphs = font->header.last_char - diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1143.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1143.patch deleted file mode 100644 index 551aeb95..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1143.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- freetype-2.3.11/src/base/ftcalc.c 2009-07-31 18:45:18.000000000 +0200 -+++ freetype-2.3.11/src/base/ftcalc.c 2012-03-28 11:59:17.000000000 +0200 -@@ -4,7 +4,7 @@ - /* */ - /* Arithmetic computations (body). */ - /* */ --/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by */ -+/* Copyright 1996-2006, 2008, 2012 by */ - /* David Turner, Robert Wilhelm, and Werner Lemberg. */ - /* */ - /* This file is part of the FreeType project, and may only be used, */ -@@ -307,7 +307,7 @@ - q <<= 1; - r |= lo >> 31; - -- if ( r >= (FT_UInt32)y ) -+ if ( r >= y ) - { - r -= y; - q |= 1; -@@ -373,7 +373,7 @@ - if ( a <= 46340L && b <= 46340L && c <= 176095L && c > 0 ) - a = ( a * b + ( c >> 1 ) ) / c; - -- else if ( c > 0 ) -+ else if ( (FT_Int32)c > 0 ) - { - FT_Int64 temp, temp2; - -@@ -412,7 +412,7 @@ - if ( a <= 46340L && b <= 46340L && c > 0 ) - a = a * b / c; - -- else if ( c > 0 ) -+ else if ( (FT_Int32)c > 0 ) - { - FT_Int64 temp; - -@@ -544,7 +544,7 @@ - s = (FT_Int32)a; a = FT_ABS( a ); - s ^= (FT_Int32)b; b = FT_ABS( b ); - -- if ( b == 0 ) -+ if ( (FT_UInt32)b == 0 ) - { - /* check for division by 0 */ - q = (FT_UInt32)0x7FFFFFFFL; -@@ -552,15 +552,16 @@ - else if ( ( a >> 16 ) == 0 ) - { - /* compute result directly */ -- q = (FT_UInt32)( (a << 16) + (b >> 1) ) / (FT_UInt32)b; -+ q = (FT_UInt32)( ( a << 16 ) + ( b >> 1 ) ) / (FT_UInt32)b; - } - else - { - /* we need more bits; we have to do it by hand */ - FT_Int64 temp, temp2; - -- temp.hi = (FT_Int32) (a >> 16); -- temp.lo = (FT_UInt32)(a << 16); -+ -+ temp.hi = (FT_Int32) ( a >> 16 ); -+ temp.lo = (FT_UInt32)( a << 16 ); - temp2.hi = 0; - temp2.lo = (FT_UInt32)( b >> 1 ); - FT_Add64( &temp, &temp2, &temp ); diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1144.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1144.patch deleted file mode 100644 index 62b47c22..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-1144.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- freetype-2.3.11/src/truetype/ttgload.c 2009-09-08 07:06:51.000000000 +0200 -+++ freetype-2.3.11/src/truetype/ttgload.c 2012-03-28 12:01:04.000000000 +0200 -@@ -267,14 +267,17 @@ - if ( n_contours >= 0xFFF || p + ( n_contours + 1 ) * 2 > limit ) - goto Invalid_Outline; - -- prev_cont = FT_NEXT_USHORT( p ); -+ prev_cont = FT_NEXT_SHORT( p ); - - if ( n_contours > 0 ) - cont[0] = prev_cont; - -+ if ( prev_cont < 0 ) -+ goto Invalid_Outline; -+ - for ( cont++; cont < cont_limit; cont++ ) - { -- cont[0] = FT_NEXT_USHORT( p ); -+ cont[0] = FT_NEXT_SHORT( p ); - if ( cont[0] <= prev_cont ) - { - /* unordered contours: this is invalid */ diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-5669.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-5669.patch deleted file mode 100644 index 3e52997a..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-CVE-2012-5669.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- freetype-2.3.11/src/bdf/bdflib.c 2013-01-15 09:57:36.000000000 +0100 -+++ freetype-2.3.11/src/bdf/bdflib.c 2013-01-15 10:04:37.000000000 +0100 -@@ -1588,9 +1588,11 @@ - - p->glyph_enc = _bdf_atol( p->list.field[1], 0, 10 ); - -- /* Check that the encoding is in the range [0,65536] because */ -- /* otherwise p->have (a bitmap with static size) overflows. */ -- if ( (size_t)p->glyph_enc >= sizeof ( p->have ) * 8 ) -+ /* Check that the encoding is in the Unicode range because */ -+ /* otherwise p->have (a bitmap with static size) overflows. */ -+ if ( p->glyph_enc > 0 && -+ (size_t)p->glyph_enc >= sizeof ( p->have ) / -+ sizeof ( unsigned long ) * 32 ) - { - error = BDF_Err_Invalid_File_Format; - goto Exit; diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-array-initialization.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-array-initialization.patch deleted file mode 100644 index 254354b7..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-array-initialization.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- freetype-2.3.11/src/base/ftoutln.c 2009-03-14 14:45:26.000000000 +0100 -+++ freetype-2.3.11/src/base/ftoutln.c 2012-04-03 11:03:35.000000000 +0200 -@@ -990,7 +990,8 @@ - - int i; - FT_Pos ray_y[3]; -- FT_Orientation result[3]; -+ FT_Orientation result[3] = -+ { FT_ORIENTATION_NONE, FT_ORIENTATION_NONE, FT_ORIENTATION_NONE }; - - - if ( !outline || outline->n_points <= 0 ) diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-axis-name-overflow.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-axis-name-overflow.patch deleted file mode 100644 index 5f32b8ad..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-axis-name-overflow.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- freetype-2.3.11/ft2demos-2.3.11/src/ftmulti.c 2010-07-22 19:11:50.000000000 +0200 -+++ freetype-2.3.11/ft2demos-2.3.11/src/ftmulti.c 2010-07-22 19:12:41.000000000 +0200 -@@ -813,13 +813,13 @@ - - for ( n = 0; n < (int)multimaster->num_axis; n++ ) - { -- char temp[32]; -+ char temp[100]; - - -- sprintf( temp, " %s:%g", -+ sprintf( temp, " %.50s:%g", - multimaster->axis[n].name, -- design_pos[n]/65536. ); -- strcat( Header, temp ); -+ design_pos[n] / 65536.0 ); -+ strncat( Header, temp, sizeof( Header ) - strlen( Header ) - 1 ); - } - } - grWriteCellString( &bit, 0, 16, Header, fore_color ); diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-bdf-overflow.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-bdf-overflow.patch deleted file mode 100644 index 88e34198..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-bdf-overflow.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- freetype-2.3.11/src/bdf/bdflib.c 2012-04-02 16:24:56.000000000 +0200 -+++ freetype-2.3.11/src/bdf/bdflib.c 2012-04-02 16:25:33.000000000 +0200 -@@ -1870,7 +1870,7 @@ - glyph->bpr = ( glyph->bbx.width * p->font->bpp + 7 ) >> 3; - - bitmap_size = glyph->bpr * glyph->bbx.height; -- if ( bitmap_size > 0xFFFFU ) -+ if ( glyph->bpr > 0xFFFFU || bitmap_size > 0xFFFFU ) - { - FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG4, lineno )); - error = BDF_Err_Bbx_Too_Big; diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-more-demos.patch b/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-more-demos.patch deleted file mode 100644 index 4b0046e8..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-2.3.11-more-demos.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -up freetype-2.3.11/ft2demos-2.3.11/Makefile.more-demos freetype-2.3.11/ft2demos-2.3.11/Makefile ---- freetype-2.3.11/ft2demos-2.3.11/Makefile.more-demos 2009-10-22 16:02:26.000000000 -0400 -+++ freetype-2.3.11/ft2demos-2.3.11/Makefile 2009-10-22 16:02:32.000000000 -0400 -@@ -288,10 +288,10 @@ else - # Note that ttdebug only works if the FreeType's `truetype' driver has - # been compiled with TT_CONFIG_OPTION_BYTECODE_INTERPRETER defined. - # -- # EXES += ftchkwd -- # EXES += ftmemchk -- # EXES += ftpatchk -- # EXES += fttimer -+ EXES += ftchkwd -+ EXES += ftmemchk -+ EXES += ftpatchk -+ EXES += fttimer - # EXES += testname - # EXES += ttdebug - diff --git a/contrib/packages/rpm/el5/SOURCES/freetype-multilib.patch b/contrib/packages/rpm/el5/SOURCES/freetype-multilib.patch deleted file mode 100644 index f369adb7..00000000 --- a/contrib/packages/rpm/el5/SOURCES/freetype-multilib.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- freetype-2.2.1/builds/unix/freetype-config.in.multilib 2006-07-27 18:50:40.000000000 -0400 -+++ freetype-2.2.1/builds/unix/freetype-config.in 2006-07-27 18:58:13.000000000 -0400 -@@ -9,11 +9,11 @@ - # indicate that you have read the license and understand and accept it - # fully. - --prefix=@prefix@ --exec_prefix=@exec_prefix@ -+prefix=`pkg-config --variable prefix freetype2` -+exec_prefix=`pkg-config --variable exec_prefix freetype2` - exec_prefix_set=no --includedir=@includedir@ --libdir=@libdir@ -+includedir=`pkg-config --variable includedir freetype2` -+libdir=`pkg-config --variable libdir freetype2` - enable_shared=@build_libtool_libs@ - wl=@wl@ - hardcode_libdir_flag_spec='@hardcode_libdir_flag_spec@' diff --git a/contrib/packages/rpm/el5/SOURCES/pthread-stubs.pc.in b/contrib/packages/rpm/el5/SOURCES/pthread-stubs.pc.in deleted file mode 100644 index 1b722e95..00000000 --- a/contrib/packages/rpm/el5/SOURCES/pthread-stubs.pc.in +++ /dev/null @@ -1,8 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ - -Name: pthread stubs -Description: Stubs missing from libc for standard pthread functions -Version: 0.1 -Libs: diff --git a/contrib/packages/rpm/el5/SOURCES/tigervnc-2b76d02.patch b/contrib/packages/rpm/el5/SOURCES/tigervnc-2b76d02.patch deleted file mode 100644 index 8ff0b9f0..00000000 --- a/contrib/packages/rpm/el5/SOURCES/tigervnc-2b76d02.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 2b76d028b0253be7c4496840fcd2e0fb47c0794e Mon Sep 17 00:00:00 2001 -From: Pierre Ossman <ossman@cendio.se> -Date: Mon, 15 Dec 2014 10:52:43 +0100 -Subject: [PATCH] Band aid to work around inluding C headers in C++ code - ---- - unix/xserver/hw/vnc/Makefile.am | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/unix/xserver/hw/vnc/Makefile.am b/unix/xserver/hw/vnc/Makefile.am -index 9885b8a..372a57f 100644 ---- a/unix/xserver/hw/vnc/Makefile.am -+++ b/unix/xserver/hw/vnc/Makefile.am -@@ -7,6 +7,9 @@ NETWORK_LIB=$(LIB_DIR)/network/libnetwork.la - XREGION_LIB=$(LIB_DIR)/Xregion/libXregion.la - COMMON_LIBS=$(NETWORK_LIB) $(RFB_LIB) $(RDR_LIB) $(XREGION_LIB) - -+# Hack to get the C headers to work when included from C++ code -+AM_CXXFLAGS = -fpermissive -+ - noinst_LTLIBRARIES = libvnccommon.la - - HDRS = RegionHelper.h vncExtInit.h vncHooks.h XserverDesktop.h xorg-version.h \ diff --git a/contrib/packages/rpm/el5/SOURCES/tigervnc14-Add-dridir-param.patch b/contrib/packages/rpm/el5/SOURCES/tigervnc14-Add-dridir-param.patch deleted file mode 100644 index 2445f519..00000000 --- a/contrib/packages/rpm/el5/SOURCES/tigervnc14-Add-dridir-param.patch +++ /dev/null @@ -1,103 +0,0 @@ -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 - diff --git a/contrib/packages/rpm/el5/SOURCES/tigervnc14-Add-xkbcompdir-param.patch b/contrib/packages/rpm/el5/SOURCES/tigervnc14-Add-xkbcompdir-param.patch deleted file mode 100644 index 0d82ba4a..00000000 --- a/contrib/packages/rpm/el5/SOURCES/tigervnc14-Add-xkbcompdir-param.patch +++ /dev/null @@ -1,46 +0,0 @@ -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 - diff --git a/contrib/packages/rpm/el5/SOURCES/tigervnc14-static-build-fixes.patch b/contrib/packages/rpm/el5/SOURCES/tigervnc14-static-build-fixes.patch deleted file mode 100644 index dd26ea66..00000000 --- a/contrib/packages/rpm/el5/SOURCES/tigervnc14-static-build-fixes.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- a/cmake/StaticBuild.cmake 2014-12-25 23:28:45.000000000 -0500 -+++ b/cmake/StaticBuild.cmake 2015-01-01 18:18:36.000000000 -0500 -@@ -82,10 +82,10 @@ - if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - set(FLTK_LIBRARIES "${FLTK_LIBRARIES} ${X11_Xcursor_LIB} ${X11_Xfixes_LIB} -Wl,-Bstatic -lXft -Wl,-Bdynamic -lfontconfig -lXext -R/usr/sfw/lib") - else() -- set(FLTK_LIBRARIES "${FLTK_LIBRARIES} -Wl,-Bstatic -lXcursor -lXfixes -lXft -lfontconfig -lexpat -lfreetype -lbz2 -lXrender -lXext -lXinerama -Wl,-Bdynamic") -+ set(FLTK_LIBRARIES "${FLTK_LIBRARIES} -Wl,-Bstatic -lXft -lfontconfig -lfreetype -lXcursor -lXfixes -lz -lbz2 -lXrender -lXinerama -lXext -lexpat -Wl,-Bdynamic") - endif() - -- set(FLTK_LIBRARIES "${FLTK_LIBRARIES} -lX11") -+ set(FLTK_LIBRARIES "${FLTK_LIBRARIES} -Wl,-Bdynamic -lX11 -Wl,-Bstatic -lxcb -lXdmcp -lXau -lICE -Wl,-Bdynamic -ldl") - endif() - endif() - -@@ -93,7 +93,7 @@ - # them statically, even libXext. libX11 is somewhat stable, although - # even it has had an ABI change once or twice. - if(X11_FOUND AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") -- set(X11_LIBRARIES "-Wl,-Bstatic -lXext -Wl,-Bdynamic -lX11") -+ set(X11_LIBRARIES "-Wl,-Bstatic -lXext -Wl,-Bdynamic -lX11 -Wl,-Bstatic -lxcb -lXdmcp -lXau -lICE -Wl,-Bdynamic -ldl -lpthread") - if(X11_XTest_LIB) - set(X11_XTest_LIB "-Wl,-Bstatic -lXtst -Wl,-Bdynamic") - endif() ---- a/vncviewer/CMakeLists.txt 2014-11-04 21:38:36.000000000 -0500 -+++ b/vncviewer/CMakeLists.txt 2015-01-01 18:15:32.000000000 -0500 -@@ -46,7 +46,7 @@ - add_executable(vncviewer ${VNCVIEWER_SOURCES}) - endif() - --target_link_libraries(vncviewer rfb network rdr os Xregion ${FLTK_LIBRARIES} ${GETTEXT_LIBRARIES}) -+target_link_libraries(vncviewer ${FLTK_LIBRARIES} rfb network rdr os Xregion ${GETTEXT_LIBRARIES}) - - if(APPLE) - target_link_libraries(vncviewer "-framework Cocoa" "-framework Carbon") diff --git a/contrib/packages/rpm/el5/SOURCES/vncserver.service b/contrib/packages/rpm/el5/SOURCES/vncserver.service deleted file mode 100644 index fb4c0de1..00000000 --- a/contrib/packages/rpm/el5/SOURCES/vncserver.service +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -# -# Init file for TigerVNC Server -# -# Written by Dag Wieers <dag@wieers.com> -# -# chkconfig: - 91 35 -# description: TigerVNC remote X administration daemon. -# -# processname: Xvnc - -source /etc/rc.d/init.d/functions -source /etc/sysconfig/network - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 1 - -[ -x /usr/bin/Xvnc ] || exit 1 - -### Default variables -SYSCONFIG="/etc/sysconfig/vncservers" -VNCSERVERS="" - -### Read configuration -[ -r "$SYSCONFIG" ] && source "$SYSCONFIG" - -RETVAL=0 -prog="Xvnc" -desc="TigerVNC remote administration daemon" - -start() { - echo -n $"Starting $desc ($prog):" - ulimit -S -c 0 &>/dev/null - for display in ${VNCSERVERS}; do - echo -n "${display} " - unset BASH_ENV ENV - initlog $INITLOG_ARGS -c \ - "su ${display##*:} -c \"cd ~${display##*:} && [ -f .vnc/passwd ] && vncserver :${display%:*} ${VNCSERVERARGS[${display%:*}]}\"" - RETVAL=$? - [ "$RETVAL" -ne 0 ] && break - done - [ "$RETVAL" -eq 0 ] && success $"vncserver startup" || failure $"vncserver start" - echo - [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/$prog - return $RETVAL -} - -stop() { - echo -n $"Shutting down $desc ($prog): " - for display in ${VNCSERVERS}; do - echo -n "${display} " - unset BASH_ENV ENV - initlog $INITLOG_ARGS -c \ - "su ${display##*:} -c \"vncserver -kill :${display%:*}\" &>/dev/null" - done - RETVAL=$? - [ "$RETVAL" -eq 0 ] && success $"vncserver shutdown" || failure $"vncserver shutdown" - echo - [ "$RETVAL" -eq 0 ] && rm -f /var/lock/subsys/$prog - return $RETVAL -} - -restart() { - stop - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - restart - ;; - condrestart) - [ -e /var/lock/subsys/$prog ] && restart - RETVAL=$? - ;; - status) - status $prog - RETVAL=$? - ;; - *) - echo $"Usage: $0 {start|stop|restart|condrestart|status}" - RETVAL=1 -esac - -exit $RETVAL diff --git a/contrib/packages/rpm/el5/SOURCES/vncserver.sysconfig b/contrib/packages/rpm/el5/SOURCES/vncserver.sysconfig deleted file mode 100644 index 5940a1e7..00000000 --- a/contrib/packages/rpm/el5/SOURCES/vncserver.sysconfig +++ /dev/null @@ -1,19 +0,0 @@ -# The VNCSERVERS variable is a list of display:user pairs. -# -# Uncomment the lines below to start a VNC server on display :2 -# as my 'myusername' (adjust this to your own). You will also -# need to set a VNC password; run 'man vncpasswd' to see how -# to do that. -# -# DO NOT RUN THIS SERVICE if your local area network is -# untrusted! For a secure way of using VNC, see this URL: -# http://kbase.redhat.com/faq/docs/DOC-7028 - -# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP. - -# Use "-localhost" to prevent remote VNC clients connecting except when -# doing so through a secure tunnel. See the "-via" option in the -# `man vncviewer' manual page. - -# VNCSERVERS="2:myusername" -# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost" diff --git a/contrib/packages/rpm/el5/SPECS/tigervnc.spec b/contrib/packages/rpm/el5/SPECS/tigervnc.spec deleted file mode 100644 index f83c15a8..00000000 --- a/contrib/packages/rpm/el5/SPECS/tigervnc.spec +++ /dev/null @@ -1,1387 +0,0 @@ -%define _default_patch_fuzz 2 -%define tigervnc_src_dir %{_builddir}/%{name}-%{version}%{?snap:-%{snap}} -%{!?_self_signed: %define _self_signed 1} -%{!?_bootstrap: %define _bootstrap 1} -#%global scl_name %{name}$(echo %version | sed -e 's/\\.//;s/\\..*//') -%define scl_name %{name}16 -%if %{_bootstrap} -%define xorg_buildroot $RPM_BUILD_ROOT/opt/%{name}/%{scl_name} -%else -%define xorg_buildroot /opt/%{name}/%{scl_name} -%endif - -Name: tigervnc -Version: @VERSION@ -Release: 3%{?snap:.%{snap}}%{?dist} -Summary: A TigerVNC remote display system - -Group: User Interface/Desktops -License: GPLv2+ -Packager: Brian P. Hinz <bphinz@users.sourceforge.net> -URL: http://www.tigervnc.com - -Source0: %{name}-%{version}%{?snap:-%{snap}}.tar.bz2 -Source1: vncserver.service -Source2: vncserver.sysconfig -Source9: FindX11.cmake -Source11: http://fltk.org/pub/fltk/1.3.3/fltk-1.3.3-source.tar.gz -Source12: http://downloads.sourceforge.net/project/libjpeg-turbo/1.4.2/libjpeg-turbo-1.4.2.tar.gz -Source13: http://downloads.sourceforge.net/project/libpng/libpng15/1.5.24/libpng-1.5.24.tar.bz2 -Source14: https://ftp.gnu.org/gnu/gmp/gmp-6.0.0a.tar.bz2 -Source15: http://ftp.gnu.org/gnu/libtasn1/libtasn1-4.7.tar.gz -Source16: https://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz -Source17: ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.19.tar.xz - -Source100: http://www.x.org/releases/X11R7.7/src/everything/bigreqsproto-1.1.2.tar.bz2 -Source101: http://www.x.org/releases/X11R7.7/src/everything/compositeproto-0.4.2.tar.bz2 -Source102: http://www.x.org/releases/X11R7.7/src/everything/damageproto-1.2.1.tar.bz2 -Source103: http://www.x.org/releases/X11R7.7/src/everything/dmxproto-2.3.1.tar.bz2 -Source104: http://www.x.org/releases/X11R7.7/src/everything/dri2proto-2.6.tar.bz2 -Source105: http://www.x.org/releases/X11R7.7/src/everything/fixesproto-5.0.tar.bz2 -Source106: http://www.x.org/releases/X11R7.7/src/everything/font-util-1.3.0.tar.bz2 -Source107: http://www.x.org/releases/X11R7.7/src/everything/fontsproto-2.1.2.tar.bz2 -Source108: http://www.x.org/releases/X11R7.7/src/everything/glproto-1.4.15.tar.bz2 -Source109: http://www.x.org/releases/X11R7.7/src/everything/inputproto-2.2.tar.bz2 -Source110: http://www.x.org/releases/X11R7.7/src/everything/kbproto-1.0.6.tar.bz2 -Source111: http://www.x.org/releases/X11R7.7/src/everything/libICE-1.0.8.tar.bz2 -Source112: http://www.x.org/releases/X11R7.7/src/everything/libSM-1.2.1.tar.bz2 -Source113: http://www.x.org/releases/X11R7.7/src/everything/libX11-1.5.0.tar.bz2 -Source114: http://www.x.org/releases/X11R7.7/src/everything/libXScrnSaver-1.2.2.tar.bz2 -Source115: http://www.x.org/releases/X11R7.7/src/everything/libXau-1.0.7.tar.bz2 -Source116: http://www.x.org/releases/X11R7.7/src/everything/libXaw-1.0.11.tar.bz2 -Source117: http://www.x.org/releases/X11R7.7/src/everything/libXcomposite-0.4.3.tar.bz2 -Source118: http://www.x.org/releases/X11R7.7/src/everything/libXcursor-1.1.13.tar.bz2 -Source119: http://www.x.org/releases/X11R7.7/src/everything/libXdamage-1.1.3.tar.bz2 -Source120: http://www.x.org/releases/X11R7.7/src/everything/libXdmcp-1.1.1.tar.bz2 -Source121: http://www.x.org/releases/X11R7.7/src/everything/libXext-1.3.1.tar.bz2 -Source122: http://www.x.org/releases/X11R7.7/src/everything/libXfixes-5.0.tar.bz2 -Source123: http://www.x.org/releases/X11R7.7/src/everything/libXfont-1.4.5.tar.bz2 -Source124: http://www.x.org/releases/X11R7.7/src/everything/libXft-2.3.1.tar.bz2 -Source125: http://www.x.org/releases/X11R7.7/src/everything/libXi-1.6.1.tar.bz2 -Source126: http://www.x.org/releases/X11R7.7/src/everything/libXinerama-1.1.2.tar.bz2 -Source127: http://www.x.org/releases/X11R7.7/src/everything/libXmu-1.1.1.tar.bz2 -Source128: http://www.x.org/releases/X11R7.7/src/everything/libXpm-3.5.10.tar.bz2 -Source129: http://www.x.org/releases/X11R7.7/src/everything/libXrandr-1.3.2.tar.bz2 -Source130: http://www.x.org/releases/X11R7.7/src/everything/libXrender-0.9.7.tar.bz2 -Source131: http://www.x.org/releases/X11R7.7/src/everything/libXres-1.0.6.tar.bz2 -Source132: http://www.x.org/releases/X11R7.7/src/everything/libXt-1.1.3.tar.bz2 -Source133: http://www.x.org/releases/X11R7.7/src/everything/libXtst-1.2.1.tar.bz2 -Source134: http://www.x.org/releases/X11R7.7/src/everything/libXv-1.0.7.tar.bz2 -Source135: http://www.x.org/releases/X11R7.7/src/everything/libXvMC-1.0.7.tar.bz2 -Source136: http://www.x.org/releases/X11R7.7/src/everything/libXxf86dga-1.1.3.tar.bz2 -Source137: http://www.x.org/releases/X11R7.7/src/everything/libXxf86vm-1.1.2.tar.bz2 -Source138: http://www.x.org/releases/X11R7.7/src/everything/libfontenc-1.1.1.tar.bz2 -Source139: http://www.x.org/releases/X11R7.7/src/everything/libpciaccess-0.13.1.tar.bz2 -#Source140: http://www.x.org/releases/X11R7.7/src/everything/libpthread-stubs-0.3.tar.bz2 -# libpthread-stubs fails to compile, so we use the same method -# as the el6 libxcb rpm. pthread-stubs.pc.in taken from el6 libxcb rpm -Source140: pthread-stubs.pc.in -Source141: http://www.x.org/releases/X11R7.7/src/everything/libxcb-1.8.1.tar.bz2 -Source142: http://www.x.org/releases/X11R7.7/src/everything/libxkbfile-1.0.8.tar.bz2 -Source143: http://www.x.org/releases/X11R7.7/src/everything/makedepend-1.0.4.tar.bz2 -Source144: http://www.x.org/releases/X11R7.7/src/everything/randrproto-1.3.2.tar.bz2 -Source145: http://www.x.org/releases/X11R7.7/src/everything/recordproto-1.14.2.tar.bz2 -Source146: http://www.x.org/releases/X11R7.7/src/everything/renderproto-0.11.1.tar.bz2 -Source147: http://www.x.org/releases/X11R7.7/src/everything/resourceproto-1.2.0.tar.bz2 -Source148: http://www.x.org/releases/X11R7.7/src/everything/scrnsaverproto-1.2.2.tar.bz2 -Source149: http://www.x.org/releases/X11R7.7/src/everything/util-macros-1.17.tar.bz2 -Source150: http://www.x.org/releases/X11R7.7/src/everything/videoproto-2.3.1.tar.bz2 -Source151: http://www.x.org/releases/X11R7.7/src/everything/xcb-proto-1.7.1.tar.bz2 -Source152: http://www.x.org/releases/X11R7.7/src/everything/xcmiscproto-1.2.2.tar.bz2 -Source153: http://www.x.org/releases/X11R7.7/src/everything/xextproto-7.2.1.tar.bz2 -Source154: http://www.x.org/releases/X11R7.7/src/everything/xf86bigfontproto-1.2.0.tar.bz2 -Source155: http://www.x.org/releases/X11R7.7/src/everything/xf86dgaproto-2.1.tar.bz2 -Source156: http://www.x.org/releases/X11R7.7/src/everything/xf86driproto-2.1.1.tar.bz2 -Source157: http://www.x.org/releases/X11R7.7/src/everything/xf86vidmodeproto-2.3.1.tar.bz2 -Source158: http://www.x.org/releases/X11R7.7/src/everything/xineramaproto-1.2.1.tar.bz2 -Source159: http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 -Source160: http://www.x.org/releases/X11R7.7/src/everything/xproto-7.0.23.tar.bz2 -Source161: http://www.x.org/releases/X11R7.7/src/everything/xrandr-1.3.5.tar.bz2 -Source162: http://www.x.org/releases/X11R7.7/src/everything/xtrans-1.2.7.tar.bz2 - -Source200: http://fontconfig.org/release/fontconfig-2.8.0.tar.gz -Source201: http://download.savannah.gnu.org/releases/freetype/freetype-old/freetype-2.3.11.tar.bz2 -Source202: http://xorg.freedesktop.org/archive/individual/lib/pixman-0.32.4.tar.bz2 -Source203: http://dri.freedesktop.org/libdrm/libdrm-2.4.52.tar.bz2 -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. -# to prevent this, build a static libsha1 and link against that. -# NOTE: -Source205: https://github.com/dottedmag/libsha1/archive/0.3.tar.gz - -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -# xorg requires newer versions of automake, & autoconf than are available with el5. Use el6 versions. -BuildRequires: automake >= 1.11, autoconf >= 2.60, libtool >= 1.4, gettext >= 0.14.4, gettext-devel >= 0.14.4, bison-devel, python26 -BuildRequires: pam-devel -BuildRequires: cmake28 -BuildRequires: pkgconfig >= 0.20 -BuildRequires: gcc44, gcc44-c++ -BuildRequires: glibc-devel, libstdc++-devel, libpng-devel -BuildRequires: expat-devel -BuildRequires: git, gperf, intltool, libtalloc-devel -BuildRequires: kernel-headers, libatomic_ops-devel -BuildRequires: xz -%if !%{_bootstrap} -BuildRequires: %{name}-static-devel == %{version} -BuildRequires: nasm >= 2.01 -%endif - -Requires(post): initscripts chkconfig coreutils -Requires(postun):coreutils -Requires: hicolor-icon-theme -Requires: tigervnc-license - -Provides: vnc = 4.1.3-2, vnc-libs = 4.1.3-2 -Obsoletes: vnc < 4.1.3-2, vnc-libs < 4.1.3-2 -Provides: tightvnc = 1.5.0-0.15.20090204svn3586 -Obsoletes: tightvnc < 1.5.0-0.15.20090204svn3586 - -# tigervnc patches -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 - -# freetype patches -Patch20: freetype-2.1.10-enable-ft2-bci.patch -Patch21: freetype-2.3.0-enable-spr.patch - -# Enable otvalid and gxvalid modules -Patch46: freetype-2.2.1-enable-valid.patch - -# Fix multilib conflicts -Patch88: freetype-multilib.patch - -Patch89: freetype-2.3.11-CVE-2010-2498.patch -Patch90: freetype-2.3.11-CVE-2010-2499.patch -Patch91: freetype-2.3.11-CVE-2010-2500.patch -Patch92: freetype-2.3.11-CVE-2010-2519.patch -Patch93: freetype-2.3.11-CVE-2010-2520.patch -Patch96: freetype-2.3.11-CVE-2010-1797.patch -Patch97: freetype-2.3.11-CVE-2010-2805.patch -Patch98: freetype-2.3.11-CVE-2010-2806.patch -Patch99: freetype-2.3.11-CVE-2010-2808.patch -Patch100: freetype-2.3.11-CVE-2010-3311.patch -Patch101: freetype-2.3.11-CVE-2010-3855.patch -Patch102: freetype-2.3.11-CVE-2011-0226.patch -Patch103: freetype-2.3.11-CVE-2011-3256.patch -Patch104: freetype-2.3.11-CVE-2011-3439.patch -Patch105: freetype-2.3.11-CVE-2012-1126.patch -Patch106: freetype-2.3.11-CVE-2012-1127.patch -Patch107: freetype-2.3.11-CVE-2012-1130.patch -Patch108: freetype-2.3.11-CVE-2012-1131.patch -Patch109: freetype-2.3.11-CVE-2012-1132.patch -Patch110: freetype-2.3.11-CVE-2012-1134.patch -Patch111: freetype-2.3.11-CVE-2012-1136.patch -Patch112: freetype-2.3.11-CVE-2012-1137.patch -Patch113: freetype-2.3.11-CVE-2012-1139.patch -Patch114: freetype-2.3.11-CVE-2012-1140.patch -Patch115: freetype-2.3.11-CVE-2012-1141.patch -Patch116: freetype-2.3.11-CVE-2012-1142.patch -Patch117: freetype-2.3.11-CVE-2012-1143.patch -Patch118: freetype-2.3.11-CVE-2012-1144.patch -Patch119: freetype-2.3.11-bdf-overflow.patch -Patch120: freetype-2.3.11-array-initialization.patch -Patch121: freetype-2.3.11-CVE-2012-5669.patch - -# Patches for Xorg CVE-2014-12-09 taken from Debian: -# https://release.debian.org/proposed-updates/stable_diffs/xorg-server_1.12.4-6+deb7u5.debdiff -Patch10000: 16_CVE-2014-mult.diff -Patch10001: 17_CVE-regressions.diff -# http://www.x.org/wiki/Development/Security/Advisory-2015-02-10/ -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 -Patch10005: CVE-2015-1804.diff -# http://lists.x.org/archives/xorg-announce/2015-April/002561.html -Patch10006: CVE-2013-7439.diff - -%description -Virtual Network Computing (VNC) is a remote display system which -allows you to view a computing 'desktop' environment not only on the -machine where it is running, but from anywhere on the Internet and -from a wide variety of machine architectures. This package contains a -client which will allow you to connect to other desktops running a VNC -server. - -%package server -Summary: A TigerVNC server -Group: User Interface/X -Provides: vnc-server = 4.1.3-2, vnc-libs = 4.1.3-2 -Obsoletes: vnc-server < 4.1.3-2, vnc-libs < 4.1.3-2 -Provides: tightvnc-server = 1.5.0-0.15.20090204svn3586 -Obsoletes: tightvnc-server < 1.5.0-0.15.20090204svn3586 -Requires: perl -Requires: tigervnc-server-minimal -Requires: xorg-x11-xauth - -%description server -The VNC system allows you to access the same desktop from a wide -variety of platforms. This package includes set of utilities -which make usage of TigerVNC server more user friendly. It also -contains x0vncserver program which can export your active -X session. - -%package server-minimal -Summary: A minimal installation of TigerVNC server -Group: User Interface/X -Requires(post): chkconfig -Requires(preun):chkconfig -Requires(preun):initscripts -Requires(postun):initscripts - -Requires: xkeyboard-config, xorg-x11-xkb-utils -Requires: keyutils-libs-devel -Requires: tigervnc-license - -%description server-minimal -The VNC system allows you to access the same desktop from a wide -variety of platforms. This package contains minimal installation -of TigerVNC server, allowing others to access the desktop on your -machine. - -%package license -Summary: License of TigerVNC suite -Group: User Interface/X -%if 0%{?fedora} >= 10 || 0%{?rhel} >= 6 || 0%{?centos} >= 6 -BuildArch: noarch -%endif - -%description license -This package contains license of the TigerVNC suite - -%package icons -Summary: Icons for TigerVNC viewer -Group: User Interface/X -%if 0%{?fedora} >= 10 || 0%{?rhel} >= 6 || 0%{?centos} >= 6 -BuildArch: noarch -%endif - -%description icons -This package contains icons for TigerVNC viewer - -%if %{_bootstrap} -%package static-devel -Summary: Static development files necessary to build TigerVNC -Group: Development/Libraries - -%description static-devel -This package contains static development files necessary to build TigerVNC -%endif - -%prep -rm -rf $RPM_BUILD_ROOT -rm -rf %{_builddir}/%{name}-%{version}%{?snap:-%{snap}} -%setup -q -n %{name}-%{version}%{?snap:-%{snap}} - -# Search paths for X11 are hard coded into FindX11.cmake -cp %SOURCE9 cmake/Modules/ -sed -i -e "s#@_includedir@#%{xorg_buildroot}%{_includedir}#" cmake/Modules/FindX11.cmake -sed -i -e "s#@_libdir@#%{xorg_buildroot}%{_libdir}#" cmake/Modules/FindX11.cmake -%patch12 -p1 -b .static-build-fixes - -%if %{_bootstrap} -tar xzf %SOURCE11 -pushd fltk-* -%patch15 -p1 -b .static-libs -popd - -tar xzf %SOURCE12 -tar xjf %SOURCE13 -tar xjf %SOURCE14 -tar xzf %SOURCE15 -tar xzf %SOURCE16 -xzcat %SOURCE17 | tar xf - -%endif - -mkdir xorg -pushd xorg -%if %{_bootstrap} -tar xjf %SOURCE100 -tar xjf %SOURCE101 -tar xjf %SOURCE102 -tar xjf %SOURCE103 -tar xjf %SOURCE104 -tar xjf %SOURCE105 -tar xjf %SOURCE106 -tar xjf %SOURCE107 -tar xjf %SOURCE108 -tar xjf %SOURCE109 -tar xjf %SOURCE110 -tar xjf %SOURCE111 -tar xjf %SOURCE112 -tar xjf %SOURCE113 -pushd libX11-* -%patch10006 -p1 -b .CVE-2013-7439 -popd -tar xjf %SOURCE114 -tar xjf %SOURCE115 -tar xjf %SOURCE116 -tar xjf %SOURCE117 -tar xjf %SOURCE118 -tar xjf %SOURCE119 -tar xjf %SOURCE120 -tar xjf %SOURCE121 -tar xjf %SOURCE122 -tar xjf %SOURCE123 -pushd libXfont-* -%patch10003 -p1 -b .CVE-2015-1802 -%patch10004 -p1 -b .CVE-2015-1803 -%patch10005 -p1 -b .CVE-2015-1804 -popd -tar xjf %SOURCE124 -tar xjf %SOURCE125 -tar xjf %SOURCE126 -tar xjf %SOURCE127 -tar xjf %SOURCE128 -tar xjf %SOURCE129 -tar xjf %SOURCE130 -tar xjf %SOURCE131 -tar xjf %SOURCE132 -tar xjf %SOURCE133 -tar xjf %SOURCE134 -tar xjf %SOURCE135 -tar xjf %SOURCE136 -tar xjf %SOURCE137 -tar xjf %SOURCE138 -tar xjf %SOURCE139 - -tar xjf %SOURCE141 -tar xjf %SOURCE142 -tar xjf %SOURCE143 -tar xjf %SOURCE144 -tar xjf %SOURCE145 -tar xjf %SOURCE146 -tar xjf %SOURCE147 -tar xjf %SOURCE148 -tar xjf %SOURCE149 -tar xjf %SOURCE150 -tar xjf %SOURCE151 -tar xjf %SOURCE152 -tar xjf %SOURCE153 -tar xjf %SOURCE154 -tar xjf %SOURCE155 -tar xjf %SOURCE156 -tar xjf %SOURCE157 -tar xjf %SOURCE158 -%endif -tar xjf %SOURCE159 -%if %{_bootstrap} -tar xjf %SOURCE160 -tar xjf %SOURCE161 -tar xjf %SOURCE162 -tar xzf %SOURCE200 -tar xjf %SOURCE201 -pushd freetype-* -%patch46 -p1 -b .enable-valid -%patch88 -p1 -b .multilib -%patch89 -p1 -b .CVE-2010-2498 -%patch90 -p1 -b .CVE-2010-2499 -%patch91 -p1 -b .CVE-2010-2500 -%patch92 -p1 -b .CVE-2010-2519 -%patch93 -p1 -b .CVE-2010-2520 -%patch96 -p1 -b .CVE-2010-1797 -%patch97 -p1 -b .CVE-2010-2805 -%patch98 -p1 -b .CVE-2010-2806 -%patch99 -p1 -b .CVE-2010-2808 -%patch100 -p1 -b .CVE-2010-3311 -%patch101 -p1 -b .CVE-2010-3855 -%patch102 -p1 -b .CVE-2011-0226 -%patch103 -p1 -b .CVE-2011-3256 -%patch104 -p1 -b .CVE-2011-3439 -%patch105 -p1 -b .CVE-2012-1126 -%patch106 -p1 -b .CVE-2012-1127 -%patch107 -p1 -b .CVE-2012-1130 -%patch108 -p1 -b .CVE-2012-1131 -%patch109 -p1 -b .CVE-2012-1132 -%patch110 -p1 -b .CVE-2012-1134 -%patch111 -p1 -b .CVE-2012-1136 -%patch112 -p1 -b .CVE-2012-1137 -%patch113 -p1 -b .CVE-2012-1139 -%patch114 -p1 -b .CVE-2012-1140 -%patch115 -p1 -b .CVE-2012-1141 -%patch116 -p1 -b .CVE-2012-1142 -%patch117 -p1 -b .CVE-2012-1143 -%patch118 -p1 -b .CVE-2012-1144 -%patch119 -p1 -b .bdf-overflow -%patch120 -p1 -b .array-initialization -%patch121 -p1 -b .CVE-2012-5669 -popd -tar xjf %SOURCE202 -tar xjf %SOURCE203 -tar xjf %SOURCE204 -%endif -pushd xorg-server-1* -%patch10000 -p1 -b .CVE-2014-mult -%patch10001 -p1 -b .CVE-regressions -%patch10002 -p1 -b .CVE-2015-0255 -for f in `find . -type f -perm -000`; do - chmod +r "$f" -done -popd -%if %{_bootstrap} -tar xzf %SOURCE205 -%endif -popd - -cp -a xorg/xorg-server-1*/* unix/xserver - -pushd unix/xserver -for all in `find . -type f -perm -001`; do - chmod -x "$all" -done -patch -p1 < %{_builddir}/%{name}-%{version}%{?snap:-%{snap}}/unix/xserver112.patch -%patch13 -p1 -b .dridir -%patch14 -p1 -b .xkbcompdir - -popd - -%build -export CC=gcc44 -export CXX=g++44 -export CFLAGS="-g $RPM_OPT_FLAGS -fPIC" -export CXXFLAGS="$CFLAGS -static-libgcc" -export PYTHON=python26 - -%if %{_bootstrap} -mkdir -p %{xorg_buildroot}%{_libdir} -pushd %{xorg_buildroot}%{_libdir} -ln -s `g++44 -print-file-name=libz.a` . -ln -s `g++44 -print-file-name=libgcc.a` . -ln -s `g++44 -print-file-name=libexpat.a` . -ln -s `g++44 -print-file-name=libcrypto.a` . -popd - -echo "*** Building libjpeg-turbo ***" -pushd libjpeg-turbo-* -LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --disable-nls --enable-static --disable-shared -make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install -popd - -echo "*** Building Xorg ***" -pushd xorg - -echo "*** Building libsha1 ***" -pushd libsha1-* -autoreconf -fiv -LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --disable-nls --enable-static --disable-shared -make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install -find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \; -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \; -popd -popd -%endif - -export CFLAGS="$RPM_OPT_FLAGS -fPIC -I%{xorg_buildroot}%{_includedir}" -export CXXFLAGS="$RPM_OPT_FLAGS -fPIC -I%{xorg_buildroot}%{_includedir} -static-libgcc" -export CPPFLAGS=$CXXFLAGS -export LDFLAGS="-L%{xorg_buildroot}%{_libdir} -L%{xorg_buildroot}%{_libdir}/tigervnc $LDFLAGS" -export ACLOCAL="aclocal -I %{xorg_buildroot}%{_datadir}/aclocal" -export PKG_CONFIG_PATH="%{xorg_buildroot}%{_libdir}/pkgconfig:%{xorg_buildroot}%{_libdir}/tigervnc/pkgconfig:%{xorg_buildroot}%{_datadir}/pkgconfig:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig" - -%if %{_bootstrap} -echo "*** Building gmp ***" -pushd gmp-* -%ifarch x86_64 s390x ia64 ppc64 alpha sparc64 -LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ABI=64 ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --enable-cxx -%else -LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ABI=32 ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --enable-cxx -%endif -make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install -find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \; -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \; -popd - -echo "*** Building libtasn1 ***" -pushd libtasn1-* -LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared -make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install -find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \; -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \; -popd - -echo "*** Building nettle ***" -pushd nettle-* -autoreconf -fiv -LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --disable-openssl -make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install -find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \; -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \; -popd - -echo "*** Building gnutls ***" -pushd gnutls-* -LDFLAGS="-L%{xorg_buildroot}%{_libdir} -lgmp $LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure \ - --host=%{_host} \ - --build=%{_build} \ - --prefix=%{_prefix} \ - --libdir=%{_libdir} \ - --enable-static \ - --disable-shared \ - --without-p11-kit \ - --disable-guile \ - --disable-srp-authentication \ - --disable-libdane \ - --disable-doc \ - --enable-local-libopts \ - --without-tpm \ - --disable-dependency-tracking \ - --disable-silent-rules \ - --disable-heartbeat-support -make %{?_smp_mflags} DESTDIR=%{xorg_buildroot} install -find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \; -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \; -popd - -pushd xorg - -echo "*** Building freetype ***" -pushd freetype-* -LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared -sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' builds/unix/libtool -sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' builds/unix/libtool -make DESTDIR=%{xorg_buildroot} install -# FIXME: fontconfig bails out if we delete the libtool archives -find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -exec sed -i -e "s|libdir='%{_libdir}'|libdir='%{xorg_buildroot}%{_libdir}'|" {} \; -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \; -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \; -# fix multilib issues -%ifarch x86_64 s390x ia64 ppc64 alpha sparc64 -%define wordsize 64 -%else -%define wordsize 32 -%endif - -mv %{xorg_buildroot}%{_includedir}/freetype2/freetype/config/ftconfig.h \ - %{xorg_buildroot}%{_includedir}/freetype2/freetype/config/ftconfig-%{wordsize}.h -cat >%{xorg_buildroot}%{_includedir}/freetype2/freetype/config/ftconfig.h <<EOF -#ifndef __FTCONFIG_H__MULTILIB -#define __FTCONFIG_H__MULTILIB - -#include <bits/wordsize.h> - -#if __WORDSIZE == 32 -# include "ftconfig-32.h" -#elif __WORDSIZE == 64 -# include "ftconfig-64.h" -#else -# error "unexpected value for __WORDSIZE macro" -#endif - -#endif -EOF -popd - -echo "*** Building fontconfig ***" -pushd fontconfig-* -autoreconf -fiv -LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" HASDOCBOOK=no ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared --with-confdir=%{_sysconfdir}/fonts --with-cache-dir=%{_localstatedir}/cache/fontconfig --with-default-fonts=%{_datadir}/fonts --with-add-fonts="%{_datadir}/X11/fonts/Type1,%{_datadir}/X11/fonts/OTF,%{_datadir}/X11/fonts/TTF,%{_datadir}/X11/fonts/misc,%{_datadir}/X11/fonts/100dpi,%{_datadir}/X11/fonts/75dpi,%{_prefix}/local/share/fonts,~/.fonts" -make %{?_smp_mflags} -make DESTDIR=%{xorg_buildroot} install -find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \; -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \; -popd - -pushd util-macros-* -echo "Building macros" -LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} --enable-static --disable-shared -make DESTDIR=%{xorg_buildroot} install -find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \; -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \; -popd - -modules="\ - bigreqsproto \ - compositeproto \ - damageproto \ - dri2proto \ - fixesproto \ - fontsproto \ - glproto \ - inputproto \ - kbproto \ - randrproto \ - recordproto \ - renderproto \ - resourceproto \ - scrnsaverproto \ - videoproto \ - xcb-proto \ - xproto \ - xcmiscproto \ - xextproto \ - xf86bigfontproto \ - xf86dgaproto \ - xf86driproto \ - xf86vidmodeproto \ - xineramaproto \ - makedepend \ - xtrans \ - libXau \ - libXdmcp \ - libxcb \ - libX11 \ - libXext \ - libfontenc \ - libICE \ - libSM \ - libXt \ - libXmu \ - libXpm \ - libXaw \ - libXfixes \ - libXcomposite \ - libXrender \ - libXdamage \ - libXcursor \ - libXfont \ - libXft \ - libXi \ - libXinerama \ - libxkbfile \ - libXrandr \ - libXres \ - libXScrnSaver \ - libXtst \ - libXv \ - libXxf86dga \ - libXxf86vm \ - libpciaccess \ - pixman \ - libdrm \ - font-util" - -for module in ${modules}; do - extraoptions="" - pushd ${module}-* - echo ====================== - echo configuring ${module} - echo ====================== -%ifarch i386 i686 x86_64 - if [ "${module}" = "libdrm" ]; then - autoreconf -fiv - extraoptions="${extraoptions} --enable-udev --disable-libkms --disable-manpages --disable-intel --disable-radeon --disable-nouveau --disable-vmwgfx" - fi -%endif - if [ "${module}" = "libXdmcp" ]; then - autoreconf -fiv - fi - if [ "${module}" = "libXcursor" ]; then - autoreconf -fiv - fi - if [ "${module}" = "libfontenc" ]; then - autoconf - fi - if [ "${module}" = "libXi" ]; then - autoreconf -fiv - fi - if [ "${module}" = "libXaw" ]; then - extraoptions="${extraoptions} --disable-xaw8 --disable-xaw6" - fi - if [ "${module}" = "libxcb" ]; then - sed -i 's/pthread-stubs //' configure.ac - autoreconf -fiv - fi - if [ "${module}" = "libX11" ]; then - autoreconf -fiv - extraoptions="${extraoptions} --disable-specs" - fi - if [ "${module}" = "libSM" ]; then - extraoptions="${extraoptions} --without-libuuid" - fi - if [ "${module}" = "pixman" ]; then - extraoptions="${extraoptions} --disable-gtk --disable-openmp" - aclocal -I %{xorg_buildroot}%{_datadir}/aclocal - autoconf - autoreconf -fiv - fi - if [ "${module}" = "libXfont" ]; then - extraoptions="${extraoptions} --with-freetype-config=%{xorg_buildroot}%{_bindir}/freetype-config" - fi - if [ "${module}" = "libXScrnSaver" ]; then - LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic - elif [ "${module}" = "libxkbfile" ]; then - LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic - elif [ "${module}" = "pixman" ]; then - LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic - elif [ "${module}" = "libXt" ]; then - LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" CFLAGS="$CFLAGS -fno-strict-aliasing" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic --with-xfile-search-path="%{_sysconfdir}/X11/%%L/%%T/%%N%%C%%S:%{_sysconfdir}/X11/%%l/%%T/\%%N%%C%%S:%{_sysconfdir}/X11/%%T/%%N%%C%%S:%{_sysconfdir}/X11/%%L/%%T/%%N%%S:%{_sysconfdir}/X\11/%%l/%%T/%%N%%S:%{_sysconfdir}/X11/%%T/%%N%%S:%{_datadir}/X11/%%L/%%T/%%N%%C%%S:%{_datadir}/X1\1/%%l/%%T/%%N%%C%%S:%{_datadir}/X11/%%T/%%N%%C%%S:%{_datadir}/X11/%%L/%%T/%%N%%S:%{_datadir}/X11/%%\l/%%T/%%N%%S:%{_datadir}/X11/%%T/%%N%%S" - elif [ "${module}" = "libX11" ]; then - LDFLAGS="$LDFLAGS -lpthread" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --disable-static --enable-shared --with-pic - elif [ "${module}" = "libXtst" ]; then - LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic - elif [ "${module}" = "libXpm" ]; then - LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic - else - LDFLAGS="$LDFLAGS -static" PKG_CONFIG="pkg-config --static" ./configure --host=%{_host} --build=%{_build} --prefix=%{_prefix} --libdir=%{_libdir} ${extraoptions} --enable-static --disable-shared --with-pic - fi - echo ====================== - echo building ${module} - echo ====================== - make DESTDIR=%{xorg_buildroot} - if [ "${module}" = "libX11" ]; then - make DESTDIR=%{xorg_buildroot} INSTALL="install -p" install - else - make DESTDIR=%{xorg_buildroot} install - fi - find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete - find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \; - 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 - 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 - elif [ "${module}" = "libSM" ]; then - echo 'Libs.private: -L${libdir} -lICE' >> %{xorg_buildroot}%{_libdir}/pkgconfig/sm.pc - fi - - popd -done -%else -pushd xorg -%endif - -%if %{_bootstrap} -# build mesa -echo "*** Building Mesa ***" -pushd Mesa-* -export PYTHON2=python26 -%ifarch %{ix86} -sed -i -e 's/-std=c99/-std=gnu99/g' configure.ac -%endif -autoreconf -fiv -%ifarch %{ix86} -# i do not have words for how much the assembly dispatch code infuriates me -%define common_flags --disable-selinux --enable-pic --disable-asm -%else -%define common_flags --disable-selinux --enable-pic -%endif - -# link libGL statically against any xorg libraries built above -LDFLAGS="$LDFLAGS -Wl,-Bstatic -lxcb -lXdmcp -lXau -lXext -lXxf86vm -ldrm -Wl,-Bdynamic -lX11 -lpthread -Wl,-rpath,"'\$$'"ORIGIN/../..%{_libdir}/tigervnc:%{_libdir}/tigervnc:%{_libdir}" \ -PKG_CONFIG="pkg-config --static" ./configure %{common_flags} \ - --host=%{_host} \ - --build=%{_build} \ - --prefix=%{_prefix} \ - --libdir=%{_libdir}/tigervnc \ - --disable-osmesa \ - --disable-shared-glapi \ - --disable-egl \ - --disable-gbm \ - --enable-glx \ - --disable-glx-tls \ - --disable-opencl \ - --disable-xvmc \ - --with-dri-driverdir=%{_libdir}/tigervnc/dri \ - --disable-gallium-egl \ - --with-gallium-drivers="" \ - --with-dri-drivers=swrast - -make DESTDIR=%{xorg_buildroot} -make install DESTDIR=%{xorg_buildroot} -find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=%{xorg_buildroot}%{_libdir}|" {} \; -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=%{xorg_buildroot}%{_prefix}|" {} \; -popd -%endif - -popd - -%if %{_bootstrap} -echo "*** Building libpng ***" -pushd libpng-* -CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" ./configure \ - --host=%{_host} \ - --build=%{_build} \ - --prefix=%{_prefix} \ - --libdir=%{_libdir} \ - --disable-shared \ - --enable-static -make %{?_smp_mflags} -make DESTDIR=%{xorg_buildroot} install -popd - -echo "*** Building fltk ***" -pushd fltk-* -%endif -export CMAKE_PREFIX_PATH="%{xorg_buildroot}%{_prefix}:%{_prefix}" -export CMAKE_EXE_LINKER_FLAGS=$LDFLAGS -export PKG_CONFIG="pkg-config --static" -%if %{_bootstrap} -./configure \ - --host=%{_host} \ - --build=%{_build} \ - --prefix=%{_prefix} \ - --libdir=%{_libdir} \ - --enable-x11 \ - --enable-gl \ - --disable-shared \ - --enable-localjpeg \ - --enable-localzlib \ - --disable-localpng \ - --enable-xinerama \ - --enable-xft \ - --enable-xdbe \ - --enable-xfixes \ - --enable-xcursor \ - --with-x -make %{?_smp_mflags} -make DESTDIR=%{xorg_buildroot} install -popd -%endif - -echo "*** Building VNC ***" -export CFLAGS="$CFLAGS -fPIC" -export CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -c //g'` -%{cmake28} -G"Unix Makefiles" \ - -DFLTK_FLUID_EXECUTABLE=%{xorg_buildroot}%{_bindir}/fluid \ - -DFLTK_LIBRARY_DIR=%{xorg_buildroot}%{_libdir} \ - -DFLTK_INCLUDE_DIR=%{xorg_buildroot}%{_includedir} \ - -DBUILD_STATIC=1 \ - -DCMAKE_BUILD_TYPE=Release \ - -DUSE_INCLUDED_ZLIB=0 \ - -DZLIB_INCLUDE_DIR=%{_includedir} \ - -DZLIB_LIBRARY=%{_libdir}/libz.a \ - -DCMAKE_INSTALL_PREFIX=%{_prefix} - -make %{?_smp_mflags} - -pushd unix/xserver -export PIXMANINCDIR=%{xorg_buildroot}%{_includedir}/pixman-1 -sed -i -e 's/^\(\s*WAYLAND_SCANNER_RULES.*\)/dnl\1/' configure.ac -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 -Wl,-rpath,"'\$$'"ORIGIN/../..%{_libdir}/tigervnc:%{_libdir}/tigervnc:%{_libdir}" \ -%configure \ - --prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_datadir}/man \ - --sysconfdir=%{_sysconfdir} --localstatedir=%{_localstatedir} \ - --with-vendor-name="The TigerVNC Project" --with-vendor-name-short="TigerVNC" \ - --with-vendor-web="https://www.tigervnc.org" \ - --disable-xorg --disable-xnest --disable-xvfb --disable-dmx \ - --disable-xwin --disable-xephyr --disable-kdrive --disable-wayland \ - --with-pic --enable-static --disable-shared --enable-xinerama \ - --with-default-xkb-rules=base \ - --with-default-font-path="catalogue:%{_sysconfdir}/X11/fontpath.d,%{_datadir}/X11/fonts/misc,%{_datadir}/X11/fonts/OTF,%{_datadir}/X11/fonts/TTF,%{_datadir}/X11/fonts/Type1,%{_datadir}/X11/fonts/100dpi,%{_datadir}/X11/fonts/75dpi,built-ins" \ - --with-serverconfig-path=%{_libdir}/xorg \ - --with-fontrootdir=%{_datadir}/X11/fonts \ - --with-xkb-output=%{_localstatedir}/lib/xkb \ - --enable-install-libxf86config \ - --enable-glx --disable-glx-tls --disable-dri --enable-dri2 --disable-dri3 \ - --disable-present \ - --disable-config-dbus \ - --disable-config-hal \ - --disable-config-udev \ - --without-dtrace \ - --disable-unit-tests \ - --disable-docs \ - --disable-devel-docs \ - --disable-selective-werror \ - --with-sha1=libsha1 - -make TIGERVNC_SRCDIR=%{tigervnc_src_dir} %{?_smp_mflags} -popd - -# Build icons -pushd media -make -popd - -%install -make install DESTDIR=$RPM_BUILD_ROOT - -pushd unix/xserver/hw/vnc -make install DESTDIR=$RPM_BUILD_ROOT -popd - -mkdir -p $RPM_BUILD_ROOT%{_libdir}/tigervnc/dri -install -m644 -p %{xorg_buildroot}%{_libdir}/tigervnc/dri/swrast_dri.so $RPM_BUILD_ROOT%{_libdir}/tigervnc/dri -for f in `find %{xorg_buildroot}%{_libdir}/tigervnc -name "lib*" -print` ; do -cp -a $f $RPM_BUILD_ROOT%{_libdir}/tigervnc -done - -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig -install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/vncserver -install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/vncservers - -%find_lang %{name} %{name}.lang - -%if %{_bootstrap} -find %{xorg_buildroot}%{_prefix} -type f -name "*.la" -delete -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{xorg_buildroot}%{_libdir}|libdir=/opt/%{name}/%{scl_name}%{_libdir}|" {} \; -find %{xorg_buildroot}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{xorg_buildroot}%{_prefix}|prefix=/opt/%{name}/%{scl_name}%{_prefix}|" {} \; -%endif - -# remove unwanted files -rm -rf $RPM_BUILD_ROOT%{_libdir}/tigervnc/pkgconfig -rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig -rm -rf $RPM_BUILD_ROOT%{_libdir}/xorg -rm -rf $RPM_BUILD_ROOT%{_includedir} -rm -f $RPM_BUILD_ROOT%{_libdir}/tigervnc/*.la -rm -f $RPM_BUILD_ROOT%{_libdir}/tigervnc/dri/*.la - -%clean -rm -rf $RPM_BUILD_ROOT - -%post -touch -c %{_datadir}/icons/hicolor -if [ -x %{_bindir}/gtk-update-icon-cache ]; then - %{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor || : -fi - -%postun -touch -c %{_datadir}/icons/hicolor -if [ -x %{_bindir}/gtk-update-icon-cache ]; then - %{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor || : -fi - -%post server -/sbin/chkconfig --add vncserver - -%preun server -if [ $1 -eq 0 ]; then - /sbin/service vncserver stop &>/dev/null || : - /sbin/chkconfig --del vncserver -fi - -%postun server -/sbin/service vncserver condrestart &>/dev/null || : - -%files -f %{name}.lang -%defattr(-,root,root,-) -%doc README.rst -%{_bindir}/vncviewer -%{_datadir}/applications/* -%{_mandir}/man1/vncviewer.1* - -%files server -%defattr(-,root,root,-) -%config(noreplace) %{_sysconfdir}/sysconfig/vncservers -%config(noreplace) %{_sysconfdir}/init.d/vncserver -%{_bindir}/x0vncserver -%{_bindir}/vncserver -%{_mandir}/man1/vncserver.1* -%{_mandir}/man1/x0vncserver.1* - -%files server-minimal -%defattr(-,root,root,-) -%{_bindir}/vncconfig -%{_bindir}/vncpasswd -%{_bindir}/Xvnc -%{_mandir}/man1/Xvnc.1* -%{_mandir}/man1/vncpasswd.1* -%{_mandir}/man1/vncconfig.1* -%{_libdir}/* - -%files license -%defattr(-,root,root,-) -%doc LICENCE.TXT - -%files icons -%defattr(-,root,root,-) -%{_datadir}/icons/hicolor/*/apps/* - -%if %{_bootstrap} -%files static-devel -%defattr(-,root,root,-) -/opt/%{name}/%{scl_name}%{_sysconfdir}/* -/opt/%{name}/%{scl_name}%{_bindir}/* -/opt/%{name}/%{scl_name}%{_datadir}/* -/opt/%{name}/%{scl_name}%{_includedir}/* -/opt/%{name}/%{scl_name}%{_libdir}/* -%ifarch x86_64 s390x ia64 ppc64 alpha sparc64 -/opt/%{name}/%{scl_name}%{_prefix}/lib/python2.6/* -%endif -%endif - -%changelog -* Fri Dec 11 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-3 -- Configure with --host and --build to avoid build host-specific compiler opts - -* Fri Nov 27 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-2 -- Split static pre-reqs into separate package - -* Thu Nov 26 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.6.80-1 -- Version bump for 1.6 release -- Update libjpeg-turbo, gnutls, libtasn1, libpng to latest upstream versions. - -* 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 14 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.4.80-6 -- Build static libraries to meet new minimum requirements - -* Sat Mar 07 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.4.80-5 -- Don't disable xinerama extension - -* Thu Feb 19 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.4.80-4 -- Bumped fltk to 1.3.3, no longer requires patching - -* Mon Jan 19 2015 Brian P. Hinz <bphinz@users.sourceforge.net> 1.4.0-3 -- Added default font paths to Xvnc and fontconfig -- Added vendor strings to Xvnc -- Specified xfile-search-path when configuring libXt the same way el6 does - -* Wed Dec 24 2014 Brian P. Hinz <bphinz@users.sourceforge.net> 1.4.80-1.20141119git59c5a55c -- Rebuilt against Xorg 7.7 with CVE-2104-12-09 patches from debian. -- Bumped versions of Mesa, Freetype, fontconfig, etc. -- Link against our own version of libGL to improve portability. -- Added static libsha1 to avoid linking against libssl.so. - -* Wed Nov 19 2014 Brian P. Hinz <bphinz@users.sourceforge.net> 1.3.80-18.20141119git59c5a55c -- Removed server module sub-package - -* Thu Nov 28 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.3.80-17.20131128svn5139 -- Bumped version to 1.3.80 -- Cleaned up linter warnings - -* Thu Jul 05 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.3.0 -- Upstream 1.3.0 release -- Conditional-ized %snap for release - -* Fri Jun 14 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.90-14.20130531svn5120 -- Update libjpeg-turbo to 1.3.0 - -* Fri May 24 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.90-14.20130524svn5114 -- Improve spec file portability - -* Fri May 17 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.90-13.20130425svn5087 -- Improve portability with more static linking - -* Thu Apr 04 2013 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.80-12.20130330svn5066 -- Added conditional -march arg to libdrm-intel to allow building on i386 -- Fixed version to reflect upstream pre-release versioning - -* 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 - systemd versions. - -* Wed Nov 28 2012 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-7.20120915svn4999 -- 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 -- Applied icon support patch - -* Sat Sep 15 2012 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-5.20120915svn4999 -- Update to TigerVNC svn r4999 snapshot -- Build a static libjpeg-turbo to remove the external dependency -- Applied Cendio's Fltk patches, except for the icon patch which I cannot get to build - without creating undefined reference errors during linking - -* Thu Jul 19 2012 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-4.20120719svn4941 -- Update to TigerVNC svn r4941 snapshot -- Removed border-hook.patch since it's been committed - -* Wed Jul 18 2012 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-3.20120715svn4937 -- Update to TigerVNC svn r4937 snapshot -- Applied border-hook.patch from devel list to fix bug #3415308 -- Use build order recommended by cgit.freedesktop.org/xorg/util/modular/tree/build.sh -- Removed tigervnc11-rh692048.patch as it seems to break support for VeNCrypt - -* Sun Jul 15 2012 Brian P. Hinz <bphinz@users.sourceforge.net> 1.2.0-1.20120715svn4935 -- Adapted spec file for building static linked binary on RHEL5 from F16 - spec file and DRC's build-xorg script included in src tarball. -- Update to TigerVNC svn r4935 snapshot -- Need to use inkscape on RHEL5 because convert is broken - -* Tue Nov 22 2011 Adam Tkac <atkac redhat com> - 1.1.0-3 -- don't build X.Org devel docs (#755782) -- applet: BR generic java-devel instead of java-gcj-devel (#755783) -- use runuser to start Xvnc in systemd service file (#754259) -- don't attepmt to restart Xvnc session during update/erase (#753216) - -* Fri Nov 11 2011 Adam Tkac <atkac redhat com> - 1.1.0-2 -- libvnc.so: don't use unexported GetMaster function (#744881) -- remove nasm buildreq - -* Mon Sep 12 2011 Adam Tkac <atkac redhat com> - 1.1.0-1 -- update to 1.1.0 -- update the xorg11 patch -- patches merged - - tigervnc11-glx.patch - - tigervnc11-CVE-2011-1775.patch - - 0001-Use-memmove-instead-of-memcpy-in-fbblt.c-when-memory.patch - -* Thu Jul 28 2011 Adam Tkac <atkac redhat com> - 1.0.90-6 -- add systemd service file and remove legacy SysV initscript (#717227) - -* Tue May 12 2011 Adam Tkac <atkac redhat com> - 1.0.90-5 -- make Xvnc buildable against X.Org 1.11 - -* Tue May 10 2011 Adam Tkac <atkac redhat com> - 1.0.90-4 -- viewer can send password without proper validation of X.509 certs - (CVE-2011-1775) - -* Wed Apr 13 2011 Adam Tkac <atkac redhat com> - 1.0.90-3 -- fix wrong usage of memcpy which caused screen artifacts (#652590) -- don't point to inaccessible link in sysconfig/vncservers (#644975) - -* Fri Apr 08 2011 Adam Tkac <atkac redhat com> - 1.0.90-2 -- improve compatibility with vinagre client (#692048) - -* Tue Mar 22 2011 Adam Tkac <atkac redhat com> - 1.0.90-1 -- update to 1.0.90 - -* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.90-0.32.20110117svn4237 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Mon Jan 17 2011 Adam Tkac <atkac redhat com> 1.0.90-0.31.20110117svn4237 -- fix libvnc.so module loading - -* Mon Jan 17 2011 Adam Tkac <atkac redhat com> 1.0.90-0.30.20110117svn4237 -- update to r4237 -- patches merged - - tigervnc11-optionsdialog.patch - - tigervnc11-rh607866.patch - -* Fri Jan 14 2011 Adam Tkac <atkac redhat com> 1.0.90-0.29.20101208svn4225 -- improve patch for keyboard issues - -* Fri Jan 14 2011 Adam Tkac <atkac redhat com> 1.0.90-0.28.20101208svn4225 -- attempt to fix various keyboard-related issues (key repeating etc) - -* Fri Jan 07 2011 Adam Tkac <atkac redhat com> 1.0.90-0.27.20101208svn4225 -- render "Ok" and "Cancel" buttons in the options dialog correctly - -* Wed Dec 15 2010 Jan Görig <jgorig redhat com> 1.0.90-0.26.20101208svn4225 -- added vncserver lock file (#662784) - -* Fri Dec 10 2010 Adam Tkac <atkac redhat com> 1.0.90-0.25.20101208svn4225 -- update to r4225 -- patches merged - - tigervnc11-rh611677.patch - - tigervnc11-rh633931.patch - - tigervnc11-xorg1.10.patch -- enable VeNCrypt and PAM support - -* Mon Dec 06 2010 Adam Tkac <atkac redhat com> 1.0.90-0.24.20100813svn4123 -- rebuild against xserver 1.10.X -- 0001-Return-Success-from-generate_modkeymap-when-max_keys.patch merged - -* Wed Sep 29 2010 jkeating - 1.0.90-0.23.20100813svn4123 -- Rebuilt for gcc bug 634757 - -* Tue Sep 21 2010 Adam Tkac <atkac redhat com> 1.0.90-0.22.20100420svn4030 -- drop xorg-x11-fonts-misc dependency (#636170) - -* Tue Sep 21 2010 Adam Tkac <atkac redhat com> 1.0.90-0.21.20100420svn4030 -- improve patch for #633645 (fix tcsh incompatibilities) - -* Thu Sep 16 2010 Adam Tkac <atkac redhat com> 1.0.90-0.20.20100813svn4123 -- press fake modifiers correctly (#633931) -- supress unneeded debug information emitted from initscript (#633645) - -* Wed Aug 25 2010 Adam Tkac <atkac redhat com> 1.0.90-0.19.20100813svn4123 -- separate Xvnc, vncpasswd and vncconfig to -server-minimal subpkg (#626946) -- move license to separate subpkg and Requires it from main subpkgs -- Xvnc: handle situations when no modifiers exist well (#611677) - -* Fri Aug 13 2010 Adam Tkac <atkac redhat com> 1.0.90-0.18.20100813svn4123 -- update to r4123 (#617973) -- add perl requires to -server subpkg (#619791) - -* Thu Jul 22 2010 Adam Tkac <atkac redhat com> 1.0.90-0.17.20100721svn4113 -- update to r4113 -- patches merged - - tigervnc11-rh586406.patch - - tigervnc11-libvnc.patch - - tigervnc11-rh597172.patch - - tigervnc11-rh600070.patch - - tigervnc11-options.patch -- don't own %%{_datadir}/icons directory (#614301) -- minor improvements in the .desktop file (#616340) -- bundled libjpeg configure requires nasm; is executed even if system-wide - libjpeg is used - -* Fri Jul 02 2010 Adam Tkac <atkac redhat com> 1.0.90-0.16.20100420svn4030 -- build against system-wide libjpeg-turbo (#494458) -- build no longer requires nasm - -* Mon Jun 28 2010 Adam Tkac <atkac redhat com> 1.0.90-0.15.20100420svn4030 -- vncserver: accept <+optname> option when specified as the first one - -* Thu Jun 24 2010 Adam Tkac <atkac redhat com> 1.0.90-0.14.20100420svn4030 -- fix memory leak in Xvnc input code (#597172) -- don't crash when receive negative encoding (#600070) -- explicitly disable udev configuration support -- add gettext-autopoint to BR - -* Mon Jun 14 2010 Adam Tkac <atkac redhat com> 1.0.90-0.13.20100420svn4030 -- update URL about SSH tunneling in the sysconfig file (#601996) - -* Fri Jun 11 2010 Adam Tkac <atkac redhat com> 1.0.90-0.12.20100420svn4030 -- use newer gettext -- autopoint now uses git instead of cvs, adjust BuildRequires appropriately - -* Thu May 13 2010 Adam Tkac <atkac redhat com> 1.0.90-0.11.20100420svn4030 -- link libvnc.so "now" to catch "undefined symbol" errors during Xorg startup -- use always XkbConvertCase instead of XConvertCase (#580159, #586406) -- don't link libvnc.so against libXi.la, libdix.la and libxkb.la; use symbols - from Xorg instead - -* Thu May 13 2010 Adam Tkac <atkac redhat com> 1.0.90-0.10.20100420svn4030 -- update to r4030 snapshot -- patches merged to upstream - - tigervnc11-rh522369.patch - - tigervnc11-rh551262.patch - - tigervnc11-r4002.patch - - tigervnc11-r4014.patch - -* Thu Apr 08 2010 Adam Tkac <atkac redhat com> 1.0.90-0.9.20100219svn3993 -- add server-applet subpackage which contains Java vncviewer applet -- fix Java applet; it didn't work when run from web browser -- add xorg-x11-xkb-utils to server Requires - -* Fri Mar 12 2010 Adam Tkac <atkac redhat com> 1.0.90-0.8.20100219svn3993 -- add French translation to vncviewer.desktop (thanks to Alain Portal) - -* Thu Mar 04 2010 Adam Tkac <atkac redhat com> 1.0.90-0.7.20100219svn3993 -- don't crash during pixel format change (#522369, #551262) - -* Mon Mar 01 2010 Adam Tkac <atkac redhat com> 1.0.90-0.6.20100219svn3993 -- add mesa-dri-drivers and xkeyboard-config to -server Requires -- update to r3993 1.0.90 snapshot - - tigervnc11-noexecstack.patch merged - - tigervnc11-xorg18.patch merged - - xserver18.patch is no longer needed - -* Wed Jan 27 2010 Jan Gorig <jgorig redhat com> 1.0.90-0.5.20091221svn3929 -- initscript LSB compliance fixes (#523974) - -* Fri Jan 22 2010 Adam Tkac <atkac redhat com> 1.0.90-0.4.20091221svn3929 -- mark stack as non-executable in jpeg ASM code -- add xorg-x11-xauth to Requires -- add support for X.Org 1.8 -- drop shave sources, they are no longer needed - -* Thu Jan 21 2010 Adam Tkac <atkac redhat com> 1.0.90-0.3.20091221svn3929 -- drop tigervnc-xorg25909.patch, it has been merged to X.Org upstream - -* Thu Jan 07 2010 Adam Tkac <atkac redhat com> 1.0.90-0.2.20091221svn3929 -- add patch for upstream X.Org issue #25909 -- add libXdmcp-devel to build requires to build Xvnc with XDMCP support (#552322) - -* Mon Dec 21 2009 Adam Tkac <atkac redhat com> 1.0.90-0.1.20091221svn3929 -- update to 1.0.90 snapshot -- patches merged - - tigervnc10-compat.patch - - tigervnc10-rh510185.patch - - tigervnc10-rh524340.patch - - tigervnc10-rh516274.patch - -* Mon Oct 26 2009 Adam Tkac <atkac redhat com> 1.0.0-3 -- create Xvnc keyboard mapping before first keypress (#516274) - -* Thu Oct 08 2009 Adam Tkac <atkac redhat com> 1.0.0-2 -- update underlying X source to 1.6.4-0.3.fc11 -- remove bogus '-nohttpd' parameter from /etc/sysconfig/vncservers (#525629) -- initscript LSB compliance fixes (#523974) -- improve -LowColorSwitch documentation and handling (#510185) -- honor dotWhenNoCursor option (and it's changes) every time (#524340) - -* Fri Aug 28 2009 Adam Tkac <atkac redhat com> 1.0.0-1 -- update to 1.0.0 -- tigervnc10-rh495457.patch merged to upstream - -* Mon Aug 24 2009 Karsten Hopp <karsten@redhat.com> 0.0.91-0.17 -- fix ifnarch s390x for server-module - -* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 0.0.91-0.16 -- rebuilt with new openssl - -* Tue Aug 04 2009 Adam Tkac <atkac redhat com> 0.0.91-0.15 -- make Xvnc compilable - -* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.91-0.14.1 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - -* Mon Jul 13 2009 Adam Tkac <atkac redhat com> 0.0.91-0.13.1 -- don't write warning when initscript is called with condrestart param (#508367) - -* Tue Jun 23 2009 Adam Tkac <atkac redhat com> 0.0.91-0.13 -- temporary use F11 Xserver base to make Xvnc compilable -- BuildRequires: libXi-devel -- don't ship tigervnc-server-module on s390/s390x - -* Mon Jun 22 2009 Adam Tkac <atkac redhat com> 0.0.91-0.12 -- fix local rendering of cursor (#495457) - -* Thu Jun 18 2009 Adam Tkac <atkac redhat com> 0.0.91-0.11 -- update to 0.0.91 (1.0.0 RC1) -- patches merged - - tigervnc10-rh499401.patch - - tigervnc10-rh497592.patch - - tigervnc10-rh501832.patch -- after discusion in upstream drop tigervnc-bounds.patch -- configure flags cleanup - -* Thu May 21 2009 Adam Tkac <atkac redhat com> 0.0.90-0.10 -- rebuild against 1.6.1.901 X server (#497835) -- disable i18n, vncviewer is not UTF-8 compatible (#501832) - -* Mon May 18 2009 Adam Tkac <atkac redhat com> 0.0.90-0.9 -- fix vncpasswd crash on long passwords (#499401) -- start session dbus daemon correctly (#497592) - -* Mon May 11 2009 Adam Tkac <atkac redhat com> 0.0.90-0.8.1 -- remove merged tigervnc-manminor.patch - -* Tue May 05 2009 Adam Tkac <atkac redhat com> 0.0.90-0.8 -- update to 0.0.90 - -* Thu Apr 30 2009 Adam Tkac <atkac redhat com> 0.0.90-0.7.20090427svn3789 -- server package now requires xorg-x11-fonts-misc (#498184) - -* Mon Apr 27 2009 Adam Tkac <atkac redhat com> 0.0.90-0.6.20090427svn3789 -- update to r3789 - - tigervnc-rh494801.patch merged -- tigervnc-newfbsize.patch is no longer needed -- fix problems when vncviewer and Xvnc run on different endianess (#496653) -- UltraVNC and TightVNC clients work fine again (#496786) - -* Wed Apr 08 2009 Adam Tkac <atkac redhat com> 0.0.90-0.5.20090403svn3751 -- workaround broken fontpath handling in vncserver script (#494801) - -* Fri Apr 03 2009 Adam Tkac <atkac redhat com> 0.0.90-0.4.20090403svn3751 -- update to r3751 -- patches merged - - tigervnc-xclients.patch - - tigervnc-clipboard.patch - - tigervnc-rh212985.patch -- basic RandR support in Xvnc (resize of the desktop) -- use built-in libjpeg (SSE2/MMX accelerated encoding on x86 platform) -- use Tight encoding by default -- use TigerVNC icons - -* Tue Mar 03 2009 Adam Tkac <atkac redhat com> 0.0.90-0.3.20090303svn3631 -- update to r3631 - -* Tue Mar 03 2009 Adam Tkac <atkac redhat com> 0.0.90-0.2.20090302svn3621 -- package review related fixes - -* Mon Mar 02 2009 Adam Tkac <atkac redhat com> 0.0.90-0.1.20090302svn3621 -- initial package, r3621 diff --git a/contrib/packages/rpm/el6/SPECS/tigervnc.spec b/contrib/packages/rpm/el6/SPECS/tigervnc.spec index 1a63298c..53efba67 100644 --- a/contrib/packages/rpm/el6/SPECS/tigervnc.spec +++ b/contrib/packages/rpm/el6/SPECS/tigervnc.spec @@ -1,4 +1,3 @@ -%{!?_self_signed: %define _self_signed 1} %{!?_bootstrap: %define _bootstrap 1} %define tigervnc_src_dir %{_builddir}/%{name}-%{version}%{?snap:-%{snap}} %global scl_name %{name}16 @@ -10,7 +9,7 @@ Name: tigervnc Version: @VERSION@ -Release: 6%{?snap:.%{snap}}%{?dist} +Release: 7%{?snap:.%{snap}}%{?dist} Summary: A TigerVNC remote display system Group: User Interface/Desktops @@ -21,7 +20,7 @@ URL: http://www.tigervnc.com Source0: %{name}-%{version}%{?snap:-%{snap}}.tar.bz2 Source1: vncserver.service Source2: vncserver.sysconfig -Source11: http://fltk.org/pub/fltk/1.3.4/fltk-1.3.4-1-source.tar.gz +Source11: http://fltk.org/pub/fltk/1.3.4/fltk-1.3.4-2-source.tar.gz Source13: http://downloads.sourceforge.net/project/libpng/libpng16/1.6.34/libpng-1.6.34.tar.gz Source14: https://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2 Source15: http://ftp.gnu.org/gnu/libtasn1/libtasn1-4.13.tar.gz @@ -36,7 +35,7 @@ BuildRequires: xorg-x11-xtrans-devel, xorg-x11-util-macros, libXtst-devel BuildRequires: libdrm-devel, libXt-devel, pixman-devel libXfont-devel BuildRequires: libxkbfile-devel, openssl-devel, libpciaccess-devel BuildRequires: mesa-libGL-devel, libXinerama-devel, ImageMagick -BuildRequires: freetype-devel, libXdmcp-devel +BuildRequires: freetype-devel, libXdmcp-devel, libXft-devel, libXrandr-devel BuildRequires: libjpeg-turbo-devel, pam-devel BuildRequires: cmake >= 2.8 %if !%{_bootstrap} @@ -418,6 +417,9 @@ fi %endif %changelog +* Mon Jan 14 2019 Pierre Ossman <ossman@cendio.se> 1.9.80-7 +- Add libXrandr-devel as a dependency so x0vncserver gets resize support. + * Sun Dec 09 2018 Mark Mielke <mmielke@ciena.com> 1.9.80-6 - Update package dependencies to require version alignment between packages. diff --git a/contrib/packages/rpm/el7/SPECS/tigervnc.spec b/contrib/packages/rpm/el7/SPECS/tigervnc.spec index 6a412a7e..e16a1b73 100644 --- a/contrib/packages/rpm/el7/SPECS/tigervnc.spec +++ b/contrib/packages/rpm/el7/SPECS/tigervnc.spec @@ -1,16 +1,6 @@ -%{!?_self_signed: %define _self_signed 1} -%{!?_bootstrap: %define _bootstrap 1} -%define tigervnc_src_dir %{_builddir}/%{name}-%{version}%{?snap:-%{snap}} -%global scl_name %{name}16 -%if %{_bootstrap} -%define static_lib_buildroot %{tigervnc_src_dir}/opt/%{name}/%{scl_name} -%else -%define static_lib_buildroot /opt/%{name}/%{scl_name} -%endif - Name: tigervnc -Version: 1.9.80 -Release: 3%{?snap:.%{snap}}%{?dist} +Version: @VERSION@ +Release: 4%{?snap:.%{snap}}%{?dist} Summary: A TigerVNC remote display system Group: User Interface/Desktops @@ -22,7 +12,6 @@ Source0: %{name}-%{version}%{?snap:-%{snap}}.tar.bz2 Source1: vncserver.service Source2: vncserver.sysconfig Source3: 10-libvnc.conf -Source11: http://fltk.org/pub/fltk/1.3.4/fltk-1.3.4-1-source.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libX11-devel, automake, autoconf, libtool, gettext, gettext-autopoint @@ -32,6 +21,7 @@ BuildRequires: libdrm-devel, libXt-devel, pixman-devel libXfont-devel BuildRequires: libxkbfile-devel, openssl-devel, libpciaccess-devel BuildRequires: mesa-libGL-devel, libXinerama-devel, ImageMagick BuildRequires: freetype-devel, libXdmcp-devel, libXfont2-devel +BuildRequires: libXrandr-devel, fltk-devel >= 1.3.3 BuildRequires: libjpeg-turbo-devel, gnutls-devel, pam-devel BuildRequires: systemd, cmake @@ -129,23 +119,10 @@ BuildArch: noarch %description icons This package contains icons for TigerVNC viewer -%if %{_bootstrap} -%package static-devel -Summary: Static development files necessary to build TigerVNC -Group: Development/Libraries - -%description static-devel -This package contains static development files necessary to build TigerVNC -%endif - %prep rm -rf $RPM_BUILD_ROOT %setup -q -n %{name}-%{version}%{?snap:-%{snap}} -%if %{_bootstrap} -tar xzf %SOURCE11 -%endif - cp -r /usr/share/xorg-x11-server-source/* unix/xserver pushd unix/xserver for all in `find . -type f -perm -001`; do @@ -158,55 +135,19 @@ popd %patch17 -p1 -b .shebang %build -%if %{_bootstrap} -mkdir -p %{static_lib_buildroot}%{_libdir} -%endif - %ifarch sparcv9 sparc64 s390 s390x -export CFLAGS="$RPM_OPT_FLAGS -fPIC -I%{static_lib_buildroot}%{_includedir}" +export CFLAGS="$RPM_OPT_FLAGS -fPIC" %else -export CFLAGS="$RPM_OPT_FLAGS -fpic -I%{static_lib_buildroot}%{_includedir}" +export CFLAGS="$RPM_OPT_FLAGS -fpic" %endif export CXXFLAGS="$CFLAGS" export CPPFLAGS="$CXXFLAGS" -export PKG_CONFIG_PATH="%{static_lib_buildroot}%{_libdir}/pkgconfig:%{static_lib_buildroot}%{_datadir}/pkgconfig:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig" -%if %{_bootstrap} -echo "*** Building fltk ***" -pushd fltk-* -%endif -export CMAKE_PREFIX_PATH="%{static_lib_buildroot}%{_prefix}:%{_prefix}" export CMAKE_EXE_LINKER_FLAGS=$LDFLAGS -export PKG_CONFIG="pkg-config --static" -%if %{_bootstrap} -#CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="-L%{static_lib_buildroot}%{_libdir} -Wl,-Bstatic -lpng -Wl,-Bdynamic $LDFLAGS" -./configure \ - --prefix=%{_prefix} \ - --libdir=%{_libdir} \ - --host=%{_host} \ - --build=%{_build} \ - --enable-x11 \ - --enable-gl \ - --disable-shared \ - --enable-localjpeg \ - --enable-localzlib \ - --disable-localpng \ - --enable-xinerama \ - --enable-xft \ - --enable-xdbe \ - --enable-xfixes \ - --enable-xcursor \ - --with-x -make %{?_smp_mflags} -make DESTDIR=%{static_lib_buildroot} install -popd -%endif %{cmake} -G"Unix Makefiles" \ -DBUILD_STATIC=off \ - -DCMAKE_INSTALL_PREFIX=%{_prefix} \ - -DFLTK_LIBRARIES="%{static_lib_buildroot}%{_libdir}/libfltk.a;%{static_lib_buildroot}%{_libdir}/libfltk_images.a;-lpng;-ldl" \ - -DFLTK_INCLUDE_DIR=%{static_lib_buildroot}%{_includedir} + -DCMAKE_INSTALL_PREFIX=%{_prefix} make %{?_smp_mflags} pushd unix/xserver @@ -240,17 +181,6 @@ make popd %install -%if %{_bootstrap} -for l in fltk; do -pushd $l-* -make install DESTDIR=$RPM_BUILD_ROOT/opt/%{name}/%{scl_name} -popd -done -find %{buildroot}/opt/%{name}/%{scl_name}%{_prefix} -type f -name "*.la" -delete -find %{buildroot}/opt/%{name}/%{scl_name}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|libdir=%{_libdir}|libdir=/opt/%{name}/%{scl_name}%{_libdir}|" {} \; -find %{buildroot}/opt/%{name}/%{scl_name}%{_prefix} -type f -name "*.pc" -exec sed -i -e "s|prefix=%{_prefix}|prefix=/opt/%{name}/%{scl_name}%{_prefix}|" {} \; -%endif - make install DESTDIR=$RPM_BUILD_ROOT pushd unix/xserver/hw/vnc @@ -344,16 +274,11 @@ fi %defattr(-,root,root,-) %{_datadir}/icons/hicolor/*/apps/* -%if %{_bootstrap} -%files static-devel -%defattr(-,root,root,-) -/opt/%{name}/%{scl_name}%{_bindir}/* -/opt/%{name}/%{scl_name}%{_includedir}/* -/opt/%{name}/%{scl_name}%{_libdir}/* -/opt/%{name}/%{scl_name}%{_datadir}/* -%endif - %changelog +* Mon Jan 14 2019 Pierre Ossman <ossman@cendio.se> 1.9.80-4 +- Use system FLTK for build +- Add libXrandr-devel as a dependency so x0vncserver gets resize support. + * Sun Dec 09 2018 Mark Mielke <mmielke@ciena.com> 1.9.80-3 - Update package dependencies to require version alignment between packages. |