[PATCH glib] Delete the manually written python binding

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

 



The python binding only supports python2, only supports
1 single API in libvirt-glib and has not even been enabled
in RPM builds since Fedora 15. Any distro these days should
have gobject introspection and pygobject available, so
there's no compelling reason to continue to have the python
binding exist.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 Makefile.am                |  2 +-
 autobuild.sh               |  6 ++--
 cfg.mk                     |  3 --
 configure.ac               | 87 ----------------------------------------------
 libvirt-glib.spec.in       | 35 +------------------
 mingw-libvirt-glib.spec.in |  3 +-
 python/Makefile.am         | 34 ------------------
 python/libvirt-glib.c      | 59 -------------------------------
 python/libvirtglib.py      | 10 ------
 9 files changed, 5 insertions(+), 234 deletions(-)
 delete mode 100644 python/Makefile.am
 delete mode 100644 python/libvirt-glib.c
 delete mode 100644 python/libvirtglib.py

diff --git a/Makefile.am b/Makefile.am
index ae8b06d..459d544 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
 
-SUBDIRS = libvirt-glib libvirt-gconfig libvirt-gobject python vapi examples docs po tests
+SUBDIRS = libvirt-glib libvirt-gconfig libvirt-gobject vapi examples docs po tests
 
 ACLOCAL_AMFLAGS = -I m4
 
diff --git a/autobuild.sh b/autobuild.sh
index 053dc1f..9935de1 100755
--- a/autobuild.sh
+++ b/autobuild.sh
@@ -56,8 +56,7 @@ if test -x /usr/bin/i686-w64-mingw32-gcc ; then
     --host=i686-w64-mingw32 \
     --prefix="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw" \
     --enable-werror \
-    --enable-introspection=no \
-    --without-python
+    --enable-introspection=no
 
   make
   make install
@@ -75,8 +74,7 @@ if test -x /usr/bin/x86_64-w64-mingw32-gcc ; then
     --host=x86_64-w64-mingw32 \
     --prefix="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw" \
     --enable-werror \
-    --enable-introspection=no \
-    --without-python
+    --enable-introspection=no
 
   make
   make install
diff --git a/cfg.mk b/cfg.mk
index b322393..6dd34cf 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -115,9 +115,6 @@ exclude_file_name_regexp--sc_preprocessor_indentation = ^*/*.[ch]
 
 exclude_file_name_regexp--sc_prohibit_strcmp = ^*/*.[ch]
 
-exclude_file_name_regexp--sc_require_config_h = python/libvirt-glib.c
-exclude_file_name_regexp--sc_require_config_h_first = python/libvirt-glib.c
-
 # XXX we shouldn't really ignore this, but the horrible enum rules...
 exclude_file_name_regexp--sc_makefile_at_at_check = libvirt-gobject/Makefile.am
 
diff --git a/configure.ac b/configure.ac
index 8edde74..cc9b2aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,15 +135,11 @@ dnl Copied from libxml2 configure.in, but I removed mingw changes
 dnl for now since I'm not supporting mingw at present.  - RWMJ
 CYGWIN_EXTRA_LDFLAGS=
 CYGWIN_EXTRA_LIBADD=
-CYGWIN_EXTRA_PYTHON_LIBADD=
 MINGW_EXTRA_LDFLAGS=
 case "$host" in
   *-*-cygwin*)
     CYGWIN_EXTRA_LDFLAGS="-no-undefined"
     CYGWIN_EXTRA_LIBADD="${INTLLIBS}"
-    if test "x$PYTHON_VERSION" != "x"; then
-      CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
-    fi
     ;;
   *-*-mingw*)
     MINGW_EXTRA_LDFLAGS="-no-undefined"
@@ -151,7 +147,6 @@ case "$host" in
 esac
 AC_SUBST([CYGWIN_EXTRA_LDFLAGS])
 AC_SUBST([CYGWIN_EXTRA_LIBADD])
-AC_SUBST([CYGWIN_EXTRA_PYTHON_LIBADD])
 AC_SUBST([MINGW_EXTRA_LDFLAGS])
 
 
@@ -172,87 +167,6 @@ if test "${enable_coverage}" = yes; then
   COV_FLAGS=
 fi
 
-dnl
-dnl check for python
-dnl
-AC_ARG_WITH([python],
-  AC_HELP_STRING([--with-python], [Build python bindings @<:@default=yes@:>@]),[],[with_python=yes])
-
-PYTHON_VERSION=
-PYTHON_INCLUDES=
-PYTHON_SITE_PACKAGES=
-PYTHON_TESTS=
-pythondir=
-if test "$with_python" != "no" ; then
-    if test "$with_python" = "yes" ; then
-       with_python=""
-    fi
-    if test -x "$with_python/bin/python"
-    then
-        echo Found python in $with_python/bin/python
-        PYTHON="$with_python/bin/python"
-    else
-	if test -x "$with_python"
-	then
-	    echo Found python in $with_python
-	    PYTHON="$with_python"
-	else
-	    if test -x "$PYTHON"
-	    then
-	        echo Found python in environment PYTHON=$PYTHON
-		with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
-	    else
-		AC_PATH_PROG([PYTHON], [python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5])
-	    fi
-	fi
-    fi
-    if test "$PYTHON" != ""
-    then
-        PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
-	echo Found Python version $PYTHON_VERSION
-    fi
-    if test "$PYTHON_VERSION" != ""
-    then
-	if test -r $with_python/include/python$PYTHON_VERSION/Python.h && \
-	   test -d $with_python/lib/python$PYTHON_VERSION/site-packages
-	then
-	    PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
-	    PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
-	else
-	    if test -r $prefix/include/python$PYTHON_VERSION/Python.h
-	    then
-	        PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
-	        PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
-	    else
-		if test -r /usr/include/python$PYTHON_VERSION/Python.h
-		then
-		    PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
-	            PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
-		else
-		    echo could not find python$PYTHON_VERSION/Python.h
-		fi
-	    fi
-	    if test ! -d "$PYTHON_SITE_PACKAGES"
-	    then
-		    PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
-	    fi
-	fi
-    fi
-    if test "$with_python" != ""
-    then
-        pythondir='$(PYTHON_SITE_PACKAGES)'
-    else
-        pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
-    fi
-else
-    PYTHON=
-fi
-AM_CONDITIONAL([WITH_PYTHON], test "$PYTHON_INCLUDES" != "")
-AC_SUBST([pythondir])
-AC_SUBST([PYTHON_VERSION])
-AC_SUBST([PYTHON_INCLUDES])
-AC_SUBST([PYTHON_SITE_PACKAGES])
-
 GOBJECT_INTROSPECTION_CHECK([$GOBJECT_INTROSPECTION_REQUIRED])
 
 with_linux=no
@@ -302,7 +216,6 @@ AC_OUTPUT(Makefile
           libvirt-gconfig/tests/Makefile
           libvirt-gobject/Makefile
           examples/Makefile
-          python/Makefile
           vapi/Makefile
           docs/Makefile
           docs/libvirt-glib/Makefile
diff --git a/libvirt-glib.spec.in b/libvirt-glib.spec.in
index 32ce4f0..2ec8337 100644
--- a/libvirt-glib.spec.in
+++ b/libvirt-glib.spec.in
@@ -1,21 +1,14 @@
 # -*- rpm-spec -*-
 
 %define with_introspection 0
-%define with_python 0
 %define with_vala 0
 
 %if 0%{?fedora} >= 15
 %define with_introspection 1
 %endif
-%if 0%{?fedora} && 0%{?fedora} < 15
-%define with_python 1
-%endif
 %if 0%{?rhel} > 6
 %define with_introspection 1
 %endif
-%if 0%{?rhel} && 0%{?rhel} < 7
-%define with_python 1
-%endif
 %define with_vala %{with_introspection}
 
 %define libvirt_version @LIBVIRT_REQUIRED@
@@ -32,7 +25,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires: glib2-devel >= @GLIB2_REQUIRED@
 BuildRequires: libvirt-devel >= %{libvirt_version}
-BuildRequires: python-devel
 %if %{with_introspection}
 BuildRequires: gobject-introspection-devel
 %if 0%{?fedora} == 12
@@ -72,12 +64,6 @@ Requires: libvirt-gconfig-devel = %{version}-%{release}
 Requires: libvirt-gobject = %{version}-%{release}
 Requires: libvirt-devel >=  %{libvirt_version}
 
-%if %{with_python}
-%package python
-Group: Development/Libraries
-Summary: libvirt glib integration for events python binding
-%endif
-
 %description
 This package provides integration between libvirt and the glib
 event loop.
@@ -102,12 +88,6 @@ objects
 This package provides development header files and libraries for
 managing virtualization host objects
 
-%if %{with_python}
-%description python
-This package provides a python module for integration between
-libvirt and the glib event loop
-%endif
-
 %prep
 %setup -q
 
@@ -118,13 +98,8 @@ libvirt and the glib event loop
 %else
 %define introspection_arg --disable-introspection
 %endif
-%if %{with_python}
-%define python_arg --with-python
-%else
-%define python_arg --without-python
-%endif
 
-%configure %{introspection_arg} %{python_arg}
+%configure %{introspection_arg}
 %__make %{?_smp_mflags}
 
 
@@ -227,12 +202,4 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/vala/vapi/libvirt-gobject-1.0.vapi
 %endif
 
-%if %{with_python}
-%files python
-%defattr(-,root,root,-)
-%doc examples/event-test.py
-%{_libdir}/python*/site-packages/libvirtglib.py*
-%{_libdir}/python*/site-packages/libvirtglibmod*
-%endif
-
 %changelog
diff --git a/mingw-libvirt-glib.spec.in b/mingw-libvirt-glib.spec.in
index 0c71628..ab31a0d 100644
--- a/mingw-libvirt-glib.spec.in
+++ b/mingw-libvirt-glib.spec.in
@@ -87,8 +87,7 @@ MinGW Windows libvirt-gobject virtualization library.
 
 %build
 %mingw_configure \
-    --enable-introspection=no \
-    --without-python
+    --enable-introspection=no
 
 %mingw_make %{?_smp_mflags}
 
diff --git a/python/Makefile.am b/python/Makefile.am
deleted file mode 100644
index 1471dce..0000000
--- a/python/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-# Makefile for libvirt python library
-
-AM_CPPFLAGS = \
-        $(WARN_CFLAGS) \
-        -I$(PYTHON_INCLUDES) \
-	-I$(top_srcdir) \
-	$(GLIB2_CFLAGS)
-
-EXTRA_DIST = libvirtglib.py
-
-if WITH_PYTHON
-python_LTLIBRARIES = libvirtglibmod.la
-
-libvirtglibmod_la_SOURCES = libvirt-glib.c
-# Python header files contain a redundant decl, hence:
-libvirtglibmod_la_CFLAGS = -Wno-redundant-decls
-
-libvirtglibmod_la_LDFLAGS = -module -avoid-version \
-	$(CYGWIN_EXTRA_LDFLAGS)
-libvirtglibmod_la_LIBADD = ../libvirt-glib/libvirt-glib-1.0.la
-	$(CYGWIN_EXTRA_LIBADD) $(CYGWIN_EXTRA_PYTHON_LIBADD)
-
-
-install-data-local:
-	$(mkinstalldirs) $(DESTDIR)$(pythondir)
-	$(INSTALL) -m 0644 $(srcdir)/libvirtglib.py $(DESTDIR)$(pythondir)
-
-uninstall-local:
-	rm -f $(DESTDIR)$(pythondir)/libvirtglib.py
-
-
-else
-all:
-endif
diff --git a/python/libvirt-glib.c b/python/libvirt-glib.c
deleted file mode 100644
index 1daca36..0000000
--- a/python/libvirt-glib.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * libvirt-glib.c: Binding the glib event loop integration to python
- *
- * Copyright (C) 2008 Red Hat, Inc., Inc.
- *
- * Daniel Berrange <berrange@xxxxxxxxxx>
- */
-
-//#include <config.h>
-
-/* Horrible kludge to work around even more horrible name-space pollution
-   via Python.h.  That file includes /usr/include/python2.5/pyconfig*.h,
-   which has over 180 autoconf-style HAVE_* definitions.  Shame on them.  */
-#undef HAVE_PTHREAD_H
-
-#include <Python.h>
-#include <glib.h>
-#include "libvirt-glib/libvirt-glib.h"
-
-#ifndef __CYGWIN__
-extern void initlibvirtglibmod(void);
-#else
-extern void initcygvirtglibmod(void);
-#endif
-
-#define VIR_PY_NONE (Py_INCREF (Py_None), Py_None)
-
-static PyObject *
-libvirt_gvir_event_register(PyObject *self G_GNUC_UNUSED, PyObject *args G_GNUC_UNUSED) {
-    gvir_event_register();
-
-    return VIR_PY_NONE;
-}
-
-
-static PyMethodDef libvirtGLibMethods[] = {
-    {(char *) "event_register", libvirt_gvir_event_register, METH_VARARGS, NULL},
-    {NULL, NULL, 0, NULL}
-};
-
-void
-#ifndef __CYGWIN__
-initlibvirtglibmod
-#else
-initcygvirtglibmod
-#endif
-  (void)
-{
-    gvir_init(NULL, NULL);
-    /* initialize the python extension module */
-    Py_InitModule((char *)
-#ifndef __CYGWIN__
-                  "libvirtglibmod"
-#else
-                  "cygvirtglibmod"
-#endif
-                  , libvirtGLibMethods);
-
-}
diff --git a/python/libvirtglib.py b/python/libvirtglib.py
deleted file mode 100644
index 3a74c3d..0000000
--- a/python/libvirtglib.py
+++ /dev/null
@@ -1,10 +0,0 @@
-
-# On cygwin, the DLL is called cygvirtmod.dll
-try:
-    import libvirtglibmod
-except:
-    import cygvirtglibmod as libvirtglibmod
-
-
-def event_register():
-    libvirtglibmod.event_register()
-- 
2.7.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]