Skip to content

Commit

Permalink
Add sddm from qt overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
FireBurn committed Mar 19, 2024
1 parent 4f12530 commit d5e85d0
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 0 deletions.
1 change: 1 addition & 0 deletions x11-misc/sddm/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST sddm-0.21.0-pam.tar.xz 676 BLAKE2B 06a79f74a5833eca9877df4be8639311382d13061b21aa3627e6c4b07725878ded62221fca943440bacc143f6be2a23b2e0a2124012ff2c9fac82e1eded11144 SHA512 6d91eef2434346f7707122454522cf19f104994ac95d562417f6060a92b4e6c9792bebcccabac8290479200b4ba02fc4d92c6098c435c7ceda796d619d8913c2
25 changes: 25 additions & 0 deletions x11-misc/sddm/files/sddm-0.20.0-respect-user-flags.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From f03f4c977b8038559c4f26e0e10cec4a3167c00c Mon Sep 17 00:00:00 2001
From: Lorenzo Porta <vindex17@outlook.it>
Date: Wed, 23 Sep 2015 23:34:38 2015 +0100
Subject: Respect user flags

---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b883a5e..77cd263 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,7 +39,7 @@ if(CMAKE_BUILD_TYPE MATCHES [Dd]ebug)
message(STATUS "Debug build")
add_definitions(-DDEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
-else()
+elseif(CMAKE_BUILD_TYPE MATCHES Release)
message(STATUS "Release build")
add_definitions(-DNDEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
--
2.43.0

41 changes: 41 additions & 0 deletions x11-misc/sddm/files/sddm-0.21.0-Xsession.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From dac9752495d1467d11e30450989194177677f30a Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sat, 21 Oct 2017 14:44:59 2017 +0200
Subject: [PATCH 2/5] Xsession

Thanks-to: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Bug: https://bugs.gentoo.org/611210

---
data/scripts/Xsession | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/data/scripts/Xsession b/data/scripts/Xsession
index a971d40..2d84a5a 100755
--- a/data/scripts/Xsession
+++ b/data/scripts/Xsession
@@ -39,6 +39,10 @@ case $SHELL in
;;
esac

+# Make D-Bus start properly, see:
+# /etc/X11/xinit/xinitrc.d/80-dbus
+command="$@"
+
[ -f /etc/xprofile ] && . /etc/xprofile
[ -f /usr/local/etc/xprofile ] && . /usr/local/etc/xprofile
[ -f $HOME/.xprofile ] && . $HOME/.xprofile
@@ -87,8 +91,8 @@ if [ -f "$USERXSESSION" ]; then
. "$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
--
2.43.0

5 changes: 5 additions & 0 deletions x11-misc/sddm/files/sddm.logrotate
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/var/log/sddm.log {
missingok
notifempty
copytruncate
}
21 changes: 21 additions & 0 deletions x11-misc/sddm/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>lxqt@gentoo.org</email>
<name>LXQt</name>
</maintainer>
<maintainer type="project">
<email>kde@gentoo.org</email>
<name>Gentoo KDE Project</name>
</maintainer>
<longdescription lang="en">
SDDM is a modern display manager aiming to be fast, simple
and beautiful. It uses modern technologies like QtQuick, which
gives the designer the ability to create smooth, animated UIs.
</longdescription>
<upstream>
<remote-id type="github">sddm/sddm</remote-id>
<remote-id type="cpe">cpe:/a:sddm_project:sddm</remote-id>
</upstream>
</pkgmetadata>
160 changes: 160 additions & 0 deletions x11-misc/sddm/sddm-9999.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PAM_TAR="${PN}-0.21.0-pam"
if [[ ${PV} == *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
else
SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
fi

QTMIN=6.6.2
inherit cmake linux-info pam systemd tmpfiles

DESCRIPTION="Simple Desktop Display Manager"
HOMEPAGE="https://github.com/sddm/sddm"
SRC_URI+=" https://dev.gentoo.org/~asturm/distfiles/${PAM_TAR}.tar.xz"

LICENSE="GPL-2+ MIT CC-BY-3.0 CC-BY-SA-3.0 public-domain"
SLOT="0"
IUSE="+elogind +qt5 systemd test +X"

REQUIRED_USE="^^ ( elogind systemd )"
RESTRICT="!test? ( test )"

COMMON_DEPEND="
acct-group/sddm
acct-user/sddm
sys-libs/pam
x11-libs/libXau
x11-libs/libxcb:=
elogind? ( sys-auth/elogind[pam] )
qt5? (
>=dev-qt/qtcore-5.15.12:5
>=dev-qt/qtdbus-5.15.12:5
>=dev-qt/qtdeclarative-5.15.12:5
>=dev-qt/qtgui-5.15.12:5
>=dev-qt/qtnetwork-5.15.12:5
)
!qt5? (
>=dev-qt/qtbase-${QTMIN}:6[dbus,gui,network]
>=dev-qt/qtdeclarative-${QTMIN}:6
)
systemd? ( sys-apps/systemd:=[pam] )
!systemd? ( sys-power/upower )
"
DEPEND="${COMMON_DEPEND}
test? (
qt5? ( >=dev-qt/qttest-5.15.12:5 )
!qt5? ( >=dev-qt/qtbase-${QTMIN}:6[network,test] )
)
"
RDEPEND="${COMMON_DEPEND}
X? ( x11-base/xorg-server )
!systemd? ( gui-libs/display-manager-init )
"
BDEPEND="
dev-python/docutils
>=dev-build/cmake-3.25.0
qt5? ( >=dev-qt/linguist-tools-5.15.12:5 )
!qt5? ( >=dev-qt/qttools-${QTMIN}[linguist] )
kde-frameworks/extra-cmake-modules:0
virtual/pkgconfig
"

PATCHES=(
# Downstream patches
"${FILESDIR}/${PN}-0.20.0-respect-user-flags.patch"
"${FILESDIR}/${PN}-0.21.0-Xsession.patch" # bug 611210
)

pkg_setup() {
local CONFIG_CHECK="~DRM"
use kernel_linux && linux-info_pkg_setup
}

src_unpack() {
[[ ${PV} == *9999* ]] && git-r3_src_unpack
default
}

src_prepare() {
touch 01gentoo.conf || die

cat <<-EOF >> 01gentoo.conf
[General]
# Remove qtvirtualkeyboard as InputMethod default
InputMethod=
EOF

cmake_src_prepare

if ! use test; then
sed -e "/^find_package/s/ Test//" -i CMakeLists.txt || die
cmake_comment_add_subdirectory test
fi

if use systemd; then
sed -e "/pam_elogind.so/s/elogind/systemd/" \
-i "${WORKDIR}"/${PAM_TAR}/${PN}-greeter.pam || die
fi
}

src_configure() {
local mycmakeargs=(
-DBUILD_MAN_PAGES=ON
-DBUILD_WITH_QT6=$(usex !qt5)
-DDBUS_CONFIG_FILENAME="org.freedesktop.sddm.conf"
-DRUNTIME_DIR=/run/sddm
-DSYSTEMD_TMPFILES_DIR="/usr/lib/tmpfiles.d"
-DNO_SYSTEMD=$(usex !systemd)
-DUSE_ELOGIND=$(usex elogind)
)
cmake_src_configure
}

src_install() {
cmake_src_install

insinto /etc/sddm.conf.d/
doins "${S}"/01gentoo.conf

# with systemd logs are sent to journald, so no point to bother in that case
if ! use systemd; then
insinto /etc/logrotate.d
newins "${FILESDIR}/sddm.logrotate" sddm
fi

newpamd "${WORKDIR}"/${PAM_TAR}/${PN}.pam ${PN}
newpamd "${WORKDIR}"/${PAM_TAR}/${PN}-autologin.pam ${PN}-autologin
newpamd "${WORKDIR}"/${PAM_TAR}/${PN}-greeter.pam ${PN}-greeter
}

pkg_postinst() {
tmpfiles_process "${PN}.conf"

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 "SDDM example config can be shown with:"
elog " ${EROOT}/usr/bin/sddm --example-config"
elog "Use ${EROOT}/etc/sddm.conf.d/ directory to override specific options."
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
}

0 comments on commit d5e85d0

Please sign in to comment.