lundi 25 mars 2013

SPICE on OSX, take 2

A while back, I made a Vinagre build for OSX. However, reproducing this build needed lots of manual tweaking, the build was not working on newer OSX versions, and in the mean time, the recommended SPICE client became remote-viewer. In short, this work was obsolete.

I've recently looked again at this, but this time with the goal of documenting the build process, and making the build as easy as possible to reproduce. This is once again based off gtk-osx, with an additional moduleset containing the SPICE modules, and a script to download/install most of what is needed. I've also switched to building remote-viewer instead of vinagre

This time, I've documented all of this work, but all you should have to do to build remote-viewer for OSX is to run a script, copy a configuration file to the right place, and then run a usual jhbuild build. Read the documentation for more detailed information about how to do an OSX build.

I've uploaded a binary built using these instructions, but it's lacking some features (USB redirection comes to mind), and it's slow, etc, etc, so .... patches welcome! ;) Feel free to contact me if you are interested in making OSX builds and need help getting started, have build issues, ...

10 commentaires:

Anonyme a dit…

Very good work, allows me to run RemoteViewer on my Mac OS X at last!
I did have to tweak one or two things to get the proper fonts as the characters displayed as square symbols in the viewer.
Whatever attempt to set the PANGO_RC_FILE environment variable did not work. I ended up setting content of the pangorc and pango.modules files manually within the RemoteViewer;app folder to have the correct fonts...

Now that the bundle is working fine, I am currently trying to go through the compilation process as described in you documents and hit some issues with cups, gettext, ...

As soon as everything rolls out fine, I'll post a new message.
Thanks again.
Christophe Rettien

Christophe a dit…

"I did have to tweak one or two things to get the proper fonts as the characters displayed as square symbols in the viewer."

This should be fixed in the 0.3.1 version I uplodaded a few weeks ago: http://people.freedesktop.org/~teuf/spice-gtk-osx/dmg/0.3.1/RemoteViewer-0.3.1.dmg

Anonyme a dit…

Correct, I just downloaded the 0.3.1 version and the bundle works fine, characters are displayed as expected. Thank you again.
Christophe Rettien

Unknown a dit…


Hi Christophe,
I am now building SPICE on OSX from scratch following your directives and as I am facing some issues I just wanted to share that information just in case someone runs into it and faces the same situation.
Follows the list of problems I ran into and what the workaround I used:
1- sudo xcode-select --switch /Applications/Xcode.app/ContentsDeveloper, I guess that is more like sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer, am I correct? I had to create the Developper dir.
2- sh spice-osx-build-setup.sh; I had to change the file on line 83 as follows: curl -s https://git.gnome.org/browse/gtk-osx/plain//gtk-osx-build-setup.sh -o gtk-osx-build-setup.sh || do_exit "Didn't get jhbuildrc"
3- *** Configuring cmake *** [3/17] says unknown option: --disable-introspection
Opened a shell and ran ./bootstrap --prefix /Users/... but without the --disable-introspection option. Worked for me and steps 4 to 17 ran like a charm after that.
4- running jhbuild build, I hit a problem with pyparsing: distutils.errors.DistutilsPlatformError: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.7" but "10.8" during configure
*** Error during phase build of pyparsing: ########## Error running python setup.py build *** [23/30]. Actually I am on a 10.8.3 version, so the above msg should not show.
I tried to run a shell and set export MACOSX_DEPLOYMENT_TARGET=10.8 but that did not help, so I ended up running sudo vi sysconfig.py and commented out line 407. Worked.
5- Had an error on building gstreamer: checking flex version Apple(flex-31) >= 2.5.31... Use of uninitialized value $flex_version_major in numeric gt (>) at - line 3.
This is because flex --version | head -n 1 | sed 's/^.* //' | sed 's/[a-zA-Z]*$//' | cut -d' ' -f1 returns Apple(flex-31) whereas we expect something like 2.5.31. Just changed the configure file at line 21226 to flex_version=`$FLEX_PATH --version | awk '{print $2}'`
6- Hit another issue with lib oil: configure.ac:14: error: 'AM_CONFIG_HEADER': this macro is obsolete. Just replaced as suggested line 14 with AC_CONFIG_HEADER. Worked.
I can now run "jhbuild run remote-viewer" and it works fine. I'll move to the next step to create a bundle and thanks again for your documentation and your work.
Christophe

Unknown a dit…

Hi Christophe,
I am now building SPICE on OSX from scratch following your directives and as I am facing some issues I just wanted to share that information just in case someone runs into it and faces the same situation.
Follows the list of problems I ran into and what the workaround I used:
1- sudo xcode-select --switch /Applications/Xcode.app/ContentsDeveloper, I guess that is more like sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer, am I correct? I had to create the Developper dir.
2- sh spice-osx-build-setup.sh; I had to change the file on line 83 as follows: curl -s https://git.gnome.org/browse/gtk-osx/plain//gtk-osx-build-setup.sh -o gtk-osx-build-setup.sh || do_exit "Didn't get jhbuildrc"
3- *** Configuring cmake *** [3/17] says unknown option: --disable-introspection
Opened a shell and ran ./bootstrap --prefix /Users/... but without the --disable-introspection option. Worked for me and steps 4 to 17 ran like a charm after that.
4- running jhbuild build, I hit a problem with pyparsing: distutils.errors.DistutilsPlatformError: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.7" but "10.8" during configure
*** Error during phase build of pyparsing: ########## Error running python setup.py build *** [23/30]. Actually I am on a 10.8.3 version, so the above msg should not show.
I tried to run a shell and set export MACOSX_DEPLOYMENT_TARGET=10.8 but that did not help, so I ended up running sudo vi sysconfig.py and commented out line 407. Worked.
5- Had an error on building gstreamer: checking flex version Apple(flex-31) >= 2.5.31... Use of uninitialized value $flex_version_major in numeric gt (>) at - line 3.
This is because flex --version | head -n 1 | sed 's/^.* //' | sed 's/[a-zA-Z]*$//' | cut -d' ' -f1 returns Apple(flex-31) whereas we expect something like 2.5.31. Just changed the configure file at line 21226 to flex_version=`$FLEX_PATH --version | awk '{print $2}'`
6- Hit another issue with lib oil: configure.ac:14: error: 'AM_CONFIG_HEADER': this macro is obsolete. Just replaced as suggested line 14 with AC_CONFIG_HEADER. Worked.
I can now run "jhbuild run remote-viewer" and it works fine. I'll move to the next step to create a bundle and thanks again for your documentation and your work.
Christophe

Unknown a dit…

Hi Christophe,
Do you think you could post the bundle file (Remot-Viewer.bundle) you created to generate the application bundle? That could be of great help for me to use as a template. Thanks
Christophe

Christophe a dit…

1) is probably a small typo of mine

2) I don't understand what you had to change, this looks like the URL that would be generated anyway

3)I don't know what module this is about

4) 5) and 6) looks like various distutils/autotools related issues in the upstream modules

The bundle file is available from http://cgit.freedesktop.org/~teuf/spice-jhbuild/tree/bundle/remote-viewer.bundle?h=osx (the repo is linked from http://spice-space.org/page/OSX_Client )

Byron Sanchez a dit…

I also received the square symbol issue on earlier versions. But the 0.3.1 binary is working perfectly on my Mac OS X 10.7 iMac acting as the client to the SPICE server.

Does sound currently work on this version of RemoteViewer? I am wondering whether or not I should pursue with debugging my own local configuration, in the case that this port currently supports sound.

Unknown a dit…

Although working fine, the binary is indeed dead slow when it comes to dragging windows or displaying menus. I am trying to replace the libjpeg used by spice-gtk with libjpeg-turbo which should improve performance.
There is a libjpeg-turbo package for Mac OS X (http://sourceforge.net/projects/libjpeg-turbo/). It stores the files in the /opt dir on your Mac. But building remote-viewer to use it is not trivial as there seems to be a hard coded dependency with the specific libjpeg-8 somewhere.
Any help is welcome.

Unknown a dit…

great job,
i am on my way change desktop from windows to mac os,
USB redirection is required for e-bank usbkey.