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/files/, sys-apps/dbus/
Date: Sun, 27 Mar 2022 23:09:30
Message-Id: 1648420846.74020795b5786fd4963fdd1823c2aa302273a3c5.sam@gentoo
1 commit: 74020795b5786fd4963fdd1823c2aa302273a3c5
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 27 22:38:49 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 27 22:40:46 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74020795
7
8 sys-apps/dbus: add 1.14.0
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 sys-apps/dbus/Manifest | 1 +
13 sys-apps/dbus/dbus-1.14.0.ebuild | 287 +++++++++++++++++++++
14 .../dbus/files/dbus-1.14.0-x-autoconf-fixes.patch | 147 +++++++++++
15 3 files changed, 435 insertions(+)
16
17 diff --git a/sys-apps/dbus/Manifest b/sys-apps/dbus/Manifest
18 index e530cbf7268b..19ec71675e81 100644
19 --- a/sys-apps/dbus/Manifest
20 +++ b/sys-apps/dbus/Manifest
21 @@ -1,2 +1,3 @@
22 DIST dbus-1.12.20.tar.gz 2095511 BLAKE2B b467526e7e0281db7b8c7c178469fe006dab29ccb1ea197c02495bd297e8de766230b68ed86c4a7e05dbe09ca30ce941a15e0bf8030fe0df66c04febf0534b3b SHA512 0964683bc6859374cc94e42e1ec0cdb542cca67971c205fcba4352500b6c0891665b0718e7d85eb060c81cb82e3346c313892bc02384da300ddd306c7eef0056
23 DIST dbus-1.12.22.tar.gz 2108231 BLAKE2B 40c30ad9e48d8ac6b5f1c67726015eb17cb3501372ef2c8ffcd8ad73e4a2f186b80a7bbba094460d4093d1d0a3f1bbb8d83a27724397a8f5312bb8542237e6b7 SHA512 0a716022f9d693fcaf871b6dfb5f242b49a8dd05d3316ec3e530f5129f1d81a2fa9caec795fa62cfdcba6ed21549fdd2f896f9bf1cc9a96e2a7d04f2c7ec7be6
24 +DIST dbus-1.14.0.tar.xz 1360228 BLAKE2B ae0ebc2779e840e2d83f633029f81fba0e35969648dddce0280640dd9bee3f9508aa7fb6aef696d1c4c56d40f91b754941f847525afaee5cc3170ad23a7eddbf SHA512 9bf17a3ebb3cf44722c6fbf24ee56e9dc14d6882fc312f26c7f07459d969424bc2fb63a229139e011804ecc479a8f0eb1a0c83286f8d5a664c5979d12634179f
25
26 diff --git a/sys-apps/dbus/dbus-1.14.0.ebuild b/sys-apps/dbus/dbus-1.14.0.ebuild
27 new file mode 100644
28 index 000000000000..03e772f142c6
29 --- /dev/null
30 +++ b/sys-apps/dbus/dbus-1.14.0.ebuild
31 @@ -0,0 +1,287 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +PYTHON_COMPAT=( python3_{8..10} )
38 +TMPFILES_OPTIONAL=1
39 +
40 +# At least at the moment, while a CMake port exists, it's not recommended
41 +# for distributions.
42 +# https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/CONTRIBUTING.md#L189
43 +inherit autotools flag-o-matic linux-info python-any-r1 readme.gentoo-r1 systemd tmpfiles virtualx multilib-minimal
44 +
45 +DESCRIPTION="A message bus system, a simple way for applications to talk to each other"
46 +HOMEPAGE="https://www.freedesktop.org/wiki/Software/dbus/"
47 +SRC_URI="https://dbus.freedesktop.org/releases/dbus/${P}.tar.xz"
48 +
49 +LICENSE="|| ( AFL-2.1 GPL-2 )"
50 +SLOT="0"
51 +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"
52 +IUSE="debug doc elogind selinux static-libs systemd test X"
53 +RESTRICT="!test? ( test )"
54 +
55 +REQUIRED_USE="?? ( elogind systemd )"
56 +
57 +BDEPEND="
58 + acct-user/messagebus
59 + app-text/xmlto
60 + app-text/docbook-xml-dtd:4.4
61 + sys-devel/autoconf-archive
62 + virtual/pkgconfig
63 + doc? ( app-doc/doxygen )
64 +"
65 +COMMON_DEPEND="
66 + >=dev-libs/expat-2.1.0
67 + elogind? ( sys-auth/elogind )
68 + selinux? ( sys-libs/libselinux )
69 + systemd? ( sys-apps/systemd:0= )
70 + X? (
71 + x11-libs/libX11
72 + x11-libs/libXt
73 + )
74 +"
75 +DEPEND="${COMMON_DEPEND}
76 + dev-libs/expat
77 + test? (
78 + ${PYTHON_DEPS}
79 + >=dev-libs/glib-2.40:2
80 + )
81 +"
82 +RDEPEND="${COMMON_DEPEND}
83 + acct-user/messagebus
84 + selinux? ( sec-policy/selinux-dbus )
85 + systemd? ( virtual/tmpfiles )
86 +"
87 +
88 +DOC_CONTENTS="
89 + Some applications require a session bus in addition to the system
90 + bus. Please see \`man dbus-launch\` for more information.
91 +"
92 +
93 +# out of sources build dir for make check
94 +TBD="${WORKDIR}/${P}-tests-build"
95 +
96 +PATCHES=(
97 + "${FILESDIR}/${PN}-enable-elogind.patch"
98 + "${FILESDIR}/${PN}-daemon-optional.patch" # bug #653136
99 +
100 + "${FILESDIR}/${P}-x-autoconf-fixes.patch"
101 +)
102 +
103 +pkg_setup() {
104 + use test && python-any-r1_pkg_setup
105 +
106 + if use kernel_linux; then
107 + CONFIG_CHECK="~EPOLL"
108 + linux-info_pkg_setup
109 + fi
110 +}
111 +
112 +src_prepare() {
113 + default
114 +
115 + if [[ ${CHOST} == *-solaris* ]]; then
116 + # fix standards conflict, due to gcc being c99 by default nowadays
117 + sed -i \
118 + -e 's/_XOPEN_SOURCE=500/_XOPEN_SOURCE=600/' \
119 + configure.ac || die
120 + fi
121 +
122 + # required for bug #263909, cross-compile so don't remove eautoreconf
123 + eautoreconf
124 +}
125 +
126 +src_configure() {
127 + local rundir=$(usex kernel_linux /run /var/run)
128 +
129 + sed -e "s;@rundir@;${EPREFIX}${rundir};g" "${FILESDIR}"/dbus.initd.in \
130 + > "${T}"/dbus.initd || die
131 +
132 + multilib-minimal_src_configure
133 +}
134 +
135 +multilib_src_configure() {
136 + local docconf myconf testconf
137 +
138 + # so we can get backtraces from apps
139 + case ${CHOST} in
140 + *-mingw*)
141 + # error: unrecognized command line option '-rdynamic', bug #488036
142 + ;;
143 + *)
144 + append-flags -rdynamic
145 + ;;
146 + esac
147 +
148 + # libaudit is *only* used in DBus wrt SELinux support, so disable it, if
149 + # not on an SELinux profile.
150 + myconf=(
151 + --localstatedir="${EPREFIX}/var"
152 + $(use_enable static-libs static)
153 + $(use_enable debug verbose-mode)
154 + --disable-asserts
155 + --disable-checks
156 + $(use_enable selinux)
157 + $(use_enable selinux libaudit)
158 + --disable-apparmor
159 + $(use_enable kernel_linux inotify)
160 + --disable-kqueue
161 + $(use_enable elogind)
162 + $(use_enable systemd)
163 + $(use_enable systemd user-session)
164 + --disable-embedded-tests
165 + --disable-modular-tests
166 + $(use_enable debug stats)
167 + --with-session-socket-dir="${EPREFIX}"/tmp
168 + --with-system-pid-file="${EPREFIX}${rundir}"/dbus.pid
169 + --with-system-socket="${EPREFIX}${rundir}"/dbus/system_bus_socket
170 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
171 + --with-systemduserunitdir="$(systemd_get_userunitdir)"
172 + --with-dbus-user=messagebus
173 + $(use_with X x)
174 + )
175 +
176 + if [[ ${CHOST} == *-darwin* ]]; then
177 + myconf+=(
178 + --enable-launchd
179 + --with-launchd-agent-dir="${EPREFIX}"/Library/LaunchAgents
180 + )
181 + fi
182 +
183 + if multilib_is_native_abi; then
184 + docconf=(
185 + --enable-xml-docs
186 + $(use_enable doc doxygen-docs)
187 + )
188 + else
189 + docconf=(
190 + --disable-xml-docs
191 + --disable-doxygen-docs
192 + )
193 + myconf+=(
194 + --disable-daemon
195 + --disable-selinux
196 + --disable-libaudit
197 + --disable-elogind
198 + --disable-systemd
199 + --without-x
200 + )
201 + fi
202 +
203 + einfo "Running configure in ${BUILD_DIR}"
204 + ECONF_SOURCE="${S}" econf "${myconf[@]}" "${docconf[@]}"
205 +
206 + if multilib_is_native_abi && use test; then
207 + mkdir "${TBD}" || die
208 + cd "${TBD}" || die
209 + testconf=(
210 + $(use_enable test asserts)
211 + $(use_enable test checks)
212 + $(use_enable test embedded-tests)
213 + $(use_enable test stats)
214 + $(has_version dev-libs/dbus-glib && echo --enable-modular-tests)
215 + )
216 + einfo "Running configure in ${TBD}"
217 + ECONF_SOURCE="${S}" econf "${myconf[@]}" "${testconf[@]}"
218 + fi
219 +}
220 +
221 +multilib_src_compile() {
222 + if multilib_is_native_abi; then
223 + # After the compile, it uses a selinuxfs interface to
224 + # check if the SELinux policy has the right support
225 + use selinux && addwrite /selinux/access
226 +
227 + einfo "Running make in ${BUILD_DIR}"
228 + emake
229 +
230 + if use test; then
231 + einfo "Running make in ${TBD}"
232 + emake -C "${TBD}"
233 + fi
234 + else
235 + emake -C dbus libdbus-1.la
236 + fi
237 +}
238 +
239 +src_test() {
240 + # DBUS_TEST_MALLOC_FAILURES=0 to avoid huge test logs
241 + # https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/CONTRIBUTING.md#L231
242 + DBUS_TEST_MALLOC_FAILURES=0 DBUS_VERBOSE=1 virtx emake -j1 -C "${TBD}" check
243 +}
244 +
245 +multilib_src_install() {
246 + if multilib_is_native_abi; then
247 + emake DESTDIR="${D}" install
248 + else
249 + emake DESTDIR="${D}" install-pkgconfigDATA
250 + emake DESTDIR="${D}" -C dbus \
251 + install-libLTLIBRARIES install-dbusincludeHEADERS \
252 + install-nodist_dbusarchincludeHEADERS
253 + fi
254 +}
255 +
256 +multilib_src_install_all() {
257 + newinitd "${T}"/dbus.initd dbus
258 +
259 + if use X; then
260 + # dbus X session script (bug #77504)
261 + # turns out to only work for GDM (and startx). has been merged into
262 + # other desktop (kdm and such scripts)
263 + exeinto /etc/X11/xinit/xinitrc.d
264 + doexe "${FILESDIR}"/80-dbus
265 + fi
266 +
267 + # Needs to exist for dbus sessions to launch
268 + keepdir /usr/share/dbus-1/services
269 + keepdir /etc/dbus-1/{session,system}.d
270 + # machine-id symlink from pkg_postinst()
271 + keepdir /var/lib/dbus
272 + # Let the init script create the /var/run/dbus directory
273 + rm -rf "${ED}"/var/run
274 +
275 + # bug #761763
276 + rm -rf "${ED}"/usr/lib/sysusers.d
277 +
278 + dodoc AUTHORS NEWS README doc/TODO
279 + readme.gentoo_create_doc
280 +
281 + find "${ED}" -name '*.la' -delete || die
282 +}
283 +
284 +pkg_postinst() {
285 + readme.gentoo_print_elog
286 +
287 + if use systemd; then
288 + tmpfiles_process dbus.conf
289 + fi
290 +
291 + # Ensure unique id is generated and put it in /etc wrt bug #370451 but symlink
292 + # for DBUS_MACHINE_UUID_FILE (see tools/dbus-launch.c) and reverse
293 + # dependencies with hardcoded paths (although the known ones got fixed already)
294 + # TODO: should be safe to remove at least the ln because of the above tmpfiles_process?
295 + dbus-uuidgen --ensure="${EROOT}"/etc/machine-id
296 + ln -sf "${EPREFIX}"/etc/machine-id "${EROOT}"/var/lib/dbus/machine-id
297 +
298 + if [[ ${CHOST} == *-darwin* ]]; then
299 + local plist="org.freedesktop.dbus-session.plist"
300 + elog
301 + elog
302 + elog "For MacOS/Darwin we now ship launchd support for dbus."
303 + elog "This enables autolaunch of dbus at session login and makes"
304 + elog "dbus usable under MacOS/Darwin."
305 + elog
306 + elog "The launchd plist file ${plist} has been"
307 + elog "installed in ${EPREFIX}/Library/LaunchAgents."
308 + elog "For it to be used, you will have to do all of the following:"
309 + elog " + cd ~/Library/LaunchAgents"
310 + elog " + ln -s ${EPREFIX}/Library/LaunchAgents/${plist}"
311 + elog " + logout and log back in"
312 + elog
313 + elog "If your application needs a proper DBUS_SESSION_BUS_ADDRESS"
314 + elog "specified and refused to start otherwise, then export the"
315 + elog "the following to your environment:"
316 + elog " DBUS_SESSION_BUS_ADDRESS=\"launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET\""
317 + fi
318 +}
319
320 diff --git a/sys-apps/dbus/files/dbus-1.14.0-x-autoconf-fixes.patch b/sys-apps/dbus/files/dbus-1.14.0-x-autoconf-fixes.patch
321 new file mode 100644
322 index 000000000000..d9eb2a611bfd
323 --- /dev/null
324 +++ b/sys-apps/dbus/files/dbus-1.14.0-x-autoconf-fixes.patch
325 @@ -0,0 +1,147 @@
326 +https://gitlab.freedesktop.org/dbus/dbus/-/commit/7d462fe93844df711ff8433ad798b54e57f8609d.patch
327 +(dropped NEWS to avoid conflicts with more patches in future)
328 +
329 +From fdbb32bd1f3c972d3d5fd3998930749206a1095a Mon Sep 17 00:00:00 2001
330 +From: Lars Wendler <polynomial-c@g.o>
331 +Date: Tue, 1 Mar 2022 15:56:30 +0100
332 +Subject: [PATCH 1/6] build: Treat --with-x[=yes] the same as --with-x=auto
333 +
334 +Previously, --with-x would disable the check for X11 libraries, which
335 +was not intended.
336 +
337 +(cherry picked from commit 99cc28e0eb1a37233c0f7d3595175d1f331550e7)
338 +--- a/configure.ac
339 ++++ b/configure.ac
340 +@@ -1115,7 +1115,7 @@ if test "x$dbus_win" = xyes; then
341 +
342 + enable_x11_autolaunch=no
343 + have_x11=no
344 +-else if test "x$with_x" = xauto; then
345 ++else if test "x$with_x" != xno; then
346 + PKG_CHECK_MODULES([X], [x11],
347 + [AC_DEFINE([HAVE_X11], [1], [Define to 1 if you have X11 library])],
348 + [ have_x11=no ])
349 +GitLab
350 +From 5f2577aea3c5291dbb97e77c7384924851b30102 Mon Sep 17 00:00:00 2001
351 +From: Lars Wendler <polynomial-c@g.o>
352 +Date: Tue, 1 Mar 2022 16:01:29 +0100
353 +Subject: [PATCH 2/6] Move DBUS_X_* definitions into PKG_CHECK_MODULES block
354 +
355 +(cherry picked from commit 51e468d828785cbc7060678f6f257723ba11cd10)
356 +--- a/configure.ac
357 ++++ b/configure.ac
358 +@@ -1117,15 +1117,15 @@ if test "x$dbus_win" = xyes; then
359 + have_x11=no
360 + else if test "x$with_x" != xno; then
361 + PKG_CHECK_MODULES([X], [x11],
362 +- [AC_DEFINE([HAVE_X11], [1], [Define to 1 if you have X11 library])],
363 ++ [AC_DEFINE([HAVE_X11], [1], [Define to 1 if you have X11 library])
364 ++ have_x11=yes
365 ++ DBUS_X_LIBS="$X_LIBS"
366 ++ DBUS_X_CFLAGS="$X_CFLAGS"
367 ++ ],
368 + [ have_x11=no ])
369 +
370 + if test "x$have_x11" = xno; then
371 + AC_MSG_WARN([Couldn't found X11, tried with pkg-config.])
372 +- else
373 +- have_x11=yes
374 +- DBUS_X_LIBS="$X_LIBS"
375 +- DBUS_X_CFLAGS="$X_CFLAGS"
376 + fi
377 + else
378 + AS_IF([test "x$enable_x11_autolaunch" = "xyes"], [
379 +GitLab
380 +From 5dad12f34c54e2359adfe8e7f122681df1d24bcb Mon Sep 17 00:00:00 2001
381 +From: Lars Wendler <polynomial-c@g.o>
382 +Date: Tue, 1 Mar 2022 16:05:52 +0100
383 +Subject: [PATCH 3/6] Emit an error when --with-x was given but no X11 libs
384 + were found
385 +
386 +(cherry picked from commit 17c88a894499da64460a0ef76db1d8b88ceb9eeb)
387 +--- a/configure.ac
388 ++++ b/configure.ac
389 +@@ -1121,12 +1121,13 @@ else if test "x$with_x" != xno; then
390 + have_x11=yes
391 + DBUS_X_LIBS="$X_LIBS"
392 + DBUS_X_CFLAGS="$X_CFLAGS"
393 +- ],
394 +- [ have_x11=no ])
395 +-
396 +- if test "x$have_x11" = xno; then
397 +- AC_MSG_WARN([Couldn't found X11, tried with pkg-config.])
398 +- fi
399 ++ ], [
400 ++ AS_IF([test "x$with_x" = xyes],
401 ++ [AC_MSG_ERROR([Couldn't find X11, tried with pkg-config.])],
402 ++ [AC_MSG_WARN([Couldn't find X11, tried with pkg-config.])]
403 ++ )
404 ++ have_x11=no
405 ++ ])
406 + else
407 + AS_IF([test "x$enable_x11_autolaunch" = "xyes"], [
408 + AC_MSG_ERROR([--enable-x11-autolaunch and --without-x are not compatible])
409 +GitLab
410 +From e03554eb0bf2731e39c06191403f7544df9bb307 Mon Sep 17 00:00:00 2001
411 +From: Lars Wendler <polynomial-c@g.o>
412 +Date: Tue, 1 Mar 2022 16:08:06 +0100
413 +Subject: [PATCH 4/6] Add have_x11=no if --without-x was given to make later
414 + checks happy
415 +
416 +(cherry picked from commit bf3cb42c6db1f4479467d66a111b08a98afef31b)
417 +--- a/configure.ac
418 ++++ b/configure.ac
419 +@@ -1129,6 +1129,7 @@ else if test "x$with_x" != xno; then
420 + have_x11=no
421 + ])
422 + else
423 ++ have_x11=no
424 + AS_IF([test "x$enable_x11_autolaunch" = "xyes"], [
425 + AC_MSG_ERROR([--enable-x11-autolaunch and --without-x are not compatible])
426 + ])
427 +GitLab
428 +From 62361f47f9da2346a9ff9a8c4b4bd4a288dc44d5 Mon Sep 17 00:00:00 2001
429 +From: Lars Wendler <polynomial-c@g.o>
430 +Date: Tue, 1 Mar 2022 16:11:05 +0100
431 +Subject: [PATCH 5/6] Convert "if" calls to AS_IF macro for the block that
432 + handles X11
433 +
434 +(cherry picked from commit c71f013a64cd7f6de4c9cf3cf3b236239d713eb1)
435 +--- a/configure.ac
436 ++++ b/configure.ac
437 +@@ -1108,14 +1108,14 @@ AC_ARG_ENABLE([x11-autolaunch],
438 + AS_HELP_STRING([--enable-x11-autolaunch], [build with X11 auto-launch support]),
439 + [], [enable_x11_autolaunch=auto])
440 +
441 +-if test "x$dbus_win" = xyes; then
442 +- if test "x$enable_x11_autolaunch" = xyes; then
443 ++AS_IF([test "x$dbus_win" = xyes], [
444 ++ AS_IF([test "x$enable_x11_autolaunch" = xyes], [
445 + AC_MSG_ERROR([X11 auto-launch is not supported on Windows])
446 +- fi
447 ++ ])
448 +
449 + enable_x11_autolaunch=no
450 + have_x11=no
451 +-else if test "x$with_x" != xno; then
452 ++], [test "x$with_x" != xno], [
453 + PKG_CHECK_MODULES([X], [x11],
454 + [AC_DEFINE([HAVE_X11], [1], [Define to 1 if you have X11 library])
455 + have_x11=yes
456 +@@ -1128,13 +1128,12 @@ else if test "x$with_x" != xno; then
457 + )
458 + have_x11=no
459 + ])
460 +-else
461 ++], [
462 + have_x11=no
463 + AS_IF([test "x$enable_x11_autolaunch" = "xyes"], [
464 + AC_MSG_ERROR([--enable-x11-autolaunch and --without-x are not compatible])
465 + ])
466 +-fi
467 +-fi
468 ++])
469 +
470 + if test "x$enable_x11_autolaunch,$have_x11" = xyes,no; then
471 + AC_MSG_ERROR([X11 auto-launch requires X headers/libraries])
472 +GitLab