Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/dbus/
Date: Fri, 25 Feb 2022 18:20:53
Message-Id: 1645813229.a4443d1730906275c1698bc9e43e3e45b1abcfac.sam@gentoo
1 commit: a4443d1730906275c1698bc9e43e3e45b1abcfac
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 25 18:16:32 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 25 18:20:29 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4443d17
7
8 sys-apps/dbus: add 1.12.22
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 sys-apps/dbus/Manifest | 1 +
13 sys-apps/dbus/dbus-1.12.22.ebuild | 284 ++++++++++++++++++++++++++++++++++++++
14 2 files changed, 285 insertions(+)
15
16 diff --git a/sys-apps/dbus/Manifest b/sys-apps/dbus/Manifest
17 index 0af7e50b0b6a..e530cbf7268b 100644
18 --- a/sys-apps/dbus/Manifest
19 +++ b/sys-apps/dbus/Manifest
20 @@ -1 +1,2 @@
21 DIST dbus-1.12.20.tar.gz 2095511 BLAKE2B b467526e7e0281db7b8c7c178469fe006dab29ccb1ea197c02495bd297e8de766230b68ed86c4a7e05dbe09ca30ce941a15e0bf8030fe0df66c04febf0534b3b SHA512 0964683bc6859374cc94e42e1ec0cdb542cca67971c205fcba4352500b6c0891665b0718e7d85eb060c81cb82e3346c313892bc02384da300ddd306c7eef0056
22 +DIST dbus-1.12.22.tar.gz 2108231 BLAKE2B 40c30ad9e48d8ac6b5f1c67726015eb17cb3501372ef2c8ffcd8ad73e4a2f186b80a7bbba094460d4093d1d0a3f1bbb8d83a27724397a8f5312bb8542237e6b7 SHA512 0a716022f9d693fcaf871b6dfb5f242b49a8dd05d3316ec3e530f5129f1d81a2fa9caec795fa62cfdcba6ed21549fdd2f896f9bf1cc9a96e2a7d04f2c7ec7be6
23
24 diff --git a/sys-apps/dbus/dbus-1.12.22.ebuild b/sys-apps/dbus/dbus-1.12.22.ebuild
25 new file mode 100644
26 index 000000000000..7427d268d82c
27 --- /dev/null
28 +++ b/sys-apps/dbus/dbus-1.12.22.ebuild
29 @@ -0,0 +1,284 @@
30 +# Copyright 1999-2022 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=7
34 +
35 +PYTHON_COMPAT=( python3_{8..10} )
36 +TMPFILES_OPTIONAL=1
37 +
38 +inherit autotools flag-o-matic linux-info python-any-r1 readme.gentoo-r1 systemd tmpfiles virtualx multilib-minimal
39 +
40 +DESCRIPTION="A message bus system, a simple way for applications to talk to each other"
41 +HOMEPAGE="https://dbus.freedesktop.org/"
42 +SRC_URI="https://dbus.freedesktop.org/releases/dbus/${P}.tar.gz"
43 +
44 +LICENSE="|| ( AFL-2.1 GPL-2 )"
45 +SLOT="0"
46 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
47 +IUSE="debug doc elogind selinux static-libs systemd test X"
48 +RESTRICT="!test? ( test )"
49 +
50 +REQUIRED_USE="?? ( elogind systemd )"
51 +
52 +BDEPEND="
53 + acct-user/messagebus
54 + app-text/xmlto
55 + app-text/docbook-xml-dtd:4.4
56 + sys-devel/autoconf-archive
57 + virtual/pkgconfig
58 + doc? ( app-doc/doxygen )
59 +"
60 +COMMON_DEPEND="
61 + >=dev-libs/expat-2.1.0
62 + elogind? ( sys-auth/elogind )
63 + selinux? ( sys-libs/libselinux )
64 + systemd? ( sys-apps/systemd:0= )
65 + X? (
66 + x11-libs/libX11
67 + x11-libs/libXt
68 + )
69 +"
70 +DEPEND="${COMMON_DEPEND}
71 + dev-libs/expat
72 + test? (
73 + ${PYTHON_DEPS}
74 + >=dev-libs/glib-2.40:2
75 + )
76 +"
77 +RDEPEND="${COMMON_DEPEND}
78 + acct-user/messagebus
79 + selinux? ( sec-policy/selinux-dbus )
80 + systemd? ( virtual/tmpfiles )
81 +"
82 +
83 +DOC_CONTENTS="
84 + Some applications require a session bus in addition to the system
85 + bus. Please see \`man dbus-launch\` for more information.
86 +"
87 +
88 +# out of sources build dir for make check
89 +TBD="${WORKDIR}/${P}-tests-build"
90 +
91 +PATCHES=(
92 + "${FILESDIR}/${PN}-enable-elogind.patch"
93 + "${FILESDIR}/${PN}-daemon-optional.patch" # bug #653136
94 +)
95 +
96 +pkg_setup() {
97 + use test && python-any-r1_pkg_setup
98 +
99 + if use kernel_linux; then
100 + CONFIG_CHECK="~EPOLL"
101 + linux-info_pkg_setup
102 + fi
103 +}
104 +
105 +src_prepare() {
106 + # Tests were restricted because of this
107 + sed -i \
108 + -e 's/.*bus_dispatch_test.*/printf ("Disabled due to excess noise\\n");/' \
109 + -e '/"dispatch"/d' \
110 + bus/test-main.c || die
111 +
112 + default
113 +
114 + if [[ ${CHOST} == *-solaris* ]]; then
115 + # fix standards conflict, due to gcc being c99 by default nowadays
116 + sed -i \
117 + -e 's/_XOPEN_SOURCE=500/_XOPEN_SOURCE=600/' \
118 + configure.ac || die
119 + fi
120 +
121 + # required for bug 263909, cross-compile so don't remove eautoreconf
122 + eautoreconf
123 +}
124 +
125 +src_configure() {
126 + local rundir=$(usex kernel_linux /run /var/run)
127 + sed -e "s;@rundir@;${EPREFIX}${rundir};g" "${FILESDIR}"/dbus.initd.in \
128 + > "${T}"/dbus.initd || die
129 + multilib-minimal_src_configure
130 +}
131 +
132 +multilib_src_configure() {
133 + local docconf myconf testconf
134 +
135 + # so we can get backtraces from apps
136 + case ${CHOST} in
137 + *-mingw*)
138 + # error: unrecognized command line option '-rdynamic' wrt #488036
139 + ;;
140 + *)
141 + append-flags -rdynamic
142 + ;;
143 + esac
144 +
145 + # libaudit is *only* used in DBus wrt SELinux support, so disable it, if
146 + # not on an SELinux profile.
147 + myconf=(
148 + --localstatedir="${EPREFIX}/var"
149 + $(use_enable static-libs static)
150 + $(use_enable debug verbose-mode)
151 + --disable-asserts
152 + --disable-checks
153 + $(use_enable selinux)
154 + $(use_enable selinux libaudit)
155 + --disable-apparmor
156 + $(use_enable kernel_linux inotify)
157 + --disable-kqueue
158 + $(use_enable elogind)
159 + $(use_enable systemd)
160 + $(use_enable systemd user-session)
161 + --disable-embedded-tests
162 + --disable-modular-tests
163 + $(use_enable debug stats)
164 + --with-session-socket-dir="${EPREFIX}"/tmp
165 + --with-system-pid-file="${EPREFIX}${rundir}"/dbus.pid
166 + --with-system-socket="${EPREFIX}${rundir}"/dbus/system_bus_socket
167 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
168 + --with-systemduserunitdir="$(systemd_get_userunitdir)"
169 + --with-dbus-user=messagebus
170 + $(use_with X x)
171 + )
172 +
173 + if [[ ${CHOST} == *-darwin* ]]; then
174 + myconf+=(
175 + --enable-launchd
176 + --with-launchd-agent-dir="${EPREFIX}"/Library/LaunchAgents
177 + )
178 + fi
179 +
180 + if multilib_is_native_abi; then
181 + docconf=(
182 + --enable-xml-docs
183 + $(use_enable doc doxygen-docs)
184 + )
185 + else
186 + docconf=(
187 + --disable-xml-docs
188 + --disable-doxygen-docs
189 + )
190 + myconf+=(
191 + --disable-daemon
192 + --disable-selinux
193 + --disable-libaudit
194 + --disable-elogind
195 + --disable-systemd
196 + --without-x
197 + )
198 + fi
199 +
200 + einfo "Running configure in ${BUILD_DIR}"
201 + ECONF_SOURCE="${S}" econf "${myconf[@]}" "${docconf[@]}"
202 +
203 + if multilib_is_native_abi && use test; then
204 + mkdir "${TBD}" || die
205 + cd "${TBD}" || die
206 + testconf=(
207 + $(use_enable test asserts)
208 + $(use_enable test checks)
209 + $(use_enable test embedded-tests)
210 + $(use_enable test stats)
211 + $(has_version dev-libs/dbus-glib && echo --enable-modular-tests)
212 + )
213 + einfo "Running configure in ${TBD}"
214 + ECONF_SOURCE="${S}" econf "${myconf[@]}" "${testconf[@]}"
215 + fi
216 +}
217 +
218 +multilib_src_compile() {
219 + if multilib_is_native_abi; then
220 + # after the compile, it uses a selinuxfs interface to
221 + # check if the SELinux policy has the right support
222 + use selinux && addwrite /selinux/access
223 +
224 + einfo "Running make in ${BUILD_DIR}"
225 + emake
226 +
227 + if use test; then
228 + einfo "Running make in ${TBD}"
229 + emake -C "${TBD}"
230 + fi
231 + else
232 + emake -C dbus libdbus-1.la
233 + fi
234 +}
235 +
236 +src_test() {
237 + DBUS_VERBOSE=1 virtx emake -j1 -C "${TBD}" check
238 +}
239 +
240 +multilib_src_install() {
241 + if multilib_is_native_abi; then
242 + emake DESTDIR="${D}" install
243 + else
244 + emake DESTDIR="${D}" install-pkgconfigDATA
245 + emake DESTDIR="${D}" -C dbus \
246 + install-libLTLIBRARIES install-dbusincludeHEADERS \
247 + install-nodist_dbusarchincludeHEADERS
248 + fi
249 +}
250 +
251 +multilib_src_install_all() {
252 + newinitd "${T}"/dbus.initd dbus
253 +
254 + if use X; then
255 + # dbus X session script (#77504)
256 + # turns out to only work for GDM (and startx). has been merged into
257 + # other desktop (kdm and such scripts)
258 + exeinto /etc/X11/xinit/xinitrc.d
259 + doexe "${FILESDIR}"/80-dbus
260 + fi
261 +
262 + # needs to exist for dbus sessions to launch
263 + keepdir /usr/share/dbus-1/services
264 + keepdir /etc/dbus-1/{session,system}.d
265 + # machine-id symlink from pkg_postinst()
266 + keepdir /var/lib/dbus
267 + # let the init script create the /var/run/dbus directory
268 + rm -rf "${ED}"/var/run
269 +
270 + # https://bugs.gentoo.org/761763
271 + rm -rf "${ED}"/usr/lib/sysusers.d
272 +
273 + dodoc AUTHORS ChangeLog NEWS README doc/TODO
274 + readme.gentoo_create_doc
275 +
276 + find "${ED}" -name '*.la' -delete || die
277 +}
278 +
279 +pkg_postinst() {
280 + readme.gentoo_print_elog
281 +
282 + if use systemd; then
283 + tmpfiles_process dbus.conf
284 + fi
285 +
286 + # Ensure unique id is generated and put it in /etc wrt #370451 but symlink
287 + # for DBUS_MACHINE_UUID_FILE (see tools/dbus-launch.c) and reverse
288 + # dependencies with hardcoded paths (although the known ones got fixed already)
289 + # TODO: should be safe to remove at least the ln because of the above tmpfiles_process?
290 + dbus-uuidgen --ensure="${EROOT}"/etc/machine-id
291 + ln -sf "${EPREFIX}"/etc/machine-id "${EROOT}"/var/lib/dbus/machine-id
292 +
293 + if [[ ${CHOST} == *-darwin* ]]; then
294 + local plist="org.freedesktop.dbus-session.plist"
295 + elog
296 + elog
297 + elog "For MacOS/Darwin we now ship launchd support for dbus."
298 + elog "This enables autolaunch of dbus at session login and makes"
299 + elog "dbus usable under MacOS/Darwin."
300 + elog
301 + elog "The launchd plist file ${plist} has been"
302 + elog "installed in ${EPREFIX}/Library/LaunchAgents."
303 + elog "For it to be used, you will have to do all of the following:"
304 + elog " + cd ~/Library/LaunchAgents"
305 + elog " + ln -s ${EPREFIX}/Library/LaunchAgents/${plist}"
306 + elog " + logout and log back in"
307 + elog
308 + elog "If your application needs a proper DBUS_SESSION_BUS_ADDRESS"
309 + elog "specified and refused to start otherwise, then export the"
310 + elog "the following to your environment:"
311 + elog " DBUS_SESSION_BUS_ADDRESS=\"launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET\""
312 + fi
313 +}