summaryrefslogtreecommitdiffstats
path: root/meta-offline-voice-agent/recipes-vosk/vosk-kaldi
diff options
context:
space:
mode:
Diffstat (limited to 'meta-offline-voice-agent/recipes-vosk/vosk-kaldi')
-rw-r--r--meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Build-fix-for-include-in-makefile.patch25
-rw-r--r--meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Enforce-cross-compilation-under-bitbake.patch23
-rw-r--r--meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Fixes-for-shared-library-compilation.patch95
-rw-r--r--meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/OLD/0001-Build-fix-for-include-in-makefile.patch25
-rw-r--r--meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/OLD/0001-Enforce-cross-compilation-under-bitbake.patch23
-rw-r--r--meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb63
6 files changed, 254 insertions, 0 deletions
diff --git a/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Build-fix-for-include-in-makefile.patch b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Build-fix-for-include-in-makefile.patch
new file mode 100644
index 00000000..8c67aba7
--- /dev/null
+++ b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Build-fix-for-include-in-makefile.patch
@@ -0,0 +1,25 @@
+From 29caad5ea644875d7d896836d5c8c67a711b4352 Mon Sep 17 00:00:00 2001
+From: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+Date: Wed, 13 Jul 2022 15:52:29 +0000
+Subject: [PATCH] Build fix for include in makefile
+
+There is a conflict when using -isystem and bitbake's own flags.
+
+Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+---
+ src/makefiles/linux_openblas.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/makefiles/linux_openblas.mk b/src/makefiles/linux_openblas.mk
+index 1ac67c355..bb15f84a5 100644
+--- a/src/makefiles/linux_openblas.mk
++++ b/src/makefiles/linux_openblas.mk
+@@ -19,7 +19,7 @@ ifndef OPENBLASLIBS
+ $(error OPENBLASLIBS not defined.)
+ endif
+
+-CXXFLAGS = -std=c++17 -I.. -isystem $(OPENFSTINC) -O1 $(EXTRA_CXXFLAGS) \
++CXXFLAGS = -std=c++17 -I.. -I $(OPENFSTINC) -O1 $(EXTRA_CXXFLAGS) \
+ -Wall -Wno-sign-compare -Wno-unused-local-typedefs \
+ -Wno-deprecated-declarations -Winit-self \
+ -DKALDI_DOUBLEPRECISION=$(DOUBLE_PRECISION) \
diff --git a/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Enforce-cross-compilation-under-bitbake.patch b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Enforce-cross-compilation-under-bitbake.patch
new file mode 100644
index 00000000..d1fb4836
--- /dev/null
+++ b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Enforce-cross-compilation-under-bitbake.patch
@@ -0,0 +1,23 @@
+From 47f7b9dec92f52e3bd7d497326a2e5d28e3cf10c Mon Sep 17 00:00:00 2001
+From: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+Date: Mon, 11 Jul 2022 16:50:23 +0200
+Subject: [PATCH] Enforce cross-compilation under bitbake
+
+Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+---
+ src/configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/configure b/src/configure
+index c74d67af8..2aaf541c3 100755
+--- a/src/configure
++++ b/src/configure
+@@ -232,7 +232,7 @@ You need $supported_compiler."
+
+ function check_for_slow_expf {
+ # We cannot run this test if we are cross compiling.
+- if [[ "$TARGET_ARCH" == "`uname -m`" ]] ; then
++ if false ; then
+ ( cd probe
+ rm -f exp-test
+ make -f Makefile.slow_expf 1>/dev/null
diff --git a/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Fixes-for-shared-library-compilation.patch b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Fixes-for-shared-library-compilation.patch
new file mode 100644
index 00000000..fb93a356
--- /dev/null
+++ b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Fixes-for-shared-library-compilation.patch
@@ -0,0 +1,95 @@
+From 4fc5d1df4dca9b7faaf630d43b32a85d80d16eb3 Mon Sep 17 00:00:00 2001
+From: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+Date: Thu, 14 Jul 2022 11:00:07 +0000
+Subject: [PATCH] Fixes for shared library compilation
+
+Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+---
+ src/configure | 2 +-
+ src/fstbin/Makefile | 3 ++-
+ src/latbin/Makefile | 3 ++-
+ src/makefiles/linux_openblas.mk | 2 +-
+ src/matrix/Makefile | 2 +-
+ src/rnnlmbin/Makefile | 2 +-
+ 6 files changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/src/configure b/configure
+index c74d67af8..2aaf541c3 100755
+--- a/configure
++++ b/configure
+@@ -232,7 +232,7 @@ You need $supported_compiler."
+
+ function check_for_slow_expf {
+ # We cannot run this test if we are cross compiling.
+- if [[ "$TARGET_ARCH" == "`uname -m`" ]] ; then
++ if false ; then
+ ( cd probe
+ rm -f exp-test
+ make -f Makefile.slow_expf 1>/dev/null
+diff --git a/fstbin/Makefile b/fstbin/Makefile
+index a22c014a7..5a29030c3 100644
+--- a/fstbin/Makefile
++++ b/fstbin/Makefile
+@@ -26,6 +26,7 @@ TESTFILES =
+ LIBFILE =
+
+ ADDLIBS = ../decoder/kaldi-decoder.a ../fstext/kaldi-fstext.a \
+- ../util/kaldi-util.a ../matrix/kaldi-matrix.a ../base/kaldi-base.a
++ ../util/kaldi-util.a ../matrix/kaldi-matrix.a ../base/kaldi-base.a \
++ ../hmm/kaldi-hmm.a ../lat/kaldi-lat.a ../tree/kaldi-tree.a
+
+ include ../makefiles/default_rules.mk
+diff --git a/latbin/Makefile b/latbin/Makefile
+index d5cc4d035..902bf1058 100644
+--- a/latbin/Makefile
++++ b/latbin/Makefile
+@@ -36,6 +36,7 @@ TESTFILES =
+ ADDLIBS = ../rnnlm/kaldi-rnnlm.a ../nnet3/kaldi-nnet3.a \
+ ../cudamatrix/kaldi-cudamatrix.a ../lat/kaldi-lat.a ../lm/kaldi-lm.a \
+ ../fstext/kaldi-fstext.a ../hmm/kaldi-hmm.a ../tree/kaldi-tree.a \
+- ../util/kaldi-util.a ../matrix/kaldi-matrix.a ../base/kaldi-base.a
++ ../util/kaldi-util.a ../matrix/kaldi-matrix.a ../base/kaldi-base.a \
++ ../chain/kaldi-chain.a ../decoder/kaldi-decoder.a
+
+ include ../makefiles/default_rules.mk
+diff --git a/makefiles/linux_openblas.mk b/makefiles/linux_openblas.mk
+index 1ac67c355..bb15f84a5 100644
+--- a/makefiles/linux_openblas.mk
++++ b/makefiles/linux_openblas.mk
+@@ -19,7 +19,7 @@ ifndef OPENBLASLIBS
+ $(error OPENBLASLIBS not defined.)
+ endif
+
+-CXXFLAGS = -std=c++17 -I.. -isystem $(OPENFSTINC) -O1 $(EXTRA_CXXFLAGS) \
++CXXFLAGS = -std=c++17 -I.. -I $(OPENFSTINC) -O1 $(EXTRA_CXXFLAGS) \
+ -Wall -Wno-sign-compare -Wno-unused-local-typedefs \
+ -Wno-deprecated-declarations -Winit-self \
+ -DKALDI_DOUBLEPRECISION=$(DOUBLE_PRECISION) \
+diff --git a/matrix/Makefile b/matrix/Makefile
+index 398179a35..bec14e089 100644
+--- a/matrix/Makefile
++++ b/matrix/Makefile
+@@ -10,7 +10,7 @@ include ../kaldi.mk
+
+ # you can uncomment matrix-lib-speed-test if you want to do the speed tests.
+
+-TESTFILES = matrix-lib-test sparse-matrix-test numpy-array-test #matrix-lib-speed-test
++#TESTFILES = matrix-lib-test sparse-matrix-test numpy-array-test #matrix-lib-speed-test
+
+ OBJFILES = kaldi-matrix.o kaldi-vector.o packed-matrix.o sp-matrix.o tp-matrix.o \
+ matrix-functions.o qr.o srfft.o compressed-matrix.o \
+diff --git a/rnnlmbin/Makefile b/rnnlmbin/Makefile
+index 23a8eba61..d801b90d8 100644
+--- a/rnnlmbin/Makefile
++++ b/rnnlmbin/Makefile
+@@ -21,6 +21,6 @@ ADDLIBS = ../rnnlm/kaldi-rnnlm.a ../nnet3/kaldi-nnet3.a \
+ ../lat/kaldi-lat.a ../lm/kaldi-lm.a ../fstext/kaldi-fstext.a \
+ ../hmm/kaldi-hmm.a ../transform/kaldi-transform.a ../gmm/kaldi-gmm.a \
+ ../tree/kaldi-tree.a ../util/kaldi-util.a ../matrix/kaldi-matrix.a \
+- ../base/kaldi-base.a
++ ../base/kaldi-base.a ../chain/kaldi-chain.a
+
+ include ../makefiles/default_rules.mk
+--
+2.33.0
+
diff --git a/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/OLD/0001-Build-fix-for-include-in-makefile.patch b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/OLD/0001-Build-fix-for-include-in-makefile.patch
new file mode 100644
index 00000000..8c67aba7
--- /dev/null
+++ b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/OLD/0001-Build-fix-for-include-in-makefile.patch
@@ -0,0 +1,25 @@
+From 29caad5ea644875d7d896836d5c8c67a711b4352 Mon Sep 17 00:00:00 2001
+From: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+Date: Wed, 13 Jul 2022 15:52:29 +0000
+Subject: [PATCH] Build fix for include in makefile
+
+There is a conflict when using -isystem and bitbake's own flags.
+
+Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+---
+ src/makefiles/linux_openblas.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/makefiles/linux_openblas.mk b/src/makefiles/linux_openblas.mk
+index 1ac67c355..bb15f84a5 100644
+--- a/src/makefiles/linux_openblas.mk
++++ b/src/makefiles/linux_openblas.mk
+@@ -19,7 +19,7 @@ ifndef OPENBLASLIBS
+ $(error OPENBLASLIBS not defined.)
+ endif
+
+-CXXFLAGS = -std=c++17 -I.. -isystem $(OPENFSTINC) -O1 $(EXTRA_CXXFLAGS) \
++CXXFLAGS = -std=c++17 -I.. -I $(OPENFSTINC) -O1 $(EXTRA_CXXFLAGS) \
+ -Wall -Wno-sign-compare -Wno-unused-local-typedefs \
+ -Wno-deprecated-declarations -Winit-self \
+ -DKALDI_DOUBLEPRECISION=$(DOUBLE_PRECISION) \
diff --git a/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/OLD/0001-Enforce-cross-compilation-under-bitbake.patch b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/OLD/0001-Enforce-cross-compilation-under-bitbake.patch
new file mode 100644
index 00000000..d1fb4836
--- /dev/null
+++ b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/OLD/0001-Enforce-cross-compilation-under-bitbake.patch
@@ -0,0 +1,23 @@
+From 47f7b9dec92f52e3bd7d497326a2e5d28e3cf10c Mon Sep 17 00:00:00 2001
+From: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+Date: Mon, 11 Jul 2022 16:50:23 +0200
+Subject: [PATCH] Enforce cross-compilation under bitbake
+
+Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+---
+ src/configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/configure b/src/configure
+index c74d67af8..2aaf541c3 100755
+--- a/src/configure
++++ b/src/configure
+@@ -232,7 +232,7 @@ You need $supported_compiler."
+
+ function check_for_slow_expf {
+ # We cannot run this test if we are cross compiling.
+- if [[ "$TARGET_ARCH" == "`uname -m`" ]] ; then
++ if false ; then
+ ( cd probe
+ rm -f exp-test
+ make -f Makefile.slow_expf 1>/dev/null
diff --git a/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb
new file mode 100644
index 00000000..b3e021f3
--- /dev/null
+++ b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb
@@ -0,0 +1,63 @@
+SUMMARY = "Kaldi Speech Recognition Toolkit"
+HOMEPAGE = "http://kaldi-asr.org/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://../COPYING;md5=a10e448a64dbd3723ff3fb2f397fba2e \
+ file://doc/legal.dox;md5=3cba845003f27e67da70faa5da924c1e"
+
+SRC_URI = "git://github.com/alphacep/kaldi.git;protocol=https;branch=vosk \
+ file://0001-Fixes-for-shared-library-compilation.patch \
+ "
+
+PV = "1.0+git${SRCPV}"
+SRCREV = "76cd51d44c0a61e3905c35cadb2ec5f54f3e42d1"
+
+S = "${WORKDIR}/git/src"
+
+DEPENDS += "openblas vosk-openfst"
+inherit python3native
+
+ALLOW_EMPTY_${PN} = "1"
+
+MYCONF = "--mathlib=OPENBLAS --static --shared --use-cuda=no --fst-root=${STAGING_INCDIR}/../ --fst-version=1.8.0 --openblas-root=${STAGING_INCDIR}/../ "
+
+do_configure() {
+
+ ./configure ${MYCONF}
+
+}
+
+do_compile() {
+
+ make ${PARALLEL_MAKE}
+
+}
+
+do_install() {
+
+ install -d ${D}${libdir}
+
+ for i in lib/*.so ; do
+ install -m 0644 ${i} ${D}${libdir}/
+ done
+
+ for i in */*.a ; do
+ install -m 0644 ${i} ${D}${libdir}/
+ done
+
+ for j in base chain decoder feat fstext gmm gst-plugin hmm itf ivector kws lat lm matrix nnet nnet2 nnet3 online online2 rnnlm sgmm2 tfrnnlm transform tree util cudadecoder cudadecoderbin cudafeat cudamatrix ; do
+ install -d ${D}${includedir}/kaldi/$j
+ for i in $j/*.h ; do
+ install -m 0644 $i ${D}${includedir}/kaldi/$j/
+ done
+ done
+
+ # make sure we have the package vosk-kaldi
+
+ install -d ${D}/usr/share/kaldi
+ echo "This is vosk-kaldi" > ${D}/usr/share/kaldi/README
+
+}
+
+FILES:${PN} += " /usr/share/kaldi /usr/share/kaldi/README"
+ERROR_QA:remove = "rpaths"
+ERROR_QA:remove = "dev-elf"