Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg_{4,6,7}: Darwin clean‐ups and improvements #351188

Merged
merged 4 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

8 changes: 0 additions & 8 deletions pkgs/development/libraries/ffmpeg/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ let
initArgs: ffmpegVariant:
callPackage ./generic.nix (
{
inherit (darwin.apple_sdk.frameworks)
Accelerate
AppKit
AudioToolbox
AVFoundation
CoreImage
VideoToolbox
;
inherit (darwin) xcode;
inherit (cudaPackages) cuda_cudart cuda_nvcc libnpp;
}
Expand Down
28 changes: 4 additions & 24 deletions pkgs/development/libraries/ffmpeg/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,9 @@
, withAlsa ? withHeadlessDeps && stdenv.hostPlatform.isLinux # Alsa in/output supporT
, withAmf ? lib.meta.availableOn stdenv.hostPlatform amf # AMD Media Framework video encoding
, withAom ? withHeadlessDeps # AV1 reference encoder
, withAppKit ? withHeadlessDeps && stdenv.hostPlatform.isDarwin # Apple AppKit framework
, withAribb24 ? withFullDeps # ARIB text and caption decoding
, withAribcaption ? withFullDeps && lib.versionAtLeast version "6.1" # ARIB STD-B24 Caption Decoder/Renderer
, withAss ? withHeadlessDeps && stdenv.hostPlatform == stdenv.buildPlatform # (Advanced) SubStation Alpha subtitle rendering
, withAudioToolbox ? withHeadlessDeps && stdenv.hostPlatform.isDarwin # Apple AudioToolbox
, withAvFoundation ? withHeadlessDeps && stdenv.hostPlatform.isDarwin # Apple AVFoundation framework
, withAvisynth ? withFullDeps # AviSynth script files reading
, withBluray ? withFullDeps # BluRay reading
, withBs2b ? withFullDeps # bs2b DSP library
Expand All @@ -51,7 +48,6 @@
, withCelt ? withHeadlessDeps # CELT decoder
, withChromaprint ? withFullDeps # Audio fingerprinting
, withCodec2 ? withFullDeps # codec2 en/decoding
, withCoreImage ? withHeadlessDeps && stdenv.hostPlatform.isDarwin # Apple CoreImage framework
, withCuda ? withFullDeps && withNvcodec
, withCudaLLVM ? withFullDeps
, withCudaNVCC ? withFullDeps && withUnfree && config.cudaSupport
Expand Down Expand Up @@ -121,7 +117,6 @@
, withV4l2M2m ? withV4l2
, withVaapi ? withHeadlessDeps && (with stdenv; isLinux || isFreeBSD) # Vaapi hardware acceleration
, withVdpau ? withSmallDeps && !stdenv.hostPlatform.isMinGW # Vdpau hardware acceleration
, withVideoToolbox ? withHeadlessDeps && stdenv.hostPlatform.isDarwin # Apple VideoToolbox
, withVidStab ? withHeadlessDeps && withGPL # Video stabilization
, withVmaf ? withFullDeps && !stdenv.hostPlatform.isAarch64 && lib.versionAtLeast version "5" # Netflix's VMAF (Video Multi-Method Assessment Fusion)
, withVoAmrwbenc ? withFullDeps && withVersion3 # AMR-WB encoder
Expand Down Expand Up @@ -333,14 +328,9 @@
, zlib
, zvbi
/*
* Darwin frameworks
* Darwin
*/
, Accelerate
, AppKit
, AudioToolbox
, AVFoundation
, CoreImage
, VideoToolbox
, apple-sdk_15
, xcode # unfree contains metalcc and metallib
/*
* Cuda Packages
Expand Down Expand Up @@ -465,7 +455,6 @@ stdenv.mkDerivation (finalAttrs: {
})
]
++ optionals (lib.versionAtLeast version "7.1") [
./0001-avfoundation.m-macOS-SDK-10.12-compatibility.patch
./fix-fate-ffmpeg-spec-disposition-7.1.patch

# Expose a private API for Chromium / Qt WebEngine.
Expand Down Expand Up @@ -560,14 +549,11 @@ stdenv.mkDerivation (finalAttrs: {
(enableFeature withAlsa "alsa")
(enableFeature withAmf "amf")
(enableFeature withAom "libaom")
(enableFeature withAppKit "appkit")
(enableFeature withAribb24 "libaribb24")
] ++ optionals (versionAtLeast version "6.1") [
(enableFeature withAribcaption "libaribcaption")
] ++ [
(enableFeature withAss "libass")
(enableFeature withAudioToolbox "audiotoolbox")
(enableFeature withAvFoundation "avfoundation")
(enableFeature withAvisynth "avisynth")
(enableFeature withBluray "libbluray")
(enableFeature withBs2b "libbs2b")
Expand All @@ -577,7 +563,6 @@ stdenv.mkDerivation (finalAttrs: {
(enableFeature withCelt "libcelt")
(enableFeature withChromaprint "chromaprint")
(enableFeature withCodec2 "libcodec2")
(enableFeature withCoreImage "coreimage")
(enableFeature withCuda "cuda")
(enableFeature withCudaLLVM "cuda-llvm")
(enableFeature withCudaNVCC "cuda-nvcc")
Expand Down Expand Up @@ -667,7 +652,6 @@ stdenv.mkDerivation (finalAttrs: {
] ++ optionals (versionAtLeast version "6.0") [
(enableFeature withVpl "libvpl")
] ++ [
(enableFeature withVideoToolbox "videotoolbox")
(enableFeature withVidStab "libvidstab") # Actual min. version 2.0
(enableFeature withVmaf "libvmaf")
(enableFeature withVoAmrwbenc "libvo-amrwbenc")
Expand Down Expand Up @@ -732,15 +716,13 @@ stdenv.mkDerivation (finalAttrs: {
++ optionals withCudaNVCC [ cuda_nvcc ];

buildInputs = []
++ optionals stdenv.hostPlatform.isDarwin [ apple-sdk_15 ]
++ optionals withAlsa [ alsa-lib ]
++ optionals withAmf [ amf-headers ]
++ optionals withAom [ libaom ]
++ optionals withAppKit [ AppKit ]
++ optionals withAribb24 [ aribb24 ]
++ optionals withAribcaption [ libaribcaption ]
++ optionals withAss [ libass ]
++ optionals withAudioToolbox [ AudioToolbox ]
++ optionals withAvFoundation [ AVFoundation ]
++ optionals withAvisynth [ avisynthplus ]
++ optionals withBluray [ libbluray ]
++ optionals withBs2b [ libbs2b ]
Expand All @@ -750,7 +732,6 @@ stdenv.mkDerivation (finalAttrs: {
++ optionals withCelt [ celt ]
++ optionals withChromaprint [ chromaprint ]
++ optionals withCodec2 [ codec2 ]
++ optionals withCoreImage [ CoreImage ]
++ optionals withCudaNVCC [ cuda_cudart cuda_nvcc ]
++ optionals withDav1d [ dav1d ]
++ optionals withDc1394 [ libdc1394 libraw1394 ]
Expand Down Expand Up @@ -794,7 +775,7 @@ stdenv.mkDerivation (finalAttrs: {
++ optionals withQuirc [ quirc ]
++ optionals withRav1e [ rav1e ]
++ optionals withRtmp [ rtmpdump ]
++ optionals withRubberband ([ rubberband ] ++ lib.optional stdenv.hostPlatform.isDarwin Accelerate)
++ optionals withRubberband [ rubberband ]
++ optionals withSamba [ samba ]
++ optionals withSdl2 [ SDL2 ]
++ optionals withShaderc [ shaderc ]
Expand All @@ -812,7 +793,6 @@ stdenv.mkDerivation (finalAttrs: {
++ optionals withV4l2 [ libv4l ]
++ optionals withVaapi [ (if withSmallDeps then libva else libva-minimal) ]
++ optionals withVdpau [ libvdpau ]
++ optionals withVideoToolbox [ VideoToolbox ]
++ optionals withVidStab [ vid-stab ]
++ optionals withVmaf [ libvmaf ]
++ optionals withVoAmrwbenc [ vo-amrwbenc ]
Expand Down