summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason A. Donenfeld <zx2c4@gentoo.org>2022-02-06 00:55:11 +0100
committerJason A. Donenfeld <zx2c4@gentoo.org>2022-02-06 00:57:30 +0100
commite4e2707733bb6b2c35242e351587e1e95883934c (patch)
treeb853849d18428ffdf53be9d3f349bd494dcb1ad2 /media-video/pipewire
parentacct-group/pipewire: new group for pipewire USE=system-service (diff)
downloadgentoo-e4e2707733bb6b2c35242e351587e1e95883934c.tar.gz
gentoo-e4e2707733bb6b2c35242e351587e1e95883934c.tar.bz2
gentoo-e4e2707733bb6b2c35242e351587e1e95883934c.zip
media-video/pipewire: add masked USE=system-service
Closes: https://github.com/gentoo/gentoo/pull/23972 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Jason A. Donenfeld <zx2c4@gentoo.org>
Diffstat (limited to 'media-video/pipewire')
-rw-r--r--media-video/pipewire/metadata.xml1
-rw-r--r--media-video/pipewire/pipewire-0.3.45.ebuild30
-rw-r--r--media-video/pipewire/pipewire-9999.ebuild30
3 files changed, 55 insertions, 6 deletions
diff --git a/media-video/pipewire/metadata.xml b/media-video/pipewire/metadata.xml
index a61d898b80e4..f88730b7d3ba 100644
--- a/media-video/pipewire/metadata.xml
+++ b/media-video/pipewire/metadata.xml
@@ -30,6 +30,7 @@
<flag name="lv2">Allow loading LV2 plugins via <pkg>media-libs/lv2</pkg></flag>
<flag name="pipewire-alsa">Replace PulseAudio's ALSA plugin with PipeWire's plugin</flag>
<flag name="ssl">Enable raop-sink support (needs <pkg>dev-libs/openssl</pkg>)</flag>
+ <flag name="system-service">Install systemd unit files for running as a system service. Not recommended.</flag>
<flag name="X">Enable audible bell for X11</flag>
</use>
</pkgmetadata>
diff --git a/media-video/pipewire/pipewire-0.3.45.ebuild b/media-video/pipewire/pipewire-0.3.45.ebuild
index 033d3614a241..a6d8db4e1bda 100644
--- a/media-video/pipewire/pipewire-0.3.45.ebuild
+++ b/media-video/pipewire/pipewire-0.3.45.ebuild
@@ -21,7 +21,7 @@ HOMEPAGE="https://pipewire.org/"
LICENSE="MIT LGPL-2.1+ GPL-2"
# ABI was broken in 0.3.42 for https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/49
SLOT="0/0.4"
-IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl systemd test v4l X zeroconf"
+IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl system-service systemd test v4l X zeroconf"
# Once replacing system JACK libraries is possible, it's likely that
# jack-client IUSE will need blocking to avoid users accidentally
@@ -29,7 +29,10 @@ IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewir
# JACK's sink - doing so is likely to yield no audio, cause a CPU
# cycles consuming loop (and may even cause GUI crashes)!
-REQUIRED_USE="jack-sdk? ( !jack-client )"
+REQUIRED_USE="
+ jack-sdk? ( !jack-client )
+ system-service? ( systemd )
+"
RESTRICT="!test? ( test )"
@@ -81,6 +84,10 @@ RDEPEND="
!pipewire-alsa? ( media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio] )
ssl? ( dev-libs/openssl:= )
systemd? ( sys-apps/systemd )
+ system-service? (
+ acct-user/pipewire
+ acct-group/pipewire
+ )
v4l? ( media-libs/libv4l )
X? (
media-libs/libcanberra
@@ -128,6 +135,12 @@ src_prepare() {
@audio - memlock 256
+ $(use system-service && {
+ echo @pipewire - rtprio 95
+ echo @pipewire - priority -19
+ echo @pipewire - memlock 4194304
+ })
+
# End of ${limitsdfile} from ${P}
EOF
}
@@ -146,7 +159,7 @@ multilib_src_configure() {
$(meson_native_use_feature gstreamer gstreamer-device-provider)
$(meson_native_use_feature systemd)
- -Dsystemd-system-service=disabled # Matches upstream
+ $(meson_native_use_feature system-service systemd-system-service)
-Dsystemd-system-unit-dir="$(systemd_get_systemunitdir)"
-Dsystemd-user-unit-dir="$(systemd_get_userunitdir)"
@@ -316,4 +329,15 @@ pkg_postinst() {
fi
ewarn
fi
+
+ if use system-service; then
+ ewarn
+ ewarn "WARNING: you have enabled the system-service USE flag, which installs"
+ ewarn "the system-wide systemd units that enable PipeWire to run as a system"
+ ewarn "service. This is more than likely NOT what you want. You are strongly"
+ ewarn "advised not to enable this mode and instead stick with systemd user"
+ ewarn "units. The default configuration files will likely not work out of"
+ ewarn "box, and you are on your own with configuration."
+ ewarn
+ fi
}
diff --git a/media-video/pipewire/pipewire-9999.ebuild b/media-video/pipewire/pipewire-9999.ebuild
index 033d3614a241..a6d8db4e1bda 100644
--- a/media-video/pipewire/pipewire-9999.ebuild
+++ b/media-video/pipewire/pipewire-9999.ebuild
@@ -21,7 +21,7 @@ HOMEPAGE="https://pipewire.org/"
LICENSE="MIT LGPL-2.1+ GPL-2"
# ABI was broken in 0.3.42 for https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/49
SLOT="0/0.4"
-IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl systemd test v4l X zeroconf"
+IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl system-service systemd test v4l X zeroconf"
# Once replacing system JACK libraries is possible, it's likely that
# jack-client IUSE will need blocking to avoid users accidentally
@@ -29,7 +29,10 @@ IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewir
# JACK's sink - doing so is likely to yield no audio, cause a CPU
# cycles consuming loop (and may even cause GUI crashes)!
-REQUIRED_USE="jack-sdk? ( !jack-client )"
+REQUIRED_USE="
+ jack-sdk? ( !jack-client )
+ system-service? ( systemd )
+"
RESTRICT="!test? ( test )"
@@ -81,6 +84,10 @@ RDEPEND="
!pipewire-alsa? ( media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio] )
ssl? ( dev-libs/openssl:= )
systemd? ( sys-apps/systemd )
+ system-service? (
+ acct-user/pipewire
+ acct-group/pipewire
+ )
v4l? ( media-libs/libv4l )
X? (
media-libs/libcanberra
@@ -128,6 +135,12 @@ src_prepare() {
@audio - memlock 256
+ $(use system-service && {
+ echo @pipewire - rtprio 95
+ echo @pipewire - priority -19
+ echo @pipewire - memlock 4194304
+ })
+
# End of ${limitsdfile} from ${P}
EOF
}
@@ -146,7 +159,7 @@ multilib_src_configure() {
$(meson_native_use_feature gstreamer gstreamer-device-provider)
$(meson_native_use_feature systemd)
- -Dsystemd-system-service=disabled # Matches upstream
+ $(meson_native_use_feature system-service systemd-system-service)
-Dsystemd-system-unit-dir="$(systemd_get_systemunitdir)"
-Dsystemd-user-unit-dir="$(systemd_get_userunitdir)"
@@ -316,4 +329,15 @@ pkg_postinst() {
fi
ewarn
fi
+
+ if use system-service; then
+ ewarn
+ ewarn "WARNING: you have enabled the system-service USE flag, which installs"
+ ewarn "the system-wide systemd units that enable PipeWire to run as a system"
+ ewarn "service. This is more than likely NOT what you want. You are strongly"
+ ewarn "advised not to enable this mode and instead stick with systemd user"
+ ewarn "units. The default configuration files will likely not work out of"
+ ewarn "box, and you are on your own with configuration."
+ ewarn
+ fi
}