From 8324e3c01e5377be75f5260374d194fa0935c0f4 Mon Sep 17 00:00:00 2001 From: John Kehayias Date: Mon, 7 Apr 2025 15:16:38 -0400 Subject: nongnu: firefox: Fix video decoding/acceleration. Fixes #386. As of Firefox 137, VA-API video acceleration is enabled by default. This would fail due to not finding libpciaccess. This is an indirect dependency, through libdrm (that mesa and libva depend on). It would be best to have our runpaths-of-input work recursively to catch this (so it can be in the RDD sandbox used by Firefox here). In the meantime, add libpciaccess explicitly to fix this issue. * nongnu/packages/mozilla.scm (firefox-esr)[arguments]<#:phases>: In the wrap-program phase, add the libpciaccess library path, used in LD_LIBRARY_PATH. Add a comment for future work on rdd-whitelist. [inputs]: Add libpciaccess. --- nongnu/packages/mozilla.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'nongnu/packages/mozilla.scm') diff --git a/nongnu/packages/mozilla.scm b/nongnu/packages/mozilla.scm index 7de17b8..8476a8b 100644 --- a/nongnu/packages/mozilla.scm +++ b/nongnu/packages/mozilla.scm @@ -372,6 +372,10 @@ ;; For hardware video acceleration via VA-API (libva-lib (string-append (assoc-ref inputs "libva") "/lib")) + ;; Needed for video acceleration (via libdrm which mesa + ;; and libva depend on). + (pciaccess-lib (string-append (assoc-ref inputs "libpciaccess") + "/lib")) ;; VA-API is run in the RDD (Remote Data Decoder) sandbox ;; and must be explicitly given access to files it needs. ;; Rather than adding the whole store (as Nix had @@ -381,6 +385,9 @@ ;; runpaths of the needed libraries to add everything to ;; LD_LIBRARY_PATH. These will then be accessible in the ;; RDD sandbox. + ;; TODO: Properly handle the runpath of libraries needed + ;; (for RDD) recursively, so the explicit libpciaccess + ;; can be removed. (rdd-whitelist (map (cut string-append <> "/") (delete-duplicates @@ -397,8 +404,8 @@ "/share"))) (wrap-program (car (find-files lib "^firefox$")) `("LD_LIBRARY_PATH" prefix (,mesa-lib ,libnotify-lib ,libva-lib - ,pulseaudio-lib ,eudev-lib ,@rdd-whitelist - ,pipewire-lib)) + ,pciaccess-lib ,pulseaudio-lib ,eudev-lib + ,@rdd-whitelist ,pipewire-lib)) `("XDG_DATA_DIRS" prefix (,gtk-share)) `("MOZ_LEGACY_PROFILES" = ("1")) `("MOZ_ALLOW_DOWNGRADE" = ("1")))))) @@ -455,6 +462,7 @@ libgnome libjpeg-turbo libnotify + libpciaccess ;; libpng-apng libva libvpx -- cgit v1.2.3