Date: Friday, October 22, 2021 @ 17:09:50
  Author: dvzrv
Revision: 1032553

upgpkg: wireplumber 0.4.4-2: Rebuild to add .install file.

Add pipewire-media-session to conflicts, as wireplumber needs to be enabled the
same as pipewire-media-session needs to be enabled:
https://bugs.archlinux.org/task/72283
Add install file for enabling/reenabling wireplumber globally.

Added:
  wireplumber/trunk/wireplumber.install
Modified:
  wireplumber/trunk/PKGBUILD

---------------------+
 PKGBUILD            |    4 +++-
 wireplumber.install |   20 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2021-10-22 17:05:16 UTC (rev 1032552)
+++ PKGBUILD    2021-10-22 17:09:50 UTC (rev 1032553)
@@ -3,7 +3,7 @@
 pkgbase=wireplumber
 pkgname=('wireplumber' 'wireplumber-docs')
 pkgver=0.4.4
-pkgrel=1
+pkgrel=2
 pkgdesc="Session / policy manager implementation for PipeWire"
 arch=('x86_64')
 url="https://gitlab.freedesktop.org/pipewire/wireplumber";
@@ -37,6 +37,8 @@
   'libgmodule-2.0.so' 'libgobject-2.0.so' 'libpipewire-0.3.so')
   optdepends=('wireplumber-docs: for documentation')
   provides=('libwireplumber-0.4.so' 'pipewire-session-manager')
+  conflicts=('pipewire-media-session')
+  install="${pkgname}.install"
 
   cd "$pkgbase-$pkgver"
   DESTDIR="${pkgdir}" meson install -C build

Added: wireplumber.install
===================================================================
--- wireplumber.install                         (rev 0)
+++ wireplumber.install 2021-10-22 17:09:50 UTC (rev 1032553)
@@ -0,0 +1,20 @@
+post_install() {
+  # Enable service by default, as it is aliased for
+  # pipewire-session-manager.service, which is required by pipewire.service
+  systemctl --global enable wireplumber.service
+}
+
+post_upgrade() {
+  if (( $(vercmp "$2" '0.4.4-2') < 0)); then
+    printf "\tReenable any per-user enabled wireplumber.service\n \
+      \tmanually to establish a new service alias for\n \
+      \tpipewire-session-manager.service added with 0.4.4.\n"
+    # reenable already enabled global pipewire-media-session.service, as an 
alias is introduced with 0.3.38
+    if systemctl --global is-enabled -q wireplumber.service; then
+      systemctl --global reenable wireplumber.service
+    fi
+    # in case the service has not been enabled before, enable it:
+    # wireplumber and pipewire-media-session conflict from this point on
+    systemctl --global enable wireplumber.service
+  fi
+}

Reply via email to