diff options
author | dreieck | 2023-02-02 00:42:25 +0100 |
---|---|---|
committer | dreieck | 2023-02-02 00:42:25 +0100 |
commit | 2055a9722576d75907632aac4ea9b772e6c65698 (patch) | |
tree | c696149ee95d05f31fc724a6eb9d022af1b66437 | |
download | aur-2055a9722576d75907632aac4ea9b772e6c65698.tar.gz |
Initial Commit.
-rw-r--r-- | .SRCINFO | 41 | ||||
-rw-r--r-- | PKGBUILD | 83 | ||||
-rw-r--r-- | pipewire-conf.d | 4 | ||||
-rwxr-xr-x | pipewire-openrc | 37 | ||||
-rw-r--r-- | pipewire-openrc.install | 4 | ||||
-rw-r--r-- | pipewire-pulse-conf.d | 5 | ||||
-rwxr-xr-x | pipewire-pulse-openrc | 39 | ||||
-rw-r--r-- | wireplumber-conf.d | 5 | ||||
-rwxr-xr-x | wireplumber-openrc | 24 |
9 files changed, 242 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..8fdeabc3533e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,41 @@ +pkgbase = pipewire-openrc + pkgdesc = A split package containing OpenRC init scripts for 'pipewire', 'pipewire-pulse' and 'wireplumber'. + pkgver = 0.2 + pkgrel = 1 + epoch = 0 + url = https://aur.archlinux.org/pkgbase/pipewire-openrc + install = pipewire-openrc.install + arch = any + license = GPL2 + optdepends = openrc: To make use of the OpenRC initscripts. + options = emptydirs + source = pipewire-openrc + source = pipewire-conf.d + source = pipewire-pulse-openrc + source = pipewire-pulse-conf.d + source = wireplumber-openrc + source = wireplumber-conf.d + source = pipewire-openrc.install + sha256sums = f0b0dc89fd435a04183fa8dc604a8a2c4a40490559e380940ef146d691381e97 + sha256sums = e0bc441df62ced6228cd31d1087b8688311536869f95f7bc6547f2ae7a1e3231 + sha256sums = 6a442662e192cbfa89b144215af86e7f7e343a36f346b38e30bbc41bddd196f4 + sha256sums = 2fad4cc23b8f417e6400b4adee85389b3595ae500d3baf17d196394c8f78d8b7 + sha256sums = 234b6e08915ecfa790f2f2f6fe3c76c347ab71c0194fb6df7f9c5f1de0db7e44 + sha256sums = 55e9a5dcf756ea81b38e976f5d161222cd6449a4bbff67911ddfe740ff9a5727 + sha256sums = 62e9ca05f742eb7249864ba86075ef51c6e3e0dd074bfcbf34f1416e75af4f8b + +pkgname = pipewire-openrc + pkgdesc = OpenRC init script for 'pipewire'. + depends = pipewire + backup = etc/conf.d/pipewire + +pkgname = pipewire-pulse-openrc + pkgdesc = OpenRC init script for 'pipewire-pulse'. + depends = pipewire-pulse + backup = etc/conf.d/pipewire-pulse + +pkgname = wireplumber-openrc + pkgdesc = OpenRC init script for 'wireplumber'. + depends = dbus + depends = wireplumber + backup = etc/conf.d/wireplumber diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..3916ef64239a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,83 @@ +# Maintainer: dreieck + +_pkgbase="pipewire-openrc" +pkgbase="${_pkgbase}" +pkgname=( + 'pipewire-openrc' + 'pipewire-pulse-openrc' + 'wireplumber-openrc' +) +epoch=0 +pkgver=0.2 +pkgrel=1 +pkgdesc="A split package containing OpenRC init scripts for 'pipewire', 'pipewire-pulse' and 'wireplumber'." +arch=( + 'any' +) +url="https://aur.archlinux.org/pkgbase/pipewire-openrc" +license=('GPL2') +depends=() +optdepends=( + 'openrc: To make use of the OpenRC initscripts.' +) +makedepends=() +options+=('emptydirs') +install="${_pkgbase}.install" +source=( + 'pipewire-openrc' + 'pipewire-conf.d' + 'pipewire-pulse-openrc' + 'pipewire-pulse-conf.d' + 'wireplumber-openrc' + 'wireplumber-conf.d' + "${install}" +) +sha256sums=( + 'f0b0dc89fd435a04183fa8dc604a8a2c4a40490559e380940ef146d691381e97' + 'e0bc441df62ced6228cd31d1087b8688311536869f95f7bc6547f2ae7a1e3231' + '6a442662e192cbfa89b144215af86e7f7e343a36f346b38e30bbc41bddd196f4' + '2fad4cc23b8f417e6400b4adee85389b3595ae500d3baf17d196394c8f78d8b7' + '234b6e08915ecfa790f2f2f6fe3c76c347ab71c0194fb6df7f9c5f1de0db7e44' + '55e9a5dcf756ea81b38e976f5d161222cd6449a4bbff67911ddfe740ff9a5727' + '62e9ca05f742eb7249864ba86075ef51c6e3e0dd074bfcbf34f1416e75af4f8b' +) + +package_pipewire-openrc() { + pkgdesc="OpenRC init script for 'pipewire'." + depends=( + 'pipewire' + ) + backup=( + 'etc/conf.d/pipewire' + ) + + install -D -v -m755 "${srcdir}/pipewire-openrc" "${pkgdir}/etc/init.d/pipewire" + install -D -v -m644 "${srcdir}/pipewire-conf.d" "${pkgdir}/etc/conf.d/pipewire" +} + +package_pipewire-pulse-openrc() { + pkgdesc="OpenRC init script for 'pipewire-pulse'." + depends=( + 'pipewire-pulse' + ) + backup=( + 'etc/conf.d/pipewire-pulse' + ) + + install -D -v -m755 "${srcdir}/pipewire-pulse-openrc" "${pkgdir}/etc/init.d/pipewire-pulse" + install -D -v -m644 "${srcdir}/pipewire-pulse-conf.d" "${pkgdir}/etc/conf.d/pipewire-pulse" +} + +package_wireplumber-openrc() { + pkgdesc="OpenRC init script for 'wireplumber'." + depends=( + 'dbus' + 'wireplumber' + ) + backup=( + 'etc/conf.d/wireplumber' + ) + + install -D -v -m755 "${srcdir}/wireplumber-openrc" "${pkgdir}/etc/init.d/wireplumber" + install -D -v -m644 "${srcdir}/wireplumber-conf.d" "${pkgdir}/etc/conf.d/wireplumber" +} diff --git a/pipewire-conf.d b/pipewire-conf.d new file mode 100644 index 000000000000..209427f8871e --- /dev/null +++ b/pipewire-conf.d @@ -0,0 +1,4 @@ +# 'pipewire_args': Bash array holding additional command line arguments to be +# passed to 'pipewire' when started via initscript '/etc/inid.d/pipewire'. +# e.g. 'pipewire_args=(-c "<config-file>")' +pipewire_args=() diff --git a/pipewire-openrc b/pipewire-openrc new file mode 100755 index 000000000000..1e48b7ee696e --- /dev/null +++ b/pipewire-openrc @@ -0,0 +1,37 @@ +#!/usr/bin/openrc-run + +# Work based on file by "Gentoo Authors", 2022 +# Modified for Artix Linux by dreieck, 2023 +# Distributed under the terms of the GNU General Public License v2 + +PIPEWIRE_RUNTIME_DIR="/run/pipewire" +name="pipewire daemon" +description="A sound server which speaks pipewire, pulseaudio and jack." +command=/usr/bin/pipewire +command_args="${pipewire_args[@]}" +command_background=yes +command_user="pipewire:pipewire" +pidfile="${PIPEWIRE_RUNTIME_DIR}/pipewire.pid" + +depend() { + after udev dbus + use alsasound pulseaudio +} + +start_pre() { + if [[ ! -e "${PIPEWIRE_RUNTIME_DIR}" ]]; then + mkdir -p "${PIPEWIRE_RUNTIME_DIR}" + fi + # Optionally, add code to delete contents of "${PIPEWIRE_RUNTIME_DIR}"/* + # (security/ information leak thoughts; maybe other cleanup thoughts). + chmod -R 2775 "${PIPEWIRE_RUNTIME_DIR}" + chown -R pipewire:pipewire "${PIPEWIRE_RUNTIME_DIR}" + export PIPEWIRE_RUNTIME_DIR +} + +start_post() { + einfo "Wait for the pipewire socket to be ready ..." + sleep 3 + find "${PIPEWIRE_RUNTIME_DIR}" -type s -exec chmod g+w '{}' ';' + einfo "Socket file(s): $(find "${PIPEWIRE_RUNTIME_DIR}" -type s)" +} diff --git a/pipewire-openrc.install b/pipewire-openrc.install new file mode 100644 index 000000000000..f8d093352cc5 --- /dev/null +++ b/pipewire-openrc.install @@ -0,0 +1,4 @@ +post_install() { + printf '%s\n' "Adding 'pipewire' system user and group ..." + id -u pipewire > /dev/null 2>&1 || useradd --system --home-dir /run/pipewire --no-create-home --user-group --groups audio,video,dbus pipewire +} diff --git a/pipewire-pulse-conf.d b/pipewire-pulse-conf.d new file mode 100644 index 000000000000..d53d225fbd65 --- /dev/null +++ b/pipewire-pulse-conf.d @@ -0,0 +1,5 @@ +# 'pipewire_pulse_args': Bash array holding additional command line arguments +# to be passed to 'pipewire-pulse' when started via initscript +# '/etc/inid.d/pipewire-pulse'. +# e.g. 'pipewire_pulse_args=(-c "<config-file>")' +pipewire_pulse_args=() diff --git a/pipewire-pulse-openrc b/pipewire-pulse-openrc new file mode 100755 index 000000000000..452f77a45d10 --- /dev/null +++ b/pipewire-pulse-openrc @@ -0,0 +1,39 @@ +#!/usr/bin/openrc-run + +# Work based on file by "Gentoo Authors", 2022 +# Modified for Artix Linux by dreieck, 2023 +# Distributed under the terms of the GNU General Public License v2 + +PIPEWIRE_RUNTIME_DIR="/run/pipewire" +PULSE_RUNTIME_PATH="/run/pulse" +# XDG_RUNTIME_DIR="" +name="pipewire pulseaudio dropin daemon" +description="Makes pipewire to be a drop-in for PulseAudio." +command=/usr/bin/pipewire-pulse +command_args="${pipewire_pulse_args[@]}" +command_background=yes +command_user="pipewire:pipewire" +pidfile="${PULSE_RUNTIME_PATH}/pipewire-pulse.pid" + +depend() { + need pipewire +} + +start_pre() { + export PIPEWIRE_RUNTIME_DIR + + if [[ ! -e "${PULSE_RUNTIME_PATH}" ]]; then + mkdir -p "${PULSE_RUNTIME_PATH}" + chmod -R 2775 "${PULSE_RUNTIME_PATH}" + chown -R pipewire:pipewire "${PULSE_RUNTIME_PATH}" + fi + export PULSE_RUNTIME_PATH +} + +start_post() { + einfo "Wait for the pulse socket to be ready ..." + sleep 3 + find "${PULSE_RUNTIME_PATH}" -type s -exec chmod g+w '{}' ';' + einfo "Socket file(s): $(find "${PULSE_RUNTIME_PATH}" -type s)" +} + diff --git a/wireplumber-conf.d b/wireplumber-conf.d new file mode 100644 index 000000000000..4d7d2d2975b3 --- /dev/null +++ b/wireplumber-conf.d @@ -0,0 +1,5 @@ +# 'wireplumber_args': Bash array holding additional command line arguments to +# be passed to 'wireplumber' when started via initscript +# '/etc/inid.d/wireplumber'. +# e.g. 'wireplumber_args=(-c "<config-file>")' +wireplumber_args=() diff --git a/wireplumber-openrc b/wireplumber-openrc new file mode 100755 index 000000000000..cd58a72b6eb7 --- /dev/null +++ b/wireplumber-openrc @@ -0,0 +1,24 @@ +#!/usr/bin/openrc-run + +# Work based on file by "Gentoo Authors", 2022 +# Modified for Artix Linux by dreieck, 2023 +# Distributed under the terms of the GNU General Public License v2 + +PIPEWIRE_RUNTIME_DIR="/run/pipewire" +DBUS_SESSION_BUS_ADDRESS="unix:path=/run/dbus/system_bus_socket" +name="pipewire automatic session manager" +description="On demand pipewire management" +command=/usr/bin/wireplumber +command_args="${wirplumber_args[@]}" +command_background=yes +command_user="pipewire:pipewire" +pidfile="${PIPEWIRE_RUNTIME_DIR}/wireplumber.pid" + +depend() { + need dbus pipewire +} + +start_pre() { + export PIPEWIRE_RUNTIME_DIR + export DBUS_SESSION_BUS_ADDRESS +} |