From d45c5ab2951fe02aabfe2b7bfce5c80ba4138a1b Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Sat, 31 Aug 2024 23:17:28 +0200 Subject: [PATCH] ffmpeg: add npp option --- pkgs/development/libraries/ffmpeg/default.nix | 7 ++++++- pkgs/development/libraries/ffmpeg/generic.nix | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/ffmpeg/default.nix b/pkgs/development/libraries/ffmpeg/default.nix index f6a6403435e8..e700ec8d4ba5 100644 --- a/pkgs/development/libraries/ffmpeg/default.nix +++ b/pkgs/development/libraries/ffmpeg/default.nix @@ -1,4 +1,8 @@ -{ callPackage, darwin }: +{ + callPackage, + darwin, + cudaPackages, +}: let mkFFmpeg = @@ -14,6 +18,7 @@ let VideoToolbox ; inherit (darwin) xcode; + inherit (cudaPackages) cuda_cudart cuda_nvcc libnpp; } // (initArgs // { inherit ffmpegVariant; }) ); diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index 5367a4439f21..746d08398ba9 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, buildPackages, removeReferencesTo, addDriverRunpath, pkg-config, perl, texinfo, texinfo6, yasm +{ lib, config, stdenv, buildPackages, removeReferencesTo, addDriverRunpath, pkg-config, perl, texinfo, texinfo6, yasm # You can fetch any upstream version using this derivation by specifying version and hash # NOTICE: Always use this argument to override the version. Do not use overrideAttrs. @@ -81,6 +81,7 @@ , withModplug ? withFullDeps && !stdenv.isDarwin # ModPlug support , withMp3lame ? withHeadlessDeps # LAME MP3 encoder , withMysofa ? withFullDeps # HRTF support via SOFAlizer +, withNpp ? withFullDeps && withUnfree && config.cudaSupport # Nvidia Performance Primitives-based code , withNvdec ? withHeadlessDeps && withNvcodec , withNvenc ? withHeadlessDeps && withNvcodec , withOpenal ? withFullDeps # OpenAL 1.1 capture support @@ -333,6 +334,12 @@ , CoreImage , VideoToolbox , xcode # unfree contains metalcc and metallib +/* + * Cuda Packages + */ +, cuda_cudart +, cuda_nvcc +, libnpp /* * Testing */ @@ -610,6 +617,7 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withModplug "libmodplug") (enableFeature withMp3lame "libmp3lame") (enableFeature withMysofa "libmysofa") + (enableFeature withNpp "libnpp") (enableFeature withNvdec "nvdec") (enableFeature withNvenc "nvenc") (enableFeature withOpenal "openal") @@ -762,6 +770,7 @@ stdenv.mkDerivation (finalAttrs: { ++ optionals withModplug [ libmodplug ] ++ optionals withMp3lame [ lame ] ++ optionals withMysofa [ libmysofa ] + ++ optionals withNpp [ libnpp cuda_cudart cuda_nvcc ] ++ optionals withOpenal [ openal ] ++ optionals withOpencl [ ocl-icd opencl-headers ] ++ optionals (withOpencoreAmrnb || withOpencoreAmrwb) [ opencore-amr ]