summary refs log tree commit diff
path: root/pkgs/development/libraries/pipewire
diff options
context:
space:
mode:
authortalyz <kim.lindberger@gmail.com>2021-04-27 12:52:41 +0200
committertalyz <kim.lindberger@gmail.com>2021-04-27 16:50:22 +0200
commitfb86d324d1a6f05a6da55af6e2ae8922e7063498 (patch)
tree0af00bd29d8d2624ada12eb4edbbc9343b7e73fa /pkgs/development/libraries/pipewire
parent6edd10201308a454f6145febc1b38317592ab7a3 (diff)
downloadnixpkgs-fb86d324d1a6f05a6da55af6e2ae8922e7063498.tar
nixpkgs-fb86d324d1a6f05a6da55af6e2ae8922e7063498.tar.gz
nixpkgs-fb86d324d1a6f05a6da55af6e2ae8922e7063498.tar.bz2
nixpkgs-fb86d324d1a6f05a6da55af6e2ae8922e7063498.tar.lz
nixpkgs-fb86d324d1a6f05a6da55af6e2ae8922e7063498.tar.xz
nixpkgs-fb86d324d1a6f05a6da55af6e2ae8922e7063498.tar.zst
nixpkgs-fb86d324d1a6f05a6da55af6e2ae8922e7063498.zip
pipewire: Add update script
Diffstat (limited to 'pkgs/development/libraries/pipewire')
-rw-r--r--pkgs/development/libraries/pipewire/default.nix50
-rwxr-xr-xpkgs/development/libraries/pipewire/update.sh24
2 files changed, 50 insertions, 24 deletions
diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix
index 9f095c7ab78..133853e2362 100644
--- a/pkgs/development/libraries/pipewire/default.nix
+++ b/pkgs/development/libraries/pipewire/default.nix
@@ -60,7 +60,7 @@ let
       owner = "pipewire";
       repo = "pipewire";
       rev = version;
-      hash = "sha256:1rqi1sa937lp89ai79b5n7m0p66pigpj4w1mr2vq4dycfp8vppxk";
+      sha256 = "sha256-s9+70XXMN4K3yDVwIu+L15gL6rFlpRNVQpeekZQOEec=";
     };
 
     patches = [
@@ -146,29 +146,31 @@ let
       moveToOutput "bin/pipewire-pulse" "$pulse"
     '';
 
-    passthru.tests = {
-      installedTests = nixosTests.installed-tests.pipewire;
-
-      # This ensures that all the paths used by the NixOS module are found.
-      test-paths = callPackage ./test-paths.nix {
-        paths-out = [
-          "share/alsa/alsa.conf.d/50-pipewire.conf"
-          "nix-support/etc/pipewire/client.conf.json"
-          "nix-support/etc/pipewire/client-rt.conf.json"
-          "nix-support/etc/pipewire/jack.conf.json"
-          "nix-support/etc/pipewire/pipewire.conf.json"
-          "nix-support/etc/pipewire/pipewire-pulse.conf.json"
-        ];
-        paths-out-media-session = [
-          "nix-support/etc/pipewire/media-session.d/alsa-monitor.conf.json"
-          "nix-support/etc/pipewire/media-session.d/bluez-monitor.conf.json"
-          "nix-support/etc/pipewire/media-session.d/media-session.conf.json"
-          "nix-support/etc/pipewire/media-session.d/v4l2-monitor.conf.json"
-        ];
-        paths-lib = [
-          "lib/alsa-lib/libasound_module_pcm_pipewire.so"
-          "share/alsa-card-profile/mixer"
-        ];
+    passthru = {
+      updateScript = ./update.sh;
+      tests = {
+        installedTests = nixosTests.installed-tests.pipewire;
+
+        # This ensures that all the paths used by the NixOS module are found.
+        test-paths = callPackage ./test-paths.nix {
+          paths-out = [
+            "share/alsa/alsa.conf.d/50-pipewire.conf"
+            "nix-support/etc/pipewire/client.conf.json"
+            "nix-support/etc/pipewire/jack.conf.json"
+            "nix-support/etc/pipewire/pipewire.conf.json"
+            "nix-support/etc/pipewire/pipewire-pulse.conf.json"
+          ];
+          paths-out-media-session = [
+            "nix-support/etc/pipewire/media-session.d/alsa-monitor.conf.json"
+            "nix-support/etc/pipewire/media-session.d/bluez-monitor.conf.json"
+            "nix-support/etc/pipewire/media-session.d/media-session.conf.json"
+            "nix-support/etc/pipewire/media-session.d/v4l2-monitor.conf.json"
+          ];
+          paths-lib = [
+            "lib/alsa-lib/libasound_module_pcm_pipewire.so"
+            "share/alsa-card-profile/mixer"
+          ];
+        };
       };
     };
 
diff --git a/pkgs/development/libraries/pipewire/update.sh b/pkgs/development/libraries/pipewire/update.sh
new file mode 100755
index 00000000000..6d0088c206c
--- /dev/null
+++ b/pkgs/development/libraries/pipewire/update.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -p nix-update -i bash
+# shellcheck shell=bash
+
+set -o errexit -o pipefail -o nounset -o errtrace
+shopt -s inherit_errexit
+shopt -s nullglob
+IFS=$'\n'
+
+NIXPKGS_ROOT="$(git rev-parse --show-toplevel)"
+
+cd "$NIXPKGS_ROOT"
+nix-update pipewire
+outputs=$(nix-build . -A pipewire -A pipewire.mediaSession)
+for p in $outputs; do
+    conf_files=$(find "$p/nix-support/etc/pipewire/" -name '*.conf.json')
+    for c in $conf_files; do
+        file_name=$(basename "$c")
+        if [[ ! -e "nixos/modules/services/desktops/pipewire/$file_name" ]]; then
+            echo "New file $file_name found! Add it to the module config and passthru tests!"
+        fi
+        install -m 0644 "$c" "nixos/modules/services/desktops/pipewire/"
+    done
+done