libobs/util: Replace libdbus by GDBus

GDBus is more and better maintained than libdbus these days. In the
future, a potential Wayland-compatible capture plugin will need to
interact with D-Bus in a way that's way too complicated for libdbus,
and it won't be nice to have both libraries talking to the D-Bus
socket.

Replace the libdbus usage by GDBus. As it turns out, it results in less
code.
This commit is contained in:
Georges Basile Stavracas Neto
2021-02-17 19:14:19 -03:00
committed by Jim
parent 94d2166951
commit ec1b07cc85
4 changed files with 74 additions and 117 deletions

View File

@@ -1,43 +0,0 @@
# Once done these will be defined:
#
# DBUS_FOUND
# DBUS_INCLUDE_DIRS
# DBUS_LIBRARIES
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_DBUS QUIET dbus-1)
endif()
find_path(DBUS_INCLUDE_DIR
NAMES dbus/dbus.h
HINTS
${_DBUS_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include)
find_path(DBUS_ARCH_INCLUDE_DIR
NAMES dbus/dbus-arch-deps.h
HINTS
${_DBUS_INCLUDE_DIRS}
PATHS
/usr/include /usr/local/include /opt/local/include)
find_library(DBUS_LIB
NAMES dbus-1
HINTS
${_DBUS_LIBRARY_DIRS}
PATHS
/usr/lib /usr/local/lib /opt/local/lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DBus DEFAULT_MSG DBUS_LIB DBUS_INCLUDE_DIR DBUS_ARCH_INCLUDE_DIR)
mark_as_advanced(DBUS_INCLUDE_DIR DBUS_ARCH_INCLUDE_DIR DBUS_LIB)
if(DBUS_FOUND)
set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
set(DBUS_LIBRARIES ${DBUS_LIB})
set(HAVE_DBUS "1")
else()
set(HAVE_DBUS "0")
endif()

View File

@@ -0,0 +1,27 @@
# - Try to find Gio
# Once done this will define
#
# GIO_FOUND - system has Gio
# GIO_INCLUDE_DIRS - the Gio include directory
# GIO_LIBRARIES - the libraries needed to use Gio
# GIO_DEFINITIONS - Compiler switches required for using Gio
# Use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
find_package(PkgConfig)
pkg_check_modules(PC_GIO gio-2.0)
set(GIO_DEFINITIONS ${PC_GIO_CFLAGS})
find_path(GIO_INCLUDE_DIRS gio.h PATHS ${PC_GIO_INCLUDEDIR} ${PC_GIO_INCLUDE_DIRS} PATH_SUFFIXES glib-2.0/gio/)
find_library(GIO_LIBRARIES NAMES gio-2.0 libgio-2.0 PATHS ${PC_GIO_LIBDIR} ${PC_GIO_LIBRARY_DIRS})
mark_as_advanced(GIO_INCLUDE_DIRS GIO_LIBRARIES)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Gio REQUIRED_VARS GIO_LIBRARIES GIO_INCLUDE_DIRS)
if(GIO_FOUND)
set(HAVE_DBUS "1")
else()
set(HAVE_DBUS "0")
endif()