From 68500c37a31b65a37bed7b7297fd51e1b2ddf194 Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 18 Jan 2024 11:55:06 +0100 Subject: [PATCH 1/2] ffmpeg: enable vulkan in small variant Closure size: 493.6M -> 494.8M Fixes https://github.com/NixOS/nixpkgs/issues/281631 --- pkgs/development/libraries/ffmpeg/generic.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index 512ec3a4bf16..faa4a3e03159 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -90,7 +90,7 @@ , withVoAmrwbenc ? withFullDeps # AMR-WB encoder , withVorbis ? withHeadlessDeps # Vorbis de/encoding, native encoder exists , withVpx ? withHeadlessDeps && stdenv.buildPlatform == stdenv.hostPlatform # VP8 & VP9 de/encoding -, withVulkan ? withFullDeps && !stdenv.isDarwin +, withVulkan ? withSmallDeps && !stdenv.isDarwin , withWebp ? withFullDeps # WebP encoder , withX264 ? withHeadlessDeps # H.264/AVC encoder , withX265 ? withHeadlessDeps # H.265/HEVC encoder From 3f89316af000885845d34c9a6776d8344af6a4c9 Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 15 Feb 2024 01:23:33 +0100 Subject: [PATCH 2/2] ffmpeg: work around libvulkan.so not being NEEDED --- pkgs/development/libraries/ffmpeg/generic.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index faa4a3e03159..e88bccb300a8 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -683,6 +683,10 @@ stdenv.mkDerivation (finalAttrs: { postFixup = optionalString (stdenv.isLinux && withLib) '' addOpenGLRunpath ${placeholder "lib"}/lib/libavcodec.so addOpenGLRunpath ${placeholder "lib"}/lib/libavutil.so + '' + # https://trac.ffmpeg.org/ticket/10809 + + optionalString (versionAtLeast version "5.0" && withVulkan) '' + patchelf $lib/lib/libavcodec.so --add-needed libvulkan.so --add-rpath ${lib.makeLibraryPath [ vulkan-loader ]} ''; enableParallelBuilding = true;