From d0fd5641c1fb189cc104ead3f498d5828c47ad1f Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Wed, 8 Feb 2012 15:50:02 -0500 Subject: [PATCH] gnome-shell-build-setup.sh: redo installing dependencies * Consolidate all dependency information into one place, rather than having a comment and per-distribution lists. * Remove packages that are in the GNOME moduleset; jhbuild sysdeps --install will install these when possible. * Install 'apt-file' and run 'apt-file update' on Debian-based distributions. * Actually run sudo rather than prompting the user to run it and exiting; the exit-and-restart approach doesn't work for 'apt-file update'. * Run 'jhbuild sysdeps --install' https://bugzilla.gnome.org/show_bug.cgi?id=668440 --- tools/build/gnome-shell-build-setup.sh | 272 ++++++++++++++----------- 1 file changed, 156 insertions(+), 116 deletions(-) diff --git a/tools/build/gnome-shell-build-setup.sh b/tools/build/gnome-shell-build-setup.sh index ad1d32680..56e561a68 100755 --- a/tools/build/gnome-shell-build-setup.sh +++ b/tools/build/gnome-shell-build-setup.sh @@ -1,7 +1,7 @@ #!/bin/sh # # Script that sets up jhbuild to build gnome-shell. Run this to -# checkout jhbuild and the required configuration. +# checkout jhbuild and the required configuration. # # Copyright (C) 2008, Red Hat, Inc. # @@ -10,23 +10,6 @@ # Copyright (C) 2006, 2007, 2008 Imendio AB # -# 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 - -############################################################ - release_file= if which lsb_release > /dev/null 2>&1; then @@ -47,54 +30,129 @@ if [ x$release_file != x ] ; then version=`sed 's/[^0-9\.]*\([0-9\.]\+\).*/\1/' < $release_file` fi -# Required software: +# This is the configuration of packages that we'll need to successfully jhbuild. +# Each line is of the form: # +# name_of_depenency: :package [:package...] +# +# The dependency name is purely informative and isn't otherwise used. distro_chars are: +# +# f: Fedora +# d: Debian/Ubuntu +# s: SuSE +# m: Mandriva +# +# Rather than have some complicated system here, when we have packages that depend +# on distribution version, we just tweak the package list in the code below. +# Where known, the module that requires a library is commented. + +all_packages() { +cat <:package + IFS=: + set $word + IFS=' ' + case $1 in + *$distribution_char*) echo $2 + esac + done + done +} + +# We try to make it clear what we're doing via sudo so if a user gets prompted +# for their password, they have some idea why. +run_via_sudo() { + echo "Running: sudo $@" + if sudo "$@" ; then : ; else + echo 1>&2 "Command failed." + echo 1>&2 "Exiting gnome-shell-build-setup.sh. You can run it again safely." + exit 1 + fi +} if test "x$system" = xUbuntu -o "x$system" = xDebian -o "x$system" = xLinuxMint ; then - reqd=" - build-essential curl - automake bison flex gettext git-core gperf gnome-common gtk-doc-tools - gvfs gvfs-backends icon-naming-utils - libdbus-glib-1-dev libexpat-dev libffi-dev libgnome-menu-dev libgnome-desktop-dev libgtop2-dev - libical-dev libjasper-dev libjpeg-dev libpng-dev libstartup-notification0-dev libtiff-dev - 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 - libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good - libltdl-dev libvorbis-dev iso-codes libgnome-keyring-dev libusb-1.0-0-dev - libupower-glib-dev libcups2-dev libproxy-dev libdb-dev libproxy-dev - libsqlite3-dev libgudev-1.0-dev libsane-dev libwebkitgtk-3.0-dev - libx11-xcb-dev libupower-glib-dev accountsservice - gnome-doc-utils liblcms2-dev libxtst-dev liboauth-dev - libnm-glib-dev libnm-util-dev - " - - 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 + reqd=`packages_for_distribution d` if apt-cache show libxcb-util0-dev > /dev/null 2> /dev/null; then reqd="$reqd libxcb-util0-dev" @@ -106,10 +164,27 @@ if test "x$system" = xUbuntu -o "x$system" = xDebian -o "x$system" = xLinuxMint reqd="$reqd autopoint" fi - if [ ! -x /usr/bin/dpkg-checkbuilddeps ]; then - echo "Please run 'sudo apt-get install dpkg-dev' and try again." - echo - exit 1 + if [ ! -x /usr/bin/dpkg-checkbuilddeps -o ! -x /usr/bin/apt-file ]; then + echo "Installing base dependencies" + run_via_sudo apt-get install dpkg-dev apt-file + fi + + echo "Updating apt-file cache" + run_via_sudo apt-file update + + # libcurl comes in both gnutls and openssl flavors. If the openssl + # flavor of the runtime is installed, install the matching -dev + # package, but default to the gnutls version. (the libcurl3 vs. libcurl4 + # mismatch is intentional and is how things are packaged.) + + if ! dpkg-checkbuilddeps -d libcurl-dev /dev/null 2> /dev/null; then + if dpkg -s libcurl3 /dev/null 2> /dev/null; then + missing="libcurl4-openssl-dev $missing" + elif dpkg -s libcurl3-nss /dev/null 2> /dev/null; then + missing="libcurl4-nss-dev $missing" + else + missing="libcurl4-gnutls-dev $missing" + fi fi for pkg in $reqd ; do @@ -118,28 +193,13 @@ if test "x$system" = xUbuntu -o "x$system" = xDebian -o "x$system" = xLinuxMint fi done if test ! "x$missing" = x; then - echo "Please run 'sudo apt-get install $missing' and try again." - echo - exit 1 + echo "Installing packages" + run_via_sudo apt-get install $missing fi fi if test "x$system" = xFedora ; then - reqd=" - binutils curl gcc gcc-c++ make accountsservice - automake bison flex gettext git gnome-common gnome-doc-utils gperf gvfs intltool - libtool pkgconfig dbus-glib-devel gnome-desktop-devel gnome-menus-devel - gnome-python2-gconf jasper-devel libffi-devel libical-devel libjpeg-devel libpng-devel - 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 - gstreamer-plugins-base gstreamer-plugins-good glx-utils expat-devel - startup-notification-devel zenity webkitgtk3-devel upower-devel - icon-naming-utils upower-devel libtool-ltdl-devel libvorbis-devel - iso-codes-devel libgcrypt-devel libtasn1-devel libtasn1-tools libusb1-devel - libgnome-keyring-devel libgtop2-devel cups-devel db4-devel libproxy-devel - sqlite-devel libgudev1-devel lcms2-devel sane-backends-devel xcb-util-devel - " + reqd=`packages_for_distribution f` if expr $version = 14 > /dev/null ; then reqd="$reqd gettext-autopoint" @@ -147,32 +207,23 @@ if test "x$system" = xFedora ; then reqd="$reqd gettext-devel" fi + echo -n "Computing packages to install ... " for pkg in $reqd ; do - if ! rpm -q $pkg > /dev/null 2>&1; then + if ! rpm -q --whatprovides $pkg > /dev/null 2>&1; then missing="$pkg $missing" fi done + echo "done" + if test ! "x$missing" = x; then - gpk-install-package-name $missing + echo -n "Installing packages ... " + gpk-install-package-name $missing + echo "done" fi fi if test "x$system" = xSUSE -o "x$system" = "xSUSE LINUX" ; then - reqd="" - for pkg in \ - curl \ - bison flex gtk-doc gnome-common gnome-doc-utils-devel \ - gnome-desktop-devel gnome-menus-devel icon-naming-utils \ - libgtop-devel libpulse-devel libtiff-devel cups-devel libffi-devel \ - orbit2-devel libwnck-devel xorg-x11-proto-devel readline-devel \ - mozilla-xulrunner191-devel libcroco-devel \ - xorg-x11-devel xorg-x11 xorg-x11-server-extra evolution-data-server-devel \ - iso-codes-devel \ - ; do - if ! rpm -q $pkg > /dev/null 2>&1; then - reqd="$pkg $reqd" - fi - done + reqd=`packages_for_distribution s` if test ! "x$reqd" = x; then echo "Please run 'su --command=\"zypper install $reqd\"' and try again." echo @@ -181,20 +232,7 @@ if test "x$system" = xSUSE -o "x$system" = "xSUSE LINUX" ; then fi if test "x$system" = xMandrivaLinux ; then - reqd="" - for pkg in \ - curl \ - bison flex gnome-common gnome-doc-utils gtk-doc icon-naming-utils \ - intltool ffi5-devel libwnck-1-devel GL-devel ORBit2-devel \ - readline-devel libxulrunner-devel \ - libxdamage-devel mesa-demos zenity \ - libcroco0.6-devel libevolution-data-server3-devel \ - iso-codes-devel \ - ; do - if ! rpm -q --whatprovides $pkg > /dev/null 2>&1; then - reqd="$pkg $reqd" - fi - done + reqd=`packages_for_distribution m` if test ! "x$reqd" = x; then gurpmi --auto $reqd fi @@ -245,10 +283,12 @@ if [ ! -f $HOME/.jhbuildrc-custom ]; then echo "done" fi +echo "Installing modules as system packages when possible" +$HOME/bin/jhbuild sysdeps --install + 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 echo "Done." -