[build] Use dpkg-checkbuilddeps to check for installed packages

This is required to handle Provides header, as used by lib*-dev packages
(for example libtiff5-dev provides libtiff-dev), this allows the build
setup script to specify the "generic" package names.

https://bugzilla.gnome.org/show_bug.cgi?id=624009
This commit is contained in:
Frédéric Péters 2010-07-11 20:40:23 +02:00
parent d8df46d4a1
commit 6259513b0f

View File

@ -69,22 +69,13 @@ fi
# #
# (*) only needed for --xephyr # (*) only needed for --xephyr
# 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
}
if test x$system = xUbuntu -o x$system = xDebian -o x$system = xLinuxMint ; then if test x$system = xUbuntu -o x$system = xDebian -o x$system = xLinuxMint ; then
reqd="" reqd=""
if [ ! -x /usr/bin/dpkg-checkbuilddeps ]; then
echo "Please run 'sudo apt-get install dpkg-dev' and try again."
echo
exit 1
fi
for pkg in \ for pkg in \
build-essential curl \ build-essential curl \
automake bison flex gettext git-core gnome-common gtk-doc-tools gvfs gvfs-backends \ automake bison flex gettext git-core gnome-common gtk-doc-tools gvfs gvfs-backends \
@ -94,7 +85,7 @@ if test x$system = xUbuntu -o x$system = xDebian -o x$system = xLinuxMint ; then
python-dev python-gconf python-gobject xulrunner-dev xserver-xephyr gnome-terminal \ 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 \ libcroco3-dev libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good \
; do ; do
if ! dpkg_is_installed $pkg; then if ! dpkg-checkbuilddeps -d $pkg /dev/null 2> /dev/null; then
reqd="$pkg $reqd" reqd="$pkg $reqd"
fi fi
done done