aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarav <marav8@free.fr>2022-04-06 18:02:48 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-04-09 15:45:49 +0700
commit2bfe57b0fc4ce9052ca055a271c1dd8a24894480 (patch)
treea96ca4d143919409600ecd95f6694b063d1f60cd
parent904dc75d3e54b916f252598792a9332a72d61f5a (diff)
audio/wireplumber: Added (policy manager for PipeWire).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--audio/wireplumber/README25
-rw-r--r--audio/wireplumber/doinst.sh5
-rw-r--r--audio/wireplumber/slack-desc19
-rw-r--r--audio/wireplumber/wireplumber-disable.sh54
-rw-r--r--audio/wireplumber/wireplumber-enable.sh42
-rw-r--r--audio/wireplumber/wireplumber.SlackBuild144
-rw-r--r--audio/wireplumber/wireplumber.desktop.sample10
-rw-r--r--audio/wireplumber/wireplumber.info10
8 files changed, 309 insertions, 0 deletions
diff --git a/audio/wireplumber/README b/audio/wireplumber/README
new file mode 100644
index 000000000000..15a585ead150
--- /dev/null
+++ b/audio/wireplumber/README
@@ -0,0 +1,25 @@
+Wireplumber - Session / policy manager implementation for PipeWire
+
+WirePlumber is a modular session / policy manager for PipeWire and a
+GObject-based high-level library that wraps PipeWire’s API,
+providing convenience for writing the daemon’s modules as well as
+external tools for managing PipeWire.
+
+The WirePlumber daemon implements the session & policy management
+service. It follows a modular design, having plugins that implement
+the actual management functionality.
+
+The WirePlumber Library provides API that allows you to extend the
+WirePlumber daemon, to write management or status tools for PipeWire
+(apps that don’t do actual media streaming) and to write custom
+session managers for embedded devices.
+
+
+Replacement of pipewire-media :
+Based on what P. Volkerding did for pulseaudio/pipewire
+There are 2 scripts to enable/disable wireplumber, in /usr/sbin :
+- wireplumber-enable.sh
+- wireplumber-disable.sh
+
+For the changes to take effect :
+logout / login
diff --git a/audio/wireplumber/doinst.sh b/audio/wireplumber/doinst.sh
new file mode 100644
index 000000000000..9018c147dbc2
--- /dev/null
+++ b/audio/wireplumber/doinst.sh
@@ -0,0 +1,5 @@
+# Toss redundant sample files:
+for file in wireplumber.desktop ; do
+ cmp etc/xdg/autostart/${file} etc/xdg/autostart/${file}.sample 2> /dev/null && rm etc/xdg/autostart/${file}.sample
+done
+
diff --git a/audio/wireplumber/slack-desc b/audio/wireplumber/slack-desc
new file mode 100644
index 000000000000..18f46d565b1b
--- /dev/null
+++ b/audio/wireplumber/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+wireplumber: wireplumber (Session / policy manager implementation for PipeWire)
+wireplumber:
+wireplumber: WirePlumber is a modular session / policy manager for
+wireplumber: PipeWire and a GObject-based high-level library
+wireplumber: that wraps PipeWire's API, providing convenience for writini
+wireplumber: the daemon's modules as well as external tools for managing PipeWire.
+wireplumber: It follows a modular design, having plugins that implement the actual
+wireplumber: management functionality.
+wireplumber:
+wireplumber: https://gitlab.com/pipewire/wireplumber
+wireplumber:
diff --git a/audio/wireplumber/wireplumber-disable.sh b/audio/wireplumber/wireplumber-disable.sh
new file mode 100644
index 000000000000..77676ea9e2b9
--- /dev/null
+++ b/audio/wireplumber/wireplumber-disable.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+# Copyright 2022 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# This script will attempt to disable pipewire as the default audio server,
+# changing it back to pulseaudio.
+
+# Remove or rename the XDG autostart files:
+for file in /etc/xdg/autostart/wireplumber.desktop ; do
+ if [ -r ${file}.sample ]; then
+ rm -f $file
+ elif [ -r $file ]; then
+ mv ${file} ${file}.sample
+ fi
+done
+
+# Condition: check if pipewire is enabled
+if [ -f /etc/xdg/autostart/pipewire.desktop ] ; then
+ # Enable pipewire-media-session.desktop:
+ if grep -q "^Hidden=true$" /etc/xdg/autostart/pipewire-media-session.desktop ; then
+ grep -v "^Hidden=true$" /etc/xdg/autostart/pipewire-media-session.desktop > /etc/xdg/autostart/pipewire-media-session.desktop.new
+ mv /etc/xdg/autostart/pipewire-media-session.desktop.new /etc/xdg/autostart/pipewire-media-session.desktop
+ fi
+
+ echo "Pipewire Media Session enabled as media session server."
+ if ps ax | grep -q pipewire ; then
+ echo
+ echo "You may need to stop running daemon/wireplumber processes."
+ echo "The clean way is to run these commands as the user that owns the processes:"
+ echo "/usr/bin/daemon --pidfiles=~/.run --name=wireplumber --stop"
+ echo
+ echo "The quick and dirty way if nothing else on the machine is using the daemon"
+ echo "utility is to issue this command:"
+ echo "killall daemon"
+ fi
+fi
+
diff --git a/audio/wireplumber/wireplumber-enable.sh b/audio/wireplumber/wireplumber-enable.sh
new file mode 100644
index 000000000000..1aac9d4ae1d6
--- /dev/null
+++ b/audio/wireplumber/wireplumber-enable.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+# Copyright 2022 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# This script will attempt to enable wireplumber as the default media session server.
+
+# Condition: check if pipewire is enabled
+if [ -f /etc/xdg/autostart/pipewire.desktop ] ; then
+
+ # Rename the XDG autostart files:
+ for file in /etc/xdg/autostart/wireplumber.desktop.sample ; do
+ if [ -r $file ]; then
+ mv $file /etc/xdg/autostart/$(basename $file .sample)
+ fi
+ done
+
+ # Disable pipewire-media-session.desktop:
+ if ! grep -q "^Hidden=true$" /etc/xdg/autostart/pipewire-media-session.desktop ; then
+ echo "Hidden=true" >> /etc/xdg/autostart/pipewire-media-session.desktop
+ fi
+ echo "Wireplumber enabled as system media session server."
+else
+ echo "Pipewire is disabled"
+ echo "you must enable pipewire first : /usr/sbin/pipewire-enable.sh"
+fi
diff --git a/audio/wireplumber/wireplumber.SlackBuild b/audio/wireplumber/wireplumber.SlackBuild
new file mode 100644
index 000000000000..7ca479fbb4a2
--- /dev/null
+++ b/audio/wireplumber/wireplumber.SlackBuild
@@ -0,0 +1,144 @@
+#!/bin/bash
+
+# Copyright 2022, marav, Paris, FR
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=wireplumber
+VERSION=${VERSION:-0.4.7}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.?z || exit 1
+cd $PRGNAM-$VERSION || exit 1
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \+ -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \+
+
+# Set options to build with or without documentation / introspection
+# These options are disabled by default
+WITHDOC=${WITHDOC:-no}
+WITHINTROSPEC=${WITHINTROSPEC:-no}
+
+if [ $WITHDOC == "no" ]; then
+ DOC_OPTION="-Ddoc=disabled"
+ else
+ DOC_OPTION="-Ddoc=auto"
+fi
+
+if [ $WITHINTROSPEC == "no" ]; then
+ INTROSPEC_OPTION="-Dintrospection=disabled"
+ else
+ INTROSPEC_OPTION="-Dintrospection=auto"
+fi
+
+# Configure, build, and install:
+export CFLAGS="$SLKCFLAGS"
+export CXXFLAGS="$SLKCFLAGS"
+mkdir meson-build
+cd meson-build
+meson setup \
+ --prefix=/usr \
+ --libdir=lib${LIBDIRSUFFIX} \
+ --libexecdir=/usr/libexec \
+ --bindir=/usr/bin \
+ --sbindir=/usr/sbin \
+ --includedir=/usr/include \
+ --datadir=/usr/share \
+ --mandir=/usr/man \
+ -Dsystem-lua=true \
+ -Dsystemd=disabled \
+ -Dsystemd-user-service=false \
+ $DOC_OPTION \
+ $INTROSPEC_OPTION \
+ ..
+ "${NINJA:=ninja}"
+ DESTDIR=$PKG $NINJA install
+cd ..
+
+# Add sample configuation files:
+mkdir -p $PKG/etc/xdg/autostart
+cp -a $CWD/wireplumber.desktop.sample $PKG/etc/xdg/autostart
+chown root:root $PKG/etc/xdg/autostart/*
+chmod 644 $PKG/etc/xdg/autostart/*
+
+mkdir -p $PKG/usr/sbin
+cp -a $CWD/wireplumber-disable.sh $PKG/usr/sbin
+cp -a $CWD/wireplumber-enable.sh $PKG/usr/sbin
+chown root:root $PKG/usr/sbin/wireplumber-disable.sh $PKG/usr/sbin/wireplumber-enable.sh
+chmod 755 $PKG/usr/sbin/wireplumber-disable.sh $PKG/usr/sbin/wireplumber-enable.sh
+
+# Strip binaries:
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ LICENSE NEWS.rst README.rst \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/audio/wireplumber/wireplumber.desktop.sample b/audio/wireplumber/wireplumber.desktop.sample
new file mode 100644
index 000000000000..d3ebdea2d3a4
--- /dev/null
+++ b/audio/wireplumber/wireplumber.desktop.sample
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Version=1.0
+Name=Wireplumber
+Comment=Start the Wireplumber
+Exec=/usr/bin/daemon -frB --pidfiles=~/.run --name=wireplumber /usr/bin/wireplumber
+Terminal=false
+Type=Application
+X-GNOME-Autostart-Phase=Initialization
+X-KDE-autostart-after=pipewire
+X-KDE-autostart-phase=1
diff --git a/audio/wireplumber/wireplumber.info b/audio/wireplumber/wireplumber.info
new file mode 100644
index 000000000000..adb52a1b337f
--- /dev/null
+++ b/audio/wireplumber/wireplumber.info
@@ -0,0 +1,10 @@
+PRGNAM="wireplumber"
+VERSION="0.4.7"
+HOMEPAGE="https://gitlab.freedesktop.org/pipewire/wireplumber"
+DOWNLOAD="https://gitlab.freedesktop.org/pipewire/wireplumber/-/archive/0.4.7/wireplumber-0.4.7.tar.gz"
+MD5SUM="9e63d8944f91b6a4646a736b1f1db251"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="lua53"
+MAINTAINER="marav"
+EMAIL="marav8@free.fr"