Synergy-core: Outdated build instruction on OS X Yosemite

Created on 24 Apr 2015  Â·  42Comments  Â·  Source: symless/synergy-core

The build instruction provided on the website no longer works:

$ patch -p1 < mac-synergy.patch
patching file ext/toolchain/commands1.py
Hunk #1 succeeded at 432 (offset -19 lines).
Hunk #2 FAILED at 467.
Hunk #3 succeeded at 551 (offset -27 lines).
1 out of 3 hunks FAILED -- saving rejects to file ext/toolchain/commands1.py.rej

I suppose this is due to the recent change in ext/toolchain/commands1.py made in 3deb5492d60f2f181ea42aa0ff5b98410b29a7c4

The following (simple) change seems to be working fine for me:

diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py
index 484b9da..d141ca8 100644
--- a/ext/toolchain/commands1.py
+++ b/ext/toolchain/commands1.py
@@ -431,7 +431,7 @@ from getopt import gnu_getopt
                if generator.cmakeName.find('Unix Makefiles') != -1:
                        cmake_args += ' -DCMAKE_BUILD_TYPE=' + target.capitalize()

-               elif sys.platform == "darwin":
+               if sys.platform == "darwin":
                        macSdkMatch = re.match("(\d+)\.(\d+)", self.macSdk)
                        if not macSdkMatch:
                                raise Exception("unknown osx version: " + self.macSdk)
bug

Most helpful comment

I can't get around:

Going back to: /synergy
bin/Synergy.app
Entering dir: bin/Synergy.app/Contents/Frameworks/QtCore.framework/Versions
Error: Destination path '5/Resources' already exists

A note to maintainers: I was planning on buying a license, but how can I trust software I can't even build?

All 42 comments

I have also run into this precise error in patching as of today around 11AM MST.

I also have this problem - couldn't get the listed patch to work. (copy and pasted and tried to apply this patch after the first patch. i didn't think you could patch the patch..)

Sorry I'm a newb, but where do you put this code? And how do you execute it?

I ran this first, but ran into the same problem:
patch -p1 < mac-synergy.patch

patching file ext/toolchain/commands1.py
Hunk #1 succeeded at 431 (offset -20 lines).
Hunk #2 FAILED at 466.
Hunk #3 succeeded at 550 (offset -28 lines).
1 out of 3 hunks FAILED -- saving rejects to file ext/toolchain/commands1.py.rej

MAIN QUESTION:
I put it as a new file and ran it with the command:
patch -p1 < mac-synergy2.patch

But received the following result:
patching file ext/toolchain/commands1.py
Hunk #1 FAILED at 431.
1 out of 1 hunk FAILED -- saving rejects to file ext/toolchain/commands1.py.rej

Any help would be greatly appreciated

kanjames, if you open the file in a text editor, ext/toolchain/commands1.py and find line 433 (which says: elif sys.platform == "darwin": ) and change the "elif" to an "if" and then save the file, you'll be fine. If you used brew to install qt, you will still need to make the other change mentioned in the wiki.

line 774 in the same file, ext/toolchain/commands1.py , change the path to this (assuming that is the correct path for you):
frameworkRootDir = "/usr/local/Cellar/qt/4.8.7/Frameworks"

A general question I have, is whether it's ok to just change the elif to an if? Is there any problem with having those cmake options there, which were excluded on the original patch:

-DCMAKE_OSX_SYSROOT
-DCMAKE_OSX_DEPLOYMENT_TARGET

Are we really discussing the color of the bikeshed ?

If this works, then, it's OK.

Since I don't know what I'm doing, I'm hesitant to say this works, or to advise other people to do this. I'm a total newbie when it comes to cmake and building on mac via command line. I'd rather not dig into cmake documentation if I don't have to.

Few questions:

Does synergy build on Yosemite as-is, from a fresh clone ?

Does synergy build on Yosemite with the "semi-official" patch ?

Does synergy build on Yosemite with this patch ?

Fresh clone: configure fails, so I assume a build will fail too

Semi-official patch: configure succeeds, once you figure out how to apply the patch by hand. I didn't try building

Simply changing elif to if: configure succeeds, there are a number of warnings during build, and then there's a failure related to a bad Qt Library path, even though I fixed that one path mentioned on the wiki. I'll post here after I track down the cause and get a successful build.

OK, it builds successfully. I put the framework path in the wrong place, oops.

kanjames, replace both paths with your actual Qt framework path, so that frameworkRootDir will be sure to point to the right directory.

I've confirmed these changes work for me. I do notice that the qt window
for 1.7.4 doesn't look as polished as it did in 1.4.x - the lines of text
aren't centered in their areas, and it's not as nicely formatted.

oh well, it works now!

On Sat, Jul 11, 2015 at 1:32 PM, corinnaSchultz [email protected]
wrote:

OK, it builds successfully. I put the framework path in the wrong place,
oops.

kanjames, replace both paths with your actual Qt framework path, so that
frameworkRootDir will be sure to point to the right directory.

—
Reply to this email directly or view it on GitHub
https://github.com/synergy/synergy/issues/4572#issuecomment-120660178.

Afterdoing this changes, I am getting this error when building:

./hm.sh conf -g1 --mac-sdk 10.10 --mac-identity test
Mapping command: conf -> configure
Running setup...
Setup complete.
Error: Mac SDK not found at: 2015-07-29 16:45:44.953 xcodebuild[28516:1327680] [MT] PluginLoading: Required plug-in compatibility UUID 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CocoaPodUI.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-07-29 16:45:44.954 xcodebuild[28516:1327680] Failed to load plugin at: /Users/x/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CocoaPodUI.xcplugin, skipping. Reason for failure: *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk

Perhaps your version of XCode isn't up-to-date? See this thread, where someone complains about a similar issue: http://stackoverflow.com/questions/11989007/where-to-get-macos-sdk-10-6-for-xcode

@corinnaSchultz yes, it's up to date... 10.10.4 & Xcode 6.4
anyway I donloaded the free version from here https://synergy-project.org/nightly
PS: do you know if there's some limitation in the "not free"/"own-compiled" besides the registered version?

... answering to your reply:
The 10.10 sdk is there. But, maybe it needs 10.6 like on the link??

i think this is related to the error:
http://stackoverflow.com/questions/20732327/xcode-5-required-plug-in-not-present-in-dvtplugincompatibilityuuids
I remember to have similar error previously with another Xcode project (an Xcode plugin), and I needed to edit (and add an UUID) the project, but inside Xcode. I don't see the Xcode project here...

Yeah try adding the UUID from the error message into the plist file. If that works, leave a comment here.

... I can't see where is the Xcode project.. sorry

Did you look in synergy/build? I think the file was created for you by hm.sh

hmm no, it stopped working before create it… Anyway I can use the compiled free version by now.

On Jul 29, 2015, at 18:56, corinnaSchultz [email protected] wrote:

Did you look in synergy/build? I think the file was created for you by hm.sh

—
Reply to this email directly or view it on GitHub https://github.com/synergy/synergy/issues/4572#issuecomment-126108190.

@corinnaSchultz

Here's my rough way to make it compilable.
(ENV : OS X 10.10.5, Xcode 7.2.1)

1.command1.py
image

self.getMacSdkDir() should return /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk but '/Developer/SDKs/MacOSX10.10.sdk`

with an error:

image

It is said that sdk path has been changed. stackoverflow 2009555

The folder /Developer is not exist.

I'm not sure whether xcrun is a good way to get SDK path, Xcode-plugins in /Users/Your User Name/Library/Application Support/Developer/Shared/Xcode/Plug-ins may cause error:
image
We need move them to another folder before running.

But It still returns /Developer/SDKs/MacOSX10.10.sdk after removing all plugins, so I changed sdkDir directly to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk

getMacSdkDir(self) may have some logical problems, but I have never learnt about python... It is called 3 times in code,but we just need fix 1 of them ,right?

PS:LINE 433 is still elif sys.platform == "darwin":

2.CMakeLists.txt

to avoid the error:

image

directly run line 182 -183:

image

That's all.

Now,It's time to run the code below.

 ./hm.sh conf -g1 [-d] # Use -d to build a debug version.
 ./hm.sh build [-d]

image

I am experiencing a weird problem when compiling after manage to link cmake ,
screen shot 2016-04-23 at 4 37 37 pm
Pls help..

I do not know what to do...any effective way to solve this?

I have the same problem as Macintoshleong. Any help would be greatly appreciated.

after a month someone reply i feel u bro

I used the instructions found here:

https://github.com/symless/synergy/wiki/Compiling#Mac_OS_X_1010_and_above

and it worked perfectly on 10.11.5. Just letting you know.

Thx @xapple will try this method tomorrow.

@xapple r u using the Mac OS X 10.10 and above method are below ?, can u state your state?

I am using qt 5.8 on Mac Sierra. I did follow the instructions at
https://github.com/symless/synergy/wiki/Compiling#Mac_OS_X_1010_and_above

Getting an error : Destination path '5/Resources' already exists.
Anyone else getting this ?

Hi narainabhi,
I am getting the same error. qt 5.8 on Sierra. I have not been able to fix it yet.
The Synergy app will launch, but no gui elements on the actual windows.
I tried doing a clean then build again. That did not help.

any one else has a fix for the above issue ?

Same problem here. Hoping for fix :)

Going back to: /Users/user/Desktop/synergy bin/Release/Synergy.app Entering dir: bin/Release/Synergy.app/Contents/Frameworks/QtCore.framework/Versions Error: Destination path '5/Resources' already exists

Me to Error: Destination path '5/Resources' already exists

The error is from fixQtFrameworksLayout, which does basically nothing. It moves some files that are already where they need to be and that causes the "already exists" error. This function call needs to be removed. But there is another problem. Application starts but all forms (windows) are empty.

Try [email protected] from Homebrew:

brew install [email protected]

Then follow @egzumer's steps. Hope it works for you too!

Finally I managed to build it. I had Qt from homebrew (5.8) and Qt 5.2.1 from qt archive. No need to erase fixQtFrameworksLayout. I did:
export PATH=$PATH:/usr/local/Cellar/qt5/5.8.0_1/bin
python hm.py conf -g2 --mac-sdk 10.12 --mac-identity test
--reopen new console--
export PATH=$PATH:/Users/user/Qt5.2.1/5.2.1/clang_64/bin
python hm.py build
python hm.py package mac

This still feels a little clunky, having to grab archival Qt's. I figured out a workaround, but downside is that it's not a static compile: https://github.com/symless/synergy/issues/5994

So, looks like the issue still hasn't been fixed, but this is just a retest from scratch on an up-to-date system.

macOS Sierra 10.12.5 w/ Xcode 8.1

Using HomeBrew to attain:

brew info qt
qt: stable 5.9.0 (bottled), HEAD [keg-only]
Cross-platform application and UI framework
https://www.qt.io/
/usr/local/Cellar/qt/5.9.0 (9,015 files, 296.3MB)
  Poured from bottle on 2017-06-02 at 11:00:05
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/qt.rb
brew info cmake
cmake: stable 3.8.2 (bottled), HEAD
Cross-platform make
https://www.cmake.org/
/usr/local/Cellar/cmake/3.8.2 (2,208 files, 29.3MB) *
  Poured from bottle on 2017-06-02 at 10:57:22
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/cmake.rb



md5-e1baeedabeb575b8f8de8092a042997e



brew install qt
brew install cmake



md5-ffe35f61fef50b91fb8c641e17bb91d4



git clone https://github.com/symless/synergy.git



md5-6e5010c12678df5955eb8f9b8d128d67



brew info qt
export PATH=/usr/local/Cellar/qt/5.9.0/bin:$PATH



md5-e0a3349a07dc33fd1b70f1e4bfee1a3a



/usr/local/Cellar/qt/5.9.0/Frameworks



md5-6429ec600002b5f68125b22d0c6ffdca



Error: Destination path '5/Resources' already exists



md5-50d6fc5d329a7bcf8b2e0ca43c20917e



./hm.sh conf -g2 --mac-sdk 10.12 --mac-identity test
./hm.sh build



md5-5952f77a6df3d5504dd10f6f0389e7ee



./hm.sh conf -g1
./hm.sh build

Pretty much creates a Synergy.app which is executable, but like all the people above, empty GUI elements. On the plus side, ./hm.sh dist mac works.

I can't get around:

Going back to: /synergy
bin/Synergy.app
Entering dir: bin/Synergy.app/Contents/Frameworks/QtCore.framework/Versions
Error: Destination path '5/Resources' already exists

A note to maintainers: I was planning on buying a license, but how can I trust software I can't even build?

@philion If you can't trust software you can't build then why do you use macOS? Anyway try #5826 out.

@yupi2, You can't trust an open source software that you can't build, not closed source.

Here's working (so far) Makefile for OSX Sierra: https://github.com/tb0hdan/synergy_build_osx

@tb0hdan, What about #5905. Isn't that happening to you too?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nbolton picture nbolton  Â·  5Comments

ColinCreamer picture ColinCreamer  Â·  5Comments

nbeazy picture nbeazy  Â·  4Comments

legonigel picture legonigel  Â·  4Comments

bigbear3001 picture bigbear3001  Â·  4Comments