Hello community,

here is the log from the commit of package python-nautilus for openSUSE:Factory
checked in at Sun Oct 2 10:26:49 CEST 2011.



--------
--- openSUSE:Factory/python-nautilus/python-nautilus.changes    2011-09-23 
12:43:01.000000000 +0200
+++ /mounts/work_src_done/STABLE/python-nautilus/python-nautilus.changes        
2011-09-29 09:16:12.000000000 +0200
@@ -1,0 +2,20 @@
+Wed Sep 28 17:53:13 UTC 2011 - [email protected]
+
+- Port to pygobject 3.0:
+  + Add nautilus-python-pygobject-3.0.patch: do the port :-)
+  + Change pkgconfig(pygobject-2.0) BuildRequires to
+    pkgconfig(pygobject-3.0).
+  + Add call to autoreconf, needed for the patch.
+- Use a build_doc macro to decide whether to build the
+  documentation. It controls the following:
+  + Use of gtk-doc BuildRequires.
+  + Use of --disable-gtk-doc or --enable-gtk-doc option passed to
+    configure.
+- Set build_doc macro to 0 as the documentation build currently
+  requires the old pygobject.
+- Add python-nautilus-fix-warnings.patch: fix various warnings in
+  the build.
+- Add python-nautilus-no-extension-on-failure.patch: do not load
+  extensions on initialization failures.
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


New:
----
  python-nautilus-fix-warnings.patch
  python-nautilus-no-extension-on-failure.patch
  python-nautilus-pygobject-3.0.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-nautilus.spec ++++++
--- /var/tmp/diff_new_pack.ADkjXQ/_old  2011-10-02 10:26:44.000000000 +0200
+++ /var/tmp/diff_new_pack.ADkjXQ/_new  2011-10-02 10:26:44.000000000 +0200
@@ -16,6 +16,7 @@
 #
 
 
+%define build_doc 0
 
 Name:           python-nautilus
 %define _name   nautilus-python
@@ -28,10 +29,18 @@
 Source:         %{_name}-%{version}.tar.bz2
 # PATCH-FIX-UPSTREAM python-nautilus-fix-path-in-pc.patch bgo#652032 
[email protected] -- Fix extension dir in pkg-config file
 Patch0:         python-nautilus-fix-path-in-pc.patch
+# PATCH-FIX-UPSTREAM python-nautilus-pygobject-3.0.patch bgo#660348 
[email protected] -- Port to pygobject 3.0
+Patch1:         python-nautilus-pygobject-3.0.patch
+# PATCH-FIX-UPSTREAM python-nautilus-fix-warnings.patch bgo#660348 
[email protected] -- Fix various warnings
+Patch2:         python-nautilus-fix-warnings.patch
+# PATCH-FIX-UPSTREAM python-nautilus-no-extension-on-failure.patch bgo#660348 
[email protected] -- Don't load extensions if we fail to initialize
+Patch3:         python-nautilus-no-extension-on-failure.patch
+%if %{build_doc}
 BuildRequires:  gtk-doc
+%endif
 BuildRequires:  python-devel
 BuildRequires:  pkgconfig(libnautilus-extension)
-BuildRequires:  pkgconfig(pygobject-2.0)
+BuildRequires:  pkgconfig(pygobject-3.0)
 Requires:       python-gobject
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
@@ -55,10 +64,18 @@
 %prep
 %setup -q -n %{_name}-%{version}
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 %build
+autoreconf -fi -I m4
 %configure --disable-static \
+%if %{build_doc}
         --enable-gtk-doc
+%else
+        --disable-gtk-doc
+%endif
 make %{?jobs:-j%jobs}
 
 %install
@@ -82,7 +99,9 @@
 %files devel
 %defattr(-,root,root)
 %{_datadir}/doc/nautilus-python/
+%if %{build_doc}
 %{_datadir}/gtk-doc/html/nautilus-python/
+%endif
 %{_libdir}/pkgconfig/nautilus-python.pc
 
 %changelog

++++++ python-nautilus-fix-warnings.patch ++++++
commit b3bea7320d69ad41422e56ac410627e5983245b1
Author: Vincent Untz <[email protected]>
Date:   Thu Sep 29 09:10:28 2011 +0200

    Fix various warnings
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660348

diff --git a/src/nautilus-python-object.c b/src/nautilus-python-object.c
index 83c9823..1cac543 100644
--- a/src/nautilus-python-object.c
+++ b/src/nautilus-python-object.c
@@ -233,7 +233,6 @@ nautilus_python_object_get_file_items (NautilusMenuProvider 
*provider,
     GList *ret = NULL;
     PyObject *py_ret = NULL, *py_files;
        PyGILState_STATE state = pyg_gil_state_ensure();
-       PyObject *provider_version = NULL;
        
        debug_enter();
 
@@ -333,7 +332,7 @@ nautilus_python_object_get_columns (NautilusColumnProvider 
*provider)
 {
        NautilusPythonObject *object = (NautilusPythonObject*)provider;
     GList *ret = NULL;
-    PyObject *py_ret;
+    PyObject *py_ret = NULL;
        PyGILState_STATE state = pyg_gil_state_ensure();                        
            \
 
        debug_enter();
@@ -349,7 +348,8 @@ nautilus_python_object_get_columns (NautilusColumnProvider 
*provider)
        HANDLE_LIST(py_ret, NautilusColumn, "Nautilus.Column");
        
  beach:
-       Py_XDECREF(py_ret);
+       if (py_ret != NULL)
+               Py_XDECREF(py_ret);
        pyg_gil_state_release(state);
     return ret;
 }
diff --git a/src/nautilus-python.c b/src/nautilus-python.c
index df37277..a860912 100644
--- a/src/nautilus-python.c
+++ b/src/nautilus-python.c
@@ -154,7 +154,7 @@ nautilus_python_load_dir (GTypeModule *module,
 static gboolean
 nautilus_python_init_python (void)
 {
-       PyObject *sys_path, *nautilus;
+       PyObject *nautilus;
        GModule *libpython;
        char *argv[] = { "nautilus", NULL };
 
++++++ python-nautilus-no-extension-on-failure.patch ++++++
commit 599a64c8d27426e9f96a18c8f7c74e8c93a8c3de
Author: Vincent Untz <[email protected]>
Date:   Thu Sep 29 09:10:01 2011 +0200

    Do not try to load python extensions if we failed to initiliaze
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660348

diff --git a/src/nautilus-python.c b/src/nautilus-python.c
index ef89e3e..df37277 100644
--- a/src/nautilus-python.c
+++ b/src/nautilus-python.c
@@ -137,6 +137,7 @@ nautilus_python_load_dir (GTypeModule *module,
                                {
                                        g_warning("nautilus_python_init_python 
failed");
                                        g_dir_close(dir);
+                                       break;
                                }
                                
                                /* sys.path.insert(0, dirname) */
++++++ python-nautilus-pygobject-3.0.patch ++++++
commit 771676016350f372c2460661bb695cf139a49daf
Author: Vincent Untz <[email protected]>
Date:   Thu Sep 29 09:09:41 2011 +0200

    Port to pygobject 3.0
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660348

diff --git a/configure.in b/configure.in
index 407b0c5..1428a0e 100644
--- a/configure.in
+++ b/configure.in
@@ -40,16 +40,16 @@ AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find 
Python headers)])
 AM_CHECK_PYTHON_LIBS(,[AC_MSG_ERROR(could not find Python lib)])
 
 
-PKG_CHECK_MODULES(NAUTILUS_PYTHON, [pygobject-2.0 >= $PYGOBJECT_REQUIRED
+PKG_CHECK_MODULES(NAUTILUS_PYTHON, [pygobject-3.0 >= $PYGOBJECT_REQUIRED
                                    libnautilus-extension >= 
$NAUTILUS_REQUIRED])
 
-PYGOBJECT_DATADIR=`$PKG_CONFIG --variable=datadir pygobject-2.0`
+PYGOBJECT_DATADIR=`$PKG_CONFIG --variable=datadir pygobject-3.0`
 AC_SUBST(PYGOBJECT_DATADIR)
 
-PYGOBJECT_PYGDOCS="`$PKG_CONFIG --variable=pygdocs pygobject-2.0`"
+PYGOBJECT_PYGDOCS="`$PKG_CONFIG --variable=pygdocs pygobject-3.0`"
 AC_SUBST(PYGOBJECT_PYGDOCS)
 
-PYGOBJECT_FIXXREF="$PYTHON `$PKG_CONFIG --variable=fixxref pygobject-2.0`"
+PYGOBJECT_FIXXREF="$PYTHON `$PKG_CONFIG --variable=fixxref pygobject-3.0`"
 AC_SUBST(PYGOBJECT_FIXXREF)
 
 NAUTILUS_LIBDIR=`$PKG_CONFIG --variable=libdir libnautilus-extension`
diff --git a/src/nautilus-python.c b/src/nautilus-python.c
index 0e00285..ef89e3e 100644
--- a/src/nautilus-python.c
+++ b/src/nautilus-python.c
@@ -45,37 +45,13 @@ static GArray *all_types = NULL;
 static inline gboolean 
 np_init_pygobject(void)
 {
-#ifdef Py_CAPSULE_H
-               void *capsule = PyCapsule_Import("gobject._PyGObject_API", 0);
-               if (capsule)
-               {
-                       _PyGObject_API = (struct _PyGObject_Functions*)capsule;
-                       return TRUE;
-               }
-#endif
-    PyObject *gobject = PyImport_ImportModule("gobject");
-    if (gobject != NULL)
-    {
-        PyObject *mdict = PyModule_GetDict(gobject);
-        PyObject *cobject = PyDict_GetItemString(mdict, "_PyGObject_API");
-        if (PyCObject_Check(cobject))
-        {
-            _PyGObject_API = (struct _PyGObject_Functions 
*)PyCObject_AsVoidPtr(cobject);
-        }
-        else
-        {
-            PyErr_SetString(PyExc_RuntimeError,
-                            "could not find _PyGObject_API object");
-                       PyErr_Print();
-                       return FALSE;
-        }
-    }
-    else
-    {
-        PyErr_Print();
-        g_warning("could not import gobject");
+    PyObject *gobject = pygobject_init (3, 0, 0);
+
+    if (gobject == NULL) {
+        PyErr_Print ();
         return FALSE;
     }
+
        return TRUE;
 }
 
continue with "q"...



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to