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/, sys-apps/dbus/files/
Date: Fri, 23 Sep 2022 05:41:21
Message-Id: 1663910235.e3741b2fe7369b84f06622e9ef4e566f76c8c4e1.sam@gentoo
1 commit: e3741b2fe7369b84f06622e9ef4e566f76c8c4e1
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 23 05:09:45 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 23 05:17:15 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e3741b2f
7
8 sys-apps/dbus: add 1.15.0 (unkeyworded)
9
10 Someone needs to test elogind support and I don't have an elogind
11 machine available right now.
12
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 sys-apps/dbus/Manifest | 1 +
16 sys-apps/dbus/dbus-1.15.0.ebuild | 294 +++++++++++++++++++++
17 .../dbus/files/dbus-1.15.0-daemon-optional.patch | 65 +++++
18 .../dbus/files/dbus-1.15.0-enable-elogind.patch | 75 ++++++
19 4 files changed, 435 insertions(+)
20
21 diff --git a/sys-apps/dbus/Manifest b/sys-apps/dbus/Manifest
22 index 729071e9798f..7acceaef14bc 100644
23 --- a/sys-apps/dbus/Manifest
24 +++ b/sys-apps/dbus/Manifest
25 @@ -1,2 +1,3 @@
26 DIST dbus-1.12.22.tar.gz 2108231 BLAKE2B 40c30ad9e48d8ac6b5f1c67726015eb17cb3501372ef2c8ffcd8ad73e4a2f186b80a7bbba094460d4093d1d0a3f1bbb8d83a27724397a8f5312bb8542237e6b7 SHA512 0a716022f9d693fcaf871b6dfb5f242b49a8dd05d3316ec3e530f5129f1d81a2fa9caec795fa62cfdcba6ed21549fdd2f896f9bf1cc9a96e2a7d04f2c7ec7be6
27 DIST dbus-1.14.0.tar.xz 1360228 BLAKE2B ae0ebc2779e840e2d83f633029f81fba0e35969648dddce0280640dd9bee3f9508aa7fb6aef696d1c4c56d40f91b754941f847525afaee5cc3170ad23a7eddbf SHA512 9bf17a3ebb3cf44722c6fbf24ee56e9dc14d6882fc312f26c7f07459d969424bc2fb63a229139e011804ecc479a8f0eb1a0c83286f8d5a664c5979d12634179f
28 +DIST dbus-1.15.0.tar.xz 1391044 BLAKE2B 50cd9e5fc27f8ff53350f426d29b0ee7dd17a791e82e9d0465789c095443826d14396045c8301e73996d054e2b723b09c1c28dd392a240ed74b6c49c1369d480 SHA512 6f7e1d4ff525ce13c5f671f1b045a089c379cbfb777662ce7a55ffe4893a8ab2aaf38877a7b8f261823067a20f3b336437449eb353a97d30699496375e00bf1a
29
30 diff --git a/sys-apps/dbus/dbus-1.15.0.ebuild b/sys-apps/dbus/dbus-1.15.0.ebuild
31 new file mode 100644
32 index 000000000000..fd178a8b873f
33 --- /dev/null
34 +++ b/sys-apps/dbus/dbus-1.15.0.ebuild
35 @@ -0,0 +1,294 @@
36 +# Copyright 1999-2022 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=8
40 +
41 +PYTHON_COMPAT=( python3_{8..10} )
42 +TMPFILES_OPTIONAL=1
43 +
44 +# From 1.15.0 release notes:
45 +# "• Add a Meson build system. This is currently considered experimental,
46 +# but the intention is for it to replace Autotools and/or CMake in future
47 +# releases, preferably both. Please test!"
48 +# We haven't migrated to it yet as it's experimental but our elogind
49 +# patch needs adjusting too (and upstreaming, ideally!)
50 +# https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/NEWS#L31
51 +inherit autotools flag-o-matic linux-info python-any-r1 readme.gentoo-r1 systemd tmpfiles virtualx multilib-minimal
52 +
53 +DESCRIPTION="A message bus system, a simple way for applications to talk to each other"
54 +HOMEPAGE="https://www.freedesktop.org/wiki/Software/dbus/"
55 +SRC_URI="https://dbus.freedesktop.org/releases/dbus/${P}.tar.xz"
56 +
57 +LICENSE="|| ( AFL-2.1 GPL-2 )"
58 +SLOT="0"
59 +# Needs testing on elogind system
60 +#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
61 +IUSE="debug doc elogind selinux static-libs systemd test X"
62 +RESTRICT="!test? ( test )"
63 +
64 +REQUIRED_USE="?? ( elogind systemd )"
65 +
66 +BDEPEND="
67 + acct-user/messagebus
68 + app-text/xmlto
69 + app-text/docbook-xml-dtd:4.4
70 + sys-devel/autoconf-archive
71 + virtual/pkgconfig
72 + doc? ( app-doc/doxygen )
73 +"
74 +COMMON_DEPEND="
75 + >=dev-libs/expat-2.1.0
76 + elogind? ( sys-auth/elogind )
77 + selinux? (
78 + sys-process/audit
79 + sys-libs/libselinux
80 + )
81 + systemd? ( sys-apps/systemd:0= )
82 + X? (
83 + x11-libs/libX11
84 + x11-libs/libXt
85 + )
86 +"
87 +DEPEND="${COMMON_DEPEND}
88 + dev-libs/expat
89 + test? (
90 + ${PYTHON_DEPS}
91 + >=dev-libs/glib-2.40:2
92 + )
93 +"
94 +RDEPEND="${COMMON_DEPEND}
95 + acct-user/messagebus
96 + selinux? ( sec-policy/selinux-dbus )
97 + systemd? ( virtual/tmpfiles )
98 +"
99 +
100 +DOC_CONTENTS="
101 + Some applications require a session bus in addition to the system
102 + bus. Please see \`man dbus-launch\` for more information.
103 +"
104 +
105 +# out of sources build dir for make check
106 +TBD="${WORKDIR}/${P}-tests-build"
107 +
108 +PATCHES=(
109 + "${FILESDIR}/dbus-1.15.0-enable-elogind.patch"
110 + "${FILESDIR}/dbus-1.15.0-daemon-optional.patch" # bug #653136
111 +)
112 +
113 +pkg_setup() {
114 + use test && python-any-r1_pkg_setup
115 +
116 + if use kernel_linux; then
117 + CONFIG_CHECK="~EPOLL"
118 + linux-info_pkg_setup
119 + fi
120 +}
121 +
122 +src_prepare() {
123 + default
124 +
125 + if [[ ${CHOST} == *-solaris* ]]; then
126 + # fix standards conflict, due to gcc being c99 by default nowadays
127 + sed -i \
128 + -e 's/_XOPEN_SOURCE=500/_XOPEN_SOURCE=600/' \
129 + configure.ac || die
130 + fi
131 +
132 + # required for bug #263909, cross-compile so don't remove eautoreconf
133 + eautoreconf
134 +}
135 +
136 +src_configure() {
137 + local rundir=$(usex kernel_linux /run /var/run)
138 +
139 + sed -e "s;@rundir@;${EPREFIX}${rundir};g" "${FILESDIR}"/dbus.initd.in \
140 + > "${T}"/dbus.initd || die
141 +
142 + multilib-minimal_src_configure
143 +}
144 +
145 +multilib_src_configure() {
146 + local docconf myconf testconf
147 +
148 + # so we can get backtraces from apps
149 + case ${CHOST} in
150 + *-mingw*)
151 + # error: unrecognized command line option '-rdynamic', bug #488036
152 + ;;
153 + *)
154 + append-flags -rdynamic
155 + ;;
156 + esac
157 +
158 + # libaudit is *only* used in DBus wrt SELinux support, so disable it, if
159 + # not on an SELinux profile.
160 + myconf=(
161 + --localstatedir="${EPREFIX}/var"
162 + $(use_enable static-libs static)
163 + $(use_enable debug verbose-mode)
164 + --disable-asserts
165 + --disable-checks
166 + $(use_enable selinux)
167 + $(use_enable selinux libaudit)
168 + --disable-apparmor
169 + $(use_enable kernel_linux inotify)
170 + --disable-kqueue
171 + $(use_enable elogind)
172 + $(use_enable systemd)
173 + $(use_enable systemd user-session)
174 + --disable-embedded-tests
175 + --disable-modular-tests
176 + $(use_enable debug stats)
177 + --with-session-socket-dir="${EPREFIX}"/tmp
178 + --with-system-pid-file="${EPREFIX}${rundir}"/dbus.pid
179 + --with-system-socket="${EPREFIX}${rundir}"/dbus/system_bus_socket
180 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
181 + --with-systemduserunitdir="$(systemd_get_userunitdir)"
182 + --with-dbus-user=messagebus
183 + $(use_with X x)
184 + )
185 +
186 + if [[ ${CHOST} == *-darwin* ]]; then
187 + myconf+=(
188 + --enable-launchd
189 + --with-launchd-agent-dir="${EPREFIX}"/Library/LaunchAgents
190 + )
191 + fi
192 +
193 + if multilib_is_native_abi; then
194 + docconf=(
195 + --enable-xml-docs
196 + $(use_enable doc doxygen-docs)
197 + )
198 + else
199 + docconf=(
200 + --disable-xml-docs
201 + --disable-doxygen-docs
202 + )
203 + myconf+=(
204 + --disable-daemon
205 + --disable-selinux
206 + --disable-libaudit
207 + --disable-elogind
208 + --disable-systemd
209 + --without-x
210 + )
211 + fi
212 +
213 + einfo "Running configure in ${BUILD_DIR}"
214 + ECONF_SOURCE="${S}" econf "${myconf[@]}" "${docconf[@]}"
215 +
216 + if multilib_is_native_abi && use test; then
217 + mkdir "${TBD}" || die
218 + cd "${TBD}" || die
219 + testconf=(
220 + $(use_enable test asserts)
221 + $(use_enable test checks)
222 + $(use_enable test embedded-tests)
223 + $(use_enable test stats)
224 + $(has_version dev-libs/dbus-glib && echo --enable-modular-tests)
225 + )
226 + einfo "Running configure in ${TBD}"
227 + ECONF_SOURCE="${S}" econf "${myconf[@]}" "${testconf[@]}"
228 + fi
229 +}
230 +
231 +multilib_src_compile() {
232 + if multilib_is_native_abi; then
233 + # After the compile, it uses a selinuxfs interface to
234 + # check if the SELinux policy has the right support
235 + use selinux && addwrite /selinux/access
236 +
237 + einfo "Running make in ${BUILD_DIR}"
238 + emake
239 +
240 + if use test; then
241 + einfo "Running make in ${TBD}"
242 + emake -C "${TBD}"
243 + fi
244 + else
245 + emake -C dbus libdbus-1.la
246 + fi
247 +}
248 +
249 +src_test() {
250 + # DBUS_TEST_MALLOC_FAILURES=0 to avoid huge test logs
251 + # https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/CONTRIBUTING.md#L231
252 + DBUS_TEST_MALLOC_FAILURES=0 DBUS_VERBOSE=1 virtx emake -j1 -C "${TBD}" check
253 +
254 +}
255 +
256 +multilib_src_install() {
257 + if multilib_is_native_abi; then
258 + emake DESTDIR="${D}" install
259 + else
260 + emake DESTDIR="${D}" install-pkgconfigDATA
261 + emake DESTDIR="${D}" -C dbus \
262 + install-libLTLIBRARIES install-dbusincludeHEADERS \
263 + install-nodist_dbusarchincludeHEADERS
264 + fi
265 +}
266 +
267 +multilib_src_install_all() {
268 + newinitd "${T}"/dbus.initd dbus
269 +
270 + if use X; then
271 + # dbus X session script (bug #77504)
272 + # turns out to only work for GDM (and startx). has been merged into
273 + # other desktop (kdm and such scripts)
274 + exeinto /etc/X11/xinit/xinitrc.d
275 + newexe "${FILESDIR}"/80-dbus-r1 80-dbus
276 + fi
277 +
278 + # Needs to exist for dbus sessions to launch
279 + keepdir /usr/share/dbus-1/services
280 + keepdir /etc/dbus-1/{session,system}.d
281 + # machine-id symlink from pkg_postinst()
282 + keepdir /var/lib/dbus
283 + # Let the init script create the /var/run/dbus directory
284 + rm -rf "${ED}"/var/run
285 +
286 + # bug #761763
287 + rm -rf "${ED}"/usr/lib/sysusers.d
288 +
289 + dodoc AUTHORS NEWS README doc/TODO
290 + readme.gentoo_create_doc
291 +
292 + find "${ED}" -name '*.la' -delete || die
293 +}
294 +
295 +pkg_postinst() {
296 + readme.gentoo_print_elog
297 +
298 + if use systemd; then
299 + tmpfiles_process dbus.conf
300 + fi
301 +
302 + # Ensure unique id is generated and put it in /etc wrt bug #370451 but symlink
303 + # for DBUS_MACHINE_UUID_FILE (see tools/dbus-launch.c) and reverse
304 + # dependencies with hardcoded paths (although the known ones got fixed already)
305 + # TODO: should be safe to remove at least the ln because of the above tmpfiles_process?
306 + dbus-uuidgen --ensure="${EROOT}"/etc/machine-id
307 + ln -sf "${EPREFIX}"/etc/machine-id "${EROOT}"/var/lib/dbus/machine-id
308 +
309 + if [[ ${CHOST} == *-darwin* ]]; then
310 + local plist="org.freedesktop.dbus-session.plist"
311 + elog
312 + elog
313 + elog "For MacOS/Darwin we now ship launchd support for dbus."
314 + elog "This enables autolaunch of dbus at session login and makes"
315 + elog "dbus usable under MacOS/Darwin."
316 + elog
317 + elog "The launchd plist file ${plist} has been"
318 + elog "installed in ${EPREFIX}/Library/LaunchAgents."
319 + elog "For it to be used, you will have to do all of the following:"
320 + elog " + cd ~/Library/LaunchAgents"
321 + elog " + ln -s ${EPREFIX}/Library/LaunchAgents/${plist}"
322 + elog " + logout and log back in"
323 + elog
324 + elog "If your application needs a proper DBUS_SESSION_BUS_ADDRESS"
325 + elog "specified and refused to start otherwise, then export the"
326 + elog "the following to your environment:"
327 + elog " DBUS_SESSION_BUS_ADDRESS=\"launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET\""
328 + fi
329 +}
330
331 diff --git a/sys-apps/dbus/files/dbus-1.15.0-daemon-optional.patch b/sys-apps/dbus/files/dbus-1.15.0-daemon-optional.patch
332 new file mode 100644
333 index 000000000000..2b9cd03472d8
334 --- /dev/null
335 +++ b/sys-apps/dbus/files/dbus-1.15.0-daemon-optional.patch
336 @@ -0,0 +1,65 @@
337 +https://bugs.gentoo.org/653136
338 +
339 +From 3c08d28fbae8b0ef3839ef26f8d2a713a9a684f9 Mon Sep 17 00:00:00 2001
340 +From: Andreas Sturmlechner <asturm@g.o>
341 +Date: Thu, 21 Feb 2019 23:53:19 +0100
342 +Subject: [PATCH] Make dbus daemon build optional
343 +
344 +--- a/bus/Makefile.am
345 ++++ b/bus/Makefile.am
346 +@@ -76,6 +76,7 @@ agentdir=$(LAUNCHD_AGENT_DIR)
347 + agent_DATA=org.freedesktop.dbus-session.plist
348 + endif
349 +
350 ++if DBUS_DAEMON
351 + if DBUS_BUS_ENABLE_KQUEUE
352 + DIR_WATCH_SOURCE=dir-watch-kqueue.c
353 + else
354 +@@ -230,6 +231,7 @@ EXTRA_DIST += \
355 + tmpfiles.d/dbus.conf.in \
356 + tmpfiles.d/meson.build \
357 + $(NULL)
358 ++endif DBUS_DAEMON
359 +
360 + if HAVE_SYSTEMD
361 + systemdsystemunit_DATA = \
362 +--- a/configure.ac
363 ++++ b/configure.ac
364 +@@ -211,6 +211,7 @@ AC_ARG_ENABLE([apparmor],
365 + [enable_apparmor=$enableval],
366 + [enable_apparmor=auto])
367 + AC_ARG_ENABLE(libaudit,AS_HELP_STRING([--enable-libaudit],[build audit daemon support for SELinux]),enable_libaudit=$enableval,enable_libaudit=auto)
368 ++AC_ARG_ENABLE(daemon, AS_HELP_STRING([--enable-daemon],[build with the dbus daemon]),enable_daemon=$enableval,enable_daemon=yes)
369 + AC_ARG_ENABLE(inotify, AS_HELP_STRING([--enable-inotify],[build with inotify support (linux only)]),enable_inotify=$enableval,enable_inotify=auto)
370 + AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue support]),enable_kqueue=$enableval,enable_kqueue=auto)
371 + AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[enable console owner file]),enable_console_owner_file=$enableval,enable_console_owner_file=auto)
372 +@@ -658,7 +659,20 @@ AC_CHECK_MEMBER([struct unpcbid.unp_pid],
373 + [],
374 + [[#include <sys/un.h>]])
375 +
376 +-PKG_CHECK_MODULES([EXPAT], [expat])
377 ++# dbusdaemon checks
378 ++if test x$enable_daemon = xno ; then
379 ++ have_daemon=no
380 ++else
381 ++ have_daemon=yes
382 ++fi
383 ++
384 ++dnl check if daemon shall be built
385 ++if test x$have_daemon = xyes; then
386 ++ AC_DEFINE(DBUS_DAEMON,1,[Use daemon])
387 ++ PKG_CHECK_MODULES([EXPAT], [expat])
388 ++fi
389 ++
390 ++AM_CONDITIONAL(DBUS_DAEMON, test x$have_daemon = xyes)
391 +
392 + save_cflags="$CFLAGS"
393 + save_libs="$LIBS"
394 +@@ -1748,6 +1762,7 @@ echo "
395 + Building bus stats API: ${enable_stats}
396 + Building SELinux support: ${have_selinux}
397 + Building AppArmor support: ${have_apparmor}
398 ++ Building daemon: ${have_daemon}
399 + Building inotify support: ${have_inotify}
400 + Building kqueue support: ${have_kqueue}
401 + Building elogind support: ${have_elogind}
402
403 diff --git a/sys-apps/dbus/files/dbus-1.15.0-enable-elogind.patch b/sys-apps/dbus/files/dbus-1.15.0-enable-elogind.patch
404 new file mode 100644
405 index 000000000000..a6c0e1bd2153
406 --- /dev/null
407 +++ b/sys-apps/dbus/files/dbus-1.15.0-enable-elogind.patch
408 @@ -0,0 +1,75 @@
409 +https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/53
410 +https://bugs.gentoo.org/599494
411 +--- a/configure.ac
412 ++++ b/configure.ac
413 +@@ -215,6 +215,7 @@ AC_ARG_ENABLE(inotify, AS_HELP_STRING([--enable-inotify],[build with inotify sup
414 + AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue support]),enable_kqueue=$enableval,enable_kqueue=auto)
415 + AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[enable console owner file]),enable_console_owner_file=$enableval,enable_console_owner_file=auto)
416 + AC_ARG_ENABLE(launchd, AS_HELP_STRING([--enable-launchd],[build with launchd auto-launch support]),enable_launchd=$enableval,enable_launchd=auto)
417 ++AC_ARG_ENABLE(elogind, AS_HELP_STRING([--enable-elogind],[build with elogind user seat support]),enable_elogind=$enableval,enable_elogind=auto)
418 + AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[build with systemd at_console support]),enable_systemd=$enableval,enable_systemd=auto)
419 + AC_ARG_ENABLE(traditional-activation, AS_HELP_STRING([--disable-traditional-activation], [Do not build support for service activation without using SystemdService]), enable_traditional_activation="$enableval", enable_traditional_activation=yes)
420 +
421 +@@ -904,6 +905,24 @@ fi
422 +
423 + AM_CONDITIONAL(HAVE_CONSOLE_OWNER_FILE, test x$have_console_owner_file = xyes)
424 +
425 ++dnl elogind detection
426 ++if test x$enable_elogind = xno ; then
427 ++ have_elogind=no;
428 ++else
429 ++ PKG_CHECK_MODULES([ELOGIND],
430 ++ [libelogind >= 209],
431 ++ [have_elogind=yes],
432 ++ [have_elogind=no])
433 ++fi
434 ++
435 ++if test x$have_elogind = xyes; then
436 ++ AC_DEFINE(HAVE_ELOGIND,1,[Have elogind])
437 ++fi
438 ++
439 ++if test x$enable_elogind = xyes -a x$have_elogind != xyes ; then
440 ++ AC_MSG_ERROR([Explicitly requested elogind support, but libelogind not found])
441 ++fi
442 ++
443 + dnl systemd detection
444 + if test x$enable_systemd = xno ; then
445 + have_systemd=no;
446 +@@ -1024,7 +1043,7 @@ if test x$with_valgrind != xno; then
447 + fi
448 +
449 + #### Set up final flags
450 +-LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs $SYSTEMD_LIBS"
451 ++LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs $SYSTEMD_LIBS $ELOGIND_LIBS"
452 + AC_SUBST([LIBDBUS_LIBS])
453 +
454 + ### X11 detection
455 +@@ -1731,6 +1750,7 @@ echo "
456 + Building AppArmor support: ${have_apparmor}
457 + Building inotify support: ${have_inotify}
458 + Building kqueue support: ${have_kqueue}
459 ++ Building elogind support: ${have_elogind}
460 + Building systemd support: ${have_systemd}
461 + Traditional activation: ${enable_traditional_activation}
462 + Building X11 code: ${have_x11}
463 +--- a/dbus/dbus-userdb-util.c
464 ++++ b/dbus/dbus-userdb-util.c
465 +@@ -39,6 +39,9 @@
466 + #ifdef HAVE_SYSTEMD
467 + #include <systemd/sd-login.h>
468 + #endif
469 ++#if HAVE_ELOGIND
470 ++#include <elogind/sd-login.h>
471 ++#endif
472 +
473 + /**
474 + * @addtogroup DBusInternalsUtils
475 +@@ -65,7 +68,7 @@ dbus_bool_t
476 + _dbus_is_console_user (dbus_uid_t uid,
477 + DBusError *error)
478 + {
479 +-#ifdef HAVE_SYSTEMD
480 ++#if defined(HAVE_SYSTEMD) || defined(HAVE_ELOGIND)
481 + /* check if we have logind */
482 + if (access ("/run/systemd/seats/", F_OK) >= 0)
483 + {