diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/pipewire')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/pipewire/0040-alsa-profiles-use-libdir.patch (renamed from nixpkgs/pkgs/development/libraries/pipewire/alsa-profiles-use-libdir.patch) | 0 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch (renamed from nixpkgs/pkgs/development/libraries/pipewire/pipewire-pulse-path.patch) | 15 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/pipewire/0055-pipewire-media-session-path.patch | 27 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/pipewire/0070-installed-tests-path.patch (renamed from nixpkgs/pkgs/development/libraries/pipewire/installed-tests-path.patch) | 24 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/pipewire/0080-pipewire-config-dir.patch (renamed from nixpkgs/pkgs/development/libraries/pipewire/pipewire-config-dir.patch) | 0 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/pipewire/default.nix | 252 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/pipewire/test-paths.nix | 1 |
7 files changed, 194 insertions, 125 deletions
diff --git a/nixpkgs/pkgs/development/libraries/pipewire/alsa-profiles-use-libdir.patch b/nixpkgs/pkgs/development/libraries/pipewire/0040-alsa-profiles-use-libdir.patch index c657d12f7d0c..c657d12f7d0c 100644 --- a/nixpkgs/pkgs/development/libraries/pipewire/alsa-profiles-use-libdir.patch +++ b/nixpkgs/pkgs/development/libraries/pipewire/0040-alsa-profiles-use-libdir.patch diff --git a/nixpkgs/pkgs/development/libraries/pipewire/pipewire-pulse-path.patch b/nixpkgs/pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch index 6ac86b111eef..4a6b21dd4312 100644 --- a/nixpkgs/pkgs/development/libraries/pipewire/pipewire-pulse-path.patch +++ b/nixpkgs/pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch @@ -1,24 +1,27 @@ diff --git a/meson_options.txt b/meson_options.txt -index 4b9e46b8..9d73ed06 100644 +index ce364d93..a6c8af72 100644 --- a/meson_options.txt +++ b/meson_options.txt -@@ -147,3 +147,6 @@ option('pw-cat', +@@ -152,6 +152,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') ++ description: 'Install directory for the pipewire-pulse daemon') + option('systemd-user-unit-dir', + type : 'string', + description : 'Directory for user systemd units (defaults to /usr/lib/systemd/user)') diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build -index 29fc93d4..f78946f2 100644 +index 0a5e5042..4a70b0b0 100644 --- a/src/daemon/systemd/user/meson.build +++ b/src/daemon/systemd/user/meson.build -@@ -6,7 +6,7 @@ install_data( +@@ -9,7 +9,7 @@ install_data( systemd_config = configuration_data() systemd_config.set('PW_BINARY', join_paths(pipewire_bindir, 'pipewire')) -systemd_config.set('PW_PULSE_BINARY', join_paths(pipewire_bindir, 'pipewire-pulse')) +systemd_config.set('PW_PULSE_BINARY', join_paths(get_option('pipewire_pulse_prefix'), 'bin/pipewire-pulse')) + systemd_config.set('PW_MEDIA_SESSION_BINARY', join_paths(pipewire_bindir, 'pipewire-media-session')) configure_file(input : 'pipewire.service.in', - output : 'pipewire.service', diff --git a/nixpkgs/pkgs/development/libraries/pipewire/0055-pipewire-media-session-path.patch b/nixpkgs/pkgs/development/libraries/pipewire/0055-pipewire-media-session-path.patch new file mode 100644 index 000000000000..a4fb8b41e7a1 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/pipewire/0055-pipewire-media-session-path.patch @@ -0,0 +1,27 @@ +diff --git a/meson_options.txt b/meson_options.txt +index e2a1e028..310029f2 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -10,6 +10,9 @@ option('media-session', + description: 'Build and install pipewire-media-session', + type: 'feature', + value: 'auto') ++option('media-session-prefix', ++ description: 'Install directory for pipewire-media-session and its support files', ++ type: 'string') + option('man', + description: 'Build manpages', + type: 'feature', +diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build +index 5c4d1af0..7296220f 100644 +--- a/src/daemon/systemd/user/meson.build ++++ b/src/daemon/systemd/user/meson.build +@@ -10,7 +10,7 @@ install_data( + systemd_config = configuration_data() + systemd_config.set('PW_BINARY', join_paths(pipewire_bindir, 'pipewire')) + systemd_config.set('PW_PULSE_BINARY', join_paths(get_option('pipewire_pulse_prefix'), 'bin/pipewire-pulse')) +-systemd_config.set('PW_MEDIA_SESSION_BINARY', join_paths(pipewire_bindir, 'pipewire-media-session')) ++systemd_config.set('PW_MEDIA_SESSION_BINARY', join_paths(get_option('media-session-prefix'), 'bin/pipewire-media-session')) + + configure_file(input : 'pipewire.service.in', + output : 'pipewire.service', diff --git a/nixpkgs/pkgs/development/libraries/pipewire/installed-tests-path.patch b/nixpkgs/pkgs/development/libraries/pipewire/0070-installed-tests-path.patch index 2a92711626bf..cb695fa398ca 100644 --- a/nixpkgs/pkgs/development/libraries/pipewire/installed-tests-path.patch +++ b/nixpkgs/pkgs/development/libraries/pipewire/0070-installed-tests-path.patch @@ -1,29 +1,29 @@ diff --git a/meson.build b/meson.build -index ffee41b4..bab6f019 100644 +index 97d4d939..b17358e5 100644 --- a/meson.build +++ b/meson.build -@@ -318,8 +318,8 @@ alsa_dep = (get_option('pipewire-alsa') - ? dependency('alsa', version : '>=1.1.7') - : dependency('', required: false)) - +@@ -353,8 +353,8 @@ libinotify_dep = (build_machine.system() == 'freebsd' + + alsa_dep = dependency('alsa', version : '>=1.1.7', required: get_option('pipewire-alsa')) + -installed_tests_metadir = join_paths(pipewire_datadir, 'installed-tests', pipewire_name) -installed_tests_execdir = join_paths(pipewire_libexecdir, 'installed-tests', pipewire_name) +installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', pipewire_name) +installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', pipewire_name) - installed_tests_enabled = get_option('installed_tests') + installed_tests_enabled = not get_option('installed_tests').disabled() installed_tests_template = files('template.test.in') - + diff --git a/meson_options.txt b/meson_options.txt -index f03033c3..32df6c53 100644 +index fba0d647..8c6106cd 100644 --- a/meson_options.txt +++ b/meson_options.txt -@@ -18,6 +18,9 @@ option('installed_tests', +@@ -26,6 +26,9 @@ option('installed_tests', description: 'Install manual and automated test executables', - type: 'boolean', - value: false) + type: 'feature', + value: 'disabled') +option('installed_test_prefix', + description: 'Prefix for installed tests', + type: 'string') option('gstreamer', description: 'Build GStreamer plugins', - type: 'boolean', + type: 'feature', diff --git a/nixpkgs/pkgs/development/libraries/pipewire/pipewire-config-dir.patch b/nixpkgs/pkgs/development/libraries/pipewire/0080-pipewire-config-dir.patch index ad1ae93684b1..ad1ae93684b1 100644 --- a/nixpkgs/pkgs/development/libraries/pipewire/pipewire-config-dir.patch +++ b/nixpkgs/pkgs/development/libraries/pipewire/0080-pipewire-config-dir.patch diff --git a/nixpkgs/pkgs/development/libraries/pipewire/default.nix b/nixpkgs/pkgs/development/libraries/pipewire/default.nix index fdd45b4bb0d9..47a85c36c23a 100644 --- a/nixpkgs/pkgs/development/libraries/pipewire/default.nix +++ b/nixpkgs/pkgs/development/libraries/pipewire/default.nix @@ -1,7 +1,6 @@ { stdenv , lib , fetchFromGitLab -, fetchpatch , removeReferencesTo , meson , ninja @@ -17,15 +16,19 @@ , udev , libva , libsndfile +, SDL2 , vulkan-headers , vulkan-loader +, ncurses , makeFontsConf , callPackage , nixosTests +, withMediaSession ? true , gstreamerSupport ? true, gst_all_1 ? null , ffmpegSupport ? true, ffmpeg ? null -, bluezSupport ? true, bluez ? null, sbc ? null, libopenaptx ? null, ldacbt ? null +, bluezSupport ? true, bluez ? null, sbc ? null, libopenaptx ? null, ldacbt ? null, fdk_aac ? null , nativeHspSupport ? true +, nativeHfpSupport ? true , ofonoSupport ? true , hsphfpdSupport ? true }: @@ -35,112 +38,147 @@ let fontDirectories = []; }; - mesonBool = b: if b then "true" else "false"; -in -stdenv.mkDerivation rec { - pname = "pipewire"; - version = "0.3.18"; - - outputs = [ - "out" - "lib" - "pulse" - "jack" - "dev" - "doc" - "installedTests" - ]; - - src = fetchFromGitLab { - domain = "gitlab.freedesktop.org"; - owner = "pipewire"; - repo = "pipewire"; - rev = version; - sha256 = "1yghhgs18yqrnd0b2r75l5n8yng962r1wszbsi01v6i9zib3jc9g"; - }; + mesonEnable = b: if b then "enabled" else "disabled"; + + self = stdenv.mkDerivation rec { + pname = "pipewire"; + version = "0.3.25"; + + outputs = [ + "out" + "lib" + "pulse" + "jack" + "dev" + "doc" + "mediaSession" + "installedTests" + ]; - patches = [ - # Break up a dependency cycle between outputs. - ./alsa-profiles-use-libdir.patch - # Move installed tests into their own output. - ./installed-tests-path.patch - # Change the path of the pipewire-pulse binary in the service definition. - ./pipewire-pulse-path.patch - # Add flag to specify configuration directory (different from the installation directory). - ./pipewire-config-dir.patch - ]; - - nativeBuildInputs = [ - doxygen - graphviz - meson - ninja - pkg-config - ]; - - buildInputs = [ - alsaLib - dbus - glib - libjack2 - libsndfile - udev - vulkan-headers - vulkan-loader - valgrind - systemd - ] ++ lib.optionals gstreamerSupport [ gst_all_1.gst-plugins-base gst_all_1.gstreamer ] - ++ lib.optional ffmpegSupport ffmpeg - ++ lib.optionals bluezSupport [ bluez libopenaptx ldacbt sbc ]; - - mesonFlags = [ - "-Ddocs=true" - "-Dman=false" # we don't have xmltoman - "-Dexamples=true" # only needed for `pipewire-media-session` - "-Dudevrulesdir=lib/udev/rules.d" - "-Dinstalled_tests=true" - "-Dinstalled_test_prefix=${placeholder "installedTests"}" - "-Dpipewire_pulse_prefix=${placeholder "pulse"}" - "-Dlibjack-path=${placeholder "jack"}/lib" - "-Dgstreamer=${mesonBool gstreamerSupport}" - "-Dffmpeg=${mesonBool ffmpegSupport}" - "-Dbluez5=${mesonBool bluezSupport}" - "-Dbluez5-backend-native=${mesonBool nativeHspSupport}" - "-Dbluez5-backend-ofono=${mesonBool ofonoSupport}" - "-Dbluez5-backend-hsphfpd=${mesonBool hsphfpdSupport}" - "-Dpipewire_config_dir=/etc/pipewire" - ]; - - FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file - - doCheck = true; - - postInstall = '' - moveToOutput "share/systemd/user/pipewire-pulse.*" "$pulse" - moveToOutput "lib/systemd/user/pipewire-pulse.*" "$pulse" - 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" - ]; - paths-lib = [ - "lib/alsa-lib/libasound_module_pcm_pipewire.so" - "share/alsa-card-profile/mixer" - ]; + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "pipewire"; + repo = "pipewire"; + rev = version; + hash = "sha256:EbXWcf6QLtbvm6/eXBI+PF2sTw2opYfmc+H/SMDEH1U="; }; - }; - meta = with lib; { - description = "Server and user space API to deal with multimedia pipelines"; - homepage = "https://pipewire.org/"; - license = licenses.mit; - platforms = platforms.linux; - maintainers = with maintainers; [ jtojnar ]; + 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 + # Change the path of the pipewire-media-session binary in the service definition. + ./0055-pipewire-media-session-path.patch + # Move installed tests into their own output. + ./0070-installed-tests-path.patch + # Add flag to specify configuration directory (different from the installation directory). + ./0080-pipewire-config-dir.patch + ]; + + nativeBuildInputs = [ + doxygen + graphviz + meson + ninja + pkg-config + ]; + + buildInputs = [ + alsaLib + dbus + glib + libjack2 + libsndfile + ncurses + udev + vulkan-headers + vulkan-loader + valgrind + SDL2 + systemd + ] ++ lib.optionals gstreamerSupport [ gst_all_1.gst-plugins-base gst_all_1.gstreamer ] + ++ lib.optional ffmpegSupport ffmpeg + ++ lib.optionals bluezSupport [ bluez libopenaptx ldacbt sbc fdk_aac ]; + + mesonFlags = [ + "-Ddocs=enabled" + "-Dman=disabled" # we don't have xmltoman + "-Dexamples=${mesonEnable withMediaSession}" # only needed for `pipewire-media-session` + "-Dudevrulesdir=lib/udev/rules.d" + "-Dinstalled_tests=enabled" + "-Dinstalled_test_prefix=${placeholder "installedTests"}" + "-Dpipewire_pulse_prefix=${placeholder "pulse"}" + "-Dmedia-session-prefix=${placeholder "mediaSession"}" + "-Dlibjack-path=${placeholder "jack"}/lib" + "-Dlibcamera=disabled" + "-Dgstreamer=${mesonEnable gstreamerSupport}" + "-Dffmpeg=${mesonEnable ffmpegSupport}" + "-Dbluez5=${mesonEnable bluezSupport}" + "-Dbluez5-backend-hsp-native=${mesonEnable nativeHspSupport}" + "-Dbluez5-backend-hfp-native=${mesonEnable nativeHfpSupport}" + "-Dbluez5-backend-ofono=${mesonEnable ofonoSupport}" + "-Dbluez5-backend-hsphfpd=${mesonEnable hsphfpdSupport}" + "-Dpipewire_config_dir=/etc/pipewire" + ]; + + FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file + + doCheck = true; + + postInstall = '' + pushd . + cd $out + mkdir -p $out/nix-support/etc/pipewire + for f in etc/pipewire/*.conf; do bin/spa-json-dump "$f" > "$out/nix-support/$f.json"; done + + mkdir -p $mediaSession/nix-support/etc/pipewire/media-session.d + for f in etc/pipewire/media-session.d/*.conf; do bin/spa-json-dump "$f" > "$mediaSession/nix-support/$f.json"; done + popd + + moveToOutput "etc/pipewire/media-session.d/*.conf" "$mediaSession" + moveToOutput "share/systemd/user/pipewire-media-session.*" "$mediaSession" + moveToOutput "lib/systemd/user/pipewire-media-session.*" "$mediaSession" + moveToOutput "bin/pipewire-media-session" "$mediaSession" + + moveToOutput "share/systemd/user/pipewire-pulse.*" "$pulse" + moveToOutput "lib/systemd/user/pipewire-pulse.*" "$pulse" + 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" + ]; + }; + }; + + meta = with lib; { + description = "Server and user space API to deal with multimedia pipelines"; + homepage = "https://pipewire.org/"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ jtojnar ]; + }; }; -} + +in self diff --git a/nixpkgs/pkgs/development/libraries/pipewire/test-paths.nix b/nixpkgs/pkgs/development/libraries/pipewire/test-paths.nix index 0ae693741946..11d00e7c2ca1 100644 --- a/nixpkgs/pkgs/development/libraries/pipewire/test-paths.nix +++ b/nixpkgs/pkgs/development/libraries/pipewire/test-paths.nix @@ -14,6 +14,7 @@ let in runCommand "pipewire-test-paths" { } '' touch $out + ${check-output pipewire.mediaSession paths-out-media-session} ${check-output pipewire.lib paths-lib} ${check-output pipewire paths-out} |