2008-10-31 05:25:28 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Script that sets up jhbuild to build gnome-shell. Run this to
|
|
|
|
# checkout jhbuild and the required configuration.
|
|
|
|
#
|
|
|
|
# Copyright (C) 2008, Red Hat, Inc.
|
|
|
|
#
|
|
|
|
# Some ideas and code taken from gtk-osx-build
|
|
|
|
#
|
|
|
|
# Copyright (C) 2006, 2007, 2008 Imendio AB
|
|
|
|
#
|
|
|
|
|
2009-01-27 16:55:39 +00:00
|
|
|
if which lsb_release > /dev/null 2>&1; then
|
|
|
|
system=`lsb_release -is`
|
|
|
|
elif [ -f /etc/fedora-release ] ; then
|
|
|
|
system=Fedora
|
2009-02-08 12:34:26 +00:00
|
|
|
elif [ -f /etc/SuSE-release ] ; then
|
2009-02-24 18:05:13 +00:00
|
|
|
system=SUSE
|
2009-02-13 17:21:51 +00:00
|
|
|
elif [ -f /etc/mandriva-release ]; then
|
|
|
|
system=MandrivaLinux
|
2009-01-27 16:55:39 +00:00
|
|
|
fi
|
|
|
|
|
2009-02-24 18:05:13 +00:00
|
|
|
# Required software:
|
|
|
|
#
|
|
|
|
# For this script:
|
2009-04-18 18:22:02 +00:00
|
|
|
# binutils, curl, gcc, make, git
|
2009-02-24 18:05:13 +00:00
|
|
|
#
|
|
|
|
# General build stuff:
|
|
|
|
# automake, bison, flex, git, gnome-common, gtk-doc, intltool,
|
|
|
|
# libtool, pkgconfig
|
|
|
|
#
|
|
|
|
# Devel packages needed by gnome-shell and its deps:
|
2009-04-09 13:54:58 +00:00
|
|
|
# dbus-glib, gconf, GL, gnome-menus, gtk, libffi, libgnomeui, librsvg, libwnck,
|
2009-02-24 18:05:13 +00:00
|
|
|
# python, readline, spidermonkey ({mozilla,firefox,xulrunner}-js),
|
|
|
|
# xdamage
|
|
|
|
#
|
|
|
|
# Non-devel packages needed by gnome-shell and its deps:
|
|
|
|
# gdb, glxinfo, python, Xephyr, xeyes*, xlogo*, xterm*, zenity
|
|
|
|
#
|
|
|
|
# (*)ed packages are only needed because gnome-shell launches them
|
|
|
|
# when running in Xephyr mode, and we should probably change it to use
|
|
|
|
# less lame things.
|
|
|
|
|
2009-04-01 20:56:50 +00:00
|
|
|
# Can this be simplified? Obvious ways don't handle handle packages
|
|
|
|
# that have been installed then removed. ('purged' status, e.g.)
|
|
|
|
dpkg_is_installed() {
|
|
|
|
status=`dpkg-query --show --showformat='${Status}' $1 2>/dev/null`
|
|
|
|
if [ $? = 0 ] ; then
|
|
|
|
set $status
|
|
|
|
if [ "$3" = installed ] ; then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2008-11-18 00:45:32 +00:00
|
|
|
if test x$system = xUbuntu -o x$system = xDebian ; then
|
2008-11-28 20:35:32 +00:00
|
|
|
reqd=""
|
2009-02-24 18:05:13 +00:00
|
|
|
for pkg in \
|
2009-04-18 18:22:02 +00:00
|
|
|
build-essential curl \
|
2009-02-24 18:05:13 +00:00
|
|
|
automake bison flex git-core gnome-common gtk-doc-tools \
|
|
|
|
libdbus-glib-1-dev libgconf2-dev libgtk2.0-dev libffi-dev \
|
2009-04-09 14:32:21 +00:00
|
|
|
libgnome-menu-dev libgnomeui-dev librsvg2-dev libwnck-dev libgl1-mesa-dev \
|
2009-02-24 18:05:13 +00:00
|
|
|
mesa-common-dev python2.5-dev libreadline5-dev xulrunner-1.9-dev \
|
|
|
|
; do
|
2009-04-01 20:56:50 +00:00
|
|
|
if ! dpkg_is_installed $pkg; then
|
2008-11-28 20:35:32 +00:00
|
|
|
reqd="$pkg $reqd"
|
|
|
|
fi
|
|
|
|
done
|
2008-11-29 21:44:17 +00:00
|
|
|
if test ! "x$reqd" = x; then
|
2009-02-24 18:05:13 +00:00
|
|
|
echo "Please run 'sudo apt-get install $reqd' and try again."
|
2008-11-28 20:35:32 +00:00
|
|
|
echo
|
2009-02-24 18:05:13 +00:00
|
|
|
exit 1
|
2008-11-28 20:35:32 +00:00
|
|
|
fi
|
2008-11-18 00:45:32 +00:00
|
|
|
fi
|
|
|
|
|
2009-01-27 16:55:39 +00:00
|
|
|
if test x$system = xFedora ; then
|
|
|
|
reqd=""
|
2009-02-24 18:05:13 +00:00
|
|
|
for pkg in \
|
2009-04-18 18:22:02 +00:00
|
|
|
binutils curl gcc make \
|
2009-02-24 18:05:13 +00:00
|
|
|
automake bison flex git gnome-common gnome-doc-utils intltool \
|
|
|
|
libtool pkgconfig \
|
2009-04-09 13:54:58 +00:00
|
|
|
dbus-glib-devel GConf2-devel gnome-menus-devel gtk2-devel libffi-devel libgnomeui-devel \
|
2009-02-24 18:05:13 +00:00
|
|
|
librsvg2-devel libwnck-devel mesa-libGL-devel python-devel readline-devel \
|
|
|
|
xulrunner-devel libXdamage-devel \
|
|
|
|
gdb glx-utils xorg-x11-apps xorg-x11-server-Xephyr xterm zenity \
|
2009-03-13 21:14:31 +00:00
|
|
|
gstreamer-devel gstreamer-plugins-base gstreamer-plugins-good \
|
2009-02-24 18:05:13 +00:00
|
|
|
; do
|
2009-01-27 16:55:39 +00:00
|
|
|
if ! rpm -q $pkg > /dev/null 2>&1; then
|
|
|
|
reqd="$pkg $reqd"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if test ! "x$reqd" = x; then
|
|
|
|
gpk-install-package-name $reqd
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2009-02-24 18:05:13 +00:00
|
|
|
if test x$system = xSUSE ; then
|
2009-02-08 12:34:26 +00:00
|
|
|
reqd=""
|
2009-02-24 18:05:13 +00:00
|
|
|
for pkg in \
|
|
|
|
curl \
|
|
|
|
bison flex gnome-doc-utils-devel \
|
|
|
|
gconf2-devel libffi-devel libgnomeui-devel librsvg-devel libwnck-devel \
|
|
|
|
readline-devel mozilla-xulrunner190-devel xorg-x11-devel \
|
|
|
|
xterm xorg-x11 xorg-x11-server-extra \
|
|
|
|
; do
|
2009-02-08 12:34:26 +00:00
|
|
|
if ! rpm -q $pkg > /dev/null 2>&1; then
|
|
|
|
reqd="$pkg $reqd"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if test ! "x$reqd" = x; then
|
2009-02-24 18:05:13 +00:00
|
|
|
echo "Please run 'su --command=\"zypper install $reqd\"' and try again."
|
2009-02-08 12:34:26 +00:00
|
|
|
echo
|
2009-02-24 18:05:13 +00:00
|
|
|
exit 1
|
2009-02-08 12:34:26 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2009-02-13 17:21:51 +00:00
|
|
|
if test x$system = xMandrivaLinux ; then
|
|
|
|
reqd=""
|
2009-02-24 18:05:13 +00:00
|
|
|
for pkg in \
|
|
|
|
curl \
|
|
|
|
bison flex gnome-common gnome-doc-utils gtk-doc intltool \
|
|
|
|
libGConf2-devel ffi5-devel libgnomeui2-devel librsvg2-devel \
|
|
|
|
libwnck-1-devel GL-devel readline-devel libxulrunner-devel \
|
|
|
|
libxdamage-devel \
|
|
|
|
mesa-demos x11-server-xephyr x11-apps xterm zenity \
|
|
|
|
; do
|
2009-02-13 17:21:51 +00:00
|
|
|
if ! rpm -q --whatprovides $pkg > /dev/null 2>&1; then
|
|
|
|
reqd="$pkg $reqd"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if test ! "x$reqd" = x; then
|
2009-02-13 17:53:54 +00:00
|
|
|
gurpmi --auto $reqd
|
2009-02-13 17:21:51 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2009-02-24 18:05:13 +00:00
|
|
|
SOURCE=$HOME/Source
|
|
|
|
BASEURL=http://git.gnome.org/cgit/gnome-shell/plain/tools/build
|
|
|
|
|
|
|
|
if [ -d $SOURCE ] ; then : ; else
|
|
|
|
mkdir $SOURCE
|
|
|
|
echo "Created $SOURCE"
|
|
|
|
fi
|
|
|
|
|
2009-04-18 18:22:02 +00:00
|
|
|
if [ -d $SOURCE/jhbuild ] ; then
|
|
|
|
if [ -d $SOURCE/jhbuild/.git ] ; then
|
|
|
|
echo -n "Updating jhbuild ... "
|
|
|
|
( cd $SOURCE/jhbuild && git pull --rebase > /dev/null ) || exit 1
|
|
|
|
echo "done"
|
|
|
|
else
|
|
|
|
echo "$SOURCE/jhbuild is not a git repository"
|
|
|
|
echo "You should remove it and rerun this script"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo -n "Checking out jhbuild into $SOURCE/jhbuild ... "
|
|
|
|
cd $SOURCE
|
|
|
|
git clone git://git.gnome.org/jhbuild > /dev/null || exit 1
|
|
|
|
echo "done"
|
|
|
|
fi
|
2009-02-24 18:05:13 +00:00
|
|
|
|
|
|
|
echo "Installing jhbuild..."
|
|
|
|
(cd $SOURCE/jhbuild && make -f Makefile.plain DISABLE_GETTEXT=1 install >/dev/null)
|
|
|
|
|
|
|
|
if [ -e $HOME/.jhbuildrc ] ; then
|
|
|
|
if grep JHBUILDRC_GNOME_SHELL $HOME/.jhbuildrc > /dev/null ; then : ; else
|
|
|
|
mv $HOME/.jhbuildrc $HOME/.jhbuildrc.bak
|
|
|
|
echo "Saved ~/.jhbuildrc as ~/.jhbuildrc.bak"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo -n "Writing ~/.jhbuildrc ... "
|
|
|
|
curl -s -o $HOME/.jhbuildrc $BASEURL/jhbuildrc-gnome-shell
|
|
|
|
echo "done"
|
|
|
|
|
|
|
|
if [ ! -f $HOME/.jhbuildrc-custom ]; then
|
|
|
|
echo -n "Writing example ~/.jhbuildrc-custom ... "
|
|
|
|
curl -s -o $HOME/.jhbuildrc-custom $BASEURL/jhbuildrc-custom-example
|
|
|
|
echo "done"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x`echo $PATH | grep $HOME/bin`" = x; then
|
|
|
|
echo "PATH does not contain $HOME/bin, it is recommended that you add that."
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
2008-10-31 05:25:28 +00:00
|
|
|
echo "Done."
|
|
|
|
|