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