OSX Client

Status

A bundle is now available.

  • Works with either gtk2 or gtk3
  • Uses GStreamer for audio (output and input?)
  • No USB support
  • No smartcard support

How to build

The MacOSX client uses the jhbuild moduleset provided by the gtk-osx project. This repository contains an additional moduleset to build the needed SPICE modules. The OSX client is based on remote-viewer (as the Windows client).

Prerequisite

Before using it, you need to install XCode. I'm using XCode 4.3.3 for Lion. After installing it, I had to run the command below to setup everything as expected:

sudo xcode-select --switch /Applications/Xcode.app/ContentsDeveloper

If you want to build spice-gtk from git (the default moduleset is building it from tarballs), you also need the Perl module Text::CSV. To install it you can run:

sudo cpan Text::CSV

Setup

Once these prerequisite are addressed, you can download the spice-osx-build-setup.sh script and run it:

sh spice-osx-build-setup.sh

It will download the gtk-osx jhbuild moduleset using the gtk-osx-build-setup.sh script from the gtk-osx project. This in turn installs jhbuild in ~/Source and creates ~/.local/bin/jhbuild. It will also install ~/.jhbuildrc and ~/.jhbuildrc-custom and will copy the current gtk-osx modules into ~/Source/jhbuild/modulesets.

After the script runs, ~/Source/spice-jhbuild will contain a jhbuildrc file. You can copy it to ~/.jhbuildrc-custom and jhbuild (as setup by the ~/.jhbuildrc file created by gtk-osx) will pick it automatically. Alternatively, you can copy it to ~/.jhbuildrc-spice and set the JHB environment variable to 'spice' (or use any other prefix of your liking). You can edit this jhbuildrc file if you want to configure the location where source will be downloaded/expanded, and the location where the built binaries/libraries will be installed.

Building

Make sure ~/.local/bin is in your PATH, this is where the jhbuild binary is located. You can then run

jhbuild bootstrap
jhbuild build

This will download and build virt-viewer and all its dependencies. Once this is done, you can start remote-viewer with

jhbuild run remote-viewer

If a weird build error happens while building freetype, exit jhbuild, run

jhbuild buildone -cfa freetype

and then restart jhbuild with

jhbuild build

Bundling

The SPICE jhbuild moduleset also comes with the needed files to generate an OSX bundle for easy deployment. This uses gtk-mac-bundler from the gtk-osx project.

After building virt-viewer or virt-viewer-gtk3, make sure you have installed gtk-mac-bundler. You can then use the bundle/remote-viewer.bundle and bundle/remote-viewer-gtk3.bundle files that come with the spice-osx moduleset to generate a bundle. If you used the spice-osx-build-setup.sh, the bundle file name will be ~/Source/spice-jhbuild/bundle/remote-viewer.bundle. Once it is installed, you can call

jhbuild run gtk-mac-bundler ~/Source/spice-jhbuild/bundle/remote-viewer.bundle

This will create a RemoteViewer.app bundle on your desktop containing everything that is needed to run the remote-viewer binary you just built on any system.

Finally, you then generate a dmg file from this bundle from the commandline using

hdiutil create ~/Desktop/dist/RemoteViewer.dmg -srcfolder ~/Desktop/dist/ -ov