-
Notifications
You must be signed in to change notification settings - Fork 162
/
pack-for-embedded-systems.sh
executable file
·60 lines (41 loc) · 1.74 KB
/
pack-for-embedded-systems.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
# This script pack all source code into a single zip file
# so that you can build it locally without accessing Internet
# on your board.
set -e
SHERPA_NCNN_VERSION=$(grep "SHERPA_NCNN_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
echo "SHERPA_NCNN_VERSION: ${SHERPA_NCNN_VERSION}"
dir=sherpa-ncnn-all-in-one-for-embedded-systems-${SHERPA_NCNN_VERSION}
rm -rf $dir
mkdir -p $dir
pushd $dir
wget \
-O sherpa-ncnn-${SHERPA_NCNN_VERSION}.tar.gz \
https://github.com/k2-fsa/sherpa-ncnn/archive/refs/tags/v${SHERPA_NCNN_VERSION}.tar.gz
tar xf sherpa-ncnn-${SHERPA_NCNN_VERSION}.tar.gz
rm -v sherpa-ncnn-${SHERPA_NCNN_VERSION}.tar.gz
# Please also change ./build-m3axpi.sh
wget \
-O kaldi-native-fbank-1.18.5.tar.gz \
https://github.com/csukuangfj/kaldi-native-fbank/archive/refs/tags/v1.18.7.tar.gz
wget \
-O ncnn-sherpa-1.1.tar.gz \
https://github.com/csukuangfj/ncnn/archive/refs/tags/sherpa-1.1.tar.gz
cat >README.md <<EOF
Please put files from this folder to the directory \$HOME/asr/
rm -rf \$HOME/asr
mkdir -p \$HOME/asr
tar xvf sherpa-ncnn-all-in-one-for-embedded-systems-${SHERPA_NCNN_VERSION}.tar.bz2 --strip-components 1 -C \$HOME/asr
rm sherpa-ncnn-all-in-one-for-embedded-systems-${SHERPA_NCNN_VERSION}.tar.bz2 # to save space
ls -lh \$HOME/asr
It should print something like below:
ls -lh \$HOME/asr
total 24368
-rw-r--r-- 1 fangjun staff 59K Feb 2 17:01 kaldi-native-fbank-1.18.5.tar.gz
-rw-r--r-- 1 fangjun staff 12M Feb 2 17:01 sherpa-1.1.tar.gz
drwxr-xr-x 29 fangjun staff 928B Feb 2 16:05 sherpa-ncnn-${SHERPA_NCNN_VERSION}
# Note: It is OK if the versions of the above files are different.
# The two .tar.gz files must be placed in \$HOME/asr
EOF
popd
tar cjf ${dir}.tar.bz2 $dir