summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2012-11-14 11:45:39 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2012-11-14 14:20:37 +0100
commit3a099234b4155973243b99b680af7a70c8beb142 (patch)
tree616190c15b312f1ce30e77c2c3cae3f6609212f9
parentd9123b30d3ffd475b149c073a9b243c21b934dc3 (diff)
Add script to download and setup SPICE OSX build
-rwxr-xr-xspice-osx-build-setup.sh64
1 files changed, 64 insertions, 0 deletions
diff --git a/spice-osx-build-setup.sh b/spice-osx-build-setup.sh
new file mode 100755
index 0000000..c04311e
--- /dev/null
+++ b/spice-osx-build-setup.sh
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# Script that sets up jhbuild for SPICE OS X building. Run this to
+# checkout jhbuild and the required configuration.
+#
+# Copyright 2007, 2008, 2009 Imendio AB
+# Copyright 2012 Red Hat, Inc
+#
+# Run this whenever you want to update jhbuild or the jhbuild setup;
+# it is safe to run it repeatedly. Note that it overwrites
+# ~/.jhbuildrc however. Custom settings should be kept in
+# ~/.jhbuildrc-custom.
+#
+# You need Mac OS X 10.4 or newer and Xcode 2.5 or newer. Make sure
+# you have subversion (svn) installed, 10.5 has it by default.
+#
+# Quick HOWTO:
+#
+# sh spice-osx-build-setup.sh
+#
+# export JHB=spice
+# jhbuild bootstrap
+# jhbuild build
+#
+# See http://spice-space.org/page/OSX_Client/Build for more information.
+#
+
+SOURCE=$HOME/Source
+BASEURL="http://git.gnome.org/browse/gtk-osx/plain/"
+SPICE_JHBUILD_GIT="git://people.freedesktop.org/~teuf/spice-jhbuild"
+
+do_exit()
+{
+ echo $1
+ exit 1
+}
+
+if test x`which git` == x; then
+ do_exit "Git is not available, please install it and try again."
+fi
+
+mkdir -p $SOURCE 2>/dev/null || do_exit "The directory $SOURCE could not be created. Check permissions and try again."
+
+echo "Checking out spice-jhbuild from git..."
+if ! test -d $SOURCE/spice-jhbuild; then
+ cd $SOURCE
+ git clone "$SPICE_JHBUILD_GIT" || do_exit "Failed to clone spice-jhbuild."
+ cd spice-jhbuild
+ git checkout osx || do_exit "Checkout of osx branch failed";
+else
+ cd $SOURCE/spice-jhbuild || do_exit "Can't cd to $SOURCE/spice-jhbuild."
+ git pull >/dev/null || \
+ do_exit "Update of spice-jhbuild failed";
+fi
+
+echo "Installing spice-jhbuild configuration..."
+if [ ! -f $HOME/.jhbuildrc-spice ]; then
+ cp jhbuildrc ~/.jhbuildrc-spice
+fi
+
+echo "Setting up gtk-osx build"
+cd ..
+curl -s $BASEURL/gtk-osx-build-setup.sh -o gtk-osx-build-setup.sh || do_exit "Didn't get jhbuildrc"
+sh gtk-osx-build-setup.sh || do_exit "Failed to setup gtk-osx build"