commit:     66972956956bc3944b4546b201eb13f009b4a1a0
Author:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  4 07:03:44 2023 +0000
Commit:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
CommitDate: Sat Feb  4 07:03:44 2023 +0000
URL:        https://gitweb.gentoo.org/repo/dev/tamiko.git/commit/?id=66972956

x11-misc/sddm: new package, add 9999

Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>

 x11-misc/sddm/files/pam-1.4-substack.patch         |  31 +++++
 .../files/sddm-0.18.1-respect-user-flags.patch     |  25 +++++
 x11-misc/sddm/files/sddm-0.19.0-Xsession.patch     |  24 ++++
 x11-misc/sddm/files/sddm.tmpfiles                  |   1 +
 x11-misc/sddm/metadata.xml                         |  24 ++++
 x11-misc/sddm/sddm-9999.ebuild                     | 125 +++++++++++++++++++++
 6 files changed, 230 insertions(+)

diff --git a/x11-misc/sddm/files/pam-1.4-substack.patch 
b/x11-misc/sddm/files/pam-1.4-substack.patch
new file mode 100644
index 0000000..b0467b2
--- /dev/null
+++ b/x11-misc/sddm/files/pam-1.4-substack.patch
@@ -0,0 +1,31 @@
+--- sddm-0.18.1/services/sddm-autologin.pam.bak        2020-06-19 
22:27:57.305580696 +0200
++++ sddm-0.18.1/services/sddm-autologin.pam    2020-06-19 22:30:50.513583973 
+0200
+@@ -1,6 +1,5 @@
+ #%PAM-1.0
+ auth        required    pam_env.so
+-auth        required    pam_tally.so file=/var/log/faillog onerr=succeed
+ auth        required    pam_shells.so
+ auth        required    pam_nologin.so
+ auth        required    pam_permit.so
+--- sddm-0.18.1/services/sddm.pam.bak  2020-06-19 22:27:26.721580117 +0200
++++ sddm-0.18.1/services/sddm.pam      2020-06-19 22:27:48.729580533 +0200
+@@ -1,15 +1,15 @@
+ #%PAM-1.0
+ 
+-auth          include         system-login
++auth          substack                system-login
+ -auth         optional        pam_gnome_keyring.so
+ -auth   optional  pam_kwallet5.so
+ 
+-account               include         system-login
++account               substack                system-login
+ 
+-password      include         system-login
++password      substack                system-login
+ -password     optional        pam_gnome_keyring.so use_authtok
+ 
+ session               optional        pam_keyinit.so force revoke
+-session               include         system-login
++session               substack                system-login
+ -session              optional        pam_gnome_keyring.so auto_start
+ -session  optional  pam_kwallet5.so auto_start
\ No newline at end of file

diff --git a/x11-misc/sddm/files/sddm-0.18.1-respect-user-flags.patch 
b/x11-misc/sddm/files/sddm-0.18.1-respect-user-flags.patch
new file mode 100644
index 0000000..6801fa7
--- /dev/null
+++ b/x11-misc/sddm/files/sddm-0.18.1-respect-user-flags.patch
@@ -0,0 +1,25 @@
+--- a/CMakeLists.txt   2020-10-12 13:03:39.000000000 +0200
++++ b/CMakeLists.txt   2020-10-12 23:40:04.480687143 +0200
+@@ -41,22 +41,6 @@
+ # Definitions
+ add_definitions(-Wall -std=c++11 -DQT_NO_CAST_FROM_ASCII 
-DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_FOREACH)
+ 
+-# Default build type
+-if(NOT CMAKE_BUILD_TYPE)
+-    set(CMAKE_BUILD_TYPE Release)
+-endif()
+-
+-# Handle build type
+-if(CMAKE_BUILD_TYPE MATCHES [Dd]ebug)
+-    message(STATUS "Debug build")
+-    add_definitions(-DDEBUG)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
+-else()
+-    message(STATUS "Release build")
+-    add_definitions(-DNDEBUG)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
+-endif()
+-
+ # Default absolute paths
+ if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR)
+     set(CMAKE_INSTALL_SYSCONFDIR "/etc")

diff --git a/x11-misc/sddm/files/sddm-0.19.0-Xsession.patch 
b/x11-misc/sddm/files/sddm-0.19.0-Xsession.patch
new file mode 100644
index 0000000..e1e3c15
--- /dev/null
+++ b/x11-misc/sddm/files/sddm-0.19.0-Xsession.patch
@@ -0,0 +1,24 @@
+--- a/data/scripts/Xsession
++++ b/data/scripts/Xsession
+@@ -50,6 +50,10 @@
+     ;;
+ esac
+ 
++# Make D-Bus start properly, see:
++# /etc/X11/xinit/xinitrc.d/80-dbus
++command="$@"
++
+ [ -f /etc/xprofile ] && . /etc/xprofile
+ [ -f $HOME/.xprofile ] && . $HOME/.xprofile
+ 
+@@ -94,8 +98,8 @@
+   . "$USERXSESSION"
+ fi
+ 
+-if [ -z "$*" ]; then
++if [ -z "$command" ]; then
+     exec xmessage -center -buttons OK:0 -default OK "Sorry, $DESKTOP_SESSION 
is no valid session."
+ else
+-    exec $@
++    exec $command
+ fi

diff --git a/x11-misc/sddm/files/sddm.tmpfiles 
b/x11-misc/sddm/files/sddm.tmpfiles
new file mode 100644
index 0000000..300d646
--- /dev/null
+++ b/x11-misc/sddm/files/sddm.tmpfiles
@@ -0,0 +1 @@
+d /var/lib/sddm 0755 sddm sddm

diff --git a/x11-misc/sddm/metadata.xml b/x11-misc/sddm/metadata.xml
new file mode 100644
index 0000000..7c58231
--- /dev/null
+++ b/x11-misc/sddm/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="project">
+               <email>l...@gentoo.org</email>
+               <name>LXQt</name>
+       </maintainer>
+       <maintainer type="project">
+               <email>k...@gentoo.org</email>
+               <name>Gentoo KDE Project</name>
+       </maintainer>
+       <use>
+               <flag name="elogind">Use <pkg>sys-auth/elogind</pkg> for 
session tracking.</flag>
+       </use>
+       <longdescription lang="en">
+               SDDM is a modern display manager for X11 aiming to be fast, 
simple
+               and beatiful. It uses modern technologies like QtQuick, which in
+               turn gives the designer the ability to create smooth, animated
+               user interfaces.
+       </longdescription>
+       <upstream>
+               <remote-id type="github">sddm/sddm</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git a/x11-misc/sddm/sddm-9999.ebuild b/x11-misc/sddm/sddm-9999.ebuild
new file mode 100644
index 0000000..18b7836
--- /dev/null
+++ b/x11-misc/sddm/sddm-9999.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+if [[ ${PV} == *9999* ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/${PN}/${PN}.git";
+else
+       
SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.gz";
+       KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+fi
+
+inherit cmake linux-info systemd tmpfiles
+
+DESCRIPTION="Simple Desktop Display Manager"
+HOMEPAGE="https://github.com/sddm/sddm";
+
+LICENSE="GPL-2+ MIT CC-BY-3.0 CC-BY-SA-3.0 public-domain"
+SLOT="0"
+IUSE="+elogind +pam systemd test"
+
+REQUIRED_USE="?? ( elogind systemd )"
+RESTRICT="!test? ( test )"
+
+COMMON_DEPEND="
+       acct-group/sddm
+       acct-user/sddm
+       dev-qt/qtcore:5
+       dev-qt/qtdbus:5
+       dev-qt/qtdeclarative:5
+       dev-qt/qtgui:5
+       dev-qt/qtnetwork:5
+       x11-base/xorg-server
+       x11-libs/libxcb
+       elogind? ( sys-auth/elogind )
+       pam? ( sys-libs/pam )
+       !pam? ( virtual/libcrypt:= )
+       systemd? ( sys-apps/systemd:= )
+       !systemd? ( sys-power/upower )
+"
+DEPEND="${COMMON_DEPEND}
+       test? ( dev-qt/qttest:5 )
+"
+RDEPEND="${COMMON_DEPEND}
+       !systemd? ( gui-libs/display-manager-init )
+"
+BDEPEND="
+       dev-python/docutils
+       dev-qt/linguist-tools:5
+       kde-frameworks/extra-cmake-modules:5
+       virtual/pkgconfig
+"
+
+PATCHES=(
+       # Downstream patches
+       "${FILESDIR}/${PN}-0.18.1-respect-user-flags.patch" # bug 563108
+       "${FILESDIR}/${PN}-0.19.0-Xsession.patch" # bug 611210
+)
+
+pkg_setup() {
+       local CONFIG_CHECK="~DRM"
+       use kernel_linux && linux-info_pkg_setup
+}
+
+src_prepare() {
+       cmake_src_prepare
+
+       if ! use test; then
+               sed -e "/^find_package/s/ Test//" -i CMakeLists.txt || die
+               cmake_comment_add_subdirectory test
+       fi
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DENABLE_PAM=$(usex pam)
+               -DNO_SYSTEMD=$(usex '!systemd')
+               -DUSE_ELOGIND=$(usex 'elogind')
+               -DBUILD_MAN_PAGES=ON
+               -DDBUS_CONFIG_FILENAME="org.freedesktop.sddm.conf"
+       )
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+
+       newtmpfiles "${FILESDIR}/${PN}.tmpfiles" "${PN}.conf"
+
+       # Create a default.conf as upstream dropped /etc/sddm.conf w/o 
replacement
+       local confd="/usr/lib/sddm/sddm.conf.d"
+       dodir ${confd}
+       "${D}"/usr/bin/sddm --example-config > "${D}/${confd}"/00default.conf \
+               || die "Failed to create 00default.conf"
+
+       sed -e "/^InputMethod/s/qtvirtualkeyboard//" \
+               -e "/^ReuseSession/s/false/true/" \
+               -e "/^EnableHiDPI/s/false/true/" \
+               -i "${D}/${confd}"/00default.conf || die
+}
+
+pkg_postinst() {
+       tmpfiles_process "${PN}.conf"
+
+       elog "Starting with 0.18.0, SDDM no longer installs /etc/sddm.conf"
+       elog "Use it to override specific options. SDDM defaults are now"
+       elog "found in: /usr/lib/sddm/sddm.conf.d/00default.conf"
+       elog
+       elog "NOTE: If SDDM startup appears to hang then entropy pool is too 
low."
+       elog "This can be fixed by configuring one of the following:"
+       elog "  - Enable CONFIG_RANDOM_TRUST_CPU in linux kernel"
+       elog "  - # emerge sys-apps/haveged && rc-update add haveged boot"
+       elog "  - # emerge sys-apps/rng-tools && rc-update add rngd boot"
+       elog
+       elog "For more information on how to configure SDDM, please visit the 
wiki:"
+       elog "  https://wiki.gentoo.org/wiki/SDDM";
+       if has_version x11-drivers/nvidia-drivers; then
+               elog
+               elog "  Nvidia GPU owners in particular should pay attention"
+               elog "  to the troubleshooting section."
+       fi
+
+       systemd_reenable sddm.service
+}

Reply via email to