[pitivi: 4/94] build: Check both the Gtk+ version and PyGtk



commit ef49fb191e1187bbbd24a6aad685de1745066ce2
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Mon Aug 22 20:02:20 2011 -0300

    build: Check both the Gtk+ version and PyGtk
    
    We used to check only PyGtk, but sometimes, the 2 versions are different
    Checking the 2 versions let us depend on exactly what we need.

 configure.ac           |    3 ++-
 pitivi/check.py        |   13 ++++++++++---
 pitivi/configure.py.in |    1 +
 3 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1275fe3..b5516ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,8 @@ dnl
 dnl For a more exhaustive list of checks, you can have a look at
 dnl the runtime checks in pitivi/check.py
 
-AC_SUBST(PYGTK_REQ, 2.24.0)
+AC_SUBST(GTK_REQ, 2.24.0)
+AC_SUBST(PYGTK_REQ, 2.17.0)
 AC_SUBST(PYGST_REQ, 0.10.19)
 AC_SUBST(GST_REQ, 0.10.28)
 AC_SUBST(GNONLIN_REQ, 0.10.16)
diff --git a/pitivi/check.py b/pitivi/check.py
index 6adb51d..dde62a6 100644
--- a/pitivi/check.py
+++ b/pitivi/check.py
@@ -29,7 +29,7 @@ import gst
 from gettext import gettext as _
 
 from pitivi.instance import PiTiVi
-from pitivi.configure import APPNAME, PYGTK_REQ, PYGST_REQ, GST_REQ, GNONLIN_REQ, PYCAIRO_REQ
+from pitivi.configure import APPNAME, PYGTK_REQ, GTK_REQ, PYGST_REQ, GST_REQ, GNONLIN_REQ, PYCAIRO_REQ
 
 global soft_deps
 soft_deps = {}
@@ -86,9 +86,12 @@ def check_required_version(modulename):
     containing the strings of the required version and the installed version.
     This function does not check for the existence of the given module !
     """
-    if modulename == "gtk":
+    if modulename == "pygtk":
         if list(gtk.pygtk_version) < _string_to_list(PYGTK_REQ):
             return [PYGTK_REQ, _version_to_string(gtk.pygtk_version)]
+    if modulename == "gtk":
+        if list(gtk.gtk_version) < _string_to_list(GTK_REQ):
+            return [GTK_REQ, _version_to_string(gtk.gtk_version)]
     if modulename == "pygst":
         if list(gst.get_pygst_version()) < _string_to_list(PYGST_REQ):
             return [PYGST_REQ, _version_to_string(gst.get_pygst_version())]
@@ -135,10 +138,14 @@ def initial_checks():
     if not __try_import__("xdg"):
         return (_("Could not import the xdg Python library"),
                 _("Make sure you have the xdg Python library installed."))
-    req, inst = check_required_version("gtk")
+    req, inst = check_required_version("pygtk")
     if req:
         return (_("You do not have a recent enough version of the GTK+ Python bindings (your version %s)") % inst,
                 _("Install a version of the GTK+ Python bindings greater than or equal to %s.") % req)
+    req, inst = check_required_version("gtk")
+    if req:
+        return (_("You do not have a recent enough version of GTK+ (your version %s)") % inst,
+                _("Install a version of GTK+ greater than or equal to %s.") % req)
     req, inst = check_required_version("pygst")
     if req:
         return (_("You do not have a recent enough version of GStreamer Python bindings (your version %s)") % inst,
diff --git a/pitivi/configure.py.in b/pitivi/configure.py.in
index 016504f..b70252f 100644
--- a/pitivi/configure.py.in
+++ b/pitivi/configure.py.in
@@ -40,6 +40,7 @@ pitivi_version = '@VERSION@'
 APPNAME = '@PACKAGE_NAME@'
 APPURL = 'http://www.pitivi.org/'
 PYGTK_REQ = '@PYGTK_REQ@'
+GTK_REQ = '@GTK_REQ@'
 PYGST_REQ = '@PYGST_REQ@'
 GST_REQ = '@GST_REQ@'
 GNONLIN_REQ = '@GNONLIN_REQ@'



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]