Commit 70ef6b18 authored by Thaodan's avatar Thaodan

[mce] Use dbus_gmain instead of dbus-glib. JB#51115

Also remove dependency on dbus-glib.
Signed-off-by: Thaodan's avatarBjörn Bidar <bjorn.bidar@jolla.com>
parent e29d2a25
......@@ -178,6 +178,7 @@ mce-dbus.o:\
mce-dbus.c\
builtin-gconf.h\
datapipe.h\
dbus-gmain/dbus-gmain.h\
mce-dbus.h\
mce-lib.h\
mce-log.h\
......@@ -189,6 +190,7 @@ mce-dbus.pic.o:\
mce-dbus.c\
builtin-gconf.h\
datapipe.h\
dbus-gmain/dbus-gmain.h\
mce-dbus.h\
mce-lib.h\
mce-log.h\
......@@ -1347,11 +1349,13 @@ tklock.pic.o:\
tools/dummy_compositor.o:\
tools/dummy_compositor.c\
builtin-gconf.h\
dbus-gmain/dbus-gmain.h\
mce-dbus.h\
tools/dummy_compositor.pic.o:\
tools/dummy_compositor.c\
builtin-gconf.h\
dbus-gmain/dbus-gmain.h\
mce-dbus.h\
tools/evdev_trace.o:\
......
[submodule "dbus-gmain"]
path = dbus-gmain
url = https://gitlab.freedesktop.org/dbus/dbus-glib.git
......@@ -138,11 +138,12 @@ HELPERSCRIPTDIR := $(_DATADIR)/mce
TESTSDESTDIR := $(_TESTSDIR)/mce
# Source directories
DOCDIR := doc
TOOLDIR := tools
TESTSDIR := tests
UTESTDIR := tests/ut
MODULE_DIR := modules
DOCDIR := doc
TOOLDIR := tools
TESTSDIR := tests
UTESTDIR := tests/ut
MODULE_DIR := modules
DBUS_GMAIN_DIR := dbus-gmain
# Binaries to build
TARGETS += mce
......@@ -281,7 +282,6 @@ MCE_PKG_NAMES += glib-2.0
MCE_PKG_NAMES += gio-2.0
MCE_PKG_NAMES += gmodule-2.0
MCE_PKG_NAMES += dbus-1
MCE_PKG_NAMES += dbus-glib-1
MCE_PKG_NAMES += dsme
MCE_PKG_NAMES += libiphb
MCE_PKG_NAMES += libsystemd
......@@ -332,6 +332,8 @@ ifeq ($(strip $(ENABLE_WAKELOCKS)),y)
MCE_CORE += libwakelock.c
endif
MCE_CORE += $(DBUS_GMAIN_DIR)/dbus-gmain.c
mce : CFLAGS += $(MCE_CFLAGS)
mce : LDLIBS += $(MCE_LDLIBS)
ifeq ($(ENABLE_HYBRIS),y)
......@@ -342,6 +344,22 @@ mce : mce.o $(patsubst %.c,%.o,$(MCE_CORE))
CFLAGS += -g
LDFLAGS += -g
# ----------------------------------------------------------------------------
# DBUS_GMAIN
# ----------------------------------------------------------------------------
# The dbus-gmain submodule contains sources that have
# issues and do not compile cleanly. As the content is
# what it is, silence warnings etc when compiling source
# files from there...
DBUS_GMAIN_CPPFLAGS += -I.
DBUS_GMAIN_CFLAGS += -Wno-unused-parameter
DBUS_GMAIN_CFLAGS += -Wno-cast-function-type
$(DBUS_GMAIN_DIR)/%.o : CPPFLAGS += $(DBUS_GMAIN_CPPFLAGS)
$(DBUS_GMAIN_DIR)/%.o : CFLAGS += $(DBUS_GMAIN_CFLAGS)
# ----------------------------------------------------------------------------
# MODULES
# ----------------------------------------------------------------------------
......@@ -350,7 +368,6 @@ MODULE_PKG_NAMES += gobject-2.0
MODULE_PKG_NAMES += glib-2.0
MODULE_PKG_NAMES += gmodule-2.0
MODULE_PKG_NAMES += dbus-1
MODULE_PKG_NAMES += dbus-glib-1
MODULE_PKG_NAMES += usb_moded
MODULE_PKG_NAMES += libudev
......@@ -377,7 +394,6 @@ $(MODULE_DIR)/%.so : $(MODULE_DIR)/%.pic.o
TOOLS_PKG_NAMES += gobject-2.0
TOOLS_PKG_NAMES += glib-2.0
TOOLS_PKG_NAMES += dbus-1
TOOLS_PKG_NAMES += dbus-glib-1
TOOLS_PKG_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(TOOLS_PKG_NAMES))
TOOLS_PKG_LDLIBS := $(shell $(PKG_CONFIG) --libs $(TOOLS_PKG_NAMES))
......@@ -395,7 +411,7 @@ $(TOOLDIR)/evdev_trace : $(TOOLDIR)/evdev_trace.o evdev.o $(TOOLDIR)/fileusers.o
$(TOOLDIR)/dummy_compositor : CFLAGS += $(TOOLS_CFLAGS)
$(TOOLDIR)/dummy_compositor : LDLIBS += $(TOOLS_LDLIBS)
$(TOOLDIR)/dummy_compositor : $(TOOLDIR)/dummy_compositor.o
$(TOOLDIR)/dummy_compositor : $(TOOLDIR)/dummy_compositor.o $(DBUS_GMAIN_DIR)/dbus-gmain.o
# ----------------------------------------------------------------------------
# UNIT TESTS
......@@ -403,7 +419,6 @@ $(TOOLDIR)/dummy_compositor : $(TOOLDIR)/dummy_compositor.o
UTESTS_PKG_NAMES += check
UTESTS_PKG_NAMES += dbus-1
UTESTS_PKG_NAMES += dbus-glib-1
UTESTS_PKG_NAMES += glib-2.0
UTESTS_PKG_NAMES += gthread-2.0
......@@ -427,6 +442,7 @@ $(UTESTDIR)/ut_display : LINK_STUBS += mce_write_string_to_file
$(UTESTDIR)/ut_display : datapipe.o
$(UTESTDIR)/ut_display : mce-lib.o
$(UTESTDIR)/ut_display : modetransition.o
$(UTESTDIR)/ut_display : $(DBUS_GMAIN_DIR)/dbus-gmain.o
# ----------------------------------------------------------------------------
# ACTIONS FOR TOP LEVEL TARGETS
......@@ -538,10 +554,13 @@ fixme::
# AUTOMATIC HEADER DEPENDENCIES
# ----------------------------------------------------------------------------
# All sources, except ones from gmain git submodule
DEPEND_SOURCES = $(filter-out $(DBUS_GMAIN_DIR)/%.c, $(wildcard *.c */*.c */*/*.c))
.PHONY: depend
depend::
@echo "Updating .depend"
$(CC) -MM $(CPPFLAGS) $(MCE_CFLAGS) *.c */*.c */*/*.c |\
$(CC) -MM $(CPPFLAGS) $(MCE_CFLAGS) $(DEPEND_SOURCES) \
./depend_filter.py > .depend
ifneq ($(MAKECMDGOALS),depend) # not while: make depend
......
dbus-gmain @ d42176ae
Subproject commit d42176ae4763e5288ef37ea314fe58387faf2005
......@@ -42,7 +42,7 @@
#include <grp.h>
#include <pwd.h>
#include <dbus/dbus-glib-lowlevel.h>
#include "dbus-gmain/dbus-gmain.h"
#include <mce/dbus-names.h>
#include <dsme/thermalmanager_dbus_if.h>
......@@ -5238,7 +5238,7 @@ gboolean mce_dbus_init(const gboolean systembus)
mce_log(LL_DEBUG, "Connecting D-Bus to the mainloop");
/* Connect D-Bus to the mainloop */
dbus_connection_setup_with_g_main(dbus_connection, NULL);
dbus_gmain_set_up_connection(dbus_connection, NULL);
mce_log(LL_DEBUG, "Acquiring D-Bus service");
......
......@@ -15,7 +15,6 @@ Requires(postun): systemd
Conflicts: mce-plugin-libhybris < 1.3.0
Conflicts: lipstick-qt5 < 0.24.7
BuildRequires: pkgconfig(dbus-1) >= 1.0.2
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(dsme) >= 0.65.0
BuildRequires: pkgconfig(thermalmanager_dbus_if)
BuildRequires: pkgconfig(libiphb)
......
#include <check.h>
#include <dbus/dbus-glib-lowlevel.h> /* dbus_connection_setup_with_g_main */
#include <dbus-gmain.h> /* dbus_gmain_set_up_connection */
#include <glib.h>
#include <linux/input.h>
#include <stdbool.h>
......
......@@ -32,7 +32,7 @@
#include <glib.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
#include "../dbus-gmain/dbus-gmain.h"
/* ========================================================================= *
* Constants
......@@ -622,7 +622,7 @@ dc_dbus_connect(void)
dbus_connection_set_exit_on_disconnect(dc_dbus_con, false);
dbus_connection_setup_with_g_main(dc_dbus_con, 0);
dbus_gmain_set_up_connection(dc_dbus_con, 0);
EXIT:
dbus_error_free(&err);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment