[cheese] check if vala is available, fail if not, partially fixes #626697
- From: Daniel G. Siegel <dgsiegel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese] check if vala is available, fail if not, partially fixes #626697
- Date: Thu, 12 Aug 2010 09:27:55 +0000 (UTC)
commit 9b32599f79b527730d52802fde9e11ecdc8aa038
Author: daniel g. siegel <dgsiegel gnome org>
Date: Thu Aug 12 11:26:14 2010 +0200
check if vala is available, fail if not, partially fixes #626697
autogen.sh | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/autogen.sh b/autogen.sh
index 8baf22a..f160d03 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -5,6 +5,7 @@ srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
PKG_NAME="cheese"
+REQUIRED_VALA_VERSION=0.9.2
(test -f $srcdir/src/cheese-main.vala) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
@@ -17,6 +18,41 @@ which gnome-autogen.sh || {
exit 1
}
+# Usage:
+# compare_versions MIN_VERSION ACTUAL_VERSION
+# returns true if ACTUAL_VERSION >= MIN_VERSION
+compare_versions() {
+ ch_min_version=$1
+ ch_actual_version=$2
+ ch_status=0
+ IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="."
+ set $ch_actual_version
+ for ch_min in $ch_min_version; do
+ ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
+ if [ -z "$ch_min" ]; then break; fi
+ if [ -z "$ch_cur" ]; then ch_status=1; break; fi
+ if [ $ch_cur -gt $ch_min ]; then break; fi
+ if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
+ done
+ IFS="$ch_save_IFS"
+ return $ch_status
+}
+
+which valac || {
+ echo "**Error**: You must have valac >= $REQUIRED_VALA_VERSION installed to build $PKG_NAME"
+ exit 1
+}
+
+# Vala version check
+test -z "$VALAC" && VALAC=valac
+VALA_VERSION=`$VALAC --version | cut -d" " -f2`
+echo $VALA_VERSION
+
+if ! compare_versions $REQUIRED_VALA_VERSION $VALA_VERSION; then
+ echo "**Error**: You must have valac >= $REQUIRED_VALA_VERSION installed to build $PKG_NAME, you have $VALA_VERSION"
+ exit 1
+fi
+
gtkdocize || exit 1
REQUIRED_AUTOCONF_VERSION=2.57
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]