dea9ff685440192667f2ee5845d75eccc80e28be
[gentoo.git] / gnome-base / dconf / dconf-0.34.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit bash-completion-r1 gnome.org gnome2-utils meson virtualx xdg
6
7 DESCRIPTION="Simple low-level configuration system"
8 HOMEPAGE="https://wiki.gnome.org/Projects/dconf"
9
10 LICENSE="LGPL-2.1+"
11 SLOT="0"
12 KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86 ~x86-linux"
13 IUSE="gtk-doc"
14 RESTRICT="!test? ( test )" # IUSE=test comes from virtualx.eclass
15
16 RDEPEND="
17         >=dev-libs/glib-2.44.0:2
18         sys-apps/dbus
19 "
20 DEPEND="${RDEPEND}"
21 BDEPEND="
22         app-text/docbook-xml-dtd:4.2
23         app-text/docbook-xsl-stylesheets
24         dev-libs/libxslt
25         dev-util/gdbus-codegen
26         gtk-doc? ( >=dev-util/gtk-doc-1.15 )
27         >=sys-devel/gettext-0.19.8
28         virtual/pkgconfig
29 "
30
31 PATCHES=(
32         "${FILESDIR}"/0.30.1-bash-completion-dir.patch
33         "${FILESDIR}"/0.32.0-drop-vapigen-dep.patch # .vapi/.deps are pregenerated, just install them without a vala dep
34         "${FILESDIR}"/0.32.0-meson-0.52-compat.patch # https://gitlab.gnome.org/GNOME/dconf/issues/59
35 )
36
37 src_configure() {
38         local emesonargs=(
39                 -Dbash_completion_dir="$(get_bashcompdir)"
40                 -Dman=true
41                 $(meson_use gtk-doc gtk_doc)
42                 -Dvapi=true
43         )
44         meson_src_configure
45 }
46
47 src_install() {
48         meson_src_install
49
50         # GSettings backend may be one of: memory, gconf, dconf
51         # Only dconf is really considered functional by upstream
52         # must have it enabled over gconf if both are installed
53         # This snippet can't be removed until gconf package is
54         # ensured to not install a /etc/env.d/50gconf and then
55         # still consider the CONFIG_PROTECT_MASK bit.
56         echo 'CONFIG_PROTECT_MASK="/etc/dconf"' >> 51dconf
57         echo 'GSETTINGS_BACKEND="dconf"' >> 51dconf
58         doenvd 51dconf
59 }
60
61 src_test() {
62         virtx meson_src_test
63 }
64
65 pkg_postinst() {
66         xdg_pkg_postinst
67         gnome2_giomodule_cache_update
68
69         # Kill existing dconf-service processes as recommended by upstream due to
70         # possible changes in the dconf private dbus API.
71         # dconf-service will be dbus-activated on next use.
72         pids=$(pgrep -x dconf-service)
73         if [[ $? == 0 ]]; then
74                 ebegin "Stopping dconf-service; it will automatically restart on demand"
75                 kill ${pids}
76                 eend $?
77         fi
78 }
79
80 pkg_postrm() {
81         xdg_pkg_postrm
82         gnome2_giomodule_cache_update
83 }