From 4aaf5378d8bd4b94d80d112669d81a7d28c2e04e Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 20 Oct 2022 04:20:00 +0000 Subject: [PATCH] kaldi: fix build on darwin --- pkgs/tools/audio/kaldi/default.nix | 11 +++++++++-- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/audio/kaldi/default.nix b/pkgs/tools/audio/kaldi/default.nix index 662a6f2b5348..57c46ce6cfdf 100644 --- a/pkgs/tools/audio/kaldi/default.nix +++ b/pkgs/tools/audio/kaldi/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv +{ lib +, stdenv , openblas , blas , lapack @@ -9,6 +10,7 @@ , fetchFromGitHub , git , python3 +, Accelerate }: assert blas.implementation == "openblas" && lapack.implementation == "openblas"; @@ -35,6 +37,9 @@ stdenv.mkDerivation { cmakeFlags = [ "-DKALDI_BUILD_TEST=off" "-DBUILD_SHARED_LIBS=on" + ] ++ lib.optionals stdenv.isDarwin [ + "-DBLAS_LIBRARIES=-lblas" + "-DLAPACK_LIBRARIES=-llapack" ]; enableParallelBuilding = true; @@ -70,6 +75,8 @@ stdenv.mkDerivation { openblas openfst icu + ] ++ lib.optionals stdenv.isDarwin [ + Accelerate ]; nativeBuildInputs = [ @@ -88,6 +95,6 @@ stdenv.mkDerivation { homepage = "https://kaldi-asr.org"; license = licenses.mit; maintainers = with maintainers; [ mic92 ]; - platforms = platforms.linux; + platforms = platforms.unix; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 225b1b7818b5..13f2b22196c5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4308,7 +4308,9 @@ with pkgs; karma = callPackage ../servers/monitoring/karma { }; - kaldi = callPackage ../tools/audio/kaldi { }; + kaldi = callPackage ../tools/audio/kaldi { + inherit (darwin.apple_sdk.frameworks) Accelerate; + }; kalker = callPackage ../tools/misc/kalker { };