From 85a635069f3eb9a164a8d4df6a92ef04da957248 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Thu, 6 Aug 2026 19:33:22 +0200 Subject: [PATCH] Remove WIVRN_USE_SYSTEMD config option --- CMakeLists.txt | 8 -------- common/wivrn_config.h.in | 2 -- server/CMakeLists.txt | 31 +++++++++++-------------------- server/main.cpp | 28 +++++++++++++++++++++------- 4 files changed, 32 insertions(+), 37 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 27b1848b..1a8efbd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,6 @@ option(WIVRN_USE_SYSTEM_FREETYPE "Use system FreeType" ON) option(WIVRN_USE_SYSTEM_BOOST "Use system Boost headers" ON) option(WIVRN_USE_SYSTEM_OPENXR "Use system OpenXR headers" ON) option(WIVRN_USE_SYSTEM_LIBKTX "Use system KTX-Software library" ON) -option(WIVRN_USE_SYSTEMD "Use libsystemd" ON) option(WIVRN_COMPRESS_GLB "Compress textures in GLB files with gltf-transform" OFF) option(WIVRN_USE_ANDROID_VALIDATION_LAYER "Download the android version of the Vulkan validation layer" OFF) option(WIVRN_USE_ANDROID_BIN_LIBKTX "Download the prebuilt libktx for android" OFF) @@ -140,10 +139,6 @@ if (WIVRN_BUILD_SERVER) pkg_check_modules(X264 REQUIRED IMPORTED_TARGET x264) endif() - if (WIVRN_USE_SYSTEMD) - pkg_check_modules(SYSTEMD REQUIRED IMPORTED_TARGET libsystemd) - endif() - if (WIVRN_USE_PIPEWIRE) pkg_check_modules(libpipewire REQUIRED IMPORTED_TARGET libpipewire-0.3) endif() @@ -318,9 +313,6 @@ if (WIVRN_BUILD_SERVER OR WIVRN_BUILD_SERVER_LIBRARY) message(STATUS "") message(STATUS "Audio backends:") message(STATUS "\tPipewire : ${WIVRN_USE_PIPEWIRE}") - message(STATUS "") - message(STATUS "Optional features:") - message(STATUS "\tsystemd: ${WIVRN_USE_SYSTEMD}") endif() endif() diff --git a/common/wivrn_config.h.in b/common/wivrn_config.h.in index 6ed766af..cf5ffa2b 100644 --- a/common/wivrn_config.h.in +++ b/common/wivrn_config.h.in @@ -33,8 +33,6 @@ static const int64_t max_extrapolation_ns = 80'000'000; #cmakedefine01 WIVRN_USE_VULKAN_ENCODE #cmakedefine01 WIVRN_USE_X264 -#cmakedefine01 WIVRN_USE_SYSTEMD - #cmakedefine01 WIVRN_USE_PIPEWIRE #cmakedefine01 WIVRN_FEATURE_DEBUG_GUI diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 10cc2fcf..2fdcfec5 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -62,7 +62,7 @@ set(XRT_HAVE_DBUS OFF) set(XRT_HAVE_LIBUDEV OFF) set(XRT_HAVE_ONNXRUNTIME OFF) -set(XRT_HAVE_SYSTEMD ${WIVRN_USE_SYSTEMD}) +set(XRT_HAVE_SYSTEMD OFF) set(XRT_INSTALL_SYSTEMD_UNIT_FILES OFF) set(BUILD_DOC OFF) @@ -97,6 +97,7 @@ if (WIVRN_BUILD_SERVER) main.cpp sleep_inhibitor.cpp start_application.cpp + start_systemd_unit.cpp ipc_server_cb.cpp target_instance_wivrn.cpp wivrn_ipc.cpp @@ -206,10 +207,6 @@ if (WIVRN_BUILD_SERVER) endif() endif() - if(WIVRN_USE_SYSTEMD) - target_link_libraries(wivrn-server PRIVATE PkgConfig::SYSTEMD) - endif() - if(WIVRN_USE_PIPEWIRE) target_sources( wivrn-server @@ -233,21 +230,15 @@ if (WIVRN_BUILD_SERVER) target_link_libraries(wivrn-server PUBLIC wivrn-server-dbus) target_link_libraries(wivrn-server PUBLIC PkgConfig::libnotify) - if(WIVRN_USE_SYSTEMD) - add_custom_command(OUTPUT systemd_manager.c systemd_manager.h - COMMAND ${GDBUS_CODEGEN} ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Manager.xml --interface-prefix org.freedesktop.systemd1 --generate-c-code systemd_manager --c-namespace systemd - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Manager.xml ) - add_custom_command(OUTPUT systemd_unit.c systemd_unit.h - COMMAND ${GDBUS_CODEGEN} ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Unit.xml --interface-prefix org.freedesktop.systemd1 --generate-c-code systemd_unit --c-namespace unit - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Manager.xml ) - target_sources(wivrn-server-dbus PRIVATE - ${CMAKE_CURRENT_BINARY_DIR}/systemd_manager.c ${CMAKE_CURRENT_BINARY_DIR}/systemd_manager.h - ${CMAKE_CURRENT_BINARY_DIR}/systemd_unit.c ${CMAKE_CURRENT_BINARY_DIR}/systemd_unit.h) - target_sources( - wivrn-server - PRIVATE start_systemd_unit.cpp - ) - endif() + add_custom_command(OUTPUT systemd_manager.c systemd_manager.h + COMMAND ${GDBUS_CODEGEN} ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Manager.xml --interface-prefix org.freedesktop.systemd1 --generate-c-code systemd_manager --c-namespace systemd + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Manager.xml ) + add_custom_command(OUTPUT systemd_unit.c systemd_unit.h + COMMAND ${GDBUS_CODEGEN} ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Unit.xml --interface-prefix org.freedesktop.systemd1 --generate-c-code systemd_unit --c-namespace unit + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/org.freedesktop.systemd1.Manager.xml ) + target_sources(wivrn-server-dbus PRIVATE + ${CMAKE_CURRENT_BINARY_DIR}/systemd_manager.c ${CMAKE_CURRENT_BINARY_DIR}/systemd_manager.h + ${CMAKE_CURRENT_BINARY_DIR}/systemd_unit.c ${CMAKE_CURRENT_BINARY_DIR}/systemd_unit.h) target_link_libraries( wivrn-server diff --git a/server/main.cpp b/server/main.cpp index be0cb03a..afc61ab7 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -1,3 +1,23 @@ +/* + * WiVRn VR streaming + * Copyright (C) 2022-2026 Guillaume Meunier + * Copyright (C) 2022-2026 Patrick Nicolas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Original copyright, from very old copy-pasted parts // Copyright 2022, Collabora, Ltd. // SPDX-License-Identifier: BSL-1.0 /*! @@ -9,7 +29,6 @@ #include "openxr/openxr.h" #include "sleep_inhibitor.h" #include "util/u_trace_marker.h" -#include "utils/wivrn_trace.h" #include "active_runtime.h" #include "avahi_publisher.h" @@ -19,6 +38,7 @@ #include "ipc_server_cb.h" #include "protocol_version.h" #include "start_application.h" +#include "start_systemd_unit.h" #include "utils/overloaded.h" #include "version.h" #include "wivrn_config.h" @@ -53,10 +73,6 @@ #include #include -#if WIVRN_USE_SYSTEMD -#include "start_systemd_unit.h" -#endif - // Insert the on load constructor to init trace marker. U_TRACE_TARGET_SETUP(U_TRACE_WHICH_SERVICE) @@ -819,13 +835,11 @@ void on_headset_info_packet(const wivrn::from_headset::headset_info_packet & inf void on_name_acquired(GDBusConnection * connection, const gchar * name, gpointer user_data) { -#if WIVRN_USE_SYSTEMD try { children = std::make_unique(connection, update_fsm); } catch (...) -#endif { children = std::make_unique(update_fsm); }