summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Olexa <darkside@gentoo.org>2011-12-05 14:45:24 +0000
committerJeremy Olexa <darkside@gentoo.org>2011-12-05 14:45:24 +0000
commit29c720bfc5a6e47be322e5a59c1a6cea9b725ed4 (patch)
tree587f6a67915a411b964f3cfb9c9ecd258c768f73 /x11-misc/synergy
parentamd64 stable per bug 389265 (diff)
downloadgentoo-2-29c720bfc5a6e47be322e5a59c1a6cea9b725ed4.tar.gz
gentoo-2-29c720bfc5a6e47be322e5a59c1a6cea9b725ed4.tar.bz2
gentoo-2-29c720bfc5a6e47be322e5a59c1a6cea9b725ed4.zip
Add upsteam patch to fix gtk3 compatibility issues, bug 392711 by Rob Bruce
(Portage version: 2.1.10.36/cvs/Linux i686)
Diffstat (limited to 'x11-misc/synergy')
-rw-r--r--x11-misc/synergy/ChangeLog8
-rw-r--r--x11-misc/synergy/files/synergy-1.4.5-gtk3-fix.patch193
-rw-r--r--x11-misc/synergy/synergy-1.4.5-r1.ebuild76
3 files changed, 276 insertions, 1 deletions
diff --git a/x11-misc/synergy/ChangeLog b/x11-misc/synergy/ChangeLog
index 49ec0078d796..6ce8aab8ee7f 100644
--- a/x11-misc/synergy/ChangeLog
+++ b/x11-misc/synergy/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for x11-misc/synergy
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-misc/synergy/ChangeLog,v 1.71 2011/11/28 11:45:44 phajdan.jr Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/synergy/ChangeLog,v 1.72 2011/12/05 14:45:24 darkside Exp $
+
+*synergy-1.4.5-r1 (05 Dec 2011)
+
+ 05 Dec 2011; Jeremy Olexa <darkside@gentoo.org> +synergy-1.4.5-r1.ebuild,
+ +files/synergy-1.4.5-gtk3-fix.patch:
+ Add upsteam patch to fix gtk3 compatibility issues, bug 392711 by Rob Bruce
28 Nov 2011; Pawel Hajdan jr <phajdan.jr@gentoo.org> synergy-1.3.6.ebuild:
x86 stable wrt bug #391393
diff --git a/x11-misc/synergy/files/synergy-1.4.5-gtk3-fix.patch b/x11-misc/synergy/files/synergy-1.4.5-gtk3-fix.patch
new file mode 100644
index 000000000000..37bf0f50626b
--- /dev/null
+++ b/x11-misc/synergy/files/synergy-1.4.5-gtk3-fix.patch
@@ -0,0 +1,193 @@
+diff -urEBwb synergy-1.4.4-Source/CMakeLists.txt synergy-1.4.4/CMakeLists.txt
+--- synergy-1.4.4-Source/CMakeLists.txt 2011-06-22 17:10:22.000000000 -0500
++++ synergy-1.4.4/CMakeLists.txt 2011-10-30 18:14:59.805858447 -0500
+@@ -169,6 +169,7 @@
+ check_include_files("X11/extensions/XKB.h" HAVE_XKB_EXTENSION)
+ check_include_files("X11/extensions/XTest.h" HAVE_X11_EXTENSIONS_XTEST_H)
+ check_include_files(${XKBlib} HAVE_X11_XKBLIB_H)
++ check_include_files("X11/extensions/XInput2.h" HAVE_XI2)
+
+ if (HAVE_X11_EXTENSIONS_DPMS_H)
+ # Assume that function prototypes declared, when include exists.
+@@ -183,6 +184,7 @@
+ check_library_exists("X11;Xext" DPMSQueryExtension "" HAVE_Xext)
+ check_library_exists("X11;Xext;Xtst" XTestQueryExtension "" HAVE_Xtst)
+ check_library_exists("Xinerama" XineramaQueryExtension "" HAVE_Xinerama)
++ check_library_exists("Xi" XISelectEvents "" HAVE_Xi)
+
+ if (HAVE_ICE)
+
+@@ -218,6 +220,10 @@
+
+ endif()
+
++ IF(HAVE_Xi)
++ LIST(APPEND libs Xi)
++ ENDIF()
++
+ # For config.h, set some static values; it may be a good idea to make
+ # these values dynamic for non-standard UNIX compilers.
+ set(ACCEPT_TYPE_ARG3 socklen_t)
+diff -urEBwb synergy-1.4.4-Source/res/config.h.in synergy-1.4.4/res/config.h.in
+--- synergy-1.4.4-Source/res/config.h.in 2009-10-26 02:54:37.000000000 -0500
++++ synergy-1.4.4/res/config.h.in 2011-10-30 17:58:25.054795783 -0500
+@@ -124,6 +124,9 @@
+ /* Define to 1 if you have the <X11/XKBlib.h> header file. */
+ #cmakedefine HAVE_X11_XKBLIB_H ${HAVE_X11_XKBLIB_H}
+
++/* Define to 1 if you have the <X11/extensions/XInput2.h> header file. */
++#cmakedefine HAVE_XI2 ${HAVE_XI2}
++
+ /* Define this if the XKB extension is available. */
+ #cmakedefine HAVE_XKB_EXTENSION ${HAVE_XKB_EXTENSION}
+
+diff -urEBwb synergy-1.4.4-Source/src/lib/platform/CMakeLists.txt synergy-1.4.4/src/lib/platform/CMakeLists.txt
+--- synergy-1.4.4-Source/src/lib/platform/CMakeLists.txt 2011-08-27 21:34:24.000000000 -0500
++++ synergy-1.4.4/src/lib/platform/CMakeLists.txt 2011-10-30 18:08:02.131234528 -0500
+@@ -172,5 +172,5 @@
+ endif()
+
+ if (UNIX)
+- target_link_libraries(platform synergy)
++ target_link_libraries(platform synergy ${libs})
+ endif()
+diff -urEBwb synergy-1.4.4-Source/src/lib/platform/CXWindowsEventQueueBuffer.cpp synergy-1.4.4/src/lib/platform/CXWindowsEventQueueBuffer.cpp
+--- synergy-1.4.4-Source/src/lib/platform/CXWindowsEventQueueBuffer.cpp 2011-01-14 22:12:51.000000000 -0600
++++ synergy-1.4.4/src/lib/platform/CXWindowsEventQueueBuffer.cpp 2011-10-30 17:55:29.951274194 -0500
+@@ -177,7 +177,7 @@
+ SELECT_TYPE_ARG234 NULL,
+ SELECT_TYPE_ARG234 NULL,
+ SELECT_TYPE_ARG5 TIMEOUT_DELAY);
+- if (FD_SET(m_pipefd[0], &rfds) {
++ if (FD_SET(m_pipefd[0], &rfds)) {
+ read(m_pipefd[0], buf, 15);
+ }
+ #endif
+diff -urEBwb synergy-1.4.4-Source/src/lib/platform/CXWindowsScreen.cpp synergy-1.4.4/src/lib/platform/CXWindowsScreen.cpp
+--- synergy-1.4.4-Source/src/lib/platform/CXWindowsScreen.cpp 2011-01-17 14:56:04.000000000 -0600
++++ synergy-1.4.4/src/lib/platform/CXWindowsScreen.cpp 2011-10-30 17:55:29.951274194 -0500
+@@ -59,9 +59,13 @@
+ # if HAVE_XKB_EXTENSION
+ # include <X11/XKBlib.h>
+ # endif
++# ifdef HAVE_XI2
++# include <X11/extensions/XInput2.h>
++# endif
+ #endif
+ #include "CArch.h"
+
++static int xi_opcode;
+
+ //
+ // CXWindowsScreen
+@@ -102,7 +106,8 @@
+ m_screensaverNotify(false),
+ m_xtestIsXineramaUnaware(true),
+ m_preserveFocus(false),
+- m_xkb(false)
++ m_xkb(false),
++ m_xi2detected(false)
+ {
+ assert(s_screen == NULL);
+
+@@ -142,6 +147,15 @@
+ if (m_isPrimary) {
+ // start watching for events on other windows
+ selectEvents(m_root);
++ m_xi2detected = detectXI2();
++
++ if (m_xi2detected) {
++ selectXIRawMotion();
++ } else
++ {
++ // start watching for events on other windows
++ selectEvents(m_root);
++ }
+
+ // prepare to use input methods
+ openIM();
+@@ -1205,6 +1219,35 @@
+ return;
+ }
+
++ if (m_xi2detected) {
++ // Process RawMotion
++ XGenericEventCookie *cookie = (XGenericEventCookie*)&xevent->xcookie;
++ if (XGetEventData(m_display, cookie) &&
++ cookie->type == GenericEvent &&
++ cookie->extension == xi_opcode) {
++ if (cookie->evtype == XI_RawMotion) {
++ // Get current pointer's position
++ Window root, child;
++ XMotionEvent xmotion;
++ xmotion.type = MotionNotify;
++ xmotion.send_event = False; // Raw motion
++ xmotion.display = m_display;
++ xmotion.window = m_window;
++ /* xmotion's time, state and is_hint are not used */
++ unsigned int msk;
++ xmotion.same_screen = XQueryPointer(
++ m_display, m_root, &xmotion.root, &xmotion.subwindow,
++ &xmotion.x_root,
++ &xmotion.y_root,
++ &xmotion.x,
++ &xmotion.y,
++ &msk);
++ onMouseMove(xmotion);
++ return;
++ }
++ }
++ }
++
+ // handle the event ourself
+ switch (xevent->type) {
+ case CreateNotify:
+@@ -1954,3 +1997,27 @@
+ return (m_keycode < x.m_keycode ||
+ (m_keycode == x.m_keycode && m_mask < x.m_mask));
+ }
++
++bool
++CXWindowsScreen::detectXI2()
++{
++ int event, error;
++ return XQueryExtension(m_display,
++ "XInputExtension", &xi_opcode, &event, &error);
++}
++
++void
++CXWindowsScreen::selectXIRawMotion()
++{
++ XIEventMask mask;
++
++ mask.deviceid = XIAllDevices;
++ mask.mask_len = XIMaskLen(XI_RawMotion);
++ mask.mask = (unsigned char*)calloc(mask.mask_len, sizeof(char));
++ mask.deviceid = XIAllMasterDevices;
++ memset(mask.mask, 0, 2);
++ XISetMask(mask.mask, XI_RawKeyRelease);
++ XISetMask(mask.mask, XI_RawMotion);
++ XISelectEvents(m_display, DefaultRootWindow(m_display), &mask, 1);
++ free(mask.mask);
++}
+diff -urEBwb synergy-1.4.4-Source/src/lib/platform/CXWindowsScreen.h synergy-1.4.4/src/lib/platform/CXWindowsScreen.h
+--- synergy-1.4.4-Source/src/lib/platform/CXWindowsScreen.h 2011-08-27 13:41:23.000000000 -0500
++++ synergy-1.4.4/src/lib/platform/CXWindowsScreen.h 2011-10-30 17:55:29.952274694 -0500
+@@ -138,6 +138,8 @@
+ void onMouseRelease(const XButtonEvent&);
+ void onMouseMove(const XMotionEvent&);
+
++ bool detectXI2();
++ void selectXIRawMotion();
+ void selectEvents(Window) const;
+ void doSelectEvents(Window) const;
+
+@@ -235,6 +237,8 @@
+ bool m_xkb;
+ int m_xkbEventBase;
+
++ bool m_xi2detected;
++
+ // pointer to (singleton) screen. this is only needed by
+ // ioErrorHandler().
+ static CXWindowsScreen* s_screen;
diff --git a/x11-misc/synergy/synergy-1.4.5-r1.ebuild b/x11-misc/synergy/synergy-1.4.5-r1.ebuild
new file mode 100644
index 000000000000..1deee2d09c95
--- /dev/null
+++ b/x11-misc/synergy/synergy-1.4.5-r1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/synergy/synergy-1.4.5-r1.ebuild,v 1.1 2011/12/05 14:45:24 darkside Exp $
+
+EAPI=4
+
+inherit eutils cmake-utils qt4-r2
+
+DESCRIPTION="Lets you easily share a single mouse and keyboard between multiple computers."
+HOMEPAGE="http://synergy-foss.org/"
+SRC_URI="http://${PN}.googlecode.com/files/${P}-Source.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE="qt4"
+
+RDEPEND="x11-libs/libXtst
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ qt4? ( x11-libs/qt-gui )
+ qt4? ( !x11-misc/qsynergy )"
+DEPEND="${RDEPEND}
+ x11-proto/xextproto
+ x11-proto/xproto
+ x11-proto/kbproto
+ x11-proto/xineramaproto
+ x11-libs/libXt"
+
+S=${WORKDIR}/${P}-Source
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-gtk3-fix.patch"
+}
+
+src_configure() {
+ # 1.4.4+ : http://synergy-foss.org/pm/issues/3016
+ append-ldflags $(no-as-needed)
+
+ cmake-utils_src_configure
+
+ if use qt4 ; then
+ cd src/gui
+ qt4-r2_src_configure
+ fi
+}
+
+src_compile() {
+ cmake-utils_src_compile
+
+ if use qt4 ; then
+ cd src/gui
+ qt4-r2_src_compile
+ fi
+}
+
+src_install () {
+ dobin bin/${PN}{c,s}
+
+ if use qt4 ; then
+ newbin bin/${PN} qsynergy
+ # FIXME: convert the .ico file to a real png instead
+ newicon src/gui/res/win/QSynergy.ico q${PN}.png
+ make_desktop_entry q${PN} ${PN/s/S} q${PN} Utility;
+ fi
+
+ insinto /etc
+ newins doc/synergy.conf.example synergy.conf
+
+ mv doc/${PN}c.man doc/${PN}c.1 || die
+ mv doc/${PN}s.man doc/${PN}s.1 || die
+ doman doc/${PN}{c,s}.1
+
+ dodoc README doc/synergy.conf.example*
+}