Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add dbus and systemd service files #3

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ set_package_properties(AppStreamQt PROPERTIES

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

add_subdirectory(systemd)
add_subdirectory(dbus)
add_subdirectory(src/gioutils)
add_subdirectory(src/utils)
add_subdirectory(src/quick)
Expand Down Expand Up @@ -54,7 +56,7 @@ set(TRANSLATION_FILES

qt_create_translation(TRANSLATED_FILES ${QML_FILES} ${SOURCE_FILES} src/models/appitem.cpp ${TRANSLATION_FILES})

qt_add_dbus_adaptor(DBUS_ADAPTER_FILES org.deepin.dde.Launcher1.xml launchercontroller.h LauncherController)
qt_add_dbus_adaptor(DBUS_ADAPTER_FILES dbus/org.deepin.dde.Launcher1.xml launchercontroller.h LauncherController)

add_executable(${BIN_NAME}
${SOURCE_FILES}
Expand Down
11 changes: 11 additions & 0 deletions dbus/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: CC0-1.0

configure_file(
org.deepin.dde.Launcher1.service.in
${CMAKE_CURRENT_BINARY_DIR}/org.deepin.dde.Launcher1.service
@ONLY)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.deepin.dde.Launcher1.service
DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/services)
8 changes: 8 additions & 0 deletions dbus/org.deepin.dde.Launcher1.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: GPL-3.0-or-later

[D-BUS Service]
Name=org.deepin.dde.Launcher1
Exec=@CMAKE_INSTALL_FULL_BINDIR@/dde-launchpad
SystemdService=org.deepin.dde.Launcher1.service
File renamed without changes.
3 changes: 3 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Build-Depends:
cmake,
pkg-config,
libglib2.0-dev,
# v-- to get systemduserunitdir from its pkg-config data
systemd,
qtbase5-dev,
libqt5svg5-dev,
qtdeclarative5-dev,
Expand Down Expand Up @@ -37,6 +39,7 @@ Depends:
# v-- actually should be depended by qqc2-styles-chameleon
qml-module-qtgraphicaleffects,
qml-module-org-kde-kitemmodels
Conflicts: dde-launcher
Replaces: dde-launcher
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>
17 changes: 17 additions & 0 deletions systemd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: CC0-1.0

if (NOT DEFINED SYSTEMD_USER_UNIT_DIR)
find_package(PkgConfig REQUIRED)
pkg_check_modules(Systemd REQUIRED systemd)
pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemduserunitdir)
endif()

configure_file(
org.deepin.dde.Launcher1.service.in
${CMAKE_CURRENT_BINARY_DIR}/org.deepin.dde.Launcher1.service
@ONLY)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.deepin.dde.Launcher1.service
DESTINATION ${SYSTEMD_USER_UNIT_DIR})
13 changes: 13 additions & 0 deletions systemd/org.deepin.dde.Launcher1.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: GPL-3.0-or-later

[Unit]
Description=DDE launchpad background service

[Service]
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/dde-launchpad
Type=dbus
BusName=org.deepin.dde.Launcher1
Restart=on-failure
RestartSec=1s
Loading