gnome-base/gnome-session: bump to 3.30.1
[gentoo.git] / gnome-base / gnome-session / gnome-session-3.30.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit gnome.org gnome2-utils meson xdg
6
7 DESCRIPTION="Gnome session manager"
8 HOMEPAGE="https://gitlab.gnome.org/GNOME/gnome-session"
9
10 LICENSE="GPL-2+"
11 SLOT="0"
12 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
13 IUSE="consolekit doc systemd"
14
15 COMMON_DEPEND="
16         >=dev-libs/glib-2.46.0:2
17         >=x11-libs/gtk+-3.18.0:3
18         x11-libs/libICE
19         x11-libs/libSM
20         x11-libs/libX11
21         >=gnome-base/gnome-desktop-3.18:3=
22         >=dev-libs/json-glib-0.10
23         media-libs/mesa[egl,gles2]
24         media-libs/libepoxy
25         x11-libs/libXcomposite
26
27         systemd? ( >=sys-apps/systemd-183:0= )
28         consolekit? ( >=dev-libs/dbus-glib-0.76 )
29 "
30
31 # Pure-runtime deps from the session files should *NOT* be added here
32 # Otherwise, things like gdm pull in gnome-shell.
33 # gnome-settings-daemon is assumed to be >=3.27.90, but this is about
34 # removed components, so no need to strictly require it (older just
35 # won't have those daemons loaded by gnome-session).
36 # x11-misc/xdg-user-dirs{,-gtk} are needed to create the various XDG_*_DIRs, and
37 # create .config/user-dirs.dirs which is read by glib to get G_USER_DIRECTORY_*
38 # xdg-user-dirs-update is run during login (see 10-user-dirs-update-gnome below).
39 # sys-apps/dbus[X] is needed for session management.
40 # Our 90-xcursor-theme-gnome reads a setting from gsettings-desktop-schemas.
41 RDEPEND="${COMMON_DEPEND}
42         >=gnome-base/gnome-settings-daemon-3.23.2
43         >=gnome-base/gsettings-desktop-schemas-0.1.7
44         sys-apps/dbus[X]
45         consolekit? ( sys-auth/consolekit )
46
47         x11-misc/xdg-user-dirs
48         x11-misc/xdg-user-dirs-gtk
49 "
50 DEPEND="${COMMON_DEPEND}
51         dev-libs/libxslt
52         dev-util/gdbus-codegen
53         >=sys-devel/gettext-0.19.8
54         x11-libs/xtrans
55         virtual/pkgconfig
56         doc? ( app-text/xmlto
57                 app-text/docbook-xml-dtd:4.1.2 )
58 "
59
60 src_prepare() {
61         xdg_src_prepare
62         # Install USE=doc in $PF if enabled
63         sed -i -e "s:meson\.project_name(), 'dbus':'${PF}', 'dbus':" doc/dbus/meson.build || die
64 }
65
66 src_configure() {
67         local emesonargs=(
68                 -Ddeprecation_flags=false
69                 -Dsession_selector=true # gnome-custom-session
70                 $(meson_use systemd)
71                 $(meson_use systemd systemd_journal)
72                 $(meson_use consolekit)
73                 $(meson_use doc docbook)
74                 -Dman=true
75         )
76         meson_src_configure
77 }
78
79 src_install() {
80         meson_src_install
81
82         dodir /etc/X11/Sessions
83         exeinto /etc/X11/Sessions
84         doexe "${FILESDIR}/Gnome"
85
86         insinto /usr/share/applications
87         newins "${FILESDIR}/defaults.list-r4" gnome-mimeapps.list
88
89         dodir /etc/X11/xinit/xinitrc.d/
90         exeinto /etc/X11/xinit/xinitrc.d/
91         newexe "${FILESDIR}/15-xdg-data-gnome-r1" 15-xdg-data-gnome
92
93         # This should be done here as discussed in bug #270852
94         newexe "${FILESDIR}/10-user-dirs-update-gnome-r1" 10-user-dirs-update-gnome
95
96         # Set XCURSOR_THEME from current dconf setting instead of installing
97         # default cursor symlink globally and affecting other DEs (bug #543488)
98         # https://bugzilla.gnome.org/show_bug.cgi?id=711703
99         newexe "${FILESDIR}/90-xcursor-theme-gnome" 90-xcursor-theme-gnome
100 }
101
102 pkg_postinst() {
103         xdg_pkg_postinst
104         gnome2_schemas_update
105
106         if ! has_version gnome-base/gdm && ! has_version x11-misc/sddm; then
107                 ewarn "If you use a custom .xinitrc for your X session,"
108                 ewarn "make sure that the commands in the xinitrc.d scripts are run."
109         fi
110
111         if ! use systemd && ! use consolekit; then
112                 ewarn "You are building without systemd and/or consolekit support."
113                 ewarn "gnome-session won't be able to correctly track and manage your session."
114         fi
115 }
116
117 pkg_postrm() {
118         xdg_pkg_postinst
119         gnome2_schemas_update
120 }