x11-misc/mozo: Stabilize 1.22.2 for amd64,x86
[gentoo.git] / x11-misc / sddm / sddm-0.18.1-r1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PLOCALES="ar bn ca cs da de es et fi fr hi_IN hu is it ja kk ko lt lv nb nl nn pl pt_BR pt_PT ro ru sk sr sr@ijekavian sr@ijekavianlatin sr@latin sv tr uk zh_CN zh_TW"
7 inherit cmake l10n systemd user
8
9 DESCRIPTION="Simple Desktop Display Manager"
10 HOMEPAGE="https://github.com/sddm/sddm"
11 SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz"
12
13 LICENSE="GPL-2+ MIT CC-BY-3.0 CC-BY-SA-3.0 public-domain"
14 SLOT="0"
15 KEYWORDS="amd64 ~arm arm64 ~ppc64 x86"
16 IUSE="consolekit elogind +pam systemd test"
17 RESTRICT="!test? ( test )"
18
19 REQUIRED_USE="?? ( elogind systemd )"
20
21 BDEPEND="
22         dev-python/docutils
23         >=dev-qt/linguist-tools-5.9.4:5
24         kde-frameworks/extra-cmake-modules:5
25         virtual/pkgconfig
26 "
27 RDEPEND="
28         >=dev-qt/qtcore-5.9.4:5
29         >=dev-qt/qtdbus-5.9.4:5
30         >=dev-qt/qtdeclarative-5.9.4:5
31         >=dev-qt/qtgui-5.9.4:5
32         >=dev-qt/qtnetwork-5.9.4:5
33         >=x11-base/xorg-server-1.15.1
34         x11-libs/libxcb[xkb]
35         consolekit? ( >=sys-auth/consolekit-0.9.4 )
36         elogind? ( sys-auth/elogind )
37         pam? ( sys-libs/pam )
38         systemd? ( sys-apps/systemd:= )
39         !systemd? ( sys-power/upower )
40 "
41 DEPEND="${RDEPEND}
42         test? ( >=dev-qt/qttest-5.9.4:5 )
43 "
44
45 PATCHES=(
46         "${FILESDIR}/${PN}-0.12.0-respect-user-flags.patch"
47         "${FILESDIR}/${PN}-0.18.0-Xsession.patch" # bug 611210
48         "${FILESDIR}/${PN}-0.18.0-sddmconfdir.patch"
49         # fix for groups: https://github.com/sddm/sddm/issues/1159
50         "${FILESDIR}/${P}-revert-honor-PAM-supplemental-groups.patch"
51         "${FILESDIR}/${P}-honor-PAM-supplemental-groups-v2.patch"
52         # fix for ReuseSession=true
53         "${FILESDIR}/${P}-only-reuse-online-sessions.patch"
54         # TODO: fix properly
55         "${FILESDIR}/${PN}-0.16.0-ck2-revert.patch" # bug 633920
56 )
57
58 src_prepare() {
59         cmake_src_prepare
60
61         disable_locale() {
62                 sed -e "/${1}\.ts/d" -i data/translations/CMakeLists.txt || die
63         }
64         l10n_find_plocales_changes "data/translations" "" ".ts"
65         l10n_for_each_disabled_locale_do disable_locale
66
67         if ! use test; then
68                 sed -e "/^find_package/s/ Test//" -i CMakeLists.txt || die
69                 cmake_comment_add_subdirectory test
70         fi
71 }
72
73 src_configure() {
74         local mycmakeargs=(
75                 -DENABLE_PAM=$(usex pam)
76                 -DNO_SYSTEMD=$(usex '!systemd')
77                 -DUSE_ELOGIND=$(usex 'elogind')
78                 -DBUILD_MAN_PAGES=ON
79                 -DDBUS_CONFIG_FILENAME="org.freedesktop.sddm.conf"
80         )
81         cmake_src_configure
82 }
83
84 src_install() {
85         cmake_src_install
86
87         # Create a default.conf as upstream dropped /etc/sddm.conf w/o replacement
88         local confd="/usr/share/sddm/sddm.conf.d"
89         dodir ${confd}
90         "${D}"/usr/bin/sddm --example-config > "${D}/${confd}"/00default.conf \
91                 || die "Failed to create 00default.conf"
92
93         sed -e "/^InputMethod/s/qtvirtualkeyboard//" \
94                 -e "/^ReuseSession/s/false/true/" \
95                 -e "/^EnableHiDPI/s/false/true/" \
96                 -i "${D}/${confd}"/00default.conf || die
97 }
98
99 pkg_postinst() {
100         elog "Starting with 0.18.0, SDDM no longer installs /etc/sddm.conf"
101         elog "Use it to override specific options. SDDM defaults are now"
102         elog "found in: /usr/share/sddm/sddm.conf.d/00default.conf"
103
104         enewgroup ${PN}
105         enewuser ${PN} -1 -1 /var/lib/${PN} ${PN},video
106
107         systemd_reenable sddm.service
108 }