From 44ecf1cd185ca7a6d0349d09b95e638ade605bf0 Mon Sep 17 00:00:00 2001 From: David Knaack Date: Mon, 26 Jun 2023 11:00:47 +0200 Subject: [PATCH] openai-whisper-cpp: enable CoreML support Co-authored-by: wegank <9713184+wegank@users.noreply.github.com> --- pkgs/tools/audio/openai-whisper-cpp/default.nix | 5 ++++- pkgs/top-level/all-packages.nix | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/audio/openai-whisper-cpp/default.nix b/pkgs/tools/audio/openai-whisper-cpp/default.nix index 5ebfcbec8286..c41c461acf0b 100644 --- a/pkgs/tools/audio/openai-whisper-cpp/default.nix +++ b/pkgs/tools/audio/openai-whisper-cpp/default.nix @@ -6,6 +6,7 @@ , wget , Accelerate , CoreGraphics +, CoreML , CoreVideo }: @@ -28,8 +29,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ SDL2 ] ++ lib.optionals stdenv.isDarwin [ Accelerate CoreGraphics CoreVideo ]; + buildInputs = [ SDL2 ] ++ lib.optionals stdenv.isDarwin [ Accelerate CoreGraphics CoreML CoreVideo ]; + WHISPER_COREML = lib.optionalString stdenv.isDarwin "1"; + WHISPER_COREML_ALLOW_FALLBACK = lib.optionalString stdenv.isDarwin "1"; makeFlags = [ "main" "stream" ]; installPhase = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ff6ad9ee1159..a863ec8fcefd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19168,8 +19168,8 @@ with pkgs; openai-whisper = with python3.pkgs; toPythonApplication openai-whisper; - openai-whisper-cpp = callPackage ../tools/audio/openai-whisper-cpp { - inherit (darwin.apple_sdk.frameworks) Accelerate CoreGraphics CoreVideo; + openai-whisper-cpp = darwin.apple_sdk_11_0.callPackage ../tools/audio/openai-whisper-cpp { + inherit (darwin.apple_sdk_11_0.frameworks) Accelerate CoreGraphics CoreML CoreVideo; }; opengrok = callPackage ../development/tools/misc/opengrok { };