summary refs log tree commit diff
diff options
context:
space:
mode:
authorLászló Vaskó <1771332+vlaci@users.noreply.github.com>2023-08-04 13:56:39 +0200
committerLászló Vaskó <1771332+vlaci@users.noreply.github.com>2023-08-14 19:33:19 +0200
commite4dcdb133a290b11537a1ef6af4fde0b76cf8807 (patch)
treef193f5a28373f712f227adbd01f4afec3542ba29
parent0c79d4f14764e62ee49872c98cb9f4fcc7e7f6e7 (diff)
downloadnixpkgs-e4dcdb133a290b11537a1ef6af4fde0b76cf8807.tar
nixpkgs-e4dcdb133a290b11537a1ef6af4fde0b76cf8807.tar.gz
nixpkgs-e4dcdb133a290b11537a1ef6af4fde0b76cf8807.tar.bz2
nixpkgs-e4dcdb133a290b11537a1ef6af4fde0b76cf8807.tar.lz
nixpkgs-e4dcdb133a290b11537a1ef6af4fde0b76cf8807.tar.xz
nixpkgs-e4dcdb133a290b11537a1ef6af4fde0b76cf8807.tar.zst
nixpkgs-e4dcdb133a290b11537a1ef6af4fde0b76cf8807.zip
qtwebengine: link to pulseaudio
Nix builds of QTWebEngine doesn't support sound output via Pulse, only
through ALSA, unless sandboxing is disabled and LD_LIBRARY_PATH
contains a reference to the Pulse libraries.

By default, Chromium won't link to PulseAudio, but dlopens it in
run-time. It is tricky to make this work because of the nontrivial
sandbox configuration. Nix builds of Chromium already link against
Pulse directly, so it makes sense to copy this behavior in
QTWebEngine.
-rw-r--r--pkgs/development/libraries/qt-5/5.15/default.nix1
-rw-r--r--pkgs/development/libraries/qt-5/5.15/qtwebengine-link-pulseaudio.patch8
-rw-r--r--pkgs/development/libraries/qt-6/modules/qtwebengine.nix1
-rw-r--r--pkgs/development/libraries/qt-6/patches/qtwebengine-link-pulseaudio.patch10
4 files changed, 20 insertions, 0 deletions
diff --git a/pkgs/development/libraries/qt-5/5.15/default.nix b/pkgs/development/libraries/qt-5/5.15/default.nix
index 5f829009038..2dc8dcd839e 100644
--- a/pkgs/development/libraries/qt-5/5.15/default.nix
+++ b/pkgs/development/libraries/qt-5/5.15/default.nix
@@ -170,6 +170,7 @@ let
         extraPrefix = "src/3rdparty/";
         hash = "sha256-s4GsGMJTBNWw2gTJuIEP3tqT82AmTsR2mbj59m2p6rM=";
       })
+      ./qtwebengine-link-pulseaudio.patch
     ] ++ lib.optionals stdenv.isDarwin [
       ./qtwebengine-darwin-no-platform-check.patch
       ./qtwebengine-mac-dont-set-dsymutil-path.patch
diff --git a/pkgs/development/libraries/qt-5/5.15/qtwebengine-link-pulseaudio.patch b/pkgs/development/libraries/qt-5/5.15/qtwebengine-link-pulseaudio.patch
new file mode 100644
index 00000000000..052ec89dbc1
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.15/qtwebengine-link-pulseaudio.patch
@@ -0,0 +1,8 @@
+--- a/src/core/config/common.pri
++++ b/src/core/config/common.pri
+@@ -47,3 +47,5 @@
+
+ !qtConfig(webengine-nodejs10): gn_args += use_rollup=false
+ gn_args += enable_ipc_logging=false
++
++gn_args += link_pulseaudio=true
diff --git a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix
index 909616d953d..0c243d4ba7a 100644
--- a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix
+++ b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix
@@ -135,6 +135,7 @@ qtModule {
     # environment variable, since NixOS relies on it working.
     # See https://github.com/NixOS/nixpkgs/issues/226484 for more context.
     ../patches/qtwebengine-xkb-includes.patch
+    ../patches/qtwebengine-link-pulseaudio.patch
   ];
 
   postPatch = ''
diff --git a/pkgs/development/libraries/qt-6/patches/qtwebengine-link-pulseaudio.patch b/pkgs/development/libraries/qt-6/patches/qtwebengine-link-pulseaudio.patch
new file mode 100644
index 00000000000..31516c41beb
--- /dev/null
+++ b/pkgs/development/libraries/qt-6/patches/qtwebengine-link-pulseaudio.patch
@@ -0,0 +1,10 @@
+--- a/src/core/CMakeLists.txt
++++ b/src/core/CMakeLists.txt
+@@ -341,6 +341,7 @@
+             devtools_fast_bundle=false
+             devtools_skip_typecheck=false
+             enable_jxl_decoder=false # temporarily because libjxl causes internal compiler error on armv7
++            link_pulseaudio=true
+         )
+
+         extend_gn_list(gnArgArg
\ No newline at end of file