|
Line 0
Link Here
|
| 0 |
- |
1 |
# Copyright 1999-2023 Gentoo Authors |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
|
| 4 |
EAPI=8 |
| 5 |
|
| 6 |
inherit cmake linux-info systemd tmpfiles |
| 7 |
|
| 8 |
DESCRIPTION="Simple Desktop Display Manager" |
| 9 |
HOMEPAGE="https://github.com/sddm/sddm" |
| 10 |
SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz" |
| 11 |
|
| 12 |
LICENSE="GPL-2+ MIT CC-BY-3.0 CC-BY-SA-3.0 public-domain" |
| 13 |
SLOT="0" |
| 14 |
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86" |
| 15 |
IUSE="+elogind +pam systemd test" |
| 16 |
|
| 17 |
REQUIRED_USE="?? ( elogind systemd )" |
| 18 |
RESTRICT="!test? ( test )" |
| 19 |
|
| 20 |
COMMON_DEPEND=" |
| 21 |
acct-group/sddm |
| 22 |
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 |
| 29 |
x11-libs/libxcb:= |
| 30 |
elogind? ( sys-auth/elogind ) |
| 31 |
pam? ( sys-libs/pam ) |
| 32 |
!pam? ( virtual/libcrypt:= ) |
| 33 |
systemd? ( sys-apps/systemd:= ) |
| 34 |
!systemd? ( sys-power/upower ) |
| 35 |
" |
| 36 |
DEPEND="${COMMON_DEPEND} |
| 37 |
test? ( dev-qt/qttest:5 ) |
| 38 |
" |
| 39 |
RDEPEND="${COMMON_DEPEND} |
| 40 |
!systemd? ( gui-libs/display-manager-init ) |
| 41 |
" |
| 42 |
BDEPEND=" |
| 43 |
dev-python/docutils |
| 44 |
dev-qt/linguist-tools:5 |
| 45 |
kde-frameworks/extra-cmake-modules:5 |
| 46 |
virtual/pkgconfig |
| 47 |
" |
| 48 |
|
| 49 |
PATCHES=( |
| 50 |
"${FILESDIR}/${PN}-0.18.1-qt-5.15.2.patch" |
| 51 |
) |
| 52 |
|
| 53 |
pkg_setup() { |
| 54 |
local CONFIG_CHECK="~DRM" |
| 55 |
use kernel_linux && linux-info_pkg_setup |
| 56 |
} |
| 57 |
|
| 58 |
src_prepare() { |
| 59 |
cmake_src_prepare |
| 60 |
|
| 61 |
if ! use test; then |
| 62 |
sed -e "/^find_package/s/ Test//" -i CMakeLists.txt || die |
| 63 |
cmake_comment_add_subdirectory test |
| 64 |
fi |
| 65 |
} |
| 66 |
|
| 67 |
src_configure() { |
| 68 |
local mycmakeargs=( |
| 69 |
-DENABLE_PAM=$(usex pam) |
| 70 |
-DNO_SYSTEMD=$(usex '!systemd') |
| 71 |
-DUSE_ELOGIND=$(usex 'elogind') |
| 72 |
-DBUILD_MAN_PAGES=ON |
| 73 |
-DDBUS_CONFIG_FILENAME="org.freedesktop.sddm.conf" |
| 74 |
) |
| 75 |
cmake_src_configure |
| 76 |
} |
| 77 |
|
| 78 |
src_install() { |
| 79 |
cmake_src_install |
| 80 |
|
| 81 |
newtmpfiles "${FILESDIR}/${PN}.tmpfiles" "${PN}.conf" |
| 82 |
|
| 83 |
# Create a default.conf as upstream dropped /etc/sddm.conf w/o replacement |
| 84 |
local confd="/usr/share/sddm/sddm.conf.d" |
| 85 |
dodir ${confd} |
| 86 |
"${D}"/usr/bin/sddm --example-config > "${D}/${confd}"/00default.conf \ |
| 87 |
|| die "Failed to create 00default.conf" |
| 88 |
|
| 89 |
sed -e "/^InputMethod/s/qtvirtualkeyboard//" \ |
| 90 |
-e "/^ReuseSession/s/false/true/" \ |
| 91 |
-e "/^EnableHiDPI/s/false/true/" \ |
| 92 |
-i "${D}/${confd}"/00default.conf || die |
| 93 |
} |
| 94 |
|
| 95 |
pkg_postinst() { |
| 96 |
tmpfiles_process "${PN}.conf" |
| 97 |
|
| 98 |
elog "Starting with 0.18.0, SDDM no longer installs /etc/sddm.conf" |
| 99 |
elog "Use it to override specific options. SDDM defaults are now" |
| 100 |
elog "found in: /usr/share/sddm/sddm.conf.d/00default.conf" |
| 101 |
elog |
| 102 |
elog "NOTE: If SDDM startup appears to hang then entropy pool is too low." |
| 103 |
elog "This can be fixed by configuring one of the following:" |
| 104 |
elog " - Enable CONFIG_RANDOM_TRUST_CPU in linux kernel" |
| 105 |
elog " - # emerge sys-apps/haveged && rc-update add haveged boot" |
| 106 |
elog " - # emerge sys-apps/rng-tools && rc-update add rngd boot" |
| 107 |
elog |
| 108 |
elog "For more information on how to configure SDDM, please visit the wiki:" |
| 109 |
elog " https://wiki.gentoo.org/wiki/SDDM" |
| 110 |
if has_version x11-drivers/nvidia-drivers; then |
| 111 |
elog |
| 112 |
elog " Nvidia GPU owners in particular should pay attention" |
| 113 |
elog " to the troubleshooting section." |
| 114 |
fi |
| 115 |
|
| 116 |
systemd_reenable sddm.service |
| 117 |
} |