Thursday, February 26, 2015

Compiling Synergy on OSX 10.9 Maverick (and 10.10 Yosemite)

Synergy is an open source software KVM that allows you to use one keyboard/mouse across multiple computers.  Although Synergy is open source, hosted on Github and under GPL, its main developer(s) decided sometime last year to put the binary of the latest version behind a pay-wall.  There is nothing in GPL that prevents them to do so and I don't necessarily object to developers charging a fee for providing a service such as hosting for downloads (I used to buy Linux install CDs from Walnut Creek without a second thought), but I'm just not a fan on the way they're doing it.

The Synergy website looks and feel like one of those spam sites where they try to trick you into buying or downloading something with big call to action buttons while the actual link to download is kind of hidden.  For example, they have a big "Get Synergy" button which is the one that ask you to pay while links to github and a link for free binary downloads (although not of the most recent version since that's the one they want you to pay for) are tiny and hidden way a bottom of the page.  I guess it's better then those sites with a big button that says "Download Here!" (which actually takes you to some spam page) while next to it as a small font link is the actual download link.  Plus, paying for it doesn't seem to get you additional support or anything other then being able to download a pre-compiled binary.  Basically, their execution of it is the turn-off and I had to check a few times to make sure the site is legit and not a spam company trying to appear legit.

Since this is open source anyone can just download the source and build it themselves, right?  Well, not exactly.  The instructions for how to compile is not great, but worst is that the code itself doesn't build if you just get it from Github.  I'm trying to build on OSX since most Linux distro will have it already in a package to install, but Synergy doesn't have a Homebrew formula and Macports has not maintainer.  So, for OSX, you'll need to compile yourself.

The latest source doesn't work yet (I tried to build it and it errors out on compile), so I thought I get the last stable version and build from that.  Nope.  If you try to build strictly from the command line it fails trying to create the right build files because of problems with the toolchain it uses.  If you try to build with Xcode, you'll need to code sign it.  In order to build it, you'll need to patch the toolchain.  I found that someone in Korea fixed the toolchain to allow him to build Synergy for Yosimite, but his solution is actually also needed to get it to build on 10.9 Maverick

So here goes:

xcode-select --install
brew install cmake
brew install qt
Next you'll need to download the source from http://github.com/synergy/synergy.

When I grabbed the latest and tried their instructions for compiling, it didn't work.  So your choice is to pull from an earlier stable release.  That means either 1.6.2 or 1.4.x.  Note that the 1.6.x client can't speak to 1.4.x and even 1.4.18 client isn't compatible with 1.4.10 server.  Fedora 21, for example, comes with 1.4.10 so if you grabbed the latest 1.4.18 release it wont' work.

To build 1.6.2 on OSX Maveric, you'll need to change ext/toolchain/command1.py


./hm.sh conf -g1 --mac-sdk 10.9 --mac-identity Maveric
./hm.sh build
To build 1.4.18, this is the replacement ext/toolchain/command1.py

I realized after building 1.4.18 client that it won't work with 1.4.10 server, I decided to have every system on 1.6.2 even if I can't use a package manager for it.

Don't just have Synergy client talk directly to the Synergy server directly.  There's a chance that someone can be listening on your communication.  Instead, use ssh tunneling so that the communication is secure.  I also suggest using autossh so that it knows to reconnect if your client gets disconnected (e.g. laptop went to sleep).  You can install autossh through Homebrew.

brew install autossh

No comments:

Post a Comment