Commit ad4380f1 authored by Milan Crha's avatar Milan Crha

Replace evolution-dbus-session tool with DBUS_SERVICES_PREFIX option

The option is still meant to be used in Flatpak only, to prefix
the D-Bus services with certain prefix (usually the same as the Flatpak
application ID), thus the services do not clash with those installed
in the host system. It fixes many issues in evolution-dbus-session.

Related to GNOME/evolution#165
parent 2b41608a
......@@ -31,13 +31,13 @@ set(PROJECT_DISTCONFIGURE_PARAMS
-DENABLE_VALA_BINDINGS=ON
-DENABLE_INSTALLED_TESTS=ON
-DENABLE_GTK_DOC=ON
-DENABLE_DBUS_SESSION_TOOL=ON
-DWITH_PRIVATE_DOCS=ON
)
# ******************************
# D-Bus versioning
# ******************************
# Actual name can be modified with DBUS_SERVICES_PREFIX option
set(ADDRESS_BOOK_DBUS_SERVICE_NAME "org.gnome.evolution.dataserver.AddressBook9")
set(CALENDAR_DBUS_SERVICE_NAME "org.gnome.evolution.dataserver.Calendar7")
set(SOURCES_DBUS_SERVICE_NAME "org.gnome.evolution.dataserver.Sources5")
......@@ -171,6 +171,15 @@ ensure_default_value(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share")
ensure_default_value(LOCALE_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/locale")
ensure_default_value(SYSCONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc")
add_printable_variable(DBUS_SERVICES_PREFIX "Prefix for D-Bus services, usually left empty, without trailing dot" "")
if(NOT ("${DBUS_SERVICES_PREFIX}" STREQUAL ""))
set(ADDRESS_BOOK_DBUS_SERVICE_NAME "${DBUS_SERVICES_PREFIX}.${ADDRESS_BOOK_DBUS_SERVICE_NAME}")
set(CALENDAR_DBUS_SERVICE_NAME "${DBUS_SERVICES_PREFIX}.${CALENDAR_DBUS_SERVICE_NAME}")
set(SOURCES_DBUS_SERVICE_NAME "${DBUS_SERVICES_PREFIX}.${SOURCES_DBUS_SERVICE_NAME}")
set(USER_PROMPTER_DBUS_SERVICE_NAME "${DBUS_SERVICES_PREFIX}.${USER_PROMPTER_DBUS_SERVICE_NAME}")
endif(NOT ("${DBUS_SERVICES_PREFIX}" STREQUAL ""))
# ******************************
# Special directories
# ******************************
......@@ -996,12 +1005,6 @@ if(ENABLE_VALA_BINDINGS)
endif(ENABLE_VALA_BINDINGS)
# ******************************
# D-Bus session tool, a Flatpak helper
# ******************************
add_printable_option(ENABLE_DBUS_SESSION_TOOL "Build evolution-dbus-session tool" OFF)
# Generate the ${PROJECT_NAME}-config.h file
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-config.h)
......
add_subdirectory(addressbook-export)
add_subdirectory(list-sources)
if(ENABLE_DBUS_SESSION_TOOL)
add_subdirectory(evolution-dbus-session)
endif(ENABLE_DBUS_SESSION_TOOL)
set(SOURCES
evolution-dbus-session.c
)
add_executable(evolution-dbus-session
${SOURCES}
)
target_compile_definitions(evolution-dbus-session PRIVATE
-DG_LOG_DOMAIN=\"evolution-dbus-session\"
)
target_compile_options(edataserver PUBLIC
${GNOME_PLATFORM_CFLAGS}
)
target_include_directories(evolution-dbus-session PUBLIC
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/src
${CMAKE_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}
${GNOME_PLATFORM_INCLUDE_DIRS}
)
target_link_libraries(evolution-dbus-session
${GNOME_PLATFORM_LDFLAGS}
)
install(TARGETS evolution-dbus-session
DESTINATION ${privlibexecdir}
)
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