1 |
|
# Copyright 1999-2022 Gentoo Authors
|
|
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
inherit cmake linux-info systemd tmpfiles
|
|
6 |
if [[ ${PV} == *9999* ]]; then
|
|
7 |
inherit git-r3
|
|
8 |
EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
|
|
9 |
else
|
|
10 |
SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
|
|
11 |
KEYWORDS="amd64 ~arm arm64 ~loong ~ppc64 ~riscv x86"
|
|
12 |
fi
|
|
13 |
|
|
14 |
QTMIN=5.15.2
|
|
15 |
inherit cmake linux-info optfeature systemd tmpfiles
|
7 |
16 |
|
8 |
17 |
DESCRIPTION="Simple Desktop Display Manager"
|
9 |
18 |
HOMEPAGE="https://github.com/sddm/sddm"
|
10 |
|
SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz"
|
11 |
19 |
|
12 |
20 |
LICENSE="GPL-2+ MIT CC-BY-3.0 CC-BY-SA-3.0 public-domain"
|
13 |
21 |
SLOT="0"
|
14 |
|
KEYWORDS="amd64 ~arm arm64 ~loong ~ppc64 ~riscv x86"
|
15 |
|
IUSE="+elogind +pam systemd test"
|
|
22 |
IUSE="+elogind systemd test"
|
16 |
23 |
|
17 |
|
REQUIRED_USE="?? ( elogind systemd )"
|
|
24 |
REQUIRED_USE="^^ ( elogind systemd )"
|
18 |
25 |
RESTRICT="!test? ( test )"
|
19 |
26 |
|
20 |
27 |
COMMON_DEPEND="
|
21 |
28 |
acct-group/sddm
|
22 |
29 |
acct-user/sddm
|
23 |
|
dev-qt/qtcore:5
|
24 |
|
dev-qt/qtdbus:5
|
25 |
|
dev-qt/qtdeclarative:5
|
26 |
|
dev-qt/qtgui:5
|
27 |
|
dev-qt/qtnetwork:5
|
28 |
|
x11-base/xorg-server
|
|
30 |
>=dev-qt/qtcore-${QTMIN}:5
|
|
31 |
>=dev-qt/qtdbus-${QTMIN}:5
|
|
32 |
>=dev-qt/qtdeclarative-${QTMIN}:5
|
|
33 |
>=dev-qt/qtgui-${QTMIN}:5
|
|
34 |
>=dev-qt/qtnetwork-${QTMIN}:5
|
|
35 |
sys-libs/pam
|
|
36 |
x11-libs/libXau
|
29 |
37 |
x11-libs/libxcb:=
|
30 |
|
elogind? ( sys-auth/elogind )
|
31 |
|
pam? ( sys-libs/pam )
|
32 |
|
!pam? ( virtual/libcrypt:= )
|
33 |
|
systemd? ( sys-apps/systemd:= )
|
|
38 |
elogind? ( sys-auth/elogind[pam] )
|
|
39 |
systemd? ( sys-apps/systemd:=[pam] )
|
34 |
40 |
!systemd? ( sys-power/upower )
|
35 |
41 |
"
|
36 |
42 |
DEPEND="${COMMON_DEPEND}
|
37 |
|
test? ( dev-qt/qttest:5 )
|
|
43 |
test? ( >=dev-qt/qttest-${QTMIN}:5 )
|
38 |
44 |
"
|
39 |
45 |
RDEPEND="${COMMON_DEPEND}
|
|
46 |
x11-base/xorg-server
|
40 |
47 |
!systemd? ( gui-libs/display-manager-init )
|
41 |
48 |
"
|
42 |
49 |
BDEPEND="
|
43 |
50 |
dev-python/docutils
|
44 |
|
dev-qt/linguist-tools:5
|
|
51 |
>=dev-qt/linguist-tools-${QTMIN}:5
|
45 |
52 |
kde-frameworks/extra-cmake-modules:5
|
46 |
53 |
virtual/pkgconfig
|
47 |
54 |
"
|
48 |
55 |
|
49 |
56 |
PATCHES=(
|
|
57 |
# Downstream patches
|
50 |
58 |
"${FILESDIR}/${P}-respect-user-flags.patch"
|
51 |
|
"${FILESDIR}/${P}-Xsession.patch" # bug 611210
|
52 |
|
"${FILESDIR}/${PN}-0.18.0-sddmconfdir.patch"
|
53 |
|
# fix for groups: https://github.com/sddm/sddm/issues/1159
|
54 |
|
"${FILESDIR}/${P}-revert-honor-PAM-supplemental-groups.patch"
|
55 |
|
"${FILESDIR}/${P}-honor-PAM-supplemental-groups-v2.patch"
|
56 |
|
# fix for ReuseSession=true
|
57 |
|
"${FILESDIR}/${P}-only-reuse-online-sessions.patch"
|
58 |
|
# TODO: fix properly
|
59 |
|
"${FILESDIR}/pam-1.4-substack.patch"
|
60 |
|
# upstream git develop branch:
|
61 |
|
"${FILESDIR}/${P}-qt-5.15.2.patch"
|
62 |
|
"${FILESDIR}/${P}-cve-2020-28049.patch" # bug 753104
|
63 |
|
"${FILESDIR}/${P}-nvidia-glitches-vt-switch.patch"
|
64 |
|
"${FILESDIR}/${P}-drop-wayland-suffix.patch"
|
65 |
|
"${FILESDIR}/${P}-fix-qt-5.15.7.patch" # KDE-bug 458865
|
|
59 |
"${FILESDIR}/${PN}-0.18.1-Xsession.patch" # bug 611210
|
|
60 |
"${FILESDIR}/${P}-sddm.pam-use-substack.patch" # bug 728550
|
|
61 |
"${FILESDIR}/${P}-disable-etc-debian-check.patch"
|
|
62 |
"${FILESDIR}/${P}-no-default-pam_systemd-module.patch" # bug 669980
|
|
63 |
# git master
|
|
64 |
"${FILESDIR}/${P}-fix-use-development-sessions.patch"
|
|
65 |
"${FILESDIR}/${P}-greeter-platform-detection.patch"
|
|
66 |
"${FILESDIR}/${P}-no-qtvirtualkeyboard-on-wayland.patch"
|
|
67 |
"${FILESDIR}/${P}-dbus-policy-in-usr.patch"
|
66 |
68 |
)
|
67 |
69 |
|
68 |
70 |
pkg_setup() {
|
... | ... | |
71 |
73 |
}
|
72 |
74 |
|
73 |
75 |
src_prepare() {
|
|
76 |
touch 01gentoo.conf || die
|
|
77 |
|
|
78 |
cat <<-EOF >> 01gentoo.conf
|
|
79 |
[General]
|
|
80 |
# Remove qtvirtualkeyboard as InputMethod default
|
|
81 |
InputMethod=
|
|
82 |
EOF
|
|
83 |
|
74 |
84 |
cmake_src_prepare
|
75 |
85 |
|
76 |
86 |
if ! use test; then
|
... | ... | |
81 |
91 |
|
82 |
92 |
src_configure() {
|
83 |
93 |
local mycmakeargs=(
|
84 |
|
-DENABLE_PAM=$(usex pam)
|
85 |
|
-DNO_SYSTEMD=$(usex '!systemd')
|
86 |
|
-DUSE_ELOGIND=$(usex 'elogind')
|
87 |
94 |
-DBUILD_MAN_PAGES=ON
|
88 |
95 |
-DDBUS_CONFIG_FILENAME="org.freedesktop.sddm.conf"
|
|
96 |
-DRUNTIME_DIR=/run/sddm
|
|
97 |
-DSYSTEMD_TMPFILES_DIR="/usr/lib/tmpfiles.d"
|
|
98 |
-DNO_SYSTEMD=$(usex !systemd)
|
|
99 |
-DUSE_ELOGIND=$(usex elogind)
|
89 |
100 |
)
|
90 |
101 |
cmake_src_configure
|
91 |
102 |
}
|
... | ... | |
93 |
104 |
src_install() {
|
94 |
105 |
cmake_src_install
|
95 |
106 |
|
96 |
|
newtmpfiles "${FILESDIR}/${PN}.tmpfiles" "${PN}.conf"
|
97 |
|
|
98 |
|
# Create a default.conf as upstream dropped /etc/sddm.conf w/o replacement
|
99 |
|
local confd="/usr/share/sddm/sddm.conf.d"
|
100 |
|
dodir ${confd}
|
101 |
|
"${D}"/usr/bin/sddm --example-config > "${D}/${confd}"/00default.conf \
|
102 |
|
|| die "Failed to create 00default.conf"
|
103 |
|
|
104 |
|
sed -e "/^InputMethod/s/qtvirtualkeyboard//" \
|
105 |
|
-e "/^ReuseSession/s/false/true/" \
|
106 |
|
-e "/^EnableHiDPI/s/false/true/" \
|
107 |
|
-i "${D}/${confd}"/00default.conf || die
|
|
107 |
insinto /etc/sddm.conf.d/
|
|
108 |
doins "${S}"/01gentoo.conf
|
108 |
109 |
}
|
109 |
110 |
|
110 |
111 |
pkg_postinst() {
|
111 |
112 |
tmpfiles_process "${PN}.conf"
|
112 |
113 |
|
113 |
|
elog "Starting with 0.18.0, SDDM no longer installs /etc/sddm.conf"
|
114 |
|
elog "Use it to override specific options. SDDM defaults are now"
|
115 |
|
elog "found in: /usr/share/sddm/sddm.conf.d/00default.conf"
|
116 |
|
elog
|
117 |
114 |
elog "NOTE: If SDDM startup appears to hang then entropy pool is too low."
|
118 |
115 |
elog "This can be fixed by configuring one of the following:"
|
119 |
116 |
elog " - Enable CONFIG_RANDOM_TRUST_CPU in linux kernel"
|
120 |
117 |
elog " - # emerge sys-apps/haveged && rc-update add haveged boot"
|
121 |
118 |
elog " - # emerge sys-apps/rng-tools && rc-update add rngd boot"
|
122 |
119 |
elog
|
|
120 |
elog "SDDM example config can be shown with:"
|
|
121 |
elog " ${EROOT}/usr/bin/sddm --example-config"
|
|
122 |
elog "Use ${EROOT}/etc/sddm.conf.d/ directory to override specific options."
|
|
123 |
elog
|
123 |
124 |
elog "For more information on how to configure SDDM, please visit the wiki:"
|
124 |
125 |
elog " https://wiki.gentoo.org/wiki/SDDM"
|
125 |
126 |
if has_version x11-drivers/nvidia-drivers; then
|
... | ... | |
128 |
129 |
elog " to the troubleshooting section."
|
129 |
130 |
fi
|
130 |
131 |
|
|
132 |
optfeature "Weston DisplayServer support (EXPERIMENTAL)" dev-libs/weston
|
|
133 |
optfeature "KWin DisplayServer support (EXPERIMENTAL)" kde-plasma/kwin
|
|
134 |
|
131 |
135 |
systemd_reenable sddm.service
|
132 |
136 |
}
|