Skip to content
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
40 changes: 16 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ include(FeatureSummary)

# Options
option(BUILD_MAN_PAGES "Build man pages" OFF)
option(ENABLE_JOURNALD "Enable logging to journald" ON)
option(WERROR "Build with -Werror" OFF)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -32,6 +32,9 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH};${ECM_MODU

# Definitions
add_definitions(-Wall -Wextra)
if (WERROR)
add_definitions(-Werror)
endif()

# Default build type
if(NOT CMAKE_BUILD_TYPE)
Expand All @@ -56,21 +59,28 @@ if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
endif()

# PKG-CONFIG
find_package(PkgConfig)
find_package(PkgConfig REQUIRED)

# PAM
find_package(PAM REQUIRED)
pkg_search_module(Pam REQUIRED IMPORTED_TARGET pam)

# Systemd
pkg_check_modules(Systemd REQUIRED systemd)
pkg_search_module(Systemd REQUIRED IMPORTED_TARGET systemd)

# libsystemd
pkg_search_module(LibSystemd REQUIRED IMPORTED_TARGET libsystemd)

# XAU
pkg_check_modules(LIBXAU REQUIRED "xau")
pkg_search_module(LibXau REQUIRED IMPORTED_TARGET xau)

# Wayland client
pkg_search_module(WaylandClient REQUIRED IMPORTED_TARGET wayland-client)

# TreelandProtocols
find_package(TreelandProtocols 0.5.3 REQUIRED)

find_package(Qt6 CONFIG REQUIRED Core DBus Gui Qml Quick QuickControls2 LinguistTools Test QuickTest)
# Qt6
find_package(Qt6 CONFIG REQUIRED Core DBus Network)
qt_standard_project_setup(REQUIRES 6.6)

# Uninstall target
Expand All @@ -81,21 +91,6 @@ if ("${ECM_VERSION}" VERSION_LESS "1.7.0")
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
endif()

add_definitions(-DHAVE_SYSTEMD)
set(CMAKE_AUTOMOC_MOC_OPTIONS -DHAVE_SYSTEMD)

# libsystemd-journal was merged into libsystemd in 209
pkg_check_modules(JOURNALD "libsystemd")

if(ENABLE_JOURNALD)
if(JOURNALD_FOUND)
add_definitions(-DHAVE_JOURNALD)
set(CMAKE_AUTOMOC_MOC_OPTIONS -DHAVE_JOURNALD)
else()
message(WARNING "Disable journald support for lack of libsystemd-journal")
endif()
endif()

if (NOT DEFINED SYSTEMD_SYSTEM_UNIT_DIR)
pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR systemd systemdsystemunitdir)
endif()
Expand All @@ -111,16 +106,13 @@ endif()
set(HALT_COMMAND "/usr/bin/systemctl poweroff")
set(REBOOT_COMMAND "/usr/bin/systemctl reboot")

add_feature_info("journald" JOURNALD_FOUND "journald support")

set(RUNTIME_DIR_DEFAULT "/run/ddm")

# Set constants
set(DATA_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/ddm" CACHE PATH "System application data install directory")
set(DBUS_CONFIG_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/dbus-1/system.d" CACHE PATH "DBus config files directory")
set(STATE_DIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/ddm" CACHE PATH "State directory")
set(RUNTIME_DIR "${RUNTIME_DIR_DEFAULT}" CACHE PATH "Runtime data storage directory")
set(QML_INSTALL_DIR "${QT_IMPORTS_DIR}" CACHE PATH "QML component installation directory")

set(SESSION_COMMAND "${DATA_INSTALL_DIR}/scripts/Xsession" CACHE PATH "Script to execute when starting the X11 desktop session")
set(WAYLAND_SESSION_COMMAND "${DATA_INSTALL_DIR}/scripts/wayland-session" CACHE PATH "Script to execute when starting the Wayland desktop session")
Expand Down
75 changes: 0 additions & 75 deletions cmake/FindPAM.cmake

This file was deleted.

28 changes: 5 additions & 23 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@ Priority: optional
Maintainer: justforlxz <zhangdingyuan@deepin.org>
Build-Depends: debhelper-compat (= 13),
cmake (>= 3.4~),
pkg-config,
extra-cmake-modules (>= 1.4.0~),
libpam0g-dev,
libsystemd-dev [linux-any],
libwayland-dev,
libxau-dev,
pkg-config,
qt6-base-dev (>= 6.6.1~),
qt6-declarative-dev (>= 6.6.1~),
qt6-tools-dev,
qt6-tools-dev-tools (>= 6.6.1~),
qt6-wayland,
qt6-wayland-dev,
qt6-wayland-private-dev,
treeland-protocols,
systemd [linux-any],
treeland-protocols,
Standards-Version: 4.6.0
Section: libs
Homepage: https://github.com/linuxdeepin/ddm.git
Expand All @@ -29,22 +24,9 @@ Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends},
${misc:Depends},
qml6-module-qtquick,
qml6-module-qtquick-controls,
qml6-module-qtquick-layouts,
qml6-module-qtqml-workerscript,
qml6-module-qtquick-templates,
qml6-module-qtquick-particles,
qml6-module-qtquick-dialogs,
qml6-module-qtquick-window,
qml6-module-qt5compat-graphicaleffects,
qml6-module-qtquick-effects,
qml6-module-qt-labs-folderlistmodel,
adduser,
seatd,
qt6-wayland,
libqt6svg6,
Recommends: libpam-systemd, xwayland
treeland,
libpam-systemd,
Description: a modern display manager for Wayland sessions aiming to be fast, simple and beautiful.

Package: libddm
Expand Down
35 changes: 4 additions & 31 deletions debian/ddm.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,11 @@ set -e
THIS_PACKAGE=ddm
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager

# creating dde group if he isn't already there
if ! getent group dde >/dev/null; then
addgroup --system dde
fi

# creating dde user if he isn't already there
if ! getent passwd dde >/dev/null; then
adduser --system --ingroup dde --home /var/lib/ddm dde
usermod -c "Simple Wayland Display Manager" dde
usermod -d "/var/lib/ddm" dde
usermod -g "dde" dde
usermod -s "/bin/false" dde
fi

# ensure dde is in dde video render groups
# required for upgrading from v23
for group in dde video render; do
usermod -a -G $group dde
done
# creating dde user & group if he isn't already there
systemd-sysusers

if [ ! -e /var/lib/ddm ]; then
# If dde was purged while running, the home dir gets removed but the user
# remains (as deluser refuses to delete a user that's in use).
mkdir -p /var/lib/ddm
fi

if [ -d /var/lib/ddm ]; then
# There has been a -R in version prior to 0.19
# but this opens up symlink attacks. Remove it.
chown dde:dde /var/lib/ddm
chmod 0750 /var/lib/ddm
fi
# creating directories required
systemd-tmpfiles --create

# debconf is not a registry, so we only fiddle with the default file if it
# does not exist
Expand Down
4 changes: 0 additions & 4 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ include /usr/share/dpkg/architecture.mk

DDM_CMAKE_ARGS = -DDBUS_CONFIG_FILENAME="ddm_org.freedesktop.DisplayManager.conf"

ifneq ($(DEB_HOST_ARCH_OS),linux)
DDM_CMAKE_ARGS += -DNO_SYSTEMD=ON -DENABLE_JOURNALD=OFF
endif

%:
dh $@

Expand Down
6 changes: 1 addition & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,10 @@
shellHook =
let
makeQtpluginPath = pkgs.lib.makeSearchPathOutput "out" pkgs.qt6.qtbase.qtPluginPrefix;
makeQmlpluginPath = pkgs.lib.makeSearchPathOutput "out" pkgs.qt6.qtbase.qtQmlPrefix;
in
''
#export WAYLAND_DEBUG=1
export QT_PLUGIN_PATH=${makeQtpluginPath (with pkgs.qt6; [ qtbase qtdeclarative qtquick3d qtimageformats qtwayland qt5compat qtsvg ])}
export QML2_IMPORT_PATH=${makeQmlpluginPath (with pkgs.qt6; [ qtdeclarative qtquick3d qt5compat ]
++ [ dde-nixos.packages.${system}.qt6.dtkdeclarative ] )}
export QML_IMPORT_PATH=$QML2_IMPORT_PATH
export QT_PLUGIN_PATH=${makeQtpluginPath (with pkgs.qt6; [ qtbase ])}
'';
};
}
Expand Down
5 changes: 1 addition & 4 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
, qttools
, wrapQtAppsHook
, qtbase
, pixman
, pam
, libxcrypt
, treeland-protocols
Expand Down Expand Up @@ -51,7 +50,6 @@ stdenv.mkDerivation (finalAttrs: {

buildInputs = [
qtbase
pixman
pam
libxcrypt
treeland-protocols
Expand All @@ -72,9 +70,8 @@ stdenv.mkDerivation (finalAttrs: {

# we still want to run the DM on VT 7 for the time being, as 1-6 are
# occupied by getties by default
"-DSDDM_INITIAL_VT=7"
"-DDDM_INITIAL_VT=7"

"-DQT_IMPORTS_DIR=${placeholder "out"}/${qtbase.qtQmlPrefix}"
"-DCMAKE_INSTALL_SYSCONFDIR=${placeholder "out"}/etc"
"-DSYSTEMD_SYSTEM_UNIT_DIR=${placeholder "out"}/lib/systemd/system"
"-DSYSTEMD_SYSUSERS_DIR=${placeholder "out"}/lib/sysusers.d"
Expand Down
1 change: 1 addition & 0 deletions services/ddm.pam
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ password include system-login

session optional pam_keyinit.so force revoke
session include system-login
session required pam_systemd.so
-session optional pam_gnome_keyring.so auto_start
-session optional pam_kwallet5.so auto_start
1 change: 1 addition & 0 deletions services/debian.ddm.pam
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux
session optional pam_keyinit.so force revoke
session required pam_limits.so
session required pam_loginuid.so
session required pam_systemd.so
@include common-session
# SELinux needs to intervene at login time to ensure that the process starts
# in the proper default security context. Only sessions which are intended
Expand Down
4 changes: 0 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
if (QT_KNOWN_POLICY_QTP0001)
qt_policy(SET QTP0001 NEW)
endif()

add_subdirectory(common)
add_subdirectory(daemon)
7 changes: 3 additions & 4 deletions src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ set_target_properties(common PROPERTIES

target_link_libraries(common
PRIVATE
Qt${QT_MAJOR_VERSION}::DBus
Qt${QT_MAJOR_VERSION}::Network
Qt${QT_MAJOR_VERSION}::Qml
${LIBXAU_LINK_LIBRARIES}
Qt6::DBus
Qt6::Network
PkgConfig::LibXau
)

target_include_directories(common INTERFACE
Expand Down
1 change: 0 additions & 1 deletion src/common/Constants.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#define LIBEXEC_INSTALL_DIR "@CMAKE_INSTALL_FULL_LIBEXECDIR@"
#define DATA_INSTALL_DIR "@DATA_INSTALL_DIR@"
#define SYS_CONFIG_DIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@"
#define IMPORTS_INSTALL_DIR "@QML_INSTALL_DIR@"
#define COMPONENTS_TRANSLATION_DIR "@COMPONENTS_TRANSLATION_DIR@"
#define RUNTIME_DIR "@RUNTIME_DIR@"
#define STATE_DIR "@STATE_DIR@"
Expand Down
Loading