User Tools

Site Tools


wiki:development:build-howto-macos:x2goclient

Building X2Go Client on Mac OS

Build X2Go Client using MacPorts

X2Go Client is available from MacPorts, maintained by Clemens Lang, who currently also builds the official X2Go Client DMGs.

If you just want to get a working version of X2Go Client you can just run sudo port install x2goclient.

If you want to build a re-distributable DMG image such as the one available from the website, follow these steps (assuming you already have MacPorts installed):

Steps summarized:

  1. Install the dependencies for X2Go Client
  2. Install the build-time dependency dylibbundler
  3. Get X2Go Client from X2Go Git
  4. Build X2Go Client DMG image

So, first install the X2Go Client dependencies and dylibbundler:

$ sudo port install depof:x2goclient dylibbundler

Once the dependencies are installed, tweak some file permissions:

$ sudo chmod u+w /opt/local/lib/libcrypto.1.0.0.dylib /opt/local/lib/libssl.1.0.0.dylib

If you omit the file permission tweak, dylibbundler will fail to bundle OpenSSL with X2Go Client.

At last, checkout X2Go Client from Git:

$ git clone git://code.x2go.org/x2goclient.git

If you want to build a specific version of X2Go Client, select that version with git checkout <version>. If you want to look around what versions are available, use git tag which will present you a list of valid version tags to use for checkout.

In the X2Go Client source directory, simply run the macbuild.sh script. Depending on your OS and your needs, you might want to adjust the lines mentioning QMAKE_MAC_SDK, QMAKE_MACOSX_DEPLOYMENT_TARGET and the CONFIG line that contains the target architectures. Once done, run

$ ./macbuild.sh

to generate x2goclient.dmg.

Build/Install X2Go Client using Homebrew

X2Go Client and it's dependencies are already formulated in Homebrew (thanks to Eugene San).

We assume you've already installed Homebrew. If not, please visit the Homebrew website.

It is possible to install X2Go Client in one command:

$ brew install x2goclient

Build X2Go Client from Scratch

Variables

This document makes use of several variables to address paths in a generic, but distinct way. They are not meant to be used via shell, but for human parsing. No program of the x2go suite actually uses them for anything. You may “set” them to whatever value you want to (in your head), just don't change them half-way through the building process. The “default value” is merely a suggestion.

Name Description Default value
$X2GO_BASE_DIR Parent directory of the x2goclient source tree /usr/src
$X2GO_CLIENT_DIR Directory containing the x2goclient source tree $X2GO_BASE_DIR/x2goclient-git
$X2GO_DIST_SRC Directory containing x2goclient dependencies source trees $X2GO_CLIENT_DIR/dist
$X2GO_DIST_INST Installation directory of x2goclient dependencies $X2GO_DIST_SRC/inst
$NX_BASE_DIR Common NX directory /usr/src/NX
$NX_LIBS_SRC Directory containing the NX libs source tree $NX_BASE_DIR/nx-libs-src
$NX_DIST_SRC Directory containing NX libs dependencies source trees $NX_BASE_DIR/dist
$NX_DIST_INST Installation directory of NX libs dependencies $NX_DIST_SRC/inst

Get the sources

x2goclient

Prepare $X2GO_BASE_DIR if need be.

# mkdir -p "$X2GO_BASE_DIR"
# cd "$X2GO_BASE_DIR"

Fetch the x2goclient sources.

# git clone git://code.x2go.org/x2goclient.git x2goclient-git

Prepare the dependencies directories.

# mkdir "$X2GO_DIST_SRC"
# mkdir "$X2GO_DIST_INST"

NX libraries

Prepare $NX_BASE_DIR.

# mkdir -p "$NX_BASE_DIR"
# cd "$NX_BASE_DIR"

Fetch the NX libraries sources.

$ wget http://code.x2go.org/releases/source/nx-libs/nx-libs-<version>-lite.tar.gz
$ tar xzf nx-libs-<version>-lite.tar.gz
$ mv nx-libs-<version> nx-libs-src

Prepare the dependencies directories.

# mkdir "$NX_DIST_SRC"
# mkdir "$NX_DIST_INST"

Dependencies

  • for optional sound support: PulseAudio
  • build dependencies:
    • Apple Developer SDK
    • Qt 4
    • libssh >= 0.4.7
    • libjpeg or libjpeg-turbo
    • libpng
    • nx-binaries

Qt4

Qt4 is a hard dependency. You can either download and install the SDK package for Mac OS X provided by Nokia, or, if you want to redistribute/deploy x2goclient on other machines, build your own version from source.

If you decide to build from source, follow these instructions, else skip to the NX part.

Download

Download the source package from the official Qt site (.tar.gz recommended.)

Put it into $X2GO_DIST_SRC.

Unpack it.

# cd "$X2GO_DIST_SRC"
# tar -xzvf qt...tar.gz
# cd qt-...
Configuration

Configure the qt source tree. We will disable unused stuff and build universal (for deployment.)

If you don't intend to deploy x2goclient, you can remove all -arch parameters and further speed up compilation.

If you don't want to debug x2goclient, replace -debug-and-release with -release for added speed.

Remember to substitute the variables with the correct path values!

# CXX="g++-4.2" CC="gcc-4.2" OBJC="gcc-4.2" PKG_CONFIG="/usr/bin/pkg-config" ./configure -prefix "$X2GO_DIST_INST/qt" -prefix-install -debug-and-release -opensource -shared -fast -largefile -no-exceptions -no-xmlpatterns -accessibility -stl -no-sql-psql -plugin-sql-sqlite -no-qt3support -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -svg -no-javascript-jit -no-webkit -no-script -no-scripttools -no-declarative -no-declarative-debug -platform macx-g++ -graphicssystem raster -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-neon -system-zlib -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -openssl-linked -rpath -v -no-optimized-qmake -no-nis -cups -iconv -no-pch -no-dbus -cocoa -framework -dwarf2 -arch "x86_64 x86 ppc" -confirm-license -nomake demos -nomake examples -nomake docs -sdk /Developer/SDKs/MacOSX10.5.sdk

If everything went through cleanly, proceed to the next step.

Building

Run make and pray. Pray strongly. To whomever or whatever you want, just pray.

# make

If everything went through without errors, install Qt.

# make install

libssh

Dependencies

libssh uses CMake to configure the source build. Please download and install CMake from the official CMake repository.

Download

Download the source package from the libssh repository. Note that currently 0.5.2 is buggy, at least on Mac OS X. Please use 0.5.1 for now.

Put it into $X2GO_DIST_SRC.

Unpack the source.

# tar -xzvf libssh-...tar.gz
# cd libssh-...
Configuration

Create a build subdir.

# mkdir build
# cd build

Configure libssh.

Again, substitute variables. If you don't need multiarch support, replace “CMAKE_OSX_ARCHITECTURES:STRING=i386 -arch x86_64 -arch ppc” with “CMAKE_OSX_ARCHITECTURES:STRING=”.

# cmake -D "CMAKE_BUILD_TYPE:STRING=Release" -D "CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++-4.2" -D "CMAKE_CXX_FLAGS:STRING=-pipe -Wall -Wextra" -D "CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG" -D "CMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc-4.2" -D "CMAKE_C_FLAGS:STRING=-pipe -Wall -Wextra" -D "CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG" -D "CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON" -D "CMAKE_INSTALL_PREFIX:PATH=$X2GO_DIST_INST" -D "CMAKE_OSX_ARCHITECTURES:STRING=i386 -arch x86_64 -arch ppc" -D "CMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.5" -D "CMAKE_OSX_SYSROOT:PATH=/Developer/SDKs/MacOSX10.5.sdk" -D "CMAKE_VERBOSE_MAKEFILE:BOOL=ON" -D "CMAKE_SKIP_RPATH:BOOL=NO" -D "CPACK_BINARY_BUNDLE:BOOL=OFF" -D "CPACK_BINARY_OSXX11:BOOL=OFF" -D "WITH_BENCHMARKS:BOOL=OFF" -D "WITH_CLIENT_TESTING:BOOL=OFF" -D "WITH_DEBUG_CALLTRACE:BOOL=ON" -D "WITH_DEBUG_CRYPTO:BOOL=OFF" -D "WITH_GCRYPT:BOOL=OFF" -D "WITH_INTERNAL_DOC:BOOL=OFF" -D "WITH_LIBZ:BOOL=ON" -D "WITH_PCAP:BOOL=OFF" -D "WITH_SERVER:BOOL=OFF" -D "WITH_SFTP:BOOL=ON" -D "WITH_SSH1:BOOL=ON" -D "WITH_STATIC_LIB:BOOL=ON" -D "WITH_TESTING:BOOL=OFF"
Building

Build the source.

# make

Install libssh.

# make install

Remove the shared libraries (we only need the static one.)

# rm "$X2GO_DIST_INST/lib/"libssh*.dylib

Run the following commands as a regular, non-root user. You'll need the root password to install them.

1. Install nxproxy from the nx-libs-lite tarball

$ wget http://code.x2go.org/releases/source/nx-libs/nx-libs-<version>-lite.tar.gz
$ tar xzf nx-libs-<version>-lite.tar.gz
$ cd nx-libs-<version>
$ PREFIX=/usr make
$ su -c "make install"

2a. Install x2goclient from git

$ git clone git://code.x2go.org/x2goclient
$ cd x2goclient
$ export PREFIX=/usr
$ make build_client && make install_client

2b. Also build+install x2goplugin

$ make build_plugin && make install_plugin
wiki/development/build-howto-macos/x2goclient.txt · Last modified: 2015/08/27 01:43 by ionic