1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 GNOME2_EAUTORECONF="yes"
8 inherit eutils gnome2 pam readme.gentoo-r1 systemd udev user
10 DESCRIPTION="GNOME Display Manager for managing graphical display servers and user logins"
11 HOMEPAGE="https://wiki.gnome.org/Projects/GDM"
14 branding? ( https://www.mail-archive.com/tango-artists@lists.freedesktop.org/msg00043/tango-gentoo-v1.1.tar.gz )
19 branding? ( CC-BY-SA-4.0 )
24 IUSE="accessibility audit bluetooth-sound branding elogind fprint +introspection ipv6 plymouth selinux smartcard systemd tcpd test wayland xinerama"
25 RESTRICT="!test? ( test )"
26 REQUIRED_USE="^^ ( elogind systemd )"
28 KEYWORDS="amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 x86"
30 # NOTE: x11-base/xorg-server dep is for X_SERVER_PATH etc, bug #295686
31 # nspr used by smartcard extension
32 # dconf, dbus and g-s-d are needed at install time for dconf update
33 # We need either systemd or >=openrc-0.12 to restart gdm properly, bug #463784
36 >=dev-libs/glib-2.44:2
38 >=x11-libs/gtk+-2.91.1:3
39 >=gnome-base/dconf-0.20
40 >=gnome-base/gnome-settings-daemon-3.1.4
41 gnome-base/gsettings-desktop-schemas
42 >=media-libs/fontconfig-2.5.0:1.0
43 >=media-libs/libcanberra-0.4[gtk3]
45 >=sys-apps/accountsservice-0.6.35
53 >=x11-misc/xdg-utils-1.0.2-r3
56 elogind? ( >=sys-auth/elogind-239.3[pam] )
57 systemd? ( >=sys-apps/systemd-186:0=[pam] )
59 sys-auth/pambase[elogind?,systemd?]
61 audit? ( sys-process/audit )
62 introspection? ( >=dev-libs/gobject-introspection-0.9.12:= )
63 plymouth? ( sys-boot/plymouth )
64 selinux? ( sys-libs/libselinux )
65 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
66 xinerama? ( x11-libs/libXinerama )
68 # XXX: These deps are from session and desktop files in data/ directory
69 # fprintd is used via dbus by gdm-fingerprint-extension
70 # gnome-session-3.6 needed to avoid freezing with orca
71 RDEPEND="${COMMON_DEPEND}
72 >=gnome-base/gnome-session-3.6
73 >=gnome-base/gnome-shell-3.1.90
77 >=app-accessibility/orca-3.10
78 gnome-extra/mousetweaks )
83 !gnome-extra/fast-user-switch-applet
85 DEPEND="${COMMON_DEPEND}
86 app-text/docbook-xml-dtd:4.1.2
87 dev-util/gdbus-codegen
90 >=sys-devel/gettext-0.19.8
93 test? ( >=dev-libs/check-0.9.4 )
95 " # yelp-tools needed for eautoreconf to not lose help docs (m4_ifdeffed YELP_HELP_INIT call and setup)
98 To make GDM start at boot with systemd, run:\n
99 # systemctl enable gdm.service\n
101 To make GDM start at boot with OpenRC, edit /etc/conf.d to have
102 DISPLAYMANAGER=\"gdm\" and enable the xdm service:\n
105 For passwordless login to unlock your keyring, you need to install
106 sys-auth/pambase with USE=gnome-keyring and set an empty password
107 on your keyring. Use app-crypt/seahorse for that.\n
109 You may need to install app-crypt/coolkey and sys-auth/pam_pkcs11
110 for smartcard support
115 enewgroup video # Just in case it hasn't been created yet
116 enewuser gdm -1 -1 /var/lib/gdm gdm,video
118 # For compatibility with certain versions of nvidia-drivers, etc., need to
119 # ensure that gdm user is in the video group
120 if ! egetent group video | grep -q gdm; then
121 # FIXME XXX: is this at all portable, ldap-safe, etc.?
122 # XXX: egetent does not have a 1-argument form, so we can't use it to
123 # get the list of gdm's groups
124 local g=$(groups gdm)
125 elog "Adding user gdm to video group"
126 usermod -G video,${g// /,} gdm || die "Adding user gdm to video group failed"
131 # ssh-agent handling must be done at xinitrc.d, bug #220603
132 eapply "${FILESDIR}/${PN}-2.32.0-xinitrc-ssh-agent.patch"
134 # Gentoo does not have a fingerprint-auth pam stack
135 eapply "${FILESDIR}/${PN}-3.8.4-fingerprint-auth.patch"
137 # Support pam_elogind.so in gdm-launch-environment.pam
138 eapply "${FILESDIR}/pam-elogind.patch"
140 # Wait 10 seconds for a DRM master with systemd. Workaround for gdm not waiting for CanGraphical=yes property on the seat. Bug #613222
141 eapply "${FILESDIR}/gdm-CanGraphical-wait.patch" # needs eautoreconf
143 # Show logo when branding is enabled
144 use branding && eapply "${FILESDIR}/${PN}-3.30.3-logo.patch"
150 # PAM is the only auth scheme supported
151 # even though configure lists shadow and crypt
152 # they don't have any corresponding code.
153 # --with-at-spi-registryd-directory= needs to be passed explicitly because
154 # of https://bugzilla.gnome.org/show_bug.cgi?id=607643#c4
155 # Xevie is obsolete, bug #482304
157 # --with-initial-vt=7 conflicts with plymouth, bug #453392
158 # gdm-3.30 now reaps (stops) the login screen when the login VT isn't active, which
159 # saves on memory. However this means if we don't start on VT1, gdm doesn't start up
160 # before user manually goes to VT7. Thus as-is we can not keep gdm away from VT1,
161 # so lets try always having it in VT1 and see if that is an issue for people before
162 # hacking up workarounds for the initial start case.
163 # ! use plymouth && myconf="${myconf} --with-initial-vt=7"
165 --enable-gdm-xsession
166 --enable-user-display-server
167 --with-run-dir=/run/gdm
168 --localstatedir="${EPREFIX}"/var
171 --enable-authentication-scheme=pam
172 --with-default-pam-config=exherbo
173 --with-pam-mod-dir=$(getpam_mod_dir)
174 --with-udevdir=$(get_udevdir)
175 --with-at-spi-registryd-directory="${EPREFIX}"/usr/libexec
177 $(use_enable systemd systemd-journal)
178 --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
179 $(use_with audit libaudit)
183 $(use_with tcpd tcp-wrappers)
184 $(use_enable wayland wayland-support)
190 --with-initial-vt=7 # TODO: Revisit together with startDM.sh and other xinit talks; also ignores plymouth possibility
191 SYSTEMD_CFLAGS=`pkg-config --cflags "libelogind" 2>/dev/null`
192 SYSTEMD_LIBS=`pkg-config --libs "libelogind" 2>/dev/null`
196 gnome2_src_configure "${myconf[@]}"
202 if ! use accessibility ; then
203 rm "${ED}"/usr/share/gdm/greeter/autostart/orca-autostart.desktop || die
206 exeinto /etc/X11/xinit/xinitrc.d
207 newexe "${FILESDIR}/49-keychain-r1" 49-keychain
208 newexe "${FILESDIR}/50-ssh-agent-r1" 50-ssh-agent
210 # gdm user's home directory
212 fowners gdm:gdm /var/lib/gdm
214 if ! use bluetooth-sound ; then
215 # Workaround https://gitlab.freedesktop.org/pulseaudio/pulseaudio/merge_requests/10
217 insinto /var/lib/gdm/.config/pulse
218 doins "${FILESDIR}"/default.pa
221 # install XDG_DATA_DIRS gdm changes
222 echo 'XDG_DATA_DIRS="/usr/share/gdm"' > 99xdg-gdm
225 use branding && newicon "${WORKDIR}/tango-gentoo-v1.1/scalable/gentoo.svg" gentoo-gdm.svg
227 readme.gentoo_create_doc
234 # bug #669146; gdm may crash if /var/lib/gdm subdirs are not owned by gdm:gdm
236 ebegin "Fixing "${EROOT}"var/lib/gdm ownership"
237 chown --no-dereference gdm:gdm "${EROOT}var/lib/gdm" || ret=1
238 for d in "${EROOT}var/lib/gdm/"{.cache,.color,.config,.dbus,.local}; do
239 [[ ! -e "${d}" ]] || chown --no-dereference -R gdm:gdm "${d}" || ret=1
243 systemd_reenable gdm.service
244 readme.gentoo_print_elog