From c6c2c7a293cb8816c42d20049c6d5e78916cb24d Mon Sep 17 00:00:00 2001 From: tilpner Date: Wed, 22 Mar 2023 16:04:16 +0100 Subject: [PATCH] ffmpeg_6: init at 6.0 --- pkgs/development/libraries/ffmpeg/6.nix | 4 ++++ pkgs/development/libraries/ffmpeg/generic.nix | 12 ++++++++++-- pkgs/top-level/all-packages.nix | 12 ++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/libraries/ffmpeg/6.nix diff --git a/pkgs/development/libraries/ffmpeg/6.nix b/pkgs/development/libraries/ffmpeg/6.nix new file mode 100644 index 00000000000..cf29526fbcb --- /dev/null +++ b/pkgs/development/libraries/ffmpeg/6.nix @@ -0,0 +1,4 @@ +import ./generic.nix rec { + version = "6.0"; + sha256 = "sha256-RVbgsafIbeUUNXmUbDQ03ZN42oaUo0njqROo7KOQgv0="; +} diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index de78e8b75c4..0ece46f3266 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -227,6 +227,7 @@ , libxml2 , xz , nv-codec-headers +, nv-codec-headers-11 , openal , ocl-icd # OpenCL ICD , opencl-headers # OpenCL headers @@ -348,7 +349,14 @@ stdenv.mkDerivation (finalAttrs: { --replace VK_EXT_VIDEO_DECODE VK_KHR_VIDEO_DECODE ''; - patches = map (patch: fetchpatch patch) extraPatches; + patches = map (patch: fetchpatch patch) (extraPatches + ++ (lib.optional (lib.versionAtLeast version "6" && lib.versionOlder version "6.1") + { # this can be removed post 6.1 + name = "fix_aacps_tablegen"; + url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/814178f92647be2411516bbb82f48532373d2554"; + hash = "sha256-FQV9/PiarPXCm45ldtCsxGHjlrriL8DKpn1LaKJ8owI="; + } + )); configurePlatforms = []; setOutputFlags = false; # Only accepts some of them @@ -539,7 +547,7 @@ stdenv.mkDerivation (finalAttrs: { # TODO This was always in buildInputs before, why? buildInputs = optionals withFullDeps [ libdc1394 ] ++ optionals (withFullDeps && !stdenv.isDarwin) [ libraw1394 ] # TODO where does this belong to - ++ optionals (withNvdec || withNvenc) [ nv-codec-headers ] + ++ optionals (withNvdec || withNvenc) [ (if (lib.versionAtLeast version "6") then nv-codec-headers-11 else nv-codec-headers) ] ++ optionals withAlsa [ alsa-lib ] ++ optionals withAom [ libaom ] ++ optionals withAss [ libass ] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a89c8c14cf3..a70389936a5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19890,6 +19890,18 @@ with pkgs; ffmpegVariant = "full"; }; + ffmpeg_6 = callPackage ../development/libraries/ffmpeg/6.nix { + inherit (darwin.apple_sdk.frameworks) + Cocoa CoreServices CoreAudio CoreMedia AVFoundation MediaToolbox + VideoDecodeAcceleration VideoToolbox; + }; + ffmpeg_6-headless = ffmpeg_6.override { + ffmpegVariant = "headless"; + }; + ffmpeg_6-full = ffmpeg_6.override { + ffmpegVariant = "full"; + }; + # Aliases # Please make sure this is updated to the latest version on the next major # update to ffmpeg