1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
9 inherit autotools eutils gnome2 pam readme.gentoo systemd user versionator
11 DESCRIPTION="GNOME Display Manager for managing graphical display servers and user logins"
12 HOMEPAGE="https://wiki.gnome.org/Projects/GDM"
15 branding? ( http://www.mail-archive.com/tango-artists@lists.freedesktop.org/msg00043/tango-gentoo-v1.1.tar.gz )
20 branding? ( CC-Sampling-Plus-1.0 )
25 IUSE="accessibility audit branding fprint +introspection ipv6 plymouth selinux smartcard +systemd tcpd test wayland xinerama"
26 REQUIRED_USE="wayland? ( systemd )"
28 KEYWORDS="~alpha amd64 ~arm ~ia64 ~ppc ~ppc64 ~sh ~sparc 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.36:2[dbus]
37 >=x11-libs/gtk+-2.91.1:3
38 >=gnome-base/dconf-0.20
39 >=gnome-base/gnome-settings-daemon-3.1.4
40 gnome-base/gsettings-desktop-schemas
41 >=media-libs/fontconfig-2.5.0
42 >=media-libs/libcanberra-0.4[gtk3]
44 >=sys-apps/accountsservice-0.6.12
54 >=x11-misc/xdg-utils-1.0.2-r3
57 systemd? ( >=sys-apps/systemd-186:0=[pam] )
59 >=x11-base/xorg-server-1.14.3-r1
60 >=sys-auth/consolekit-0.4.5_p20120320-r2
61 !<sys-apps/openrc-0.12
63 sys-auth/pambase[systemd?]
65 audit? ( sys-process/audit )
66 introspection? ( >=dev-libs/gobject-introspection-0.9.12:= )
67 plymouth? ( sys-boot/plymouth )
68 selinux? ( sys-libs/libselinux )
69 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
70 xinerama? ( x11-libs/libXinerama )
72 # XXX: These deps are from session and desktop files in data/ directory
73 # fprintd is used via dbus by gdm-fingerprint-extension
74 # gnome-session-3.6 needed to avoid freezing with orca
75 RDEPEND="${COMMON_DEPEND}
76 >=gnome-base/gnome-session-3.6
77 >=gnome-base/gnome-shell-3.1.90
78 gnome-extra/polkit-gnome:0
80 x11-themes/gnome-icon-theme-symbolic
83 >=app-accessibility/orca-3.10
84 gnome-extra/mousetweaks )
89 !gnome-extra/fast-user-switch-applet
91 DEPEND="${COMMON_DEPEND}
92 app-text/docbook-xml-dtd:4.1.2
93 dev-util/gdbus-codegen
94 >=dev-util/intltool-0.40.0
99 test? ( >=dev-libs/check-0.9.4 )
100 xinerama? ( x11-proto/xineramaproto )
104 To make GDM start at boot, run:\n
105 # systemctl enable gdm.service\n
107 For passwordless login to unlock your keyring, you need to install
108 sys-auth/pambase with USE=gnome-keyring and set an empty password
109 on your keyring. Use app-crypt/seahorse for that.\n
111 You may need to install app-crypt/coolkey and sys-auth/pam_pkcs11
112 for smartcard support
117 enewgroup video # Just in case it hasn't been created yet
118 enewuser gdm -1 -1 /var/lib/gdm gdm,video
120 # For compatibility with certain versions of nvidia-drivers, etc., need to
121 # ensure that gdm user is in the video group
122 if ! egetent group video | grep -q gdm; then
123 # FIXME XXX: is this at all portable, ldap-safe, etc.?
124 # XXX: egetent does not have a 1-argument form, so we can't use it to
125 # get the list of gdm's groups
126 local g=$(groups gdm)
127 elog "Adding user gdm to video group"
128 usermod -G video,${g// /,} gdm || die "Adding user gdm to video group failed"
133 # make custom session work, bug #216984, upstream bug #737578
134 epatch "${FILESDIR}/${PN}-3.2.1.1-custom-session.patch"
136 # ssh-agent handling must be done at xinitrc.d, bug #220603
137 epatch "${FILESDIR}/${PN}-2.32.0-xinitrc-ssh-agent.patch"
139 # Gentoo does not have a fingerprint-auth pam stack
140 epatch "${FILESDIR}/${PN}-3.8.4-fingerprint-auth.patch"
142 # Show logo when branding is enabled
143 use branding && epatch "${FILESDIR}/${PN}-3.8.4-logo.patch"
152 # PAM is the only auth scheme supported
153 # even though configure lists shadow and crypt
154 # they don't have any corresponding code.
155 # --with-at-spi-registryd-directory= needs to be passed explicitly because
156 # of https://bugzilla.gnome.org/show_bug.cgi?id=607643#c4
157 # Xevie is obsolete, bug #482304
158 # --with-initial-vt=7 conflicts with plymouth, bug #453392
159 ! use plymouth && myconf="${myconf} --with-initial-vt=7"
161 gnome2_src_configure \
162 --with-run-dir=/run/gdm \
163 --localstatedir="${EPREFIX}"/var \
166 --enable-authentication-scheme=pam \
167 --with-default-pam-config=exherbo \
168 --with-at-spi-registryd-directory="${EPREFIX}"/usr/libexec \
169 --with-consolekit-directory="${EPREFIX}"/usr/lib/ConsoleKit \
171 $(use_with audit libaudit) \
173 $(use_with plymouth) \
174 $(use_with selinux) \
175 $(use_with systemd) \
176 $(use_with !systemd console-kit) \
177 $(use_enable systemd systemd-journal) \
178 $(systemd_with_unitdir) \
179 $(use_with tcpd tcp-wrappers) \
180 $(use_enable wayland wayland-support) \
181 $(use_with xinerama) \
188 if ! use accessibility ; then
189 rm "${ED}"/usr/share/gdm/greeter/autostart/orca-autostart.desktop || die
192 exeinto /etc/X11/xinit/xinitrc.d
193 newexe "${FILESDIR}/49-keychain-r1" 49-keychain
194 newexe "${FILESDIR}/50-ssh-agent-r1" 50-ssh-agent
196 # gdm user's home directory
198 fowners gdm:gdm /var/lib/gdm
200 # install XDG_DATA_DIRS gdm changes
201 echo 'XDG_DATA_DIRS="/usr/share/gdm"' > 99xdg-gdm
204 use branding && newicon "${WORKDIR}/tango-gentoo-v1.1/scalable/gentoo.svg" gentoo-gdm.svg
206 readme.gentoo_create_doc
214 # bug #436456; gdm crashes if /var/lib/gdm subdirs are not owned by gdm:gdm
216 ebegin "Fixing "${EROOT}"var/lib/gdm ownership"
217 chown gdm:gdm "${EROOT}var/lib/gdm" || ret=1
218 for d in "${EROOT}var/lib/gdm/"{.cache,.config,.local}; do
219 [[ ! -e "${d}" ]] || chown -R gdm:gdm "${d}" || ret=1
223 readme.gentoo_print_elog
225 if ! version_is_at_least 3.16.0 ${REPLACING_VERSIONS}; then
226 ewarn "GDM will now use a new TTY per logged user as explained at:"
227 ewarn "https://wiki.gentoo.org/wiki/Project:GNOME/GNOME3-Troubleshooting#GDM_.3E.3D_3.16_opens_one_graphical_session_per_user"