summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2018-01-29 09:43:56 +0000
committerSimon McVittie <smcv@collabora.com>2018-01-29 09:43:56 +0000
commit28098f2c7c23bdef9247c5dfbb8437ca3f03dac4 (patch)
treef87cbac1f0a97c848f0450b6131350f273c98aa4
parent8d0bc022242a89b1d31b2be0aa9e4d570179e3cc (diff)
Integrate dbus-gmain
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--.travis.yml1
-rw-r--r--AUTHORS2
-rw-r--r--COPYING9
-rw-r--r--Makefile.am8
-rw-r--r--NEWS3
-rw-r--r--configure.ac8
-rw-r--r--dbus_glib_bindings/module.c9
7 files changed, 28 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml
index c785e24..e827ebb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,7 +37,6 @@ install:
dbus
gnome-desktop-testing
libdbus-1-dev
- libdbus-glib-1-dev
libtool
- >
test -z "$dbus_ci_system_python" || sudo apt-get -qq -y install
diff --git a/AUTHORS b/AUTHORS
index a5f1126..aa914eb 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -16,3 +16,5 @@ Zack Rusin <zack@kde.org>
Joe Shaw <joe@assbarn.com>
Colin Walters <walters@verbum.org>
David Zeuthen <david@fubar.dk>
+
+(See also dbus-gmain/AUTHORS.)
diff --git a/COPYING b/COPYING
index 3180f9b..c037e8f 100644
--- a/COPYING
+++ b/COPYING
@@ -1,6 +1,6 @@
-As of version 0.82.4, dbus-python is released under the following permissive
-non-copyleft license (the same one that was proposed for D-Bus core but
-wasn't achieved):
+As of version 0.82.4, dbus-python itself is released under the following
+permissive non-copyleft license (the same one that was proposed for
+D-Bus core but wasn't achieved):
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -23,3 +23,6 @@ wasn't achieved):
DEALINGS IN THE SOFTWARE.
Copyright holders and licensing are indicated in the source files.
+
+The dbus-gmain/ subdirectory is under a different license: see
+dbus-gmain/COPYING for details.
diff --git a/Makefile.am b/Makefile.am
index d7d8575..13ad510 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,6 +5,7 @@ installed_test_testdir = ${installed_testdir}/test
installed_test_metadir = ${datadir}/installed-tests/${PACKAGE_TARNAME}
ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = dbus-gmain .
CLEANFILES = \
test/test-service.log \
@@ -42,7 +43,7 @@ AM_CPPFLAGS = \
-include config.h \
-I$(top_srcdir)/include \
$(DBUS_CFLAGS) \
- $(DBUS_GLIB_CFLAGS) \
+ $(GLIB_CFLAGS) \
$(PYTHON_CPPFLAGS) \
$(NULL)
AM_CFLAGS = \
@@ -123,15 +124,18 @@ _dbus_bindings_la_SOURCES = \
dbus_bindings/validation.c \
$(NULL)
+dbus-gmain/libdbus-gmain.la:
+ $(MAKE) -C dbus-gmain
+
_dbus_glib_bindings_la_LDFLAGS = \
$(pymod_ldflags) \
-export-symbols-regex \(PyInit__\|init_\)dbus_glib_bindings \
$(AM_LDFLAGS) \
$(NULL)
_dbus_glib_bindings_la_LIBADD = \
+ dbus-gmain/libdbus-gmain.la \
$(pymod_libadd) \
$(DBUS_LIBS) \
- $(DBUS_GLIB_LIBS) \
$(NULL)
_dbus_glib_bindings_la_SOURCES = \
dbus_glib_bindings/module.c \
diff --git a/NEWS b/NEWS
index 02c89e0..27c3bb6 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,9 @@ Dependencies:
• Unit tests now require the dbus-run-session tool from dbus version
1.8 or later.
• Most unit tests now require the tap.py module from PyPI.
+• The deprecated dbus-glib library is no longer required. A bundled copy
+ of its main loop integration code is included instead. GLib is still
+ required for compilation.
Enhancements:
diff --git a/configure.ac b/configure.ac
index 16a0c4b..40754a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -187,7 +187,7 @@ AM_CONDITIONAL([ENABLE_API_DOCS], [test "$enable_api_docs" != no])
AM_CONDITIONAL([ENABLE_DOCS], [test "$enable_html_docs" != no])
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6])
-PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.70])
+PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.40])
AX_COMPILER_FLAGS([WARN_CFLAGS],
[WARN_LDFLAGS], [],
@@ -216,8 +216,14 @@ AC_ARG_ENABLE([coding-style-checks],
[ENABLE_CODING_STYLE_CHECKS=$enableval],
[ENABLE_CODING_STYLE_CHECKS=$ax_is_release])
+# Make dbus-gmain submodule part of dbus-python's namespace
+AH_BOTTOM([
+#define DBUS_GMAIN_FUNCTION_NAME(name) _dbus_py_glib_ ## name
+])
+
AC_CONFIG_FILES([
Makefile
+ dbus-gmain/Makefile
dbus-python.pc
])
AC_OUTPUT
diff --git a/dbus_glib_bindings/module.c b/dbus_glib_bindings/module.c
index 1da1ddb..ac05bca 100644
--- a/dbus_glib_bindings/module.c
+++ b/dbus_glib_bindings/module.c
@@ -25,8 +25,7 @@
#include <Python.h>
#include <dbus/dbus-python.h>
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
+#include <dbus-gmain/dbus-gmain.h>
#ifdef PY3
PyMODINIT_FUNC PyInit__dbus_glib_bindings(void);
@@ -49,7 +48,7 @@ dbus_py_glib_set_up_conn(DBusConnection *conn, void *data)
{
GMainContext *ctx = (GMainContext *)data;
Py_BEGIN_ALLOW_THREADS
- dbus_connection_setup_with_g_main(conn, ctx);
+ _dbus_py_glib_set_up_connection(conn, ctx);
Py_END_ALLOW_THREADS
return 1;
}
@@ -59,7 +58,7 @@ dbus_py_glib_set_up_srv(DBusServer *srv, void *data)
{
GMainContext *ctx = (GMainContext *)data;
Py_BEGIN_ALLOW_THREADS
- dbus_server_setup_with_g_main(srv, ctx);
+ _dbus_py_glib_set_up_server(srv, ctx);
Py_END_ALLOW_THREADS
return 1;
}
@@ -161,7 +160,7 @@ PyDoc_STRVAR(gthreads_init__doc__,
static PyObject *
gthreads_init (PyObject *always_null UNUSED, PyObject *no_args UNUSED)
{
- dbus_g_thread_init();
+ dbus_threads_init_default();
Py_RETURN_NONE;
}