* [gentoo-commits] repo/gentoo:master commit in: sys-apps/dbus/files/, sys-apps/dbus/
@ 2025-02-28 14:44 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2025-02-28 14:44 UTC (permalink / raw
To: gentoo-commits
commit: df5f2d54a6e4b685329a6948239f4574cd8eb679
Author: Anna (navi) Figueiredo Gomes <navi <AT> vlhl <DOT> dev>
AuthorDate: Fri Feb 28 14:39:13 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 28 14:43:57 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df5f2d54
sys-apps/dbus: remove profile.d script for now
Some tools (namely plasma) don't check if the script is valid, and then
deadlocks. Once we have more robust login mechanisms we can re-introduce
those.
Signed-off-by: Anna (navi) Figueiredo Gomes <navi <AT> vlhl.dev>
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/dbus/{dbus-1.16.0-r2.ebuild => dbus-1.16.0-r3.ebuild} | 3 ---
sys-apps/dbus/files/dbus.sh | 7 -------
2 files changed, 10 deletions(-)
diff --git a/sys-apps/dbus/dbus-1.16.0-r2.ebuild b/sys-apps/dbus/dbus-1.16.0-r3.ebuild
similarity index 99%
rename from sys-apps/dbus/dbus-1.16.0-r2.ebuild
rename to sys-apps/dbus/dbus-1.16.0-r3.ebuild
index 15416a5511d7..329294046b7e 100644
--- a/sys-apps/dbus/dbus-1.16.0-r2.ebuild
+++ b/sys-apps/dbus/dbus-1.16.0-r3.ebuild
@@ -161,9 +161,6 @@ multilib_src_install_all() {
exeinto /etc/user/init.d
newexe "${FILESDIR}/dbus.user.initd" dbus
- insinto /etc/profile.d
- doins "${FILESDIR}"/dbus.sh
-
if use X; then
# dbus X session script (bug #77504)
# turns out to only work for GDM (and startx). has been merged into
diff --git a/sys-apps/dbus/files/dbus.sh b/sys-apps/dbus/files/dbus.sh
deleted file mode 100644
index 6111f1e34992..000000000000
--- a/sys-apps/dbus/files/dbus.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License, v2 or later
-#
-if [ -f /run/openrc/softlevel ] && [ -z "$DBUS_SESSION_BUS_ADDRESS" ] \
- && rc-service --user --exists dbus 2>&1 >/dev/null; then
- export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
-fi
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/dbus/files/, sys-apps/dbus/
@ 2025-02-28 13:27 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2025-02-28 13:27 UTC (permalink / raw
To: gentoo-commits
commit: ae6c976da66068635deae9d159c1b2e3bcb2a658
Author: Anna (navi) Figueiredo Gomes <navi <AT> vlhl <DOT> dev>
AuthorDate: Fri Feb 28 13:23:27 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 28 13:27:04 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae6c976d
sys-apps/dbus: fix syntax error in profile.d script
Signed-off-by: Anna (navi) Figueiredo Gomes <navi <AT> vlhl.dev>
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/dbus/{dbus-1.16.0-r1.ebuild => dbus-1.16.0-r2.ebuild} | 0
sys-apps/dbus/files/dbus.sh | 2 +-
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys-apps/dbus/dbus-1.16.0-r1.ebuild b/sys-apps/dbus/dbus-1.16.0-r2.ebuild
similarity index 100%
rename from sys-apps/dbus/dbus-1.16.0-r1.ebuild
rename to sys-apps/dbus/dbus-1.16.0-r2.ebuild
diff --git a/sys-apps/dbus/files/dbus.sh b/sys-apps/dbus/files/dbus.sh
index f2c34efad51f..6111f1e34992 100644
--- a/sys-apps/dbus/files/dbus.sh
+++ b/sys-apps/dbus/files/dbus.sh
@@ -1,7 +1,7 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License, v2 or later
#
-if [ -f /run/openrc/softlevel ] && [ -z "$DBUS_SESSION_BUS_ADDRESS" ]
+if [ -f /run/openrc/softlevel ] && [ -z "$DBUS_SESSION_BUS_ADDRESS" ] \
&& rc-service --user --exists dbus 2>&1 >/dev/null; then
export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
fi
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/dbus/files/, sys-apps/dbus/
@ 2025-02-09 8:20 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2025-02-09 8:20 UTC (permalink / raw
To: gentoo-commits
commit: 45c607a6f6541f8d438283a9a2cec62bf2eaab3a
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 9 08:20:15 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 9 08:20:15 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45c607a6
sys-apps/dbus: add 1.16.0
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/dbus/Manifest | 1 +
sys-apps/dbus/dbus-1.16.0.ebuild | 221 +++++++++++++++++++++
.../dbus/files/dbus-1.16.0-enable-elogind.patch | 103 ++++++++++
3 files changed, 325 insertions(+)
diff --git a/sys-apps/dbus/Manifest b/sys-apps/dbus/Manifest
index 9812c01b65ba..fde42a8a7bf5 100644
--- a/sys-apps/dbus/Manifest
+++ b/sys-apps/dbus/Manifest
@@ -1 +1,2 @@
DIST dbus-1.15.8.tar.xz 1149088 BLAKE2B 7c1962dfccc6a1b6250e80b0706d7f44536fabeff009013865ec4b1edaec6d4b47dcbe8f78caa61ef7aef4bac6b79f0e2027dd16bbb2baae328429e648bf8b8c SHA512 84b8ac194ede3bf300f4501395b7253538469a4f9d59ea4adaf800282e359ef43494d81941b338081d3704317d39f0aba14906c6490419f04f946eb9d815f46c
+DIST dbus-1.16.0.tar.xz 1114680 BLAKE2B a5a3ebe777c1c0296ba7240f9ed29ad329a6578a05baf10a469ce8c7d243791d35aca42a70d04cdd88feea238d081c3c8b0db444df24abcf7ce5ffe9187a0440 SHA512 9206bf4e41575f379e4c615212d137600967311f3c8feac94692aadf4dca9df9169ae52c404ec8ed31a9b2bc718792be920ac0130f1159f082e4b6c66f3f233e
diff --git a/sys-apps/dbus/dbus-1.16.0.ebuild b/sys-apps/dbus/dbus-1.16.0.ebuild
new file mode 100644
index 000000000000..ce3cee9230e9
--- /dev/null
+++ b/sys-apps/dbus/dbus-1.16.0.ebuild
@@ -0,0 +1,221 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Be careful with packaging odd-version-number branches!
+# We should at the very least keep stable as an upstream stable branch,
+# possibly even ~arch too, given the note about security releases on their website.
+# See https://www.freedesktop.org/wiki/Software/dbus/#download.
+
+PYTHON_COMPAT=( python3_{10..13} )
+TMPFILES_OPTIONAL=1
+
+inherit linux-info meson-multilib python-any-r1 readme.gentoo-r1 systemd tmpfiles virtualx
+
+DESCRIPTION="A message bus system, a simple way for applications to talk to each other"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/dbus/"
+SRC_URI="https://dbus.freedesktop.org/releases/dbus/${P}.tar.xz"
+
+LICENSE="|| ( AFL-2.1 GPL-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
+# TODO: USE=daemon
+IUSE="debug doc elogind selinux static-libs systemd test valgrind X"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ ${PYTHON_DEPS}
+ acct-user/messagebus
+ app-text/xmlto
+ app-text/docbook-xml-dtd:4.4
+ dev-build/autoconf-archive
+ virtual/pkgconfig
+ doc? ( app-text/doxygen )
+"
+COMMON_DEPEND="
+ >=dev-libs/expat-2.1.0
+ elogind? ( sys-auth/elogind )
+ selinux? (
+ sys-process/audit
+ sys-libs/libselinux
+ )
+ systemd? ( sys-apps/systemd:= )
+ X? (
+ x11-libs/libX11
+ x11-libs/libXt
+ )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ dev-libs/expat
+ test? ( >=dev-libs/glib-2.40:2[${MULTILIB_USEDEP}] )
+ valgrind? ( >=dev-debug/valgrind-3.6 )
+ X? ( x11-base/xorg-proto )
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ acct-user/messagebus
+ selinux? ( sec-policy/selinux-dbus )
+ systemd? ( virtual/tmpfiles )
+"
+
+DOC_CONTENTS="
+ Some applications require a session bus in addition to the system
+ bus. Please see \`man dbus-launch\` for more information.
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.16.0-enable-elogind.patch # bug #599494
+)
+
+pkg_setup() {
+ # Python interpeter required unconditionally (bug #932517)
+ python-any-r1_pkg_setup
+
+ if use kernel_linux; then
+ CONFIG_CHECK="~EPOLL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_configure() {
+ local rundir=$(usex kernel_linux /run /var/run)
+
+ sed -e "s;@rundir@;${EPREFIX}${rundir};g" "${FILESDIR}"/dbus.initd.in \
+ > "${T}"/dbus.initd || die
+
+ meson-multilib_src_configure
+}
+
+multilib_src_configure() {
+ local emesonargs=(
+ --localstatedir="${EPREFIX}/var"
+ -Druntime_dir="${EPREFIX}${rundir}"
+
+ -Ddefault_library=$(multilib_native_usex static-libs both shared)
+
+ -Dapparmor=disabled
+ -Dasserts=false # TODO
+ -Dchecks=false # TODO
+ $(meson_use debug stats)
+ $(meson_use debug verbose_mode)
+ -Ddbus_user=messagebus
+ -Dkqueue=disabled
+ $(meson_feature kernel_linux inotify)
+ $(meson_native_use_feature doc doxygen_docs)
+ $(meson_native_enabled xml_docs) # Controls man pages
+
+ -Dinstalled_tests=false
+ $(meson_native_true message_bus) # TODO: USE=daemon?
+ $(meson_feature test modular_tests)
+ -Dqt_help=disabled
+
+ $(meson_native_true tools)
+
+ $(meson_native_use_feature elogind)
+ $(meson_native_use_feature systemd)
+ $(meson_use systemd user_session)
+ $(meson_native_use_feature X x11_autolaunch)
+ $(meson_native_use_feature valgrind)
+
+ # libaudit is *only* used in DBus wrt SELinux support, so disable it if
+ # not on an SELinux profile.
+ $(meson_native_use_feature selinux)
+ $(meson_native_use_feature selinux libaudit)
+
+ -Dsession_socket_dir="${EPREFIX}"/tmp
+ -Dsystem_pid_file="${EPREFIX}${rundir}"/dbus.pid
+ -Dsystem_socket="${EPREFIX}${rundir}"/dbus/system_bus_socket
+ -Dsystemd_system_unitdir="$(systemd_get_systemunitdir)"
+ -Dsystemd_user_unitdir="$(systemd_get_userunitdir)"
+ )
+
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ emesonargs+=(
+ -Dlaunchd=enabled
+ -Dlaunchd_agent_dir="${EPREFIX}"/Library/LaunchAgents
+ )
+ fi
+
+ meson_src_configure
+}
+
+multilib_src_compile() {
+ # After the compile, it uses a selinuxfs interface to
+ # check if the SELinux policy has the right support
+ use selinux && addwrite /selinux/access
+
+ meson_src_compile
+}
+
+multilib_src_test() {
+ # DBUS_TEST_MALLOC_FAILURES=0 to avoid huge test logs
+ # https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/CONTRIBUTING.md#L231
+ DBUS_TEST_MALLOC_FAILURES=0 DBUS_VERBOSE=1 virtx meson_src_test
+
+}
+
+multilib_src_install_all() {
+ newinitd "${T}"/dbus.initd dbus
+
+ if use X; then
+ # dbus X session script (bug #77504)
+ # turns out to only work for GDM (and startx). has been merged into
+ # other desktop (kdm and such scripts)
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/80-dbus-r1 80-dbus
+ fi
+
+ # Needs to exist for dbus sessions to launch
+ keepdir /usr/share/dbus-1/services
+ keepdir /etc/dbus-1/{session,system}.d
+ # machine-id symlink from pkg_postinst()
+ keepdir /var/lib/dbus
+ # Let the init script create the /var/run/dbus directory
+ rm -rf "${ED}"/{,var/}run
+
+ # bug #761763
+ rm -rf "${ED}"/usr/lib/sysusers.d
+
+ dodoc AUTHORS NEWS README doc/TODO
+ readme.gentoo_create_doc
+
+ mv "${ED}"/usr/share/doc/dbus/* "${ED}"/usr/share/doc/${PF}/ || die
+ rm -rf "${ED}"/usr/share/doc/dbus || die
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+
+ if use systemd; then
+ tmpfiles_process dbus.conf
+ fi
+
+ # Ensure unique id is generated and put it in /etc wrt bug #370451 but symlink
+ # for DBUS_MACHINE_UUID_FILE (see tools/dbus-launch.c) and reverse
+ # dependencies with hardcoded paths (although the known ones got fixed already)
+ # TODO: should be safe to remove at least the ln because of the above tmpfiles_process?
+ dbus-uuidgen --ensure="${EROOT}"/etc/machine-id
+ ln -sf "${EPREFIX}"/etc/machine-id "${EROOT}"/var/lib/dbus/machine-id
+
+ if [[ ${CHOST} == *-darwin* ]]; then
+ local plist="org.freedesktop.dbus-session.plist"
+ elog
+ elog "For MacOS/Darwin we now ship launchd support for dbus."
+ elog "This enables autolaunch of dbus at session login and makes"
+ elog "dbus usable under MacOS/Darwin."
+ elog
+ elog "The launchd plist file ${plist} has been"
+ elog "installed in ${EPREFIX}/Library/LaunchAgents."
+ elog "For it to be used, you will have to do all of the following:"
+ elog " + cd ~/Library/LaunchAgents"
+ elog " + ln -s ${EPREFIX}/Library/LaunchAgents/${plist}"
+ elog " + logout and log back in"
+ elog
+ elog "If your application needs a proper DBUS_SESSION_BUS_ADDRESS"
+ elog "specified and refused to start otherwise, then export the"
+ elog "the following to your environment:"
+ elog " DBUS_SESSION_BUS_ADDRESS=\"launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET\""
+ fi
+}
diff --git a/sys-apps/dbus/files/dbus-1.16.0-enable-elogind.patch b/sys-apps/dbus/files/dbus-1.16.0-enable-elogind.patch
new file mode 100644
index 000000000000..6403c03d4418
--- /dev/null
+++ b/sys-apps/dbus/files/dbus-1.16.0-enable-elogind.patch
@@ -0,0 +1,103 @@
+https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/509
+
+From a10cfc2ed95b04063826911111819fff5e837d6f Mon Sep 17 00:00:00 2001
+From: Dudemanguy <random342@airmail.cc>
+Date: Fri, 20 Dec 2024 10:53:28 -0600
+Subject: [PATCH] build: add elogind support
+
+Checking the uid of the user seat also works if elogind is used. Add
+this as an option to the build and make it mutually exclusive with
+enabling systemd.
+---
+ dbus/dbus-userdb-util.c | 6 +++++-
+ dbus/meson.build | 1 +
+ meson.build | 12 ++++++++++++
+ meson_options.txt | 7 +++++++
+ 4 files changed, 25 insertions(+), 1 deletion(-)
+
+diff --git a/dbus/dbus-userdb-util.c b/dbus/dbus-userdb-util.c
+index 736244955..a7b611309 100644
+--- a/dbus/dbus-userdb-util.c
++++ b/dbus/dbus-userdb-util.c
+@@ -42,6 +42,10 @@
+ #include <systemd/sd-login.h>
+ #endif
+
++#ifdef HAVE_ELOGIND
++#include <elogind/sd-login.h>
++#endif
++
+ /**
+ * @addtogroup DBusInternalsUtils
+ * @{
+@@ -67,7 +71,7 @@ dbus_bool_t
+ _dbus_is_console_user (dbus_uid_t uid,
+ DBusError *error)
+ {
+-#ifdef HAVE_SYSTEMD
++#if defined(HAVE_SYSTEMD) || defined(HAVE_ELOGIND)
+ /* check if we have logind */
+ if (access ("/run/systemd/seats/", F_OK) >= 0)
+ {
+diff --git a/dbus/meson.build b/dbus/meson.build
+index d2acd0594..0e543069e 100644
+--- a/dbus/meson.build
++++ b/dbus/meson.build
+@@ -24,6 +24,7 @@ dbus_dependencies = [
+ adt_libs,
+ network_libs,
+ systemd,
++ elogind,
+ valgrind.partial_dependency(compile_args: true),
+ ]
+
+diff --git a/meson.build b/meson.build
+index 97d14593f..5f24ba3af 100644
+--- a/meson.build
++++ b/meson.build
+@@ -519,6 +519,17 @@ else
+ endif
+ data_config.set('SYSTEMCTL', systemctl)
+
++elogind_opt = get_option('elogind')
++if use_systemd
++ if elogind_opt.enabled()
++ error('-Dsystemd and -Delogind are mutually exclusive')
++ endif
++ elogind = dependency('', required: false)
++else
++ elogind = dependency('libelogind', version: '>=209', required: elogind_opt)
++endif
++use_elogind = elogind.found()
++config.set('HAVE_ELOGIND', use_elogind)
+
+
+ use_traditional_activation = message_bus and get_option('traditional_activation')
+@@ -1361,6 +1372,7 @@ summary_dict += {
+ 'Building inotify support': use_inotify,
+ 'Building kqueue support': use_kqueue,
+ 'Building systemd support': use_systemd,
++ 'Building elogind support': use_elogind,
+ 'Traditional activation': use_traditional_activation,
+ 'Building X11 code': config.get('DBUS_BUILD_X11'),
+ 'Building Doxygen docs': doxygen.found(),
+diff --git a/meson_options.txt b/meson_options.txt
+index 1bd00579f..9a56fb825 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -95,6 +95,13 @@ option(
+ description: 'Enable tests that require insecure extra code in the library and binaries'
+ )
+
++option(
++ 'elogind',
++ type: 'feature',
++ value: 'disabled',
++ description: 'Use elogind for detecting user sessions'
++)
++
+ option(
+ 'epoll',
+ type: 'feature',
+--
+GitLab
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/dbus/files/, sys-apps/dbus/
@ 2023-09-02 16:21 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2023-09-02 16:21 UTC (permalink / raw
To: gentoo-commits
commit: c4f4edf10c8483631a77948a50f2b9308adf5cef
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 2 16:14:01 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep 2 16:17:12 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4f4edf1
sys-apps/dbus: add 1.15.8
Upstream have dropped non-meson support, so here we go!
Rebased the elogind patch reluctantly, but I've dropped the REQUIRED_USE
for one-of systemd/elogind, given floppym's analysis on the bug. The functionality
provided by elogind here is pretty minimal and it doesn't appear required at all,
so it doesn't make sense to force it.
Bug: https://bugs.gentoo.org/599494
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/dbus/Manifest | 1 +
sys-apps/dbus/dbus-1.15.8.ebuild | 232 +++++++++++++++++++++
.../dbus/files/dbus-1.15.8-enable-elogind.patch | 65 ++++++
3 files changed, 298 insertions(+)
diff --git a/sys-apps/dbus/Manifest b/sys-apps/dbus/Manifest
index e0263135e574..38dd813835d5 100644
--- a/sys-apps/dbus/Manifest
+++ b/sys-apps/dbus/Manifest
@@ -1,2 +1,3 @@
DIST dbus-1.15.4.tar.xz 1404576 BLAKE2B 6007be414497ef95f1e6a7e937c6a0a9b590c163b6b3a1c3e61b6726b988192728aa85a328d89472f34613d48ca1bb6844e86bee997acb4f377a228b2072fbce SHA512 53a5b7161940c5d4432b902c3c0ac1f1965978e3791a640d1a71f2d819474b727497f7a13c95d7c5850baef659062f1434296a3f5e56701383cc573dfbf187ee
DIST dbus-1.15.6.tar.xz 1406672 BLAKE2B 5c2b876ede784a82c43096e82c3fa4b905cab26aa8f27e5553d07c53bde6120854cd9b109f3f179e9b47ecd7e2b69c08655b96d821c7790c1c9f52bb6356d331 SHA512 8c2e207d98245d5f8d358e9824be9e8646af8147958e8bd56e18d478e8976e58a6645ee1aba62451fcc58443157e2a39c4a6ed9c2e440e7b6b05053d022f0113
+DIST dbus-1.15.8.tar.xz 1149088 BLAKE2B 7c1962dfccc6a1b6250e80b0706d7f44536fabeff009013865ec4b1edaec6d4b47dcbe8f78caa61ef7aef4bac6b79f0e2027dd16bbb2baae328429e648bf8b8c SHA512 84b8ac194ede3bf300f4501395b7253538469a4f9d59ea4adaf800282e359ef43494d81941b338081d3704317d39f0aba14906c6490419f04f946eb9d815f46c
diff --git a/sys-apps/dbus/dbus-1.15.8.ebuild b/sys-apps/dbus/dbus-1.15.8.ebuild
new file mode 100644
index 000000000000..c783689b9742
--- /dev/null
+++ b/sys-apps/dbus/dbus-1.15.8.ebuild
@@ -0,0 +1,232 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Be careful with packaging odd-version-number branches!
+# After >1.15, we should at least keep stable as an upstream stable branch,
+# possibly even ~arch too, given the note about security releases on their website.
+# See https://www.freedesktop.org/wiki/Software/dbus/#download.
+
+PYTHON_COMPAT=( python3_{10..12} )
+TMPFILES_OPTIONAL=1
+
+inherit linux-info meson-multilib python-any-r1 readme.gentoo-r1 systemd tmpfiles virtualx
+
+DESCRIPTION="A message bus system, a simple way for applications to talk to each other"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/dbus/"
+SRC_URI="https://dbus.freedesktop.org/releases/dbus/${P}.tar.xz"
+
+LICENSE="|| ( AFL-2.1 GPL-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
+# TODO: USE=daemon
+IUSE="debug doc elogind selinux static-libs systemd test valgrind X"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ acct-user/messagebus
+ app-text/xmlto
+ app-text/docbook-xml-dtd:4.4
+ sys-devel/autoconf-archive
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+"
+COMMON_DEPEND="
+ >=dev-libs/expat-2.1.0
+ elogind? ( sys-auth/elogind )
+ selinux? (
+ sys-process/audit
+ sys-libs/libselinux
+ )
+ systemd? ( sys-apps/systemd:= )
+ X? (
+ x11-libs/libX11
+ x11-libs/libXt
+ )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ dev-libs/expat
+ test? (
+ ${PYTHON_DEPS}
+ >=dev-libs/glib-2.40:2
+ )
+ valgrind? ( >=dev-util/valgrind-3.6 )
+ X? ( x11-base/xorg-proto )
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ acct-user/messagebus
+ selinux? ( sec-policy/selinux-dbus )
+ systemd? ( virtual/tmpfiles )
+"
+
+DOC_CONTENTS="
+ Some applications require a session bus in addition to the system
+ bus. Please see \`man dbus-launch\` for more information.
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.15.8-enable-elogind.patch # bug #599494
+)
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+
+ if use kernel_linux; then
+ CONFIG_CHECK="~EPOLL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_configure() {
+ local rundir=$(usex kernel_linux /run /var/run)
+
+ sed -e "s;@rundir@;${EPREFIX}${rundir};g" "${FILESDIR}"/dbus.initd.in \
+ > "${T}"/dbus.initd || die
+
+ meson-multilib_src_configure
+}
+
+multilib_src_configure() {
+ local emesonargs=(
+ --localstatedir="${EPREFIX}/var"
+ -Druntime_dir="${EPREFIX}${rundir}"
+
+ -Ddefault_library=$(multilib_native_usex static-libs both shared)
+
+ -Dapparmor=disabled
+ -Dasserts=false # TODO
+ -Dchecks=false # TODO
+ $(meson_use debug stats)
+ $(meson_use debug verbose_mode)
+ -Dcontainers=false
+ -Ddbus_user=messagebus
+ -Dkqueue=disabled
+ $(meson_feature kernel_linux inotify)
+ $(meson_native_use_feature doc doxygen_docs)
+ $(meson_native_enabled xml_docs) # Controls man pages
+
+ -Dembedded_tests=false
+ -Dinstalled_tests=false
+ $(meson_native_true message_bus) # TODO: USE=daemon?
+ $(meson_feature test modular_tests)
+ -Dqt_help=disabled
+
+ $(meson_native_true tools)
+
+ $(meson_feature elogind)
+ $(meson_feature systemd)
+ $(meson_use systemd user_session)
+ $(meson_feature X x11_autolaunch)
+ $(meson_native_use_feature valgrind)
+
+ # libaudit is *only* used in DBus wrt SELinux support, so disable it if
+ # not on an SELinux profile.
+ $(meson_feature selinux)
+ $(meson_feature selinux libaudit)
+
+ -Dsession_socket_dir="${EPREFIX}"/tmp
+ -Dsystem_pid_file="${EPREFIX}${rundir}"/dbus.pid
+ -Dsystem_socket="${EPREFIX}${rundir}"/dbus/system_bus_socket
+ -Dsystemd_system_unitdir="$(systemd_get_systemunitdir)"
+ -Dsystemd_user_unitdir="$(systemd_get_userunitdir)"
+ )
+
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ emesonargs+=(
+ -Dlaunchd=enabled
+ -Dlaunchd_agent_dir="${EPREFIX}"/Library/LaunchAgents
+ )
+ fi
+
+ meson_src_configure
+}
+
+amultilib_src_configure() {
+ myconf=(
+ $(use_enable static-libs static)
+ )
+
+ # $(has_version dev-libs/dbus-glib && echo --enable-modular-tests)
+}
+
+multilib_src_compile() {
+ # After the compile, it uses a selinuxfs interface to
+ # check if the SELinux policy has the right support
+ use selinux && addwrite /selinux/access
+
+ meson_src_compile
+}
+
+multilib_src_test() {
+ # DBUS_TEST_MALLOC_FAILURES=0 to avoid huge test logs
+ # https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/CONTRIBUTING.md#L231
+ DBUS_TEST_MALLOC_FAILURES=0 DBUS_VERBOSE=1 virtx meson_src_test
+
+}
+
+multilib_src_install_all() {
+ newinitd "${T}"/dbus.initd dbus
+
+ if use X; then
+ # dbus X session script (bug #77504)
+ # turns out to only work for GDM (and startx). has been merged into
+ # other desktop (kdm and such scripts)
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/80-dbus-r1 80-dbus
+ fi
+
+ # Needs to exist for dbus sessions to launch
+ keepdir /usr/share/dbus-1/services
+ keepdir /etc/dbus-1/{session,system}.d
+ # machine-id symlink from pkg_postinst()
+ keepdir /var/lib/dbus
+ # Let the init script create the /var/run/dbus directory
+ rm -rf "${ED}"/{,var/}run
+
+ # bug #761763
+ rm -rf "${ED}"/usr/lib/sysusers.d
+
+ dodoc AUTHORS NEWS README doc/TODO
+ readme.gentoo_create_doc
+
+ mv "${ED}"/usr/share/doc/dbus/* "${ED}"/usr/share/doc/${PF}/ || die
+ rm -rf "${ED}"/usr/share/doc/dbus || die
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+
+ if use systemd; then
+ tmpfiles_process dbus.conf
+ fi
+
+ # Ensure unique id is generated and put it in /etc wrt bug #370451 but symlink
+ # for DBUS_MACHINE_UUID_FILE (see tools/dbus-launch.c) and reverse
+ # dependencies with hardcoded paths (although the known ones got fixed already)
+ # TODO: should be safe to remove at least the ln because of the above tmpfiles_process?
+ dbus-uuidgen --ensure="${EROOT}"/etc/machine-id
+ ln -sf "${EPREFIX}"/etc/machine-id "${EROOT}"/var/lib/dbus/machine-id
+
+ if [[ ${CHOST} == *-darwin* ]]; then
+ local plist="org.freedesktop.dbus-session.plist"
+ elog
+ elog "For MacOS/Darwin we now ship launchd support for dbus."
+ elog "This enables autolaunch of dbus at session login and makes"
+ elog "dbus usable under MacOS/Darwin."
+ elog
+ elog "The launchd plist file ${plist} has been"
+ elog "installed in ${EPREFIX}/Library/LaunchAgents."
+ elog "For it to be used, you will have to do all of the following:"
+ elog " + cd ~/Library/LaunchAgents"
+ elog " + ln -s ${EPREFIX}/Library/LaunchAgents/${plist}"
+ elog " + logout and log back in"
+ elog
+ elog "If your application needs a proper DBUS_SESSION_BUS_ADDRESS"
+ elog "specified and refused to start otherwise, then export the"
+ elog "the following to your environment:"
+ elog " DBUS_SESSION_BUS_ADDRESS=\"launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET\""
+ fi
+}
diff --git a/sys-apps/dbus/files/dbus-1.15.8-enable-elogind.patch b/sys-apps/dbus/files/dbus-1.15.8-enable-elogind.patch
new file mode 100644
index 000000000000..1cf9094990e6
--- /dev/null
+++ b/sys-apps/dbus/files/dbus-1.15.8-enable-elogind.patch
@@ -0,0 +1,65 @@
+https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/53
+https://bugs.gentoo.org/599494
+
+Especially see https://bugs.gentoo.org/599494#c21 - this functionality isn't
+particularly required. The only known consumer at the moment is hplip.
+--- a/dbus/dbus-userdb-util.c
++++ b/dbus/dbus-userdb-util.c
+@@ -41,6 +41,9 @@
+ #ifdef HAVE_SYSTEMD
+ #include <systemd/sd-login.h>
+ #endif
++#if HAVE_ELOGIND
++#include <elogind/sd-login.h>
++#endif
+
+ /**
+ * @addtogroup DBusInternalsUtils
+@@ -67,7 +70,7 @@ dbus_bool_t
+ _dbus_is_console_user (dbus_uid_t uid,
+ DBusError *error)
+ {
+-#ifdef HAVE_SYSTEMD
++#if defined(HAVE_SYSTEMD) || defined(HAVE_ELOGIND)
+ /* check if we have logind */
+ if (access ("/run/systemd/seats/", F_OK) >= 0)
+ {
+--- a/dbus/meson.build
++++ b/dbus/meson.build
+@@ -23,6 +23,7 @@ dbus_dependencies = [
+ threads,
+ network_libs,
+ systemd,
++ elogind,
+ valgrind.partial_dependency(compile_args: true),
+ ]
+
+--- a/meson.build
++++ b/meson.build
+@@ -478,6 +478,10 @@ if use_launchd
+ endif
+ endif
+
++elogind = dependency('elogind', version: '>=209', required: get_option('elogind'))
++use_elogind = elogind.found()
++config.set('HAVE_ELOGIND', use_elogind)
++
+ systemd = dependency('libsystemd', version: '>=209', required: get_option('systemd'))
+ use_systemd = systemd.found()
+ config.set('HAVE_SYSTEMD', use_systemd)
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -244,6 +244,13 @@ option(
+ description: 'Systemd at_console support'
+ )
+
++option(
++ 'elogind',
++ type: 'feature',
++ value: 'auto',
++ description: 'elogind at_console support'
++)
++
+ option(
+ 'test_socket_dir',
+ type: 'string',
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/dbus/files/, sys-apps/dbus/
@ 2022-09-12 18:04 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2022-09-12 18:04 UTC (permalink / raw
To: gentoo-commits
commit: d1a79e781bbe17899a96df6137118e6a03076737
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 12 17:39:27 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 18:04:15 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1a79e78
sys-apps/dbus: fix configure tests with Clang 15
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/dbus/dbus-1.14.0-r5.ebuild | 294 +++++++++++++++++++++
.../files/dbus-1.14.0-clang-15-configure.patch | 26 ++
2 files changed, 320 insertions(+)
diff --git a/sys-apps/dbus/dbus-1.14.0-r5.ebuild b/sys-apps/dbus/dbus-1.14.0-r5.ebuild
new file mode 100644
index 000000000000..64f28fbcc48f
--- /dev/null
+++ b/sys-apps/dbus/dbus-1.14.0-r5.ebuild
@@ -0,0 +1,294 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+TMPFILES_OPTIONAL=1
+
+# At least at the moment, while a CMake port exists, it's not recommended
+# for distributions.
+# https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/CONTRIBUTING.md#L189
+inherit autotools flag-o-matic linux-info python-any-r1 readme.gentoo-r1 systemd tmpfiles virtualx multilib-minimal
+
+DESCRIPTION="A message bus system, a simple way for applications to talk to each other"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/dbus/"
+SRC_URI="https://dbus.freedesktop.org/releases/dbus/${P}.tar.xz"
+
+LICENSE="|| ( AFL-2.1 GPL-2 )"
+SLOT="0"
+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"
+IUSE="debug doc elogind selinux static-libs systemd test X"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="?? ( elogind systemd )"
+
+BDEPEND="
+ acct-user/messagebus
+ app-text/xmlto
+ app-text/docbook-xml-dtd:4.4
+ sys-devel/autoconf-archive
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+"
+COMMON_DEPEND="
+ >=dev-libs/expat-2.1.0
+ elogind? ( sys-auth/elogind )
+ selinux? ( sys-libs/libselinux )
+ systemd? ( sys-apps/systemd:0= )
+ X? (
+ x11-libs/libX11
+ x11-libs/libXt
+ )
+"
+DEPEND="${COMMON_DEPEND}
+ dev-libs/expat
+ test? (
+ ${PYTHON_DEPS}
+ >=dev-libs/glib-2.40:2
+ )
+"
+RDEPEND="${COMMON_DEPEND}
+ acct-user/messagebus
+ selinux? ( sec-policy/selinux-dbus )
+ systemd? ( virtual/tmpfiles )
+"
+
+DOC_CONTENTS="
+ Some applications require a session bus in addition to the system
+ bus. Please see \`man dbus-launch\` for more information.
+"
+
+# out of sources build dir for make check
+TBD="${WORKDIR}/${P}-tests-build"
+
+PATCHES=(
+ "${FILESDIR}/dbus-enable-elogind.patch"
+ "${FILESDIR}/dbus-daemon-optional.patch" # bug #653136
+
+ "${FILESDIR}/dbus-1.14.0-x-autoconf-fixes.patch"
+ "${FILESDIR}/dbus-1.12.22-check-fd.patch"
+
+ # https://bugs.gentoo.org/836560
+ "${FILESDIR}/dbus-1.14.0-oom_score_adj.patch"
+
+ "${FILESDIR}/dbus-1.14.0-clang-15-configure.patch"
+)
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+
+ if use kernel_linux; then
+ CONFIG_CHECK="~EPOLL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ default
+
+ if [[ ${CHOST} == *-solaris* ]]; then
+ # fix standards conflict, due to gcc being c99 by default nowadays
+ sed -i \
+ -e 's/_XOPEN_SOURCE=500/_XOPEN_SOURCE=600/' \
+ configure.ac || die
+ fi
+
+ # required for bug #263909, cross-compile so don't remove eautoreconf
+ eautoreconf
+}
+
+src_configure() {
+ local rundir=$(usex kernel_linux /run /var/run)
+
+ sed -e "s;@rundir@;${EPREFIX}${rundir};g" "${FILESDIR}"/dbus.initd.in \
+ > "${T}"/dbus.initd || die
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local docconf myconf testconf
+
+ # so we can get backtraces from apps
+ case ${CHOST} in
+ *-mingw*)
+ # error: unrecognized command line option '-rdynamic', bug #488036
+ ;;
+ *)
+ append-flags -rdynamic
+ ;;
+ esac
+
+ # libaudit is *only* used in DBus wrt SELinux support, so disable it, if
+ # not on an SELinux profile.
+ myconf=(
+ --localstatedir="${EPREFIX}/var"
+ $(use_enable static-libs static)
+ $(use_enable debug verbose-mode)
+ --disable-asserts
+ --disable-checks
+ $(use_enable selinux)
+ $(use_enable selinux libaudit)
+ --disable-apparmor
+ $(use_enable kernel_linux inotify)
+ --disable-kqueue
+ $(use_enable elogind)
+ $(use_enable systemd)
+ $(use_enable systemd user-session)
+ --disable-embedded-tests
+ --disable-modular-tests
+ $(use_enable debug stats)
+ --with-session-socket-dir="${EPREFIX}"/tmp
+ --with-system-pid-file="${EPREFIX}${rundir}"/dbus.pid
+ --with-system-socket="${EPREFIX}${rundir}"/dbus/system_bus_socket
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+ --with-systemduserunitdir="$(systemd_get_userunitdir)"
+ --with-dbus-user=messagebus
+ $(use_with X x)
+ )
+
+ if [[ ${CHOST} == *-darwin* ]]; then
+ myconf+=(
+ --enable-launchd
+ --with-launchd-agent-dir="${EPREFIX}"/Library/LaunchAgents
+ )
+ fi
+
+ if multilib_is_native_abi; then
+ docconf=(
+ --enable-xml-docs
+ $(use_enable doc doxygen-docs)
+ )
+ else
+ docconf=(
+ --disable-xml-docs
+ --disable-doxygen-docs
+ )
+ myconf+=(
+ --disable-daemon
+ --disable-selinux
+ --disable-libaudit
+ --disable-elogind
+ --disable-systemd
+ --without-x
+ )
+ fi
+
+ einfo "Running configure in ${BUILD_DIR}"
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" "${docconf[@]}"
+
+ if multilib_is_native_abi && use test; then
+ mkdir "${TBD}" || die
+ cd "${TBD}" || die
+ testconf=(
+ $(use_enable test asserts)
+ $(use_enable test checks)
+ $(use_enable test embedded-tests)
+ $(use_enable test stats)
+ $(has_version dev-libs/dbus-glib && echo --enable-modular-tests)
+ )
+ einfo "Running configure in ${TBD}"
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" "${testconf[@]}"
+ fi
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ # After the compile, it uses a selinuxfs interface to
+ # check if the SELinux policy has the right support
+ use selinux && addwrite /selinux/access
+
+ einfo "Running make in ${BUILD_DIR}"
+ emake
+
+ if use test; then
+ einfo "Running make in ${TBD}"
+ emake -C "${TBD}"
+ fi
+ else
+ emake -C dbus libdbus-1.la
+ fi
+}
+
+src_test() {
+ # DBUS_TEST_MALLOC_FAILURES=0 to avoid huge test logs
+ # https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/CONTRIBUTING.md#L231
+ DBUS_TEST_MALLOC_FAILURES=0 DBUS_VERBOSE=1 virtx emake -j1 -C "${TBD}" check
+
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake DESTDIR="${D}" install-pkgconfigDATA
+ emake DESTDIR="${D}" -C dbus \
+ install-libLTLIBRARIES install-dbusincludeHEADERS \
+ install-nodist_dbusarchincludeHEADERS
+ fi
+}
+
+multilib_src_install_all() {
+ newinitd "${T}"/dbus.initd dbus
+
+ if use X; then
+ # dbus X session script (bug #77504)
+ # turns out to only work for GDM (and startx). has been merged into
+ # other desktop (kdm and such scripts)
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/80-dbus-r1 80-dbus
+ fi
+
+ # Needs to exist for dbus sessions to launch
+ keepdir /usr/share/dbus-1/services
+ keepdir /etc/dbus-1/{session,system}.d
+ # machine-id symlink from pkg_postinst()
+ keepdir /var/lib/dbus
+ # Let the init script create the /var/run/dbus directory
+ rm -rf "${ED}"/var/run
+
+ # bug #761763
+ rm -rf "${ED}"/usr/lib/sysusers.d
+
+ dodoc AUTHORS NEWS README doc/TODO
+ readme.gentoo_create_doc
+
+ find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+
+ if use systemd; then
+ tmpfiles_process dbus.conf
+ fi
+
+ # Ensure unique id is generated and put it in /etc wrt bug #370451 but symlink
+ # for DBUS_MACHINE_UUID_FILE (see tools/dbus-launch.c) and reverse
+ # dependencies with hardcoded paths (although the known ones got fixed already)
+ # TODO: should be safe to remove at least the ln because of the above tmpfiles_process?
+ dbus-uuidgen --ensure="${EROOT}"/etc/machine-id
+ ln -sf "${EPREFIX}"/etc/machine-id "${EROOT}"/var/lib/dbus/machine-id
+
+ if [[ ${CHOST} == *-darwin* ]]; then
+ local plist="org.freedesktop.dbus-session.plist"
+ elog
+ elog
+ elog "For MacOS/Darwin we now ship launchd support for dbus."
+ elog "This enables autolaunch of dbus at session login and makes"
+ elog "dbus usable under MacOS/Darwin."
+ elog
+ elog "The launchd plist file ${plist} has been"
+ elog "installed in ${EPREFIX}/Library/LaunchAgents."
+ elog "For it to be used, you will have to do all of the following:"
+ elog " + cd ~/Library/LaunchAgents"
+ elog " + ln -s ${EPREFIX}/Library/LaunchAgents/${plist}"
+ elog " + logout and log back in"
+ elog
+ elog "If your application needs a proper DBUS_SESSION_BUS_ADDRESS"
+ elog "specified and refused to start otherwise, then export the"
+ elog "the following to your environment:"
+ elog " DBUS_SESSION_BUS_ADDRESS=\"launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET\""
+ fi
+}
diff --git a/sys-apps/dbus/files/dbus-1.14.0-clang-15-configure.patch b/sys-apps/dbus/files/dbus-1.14.0-clang-15-configure.patch
new file mode 100644
index 000000000000..821279c50ee9
--- /dev/null
+++ b/sys-apps/dbus/files/dbus-1.14.0-clang-15-configure.patch
@@ -0,0 +1,26 @@
+https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/339
+
+From 88c96ff6a351758cb7c69a25e3a8464b5164a19c Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 12 Sep 2022 18:37:35 +0100
+Subject: [PATCH] configure.ac: fix configure tests broken with Clang 15
+ (implicit function declarations)
+
+Clang 15 makes implicit function declarations fatal by default which
+leads to some configure tests silently failing/returning
+the wrong result.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/configure.ac
++++ b/configure.ac
+@@ -613,7 +613,8 @@ AS_IF([test -n "$dbus_va_copy_func"],
+ AC_CACHE_CHECK([whether $CC knows __sync_sub_and_fetch()],
+ dbus_cv_sync_sub_and_fetch,
+ [AC_LINK_IFELSE([
+- AC_LANG_PROGRAM([[]], [[int a = 4; int b = __sync_sub_and_fetch(&a, 4); exit(b); ]])],
++ AC_LANG_PROGRAM([[]], [[#include <stdlib.h>
++ int a = 4; int b = __sync_sub_and_fetch(&a, 4); exit(b); ]])],
+ [dbus_cv_sync_sub_and_fetch=yes],
+ [dbus_cv_sync_sub_and_fetch=no])
+ ])
+GitLab
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/dbus/files/, sys-apps/dbus/
@ 2022-06-20 3:02 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2022-06-20 3:02 UTC (permalink / raw
To: gentoo-commits
commit: d312126538f24aed777addc15e0a572f9e670f58
Author: Andrew Udvare <audvare <AT> gmail <DOT> com>
AuthorDate: Mon Jun 20 02:59:41 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 20 03:02:20 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3121265
sys-apps/dbus: minor shellcheck fixes
* [x] Run shellcheck
* [x] Use `$(...)` syntax instead of backticks
* [x] Quote eval arguments
Bug: https://bugs.gentoo.org/845141
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andrew Udvare <audvare <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/25988
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/dbus/{dbus-1.14.0-r3.ebuild => dbus-1.14.0-r4.ebuild} | 0
sys-apps/dbus/files/80-dbus-r1 | 4 ++--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys-apps/dbus/dbus-1.14.0-r3.ebuild b/sys-apps/dbus/dbus-1.14.0-r4.ebuild
similarity index 100%
rename from sys-apps/dbus/dbus-1.14.0-r3.ebuild
rename to sys-apps/dbus/dbus-1.14.0-r4.ebuild
diff --git a/sys-apps/dbus/files/80-dbus-r1 b/sys-apps/dbus/files/80-dbus-r1
index edef88a3c30c..3499a6a12eca 100644
--- a/sys-apps/dbus/files/80-dbus-r1
+++ b/sys-apps/dbus/files/80-dbus-r1
@@ -2,12 +2,12 @@
# launches a session dbus instance
-dbuslaunch="`command -v dbus-launch 2>/dev/null`"
+dbuslaunch=$(command -v dbus-launch 2>/dev/null)
if [ -n "$dbuslaunch" ] && [ -x "$dbuslaunch" ] && [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
if [ -n "$command" ]; then
command="$dbuslaunch --exit-with-session $command"
else
- eval `$dbuslaunch --sh-syntax --exit-with-session`
+ eval "$($dbuslaunch --sh-syntax --exit-with-session)"
fi
fi
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/dbus/files/, sys-apps/dbus/
@ 2022-04-22 23:54 Mike Gilbert
0 siblings, 0 replies; 8+ messages in thread
From: Mike Gilbert @ 2022-04-22 23:54 UTC (permalink / raw
To: gentoo-commits
commit: 7c17fe616d1b710aa29c84bcc32c3f22417fb201
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 22 23:51:44 2022 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Apr 22 23:54:14 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c17fe61
sys-apps/dbus: do not open /proc/self/oom_score_adj for writing
Bug: https://bugs.gentoo.org/836560
Closes: https://bugs.gentoo.org/839795
Bug: https://bugs.gentoo.org/839807
Closes: https://bugs.gentoo.org/839834
Closes: https://bugs.gentoo.org/839837
Closes: https://bugs.gentoo.org/840119
Closes: https://bugs.gentoo.org/840125
Closes: https://bugs.gentoo.org/840161
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
...{dbus-1.12.22.ebuild => dbus-1.12.22-r1.ebuild} | 6 +-
.../{dbus-1.14.0.ebuild => dbus-1.14.0-r1.ebuild} | 6 +-
.../dbus/files/dbus-1.14.0-oom_score_adj.patch | 115 +++++++++++++++++++++
3 files changed, 121 insertions(+), 6 deletions(-)
diff --git a/sys-apps/dbus/dbus-1.12.22.ebuild b/sys-apps/dbus/dbus-1.12.22-r1.ebuild
similarity index 99%
rename from sys-apps/dbus/dbus-1.12.22.ebuild
rename to sys-apps/dbus/dbus-1.12.22-r1.ebuild
index 0491fc1085d8..6490a2e922d7 100644
--- a/sys-apps/dbus/dbus-1.12.22.ebuild
+++ b/sys-apps/dbus/dbus-1.12.22-r1.ebuild
@@ -64,6 +64,9 @@ PATCHES=(
"${FILESDIR}/dbus-daemon-optional.patch" # bug #653136
"${FILESDIR}/dbus-1.12.22-check-fd.patch"
+
+ # https://bugs.gentoo.org/836560
+ "${FILESDIR}/dbus-1.14.0-oom_score_adj.patch"
)
pkg_setup() {
@@ -207,9 +210,6 @@ multilib_src_compile() {
}
src_test() {
- # https://bugs.gentoo.org/836560
- addwrite /proc/self
-
DBUS_VERBOSE=1 virtx emake -j1 -C "${TBD}" check
}
diff --git a/sys-apps/dbus/dbus-1.14.0.ebuild b/sys-apps/dbus/dbus-1.14.0-r1.ebuild
similarity index 99%
rename from sys-apps/dbus/dbus-1.14.0.ebuild
rename to sys-apps/dbus/dbus-1.14.0-r1.ebuild
index 2cddb00c4761..ce9df1f58e2e 100644
--- a/sys-apps/dbus/dbus-1.14.0.ebuild
+++ b/sys-apps/dbus/dbus-1.14.0-r1.ebuild
@@ -68,6 +68,9 @@ PATCHES=(
"${FILESDIR}/dbus-1.14.0-x-autoconf-fixes.patch"
"${FILESDIR}/dbus-1.12.22-check-fd.patch"
+
+ # https://bugs.gentoo.org/836560
+ "${FILESDIR}/dbus-1.14.0-oom_score_adj.patch"
)
pkg_setup() {
@@ -207,9 +210,6 @@ multilib_src_compile() {
}
src_test() {
- # https://bugs.gentoo.org/836560
- addwrite /proc
-
# DBUS_TEST_MALLOC_FAILURES=0 to avoid huge test logs
# https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/CONTRIBUTING.md#L231
DBUS_TEST_MALLOC_FAILURES=0 DBUS_VERBOSE=1 virtx emake -j1 -C "${TBD}" check
diff --git a/sys-apps/dbus/files/dbus-1.14.0-oom_score_adj.patch b/sys-apps/dbus/files/dbus-1.14.0-oom_score_adj.patch
new file mode 100644
index 000000000000..094529708088
--- /dev/null
+++ b/sys-apps/dbus/files/dbus-1.14.0-oom_score_adj.patch
@@ -0,0 +1,115 @@
+From 499cdfde1b3f5d812912e89b1a1a0d7a4fb83306 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 1 Apr 2022 18:58:34 +0100
+Subject: [PATCH 1/2] activation-helper: Never crash if unable to write
+ oom_score_adj
+
+_dbus_warn() normally only logs a warning, but can be made fatal by
+environment variables. In particular, we do that during unit testing,
+which can result in a build-time test failure if dbus is built in a
+sandbox environment that prevents write access.
+
+_dbus_log() does only the logging part of _dbus_warn(), which seems
+more appropriate here.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ bus/activation-helper.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/bus/activation-helper.c b/bus/activation-helper.c
+index 8a4fd732..df0472ce 100644
+--- a/bus/activation-helper.c
++++ b/bus/activation-helper.c
+@@ -348,7 +348,7 @@ exec_for_correct_user (char *exec, char *user, DBusError *error)
+ /* Resetting the OOM score adjustment is best-effort, so we don't
+ * treat a failure to do so as fatal. */
+ if (!_dbus_reset_oom_score_adj (&error_str))
+- _dbus_warn ("%s: %s", error_str, strerror (errno));
++ _dbus_log (DBUS_SYSTEM_LOG_WARNING, "%s: %s", error_str, strerror (errno));
+
+ if (!switch_user (user, error))
+ return FALSE;
+--
+GitLab
+
+
+From 5c8e5b7140c4f1f88684c7a83ce9587fff2def0c Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Fri, 1 Apr 2022 18:56:26 +0100
+Subject: [PATCH 2/2] sysdeps: Only open oom_score_adj read/write if we need to
+ write it
+
+If we're running in a sandbox, we might not have write access to
+oom_score_adj. In the common case where we don't have any special
+protection from the OOM-killer, we can detect that with only read
+access, and skip the part where we open it for writing.
+
+(We would also not have write access to oom_score_adj if we're running
+with elevated Linux capabilities while not root, but that should never
+actually happen for dbus-daemon-launch-helper, which is setuid root
+for production use or has no capabilities during unit-testing.)
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+---
+ dbus/dbus-sysdeps-util-unix.c | 26 +++++++++++++++++++++++---
+ 1 file changed, 23 insertions(+), 3 deletions(-)
+
+diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c
+index 8f079cbf..ca130cff 100644
+--- a/dbus/dbus-sysdeps-util-unix.c
++++ b/dbus/dbus-sysdeps-util-unix.c
+@@ -1627,12 +1627,12 @@ _dbus_reset_oom_score_adj (const char **error_str_p)
+ const char *error_str = NULL;
+
+ #ifdef O_CLOEXEC
+- fd = open ("/proc/self/oom_score_adj", O_RDWR | O_CLOEXEC);
++ fd = open ("/proc/self/oom_score_adj", O_RDONLY | O_CLOEXEC);
+ #endif
+
+ if (fd < 0)
+ {
+- fd = open ("/proc/self/oom_score_adj", O_RDWR);
++ fd = open ("/proc/self/oom_score_adj", O_RDONLY);
+ if (fd >= 0)
+ _dbus_fd_set_close_on_exec (fd);
+ }
+@@ -1680,6 +1680,26 @@ _dbus_reset_oom_score_adj (const char **error_str_p)
+ goto out;
+ }
+
++ close (fd);
++#ifdef O_CLOEXEC
++ fd = open ("/proc/self/oom_score_adj", O_WRONLY | O_CLOEXEC);
++
++ if (fd < 0)
++#endif
++ {
++ fd = open ("/proc/self/oom_score_adj", O_WRONLY);
++ if (fd >= 0)
++ _dbus_fd_set_close_on_exec (fd);
++ }
++
++ if (fd < 0)
++ {
++ ret = FALSE;
++ error_str = "open(/proc/self/oom_score_adj) for writing";
++ saved_errno = errno;
++ goto out;
++ }
++
+ if (pwrite (fd, "0", sizeof (char), 0) < 0)
+ {
+ ret = FALSE;
+@@ -1700,7 +1720,7 @@ _dbus_reset_oom_score_adj (const char **error_str_p)
+ else
+ {
+ ret = FALSE;
+- error_str = "open(/proc/self/oom_score_adj)";
++ error_str = "open(/proc/self/oom_score_adj) for reading";
+ saved_errno = errno;
+ goto out;
+ }
+--
+GitLab
+
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/dbus/files/, sys-apps/dbus/
@ 2022-03-27 23:09 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2022-03-27 23:09 UTC (permalink / raw
To: gentoo-commits
commit: 74020795b5786fd4963fdd1823c2aa302273a3c5
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 27 22:38:49 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 27 22:40:46 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74020795
sys-apps/dbus: add 1.14.0
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/dbus/Manifest | 1 +
sys-apps/dbus/dbus-1.14.0.ebuild | 287 +++++++++++++++++++++
.../dbus/files/dbus-1.14.0-x-autoconf-fixes.patch | 147 +++++++++++
3 files changed, 435 insertions(+)
diff --git a/sys-apps/dbus/Manifest b/sys-apps/dbus/Manifest
index e530cbf7268b..19ec71675e81 100644
--- a/sys-apps/dbus/Manifest
+++ b/sys-apps/dbus/Manifest
@@ -1,2 +1,3 @@
DIST dbus-1.12.20.tar.gz 2095511 BLAKE2B b467526e7e0281db7b8c7c178469fe006dab29ccb1ea197c02495bd297e8de766230b68ed86c4a7e05dbe09ca30ce941a15e0bf8030fe0df66c04febf0534b3b SHA512 0964683bc6859374cc94e42e1ec0cdb542cca67971c205fcba4352500b6c0891665b0718e7d85eb060c81cb82e3346c313892bc02384da300ddd306c7eef0056
DIST dbus-1.12.22.tar.gz 2108231 BLAKE2B 40c30ad9e48d8ac6b5f1c67726015eb17cb3501372ef2c8ffcd8ad73e4a2f186b80a7bbba094460d4093d1d0a3f1bbb8d83a27724397a8f5312bb8542237e6b7 SHA512 0a716022f9d693fcaf871b6dfb5f242b49a8dd05d3316ec3e530f5129f1d81a2fa9caec795fa62cfdcba6ed21549fdd2f896f9bf1cc9a96e2a7d04f2c7ec7be6
+DIST dbus-1.14.0.tar.xz 1360228 BLAKE2B ae0ebc2779e840e2d83f633029f81fba0e35969648dddce0280640dd9bee3f9508aa7fb6aef696d1c4c56d40f91b754941f847525afaee5cc3170ad23a7eddbf SHA512 9bf17a3ebb3cf44722c6fbf24ee56e9dc14d6882fc312f26c7f07459d969424bc2fb63a229139e011804ecc479a8f0eb1a0c83286f8d5a664c5979d12634179f
diff --git a/sys-apps/dbus/dbus-1.14.0.ebuild b/sys-apps/dbus/dbus-1.14.0.ebuild
new file mode 100644
index 000000000000..03e772f142c6
--- /dev/null
+++ b/sys-apps/dbus/dbus-1.14.0.ebuild
@@ -0,0 +1,287 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+TMPFILES_OPTIONAL=1
+
+# At least at the moment, while a CMake port exists, it's not recommended
+# for distributions.
+# https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/CONTRIBUTING.md#L189
+inherit autotools flag-o-matic linux-info python-any-r1 readme.gentoo-r1 systemd tmpfiles virtualx multilib-minimal
+
+DESCRIPTION="A message bus system, a simple way for applications to talk to each other"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/dbus/"
+SRC_URI="https://dbus.freedesktop.org/releases/dbus/${P}.tar.xz"
+
+LICENSE="|| ( AFL-2.1 GPL-2 )"
+SLOT="0"
+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"
+IUSE="debug doc elogind selinux static-libs systemd test X"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="?? ( elogind systemd )"
+
+BDEPEND="
+ acct-user/messagebus
+ app-text/xmlto
+ app-text/docbook-xml-dtd:4.4
+ sys-devel/autoconf-archive
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+"
+COMMON_DEPEND="
+ >=dev-libs/expat-2.1.0
+ elogind? ( sys-auth/elogind )
+ selinux? ( sys-libs/libselinux )
+ systemd? ( sys-apps/systemd:0= )
+ X? (
+ x11-libs/libX11
+ x11-libs/libXt
+ )
+"
+DEPEND="${COMMON_DEPEND}
+ dev-libs/expat
+ test? (
+ ${PYTHON_DEPS}
+ >=dev-libs/glib-2.40:2
+ )
+"
+RDEPEND="${COMMON_DEPEND}
+ acct-user/messagebus
+ selinux? ( sec-policy/selinux-dbus )
+ systemd? ( virtual/tmpfiles )
+"
+
+DOC_CONTENTS="
+ Some applications require a session bus in addition to the system
+ bus. Please see \`man dbus-launch\` for more information.
+"
+
+# out of sources build dir for make check
+TBD="${WORKDIR}/${P}-tests-build"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-enable-elogind.patch"
+ "${FILESDIR}/${PN}-daemon-optional.patch" # bug #653136
+
+ "${FILESDIR}/${P}-x-autoconf-fixes.patch"
+)
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+
+ if use kernel_linux; then
+ CONFIG_CHECK="~EPOLL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ default
+
+ if [[ ${CHOST} == *-solaris* ]]; then
+ # fix standards conflict, due to gcc being c99 by default nowadays
+ sed -i \
+ -e 's/_XOPEN_SOURCE=500/_XOPEN_SOURCE=600/' \
+ configure.ac || die
+ fi
+
+ # required for bug #263909, cross-compile so don't remove eautoreconf
+ eautoreconf
+}
+
+src_configure() {
+ local rundir=$(usex kernel_linux /run /var/run)
+
+ sed -e "s;@rundir@;${EPREFIX}${rundir};g" "${FILESDIR}"/dbus.initd.in \
+ > "${T}"/dbus.initd || die
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local docconf myconf testconf
+
+ # so we can get backtraces from apps
+ case ${CHOST} in
+ *-mingw*)
+ # error: unrecognized command line option '-rdynamic', bug #488036
+ ;;
+ *)
+ append-flags -rdynamic
+ ;;
+ esac
+
+ # libaudit is *only* used in DBus wrt SELinux support, so disable it, if
+ # not on an SELinux profile.
+ myconf=(
+ --localstatedir="${EPREFIX}/var"
+ $(use_enable static-libs static)
+ $(use_enable debug verbose-mode)
+ --disable-asserts
+ --disable-checks
+ $(use_enable selinux)
+ $(use_enable selinux libaudit)
+ --disable-apparmor
+ $(use_enable kernel_linux inotify)
+ --disable-kqueue
+ $(use_enable elogind)
+ $(use_enable systemd)
+ $(use_enable systemd user-session)
+ --disable-embedded-tests
+ --disable-modular-tests
+ $(use_enable debug stats)
+ --with-session-socket-dir="${EPREFIX}"/tmp
+ --with-system-pid-file="${EPREFIX}${rundir}"/dbus.pid
+ --with-system-socket="${EPREFIX}${rundir}"/dbus/system_bus_socket
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+ --with-systemduserunitdir="$(systemd_get_userunitdir)"
+ --with-dbus-user=messagebus
+ $(use_with X x)
+ )
+
+ if [[ ${CHOST} == *-darwin* ]]; then
+ myconf+=(
+ --enable-launchd
+ --with-launchd-agent-dir="${EPREFIX}"/Library/LaunchAgents
+ )
+ fi
+
+ if multilib_is_native_abi; then
+ docconf=(
+ --enable-xml-docs
+ $(use_enable doc doxygen-docs)
+ )
+ else
+ docconf=(
+ --disable-xml-docs
+ --disable-doxygen-docs
+ )
+ myconf+=(
+ --disable-daemon
+ --disable-selinux
+ --disable-libaudit
+ --disable-elogind
+ --disable-systemd
+ --without-x
+ )
+ fi
+
+ einfo "Running configure in ${BUILD_DIR}"
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" "${docconf[@]}"
+
+ if multilib_is_native_abi && use test; then
+ mkdir "${TBD}" || die
+ cd "${TBD}" || die
+ testconf=(
+ $(use_enable test asserts)
+ $(use_enable test checks)
+ $(use_enable test embedded-tests)
+ $(use_enable test stats)
+ $(has_version dev-libs/dbus-glib && echo --enable-modular-tests)
+ )
+ einfo "Running configure in ${TBD}"
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" "${testconf[@]}"
+ fi
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ # After the compile, it uses a selinuxfs interface to
+ # check if the SELinux policy has the right support
+ use selinux && addwrite /selinux/access
+
+ einfo "Running make in ${BUILD_DIR}"
+ emake
+
+ if use test; then
+ einfo "Running make in ${TBD}"
+ emake -C "${TBD}"
+ fi
+ else
+ emake -C dbus libdbus-1.la
+ fi
+}
+
+src_test() {
+ # DBUS_TEST_MALLOC_FAILURES=0 to avoid huge test logs
+ # https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/CONTRIBUTING.md#L231
+ DBUS_TEST_MALLOC_FAILURES=0 DBUS_VERBOSE=1 virtx emake -j1 -C "${TBD}" check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake DESTDIR="${D}" install-pkgconfigDATA
+ emake DESTDIR="${D}" -C dbus \
+ install-libLTLIBRARIES install-dbusincludeHEADERS \
+ install-nodist_dbusarchincludeHEADERS
+ fi
+}
+
+multilib_src_install_all() {
+ newinitd "${T}"/dbus.initd dbus
+
+ if use X; then
+ # dbus X session script (bug #77504)
+ # turns out to only work for GDM (and startx). has been merged into
+ # other desktop (kdm and such scripts)
+ exeinto /etc/X11/xinit/xinitrc.d
+ doexe "${FILESDIR}"/80-dbus
+ fi
+
+ # Needs to exist for dbus sessions to launch
+ keepdir /usr/share/dbus-1/services
+ keepdir /etc/dbus-1/{session,system}.d
+ # machine-id symlink from pkg_postinst()
+ keepdir /var/lib/dbus
+ # Let the init script create the /var/run/dbus directory
+ rm -rf "${ED}"/var/run
+
+ # bug #761763
+ rm -rf "${ED}"/usr/lib/sysusers.d
+
+ dodoc AUTHORS NEWS README doc/TODO
+ readme.gentoo_create_doc
+
+ find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+
+ if use systemd; then
+ tmpfiles_process dbus.conf
+ fi
+
+ # Ensure unique id is generated and put it in /etc wrt bug #370451 but symlink
+ # for DBUS_MACHINE_UUID_FILE (see tools/dbus-launch.c) and reverse
+ # dependencies with hardcoded paths (although the known ones got fixed already)
+ # TODO: should be safe to remove at least the ln because of the above tmpfiles_process?
+ dbus-uuidgen --ensure="${EROOT}"/etc/machine-id
+ ln -sf "${EPREFIX}"/etc/machine-id "${EROOT}"/var/lib/dbus/machine-id
+
+ if [[ ${CHOST} == *-darwin* ]]; then
+ local plist="org.freedesktop.dbus-session.plist"
+ elog
+ elog
+ elog "For MacOS/Darwin we now ship launchd support for dbus."
+ elog "This enables autolaunch of dbus at session login and makes"
+ elog "dbus usable under MacOS/Darwin."
+ elog
+ elog "The launchd plist file ${plist} has been"
+ elog "installed in ${EPREFIX}/Library/LaunchAgents."
+ elog "For it to be used, you will have to do all of the following:"
+ elog " + cd ~/Library/LaunchAgents"
+ elog " + ln -s ${EPREFIX}/Library/LaunchAgents/${plist}"
+ elog " + logout and log back in"
+ elog
+ elog "If your application needs a proper DBUS_SESSION_BUS_ADDRESS"
+ elog "specified and refused to start otherwise, then export the"
+ elog "the following to your environment:"
+ elog " DBUS_SESSION_BUS_ADDRESS=\"launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET\""
+ fi
+}
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
new file mode 100644
index 000000000000..d9eb2a611bfd
--- /dev/null
+++ b/sys-apps/dbus/files/dbus-1.14.0-x-autoconf-fixes.patch
@@ -0,0 +1,147 @@
+https://gitlab.freedesktop.org/dbus/dbus/-/commit/7d462fe93844df711ff8433ad798b54e57f8609d.patch
+(dropped NEWS to avoid conflicts with more patches in future)
+
+From fdbb32bd1f3c972d3d5fd3998930749206a1095a Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Tue, 1 Mar 2022 15:56:30 +0100
+Subject: [PATCH 1/6] build: Treat --with-x[=yes] the same as --with-x=auto
+
+Previously, --with-x would disable the check for X11 libraries, which
+was not intended.
+
+(cherry picked from commit 99cc28e0eb1a37233c0f7d3595175d1f331550e7)
+--- a/configure.ac
++++ b/configure.ac
+@@ -1115,7 +1115,7 @@ if test "x$dbus_win" = xyes; then
+
+ enable_x11_autolaunch=no
+ have_x11=no
+-else if test "x$with_x" = xauto; then
++else if test "x$with_x" != xno; then
+ PKG_CHECK_MODULES([X], [x11],
+ [AC_DEFINE([HAVE_X11], [1], [Define to 1 if you have X11 library])],
+ [ have_x11=no ])
+GitLab
+From 5f2577aea3c5291dbb97e77c7384924851b30102 Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Tue, 1 Mar 2022 16:01:29 +0100
+Subject: [PATCH 2/6] Move DBUS_X_* definitions into PKG_CHECK_MODULES block
+
+(cherry picked from commit 51e468d828785cbc7060678f6f257723ba11cd10)
+--- a/configure.ac
++++ b/configure.ac
+@@ -1117,15 +1117,15 @@ if test "x$dbus_win" = xyes; then
+ have_x11=no
+ else if test "x$with_x" != xno; then
+ PKG_CHECK_MODULES([X], [x11],
+- [AC_DEFINE([HAVE_X11], [1], [Define to 1 if you have X11 library])],
++ [AC_DEFINE([HAVE_X11], [1], [Define to 1 if you have X11 library])
++ have_x11=yes
++ DBUS_X_LIBS="$X_LIBS"
++ DBUS_X_CFLAGS="$X_CFLAGS"
++ ],
+ [ have_x11=no ])
+
+ if test "x$have_x11" = xno; then
+ AC_MSG_WARN([Couldn't found X11, tried with pkg-config.])
+- else
+- have_x11=yes
+- DBUS_X_LIBS="$X_LIBS"
+- DBUS_X_CFLAGS="$X_CFLAGS"
+ fi
+ else
+ AS_IF([test "x$enable_x11_autolaunch" = "xyes"], [
+GitLab
+From 5dad12f34c54e2359adfe8e7f122681df1d24bcb Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Tue, 1 Mar 2022 16:05:52 +0100
+Subject: [PATCH 3/6] Emit an error when --with-x was given but no X11 libs
+ were found
+
+(cherry picked from commit 17c88a894499da64460a0ef76db1d8b88ceb9eeb)
+--- a/configure.ac
++++ b/configure.ac
+@@ -1121,12 +1121,13 @@ else if test "x$with_x" != xno; then
+ have_x11=yes
+ DBUS_X_LIBS="$X_LIBS"
+ DBUS_X_CFLAGS="$X_CFLAGS"
+- ],
+- [ have_x11=no ])
+-
+- if test "x$have_x11" = xno; then
+- AC_MSG_WARN([Couldn't found X11, tried with pkg-config.])
+- fi
++ ], [
++ AS_IF([test "x$with_x" = xyes],
++ [AC_MSG_ERROR([Couldn't find X11, tried with pkg-config.])],
++ [AC_MSG_WARN([Couldn't find X11, tried with pkg-config.])]
++ )
++ have_x11=no
++ ])
+ else
+ AS_IF([test "x$enable_x11_autolaunch" = "xyes"], [
+ AC_MSG_ERROR([--enable-x11-autolaunch and --without-x are not compatible])
+GitLab
+From e03554eb0bf2731e39c06191403f7544df9bb307 Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Tue, 1 Mar 2022 16:08:06 +0100
+Subject: [PATCH 4/6] Add have_x11=no if --without-x was given to make later
+ checks happy
+
+(cherry picked from commit bf3cb42c6db1f4479467d66a111b08a98afef31b)
+--- a/configure.ac
++++ b/configure.ac
+@@ -1129,6 +1129,7 @@ else if test "x$with_x" != xno; then
+ have_x11=no
+ ])
+ else
++ have_x11=no
+ AS_IF([test "x$enable_x11_autolaunch" = "xyes"], [
+ AC_MSG_ERROR([--enable-x11-autolaunch and --without-x are not compatible])
+ ])
+GitLab
+From 62361f47f9da2346a9ff9a8c4b4bd4a288dc44d5 Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Tue, 1 Mar 2022 16:11:05 +0100
+Subject: [PATCH 5/6] Convert "if" calls to AS_IF macro for the block that
+ handles X11
+
+(cherry picked from commit c71f013a64cd7f6de4c9cf3cf3b236239d713eb1)
+--- a/configure.ac
++++ b/configure.ac
+@@ -1108,14 +1108,14 @@ AC_ARG_ENABLE([x11-autolaunch],
+ AS_HELP_STRING([--enable-x11-autolaunch], [build with X11 auto-launch support]),
+ [], [enable_x11_autolaunch=auto])
+
+-if test "x$dbus_win" = xyes; then
+- if test "x$enable_x11_autolaunch" = xyes; then
++AS_IF([test "x$dbus_win" = xyes], [
++ AS_IF([test "x$enable_x11_autolaunch" = xyes], [
+ AC_MSG_ERROR([X11 auto-launch is not supported on Windows])
+- fi
++ ])
+
+ enable_x11_autolaunch=no
+ have_x11=no
+-else if test "x$with_x" != xno; then
++], [test "x$with_x" != xno], [
+ PKG_CHECK_MODULES([X], [x11],
+ [AC_DEFINE([HAVE_X11], [1], [Define to 1 if you have X11 library])
+ have_x11=yes
+@@ -1128,13 +1128,12 @@ else if test "x$with_x" != xno; then
+ )
+ have_x11=no
+ ])
+-else
++], [
+ have_x11=no
+ AS_IF([test "x$enable_x11_autolaunch" = "xyes"], [
+ AC_MSG_ERROR([--enable-x11-autolaunch and --without-x are not compatible])
+ ])
+-fi
+-fi
++])
+
+ if test "x$enable_x11_autolaunch,$have_x11" = xyes,no; then
+ AC_MSG_ERROR([X11 auto-launch requires X headers/libraries])
+GitLab
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-02-28 14:44 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-28 14:44 [gentoo-commits] repo/gentoo:master commit in: sys-apps/dbus/files/, sys-apps/dbus/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2025-02-28 13:27 Sam James
2025-02-09 8:20 Sam James
2023-09-02 16:21 Sam James
2022-09-12 18:04 Sam James
2022-06-20 3:02 Sam James
2022-04-22 23:54 Mike Gilbert
2022-03-27 23:09 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox