aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/init_qt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/init_qt.sh')
-rwxr-xr-xscripts/init_qt.sh137
1 files changed, 70 insertions, 67 deletions
diff --git a/scripts/init_qt.sh b/scripts/init_qt.sh
index c082b6bd..fec0d5d5 100755
--- a/scripts/init_qt.sh
+++ b/scripts/init_qt.sh
@@ -15,77 +15,80 @@
#!/bin/bash
-set -e
+set -ex
-if [ $ARCH = "x86" ]; then
- echo "Qt is not available for x86 systems"
- exit 1
-fi
+if [ "$ANDROID_ARCH" = "arm" ]; then
+ TOOLCHAIN=`pwd`/sdk/toolchain
+ BASE_PATH=`pwd`
+ mkdir -p qt
+ cd qt
+ export QT_HOME=`pwd`/Qt
+ if [ ! -d ${QT_HOME} ]; then
+ if [ $OS = "darwin" ]; then
+ if [ ! -f qt-opensource-mac-x64-android-ios-5.8.0.dmg ]; then
+ wget http://download.qt.io/archive/qt/5.8/5.8.0/qt-opensource-mac-x64-android-ios-5.8.0.dmg
+ fi
+ VOLUME=$(hdiutil attach qt-opensource-mac-x64-android-ios-5.8.0.dmg | tail -1 | awk '{print $3}')
+ $VOLUME/qt-opensource-mac-x64-android-ios-5.8.0.app/Contents/MacOS/qt-opensource-mac-x64-android-ios-5.8.0 --script ../scripts/install_script.sh -platform minimal --verbose
+ diskutil unmount $VOLUME
+ else
+ if [ ! -f qt-opensource-linux-x64-android-5.8.0.run ]; then
+ wget http://download.qt.io/archive/qt/5.8/5.8.0/qt-opensource-linux-x64-android-5.8.0.run
+ fi
+ chmod +x qt-opensource-linux-x64-android-5.8.0.run
+ ./qt-opensource-linux-x64-android-5.8.0.run --script ../scripts/install_script.sh -platform minimal --verbose
+ fi
+ fi
-mkdir -p qt
-cd qt
-export QT_HOME=`pwd`/Qt
-if [ ! -d ${QT_HOME} ]; then
- if [ $OS = "darwin" ]; then
- if [ ! -f qt-opensource-mac-x64-android-5.7.1.dmg ]; then
- wget http://download.qt.io/archive/qt/5.7/5.7.1/qt-opensource-mac-x64-android-5.7.1.dmg
- fi
-
- VOLUME=$(hdiutil attach qt-opensource-mac-x64-android-5.7.1.dmg | tail -1 | awk '{print $3}')
- $VOLUME/qt-opensource-mac-x64-android-5.7.1.app/Contents/MacOS/qt-opensource-mac-x64-android-5.7.1 --script ../scripts/install_script.sh -platform minimal --verbose
- diskutil unmount $VOLUME
- else
- if [ ! -f qt-opensource-linux-x64-android-5.7.1.run ]; then
- wget http://download.qt.io/archive/qt/5.7/5.7.1/qt-opensource-linux-x64-android-5.7.1.run
- fi
- chmod +x qt-opensource-linux-x64-android-5.7.1.run
- ./qt-opensource-linux-x64-android-5.7.1.run --script ../scripts/install_script.sh -platform minimal --verbose
+ if [ ! -d ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/boost ]; then
+ ln -s $DISTILLERY_INSTALL_DIR/include/ccnx ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
+ ln -s $DISTILLERY_INSTALL_DIR/include/boost ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
+ ln -s $DISTILLERY_INSTALL_DIR/include/parc ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
+ ln -s $DISTILLERY_INSTALL_DIR/include/LongBow ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
+ ln -s $DISTILLERY_INSTALL_DIR/include/icnet ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
+ ln -s $DISTILLERY_INSTALL_DIR/include/dash ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
fi
-fi
-cp -f $DISTILLERY_INSTALL_DIR/lib/libdash.so ${QT_HOME}/5.7/android_${ANDROID_ARCH}/lib/
+ echo "clone and compile ffmpeg"
+ if [ ! -f $DISTILLERY_INSTALL_DIR/lib/libavcodec.so -o ! -f $DISTILLERY_INSTALL_DIR/libavfilter.so -o ! -f $DISTILLERY_INSTALL_DIR/lib/libavformat.so -o ! -f $DISTILLERY_INSTALL_DIR/lib/libavutil.so -o ! -f $DISTILLERY_INSTALL_DIR/lib/libswresample.so -o ! -f $DISTILLERY_INSTALL_DIR/lib/libswscale.so ]; then
-if [ ! -d ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/boost ]; then
- ln -s $DISTILLERY_INSTALL_DIR/include/ccnx ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
- ln -s $DISTILLERY_INSTALL_DIR/include/boost ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
- ln -s $DISTILLERY_INSTALL_DIR/include/parc ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
- ln -s $DISTILLERY_INSTALL_DIR/include/LongBow ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
- ln -s $DISTILLERY_INSTALL_DIR/include/icnet ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
- ln -s $DISTILLERY_INSTALL_DIR/include/dash ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
-fi
+ if [ ! -d ffmpeg ]; then
+ git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
+ fi
+ fi
-if [ ! -d ffmpeg ]; then
- git clone -b release/3.3 https://git.ffmpeg.org/ffmpeg.git ffmpeg
-fi
-export FFSRC=`pwd`/ffmpeg
-export ANDROID_NDK=${NDK}
-export ANDROID_HOME=${SDK}
-export ANDROID_NDK_HOST=${OS}-${ARCH}
-export ANDROID_NDK_PLATFORM=${ANDROID_PLATFORM}
-export ANDROID_NDK_ROOT=${NDK}
-export ANDROID_NDK_TOOLCHAIN_PREFIX=arm-linux-androideabi
-export ANDROID_NDK_TOOLCHAIN_VERSION=4.9
-export ANDROID_NDK_TOOLS_PREFIX=arm-linux-androideabi
-export ANDROID_SDK_ROOT=${SDK}
-export ANDROID_API_VERSION=${ANDROID_PLATFORM}
-export PATH=$PATH:${ANDROID_HOME}/tools:${JAVA_HOME}/bin
-if [ ! -d ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/QtAV ]; then
- if [ ! -d QtAv ]; then
- git clone https://github.com/wang-bin/QtAV.git
- fi
- cd QtAV
- git submodule update --init
- cd tools/build_ffmpeg
- ./avbuild.sh android armv7
- cp sdk-android-gcc/lib/armeabi-v7a/lib* ${QT_HOME}/5.7/android_${ANDROID_ARCH}/lib/
- cp -r sdk-android-gcc/include/* ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
- cd ../..
- mkdir -p ${DISTILLERY_BUILD_DIR}/qtav
- cd ${DISTILLERY_BUILD_DIR}/qtav
- ${QT_HOME}/5.7/android_${ANDROID_ARCH}/bin/qmake -r -spec android-g++ ${DISTILLERY_ROOT_DIR}/qt/QtAV/QtAV.pro
- make
- make install INSTALL_ROOT=android
- sh sdk_install.sh
-fi
-cd ${DISTILLERY_ROOT_DIR}
+ export FFSRC=`pwd`/ffmpeg
+ export ANDROID_NDK=${NDK}
+ export ANDROID_HOME=${SDK}
+ export ANDROID_NDK_HOST=${OS}-${ARCH}
+ export ANDROID_NDK_PLATFORM=android-26
+ export ANDROID_NDK_ROOT=${NDK}
+ export ANDROID_NDK_TOOLCHAIN_PREFIX=arm-linux-androideabi
+ export ANDROID_NDK_TOOLCHAIN_VERSION=4.9
+ export ANDROID_NDK_TOOLS_PREFIX=arm-linux-androideabi
+ export ANDROID_SDK_ROOT=${SDK}
+ export ANDROID_API_VERSION=${ANDROID_PLATFORM}
+ export PATH=$PATH:${ANDROID_HOME}/tools:${JAVA_HOME}/bin
+ if [ ! -d ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/QtAV ]; then
+ if [ ! -d QtAV ]; then
+ git clone https://github.com/wang-bin/QtAV.git
+ fi
+ cd QtAV
+ echo "INCLUDEPATH += ${DISTILLERY_INSTALL_DIR}/include" >> .qmake.conf
+ echo "LIBS += -L${DISTILLERY_INSTALL_DIR}/lib" >> .qmake.conf
+ git submodule update --init
+ cd tools/build_ffmpeg
+ ./avbuild.sh android armv7
+ cp sdk-android-gcc/lib/armeabi-v7a/lib* ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/lib/
+ cp -r sdk-android-gcc/include/* ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
+ cd ../..
+ mkdir -p ${DISTILLERY_BUILD_DIR}/qtav
+ cd ${DISTILLERY_BUILD_DIR}/qtav
+ ${QT_HOME}/5.8/android_armv7/bin/qmake -r -spec android-g++ $BASE_PATH/qt/QtAV/QtAV.pro
+ make
+ make install INSTALL_ROOT=android
+ sh sdk_install.sh
+ fi
+ cd ${DISTILLERY_ROOT_DIR}
+fi \ No newline at end of file