[farsight2/master] Remove dep on pygtk if pygobject 2.16 is present

Olivier Crête olivier.crete at collabora.co.uk
Wed Apr 8 15:11:52 PDT 2009


---
 README                 |    8 +++++---
 configure.ac           |   11 ++++++++---
 python/Makefile.am     |    5 +++--
 python/rebuild-defs.sh |    7 ++++---
 4 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/README b/README
index d7b1de6..2db75a8 100644
--- a/README
+++ b/README
@@ -24,16 +24,18 @@ Build time:
 For UPnP support:
  - GUPnP-IGD
 
+For the python module:
+ - PyGObject 2.12
+ - gst-python 0.10.10
+ - PyGObject 2.16 or PyGTK 2.10 
 
 Run time for the RTP plugin:
  All of the build time requirements (except gtk-doc) plus
  - gst-plugins-good 0.10.7
  - gst-plugins-bad 0.10.11
 
-For the python module and examples you also need:
- - PyGObject 2.12
+For the GUI example:
  - PyGTK 2.10
- - gst-python 0.10.10
 
 The tests require gst-check (which requires check)
 Building the documentation requires gtk-doc 1.8
diff --git a/configure.ac b/configure.ac
index c7bbcc3..eac4d10 100644
--- a/configure.ac
+++ b/configure.ac
@@ -334,10 +334,15 @@ AC_ARG_ENABLE([python],
 	WANT_PYTHON=yes)
 if test "x$WANT_PYTHON" = "xyes"; then
    AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
-   PKG_CHECK_MODULES(PYFARSIGHT, [ 	pygobject-2.0 >= 2.12.0
-					gst-python-0.10 >= 0.10.10
-					pygtk-2.0 >= 2.10 ] )
+   PKG_CHECK_MODULES(PYFARSIGHT, [ pygobject-2.0 >= 2.12.0
+				   gst-python-0.10 >= 0.10.10] )
+   PKG_CHECK_MODULES(PYCODEGEN, [ pygobject-2.0 >= 2.16.0 ],
+     PYCODEGEN=pygobject-codegen-2.0,
+     PKG_CHECK_MODULES(PYCODEGEN, [ pygtk-2.0 >= 2.10 ],
+       PYCODEGEN=pygtk-codegen-2.0,
+       AC_MSG_ERROR([You need pygobject 2.16+ or pygtk for the codegen])))
 fi
+AC_SUBST(PYCODEGEN)
 AM_CONDITIONAL(WANT_PYTHON, test "x$WANT_PYTHON" = "xyes")
 
 AC_ARG_ENABLE([gupnp],
diff --git a/python/Makefile.am b/python/Makefile.am
index 66e8854..2fb2a6e 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -1,4 +1,5 @@
-PYDEFS=`pkg-config --variable=defsdir pygtk-2.0`
+PYDEFS=`pkg-config --variable=defsdir pygobject-2.0`
+[ -z "$PYDEFS" && PYDEFS=`pkg-config --variable=defsdir pygtk-2.0`]
 GSTPYDEFS=`pkg-config --variable=defsdir gst-python-0.10`
 
 AM_CPPFLAGS =						\
@@ -31,7 +32,7 @@ farsight_la_LDFLAGS =					\
 	-module -avoid-version
 
 pyfarsight.c: pyfarsight.override pyfarsight.defs
-	pygtk-codegen-2.0					\
+	$(PYCODEGEN)						\
 		--prefix fs					\
 		--register $(PYDEFS)/gdk-types.defs		\
 		--register $(PYDEFS)/gtk-types.defs		\
diff --git a/python/rebuild-defs.sh b/python/rebuild-defs.sh
index c5c9ab2..ed8d7e9 100755
--- a/python/rebuild-defs.sh
+++ b/python/rebuild-defs.sh
@@ -17,10 +17,11 @@ filter=pyfarsight-filter.defs
 
 cat ${filter} > ${output}
 
-H2DEF=
+
+
+H2DEF="$(pkg-config --variable=codegendir pygobject-2.0)/h2def.py"
+[ -z "${H2DEF}" ] && H2DEF="$(pkg-config --variable=codegendir pygtk-2.0)/h2def.py"
 [ -z "${H2DEF}" -a -f /usr/share/pygtk/2.0/codegen/h2def.py ] && H2DEF=/usr/share/pygtk/2.0/codegen/h2def.py
-[ -z "${H2DEF}" -a -f /usr/lib/python2.5/site-packages/gtk-2.0/codegen/h2def.py ] && H2DEF=/usr/lib/python2.5/site-packages/gtk-2.0/codegen/h2def.py
-[ -z "${H2DEF}" -a -f /usr/lib/python2.4/site-packages/gtk-2.0/codegen/h2def.py ] && H2DEF=/usr/lib/python2.4/site-packages/gtk-2.0/codegen/h2def.py
 
 for h in $HEADERS; do
     python ${H2DEF} --defsfilter=${filter} ${srcdir}/$h >> $output
-- 
1.5.6.5



More information about the farsight-commits mailing list