From c5c96b902bdcdf4cb9f7cbbc67592e494883deb1 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Mon, 26 Feb 2024 20:47:46 +0100 Subject: [PATCH 1/5] ffmpeg: fix enabeling withCaca --- pkgs/development/libraries/ffmpeg/generic.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index be0ae7792aa5..665cda6978b9 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -476,6 +476,7 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withBluray "libbluray") (enableFeature withBs2b "libbs2b") (enableFeature withBzlib "bzlib") + (enableFeature withCaca "libcaca") (enableFeature withCelt "libcelt") (enableFeature withChromaprint "chromaprint") (enableFeature withCuda "cuda") From 893148f833171c7b7b10c3d7105eb261524be09b Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Mon, 26 Feb 2024 20:48:43 +0100 Subject: [PATCH 2/5] ffmpeg: also enable libfontconfig when withFontconfig is enabled --- pkgs/development/libraries/ffmpeg/generic.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index 665cda6978b9..d30d107470de 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -487,6 +487,7 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withFdkAac "libfdk-aac") (enableFeature withFlite "libflite") (enableFeature withFontconfig "fontconfig") + (enableFeature withFontconfig "libfontconfig") (enableFeature withFreetype "libfreetype") (enableFeature withFrei0r "frei0r") (enableFeature withFribidi "libfribidi") From 1e7fead1d5f2bdeffd2a70f9441bf28a52f190cc Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Mon, 26 Feb 2024 20:52:15 +0100 Subject: [PATCH 3/5] ffmpeg: add second opencore amr option withOpencoreAmrnb only adds AMR-NB de/encoder also add adding withOpencoreAmrwb to also support AMR-WB decoder --- pkgs/development/libraries/ffmpeg/generic.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index d30d107470de..1f9fb446cf4e 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -63,7 +63,8 @@ , withOgg ? withHeadlessDeps # Ogg container used by vorbis & theora , withOpenal ? withFullDeps # OpenAL 1.1 capture support , withOpencl ? withFullDeps -, withOpencoreAmrnb ? withFullDeps && withVersion3 # AMR-NB de/encoder & AMR-WB decoder +, withOpencoreAmrnb ? withFullDeps && withVersion3 # AMR-NB de/encoder +, withOpencoreAmrwb ? withFullDeps && withVersion3 # AMR-WB decoder , withOpengl ? false # OpenGL rendering , withOpenh264 ? withFullDeps # H.264/AVC encoder , withOpenjpeg ? withFullDeps # JPEG 2000 de/encoder @@ -511,6 +512,7 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withOpenal "openal") (enableFeature withOpencl "opencl") (enableFeature withOpencoreAmrnb "libopencore-amrnb") + (enableFeature withOpencoreAmrwb "libopencore-amrwb") (enableFeature withOpengl "opengl") (enableFeature withOpenh264 "libopenh264") (enableFeature withOpenjpeg "libopenjpeg") @@ -625,7 +627,7 @@ stdenv.mkDerivation (finalAttrs: { ++ optionals withOgg [ libogg ] ++ optionals withOpenal [ openal ] ++ optionals withOpencl [ ocl-icd opencl-headers ] - ++ optionals withOpencoreAmrnb [ opencore-amr ] + ++ optionals (withOpencoreAmrnb || withOpencoreAmrwb) [ opencore-amr ] ++ optionals withOpengl [ libGL libGLU ] ++ optionals withOpenh264 [ openh264 ] ++ optionals withOpenjpeg [ openjpeg ] From ce12be4c1680aec24d4a1a87f56bb7f2aef25309 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Mon, 26 Feb 2024 20:56:49 +0100 Subject: [PATCH 4/5] ffmpeg: correct fdk-acc inclusion condition Only on gpl build does it need unfree --- 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 1f9fb446cf4e..e1957463935b 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -40,7 +40,7 @@ , withDav1d ? withHeadlessDeps # AV1 decoder (focused on speed and correctness) , withDc1394 ? withFullDeps && !stdenv.isDarwin # IIDC-1394 grabbing (ieee 1394) , withDrm ? withHeadlessDeps && (with stdenv; isLinux || isFreeBSD) # libdrm support -, withFdkAac ? withFullDeps && withUnfree # Fraunhofer FDK AAC de/encoder +, withFdkAac ? withFullDeps && (!withGPL || withUnfree) # Fraunhofer FDK AAC de/encoder , withFlite ? withFullDeps # Voice Synthesis , withFontconfig ? withHeadlessDeps # Needed for drawtext filter , withFreetype ? withHeadlessDeps # Needed for drawtext filter From 63bcf453d34b4a81440883cca5d576a071d38294 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Mon, 26 Feb 2024 21:10:10 +0100 Subject: [PATCH 5/5] ffmpeg: Also sort withNvDec in the list --- pkgs/development/libraries/ffmpeg/generic.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index e1957463935b..2410547e2df6 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -592,7 +592,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ removeReferencesTo addOpenGLRunpath perl pkg-config texinfo yasm ] ++ optionals withCudaLLVM [ clang ]; - buildInputs = optionals (withNvdec || withNvenc) [ (if (lib.versionAtLeast finalAttrs.version "6") then nv-codec-headers-12 else nv-codec-headers) ] + buildInputs = [] ++ optionals withAlsa [ alsa-lib ] ++ optionals withAom [ libaom ] ++ optionals withAribcaption [ libaribcaption ] @@ -624,6 +624,7 @@ stdenv.mkDerivation (finalAttrs: { ++ optionals withModplug [ libmodplug ] ++ optionals withMp3lame [ lame ] ++ optionals withMysofa [ libmysofa ] + ++ optionals (withNvdec || withNvenc) [ (if (lib.versionAtLeast finalAttrs.version "6") then nv-codec-headers-12 else nv-codec-headers) ] ++ optionals withOgg [ libogg ] ++ optionals withOpenal [ openal ] ++ optionals withOpencl [ ocl-icd opencl-headers ]