Subject: [bug#78022] [PATCH 1/8] gnu: kaldi-for-vosk: Update to 0-1.bc5baf1.

From: Nicolas Graves <[email-masked]>
Date: Thu, 24 Apr 2025 01:08:05 +0200

* gnu/packages/patches/kaldi-openblas-0.3.29-compatibility.patch: Add patch.
* gnu/local.mk: Record patch.
* gnu/packages/machine-learning.scm (kaldi-for-vosk): Update to 0-1.bc5baf1.
  [origin]: Record patch.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/machine-learning.scm             |  9 ++-
 .../kaldi-openblas-0.3.29-compatibility.patch | 70 +++++++++++++++++++
 3 files changed, 77 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/kaldi-openblas-0.3.29-compatibility.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 4aa84f8ef96..9f0ed220d07 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1680,6 +1680,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/lightdm-vnc-color-depth.patch		\
   %D%/packages/patches/lightdm-vncserver-check.patch		\
   %D%/packages/patches/localed-xorg-keyboard.patch		\
+  %D%/packages/patches/kaldi-openblas-0.3.29-compatibility.patch	\
   %D%/packages/patches/kcontacts-incorrect-country-name.patch	\
   %D%/packages/patches/kde-cli-tools-delay-mime-db.patch	\
   %D%/packages/patches/kdiagram-Fix-missing-link-libraries.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index c4dd9e2c2dd..964e2aceb49 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -3044,8 +3044,9 @@ (define-public kaldi
       (license license:asl2.0))))
 
 (define kaldi-for-vosk
-  (let* ((commit "a25f216f5ce4eec5e45a6ab7651e20c9840a05cd")
-         (revision "0")
+  ;; Commit of branch "vosk"
+  (let* ((commit "bc5baf14231660bd50b7d05788865b4ac6c34481")
+         (revision "1")
          (openfst openfst-for-vosk))
     (package
       (inherit kaldi)
@@ -3059,7 +3060,9 @@ (define kaldi-for-vosk
                (commit commit)))
          (file-name (git-file-name name version))
          (sha256
-          (base32 "16w90za8narkfi590cxj4p7vc1f5sdxc927g5hk6kh4l3mf6iisl"))))
+          (base32 "1y3d6918srr7cn5r72v5wvbdwz9p9j2bjw1x78sfis2r2k60lllw"))
+         (patches
+          (search-patches "kaldi-openblas-0.3.29-compatibility.patch"))))
       (inputs
        (list alsa-lib
              glib
diff --git a/gnu/packages/patches/kaldi-openblas-0.3.29-compatibility.patch b/gnu/packages/patches/kaldi-openblas-0.3.29-compatibility.patch
new file mode 100644
index 00000000000..c00e742e433
--- /dev/null
+++ b/gnu/packages/patches/kaldi-openblas-0.3.29-compatibility.patch
@@ -0,0 +1,70 @@
+From c8febca41cecf68f468f346409735c90ed340a5e Mon Sep 17 00:00:00 2001
+Message-ID: <[email-masked]>
+From: Nicolas Graves <[email-masked]>
+Date: Tue, 22 Apr 2025 17:57:34 +0200
+Subject: [PATCH] [email-masked] compatibility.
+
+---
+ src/matrix/cblas-wrappers.h | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/src/matrix/cblas-wrappers.h b/src/matrix/cblas-wrappers.h
+index f869ab7e0..bcc2c2b75 100644
+--- a/src/matrix/cblas-wrappers.h
++++ b/src/matrix/cblas-wrappers.h
+@@ -383,10 +383,10 @@ inline void mul_elements(
+ // add clapack here
+ #if !defined(HAVE_ATLAS)
+ inline void clapack_Xtptri(KaldiBlasInt *num_rows, float *Mdata, KaldiBlasInt *result) {
+-  stptri_(const_cast<char *>("U"), const_cast<char *>("N"), num_rows, Mdata, result);
++  stptri_(const_cast<char *>("U"), const_cast<char *>("N"), num_rows, Mdata, result, 1, 1);
+ }
+ inline void clapack_Xtptri(KaldiBlasInt *num_rows, double *Mdata, KaldiBlasInt *result) {
+-  dtptri_(const_cast<char *>("U"), const_cast<char *>("N"), num_rows, Mdata, result);
++  dtptri_(const_cast<char *>("U"), const_cast<char *>("N"), num_rows, Mdata, result, 1, 1);
+ }
+ // 
+ inline void clapack_Xgetrf2(KaldiBlasInt *num_rows, KaldiBlasInt *num_cols, 
+@@ -420,7 +420,7 @@ inline void clapack_Xgesvd(char *v, char *u, KaldiBlasInt *num_cols,
+   sgesvd_(v, u,
+           num_cols, num_rows, Mdata, stride,
+           sv, Vdata, vstride, Udata, ustride, 
+-          p_work, l_work, result); 
++          p_work, l_work, result, 1, 1);
+ }
+ inline void clapack_Xgesvd(char *v, char *u, KaldiBlasInt *num_cols,
+                            KaldiBlasInt *num_rows, double *Mdata, KaldiBlasInt *stride,
+@@ -430,25 +430,25 @@ inline void clapack_Xgesvd(char *v, char *u, KaldiBlasInt *num_cols,
+   dgesvd_(v, u,
+           num_cols, num_rows, Mdata, stride,
+           sv, Vdata, vstride, Udata, ustride,
+-          p_work, l_work, result); 
++          p_work, l_work, result, 1, 1);
+ }
+ //
+ void inline clapack_Xsptri(KaldiBlasInt *num_rows, float *Mdata, 
+                            KaldiBlasInt *ipiv, float *work, KaldiBlasInt *result) {
+-  ssptri_(const_cast<char *>("U"), num_rows, Mdata, ipiv, work, result);
++  ssptri_(const_cast<char *>("U"), num_rows, Mdata, ipiv, work, result, 1);
+ }
+ void inline clapack_Xsptri(KaldiBlasInt *num_rows, double *Mdata, 
+                            KaldiBlasInt *ipiv, double *work, KaldiBlasInt *result) {
+-  dsptri_(const_cast<char *>("U"), num_rows, Mdata, ipiv, work, result);
++  dsptri_(const_cast<char *>("U"), num_rows, Mdata, ipiv, work, result, 1);
+ }
+ //
+ void inline clapack_Xsptrf(KaldiBlasInt *num_rows, float *Mdata,
+                            KaldiBlasInt *ipiv, KaldiBlasInt *result) {
+-  ssptrf_(const_cast<char *>("U"), num_rows, Mdata, ipiv, result);
++  ssptrf_(const_cast<char *>("U"), num_rows, Mdata, ipiv, result, 1);
+ }
+ void inline clapack_Xsptrf(KaldiBlasInt *num_rows, double *Mdata,
+                            KaldiBlasInt *ipiv, KaldiBlasInt *result) {
+-  dsptrf_(const_cast<char *>("U"), num_rows, Mdata, ipiv, result);
++  dsptrf_(const_cast<char *>("U"), num_rows, Mdata, ipiv, result, 1);
+ }
+ #else
+ inline void clapack_Xgetrf(MatrixIndexT num_rows, MatrixIndexT num_cols,
+-- 
+2.49.0
+
-- 
2.49.0