commit sddm for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package sddm for openSUSE:Factory checked in at 2023-09-29 21:12:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sddm (Old) and /work/SRC/openSUSE:Factory/.sddm.new.28202 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "sddm" Fri Sep 29 21:12:28 2023 rev:66 rq:1112525 version:0.20.0 Changes: -------- --- /work/SRC/openSUSE:Factory/sddm/sddm.changes 2023-07-01 23:17:21.506011120 +0200 +++ /work/SRC/openSUSE:Factory/.sddm.new.28202/sddm.changes 2023-09-29 21:12:36.671664696 +0200 @@ -1,0 +2,30 @@ +Wed Sep 20 06:34:37 UTC 2023 - Fabian Vogt <fabian@ritter-vogt.de> + +- Remove unnecessary Requires(post*) + +------------------------------------------------------------------- +Tue Sep 19 17:04:26 UTC 2023 - Fabian Vogt <fabian@ritter-vogt.de> + +- Config file changes: + * No longer own sddm.conf. The migration for this conflicts with + the other migration code, so: + * Drop code for migrating from Current=maui (Leap <= 42.2) + and the monolithic /etc/sddm.conf (Leap <= 42.3) + +------------------------------------------------------------------- +Thu Sep 14 16:50:58 UTC 2023 - Fabian Vogt <fabian@ritter-vogt.de> + +- Add patch and drop unnecessary BuildRequirements of + extra-cmake-modules and kf5-filesystem: + * 0001-Drop-unnecessary-ECM-dependency-and-dead-uninstall-t.patch +- Split the greeter into a subpackage and use _multibuild to build + both daemon and greeter for Qt 5 and Qt 6. Add patches to allow + for greeter coinstallation: + * 0002-Make-sddm-greeter-for-Qt-5-and-Qt-6-coinstallable.patch + * 0003-Let-themes-specify-the-used-version-of-Qt.patch +- Refresh 0001-Read-the-DISPLAYMANAGER_AUTOLOGIN-value-from-sysconf.patch +- Don't set CMAKE_BUILD_TYPE=Release +- Make branding packages noarch +- Add %check + +------------------------------------------------------------------- New: ---- 0001-Drop-unnecessary-ECM-dependency-and-dead-uninstall-t.patch 0002-Make-sddm-greeter-for-Qt-5-and-Qt-6-coinstallable.patch 0003-Let-themes-specify-the-used-version-of-Qt.patch _multibuild ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sddm.spec ++++++ --- /var/tmp/diff_new_pack.cda3KZ/_old 2023-09-29 21:12:38.859743642 +0200 +++ /var/tmp/diff_new_pack.cda3KZ/_new 2023-09-29 21:12:38.859743642 +0200 @@ -16,15 +16,38 @@ # +# Packaging for Qt 5 and Qt 6 flavors: +# The daemon using Qt 5 can use sddm-greeter-qt6 and vice versa, +# the only restriction is that the Qt X daemon defaults to run sddm-greeter-qtX +# so that should be treated as a hard requirement. The default flavor builds +# daemon and greeter with Qt 5 while the qt6 flavor builds both with Qt 6: +# sddm builds sddm, sddm-greeter-qt5, sddm-branding-{upstream,openSUSE} +# sddm:qt6 builds sddm-qt6, sddm-greeter-qt6, sddm-qt6-branding-upstream +# There is a PR pending (#1790) to build both greeters in one go, but here we +# build them separately to allow separation with _multibuild flavors. + +%if "@BUILD_FLAVOR@" == "qt6" +%global qt6 1 +%global qtver 6 +%else +%global qt6 0 +%global qtver 5 +%endif + +# The .spec file name has to match the first Name: +%if !%qt6 Name: sddm +%else +Name: sddm-qt6 +%endif Version: 0.20.0 Release: 0 -Summary: QML-based display manager +Summary: QML-based display manager (Qt%{qtver}) License: GPL-2.0-or-later Group: System/GUI/KDE URL: https://github.com/sddm/sddm -Source: https://github.com/sddm/sddm/archive/v%{version}/%{name}-%{version}.tar.gz -Source1: X11-displaymanagers-%{name} +Source: https://github.com/sddm/sddm/archive/v%{version}/sddm-%{version}.tar.gz +Source1: X11-displaymanagers-sddm # Distro configs Source10: 00-general.conf Source11: 10-theme.conf @@ -41,6 +64,11 @@ # https://github.com/sddm/sddm/pull/1753 Patch1: 0001-greeter-Look-at-WAYLAND_DISPLAY-for-platform-detecti.patch Patch2: 0002-Ignore-InputMethod-qtvirtualkeyboard-on-wayland.patch +# https://github.com/sddm/sddm/pull/1792 +Patch3: 0001-Drop-unnecessary-ECM-dependency-and-dead-uninstall-t.patch +# https://github.com/sddm/sddm/pull/1789 +Patch4: 0002-Make-sddm-greeter-for-Qt-5-and-Qt-6-coinstallable.patch +Patch5: 0003-Let-themes-specify-the-used-version-of-Qt.patch # Patch100-?: PATCH-FIX-OPENSUSE Patch101: 0001-Write-the-daemon-s-PID-to-a-file-on-startup.patch Patch102: 0001-Set-XAUTHLOCALHOSTNAME-in-sessions.patch @@ -50,74 +78,110 @@ Patch104: sddm-service-handle-plymouth.patch Patch107: 0003-Leave-duplicate-symlinks-out-of-the-SessionModel.patch BuildRequires: cmake -BuildRequires: extra-cmake-modules >= 1.4.0 BuildRequires: fdupes -BuildRequires: kf5-filesystem -BuildRequires: libqt5-linguist-devel +%if 0%{?suse_version} <= 1500 +BuildRequires: gcc10-PIE +BuildRequires: gcc10-c++ +%endif BuildRequires: pam-devel BuildRequires: pkgconfig # Autodetect UID_MIN and UID_MAX from /etc/login.defs BuildRequires: shadow BuildRequires: python3-docutils BuildRequires: sysuser-tools -BuildRequires: pkgconfig(Qt5Core) >= 5.15.0 -BuildRequires: pkgconfig(Qt5DBus) -BuildRequires: pkgconfig(Qt5Network) -BuildRequires: pkgconfig(Qt5Quick) -BuildRequires: pkgconfig(Qt5Test) +%if %qt6 +BuildRequires: cmake(Qt6Core) +BuildRequires: cmake(Qt6DBus) +BuildRequires: cmake(Qt6LinguistTools) +BuildRequires: cmake(Qt6Network) +BuildRequires: cmake(Qt6Quick) +BuildRequires: cmake(Qt6QuickTest) +BuildRequires: cmake(Qt6Test) +%else +BuildRequires: cmake(Qt5Core) >= 5.15.0 +BuildRequires: cmake(Qt5DBus) +BuildRequires: cmake(Qt5LinguistTools) +BuildRequires: cmake(Qt5Network) +BuildRequires: cmake(Qt5Quick) +BuildRequires: cmake(Qt5QuickTest) +BuildRequires: cmake(Qt5Test) +%endif BuildRequires: pkgconfig(libsystemd) BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(xcb-xkb) %systemd_requires %sysusers_requires BuildRequires: update-alternatives -Requires(post): update-alternatives -Requires(postun):update-alternatives -Requires(post): diffutils Requires(post): %{_sbindir}/update-alternatives Requires(postun):%{_sbindir}/update-alternatives -Requires: sddm-branding = %{version} +Requires: %{name}-branding = %{version} +Requires: sddm-greeter-qt%{qtver} = %{version} Requires: xdm +%if %qt6 +Provides: sddm = %{version} +# Most themes use Qt 5, just always provide support for now. +Requires: sddm-greeter-qt5 +Conflicts: sddm +%else +Provides: sddm-qt5 = %{version} # Merged the -lang package back into the main package -Provides: %{name}-lang = %{version} -Obsoletes: %{name}-lang < %{version} +Provides: sddm-lang = %{version} +Obsoletes: sddm-lang < %{version} +%endif %description SDDM is a display manager for X11 and Wayland. It uses technologies like QtQuick, which gives the designer the ability to create animated user interfaces. +%package -n sddm-greeter-qt%{qtver} +Summary: SDDM Greeter for Qt%{qtver} themes +Group: System/GUI/KDE +Requires: sddm = %{version} + +%description -n sddm-greeter-qt%{qtver} +This package provides the SDDM frontend for themes using Qt %qtver. + %package branding-openSUSE -Summary: openSUSE branding for SDDM +Summary: openSUSE branding for SDDM (Qt%{qtver}) Group: System/GUI/KDE +BuildArch: noarch Requires: %{name} = %{version} Requires: sddm-theme-openSUSE +%if %qt6 +# Make installcheck happy: There needs to be a direct conflict, +# not just via sddm-qt6-branding-foo -> sddm-qt6 <-> sddm-branding-foo -> sddm +Conflicts: sddm-branding +%else # See 11-kwin_wayland.conf Requires: kwin5 >= 5.26.90 -Requires(post): %{name} -Requires(post): diffutils Supplements: (plasma5-workspace and branding-openSUSE) -Conflicts: sddm-branding -Provides: sddm-branding = %{version} +%endif +Conflicts: %{name}-branding +Provides: %{name}-branding = %{version} %description branding-openSUSE This package provides the openSUSE branding for SDDM. %package branding-upstream -Summary: Upstream branding for SDDM +Summary: Upstream branding for SDDM (Qt%{qtver}) Group: System/GUI/KDE +BuildArch: noarch Requires: %{name} = %{version} -Requires(post): %{name} -Requires(post): diffutils Supplements: (%{name} and branding-upstream) +%if %qt6 +# Make installcheck happy: There needs to be a direct conflict, +# not just via sddm-qt6-branding-foo -> sddm-qt6 <-> sddm-branding-foo -> sddm Conflicts: sddm-branding -Provides: sddm-branding = %{version} +%endif +Conflicts: %{name}-branding +Provides: %{name}-branding = %{version} %description branding-upstream This package provides upstream branding for SDDM. %prep -%autosetup -p1 +%autosetup -p1 -n sddm-%{version} %build LOGIN_DEFS_PATH="%{_sysconfdir}/login.defs" @@ -125,9 +189,8 @@ # SDDM_INITIAL_VT does not work for X: https://github.com/sddm/sddm/issues/1650 %cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_LIBEXECDIR="%{_libexecdir}/%{name}" \ - -DIMPORTS_INSTALL_DIR="%{_libdir}/qt5/qml" \ + -DBUILD_WITH_QT6:BOOL=%{qt6} \ + -DCMAKE_INSTALL_LIBEXECDIR="%{_libexecdir}/sddm" \ -DSESSION_COMMAND="%{_sysconfdir}/X11/xdm/Xsession" \ -DBUILD_MAN_PAGES=ON \ -DSTATE_DIR="%{_localstatedir}/lib/sddm" \ @@ -135,25 +198,28 @@ -DRUNTIME_DIR="/run/sddm" \ -DPID_FILE="/run/sddm.pid" \ -DLOGIN_DEFS_PATH:path="${LOGIN_DEFS_PATH}" \ - %make_jobs +%if 0%{?suse_version} <= 1500 + -DCMAKE_C_COMPILER:STRING=gcc-10 \ + -DCMAKE_CXX_COMPILER:STRING=g++-10 \ +%endif -%install - %kf5_makeinstall -C build + %cmake_build - # We don't want the example config. - # However, we need to package the file so it does not end up being removed. - echo > %{buildroot}%{_sysconfdir}/sddm.conf +%install + %cmake_install pushd %{buildroot}%{_datadir}/dbus-1/system.d mv org.freedesktop.DisplayManager.conf sddm_org.freedesktop.DisplayManager.conf popd - install -Dm 0644 %{SOURCE1} %{buildroot}%{_prefix}/lib/X11/displaymanagers/%{name} + install -Dm 0644 %{SOURCE1} %{buildroot}%{_prefix}/lib/X11/displaymanagers/sddm install -Dm 0644 %{SOURCE10} %{buildroot}%{_prefix}/lib/sddm/sddm.conf.d/00-general.conf # Adjust paths to X session scripts in 00-general.conf sed -e 's-/usr/etc-%{?_distconfdir}%{!?_distconfdir:%{_sysconfdir}}-g' -i %{buildroot}%{_prefix}/lib/sddm/sddm.conf.d/00-general.conf + %if !%qt6 install -Dm 0644 %{SOURCE11} %{buildroot}%{_prefix}/lib/sddm/sddm.conf.d/10-theme.conf install -Dm 0644 %{SOURCE12} %{buildroot}%{_prefix}/lib/sddm/sddm.conf.d/11-kwin_wayland.conf + %endif # Install PAM config rm -r %{buildroot}%{_sysconfdir}/pam.d # Remove sddm's config, for debian only @@ -182,6 +248,9 @@ %fdupes %{buildroot}%{_datadir}/sddm +%check + %ctest + %pre -f sddm.pre %service_add_pre sddm.service %if 0%{?suse_version} > 1500 @@ -190,37 +259,36 @@ test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||: done %endif +# Previous versions owned /etc/sddm.conf, on upgrade it will be moved to .rpmsave if it was changed +# on disk. To keep the user configuration intact, it has to be moved back in posttrans. +# This also works for switching between sddm and sddm-qt6 in one transaction. +# However, if both /etc/sddm.conf and /etc/sddm.conf.rpmsave exist already, there are special cases: +# 1. /etc/sddm.conf was not changed on disk. It will be deleted instead of renamed to .rpmsave. +# The posttrans script would rename the *old* .rpmsave file, restoring some ancient config. +# 2. /etc/sddm.conf was changed. The old .rpmsave file will be overwritten. +# Avoid this by moving any preexisting .rpmsave to .rpmsave.old. There is no rename back though, +# to prevent that every upgrade of the package renames it back and forth... +if [ -f %{_sysconfdir}/sddm.conf.rpmsave ]; then + mv -v %{_sysconfdir}/sddm.conf.rpmsave %{_sysconfdir}/sddm.conf.rpmsave.old +fi %post %service_add_post sddm.service %{_bindir}/systemd-tmpfiles --create %{_tmpfilesdir}/sddm.conf -if [ $1 -eq 2 -a -f %{_sysconfdir}/sddm.conf ]; then - # Avoid changing sddm.conf's timestamp if no modifications done - tempconf="$(mktemp)" - - # SDDM 0.14.0 moved maui into the built-in resources - # SDDM <= 0.15.0 had no system config dir, so we need to remove the - # moved configuration options from the old single config file - sed -e 's/^Current=maui$/Current=/g' \ - -e '\#^DisplayCommand=%{_sysconfdir}/X11/xdm/Xsetup#d' \ - -e '\#^MinimumVT=7$#d' \ - -e '\#^ServerPath=%{_bindir}/X$#d' \ - -e '\#^SessionCommand=%{_sysconfdir}/X11/xdm/Xsession$#d' \ - %{_sysconfdir}/sddm.conf > "${tempconf}" - - cmp -s "${tempconf}" "%{_sysconfdir}/sddm.conf" || cp "${tempconf}" "%{_sysconfdir}/sddm.conf" - rm "${tempconf}" -fi %{_sbindir}/update-alternatives --install %{_prefix}/lib/X11/displaymanagers/default-displaymanager \ default-displaymanager %{_prefix}/lib/X11/displaymanagers/sddm 25 -%if 0%{?suse_version} > 1500 %posttrans +%if 0%{?suse_version} > 1500 # Migration to /usr/lib/pam.d/, restore just created .rpmsave for i in pam.d/sddm pam.d/sddm-autologin pam.d/sddm-greeter; do [ -f %{_sysconfdir}/${i}.rpmsave ] && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} || : done %endif +# See the pre script above +if [ -f %{_sysconfdir}/sddm.conf.rpmsave ] && ! [ -f %{_sysconfdir}/sddm.conf ]; then + mv %{_sysconfdir}/sddm.conf.rpmsave %{_sysconfdir}/sddm.conf +fi %preun %service_del_preun sddm.service @@ -235,42 +303,9 @@ [ -f %{_prefix}/lib/X11/displaymanagers/sddm ] || %{_sbindir}/update-alternatives \ --remove default-displaymanager %{_prefix}/lib/X11/displaymanagers/sddm -%post branding-upstream -if [ $1 -eq 2 -a -f %{_sysconfdir}/sddm.conf ]; then - # Avoid changing sddm.conf's timestamp if no modifications done - tempconf="$(mktemp)" - - # SDDM <= 0.15.0 had no system config dir, so we need to remove the - # theme configuration from the old single config file - sed -e '/^Current=$/d' %{_sysconfdir}/sddm.conf > "${tempconf}" - - cmp -s "${tempconf}" "%{_sysconfdir}/sddm.conf" || cp "${tempconf}" "%{_sysconfdir}/sddm.conf" - rm "${tempconf}" -fi -: - -%post branding-openSUSE -if [ $1 -eq 2 -a -f %{_sysconfdir}/sddm.conf ]; then - # Avoid changing sddm.conf's timestamp if no modifications done - tempconf="$(mktemp)" - - # Upgrade from previous theme name - # SDDM <= 0.15.0 had no system config dir, so we need to remove the - # theme configuration from the old single config file - sed -e 's/^Current=breeze$/Current=breeze-openSUSE/g' \ - -e 's/^Current=maui$/Current=breeze-openSUSE/g' \ - -e '/^Current=breeze-openSUSE$/d' \ - -e '/^CursorTheme=breeze_cursors$/d' %{_sysconfdir}/sddm.conf > "${tempconf}" - - cmp -s "${tempconf}" "%{_sysconfdir}/sddm.conf" || cp "${tempconf}" "%{_sysconfdir}/sddm.conf" - rm "${tempconf}" -fi -: - %files %license LICENSE* %doc README* -%config(noreplace) %{_sysconfdir}/sddm.conf %dir %{_sysconfdir}/sddm.conf.d/ %if 0%{?suse_version} > 1500 %{_pam_vendordir}/sddm @@ -283,13 +318,11 @@ %endif %{_datadir}/dbus-1/system.d/sddm_org.freedesktop.DisplayManager.conf %dir %{_prefix}/lib/X11/displaymanagers/ -%{_prefix}/lib/X11/displaymanagers/%{name} +%{_prefix}/lib/X11/displaymanagers/sddm %{_prefix}/lib/X11/displaymanagers/default-displaymanager %ghost %{_sysconfdir}/alternatives/default-displaymanager %{_bindir}/sddm -%{_bindir}/sddm-greeter %{_sbindir}/rcsddm -%{_libdir}/qt5/qml/ %dir %{_datadir}/sddm/ %dir %{_prefix}/lib/sddm/ %dir %{_prefix}/lib/sddm/sddm.conf.d/ @@ -302,7 +335,6 @@ %{_datadir}/sddm/flags/ %{_datadir}/sddm/scripts/ %{_datadir}/sddm/themes/ -%{_datadir}/sddm/translations/ %ghost %attr(711,root,root) %dir %{_rundir}/sddm %ghost %attr(750,sddm,sddm) %dir %{_localstatedir}/lib/sddm %{_mandir}/man*/sddm*%{ext_man} @@ -310,11 +342,23 @@ %{_sysusersdir}/sddm.conf %{_tmpfilesdir}/sddm.conf +%files -n sddm-greeter-qt%{qtver} +%if %qtver == 5 +%{_bindir}/sddm-greeter +%else +%{_bindir}/sddm-greeter-qt%{qtver} +%endif +%{_libdir}/qt%{qtver}/qml/ +%{_datadir}/sddm/translations-qt%{qtver}/ + +# No openSUSE branding for Qt 6 yet +%if !%qt6 %files branding-openSUSE %license LICENSE* %doc README* %{_prefix}/lib/sddm/sddm.conf.d/10-theme.conf %{_prefix}/lib/sddm/sddm.conf.d/11-kwin_wayland.conf +%endif %files branding-upstream %license LICENSE* ++++++ 0001-Drop-unnecessary-ECM-dependency-and-dead-uninstall-t.patch ++++++ From f0e1b77d3e652c35dcbbcb23e9ca95faad32db92 Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fabian@ritter-vogt.de> Date: Thu, 14 Sep 2023 18:09:34 +0200 Subject: [PATCH 1/3] Drop unnecessary ECM dependency and dead uninstall target ECM was added by 6ef91b0b because of some potential dependency needed for Wayland, which was not added until now. The commit also changed the "uninstall" target to not be created if ECM >= 1.7.0. ECM itself doesn't register an uninstall target automatically either, which means this is dead code. Just remove it. --- CMakeLists.txt | 12 +----------- cmake/cmake_uninstall.cmake.in | 22 ---------------------- 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 cmake/cmake_uninstall.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 44956e5..e333839 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,9 +23,7 @@ option(BUILD_WITH_QT6 "Build with Qt 6" OFF) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -# ECM -find_package(ECM 1.4.0 REQUIRED NO_MODULE) -set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH};${ECM_MODULE_PATH}") +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}") # Definitions add_definitions(-Wall -Wextra -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_FOREACH) @@ -92,14 +90,6 @@ if(NOT QT_IMPORTS_DIR) execute_process(COMMAND ${QMAKE_EXECUTABLE} -query QT_INSTALL_QML OUTPUT_VARIABLE QT_IMPORTS_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) endif() -# Uninstall target -if ("${ECM_VERSION}" VERSION_LESS "1.7.0") - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY) - add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") -endif() - # systemd if(NOT NO_SYSTEMD AND NOT USE_ELOGIND) pkg_check_modules(SYSTEMD "systemd") diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in deleted file mode 100644 index c6d8094..0000000 --- a/cmake/cmake_uninstall.cmake.in +++ /dev/null @@ -1,22 +0,0 @@ -if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") -endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - -file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) -string(REGEX REPLACE "\n" ";" files "${files}") -list(REVERSE files) -foreach (file ${files}) - message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") - if (EXISTS "$ENV{DESTDIR}${file}") - execute_process( - COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}" - OUTPUT_VARIABLE rm_out - RESULT_VARIABLE rm_retval - ) - if(NOT ${rm_retval} EQUAL 0) - message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") - endif (NOT ${rm_retval} EQUAL 0) - else (EXISTS "$ENV{DESTDIR}${file}") - message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") - endif (EXISTS "$ENV{DESTDIR}${file}") -endforeach(file) -- 2.42.0 ++++++ 0001-Read-the-DISPLAYMANAGER_AUTOLOGIN-value-from-sysconf.patch ++++++ --- /var/tmp/diff_new_pack.cda3KZ/_old 2023-09-29 21:12:38.895744941 +0200 +++ /var/tmp/diff_new_pack.cda3KZ/_new 2023-09-29 21:12:38.895744941 +0200 @@ -1,4 +1,4 @@ -From 0374d7dd1432714c03c91a3ce6e21b87ba46175d Mon Sep 17 00:00:00 2001 +From 5cc1a99fadce25298124cde0be8be9bab25c87cc Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan <hrvoje.senjan@gmail.com> Date: Sat, 2 Sep 2017 11:27:01 +0200 Subject: [PATCH] Read the DISPLAYMANAGER_AUTOLOGIN value from @@ -16,19 +16,19 @@ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4f5c92e..7ab509c 100644 +index 3107c7a..10839b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -194,6 +194,7 @@ set(CONFIG_FILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sddm.conf" +@@ -183,6 +183,7 @@ set(CONFIG_FILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sddm.conf" set(CONFIG_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sddm.conf.d" CACHE PATH "Path of the sddm config directory") set(ACCOUNTSSERVICE_DATA_DIR "/var/lib/AccountsService" CACHE PATH "Path of the accountsservice data directory") set(SYSTEM_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib/sddm/sddm.conf.d" CACHE PATH "Path of the system sddm config directory") +set(DISPLAY_MANAGER_CONFIG_FILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sysconfig/displaymanager" CACHE PATH "Path of the sysconfig/displaymanager config file") set(LOG_FILE "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/sddm.log" CACHE PATH "Path of the sddm log file") set(DBUS_CONFIG_FILENAME "org.freedesktop.DisplayManager.conf" CACHE STRING "Name of the sddm config file") - set(COMPONENTS_TRANSLATION_DIR "${DATA_INSTALL_DIR}/translations" CACHE PATH "Components translations directory") + set(COMPONENTS_TRANSLATION_DIR "${DATA_INSTALL_DIR}/translations-qt${QT_MAJOR_VERSION}" CACHE PATH "Components translations directory") diff --git a/src/common/Configuration.h b/src/common/Configuration.h -index b8f317a..d54fca6 100644 +index 54bcace..484fae1 100644 --- a/src/common/Configuration.h +++ b/src/common/Configuration.h @@ -101,14 +101,15 @@ namespace SDDM { @@ -62,7 +62,7 @@ #define LOG_FILE "@LOG_FILE@" #define PID_FILE "@PID_FILE@" diff --git a/src/daemon/Display.cpp b/src/daemon/Display.cpp -index 1b019df..276cb37 100644 +index a9c80dc..6c5a968 100644 --- a/src/daemon/Display.cpp +++ b/src/daemon/Display.cpp @@ -35,6 +35,7 @@ @@ -73,7 +73,7 @@ #include <pwd.h> #include <unistd.h> -@@ -240,6 +241,11 @@ namespace SDDM { +@@ -272,6 +273,11 @@ namespace SDDM { // log message qDebug() << "Display server started."; @@ -86,6 +86,6 @@ !mainConfig.Autologin.User.get().isEmpty()) { // reset first flag -- -2.40.0 +2.42.0 ++++++ 0002-Make-sddm-greeter-for-Qt-5-and-Qt-6-coinstallable.patch ++++++ From 4043f1c81851d15213082c93ccc5256a2ccbda8f Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fabian@ritter-vogt.de> Date: Sat, 9 Sep 2023 15:30:35 +0200 Subject: [PATCH 2/3] Make sddm-greeter for Qt 5 and Qt 6 coinstallable When not building for Qt 5, give the sddm-greeter binary a Qt version suffix. Also version the translation directory. --- CMakeLists.txt | 2 +- src/greeter/CMakeLists.txt | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e333839..3107c7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,7 +185,7 @@ set(ACCOUNTSSERVICE_DATA_DIR "/var/lib/AccountsService" set(SYSTEM_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib/sddm/sddm.conf.d" CACHE PATH "Path of the system sddm config directory") set(LOG_FILE "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/sddm.log" CACHE PATH "Path of the sddm log file") set(DBUS_CONFIG_FILENAME "org.freedesktop.DisplayManager.conf" CACHE STRING "Name of the sddm config file") -set(COMPONENTS_TRANSLATION_DIR "${DATA_INSTALL_DIR}/translations" CACHE PATH "Components translations directory") +set(COMPONENTS_TRANSLATION_DIR "${DATA_INSTALL_DIR}/translations-qt${QT_MAJOR_VERSION}" CACHE PATH "Components translations directory") set(SDDM_INITIAL_VT "1" CACHE STRING "Initial tty to use") diff --git a/src/greeter/CMakeLists.txt b/src/greeter/CMakeLists.txt index 7718afc..72769e4 100644 --- a/src/greeter/CMakeLists.txt +++ b/src/greeter/CMakeLists.txt @@ -1,3 +1,14 @@ +if(QT_MAJOR_VERSION EQUAL "5") + # Keep the unversioned name for Qt5. When upgrading SDDM, the old daemon + # might still be running and only know about "sddm-greeter". Keeping the + # previous name around also helps users calling it directly. + set(GREETER_TARGET sddm-greeter) +else() + set(GREETER_TARGET sddm-greeter-qt${QT_MAJOR_VERSION}) +endif() + +message(STATUS "Building greeter for Qt ${QT_MAJOR_VERSION} as ${GREETER_TARGET}") + include_directories( "${CMAKE_SOURCE_DIR}/src/common" "${CMAKE_BINARY_DIR}/src/common" @@ -28,18 +39,17 @@ configure_file("theme.qrc" "theme.qrc") qt_add_resources(RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/theme.qrc) -add_executable(sddm-greeter ${GREETER_SOURCES} ${RESOURCES}) -target_link_libraries(sddm-greeter +add_executable(${GREETER_TARGET} ${GREETER_SOURCES} ${RESOURCES}) +target_link_libraries(${GREETER_TARGET} Qt${QT_MAJOR_VERSION}::Quick ${LIBXCB_LIBRARIES} ${LIBXKB_LIBRARIES}) if(JOURNALD_FOUND) - target_link_libraries(sddm-greeter ${JOURNALD_LIBRARIES}) + target_link_libraries(${GREETER_TARGET} ${JOURNALD_LIBRARIES}) endif() # Translations -add_dependencies(sddm-greeter components-translation) -add_dependencies(sddm-greeter themes-translation) +add_dependencies(${GREETER_TARGET} components-translation themes-translation) -install(TARGETS sddm-greeter DESTINATION "${CMAKE_INSTALL_BINDIR}") +install(TARGETS ${GREETER_TARGET} DESTINATION "${CMAKE_INSTALL_BINDIR}") -- 2.42.0 ++++++ 0003-Let-themes-specify-the-used-version-of-Qt.patch ++++++ From 957c6c01f517654bab23a18ded533bbe639bfd57 Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fabian@ritter-vogt.de> Date: Sat, 9 Sep 2023 16:21:26 +0200 Subject: [PATCH 3/3] Let themes specify the used version of Qt metadata.desktop in the theme directory has a new key "QtVersion" which defaults to 5. If it's not 5, sddm-greeter-qt${QtVersion} will be used to show the theme. --- src/common/ThemeMetadata.cpp | 6 ++++++ src/common/ThemeMetadata.h | 1 + src/daemon/Greeter.cpp | 20 +++++++++++++++++--- src/daemon/Greeter.h | 1 + 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/common/ThemeMetadata.cpp b/src/common/ThemeMetadata.cpp index 3bae0ff..2cb3762 100644 --- a/src/common/ThemeMetadata.cpp +++ b/src/common/ThemeMetadata.cpp @@ -28,6 +28,7 @@ namespace SDDM { QString mainScript { QStringLiteral("Main.qml") }; QString configFile; QString translationsDirectory { QStringLiteral(".") }; + int qtVersion = 5; }; ThemeMetadata::ThemeMetadata(const QString &path, QObject *parent) : QObject(parent), d(new ThemeMetadataPrivate()) { @@ -50,11 +51,16 @@ namespace SDDM { return d->translationsDirectory; } + int ThemeMetadata::qtVersion() const { + return d->qtVersion; + } + void ThemeMetadata::setTo(const QString &path) { QSettings settings(path, QSettings::IniFormat); // read values d->mainScript = settings.value(QStringLiteral("SddmGreeterTheme/MainScript"), QStringLiteral("Main.qml")).toString(); d->configFile = settings.value(QStringLiteral("SddmGreeterTheme/ConfigFile"), QStringLiteral("theme.conf")).toString(); d->translationsDirectory = settings.value(QStringLiteral("SddmGreeterTheme/TranslationsDirectory"), QStringLiteral(".")).toString(); + d->qtVersion = settings.value(QStringLiteral("SddmGreeterTheme/QtVersion"), 5).toInt(); } } diff --git a/src/common/ThemeMetadata.h b/src/common/ThemeMetadata.h index 0612337..fdb89a9 100644 --- a/src/common/ThemeMetadata.h +++ b/src/common/ThemeMetadata.h @@ -36,6 +36,7 @@ namespace SDDM { const QString &mainScript() const; const QString &configFile() const; const QString &translationsDirectory() const; + int qtVersion() const; void setTo(const QString &path); diff --git a/src/daemon/Greeter.cpp b/src/daemon/Greeter.cpp index c0437ae..4974bb5 100644 --- a/src/daemon/Greeter.cpp +++ b/src/daemon/Greeter.cpp @@ -80,11 +80,26 @@ namespace SDDM { m_displayServerCmd = cmd; } + QString Greeter::greeterPathForQt(int qtVersion) + { + const QString suffix = qtVersion == 5 ? QString() : QStringLiteral("-qt%1").arg(qtVersion); + return QStringLiteral(BIN_INSTALL_DIR "/sddm-greeter%1").arg(suffix); + } + bool Greeter::start() { // check flag if (m_started) return false; + // If no theme is given, use the default theme of the default greeter version + const int themeQtVersion = m_themePath.isEmpty() ? (QT_VERSION >> 16) : m_metadata->qtVersion(); + QString greeterPath = greeterPathForQt(themeQtVersion); + if (!QFileInfo(greeterPath).isExecutable()) { + qWarning() << "The theme at" << m_themePath << "requires missing" << greeterPath << ". Using fallback theme."; + setTheme(QString()); + greeterPath = greeterPathForQt(QT_VERSION >> 16); + } + // themes QString xcursorTheme = mainConfig.Theme.CursorTheme.get(); if (m_themeConfig->contains(QLatin1String("cursorTheme"))) @@ -139,7 +154,7 @@ namespace SDDM { m_process->setProcessEnvironment(env); } // Greeter command - m_process->start(QStringLiteral("%1/sddm-greeter").arg(QStringLiteral(BIN_INSTALL_DIR)), args); + m_process->start(greeterPath, args); //if we fail to start bail immediately, and don't block in waitForStarted if (m_process->state() == QProcess::NotRunning) { @@ -173,8 +188,7 @@ namespace SDDM { // command QStringList cmd; - cmd << QStringLiteral("%1/sddm-greeter").arg(QStringLiteral(BIN_INSTALL_DIR)) - << args; + cmd << greeterPath << args; // greeter environment QProcessEnvironment env; diff --git a/src/daemon/Greeter.h b/src/daemon/Greeter.h index d25eb07..8cc996d 100644 --- a/src/daemon/Greeter.h +++ b/src/daemon/Greeter.h @@ -79,6 +79,7 @@ namespace SDDM { QProcess *m_process { nullptr }; static void insertEnvironmentList(QStringList names, QProcessEnvironment sourceEnv, QProcessEnvironment &targetEnv); + static QString greeterPathForQt(int qtVersion); }; } -- 2.42.0 ++++++ _multibuild ++++++ <multibuild> <flavor>qt6</flavor> </multibuild>
participants (1)
-
Source-Sync