From 7e886531a2b9be8ca3fd43bde8e82cbae9b9e4a0 Mon Sep 17 00:00:00 2001 From: Kevin Puetz Date: Sun, 3 Dec 2023 12:58:38 -0600 Subject: [PATCH] qt6.qtmultimedia: Fix failure to load libva.so QtMultimedia 6.6.0 would select dynamic VAAPI on linux, then warns during build (even though it chose this on purpose): > QT_FEATURE_vaapi is found but ffmpeg doesn't include vaapi, > however dynamic symbols resolve is possible The nuisance warning was fixed for 6.7 and backported to 6.6.1: https://codereview.qt-project.org/c/qt/qtmultimedia/+/517333 However, tracing it helped me figure out why vaapi actually wasn't working: nix doesn't end up with an rpath such that dlopen("va") can actually find libva.so in the nix store, thus failing at runtime: > qt.multimedia.plugin: loading backend "ffmpeg" > qt.core.library: "/nix/store/i9fkjks6dfjj1p9qvj5633sxbrf5rbd8-qtmultimedia-6.6.1/lib/qt-6/plugins/multimedia/libffmpegmediaplugin.so" loaded library > qt.multimedia.ffmpeg.libsymbolsresolver: Start VAAPI symbols resolving: 39 symbols > qt.core.library: "va" cannot load: Cannot load library va: (va: cannot open shared object file: No such file or directory) > qt.multimedia.ffmpeg.libsymbolsresolver: Couldn't load VAAPI library --- pkgs/development/libraries/qt-6/modules/qtmultimedia.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix b/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix index 2545ee1a740c..f77fdac059ce 100644 --- a/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix +++ b/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix @@ -33,6 +33,8 @@ qtModule { ++ lib.optionals stdenv.isLinux [ gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi ] ++ lib.optionals stdenv.isDarwin [ VideoToolbox ]; + cmakeFlags = [ "-DENABLE_DYNAMIC_RESOLVE_VAAPI_SYMBOLS=0" ]; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-include AudioToolbox/AudioToolbox.h"; NIX_LDFLAGS = lib.optionalString stdenv.isDarwin