3 # Copyright (C) 2010, Intel Corp.
5 # Modified version of gnome-shell-build-setup.sh for building Clutter
6 # and its dependencies using jhbuild
8 # Copyright (C) 2008, Red Hat, Inc.
10 # Some ideas and code taken from gtk-osx-build
12 # Copyright (C) 2006, 2007, 2008 Imendio AB
15 # Pre-check on GNOME version
19 if which lsb_release > /dev/null 2>&1; then
20 system=`lsb_release -is`
21 version=`lsb_release -rs`
22 elif [ -f /etc/fedora-release ] ; then
24 release_file=/etc/fedora-release
25 elif [ -f /etc/SuSE-release ] ; then
27 release_file=/etc/SuSE-release
28 elif [ -f /etc/mandriva-release ]; then
30 release_file=/etc/mandriva-release
33 if [ x$release_file != x ] ; then
34 version=`sed 's/[^0-9\.]*\([0-9\.]\+\).*/\1/' < $release_file`
37 if test x$system = xUbuntu -o x$system = xDebian -o x$system = xLinuxMint ; then
39 if [ ! -x /usr/bin/dpkg-checkbuilddeps ]; then
40 echo "Please run 'sudo apt-get install dpkg-dev' and try again."
45 build-essential curl \
46 automake bison flex gettext git-core gnome-common gtk-doc-tools \
47 libjasper-dev libjpeg-dev libpng-dev libstartup-notification0-dev libtiff-dev \
48 libgl1-mesa-dev libxml2-dev mesa-common-dev mesa-utils \
49 python-dev python-gconf python-gobject \
50 libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good \
52 if ! dpkg-checkbuilddeps -d $pkg /dev/null 2> /dev/null; then
56 if test ! "x$reqd" = x; then
57 echo "Please run 'sudo apt-get install $reqd' and try again."
63 if test x$system = xFedora ; then
65 binutils curl gcc gcc-c++ make
66 automake bison flex gettext git gnome-common gnome-doc-utils intltool
67 libtool pkgconfig jasper-devel libffi-devel libjpeg-devel
68 libpng-devel libtiff-devel libwnck-devel mesa-libGL-devel
69 python-devel pygobject2 libXdamage-devel libxml2-devel
70 gstreamer-devel gstreamer-plugins-base gstreamer-plugins-good
74 if expr $version \>= 14 > /dev/null ; then
75 reqd="$reqd gettext-autopoint"
79 if ! rpm -q $pkg > /dev/null 2>&1; then
80 missing="$pkg $missing"
83 if test ! "x$missing" = x; then
84 gpk-install-package-name $missing
88 if test x$system = xSUSE ; then
92 bison flex gnome-doc-utils-devel \
93 xorg-x11-proto-devel xorg-x11-devel xorg-x11 xorg-x11-server-extra \
95 if ! rpm -q $pkg > /dev/null 2>&1; then
99 if test ! "x$reqd" = x; then
100 echo "Please run 'su --command=\"zypper install $reqd\"' and try again."
106 if test x$system = xMandrivaLinux ; then
110 bison flex gnome-common gnome-doc-utils gtk-doc intltool \
111 libwnck-1-devel GL-devel \
112 libxdamage-devel mesa-demos \
114 if ! rpm -q --whatprovides $pkg > /dev/null 2>&1; then
118 if test ! "x$reqd" = x; then
124 BASEURL=http://git.clutter-project.org/clutter/plain/build
126 if [ -d $SOURCE ] ; then : ; else
128 echo "Created $SOURCE"
131 if [ -d $SOURCE/jhbuild ] ; then
132 if [ -d $SOURCE/jhbuild/.git ] ; then
133 echo -n "Updating jhbuild ... "
134 ( cd $SOURCE/jhbuild && git pull --rebase > /dev/null ) || exit 1
137 echo "$SOURCE/jhbuild is not a git repository"
138 echo "You should remove it and rerun this script"
142 echo -n "Checking out jhbuild into $SOURCE/jhbuild ... "
144 git clone git://git.gnome.org/jhbuild > /dev/null || exit 1
148 echo "Installing jhbuild..."
149 (cd $SOURCE/jhbuild && make -f Makefile.plain DISABLE_GETTEXT=1 bindir=$HOME/bin install >/dev/null)
151 if [ -e $HOME/.jhbuildrc ] ; then
152 if grep JHBUILDRC_GNOME_SHELL $HOME/.jhbuildrc > /dev/null ; then : ; else
153 mv $HOME/.jhbuildrc $HOME/.jhbuildrc.bak
154 echo "Saved ~/.jhbuildrc as ~/.jhbuildrc.bak"
158 echo -n "Writing ~/.jhbuildrc ... "
159 curl -L -s -o $HOME/.jhbuildrc $BASEURL/jhbuildrc-clutter
162 if [ ! -f $HOME/.jhbuildrc-custom ]; then
163 echo -n "Writing example ~/.jhbuildrc-custom ... "
164 curl -L -s -o $HOME/.jhbuildrc-custom $BASEURL/jhbuildrc-custom-example
168 if test "x`echo $PATH | grep $HOME/bin`" = x; then
169 echo "PATH does not contain $HOME/bin, it is recommended that you add that."