2008-10-31 01:25:28 -04: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-08-27 16:19:35 -04:00
|
|
|
# Pre-check on GNOME version
|
|
|
|
|
|
|
|
gnome_version=`gnome-session --version 2>/dev/null | (read name version && echo $version)`
|
|
|
|
have_gnome_26=false
|
|
|
|
case $gnome_version in
|
|
|
|
2.2[6789]*|2.[3456789]*|3.*)
|
|
|
|
have_gnome_26=true
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if $have_gnome_26 ; then : ; else
|
|
|
|
echo "GNOME 2.26 or newer is required to build GNOME Shell" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################################
|
|
|
|
|
2009-01-27 11:55:39 -05: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 07:34:26 -05:00
|
|
|
elif [ -f /etc/SuSE-release ] ; then
|
2009-02-24 13:05:13 -05:00
|
|
|
system=SUSE
|
2009-02-13 12:21:51 -05:00
|
|
|
elif [ -f /etc/mandriva-release ]; then
|
|
|
|
system=MandrivaLinux
|
2009-01-27 11:55:39 -05:00
|
|
|
fi
|
|
|
|
|
2009-02-24 13:05:13 -05:00
|
|
|
# Required software:
|
|
|
|
#
|
|
|
|
# For this script:
|
2009-04-18 14:22:02 -04:00
|
|
|
# binutils, curl, gcc, make, git
|
2009-02-24 13:05:13 -05:00
|
|
|
#
|
|
|
|
# General build stuff:
|
|
|
|
# automake, bison, flex, git, gnome-common, gtk-doc, intltool,
|
|
|
|
# libtool, pkgconfig
|
|
|
|
#
|
|
|
|
# Devel packages needed by gnome-shell and its deps:
|
2010-07-05 20:27:26 -04:00
|
|
|
# dbus-glib, GL, gnome-menus, gstreamer, libffi,
|
|
|
|
# libjasper, libjpeg, libpng, libtiff, libwnck,
|
|
|
|
# libxml2, python,readline, spidermonkey ({mozilla,firefox,xulrunner}-js),
|
|
|
|
# startup-notification, xdamage
|
2009-02-24 13:05:13 -05:00
|
|
|
#
|
|
|
|
# Non-devel packages needed by gnome-shell and its deps:
|
2009-08-27 16:19:35 -04:00
|
|
|
# glxinfo, gstreamer-plugins-base, gstreamer-plugins-good,
|
2010-07-05 20:27:26 -04:00
|
|
|
# gvfs, python, pygobject, gnome-python (gconf), gnome-terminal*
|
2009-11-12 15:17:35 -05:00
|
|
|
# Xephyr*, zenity
|
2009-02-24 13:05:13 -05:00
|
|
|
#
|
2009-11-12 15:17:35 -05:00
|
|
|
# (*) only needed for --xephyr
|
2009-02-24 13:05:13 -05:00
|
|
|
|
2009-04-01 16:56:50 -04: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
|
|
|
|
}
|
|
|
|
|
2009-09-26 13:14:43 -04:00
|
|
|
if test x$system = xUbuntu -o x$system = xDebian -o x$system = xLinuxMint ; then
|
2008-11-28 15:35:32 -05:00
|
|
|
reqd=""
|
2009-02-24 13:05:13 -05:00
|
|
|
for pkg in \
|
2009-04-18 14:22:02 -04:00
|
|
|
build-essential curl \
|
2010-07-05 20:27:26 -04:00
|
|
|
automake bison flex git-core gnome-common gtk-doc-tools gvfs gvfs-backends \
|
|
|
|
libdbus-glib-1-dev libffi-dev libgnome-menu-dev libgnome-desktop-dev \
|
|
|
|
libjasper-dev libjpeg-dev libpng-dev libstartup-notification0-dev libtiff-dev \
|
|
|
|
libwnck-dev libgl1-mesa-devlibreadline5-dev libxml2-dev mesa-common-dev mesa-utils \
|
|
|
|
python-dev python-gconf python-gobject xulrunner-dev xserver-xephyr gnome-terminal \
|
|
|
|
libcroco3-dev libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good \
|
2009-02-24 13:05:13 -05:00
|
|
|
; do
|
2009-04-01 16:56:50 -04:00
|
|
|
if ! dpkg_is_installed $pkg; then
|
2008-11-28 15:35:32 -05:00
|
|
|
reqd="$pkg $reqd"
|
|
|
|
fi
|
|
|
|
done
|
2008-11-29 16:44:17 -05:00
|
|
|
if test ! "x$reqd" = x; then
|
2009-02-24 13:05:13 -05:00
|
|
|
echo "Please run 'sudo apt-get install $reqd' and try again."
|
2008-11-28 15:35:32 -05:00
|
|
|
echo
|
2009-02-24 13:05:13 -05:00
|
|
|
exit 1
|
2008-11-28 15:35:32 -05:00
|
|
|
fi
|
2008-11-17 19:45:32 -05:00
|
|
|
fi
|
|
|
|
|
2009-01-27 11:55:39 -05:00
|
|
|
if test x$system = xFedora ; then
|
|
|
|
reqd=""
|
2009-02-24 13:05:13 -05:00
|
|
|
for pkg in \
|
2010-01-06 13:54:12 -05:00
|
|
|
binutils curl gcc gcc-c++ make \
|
2010-07-05 20:27:26 -04:00
|
|
|
automake bison flex git gnome-common gnome-doc-utils gvfs intltool \
|
|
|
|
libtool pkgconfig dbus-glib-devel gnome-desktop-devel gnome-menus-devel \
|
|
|
|
gnome-python2-gconf jasper-devel libffi-devel libjpeg-devel \
|
|
|
|
libpng-devel libtiff-devel libwnck-devel mesa-libGL-devel \
|
2010-06-25 10:10:18 -04:00
|
|
|
python-devel pygobject2 readline-devel xulrunner-devel libXdamage-devel libcroco-devel \
|
|
|
|
libxml2-devel gstreamer-devel gstreamer-plugins-base gstreamer-plugins-good \
|
2010-07-05 20:27:26 -04:00
|
|
|
glx-utils startup-notification-devel xorg-x11-server-Xephyr gnome-terminal zenity \
|
2009-02-24 13:05:13 -05:00
|
|
|
; do
|
2009-01-27 11:55:39 -05: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 13:05:13 -05:00
|
|
|
if test x$system = xSUSE ; then
|
2009-02-08 07:34:26 -05:00
|
|
|
reqd=""
|
2009-02-24 13:05:13 -05:00
|
|
|
for pkg in \
|
|
|
|
curl \
|
|
|
|
bison flex gnome-doc-utils-devel \
|
2010-07-05 20:27:26 -04:00
|
|
|
libffi-devel gnome-desktop-devel libwnck-devel \
|
2009-07-01 14:54:51 -04:00
|
|
|
xorg-x11-proto-devel readline-devel mozilla-xulrunner190-devel \
|
2009-11-12 15:17:35 -05:00
|
|
|
libcroco-devel xorg-x11-devel xorg-x11 xorg-x11-server-extra \
|
2009-02-24 13:05:13 -05:00
|
|
|
; do
|
2009-02-08 07:34:26 -05:00
|
|
|
if ! rpm -q $pkg > /dev/null 2>&1; then
|
|
|
|
reqd="$pkg $reqd"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if test ! "x$reqd" = x; then
|
2009-02-24 13:05:13 -05:00
|
|
|
echo "Please run 'su --command=\"zypper install $reqd\"' and try again."
|
2009-02-08 07:34:26 -05:00
|
|
|
echo
|
2009-02-24 13:05:13 -05:00
|
|
|
exit 1
|
2009-02-08 07:34:26 -05:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2009-02-13 12:21:51 -05:00
|
|
|
if test x$system = xMandrivaLinux ; then
|
|
|
|
reqd=""
|
2009-02-24 13:05:13 -05:00
|
|
|
for pkg in \
|
|
|
|
curl \
|
|
|
|
bison flex gnome-common gnome-doc-utils gtk-doc intltool \
|
2010-07-05 20:27:26 -04:00
|
|
|
ffi5-devel \
|
2009-02-24 13:05:13 -05:00
|
|
|
libwnck-1-devel GL-devel readline-devel libxulrunner-devel \
|
2009-11-12 15:17:35 -05:00
|
|
|
libxdamage-devel mesa-demos x11-server-xephyr zenity \
|
2009-10-01 15:57:53 -04:00
|
|
|
libcroco0.6-devel \
|
2009-02-24 13:05:13 -05:00
|
|
|
; do
|
2009-02-13 12:21:51 -05: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 12:53:54 -05:00
|
|
|
gurpmi --auto $reqd
|
2009-02-13 12:21:51 -05:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2009-02-24 13:05:13 -05:00
|
|
|
SOURCE=$HOME/Source
|
2009-12-20 11:28:59 -05:00
|
|
|
BASEURL=http://git.gnome.org/browse/gnome-shell/plain/tools/build
|
2009-02-24 13:05:13 -05:00
|
|
|
|
|
|
|
if [ -d $SOURCE ] ; then : ; else
|
|
|
|
mkdir $SOURCE
|
|
|
|
echo "Created $SOURCE"
|
|
|
|
fi
|
|
|
|
|
2009-04-18 14:22:02 -04: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 13:05:13 -05:00
|
|
|
|
|
|
|
echo "Installing jhbuild..."
|
2009-04-24 15:49:11 -04:00
|
|
|
(cd $SOURCE/jhbuild && make -f Makefile.plain DISABLE_GETTEXT=1 bindir=$HOME/bin install >/dev/null)
|
2009-02-24 13:05:13 -05:00
|
|
|
|
|
|
|
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 ... "
|
2010-01-06 13:56:19 -05:00
|
|
|
curl -L -s -o $HOME/.jhbuildrc $BASEURL/jhbuildrc-gnome-shell
|
2009-02-24 13:05:13 -05:00
|
|
|
echo "done"
|
|
|
|
|
|
|
|
if [ ! -f $HOME/.jhbuildrc-custom ]; then
|
|
|
|
echo -n "Writing example ~/.jhbuildrc-custom ... "
|
2010-01-06 13:56:19 -05:00
|
|
|
curl -L -s -o $HOME/.jhbuildrc-custom $BASEURL/jhbuildrc-custom-example
|
2009-02-24 13:05:13 -05:00
|
|
|
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 01:25:28 -04:00
|
|
|
echo "Done."
|
|
|
|
|