app-accessibility/speech-dispatcher: fix automagic systemd support

In this upstream release, user units were added that also link to
libsystemd.so; it is autodetected if both the unit files were installed
AND libsystemd was found via pkg-config.

We need a USE flag to control this. Once we have a USE flag it is
pointless to install the system unit unconditionally (the "small files"
QA rule) since users will anyways want/need socket activation or just build
with global USE=systemd.

Fixes:
```
 * VDB: detected possibly incorrect RDEPEND (app-accessibility/speech-dispatcher-0.12.0)
 *  > sys-apps/systemd
```

Fixes: 1f6eb8673d45d10412a8e10740f6f81587724191
Closes: https://bugs.gentoo.org/955909
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Eli Schwartz 2025-05-13 11:17:25 -04:00 committed by Sam James
parent c5fbb49552
commit b4777b81aa
No known key found for this signature in database
GPG Key ID: 738409F520DF9190

View File

@ -13,7 +13,7 @@ SRC_URI="https://github.com/brailcom/speechd/releases/download/${PV}/${P}.tar.gz
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ppc ppc64 ~riscv ~sparc x86"
IUSE="alsa ao +espeak flite nas pulseaudio pipewire +python"
IUSE="alsa ao +espeak flite nas pulseaudio pipewire +python systemd"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
@ -27,7 +27,9 @@ DEPEND="python? ( ${PYTHON_DEPS} )
flite? ( app-accessibility/flite )
nas? ( media-libs/nas )
pulseaudio? ( media-libs/libpulse )
pipewire? ( media-video/pipewire )"
pipewire? ( media-video/pipewire )
systemd? ( sys-apps/systemd:= )
"
RDEPEND="${DEPEND}
python? ( dev-python/pyxdg[${PYTHON_USEDEP}] )"
BDEPEND="
@ -59,8 +61,13 @@ src_configure() {
$(use_with nas)
$(use_with pulseaudio pulse)
$(use_with pipewire)
--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
--with-systemduserunitdir="$(systemd_get_userunitdir)"
# Technically we should always install these under the "small files" QA
# rule. But upstream uses presence of the user unit dir to define
# USE_LIBSYSTEMD and link in code which consumes systemd/sd-daemon.h,
# and the corresponding *user* files have a hard dependency on that
# code. There is no standalone --with-systemd.
"$(use_with systemd systemdsystemunitdir "$(systemd_get_systemunitdir)")"
"$(use_with systemd systemduserunitdir "$(systemd_get_userunitdir)")"
)
econf "${myeconfargs[@]}"
}