From baee63f5e1af6d6a16fc0d3bd993673ecc689e00 Mon Sep 17 00:00:00 2001 From: Zack A Date: Fri, 29 Oct 2021 05:36:54 -0700 Subject: [PATCH] SDL2: add pipewire & libdecor support Co-authored-by: jakobrs --- pkgs/development/libraries/SDL2/default.nix | 6 ++++++ pkgs/development/libraries/pipewire/default.nix | 5 ++--- pkgs/top-level/all-packages.nix | 12 +++++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix index c7b2c03249d7..d1086de3718d 100644 --- a/pkgs/development/libraries/SDL2/default.nix +++ b/pkgs/development/libraries/SDL2/default.nix @@ -31,6 +31,10 @@ , ibus , fcitxSupport ? false , fcitx +, libdecorSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid +, libdecor +, pipewireSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid +, pipewire # NOTE: must be built with SDL2 without pipewire support , pulseaudioSupport ? config.pulseaudio or stdenv.isLinux && !stdenv.hostPlatform.isAndroid , libpulseaudio , AudioUnit @@ -75,6 +79,8 @@ stdenv.mkDerivation rec { dlopenBuildInputs = optionals alsaSupport [ alsa-lib audiofile ] ++ optional dbusSupport dbus + ++ optional libdecorSupport libdecor + ++ optional pipewireSupport pipewire ++ optional pulseaudioSupport libpulseaudio ++ optional udevSupport udev ++ optionals waylandSupport [ wayland wayland-protocols libxkbcommon ] diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix index 79682d7ace81..fc5f6608ed2f 100644 --- a/pkgs/development/libraries/pipewire/default.nix +++ b/pkgs/development/libraries/pipewire/default.nix @@ -20,7 +20,6 @@ , udev , libva , libsndfile -, SDL2 , vulkan-headers , vulkan-loader , webrtc-audio-processing @@ -129,7 +128,6 @@ let vulkan-headers vulkan-loader webrtc-audio-processing - SDL2 systemd ] ++ lib.optionals gstreamerSupport [ gst_all_1.gst-plugins-base gst_all_1.gstreamer ] ++ lib.optionals libcameraSupport [ libcamera libdrm ] @@ -139,7 +137,7 @@ let ++ lib.optional zeroconfSupport avahi ++ lib.optional raopSupport openssl ++ lib.optional rocSupport roc-toolkit - ++ lib.optionals x11Support [ libcanberra xorg.libxcb ]; + ++ lib.optionals x11Support [ libcanberra xorg.libX11 ]; # Valgrind binary is required for running one optional test. checkInputs = lib.optional withValgrind valgrind; @@ -169,6 +167,7 @@ let "-Dsession-managers=" "-Dvulkan=enabled" "-Dx11=${mesonEnableFeature x11Support}" + "-Dsdl2=disabled" # required only to build examples, causes dependency loop ]; # Fontconfig error: Cannot load default config file diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2c74102c8993..dfa0b91d4028 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13962,8 +13962,18 @@ with pkgs; pipenv = callPackage ../development/tools/pipenv {}; - pipewire = callPackage ../development/libraries/pipewire {}; + pipewire = callPackage ../development/libraries/pipewire { + # ffmpeg depends on SDL2 which depends on pipewire by default. + # Break the cycle by disabling pipewire support in our ffmpeg. + ffmpeg = ffmpeg.override { + SDL2 = SDL2.override { + pipewireSupport = false; + }; + }; + }; + pipewire-media-session = callPackage ../development/libraries/pipewire/media-session.nix {}; + pipewire_0_2 = callPackage ../development/libraries/pipewire/0.2.nix {}; wireplumber = callPackage ../development/libraries/pipewire/wireplumber.nix {};