summary refs log tree commit diff
path: root/pkgs/development/libraries/pipewire
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-11-21 16:12:21 +0100
committerAlyssa Ross <hi@alyssa.is>2023-11-21 16:12:48 +0100
commit048a4cd441a59cbf89defb18bb45c9f0b4429b35 (patch)
treef8f5850ff05521ab82d65745894714a8796cbfb6 /pkgs/development/libraries/pipewire
parent030c5028b07afcedce7c5956015c629486cc79d9 (diff)
parent4c2d05dd6435d449a3651a6dd314d9411b5f8146 (diff)
downloadnixpkgs-rootfs.tar
nixpkgs-rootfs.tar.gz
nixpkgs-rootfs.tar.bz2
nixpkgs-rootfs.tar.lz
nixpkgs-rootfs.tar.xz
nixpkgs-rootfs.tar.zst
nixpkgs-rootfs.zip
Rebase onto e4ad989506ec7d71f7302cc3067abd82730a4beb HEAD rootfs
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'pkgs/development/libraries/pipewire')
-rw-r--r--pkgs/development/libraries/pipewire/0040-alsa-profiles-use-libdir.patch13
-rw-r--r--pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch27
-rw-r--r--pkgs/development/libraries/pipewire/0080-pipewire-config-dir.patch30
-rw-r--r--pkgs/development/libraries/pipewire/0090-pipewire-config-template-paths.patch50
-rw-r--r--pkgs/development/libraries/pipewire/0095-spa-data-dir.patch12
-rw-r--r--pkgs/development/libraries/pipewire/default.nix44
-rw-r--r--pkgs/development/libraries/pipewire/wireplumber.nix48
7 files changed, 37 insertions, 187 deletions
diff --git a/pkgs/development/libraries/pipewire/0040-alsa-profiles-use-libdir.patch b/pkgs/development/libraries/pipewire/0040-alsa-profiles-use-libdir.patch
deleted file mode 100644
index fab89c4ffd9..00000000000
--- a/pkgs/development/libraries/pipewire/0040-alsa-profiles-use-libdir.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/meson.build b/meson.build
-index 99a4b2d1..d4a4cda7 100644
---- a/meson.build
-+++ b/meson.build
-@@ -55,7 +55,7 @@ endif
- 
- spa_plugindir = pipewire_libdir / spa_name
- 
--alsadatadir = pipewire_datadir / 'alsa-card-profile' / 'mixer'
-+alsadatadir = pipewire_libdir / '..' / 'share' / 'alsa-card-profile' / 'mixer'
- 
- pipewire_headers_dir = pipewire_name / 'pipewire'
- 
diff --git a/pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch b/pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch
deleted file mode 100644
index 230f1b30394..00000000000
--- a/pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff --git a/meson_options.txt b/meson_options.txt
-index 961ae2a76..692b84dfd 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -179,6 +179,9 @@ option('udev',
- option('udevrulesdir',
-        type : 'string',
-        description : 'Directory for udev rules (defaults to /lib/udev/rules.d)')
-+option('pipewire_pulse_prefix',
-+       type : 'string',
-+       description: 'Install directory for the pipewire-pulse daemon')
- option('systemd-system-unit-dir',
-        type : 'string',
-        description : 'Directory for system systemd units (defaults to /usr/lib/systemd/system)')
-diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build
-index d17f3794f..34afe4f1a 100644
---- a/src/daemon/systemd/user/meson.build
-+++ b/src/daemon/systemd/user/meson.build
-@@ -9,7 +9,7 @@ install_data(
- 
- systemd_config = configuration_data()
- systemd_config.set('PW_BINARY', pipewire_bindir / 'pipewire')
--systemd_config.set('PW_PULSE_BINARY', pipewire_bindir / 'pipewire-pulse')
-+systemd_config.set('PW_PULSE_BINARY', get_option('pipewire_pulse_prefix') / 'bin/pipewire-pulse')
- 
- configure_file(input : 'pipewire.service.in',
-                output : 'pipewire.service',
diff --git a/pkgs/development/libraries/pipewire/0080-pipewire-config-dir.patch b/pkgs/development/libraries/pipewire/0080-pipewire-config-dir.patch
deleted file mode 100644
index b8d8fcb0f90..00000000000
--- a/pkgs/development/libraries/pipewire/0080-pipewire-config-dir.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git a/meson.build b/meson.build
-index b6b4553b..f21c29d8 100644
---- a/meson.build
-+++ b/meson.build
-@@ -37,7 +37,10 @@ pipewire_localedir = prefix / get_option('localedir')
- pipewire_sysconfdir = prefix / get_option('sysconfdir')
- 
- pipewire_configdir = pipewire_sysconfdir / 'pipewire'
--pipewire_confdatadir = pipewire_datadir / 'pipewire'
-+pipewire_confdatadir = get_option('pipewire_confdata_dir')
-+if pipewire_confdatadir == ''
-+  pipewire_confdatadir = pipewire_datadir / 'pipewire'
-+endif
- modules_install_dir = pipewire_libdir / pipewire_name
- 
- if host_machine.system() == 'linux'
-diff --git a/meson_options.txt b/meson_options.txt
-index 9bc33fcd..e4bd2dc1 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -61,6 +61,9 @@ option('jack-devel',
- option('libjack-path',
-        description: 'Where to install the libjack.so library',
-        type: 'string')
-+option('pipewire_confdata_dir',
-+       type: 'string',
-+       description: 'Directory for pipewire default configuration (defaults to /usr/share/pipewire)')
- option('spa-plugins',
-        description: 'Enable spa plugins integration',
-        type: 'feature',
diff --git a/pkgs/development/libraries/pipewire/0090-pipewire-config-template-paths.patch b/pkgs/development/libraries/pipewire/0090-pipewire-config-template-paths.patch
deleted file mode 100644
index ca7d351257b..00000000000
--- a/pkgs/development/libraries/pipewire/0090-pipewire-config-template-paths.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-diff --git a/src/daemon/minimal.conf.in b/src/daemon/minimal.conf.in
-index 9c885a38f..c474eb45d 100644
---- a/src/daemon/minimal.conf.in
-+++ b/src/daemon/minimal.conf.in
-@@ -111,7 +111,7 @@ context.modules = [
-             # access.allowed to list an array of paths of allowed
-             # apps.
-             #access.allowed = [
--            #    @session_manager_path@
-+            #    <session_manager_path>
-             #]
- 
-             # An array of rejected paths.
-@@ -359,5 +359,5 @@ context.exec = [
-     # It can be interesting to start another daemon here that listens
-     # on another address with the -a option (eg. -a tcp:4713).
-     #
--    #@pulse_comment@{ path = "@pipewire_path@" args = "-c pipewire-pulse.conf" }
-+    #@pulse_comment@{ path = "<pipewire_path>" args = "-c pipewire-pulse.conf" }
- ]
-diff --git a/src/daemon/pipewire.conf.in b/src/daemon/pipewire.conf.in
-index 697bf094d..3a7b54ddd 100644
---- a/src/daemon/pipewire.conf.in
-+++ b/src/daemon/pipewire.conf.in
-@@ -142,7 +142,7 @@ context.modules = [
-             # access.allowed to list an array of paths of allowed
-             # apps.
-             #access.allowed = [
--            #    @session_manager_path@
-+            #    <session_manager_path>
-             #]
- 
-             # An array of rejected paths.
-@@ -294,7 +294,7 @@ context.exec = [
-     # but it is better to start it as a systemd service.
-     # Run the session manager with -h for options.
-     #
--    @sm_comment@{ path = "@session_manager_path@" args = "@session_manager_args@"
-+    @sm_comment@{ path = "<session_manager_path>" args = "@session_manager_args@"
-     @sm_comment@  condition = [ { exec.session-manager = null } { exec.session-manager = true } ] }
-     #
-     # You can optionally start the pulseaudio-server here as well
-@@ -302,6 +302,6 @@ context.exec = [
-     # It can be interesting to start another daemon here that listens
-     # on another address with the -a option (eg. -a tcp:4713).
-     #
--    @pulse_comment@{ path = "@pipewire_path@" args = "-c pipewire-pulse.conf"
-+    @pulse_comment@{ path = "<pipewire_path>" args = "-c pipewire-pulse.conf"
-     @pulse_comment@  condition = [ { exec.pipewire-pulse = null } { exec.pipewire-pulse = true } ] }
- ]
diff --git a/pkgs/development/libraries/pipewire/0095-spa-data-dir.patch b/pkgs/development/libraries/pipewire/0095-spa-data-dir.patch
deleted file mode 100644
index d8241a809f6..00000000000
--- a/pkgs/development/libraries/pipewire/0095-spa-data-dir.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/meson.build b/meson.build
-index 56599ebd1..3bed2d3e3 100644
---- a/meson.build
-+++ b/meson.build
-@@ -54,7 +54,7 @@ else
- endif
- 
- spa_plugindir = pipewire_libdir / spa_name
--spa_datadir = pipewire_datadir / spa_name
-+spa_datadir = pipewire_libdir / spa_name
- 
- alsadatadir = pipewire_datadir / 'alsa-card-profile' / 'mixer'
diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix
index fdc514c286b..3876a5c892a 100644
--- a/pkgs/development/libraries/pipewire/default.nix
+++ b/pkgs/development/libraries/pipewire/default.nix
@@ -23,6 +23,7 @@
 , vulkan-headers
 , vulkan-loader
 , webrtc-audio-processing
+, webrtc-audio-processing_1
 , ncurses
 , readline # meson can't find <7 as those versions don't have a .pc file
 , lilv
@@ -42,10 +43,11 @@
 , bluez
 , sbc
 , libfreeaptx
-, ldacbt
 , liblc3
 , fdk_aac
 , libopus
+, ldacbtSupport ? bluezSupport && lib.meta.availableOn stdenv.hostPlatform ldacbt
+, ldacbt
 , nativeHspSupport ? true
 , nativeHfpSupport ? true
 , nativeModemManagerSupport ? true
@@ -68,19 +70,21 @@
 , tinycompress
 , ffadoSupport ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
 , ffado
+, libselinux
 }:
 
+# Bluetooth codec only makes sense if general bluetooth enabled
+assert ldacbtSupport -> bluezSupport;
+
 let
   mesonEnableFeature = b: if b then "enabled" else "disabled";
 
   self = stdenv.mkDerivation rec {
     pname = "pipewire";
-    version = "0.3.79";
+    version = "0.3.84";
 
     outputs = [
       "out"
-      "lib"
-      "pulse"
       "jack"
       "dev"
       "doc"
@@ -93,24 +97,14 @@ let
       owner = "pipewire";
       repo = "pipewire";
       rev = version;
-      sha256 = "sha256-pqs991pMqz3IQE+NUk0VNzZS4ExwfoZqBQDWBSGdWcs=";
+      sha256 = "sha256-9W9y+wtS/CYUaPRrCRmRDeyvuS1XllMBNQLy6GAMqBM=";
     };
 
     patches = [
-      # Break up a dependency cycle between outputs.
-      ./0040-alsa-profiles-use-libdir.patch
-      # Change the path of the pipewire-pulse binary in the service definition.
-      ./0050-pipewire-pulse-path.patch
       # Load libjack from a known location
       ./0060-libjack-path.patch
       # Move installed tests into their own output.
       ./0070-installed-tests-path.patch
-      # Add option for changing the config install directory
-      ./0080-pipewire-config-dir.patch
-      # Remove output paths from the comments in the config templates to break dependency cycles
-      ./0090-pipewire-config-template-paths.patch
-      # Place SPA data files in lib output to avoid dependency cycles
-      ./0095-spa-data-dir.patch
     ];
 
     strictDeps = true;
@@ -131,6 +125,7 @@ let
       glib
       libjack2
       libusb1
+      libselinux
       libsndfile
       lilv
       ncurses
@@ -138,13 +133,14 @@ let
       udev
       vulkan-headers
       vulkan-loader
-      webrtc-audio-processing
       tinycompress
     ] ++ (if enableSystemd then [ systemd ] else [ eudev ])
+    ++ (if lib.meta.availableOn stdenv.hostPlatform webrtc-audio-processing_1 then [ webrtc-audio-processing_1 ] else [ webrtc-audio-processing ])
     ++ lib.optionals gstreamerSupport [ gst_all_1.gst-plugins-base gst_all_1.gstreamer ]
     ++ lib.optionals libcameraSupport [ libcamera libdrm ]
     ++ lib.optional ffmpegSupport ffmpeg
-    ++ lib.optionals bluezSupport [ bluez libfreeaptx ldacbt liblc3 sbc fdk_aac libopus ]
+    ++ lib.optionals bluezSupport [ bluez libfreeaptx liblc3 sbc fdk_aac libopus ]
+    ++ lib.optional ldacbtSupport ldacbt
     ++ lib.optional nativeModemManagerSupport modemmanager
     ++ lib.optional pulseTunnelSupport libpulseaudio
     ++ lib.optional zeroconfSupport avahi
@@ -162,9 +158,7 @@ let
       "-Dudevrulesdir=lib/udev/rules.d"
       "-Dinstalled_tests=enabled"
       "-Dinstalled_test_prefix=${placeholder "installedTests"}"
-      "-Dpipewire_pulse_prefix=${placeholder "pulse"}"
       "-Dlibjack-path=${placeholder "jack"}/lib"
-      "-Dlibv4l2-path=${placeholder "out"}/lib"
       "-Dlibcamera=${mesonEnableFeature libcameraSupport}"
       "-Dlibffado=${mesonEnableFeature ffadoSupport}"
       "-Droc=${mesonEnableFeature rocSupport}"
@@ -173,7 +167,6 @@ let
       "-Dgstreamer=${mesonEnableFeature gstreamerSupport}"
       "-Dsystemd-system-service=${mesonEnableFeature enableSystemd}"
       "-Dudev=${mesonEnableFeature (!enableSystemd)}"
-      "-Dudevrulesdir=${placeholder "out"}/lib/udev/rules.d"
       "-Dffmpeg=${mesonEnableFeature ffmpegSupport}"
       "-Dbluez5=${mesonEnableFeature bluezSupport}"
       "-Dbluez5-backend-hsp-native=${mesonEnableFeature nativeHspSupport}"
@@ -184,8 +177,8 @@ let
       # source code is not easily obtainable
       "-Dbluez5-codec-lc3plus=disabled"
       "-Dbluez5-codec-lc3=${mesonEnableFeature bluezSupport}"
+      "-Dbluez5-codec-ldac=${mesonEnableFeature ldacbtSupport}"
       "-Dsysconfdir=/etc"
-      "-Dpipewire_confdata_dir=${placeholder "lib"}/share/pipewire"
       "-Draop=${mesonEnableFeature raopSupport}"
       "-Dsession-managers="
       "-Dvulkan=enabled"
@@ -209,15 +202,6 @@ let
     '';
 
     postInstall = ''
-      ${lib.optionalString enableSystemd ''
-        moveToOutput "share/systemd/user/pipewire-pulse.*" "$pulse"
-        moveToOutput "lib/systemd/user/pipewire-pulse.*" "$pulse"
-      ''}
-
-      rm $out/bin/pipewire-pulse
-      mkdir -p $pulse/bin
-      ln -sf $out/bin/pipewire $pulse/bin/pipewire-pulse
-
       moveToOutput "bin/pw-jack" "$jack"
     '';
 
diff --git a/pkgs/development/libraries/pipewire/wireplumber.nix b/pkgs/development/libraries/pipewire/wireplumber.nix
index 4e249459d7a..37dea2ece86 100644
--- a/pkgs/development/libraries/pipewire/wireplumber.nix
+++ b/pkgs/development/libraries/pipewire/wireplumber.nix
@@ -2,31 +2,29 @@
 , stdenv
 , fetchFromGitLab
 , nix-update-script
-, # base build deps
-  meson
+# base build deps
+, meson
 , pkg-config
 , ninja
-, # docs build deps
-  python3
+# docs build deps
+, python3
 , doxygen
 , graphviz
-, # GI build deps
-  gobject-introspection
-, # runtime deps
-  glib
+# GI build deps
+, gobject-introspection
+# runtime deps
+, glib
 , systemd
 , lua5_4
 , pipewire
-, # options
-  enableDocs ? true
+# options
+, enableDocs ? true
 , enableGI ? true
 }:
-let
-  mesonEnableFeature = b: if b then "enabled" else "disabled";
-in
+
 stdenv.mkDerivation rec {
   pname = "wireplumber";
-  version = "0.4.14";
+  version = "0.4.15";
 
   outputs = [ "out" "dev" ] ++ lib.optional enableDocs "doc";
 
@@ -35,7 +33,7 @@ stdenv.mkDerivation rec {
     owner = "pipewire";
     repo = "wireplumber";
     rev = version;
-    sha256 = "sha256-PKS+WErdZuSU4jrFHQcRbnZIHlnlv06R6ZxIAIBptko=";
+    hash = "sha256-VwzpPAVfoaV47O7OjXtPQj5s8zfH5rkB22Pdlg7u5Fg=";
   };
 
   nativeBuildInputs = [
@@ -48,9 +46,9 @@ stdenv.mkDerivation rec {
     gobject-introspection
   ] ++ lib.optionals (enableDocs || enableGI) [
     doxygen
-    (python3.pythonForBuild.withPackages (ps: with ps;
-    lib.optionals enableDocs [ sphinx sphinx-rtd-theme breathe ] ++
-      lib.optionals enableGI [ lxml ]
+    (python3.pythonOnBuildForHost.withPackages (ps: with ps;
+      lib.optionals enableDocs [ sphinx sphinx-rtd-theme breathe ]
+      ++ lib.optionals enableGI [ lxml ]
     ))
   ];
 
@@ -62,13 +60,13 @@ stdenv.mkDerivation rec {
   ];
 
   mesonFlags = [
-    "-Dsystem-lua=true"
-    "-Delogind=disabled"
-    "-Ddoc=${mesonEnableFeature enableDocs}"
-    "-Dintrospection=${mesonEnableFeature enableGI}"
-    "-Dsystemd-system-service=true"
-    "-Dsystemd-system-unit-dir=${placeholder "out"}/lib/systemd/system"
-    "-Dsysconfdir=/etc"
+    (lib.mesonBool "system-lua" true)
+    (lib.mesonEnable "elogind" false)
+    (lib.mesonEnable "doc" enableDocs)
+    (lib.mesonEnable "introspection" enableGI)
+    (lib.mesonBool "systemd-system-service" true)
+    (lib.mesonOption "systemd-system-unit-dir" "${placeholder "out"}/lib/systemd/system")
+    (lib.mesonOption "sysconfdir" "/etc")
   ];
 
   passthru.updateScript = nix-update-script { };