*/*: Drop stable ia64 keywords
[gentoo.git] / gnome-base / gconf / gconf-3.2.6-r4.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5 GCONF_DEBUG="yes"
6 GNOME_ORG_MODULE="GConf"
7 GNOME2_LA_PUNT="yes"
8 PYTHON_COMPAT=( python2_7 )
9 PYTHON_REQ_USE="xml"
10
11 inherit eutils gnome2 multilib-minimal python-r1
12
13 DESCRIPTION="GNOME configuration system and daemon"
14 HOMEPAGE="https://projects.gnome.org/gconf/"
15
16 LICENSE="LGPL-2+"
17 SLOT="2"
18 KEYWORDS="~alpha amd64 arm arm64 ~ia64 ~mips ppc ppc64 sparc x86 ~x86-linux"
19 IUSE="debug +introspection ldap policykit"
20
21 RDEPEND="
22         ${PYTHON_DEPS}
23         >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}]
24         >=dev-libs/dbus-glib-0.100.2:=[${MULTILIB_USEDEP}]
25         >=sys-apps/dbus-1.6.18-r1:=[${MULTILIB_USEDEP}]
26         >=dev-libs/libxml2-2.9.1-r4:2[${MULTILIB_USEDEP}]
27         introspection? ( >=dev-libs/gobject-introspection-0.9.5:= )
28         ldap? ( >=net-nds/openldap-2.4.38-r1:=[${MULTILIB_USEDEP}] )
29         policykit? ( sys-auth/polkit:= )
30 "
31 DEPEND="${RDEPEND}
32         dev-libs/libxslt
33         dev-util/glib-utils
34         dev-util/gtk-doc-am
35         >=dev-util/intltool-0.35
36         >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
37 "
38
39 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
40
41 pkg_setup() {
42         kill_gconf
43 }
44
45 src_prepare() {
46         # Do not start gconfd when installing schemas, fix bug #238276, upstream #631983
47         epatch "${FILESDIR}/${PN}-2.24.0-no-gconfd.patch"
48
49         # Do not crash in gconf_entry_set_value() when entry pointer is NULL, upstream #631985
50         epatch "${FILESDIR}/${PN}-2.28.0-entry-set-value-sigsegv.patch"
51
52         # From 'master'
53         # mconvert: enable recursive scheme lookup and fix a crasher
54         epatch "${FILESDIR}/${P}-mconvert-crasher.patch"
55
56         # dbus: Don't spew to console when unable to connect to dbus daemon
57         epatch "${FILESDIR}/${P}-spew-console-error.patch"
58
59         # gsettings-data-convert: Warn (and fix) invalid schema paths
60         epatch "${FILESDIR}/${P}-gsettings-data-convert-paths.patch"
61
62         gnome2_src_prepare
63 }
64
65 multilib_src_configure() {
66         ECONF_SOURCE=${S} \
67         gnome2_src_configure \
68                 --disable-static \
69                 --enable-gsettings-backend \
70                 --with-gtk=3.0 \
71                 --disable-orbit \
72                 $(multilib_native_use_enable introspection) \
73                 $(use_with ldap openldap) \
74                 $(multilib_native_use_enable policykit defaults-service)
75
76         if multilib_is_native_abi; then
77                 ln -s "${S}"/doc/gconf/html doc/gconf/html || die
78         fi
79 }
80
81 multilib_src_install() {
82         gnome2_src_install
83 }
84
85 multilib_src_install_all() {
86         python_replicate_script "${ED}"/usr/bin/gsettings-schema-convert
87
88         keepdir /etc/gconf/gconf.xml.mandatory
89         keepdir /etc/gconf/gconf.xml.defaults
90         # Make sure this directory exists, bug #268070, upstream #572027
91         keepdir /etc/gconf/gconf.xml.system
92
93         echo "CONFIG_PROTECT_MASK=\"/etc/gconf\"" > 50gconf
94         echo 'GSETTINGS_BACKEND="gconf"' >> 50gconf
95         doenvd 50gconf
96         dodir /root/.gconfd
97 }
98
99 pkg_preinst() {
100         kill_gconf
101         gnome2_pkg_preinst
102 }
103
104 pkg_postinst() {
105         kill_gconf
106
107         gnome2_pkg_postinst
108
109         multilib_pkg_postinst() {
110                 gnome2_giomodule_cache_update \
111                         || die "Update GIO modules cache failed (for ${ABI})"
112         }
113         multilib_foreach_abi multilib_pkg_postinst
114
115         # change the permissions to avoid some gconf bugs
116         einfo "changing permissions for gconf dirs"
117         find  "${EPREFIX}"/etc/gconf/ -type d -exec chmod ugo+rx "{}" \;
118
119         einfo "changing permissions for gconf files"
120         find  "${EPREFIX}"/etc/gconf/ -type f -exec chmod ugo+r "{}" \;
121 }
122
123 pkg_postrm() {
124         gnome2_pkg_postrm
125
126         multilib_pkg_postrm() {
127                 gnome2_giomodule_cache_update \
128                         || die "Update GIO modules cache failed (for ${ABI})"
129         }
130         multilib_foreach_abi multilib_pkg_postrm
131 }
132
133 kill_gconf() {
134         # This function will kill all running gconfd-2 that could be causing troubles
135         if [ -x "${EPREFIX}"/usr/bin/gconftool-2 ]
136         then
137                 "${EPREFIX}"/usr/bin/gconftool-2 --shutdown
138         fi
139
140         return 0
141 }