summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO36
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD93
-rw-r--r--stt-tflite.pc5
-rw-r--r--stt.pc5
5 files changed, 144 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..1b7df5b12a69
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,36 @@
+pkgbase = stt-bin
+ pkgdesc = A TensorFlow implementation of Baidu's stt architecture - C++ native client + devel files.
+ pkgver = 0.8.0
+ pkgrel = 1
+ url = https://github.com/coqui-ai/STT
+ arch = x86_64
+ arch = armv7h
+ arch = aarch64
+ license = MPL2
+ makedepends = wget
+ makedepends = tar
+ depends = gcc-libs
+ provides = stt
+ conflicts = stt
+ source_x86_64 = https://github.com/mozilla/stt/releases/download/v0.8.0/native_client.amd64.cpu.linux.tar.xz
+ source_x86_64 = https://raw.githubusercontent.com/mozilla/stt/v0.8.0//native_client/stt.h
+ source_x86_64 = stt.pc
+ source_x86_64 = stt-tflite.pc
+ sha512sums_x86_64 = 866c54d48ce260f62aeade4d0776f536245e5405b405f1e75f3d82cce286771ac2cab2dc8c0bdddbdb9fe1f092dc08007390d72f58c54b239b43f3b3084e6177
+ sha512sums_x86_64 = 16563959019ce823249b1c8772528936f4aa61d89daa5a9a9544b37b95348f0c6fefa5836b7eb7d3b41eb90c1998fb94ccb9e9b02dec4f0df8f693efd706ec4f
+ sha512sums_x86_64 = caf2820f4d6a4fe7a9b9b035eee76700a5b90eb4c25242da6265934024a7bb669d541b05521a16d2792b1373f9ba6d3aa92fb9487c2def0a843d9fb74ce8db17
+ sha512sums_x86_64 = 34bbee9149d2a7545e797c8a5858b267c9c7aed00762e88c6098c9cbb7d6a7eb346a930b6c64a34e191ced1e1bf76f1ea91b357169101058bab0f0adb057f44d
+ source_armv7h = https://github.com/mozilla/stt/releases/download/v0.8.0/native_client.rpi3.cpu.linux.tar.xz
+ source_armv7h = https://raw.githubusercontent.com/mozilla/stt/v0.8.0//native_client/stt.h
+ source_armv7h = stt.pc
+ sha512sums_armv7h = d820ffde8493f8bfa560da79ad4362dce2777f82e8d519a16529b2c6c2bb824071772e3071e8d4d0ee93ab76e32c2e5755ca473e5a8ff10491d7da5d294b1d77
+ sha512sums_armv7h = 16563959019ce823249b1c8772528936f4aa61d89daa5a9a9544b37b95348f0c6fefa5836b7eb7d3b41eb90c1998fb94ccb9e9b02dec4f0df8f693efd706ec4f
+ sha512sums_armv7h = caf2820f4d6a4fe7a9b9b035eee76700a5b90eb4c25242da6265934024a7bb669d541b05521a16d2792b1373f9ba6d3aa92fb9487c2def0a843d9fb74ce8db17
+ source_aarch64 = https://github.com/mozilla/stt/releases/download/v0.8.0/native_client.arm64.cpu.linux.tar.xz
+ source_aarch64 = https://raw.githubusercontent.com/mozilla/stt/v0.8.0//native_client/stt.h
+ source_aarch64 = stt.pc
+ sha512sums_aarch64 = 32261e9bda72c53a345acf4541d73e86dd68be587cf2f7e90e1705a68f4e501907c5f144539d7644db72f9784ba035dad9de184db4880f10f0d676a5935d85d3
+ sha512sums_aarch64 = 16563959019ce823249b1c8772528936f4aa61d89daa5a9a9544b37b95348f0c6fefa5836b7eb7d3b41eb90c1998fb94ccb9e9b02dec4f0df8f693efd706ec4f
+ sha512sums_aarch64 = caf2820f4d6a4fe7a9b9b035eee76700a5b90eb4c25242da6265934024a7bb669d541b05521a16d2792b1373f9ba6d3aa92fb9487c2def0a843d9fb74ce8db17
+
+pkgname = stt-bin
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..68f18504beaa
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+stt.h
+stt-*.tar.*z
+native_client.*.tar.*z
+pkg/
+src/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..98546a72b73f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,93 @@
+pkgbase=stt
+pkgname=stt-bin
+_pkgname=STT
+pkgver=1.3.0
+pkgrel=1
+pkgdesc="A TensorFlow implementation of Baidu's DeepSpeech architecture - C++ native client + devel files."
+arch=('x86_64' 'armv7h' 'aarch64')
+url="https://github.com/coqui-ai/STT"
+license=('MPL2')
+depends=('gcc-libs')
+makedepends=('wget' 'tar')
+provides=('stt')
+conflicts=('stt')
+
+# Set all sources.
+_src_base_url="https://github.com/coqui-ai/STT/releases/download/v$pkgver"
+_raw_base_url="https://raw.githubusercontent.com/coqui-ai/STT/v$pkgver/"
+
+# Reused checksums.
+_header_sum='16563959019ce823249b1c8772528936f4aa61d89daa5a9a9544b37b95348f0c6fefa5836b7eb7d3b41eb90c1998fb94ccb9e9b02dec4f0df8f693efd706ec4f'
+_pc_sum='caf2820f4d6a4fe7a9b9b035eee76700a5b90eb4c25242da6265934024a7bb669d541b05521a16d2792b1373f9ba6d3aa92fb9487c2def0a843d9fb74ce8db17'
+_pc_tflite_sum='34bbee9149d2a7545e797c8a5858b267c9c7aed00762e88c6098c9cbb7d6a7eb346a930b6c64a34e191ced1e1bf76f1ea91b357169101058bab0f0adb057f44d'
+
+# amd64
+source_x86_64=("$_src_base_url/native_client.amd64.cpu.linux.tar.xz"
+ "$_raw_base_url/native_client/stt.h"
+ "stt.pc"
+ "stt-tflite.pc")
+sha512sums_x86_64=('866c54d48ce260f62aeade4d0776f536245e5405b405f1e75f3d82cce286771ac2cab2dc8c0bdddbdb9fe1f092dc08007390d72f58c54b239b43f3b3084e6177'
+ "$_header_sum"
+ "$_pc_sum"
+ "$_pc_tflite_sum")
+
+# armv7h
+source_armv7h=("$_src_base_url/native_client.rpi3.cpu.linux.tar.xz"
+ "$_raw_base_url/native_client/stt.h"
+ "stt.pc")
+sha512sums_armv7h=('d820ffde8493f8bfa560da79ad4362dce2777f82e8d519a16529b2c6c2bb824071772e3071e8d4d0ee93ab76e32c2e5755ca473e5a8ff10491d7da5d294b1d77'
+ "$_header_sum"
+ "$_pc_sum")
+
+# aarch64
+source_aarch64=("$_src_base_url/native_client.arm64.cpu.linux.tar.xz"
+ "$_raw_base_url/native_client/stt.h"
+ "stt.pc")
+sha512sums_aarch64=('32261e9bda72c53a345acf4541d73e86dd68be587cf2f7e90e1705a68f4e501907c5f144539d7644db72f9784ba035dad9de184db4880f10f0d676a5935d85d3'
+ "$_header_sum"
+ "$_pc_sum")
+
+package() {
+ # Create installation directories.
+ mkdir -p "$pkgdir/usr/lib"
+ mkdir -p "$pkgdir/usr/include"
+ mkdir -p "$pkgdir/usr/lib/pkgconfig"
+
+ # Separately get a copy of the TFLite library.
+ # Unfortunately, due to files having the same name, this cannot be done with the sources section.
+ # Note: At this time, only x86_64 Linux has a prebuilt TFLite library.
+ MACHINE_TYPE=`uname -m`
+ if [ ${MACHINE_TYPE} == 'x86_64' ]; then
+ # Download the TFLite version of DS.
+ local nc_tflite_fname="native_client.amd64.tflite.linux.tar.xz"
+ wget "$_src_base_url/$nc_tflite_fname" -q -O "$srcdir/$nc_tflite_fname"
+
+ # Make a directory and extract the library.
+ local tf_dir="$srcdir/tflite"
+ local tf_lib_path="$tf_dir/libstt.so"
+ local tf_lib_sum="7010cf23eb16da1edcd059ff599296a614171fca94f21dbd6de27935a2e72da557333b5560dacc4869a8fe4989a85608b685c2e20dbc8301d7b5f0ad20e06c98"
+ mkdir -p "$tf_dir"
+ tar -xvf "$srcdir/$nc_tflite_fname" -C "$tf_dir" --wildcards 'libstt.so'
+
+ # Ensure the library's checksum is correct.
+ local lib_sum_check=$(sha512sum "$tf_lib_path" | awk '{print $1}')
+ if [ ${lib_sum_check} != "$tf_lib_sum" ]; then
+ # Bail!
+ echo "Verifying the TFLite library's checksum failed!" 1>&2
+ exit 1
+ fi
+
+ # Copy and rename the TFLite library.
+ install -Dm755 "$tf_lib_path" "$pkgdir/usr/lib/libstt-tflite.so.$pkgver"
+ ln -s "/usr/lib/libstt-tflite.so.$pkgver" "$pkgdir/usr/lib/libstt-tflite.so"
+
+ # Install the pkgconf file.
+ install -Dm644 stt-tflite.pc "$pkgdir/usr/lib/pkgconfig/stt-tflite.pc"
+ fi
+
+ # Install files.
+ install -Dm755 libstt.so "$pkgdir/usr/lib/libstt.so.$pkgver"
+ ln -s "/usr/lib/libstt.so.$pkgver" "$pkgdir/usr/lib/libstt.so"
+ install -Dm644 stt.h "$pkgdir/usr/include"
+ install -Dm644 stt.pc "$pkgdir/usr/lib/pkgconfig/stt.pc"
+} \ No newline at end of file
diff --git a/stt-tflite.pc b/stt-tflite.pc
new file mode 100644
index 000000000000..f5d4b3b30ac0
--- /dev/null
+++ b/stt-tflite.pc
@@ -0,0 +1,5 @@
+Name: libstt-tflite
+Description: A TensorFlow implementation of Baidu's DeepSpeech architecture - C++ native client + devel files (for TFLite models).
+Version: 1.3.0
+Libs: /usr/lib/libstt-tflite.so.1.3.0
+Cflags: -I/usr/include
diff --git a/stt.pc b/stt.pc
new file mode 100644
index 000000000000..f03642387230
--- /dev/null
+++ b/stt.pc
@@ -0,0 +1,5 @@
+Name: libstt
+Description: A TensorFlow implementation of Baidu's DeepSpeech architecture - C++ native client + devel files.
+Version: 1.3.0
+Libs: /usr/lib/libstt.so.1.3.0
+Cflags: -I/usr/include