setup.sh 1000 字节
Newer Older
Y
Yibing Liu 已提交
1
#! /usr/bin/env  bash
Y
yangyaming 已提交
2 3

# install python dependencies
4
if [ -f "requirements.txt" ]; then
H
Hui Zhang 已提交
5
    pip3 install -r requirements.txt
Y
yangyaming 已提交
6 7
fi
if [ $? != 0 ]; then
Y
yangyaming 已提交
8
    echo "Install python dependencies failed !!!"
Y
yangyaming 已提交
9 10 11
    exit 1
fi

12
# install package libsndfile
H
Hui Zhang 已提交
13
python3 -c "import soundfile"
Y
yangyaming 已提交
14
if [ $? != 0 ]; then
L
Luo Tao 已提交
15
    echo "Install package libsndfile into default system path."
L
Luo Tao 已提交
16
    wget "http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz"
L
Luo Tao 已提交
17 18 19 20 21 22
    if [ $? != 0 ]; then
        echo "Download libsndfile-1.0.28.tar.gz failed !!!"
        exit 1
    fi
    tar -zxvf libsndfile-1.0.28.tar.gz
    cd libsndfile-1.0.28
23
    ./configure > /dev/null && make > /dev/null && make install > /dev/null
L
Luo Tao 已提交
24 25 26
    cd ..
    rm -rf libsndfile-1.0.28
    rm libsndfile-1.0.28.tar.gz
Y
yangyaming 已提交
27
fi
Y
yangyaming 已提交
28

Y
Yibing Liu 已提交
29
# install decoders
H
Hui Zhang 已提交
30
python3 -c "import pkg_resources; pkg_resources.require(\"swig_decoders==1.1\")"
Y
Yibing Liu 已提交
31
if [ $? != 0 ]; then
Y
Yibing Liu 已提交
32
    cd decoders/swig > /dev/null
Y
Yibing Liu 已提交
33
    sh setup.sh
Y
Yibing Liu 已提交
34
    cd - > /dev/null
Y
Yibing Liu 已提交
35 36 37
fi


Y
yangyaming 已提交
38
echo "Install all dependencies successfully."