Removed remnants of synmacph tool (part 2) #4398
This commit is contained in:
parent
5767790e1e
commit
450435d062
|
@ -463,12 +463,6 @@ class InternalCommands:
|
|||
|
||||
if generator.cmakeName.find('Eclipse') != -1:
|
||||
self.fixCmakeEclipseBug()
|
||||
|
||||
# only on osx 10.9 mavericks.
|
||||
# manually change .xcodeproj to add code sign for
|
||||
# synmacph project and specify its info.plist
|
||||
if self.macSdk == "10.9" and generator.cmakeName.find('Xcode') != -1:
|
||||
self.fixXcodeProject(target)
|
||||
|
||||
if err != 0:
|
||||
raise Exception('CMake encountered error: ' + str(err))
|
||||
|
@ -570,59 +564,6 @@ class InternalCommands:
|
|||
file.write(content)
|
||||
file.truncate()
|
||||
file.close()
|
||||
|
||||
def fixXcodeProject(self, target):
|
||||
print "Fixing Xcode project..."
|
||||
|
||||
insertContent = (
|
||||
"CODE_SIGN_IDENTITY = '%s';\n"
|
||||
"INFOPLIST_FILE = %s/src/cmd/synmacph/Info.plist;\n") % (
|
||||
self.macIdentity,
|
||||
os.getcwd()
|
||||
)
|
||||
|
||||
dir = self.getBuildDir(target)
|
||||
file = open(dir + '/synergy.xcodeproj/project.pbxproj', 'r+')
|
||||
contents = file.readlines()
|
||||
|
||||
buildConfigurationsFound = None
|
||||
releaseConfigRefFound = None
|
||||
releaseBuildSettingsFound = None
|
||||
fixed = None
|
||||
releaseConfigRef = "";
|
||||
|
||||
for line in contents:
|
||||
if buildConfigurationsFound:
|
||||
matchObj = re.search(r'\s*(.*)\s*\/\*\s*Release\s*\*\/,', line, re.I)
|
||||
if matchObj:
|
||||
releaseConfigRef = matchObj.group(1)
|
||||
releaseConfigRefFound = True
|
||||
break
|
||||
elif buildConfigurationsFound == None:
|
||||
if 'PBXNativeTarget "synmacph" */ = {' in line:
|
||||
buildConfigurationsFound = True
|
||||
|
||||
if not releaseConfigRefFound:
|
||||
raise Exception("Release config ref not found.")
|
||||
|
||||
for n, line in enumerate(contents):
|
||||
if releaseBuildSettingsFound == None:
|
||||
if releaseConfigRef + '/* Release */ = {' in line:
|
||||
releaseBuildSettingsFound = True
|
||||
elif fixed == None:
|
||||
if 'buildSettings = {' in line:
|
||||
contents[n] = line + insertContent
|
||||
fixed = True
|
||||
|
||||
if not fixed:
|
||||
raise Exception("Xcode project was not fixed.")
|
||||
|
||||
file.seek(0)
|
||||
for line in contents:
|
||||
file.write(line)
|
||||
file.truncate()
|
||||
file.close()
|
||||
return
|
||||
|
||||
def persist_cmake(self):
|
||||
# even though we're running `cmake --version`, we're only doing this for the 0 return
|
||||
|
|
|
@ -23,9 +23,3 @@ add_subdirectory(syntool)
|
|||
if (WIN32)
|
||||
add_subdirectory(synergyp)
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
if (OSX_TARGET_MINOR GREATER 8)
|
||||
add_subdirectory(synmacph)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
# synergy -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2014 Synergy Si Ltd.
|
||||
#
|
||||
# This package is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# found in the file COPYING that should have accompanied this file.
|
||||
#
|
||||
# This package is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
file(GLOB sources "*.c" "*.plist")
|
||||
|
||||
include_directories(
|
||||
../
|
||||
)
|
||||
|
||||
add_executable(synmacph ${sources})
|
||||
|
||||
get_target_property(current_property synmacph LINK_FLAGS)
|
||||
|
||||
set(OTHER_LINK_FLAGS "-sectcreate __TEXT __info_plist ${root_dir}/src/cmd/synmacph/Info.plist -sectcreate __TEXT __launchd_plist ${root_dir}/src/cmd/synmacph/Launchd.plist")
|
||||
|
||||
if (NOT ${current_property})
|
||||
set_target_properties(synmacph PROPERTIES LINK_FLAGS ${OTHER_LINK_FLAGS})
|
||||
endif()
|
||||
|
||||
target_link_libraries(synmacph)
|
||||
|
||||
if (CONF_CPACK)
|
||||
install(TARGETS
|
||||
synmacph
|
||||
COMPONENT core
|
||||
DESTINATION bin)
|
||||
endif()
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>synmacph</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>synmacph</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.5</string>
|
||||
<key>SMAuthorizedClients</key>
|
||||
<array>
|
||||
<string>anchor apple generic and identifier "synergy" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = SP58PFWX5L)</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>synmacph</string>
|
||||
<key>MachServices</key>
|
||||
<dict>
|
||||
<key>synmacph</key>
|
||||
<true/>
|
||||
</dict></dict>
|
||||
</plist>
|
|
@ -1,99 +0,0 @@
|
|||
/*
|
||||
* synergy -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2014 Synergy Si Ltd.
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file COPYING that should have accompanied this file.
|
||||
*
|
||||
* This package is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <syslog.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <xpc/xpc.h>
|
||||
|
||||
const char* const label = "synmacph";
|
||||
|
||||
static void xpcEventHandler(xpc_connection_t connection, xpc_object_t event);
|
||||
static void xpcConnectionHandler(xpc_connection_t connection);
|
||||
|
||||
static void xpcEventHandler(xpc_connection_t connection, xpc_object_t event)
|
||||
{
|
||||
syslog(LOG_NOTICE, "received event in helper");
|
||||
|
||||
xpc_type_t type = xpc_get_type(event);
|
||||
|
||||
if (type == XPC_TYPE_ERROR) {
|
||||
if (event == XPC_ERROR_CONNECTION_INVALID) {
|
||||
// the client process on the other end of the connection has either
|
||||
// crashed or cancelled the connection. After receiving this error,
|
||||
// the connection is in an invalid state, and you do not need to
|
||||
// call xpc_connection_cancel(). Just tear down any associated state
|
||||
// here.
|
||||
}
|
||||
else if (event == XPC_ERROR_TERMINATION_IMMINENT) {
|
||||
// handle per-connection termination cleanup.
|
||||
}
|
||||
}
|
||||
else {
|
||||
xpc_connection_t remote = xpc_dictionary_get_remote_connection(event);
|
||||
|
||||
const char* command = xpc_dictionary_get_string(event, "request");
|
||||
syslog(LOG_NOTICE, "received command in helper: %s", command);
|
||||
system(command);
|
||||
|
||||
xpc_object_t reply = xpc_dictionary_create_reply(event);
|
||||
xpc_dictionary_set_string(reply, "reply", "command has been executed");
|
||||
xpc_connection_send_message(remote, reply);
|
||||
xpc_release(reply);
|
||||
}
|
||||
}
|
||||
|
||||
static void xpcConnectionHandler(xpc_connection_t connection)
|
||||
{
|
||||
syslog(LOG_NOTICE, "configuring message event handler for helper");
|
||||
|
||||
xpc_connection_set_event_handler(connection, ^(xpc_object_t event) {
|
||||
xpcEventHandler(connection, event);
|
||||
});
|
||||
|
||||
xpc_connection_resume(connection);
|
||||
}
|
||||
|
||||
int main(int argc, const char * argv[])
|
||||
{
|
||||
#pragma unused(argc)
|
||||
#pragma unused(argv)
|
||||
|
||||
xpc_connection_t service = xpc_connection_create_mach_service(
|
||||
label,
|
||||
dispatch_get_main_queue(),
|
||||
XPC_CONNECTION_MACH_SERVICE_LISTENER);
|
||||
|
||||
if (!service) {
|
||||
syslog(LOG_NOTICE, "failed to create service");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
syslog(LOG_NOTICE, "configuring connection event handler for helper");
|
||||
xpc_connection_set_event_handler(service, ^(xpc_object_t connection) {
|
||||
xpcConnectionHandler(connection);
|
||||
});
|
||||
|
||||
xpc_connection_resume(service);
|
||||
|
||||
dispatch_main();
|
||||
|
||||
xpc_release(service);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Loading…
Reference in New Issue