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
|
|
|
|
|
|
|
|
############################################################
|
|
|
|
|
2010-07-12 11:31:18 -04:00
|
|
|
release_file=
|
|
|
|
|
2009-01-27 11:55:39 -05:00
|
|
|
if which lsb_release > /dev/null 2>&1; then
|
|
|
|
system=`lsb_release -is`
|
2010-07-12 11:31:18 -04:00
|
|
|
version=`lsb_release -rs`
|
2009-01-27 11:55:39 -05:00
|
|
|
elif [ -f /etc/fedora-release ] ; then
|
|
|
|
system=Fedora
|
2010-07-12 11:31:18 -04:00
|
|
|
release_file=/etc/fedora-release
|
2009-02-08 07:34:26 -05:00
|
|
|
elif [ -f /etc/SuSE-release ] ; then
|
2009-02-24 13:05:13 -05:00
|
|
|
system=SUSE
|
2010-07-12 11:31:18 -04:00
|
|
|
release_file=/etc/SuSE-release
|
2009-02-13 12:21:51 -05:00
|
|
|
elif [ -f /etc/mandriva-release ]; then
|
|
|
|
system=MandrivaLinux
|
2010-07-12 11:31:18 -04:00
|
|
|
release_file=/etc/mandriva-release
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ x$release_file != x ] ; then
|
|
|
|
version=`sed 's/[^0-9\.]*\([0-9\.]\+\).*/\1/' < $release_file`
|
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:
|
2011-03-06 22:28:00 -05:00
|
|
|
# automake, bison, flex, gettext, gnome-common, gperf, gtk-doc, intltool,
|
2011-03-31 08:23:42 -04:00
|
|
|
# libtool, pkgconfig
|
2009-02-24 13:05:13 -05:00
|
|
|
#
|
|
|
|
# Devel packages needed by gnome-shell and its deps:
|
2010-11-14 18:54:49 -05:00
|
|
|
# dbus-glib, expat, GL, gnome-menus, gstreamer, libffi,
|
2010-10-19 15:16:22 -04:00
|
|
|
# libjasper, libjpeg, libpng, libpulse, libtiff, libwnck,
|
2011-07-09 11:16:18 -04:00
|
|
|
# iso-codes, libical, libxml2, ORBit2, pam, python, readline, upower,
|
2010-11-17 09:44:46 -05:00
|
|
|
# spidermonkey ({mozilla,firefox,xulrunner}-js), startup-notification,
|
|
|
|
# xdamage, icon-naming-utils, upower, libtool-ltdl, libvorbis,
|
2011-10-25 02:27:55 -04:00
|
|
|
# libgcrypt, libtasn1, libgnome-keyring, libgtop, cups, xcb, libwebkitgtk,
|
|
|
|
# libusb, libproxy, libdb, libproxy, sqlite, gudev, liblcms2, sane,
|
|
|
|
# python-gobject, libxtst, liboauth, libnm
|
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,
|
2011-10-25 02:27:55 -04:00
|
|
|
# gvfs, python, gnome-python (gconf),
|
2011-05-10 10:13:05 -04:00
|
|
|
# icon-naming-utils, zenity, libtasn1-tools accountsservice
|
2009-02-24 13:05:13 -05:00
|
|
|
|
2010-08-17 11:44:09 -04:00
|
|
|
if test "x$system" = xUbuntu -o "x$system" = xDebian -o "x$system" = xLinuxMint ; then
|
2010-11-15 08:17:08 -05:00
|
|
|
reqd="
|
|
|
|
build-essential curl
|
2011-03-31 08:23:42 -04:00
|
|
|
automake bison flex gettext git-core gperf gnome-common gtk-doc-tools
|
2010-11-15 08:17:08 -05:00
|
|
|
gvfs gvfs-backends icon-naming-utils
|
2011-01-11 18:10:08 -05:00
|
|
|
libdbus-glib-1-dev libexpat-dev libffi-dev libgnome-menu-dev libgnome-desktop-dev libgtop2-dev
|
2011-03-06 22:28:00 -05:00
|
|
|
libical-dev libjasper-dev libjpeg-dev libpng-dev libstartup-notification0-dev libtiff-dev
|
2011-10-25 02:27:55 -04:00
|
|
|
libwnck-dev libgl1-mesa-dev liborbit2-dev libpulse-dev libreadline-dev libxml2-dev
|
|
|
|
mesa-common-dev mesa-utils libpam-dev python-dev python-gconf python-gobject-dev
|
|
|
|
libcroco3-dev
|
2010-11-15 08:17:08 -05:00
|
|
|
libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good
|
2011-02-23 16:56:51 -05:00
|
|
|
libltdl-dev libvorbis-dev iso-codes libgnome-keyring-dev libusb-1.0-0-dev
|
2011-03-03 16:21:53 -05:00
|
|
|
libupower-glib-dev libcups2-dev libproxy-dev libdb-dev libproxy-dev
|
2011-10-25 02:27:55 -04:00
|
|
|
libsqlite3-dev libgudev-1.0-dev libsane-dev libwebkitgtk-3.0-dev
|
2011-05-10 10:13:05 -04:00
|
|
|
libx11-xcb-dev libupower-glib-dev accountsservice
|
2011-10-25 02:27:55 -04:00
|
|
|
gnome-doc-utils liblcms2-dev libxtst-dev liboauth-dev
|
|
|
|
libnm-glib-dev libnm-util-dev
|
2010-11-15 08:17:08 -05:00
|
|
|
"
|
|
|
|
|
2011-10-25 02:27:55 -04:00
|
|
|
if apt-cache show libmozjs-dev > /dev/null 2> /dev/null; then
|
|
|
|
reqd="$reqd libmozjs-dev"
|
|
|
|
elif apt-cache show xulrunner-dev > /dev/null 2> /dev/null; then
|
|
|
|
reqd="$reqd xulrunner-dev"
|
|
|
|
fi
|
|
|
|
|
2011-07-06 19:01:41 -04:00
|
|
|
if apt-cache show libxcb-util0-dev > /dev/null 2> /dev/null; then
|
|
|
|
reqd="$reqd libxcb-util0-dev"
|
|
|
|
else
|
|
|
|
reqd="$reqd libxcb-event1-dev libxcb-aux0-dev"
|
|
|
|
fi
|
|
|
|
|
2010-11-15 08:17:08 -05:00
|
|
|
if apt-cache show autopoint > /dev/null 2> /dev/null; then
|
|
|
|
reqd="$reqd autopoint"
|
|
|
|
fi
|
|
|
|
|
2010-07-11 14:40:23 -04:00
|
|
|
if [ ! -x /usr/bin/dpkg-checkbuilddeps ]; then
|
|
|
|
echo "Please run 'sudo apt-get install dpkg-dev' and try again."
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
2010-11-15 08:17:08 -05:00
|
|
|
|
|
|
|
for pkg in $reqd ; do
|
2010-07-11 14:40:23 -04:00
|
|
|
if ! dpkg-checkbuilddeps -d $pkg /dev/null 2> /dev/null; then
|
2010-11-15 08:17:08 -05:00
|
|
|
missing="$pkg $missing"
|
2008-11-28 15:35:32 -05:00
|
|
|
fi
|
|
|
|
done
|
2010-11-15 08:17:08 -05:00
|
|
|
if test ! "x$missing" = x; then
|
|
|
|
echo "Please run 'sudo apt-get install $missing' 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
|
|
|
|
|
2010-08-17 11:44:09 -04:00
|
|
|
if test "x$system" = xFedora ; then
|
2010-07-12 11:31:18 -04:00
|
|
|
reqd="
|
2011-05-10 10:13:05 -04:00
|
|
|
binutils curl gcc gcc-c++ make accountsservice
|
2011-03-06 22:28:00 -05:00
|
|
|
automake bison flex gettext git gnome-common gnome-doc-utils gperf gvfs intltool
|
2010-07-12 11:31:18 -04:00
|
|
|
libtool pkgconfig dbus-glib-devel gnome-desktop-devel gnome-menus-devel
|
2011-03-06 22:28:00 -05:00
|
|
|
gnome-python2-gconf jasper-devel libffi-devel libical-devel libjpeg-devel libpng-devel
|
2010-11-12 15:28:07 -05:00
|
|
|
libtiff-devel libwnck-devel mesa-libGL-devel ORBit2-devel pam-devel
|
|
|
|
pulseaudio-libs-devel python-devel pygobject2 readline-devel xulrunner-devel
|
|
|
|
libXdamage-devel libcroco-devel libxml2-devel gstreamer-devel
|
2010-11-14 18:54:49 -05:00
|
|
|
gstreamer-plugins-base gstreamer-plugins-good glx-utils expat-devel
|
2011-07-09 11:16:18 -04:00
|
|
|
startup-notification-devel zenity webkitgtk3-devel upower-devel
|
2010-11-15 16:45:17 -05:00
|
|
|
icon-naming-utils upower-devel libtool-ltdl-devel libvorbis-devel
|
2011-02-22 19:56:14 -05:00
|
|
|
iso-codes-devel libgcrypt-devel libtasn1-devel libtasn1-tools libusb1-devel
|
2011-03-02 00:17:33 -05:00
|
|
|
libgnome-keyring-devel libgtop2-devel cups-devel db4-devel libproxy-devel
|
2011-05-24 19:04:24 -04:00
|
|
|
sqlite-devel libgudev1-devel lcms2-devel sane-backends-devel xcb-util-devel
|
2010-07-12 11:31:18 -04:00
|
|
|
"
|
|
|
|
|
2011-05-23 09:08:30 -04:00
|
|
|
if expr $version = 14 > /dev/null ; then
|
2010-07-12 11:31:18 -04:00
|
|
|
reqd="$reqd gettext-autopoint"
|
2011-05-23 09:08:30 -04:00
|
|
|
elif expr $version \>= 15 > /dev/null ; then
|
|
|
|
reqd="$reqd gettext-devel"
|
2010-07-12 11:31:18 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
for pkg in $reqd ; do
|
2009-01-27 11:55:39 -05:00
|
|
|
if ! rpm -q $pkg > /dev/null 2>&1; then
|
2010-07-12 11:31:18 -04:00
|
|
|
missing="$pkg $missing"
|
2009-01-27 11:55:39 -05:00
|
|
|
fi
|
|
|
|
done
|
2010-07-12 11:31:18 -04:00
|
|
|
if test ! "x$missing" = x; then
|
|
|
|
gpk-install-package-name $missing
|
2009-01-27 11:55:39 -05:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2010-08-17 11:44:09 -04:00
|
|
|
if test "x$system" = xSUSE -o "x$system" = "xSUSE LINUX" ; then
|
2009-02-08 07:34:26 -05:00
|
|
|
reqd=""
|
2009-02-24 13:05:13 -05:00
|
|
|
for pkg in \
|
|
|
|
curl \
|
2010-10-03 08:48:43 -04:00
|
|
|
bison flex gtk-doc gnome-common gnome-doc-utils-devel \
|
|
|
|
gnome-desktop-devel gnome-menus-devel icon-naming-utils \
|
2011-01-11 18:10:08 -05:00
|
|
|
libgtop-devel libpulse-devel libtiff-devel cups-devel libffi-devel \
|
2010-10-03 08:48:43 -04:00
|
|
|
orbit2-devel libwnck-devel xorg-x11-proto-devel readline-devel \
|
2010-09-16 18:44:31 -04:00
|
|
|
mozilla-xulrunner191-devel libcroco-devel \
|
2011-01-28 16:35:46 -05:00
|
|
|
xorg-x11-devel xorg-x11 xorg-x11-server-extra evolution-data-server-devel \
|
2011-03-31 08:23:42 -04:00
|
|
|
iso-codes-devel \
|
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
|
|
|
|
|
2010-08-17 11:44:09 -04:00
|
|
|
if test "x$system" = xMandrivaLinux ; then
|
2009-02-13 12:21:51 -05:00
|
|
|
reqd=""
|
2009-02-24 13:05:13 -05:00
|
|
|
for pkg in \
|
|
|
|
curl \
|
2010-10-03 08:48:43 -04:00
|
|
|
bison flex gnome-common gnome-doc-utils gtk-doc icon-naming-utils \
|
|
|
|
intltool ffi5-devel libwnck-1-devel GL-devel ORBit2-devel \
|
2010-09-16 18:44:31 -04:00
|
|
|
readline-devel libxulrunner-devel \
|
2011-02-28 09:16:45 -05:00
|
|
|
libxdamage-devel mesa-demos zenity \
|
2011-01-28 16:35:46 -05:00
|
|
|
libcroco0.6-devel libevolution-data-server3-devel \
|
2011-03-31 08:23:42 -04:00
|
|
|
iso-codes-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."
|
|
|
|
|