Revision: 83211 http://trac.macports.org/changeset/83211 Author: raimue@macports.org Date: 2011-08-28 08:50:57 -0700 (Sun, 28 Aug 2011) Log Message: ----------- sysutils/synergy: Update to version 1.3.7, with some backported patches, see #26516 Modified Paths: -------------- users/raimue/ports/sysutils/synergy/Portfile users/raimue/ports/sysutils/synergy/files/patch-CArchFileUnix.cpp.diff Added Paths: ----------- users/raimue/ports/sysutils/synergy/files/patch-bug57-keypress.diff users/raimue/ports/sysutils/synergy/files/patch-bug57-modifiers.diff Modified: users/raimue/ports/sysutils/synergy/Portfile =================================================================== --- users/raimue/ports/sysutils/synergy/Portfile 2011-08-28 15:47:00 UTC (rev 83210) +++ users/raimue/ports/sysutils/synergy/Portfile 2011-08-28 15:50:57 UTC (rev 83211) @@ -1,48 +1,58 @@ # $Id$ PortSystem 1.0 +PortGroup cmake 1.0 -name synergy -set sf_proj synergy2 -version 1.3.1 -categories sysutils -platforms darwin -maintainers gmail.com:ascarter -description a client/server for sharing a single mouse and keyboard -long_description Synergy lets you easily share a single mouse and keyboard \ - between multiple computers with different operating systems \ - without special hardware. It is intended for users with \ - multiple computers on their desk since each system uses its \ - own display. +name synergy +version 1.3.7 +categories sysutils +platforms darwin +maintainers raimue +description A client/server for sharing a single mouse and keyboard +long_description \ + Synergy lets you easily share a single mouse and keyboard \ + between multiple computers with different operating systems \ + without special hardware. It is intended for users with \ + multiple computers on their desk since each system uses its \ + own display. +homepage http://synergy-foss.org +master_sites googlecode +distname ${name}-${version}-Source -homepage http://synergy-foss.org/ -master_sites sourceforge -master_sites.mirror_subdir ${sf_proj} +checksums sha1 0f67dc4a221dc0db74ec8a35d3dd578e9d76eccc \ + rmd160 5f28bd102293437481a8c5808d5cbfc8722ee1ae -checksums md5 a6e09d6b71cb217f23069980060abf27 +# Force 32-bit, all kinds of Carbon cruft in here. (#20908) +supported_archs i386 ppc -configure.args --sysconfdir=${prefix}/etc/${name} -patchfiles patch-CArchFileUnix.cpp.diff patch-configure.diff +patchfiles patch-CArchFileUnix.cpp.diff +# See http://synergy-foss.org/pm/issues/57 +patchfiles-append patch-bug57-keypress.diff \ + patch-bug57-modifiers.diff + post-patch { - reinplace "s|__SYSCONFDIR|${prefix}/etc/${name}|g" ${worksrcpath}/lib/arch/CArchFileUnix.cpp -} + # Set default config path + reinplace "s|@@SYSCONFDIR@@|${prefix}/etc/${name}|g" ${worksrcpath}/src/lib/arch/CArchFileUnix.cpp -variant server { - startupitem.create yes - startupitem.name Synergy - startupitem.start "${prefix}/bin/synergys --daemon &" - startupitem.stop "/usr/bin/killall synergys" + # Fix build architectures + reinplace "s:CMAKE_OSX_ARCHITECTURES \"ppc;i386\":CMAKE_OSX_ARCHITECTURES \"[join [get_canonical_archs] ;]\":" ${worksrcpath}/CMakeLists.txt } -post-destroot { - xinstall -m 755 -d ${destroot}${prefix}/etc/${name} - xinstall -m 644 -c ${worksrcpath}/examples/synergy.conf \ - ${destroot}${prefix}/etc/${name}/synergy.conf.sample +destroot { + # xinstall -d ${destroot}${prefix}/bin + xinstall -m 755 ${worksrcpath}/bin/synergyc ${destroot}${prefix}/bin + xinstall -m 755 ${worksrcpath}/bin/synergys ${destroot}${prefix}/bin + xinstall -m 644 ${worksrcpath}/doc/synergyc.man ${destroot}${prefix}/share/man/man1/synergyc.1 + xinstall -m 644 ${worksrcpath}/doc/synergys.man ${destroot}${prefix}/share/man/man1/synergys.1 + # xinstall -d ${destroot}${prefix}/etc/${name} + xinstall -m 644 -W ${worksrcpath}/doc/ \ + synergy.conf.example \ + synergy.conf.example-advanced \ + synergy.conf.example-basic \ + ${destroot}${prefix}/etc/${name} } -livecheck.name ${sf_proj} -livecheck.regex <title>Sources (.*) released.*</title> - -# Force 32-bit, all kinds of Carbon cruft in here. (#20908) -supported_archs i386 ppc +startupitem.create yes +startupitem.name Synergy +startupitem.executable "${prefix}/bin/synergys --no-daemon" Modified: users/raimue/ports/sysutils/synergy/files/patch-CArchFileUnix.cpp.diff =================================================================== --- users/raimue/ports/sysutils/synergy/files/patch-CArchFileUnix.cpp.diff 2011-08-28 15:47:00 UTC (rev 83210) +++ users/raimue/ports/sysutils/synergy/files/patch-CArchFileUnix.cpp.diff 2011-08-28 15:50:57 UTC (rev 83211) @@ -1,11 +1,11 @@ ---- lib/arch/CArchFileUnix.cpp.orig Wed Feb 9 13:29:56 2005 -+++ lib/arch/CArchFileUnix.cpp Wed Feb 9 13:30:27 2005 -@@ -80,7 +80,7 @@ +--- src/lib/arch/CArchFileUnix.cpp.orig Wed Feb 9 13:29:56 2005 ++++ src/lib/arch/CArchFileUnix.cpp Wed Feb 9 13:30:27 2005 +@@ -83,7 +83,7 @@ std::string CArchFileUnix::getSystemDirectory() { - return "/etc"; -+ return "__SYSCONFDIR"; ++ return "@@SYSCONFDIR@@"; } std::string Added: users/raimue/ports/sysutils/synergy/files/patch-bug57-keypress.diff =================================================================== --- users/raimue/ports/sysutils/synergy/files/patch-bug57-keypress.diff (rev 0) +++ users/raimue/ports/sysutils/synergy/files/patch-bug57-keypress.diff 2011-08-28 15:50:57 UTC (rev 83211) @@ -0,0 +1,49 @@ +Index: src/lib/platform/COSXScreen.cpp +=================================================================== +--- src/lib/platform/COSXScreen.cpp (revision 909) ++++ src/lib/platform/COSXScreen.cpp (working copy) +@@ -620,7 +620,7 @@ + // FIXME -- start watching jump zones + + // kCGEventTapOptionDefault = 0x00000000 (Missing in 10.4, so specified literally) +- m_eventTapPort=CGEventTapCreate(kCGHIDEventTap, kCGHIDEventTap, 0, ++ m_eventTapPort=CGEventTapCreate(kCGHIDEventTap, kCGHeadInsertEventTap, 0, + kCGEventMaskForAllEvents, + handleCGInputEvent, + this); +@@ -640,7 +640,7 @@ + // there may be a better way to do this, but we register an event handler even if we're + // not on the primary display (acting as a client). This way, if a local event comes in + // (either keyboard or mouse), we can make sure to show the cursor if we've hidden it. +- m_eventTapPort=CGEventTapCreate(kCGHIDEventTap, kCGHIDEventTap, 0, ++ m_eventTapPort=CGEventTapCreate(kCGHIDEventTap, kCGHeadInsertEventTap, 0, + kCGEventMaskForAllEvents, + handleCGInputEventSecondary, + this); +Index: src/lib/platform/COSXKeyState.cpp +=================================================================== +--- src/lib/platform/COSXKeyState.cpp (revision 909) ++++ src/lib/platform/COSXKeyState.cpp (working copy) +@@ -284,22 +284,6 @@ + #endif + + if (layoutValid) { +- +- // choose action +- UInt16 action; +- switch (eventKind) { +- case kEventRawKeyDown: +- action = kUCKeyActionDown; +- break; +- +- case kEventRawKeyRepeat: +- action = kUCKeyActionAutoKey; +- break; +- +- default: +- return 0; +- } +- + // translate key + UniCharCount count; + UniChar chars[2]; Added: users/raimue/ports/sysutils/synergy/files/patch-bug57-modifiers.diff =================================================================== --- users/raimue/ports/sysutils/synergy/files/patch-bug57-modifiers.diff (rev 0) +++ users/raimue/ports/sysutils/synergy/files/patch-bug57-modifiers.diff 2011-08-28 15:50:57 UTC (rev 83211) @@ -0,0 +1,80 @@ +Index: src/lib/platform/COSXScreen.cpp +=================================================================== +--- src/lib/platform/COSXScreen.cpp (revision 1077) ++++ src/lib/platform/COSXScreen.cpp (working copy) +@@ -1097,14 +1097,14 @@ + + // get the key and active modifiers + UInt32 virtualKey = CGEventGetIntegerValueField(event, kCGKeyboardEventKeycode); +- CGEventFlags macMask = CGEventGetFlags(event); ++ CGEventFlags macMaskCarbon = m_keyState->mapModifiersToCarbon(CGEventGetFlags(event)); + LOG((CLOG_DEBUG1 "event: Key event kind: %d, keycode=%d", eventKind, virtualKey)); + + // Special handling to track state of modifiers + if (eventKind == kCGEventFlagsChanged) { + // get old and new modifier state + KeyModifierMask oldMask = getActiveModifiers(); +- KeyModifierMask newMask = m_keyState->mapModifiersFromOSX(macMask); ++ KeyModifierMask newMask = m_keyState->mapModifiersFromOsxCarbon(macMaskCarbon); + m_keyState->handleModifierKeys(getEventTarget(), oldMask, newMask); + + // if the current set of modifiers exactly matches a modifiers-only +@@ -1141,9 +1141,7 @@ + // so we check for a key/modifier match in our hot key map. + if (!m_isOnScreen) { + HotKeyToIDMap::const_iterator i = +- m_hotKeyToIDMap.find(CHotKeyItem(virtualKey, +- m_keyState->mapModifiersToCarbon(macMask) +- & 0xff00u)); ++ m_hotKeyToIDMap.find(CHotKeyItem(virtualKey, macMaskCarbon & 0xff00u)); + if (i != m_hotKeyToIDMap.end()) { + UInt32 id = i->second; + +Index: src/lib/platform/COSXKeyState.cpp +=================================================================== +--- src/lib/platform/COSXKeyState.cpp (revision 1077) ++++ src/lib/platform/COSXKeyState.cpp (working copy) +@@ -155,7 +155,7 @@ + } + + KeyModifierMask +-COSXKeyState::mapModifiersFromOSX(UInt32 mask) const ++COSXKeyState::mapModifiersFromOsxCarbon(UInt32 mask) const + { + LOG((CLOG_DEBUG1 "mask: %04x", mask)); + +@@ -336,7 +336,7 @@ + KeyModifierMask + COSXKeyState::pollActiveModifiers() const + { +- return mapModifiersFromOSX(GetCurrentKeyModifiers()); ++ return mapModifiersFromOsxCarbon(GetCurrentKeyModifiers()); + } + + SInt32 +@@ -620,10 +620,10 @@ + } + + // now add a key entry for each key/required modifier pair. +- item.m_sensitive = mapModifiersFromOSX(sensitive << 8); ++ item.m_sensitive = mapModifiersFromOsxCarbon(sensitive << 8); + for (std::set<UInt32>::iterator k = required.begin(); + k != required.end(); ++k) { +- item.m_required = mapModifiersFromOSX(*k << 8); ++ item.m_required = mapModifiersFromOsxCarbon(*k << 8); + keyMap.addKeyEntry(item); + } + } +Index: src/lib/platform/COSXKeyState.h +=================================================================== +--- src/lib/platform/COSXKeyState.h (revision 1077) ++++ src/lib/platform/COSXKeyState.h (working copy) +@@ -62,7 +62,7 @@ + Returns the synergy modifier mask corresponding to the OS X modifier + mask in \p mask. + */ +- KeyModifierMask mapModifiersFromOSX(UInt32 mask) const; ++ KeyModifierMask mapModifiersFromOsxCarbon(UInt32 mask) const; + + //! Convert CG flags-style modifier mask to old-style Carbon + /*!