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

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

12
# install package libsndfile
L
Luo Tao 已提交
13
python -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 30 31
# install decoders
python -c "import swig_decoders"
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."