[nautilus-python/nautilus-3.0] Regain pygobject 2.28.x compatibility
- From: Adam Plumb <adamplumb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-python/nautilus-3.0] Regain pygobject 2.28.x compatibility
- Date: Mon, 17 Oct 2011 14:55:28 +0000 (UTC)
commit 2db566bd33375bd7611f1978ebfab7ac77a3fec0
Author: Adam Plumb <adamplumb gmail com>
Date: Mon Oct 17 10:55:19 2011 -0400
Regain pygobject 2.28.x compatibility
configure.in | 26 +++++++++++++++++++++-----
src/nautilus-python.c | 2 +-
2 files changed, 22 insertions(+), 6 deletions(-)
---
diff --git a/configure.in b/configure.in
index 6792ea6..2538ada 100644
--- a/configure.in
+++ b/configure.in
@@ -14,7 +14,6 @@ AC_CONFIG_MACRO_DIR([m4])
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I .")
NAUTILUS_REQUIRED=2.32
-PYGOBJECT_REQUIRED=3.0
AC_PROG_CC
AC_DISABLE_STATIC
@@ -40,17 +39,33 @@ dnl **************************************************
AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
AM_CHECK_PYTHON_LIBS(,[AC_MSG_ERROR(could not find Python lib)])
+if test "`pkg-config --variable=datadir pygobject-3.0`" != "" ; then
+ PYGOBJECT_VERSION=pygobject-3.0
+ PYGOBJECT_MAJOR_VERSION=3
+ PYGOBJECT_MINOR_VERSION=0
+ PYGOBJECT_MICRO_VERSION=0
+else
+ PYGOBJECT_VERSION=pygobject-2.0
+ PYGOBJECT_MAJOR_VERSION=2
+ PYGOBJECT_MINOR_VERSION=28
+ PYGOBJECT_MICRO_VERSION=2
+fi
+
+PYGOBJECT_REQUIRED=$PYGOBJECT_MAJOR_VERSION.$PYGOBJECT_MINOR_VERSION.$PYGOBJECT_MICRO_VERSION
+AC_DEFINE_UNQUOTED(PYGOBJECT_MAJOR_VERSION,[$PYGOBJECT_MAJOR_VERSION], [PyGObject major version.])
+AC_DEFINE_UNQUOTED(PYGOBJECT_MINOR_VERSION,[$PYGOBJECT_MINOR_VERSION], [PyGObject minor version.])
+AC_DEFINE_UNQUOTED(PYGOBJECT_MICRO_VERSION,[$PYGOBJECT_MICRO_VERSION], [PyGObject micro version.])
-PKG_CHECK_MODULES(NAUTILUS_PYTHON, [pygobject-3.0 >= $PYGOBJECT_REQUIRED
+PKG_CHECK_MODULES(NAUTILUS_PYTHON, [$PYGOBJECT_VERSION >= $PYGOBJECT_REQUIRED
libnautilus-extension >= $NAUTILUS_REQUIRED])
-PYGOBJECT_DATADIR=`$PKG_CONFIG --variable=datadir pygobject-3.0`
+PYGOBJECT_DATADIR=`$PKG_CONFIG --variable=datadir $PYGOBJECT_VERSION`
AC_SUBST(PYGOBJECT_DATADIR)
-PYGOBJECT_PYGDOCS="`$PKG_CONFIG --variable=pygdocs pygobject-3.0`"
+PYGOBJECT_PYGDOCS="`$PKG_CONFIG --variable=pygdocs $PYGOBJECT_VERSION`"
AC_SUBST(PYGOBJECT_PYGDOCS)
-PYGOBJECT_FIXXREF="$PYTHON `$PKG_CONFIG --variable=fixxref pygobject-3.0`"
+PYGOBJECT_FIXXREF="$PYTHON `$PKG_CONFIG --variable=fixxref $PYGOBJECT_VERSION`"
AC_SUBST(PYGOBJECT_FIXXREF)
NAUTILUS_LIBDIR=`$PKG_CONFIG --variable=libdir libnautilus-extension`
@@ -89,5 +104,6 @@ echo
echo " nautilus-python $VERSION"
echo
echo " Nautilus Prefix: ${prefix}"
+echo " PyGObject Version: ${PYGOBJECT_VERSION}"
echo " Documentation: ${enable_gtk_doc}"
echo
diff --git a/src/nautilus-python.c b/src/nautilus-python.c
index a4e1013..ae26660 100644
--- a/src/nautilus-python.c
+++ b/src/nautilus-python.c
@@ -45,7 +45,7 @@ static GArray *all_types = NULL;
static inline gboolean
np_init_pygobject(void)
{
- PyObject *gobject = pygobject_init (3, 0, 0);
+ PyObject *gobject = pygobject_init (PYGOBJECT_MAJOR_VERSION, PYGOBJECT_MINOR_VERSION, PYGOBJECT_MICRO_VERSION);
if (gobject == NULL) {
PyErr_Print ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]