Diff dbus-1.15.6 with a dbus-1.15.8

/usr/portage/sys-apps/dbus/dbus-1.15.8.ebuild 2023-10-09 14:52:35.364368498 +0300
11 11
PYTHON_COMPAT=( python3_{10..12} )
12 12
TMPFILES_OPTIONAL=1
13 13

  
14
# As of 1.15.6, the Meson build system is now recommended upstream, but we
15
# can't use it because our elogind patch needs rebasing and submission upstream.
16
# See bug #599494.
17
inherit autotools flag-o-matic linux-info python-any-r1 readme.gentoo-r1 systemd tmpfiles virtualx multilib-minimal
14
inherit linux-info meson-multilib python-any-r1 readme.gentoo-r1 systemd tmpfiles virtualx
18 15

  
19 16
DESCRIPTION="A message bus system, a simple way for applications to talk to each other"
20 17
HOMEPAGE="https://www.freedesktop.org/wiki/Software/dbus/"
......
22 19

  
23 20
LICENSE="|| ( AFL-2.1 GPL-2 )"
24 21
SLOT="0"
25
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"
22
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"
23
# TODO: USE=daemon
26 24
IUSE="debug doc elogind selinux static-libs systemd test valgrind X"
27 25
RESTRICT="!test? ( test )"
28 26

  
29
REQUIRED_USE="?? ( elogind systemd )"
30

  
31 27
BDEPEND="
32 28
	acct-user/messagebus
33 29
	app-text/xmlto
......
43 39
		sys-process/audit
44 40
		sys-libs/libselinux
45 41
	)
46
	systemd? ( sys-apps/systemd:0= )
42
	systemd? ( sys-apps/systemd:= )
47 43
	X? (
48 44
		x11-libs/libX11
49 45
		x11-libs/libXt
50 46
	)
51 47
"
52
DEPEND="${COMMON_DEPEND}
48
DEPEND="
49
	${COMMON_DEPEND}
53 50
	dev-libs/expat
54 51
	test? (
55 52
		${PYTHON_DEPS}
......
58 55
	valgrind? ( >=dev-util/valgrind-3.6 )
59 56
	X? ( x11-base/xorg-proto )
60 57
"
61
RDEPEND="${COMMON_DEPEND}
58
RDEPEND="
59
	${COMMON_DEPEND}
62 60
	acct-user/messagebus
63 61
	selinux? ( sec-policy/selinux-dbus )
64 62
	systemd? ( virtual/tmpfiles )
......
69 67
	bus. Please see \`man dbus-launch\` for more information.
70 68
"
71 69

  
72
# out of sources build dir for make check
73
TBD="${WORKDIR}/${P}-tests-build"
74

  
75 70
PATCHES=(
76
	"${FILESDIR}/dbus-1.15.0-enable-elogind.patch"
77
	"${FILESDIR}/dbus-1.15.0-daemon-optional.patch" # bug #653136
71
	"${FILESDIR}"/${PN}-1.15.8-enable-elogind.patch # bug #599494
78 72
)
79 73

  
80 74
pkg_setup() {
......
86 80
	fi
87 81
}
88 82

  
89
src_prepare() {
90
	default
91

  
92
	if [[ ${CHOST} == *-solaris* ]]; then
93
		# fix standards conflict, due to gcc being c99 by default nowadays
94
		sed -i \
95
			-e 's/_XOPEN_SOURCE=500/_XOPEN_SOURCE=600/' \
96
			configure.ac || die
97
	fi
98

  
99
	# required for bug #263909, cross-compile so don't remove eautoreconf
100
	eautoreconf
101
}
102

  
103 83
src_configure() {
104 84
	local rundir=$(usex kernel_linux /run /var/run)
105 85

  
106 86
	sed -e "s;@rundir@;${EPREFIX}${rundir};g" "${FILESDIR}"/dbus.initd.in \
107 87
		> "${T}"/dbus.initd || die
108 88

  
109
	multilib-minimal_src_configure
89
	meson-multilib_src_configure
110 90
}
111 91

  
112 92
multilib_src_configure() {
113
	local docconf myconf testconf
93
	local emesonargs=(
94
		--localstatedir="${EPREFIX}/var"
95
		-Druntime_dir="${EPREFIX}${rundir}"
114 96

  
115
	# so we can get backtraces from apps
116
	case ${CHOST} in
117
		*-mingw*)
118
			# error: unrecognized command line option '-rdynamic', bug #488036
119
			;;
120
		*)
121
			append-flags -rdynamic
122
			;;
123
	esac
97
		-Ddefault_library=$(multilib_native_usex static-libs both shared)
124 98

  
125
	# libaudit is *only* used in DBus wrt SELinux support, so disable it, if
126
	# not on an SELinux profile.
127
	myconf=(
128
		--localstatedir="${EPREFIX}/var"
129
		--runstatedir="${EPREFIX}${rundir}"
130
		$(use_enable static-libs static)
131
		$(use_enable debug verbose-mode)
132
		--disable-asserts
133
		--disable-checks
134
		$(use_enable selinux)
135
		$(use_enable selinux libaudit)
136
		--disable-apparmor
137
		$(use_enable kernel_linux inotify)
138
		--disable-kqueue
139
		$(use_enable elogind)
140
		$(use_enable systemd)
141
		$(use_enable systemd user-session)
142
		--disable-embedded-tests
143
		--disable-modular-tests
144
		$(use_enable debug stats)
145
		--with-session-socket-dir="${EPREFIX}"/tmp
146
		--with-system-pid-file="${EPREFIX}${rundir}"/dbus.pid
147
		--with-system-socket="${EPREFIX}${rundir}"/dbus/system_bus_socket
148
		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
149
		--with-systemduserunitdir="$(systemd_get_userunitdir)"
150
		--with-dbus-user=messagebus
151
		$(multilib_native_use_with valgrind)
152
		$(use_with X x)
99
		-Dapparmor=disabled
100
		-Dasserts=false # TODO
101
		-Dchecks=false # TODO
102
		$(meson_use debug stats)
103
		$(meson_use debug verbose_mode)
104
		-Dcontainers=false
105
		-Ddbus_user=messagebus
106
		-Dkqueue=disabled
107
		$(meson_feature kernel_linux inotify)
108
		$(meson_native_use_feature doc doxygen_docs)
109
		$(meson_native_enabled xml_docs) # Controls man pages
110

  
111
		-Dembedded_tests=false
112
		-Dinstalled_tests=false
113
		$(meson_native_true message_bus) # TODO: USE=daemon?
114
		$(meson_feature test modular_tests)
115
		-Dqt_help=disabled
116

  
117
		$(meson_native_true tools)
118

  
119
		$(meson_native_use_feature elogind)
120
		$(meson_native_use_feature systemd)
121
		$(meson_use systemd user_session)
122
		$(meson_native_use_feature X x11_autolaunch)
123
		$(meson_native_use_feature valgrind)
124

  
125
		# libaudit is *only* used in DBus wrt SELinux support, so disable it if
126
		# not on an SELinux profile.
127
		$(meson_native_use_feature selinux)
128
		$(meson_native_use_feature selinux libaudit)
129

  
130
		-Dsession_socket_dir="${EPREFIX}"/tmp
131
		-Dsystem_pid_file="${EPREFIX}${rundir}"/dbus.pid
132
		-Dsystem_socket="${EPREFIX}${rundir}"/dbus/system_bus_socket
133
		-Dsystemd_system_unitdir="$(systemd_get_systemunitdir)"
134
		-Dsystemd_user_unitdir="$(systemd_get_userunitdir)"
153 135
	)
154 136

  
155
	if [[ ${CHOST} == *-darwin* ]]; then
156
		myconf+=(
157
			--enable-launchd
158
			--with-launchd-agent-dir="${EPREFIX}"/Library/LaunchAgents
137
	if [[ ${CHOST} == *-darwin* ]] ; then
138
		emesonargs+=(
139
			-Dlaunchd=enabled
140
			-Dlaunchd_agent_dir="${EPREFIX}"/Library/LaunchAgents
159 141
		)
160 142
	fi
161 143

  
162
	if multilib_is_native_abi; then
163
		docconf=(
164
			--enable-xml-docs
165
			$(use_enable doc doxygen-docs)
166
		)
167
	else
168
		docconf=(
169
			--disable-xml-docs
170
			--disable-doxygen-docs
171
		)
172
		myconf+=(
173
			--disable-daemon
174
			--disable-selinux
175
			--disable-libaudit
176
			--disable-elogind
177
			--disable-systemd
178
			--without-x
179
		)
180
	fi
144
	meson_src_configure
145
}
181 146

  
182
	einfo "Running configure in ${BUILD_DIR}"
183
	ECONF_SOURCE="${S}" econf "${myconf[@]}" "${docconf[@]}"
147
amultilib_src_configure() {
148
	myconf=(
149
		$(use_enable static-libs static)
150
	)
184 151

  
185
	if multilib_is_native_abi && use test; then
186
		mkdir "${TBD}" || die
187
		cd "${TBD}" || die
188
		testconf=(
189
			$(use_enable test asserts)
190
			$(use_enable test checks)
191
			$(use_enable test embedded-tests)
192
			$(use_enable test stats)
193
			$(has_version dev-libs/dbus-glib && echo --enable-modular-tests)
194
		)
195
		einfo "Running configure in ${TBD}"
196
		ECONF_SOURCE="${S}" econf "${myconf[@]}" "${testconf[@]}"
197
	fi
152
	# $(has_version dev-libs/dbus-glib && echo --enable-modular-tests)
198 153
}
199 154

  
200 155
multilib_src_compile() {
201
	if multilib_is_native_abi; then
202
		# After the compile, it uses a selinuxfs interface to
203
		# check if the SELinux policy has the right support
204
		use selinux && addwrite /selinux/access
205

  
206
		einfo "Running make in ${BUILD_DIR}"
207
		emake
208

  
209
		if use test; then
210
			einfo "Running make in ${TBD}"
211
			emake -C "${TBD}"
212
		fi
213
	else
214
		emake -C dbus libdbus-1.la
215
	fi
156
	# After the compile, it uses a selinuxfs interface to
157
	# check if the SELinux policy has the right support
158
	use selinux && addwrite /selinux/access
159

  
160
	meson_src_compile
216 161
}
217 162

  
218
src_test() {
163
multilib_src_test() {
219 164
	# DBUS_TEST_MALLOC_FAILURES=0 to avoid huge test logs
220 165
	# https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/CONTRIBUTING.md#L231
221
	DBUS_TEST_MALLOC_FAILURES=0 DBUS_VERBOSE=1 virtx emake -j1 -C "${TBD}" check
166
	DBUS_TEST_MALLOC_FAILURES=0 DBUS_VERBOSE=1 virtx meson_src_test
222 167

  
223 168
}
224 169

  
225
multilib_src_install() {
226
	if multilib_is_native_abi; then
227
		emake DESTDIR="${D}" install
228
	else
229
		emake DESTDIR="${D}" install-pkgconfigDATA install-cmakeconfigDATA
230
		emake DESTDIR="${D}" -C dbus \
231
			install-libLTLIBRARIES install-dbusincludeHEADERS \
232
			install-nodist_dbusarchincludeHEADERS
233
	fi
234
}
235

  
236 170
multilib_src_install_all() {
237 171
	newinitd "${T}"/dbus.initd dbus
238 172

  
......
258 192
	dodoc AUTHORS NEWS README doc/TODO
259 193
	readme.gentoo_create_doc
260 194

  
261
	find "${ED}" -name '*.la' -delete || die
195
	mv "${ED}"/usr/share/doc/dbus/* "${ED}"/usr/share/doc/${PF}/ || die
196
	rm -rf "${ED}"/usr/share/doc/dbus || die
262 197
}
263 198

  
264 199
pkg_postinst() {
......
278 213
	if [[ ${CHOST} == *-darwin* ]]; then
279 214
		local plist="org.freedesktop.dbus-session.plist"
280 215
		elog
281
		elog
282 216
		elog "For MacOS/Darwin we now ship launchd support for dbus."
283 217
		elog "This enables autolaunch of dbus at session login and makes"
284 218
		elog "dbus usable under MacOS/Darwin."
Thank you!