cutego/internal/ci/linux.sh

81 lines
5.5 KiB
Bash
Raw Normal View History

2016-10-20 04:42:23 +03:00
#!/bin/bash
2016-10-04 23:53:23 +03:00
set -ev
2016-10-04 22:51:32 +03:00
2016-10-06 17:53:27 +03:00
#check env
2016-10-06 16:46:45 +03:00
df -h
2016-10-06 17:53:27 +03:00
ls $HOME/*
du -sh $HOME/*
2016-10-06 16:46:45 +03:00
#needed for headless qt installation
export QT_QPA_PLATFORM=minimal
2016-10-04 22:51:32 +03:00
#replace gcc4 with gcc5
2016-10-05 14:10:39 +03:00
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
2016-10-05 14:04:10 +03:00
sudo apt-get -qq update
sudo apt-get -y -qq install gcc-5 g++-5
2016-10-07 21:36:40 +03:00
sudo rm /usr/bin/gcc; sudo ln -s /usr/bin/gcc-5 /usr/bin/gcc
sudo rm /usr/bin/g++; sudo ln -s /usr/bin/g++-5 /usr/bin/g++
2016-10-04 22:51:32 +03:00
if [ "$QT_PKG_CONFIG" == "true" ]
then
#download and install qt
sudo add-apt-repository -y ppa:beineri/opt-qt57-trusty
sudo apt-get -qq update
2016-10-20 15:34:02 +03:00
sudo apt-get -y -qq install qt573d qt57base qt57canvas3d qt57charts-no-lgpl qt57connectivity qt57creator qt57datavis-no-lgpl qt57declarative qt57declarative-render2d-no-lgpl qt57doc qt57gamepad qt57graphicaleffects qt57imageformats qt57location qt57multimedia qt57qbs qt57quickcontrols qt57quickcontrols2 qt57script qt57scxml qt57sensors qt57serialbus qt57serialport qt57svg qt57tools qt57translations qt57virtualkeyboard-no-lgpl qt57webchannel qt57webengine qt57websockets qt57x11extras qt57xmlpatterns
else
#download and install qt
QT=qt-opensource-linux-x64-android-5.7.0.run
curl -sL --retry 10 --retry-delay 10 -o /tmp/$QT https://download.qt.io/official_releases/qt/5.7/5.7.0/$QT
chmod +x /tmp/$QT
/tmp/$QT --script $GOPATH/src/github.com/therecipe/qt/internal/ci/iscript.qs
rm -f /tmp/$QT
fi
2016-10-05 13:46:59 +03:00
if [ "$QT_WINDOWS_CC" == "true" ]
then
2016-10-24 01:11:57 +03:00
#download and install qt (and wine) for cross compilation
#sudo apt-get -y -qq install wine
echo "deb http://pkg.mxe.cc/repos/apt/debian wheezy main" | sudo tee --append /etc/apt/sources.list.d/mxeapt.list > /dev/null
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D43A795B73B16ABE9643FE1AFD8FFF16DB45C6AB
sudo apt-get -qq update
2016-11-12 18:06:57 +03:00
if [ "$QT_MXE_ARCH" == "386" ]
then
sudo apt-get -y -qq install mxe-i686-w64-mingw32.shared-qt3d mxe-i686-w64-mingw32.shared-qtactiveqt mxe-i686-w64-mingw32.shared-qtbase mxe-i686-w64-mingw32.shared-qtcanvas3d mxe-i686-w64-mingw32.shared-qtcharts mxe-i686-w64-mingw32.shared-qtconnectivity mxe-i686-w64-mingw32.shared-qtdatavis3d mxe-i686-w64-mingw32.shared-qtdeclarative mxe-i686-w64-mingw32.shared-qtdeclarative-render2d mxe-i686-w64-mingw32.shared-qtgamepad mxe-i686-w64-mingw32.shared-qtgraphicaleffects mxe-i686-w64-mingw32.shared-qtimageformats mxe-i686-w64-mingw32.shared-qtlocation mxe-i686-w64-mingw32.shared-qtmultimedia mxe-i686-w64-mingw32.shared-qtofficeopenxml mxe-i686-w64-mingw32.shared-qtpurchasing mxe-i686-w64-mingw32.shared-qtquickcontrols mxe-i686-w64-mingw32.shared-qtquickcontrols2 mxe-i686-w64-mingw32.shared-qtscript mxe-i686-w64-mingw32.shared-qtscxml mxe-i686-w64-mingw32.shared-qtsensors mxe-i686-w64-mingw32.shared-qtserialbus mxe-i686-w64-mingw32.shared-qtserialport mxe-i686-w64-mingw32.shared-qtservice mxe-i686-w64-mingw32.shared-qtsvg mxe-i686-w64-mingw32.shared-qtsystems mxe-i686-w64-mingw32.shared-qttools mxe-i686-w64-mingw32.shared-qttranslations mxe-i686-w64-mingw32.shared-qtvirtualkeyboard mxe-i686-w64-mingw32.shared-qtwebchannel mxe-i686-w64-mingw32.shared-qtwebkit mxe-i686-w64-mingw32.shared-qtwebsockets mxe-i686-w64-mingw32.shared-qtwinextras mxe-i686-w64-mingw32.shared-qtxlsxwriter mxe-i686-w64-mingw32.shared-qtxmlpatterns
else
sudo apt-get -y -qq install mxe-x86-64-w64-mingw32.shared-qt3d mxe-x86-64-w64-mingw32.shared-qtactiveqt mxe-x86-64-w64-mingw32.shared-qtbase mxe-x86-64-w64-mingw32.shared-qtcanvas3d mxe-x86-64-w64-mingw32.shared-qtcharts mxe-x86-64-w64-mingw32.shared-qtconnectivity mxe-x86-64-w64-mingw32.shared-qtdatavis3d mxe-x86-64-w64-mingw32.shared-qtdeclarative mxe-x86-64-w64-mingw32.shared-qtdeclarative-render2d mxe-x86-64-w64-mingw32.shared-qtgamepad mxe-x86-64-w64-mingw32.shared-qtgraphicaleffects mxe-x86-64-w64-mingw32.shared-qtimageformats mxe-x86-64-w64-mingw32.shared-qtlocation mxe-x86-64-w64-mingw32.shared-qtmultimedia mxe-x86-64-w64-mingw32.shared-qtofficeopenxml mxe-x86-64-w64-mingw32.shared-qtpurchasing mxe-x86-64-w64-mingw32.shared-qtquickcontrols mxe-x86-64-w64-mingw32.shared-qtquickcontrols2 mxe-x86-64-w64-mingw32.shared-qtscript mxe-x86-64-w64-mingw32.shared-qtscxml mxe-x86-64-w64-mingw32.shared-qtsensors mxe-x86-64-w64-mingw32.shared-qtserialbus mxe-x86-64-w64-mingw32.shared-qtserialport mxe-x86-64-w64-mingw32.shared-qtservice mxe-x86-64-w64-mingw32.shared-qtsvg mxe-x86-64-w64-mingw32.shared-qtsystems mxe-x86-64-w64-mingw32.shared-qttools mxe-x86-64-w64-mingw32.shared-qttranslations mxe-x86-64-w64-mingw32.shared-qtvirtualkeyboard mxe-x86-64-w64-mingw32.shared-qtwebchannel mxe-x86-64-w64-mingw32.shared-qtwebkit mxe-x86-64-w64-mingw32.shared-qtwebsockets mxe-x86-64-w64-mingw32.shared-qtwinextras mxe-x86-64-w64-mingw32.shared-qtxlsxwriter mxe-x86-64-w64-mingw32.shared-qtxmlpatterns
fi
fi
2016-10-05 13:46:59 +03:00
#download and install android sdk
2016-10-06 03:15:20 +03:00
SDK=android-sdk_r24.4.1-linux.tgz
2016-10-07 20:14:46 +03:00
curl -sL --retry 10 --retry-delay 10 -o /tmp/$SDK https://dl.google.com/android/$SDK
2016-10-06 04:28:49 +03:00
tar -xzf /tmp/$SDK -C $HOME
2016-10-06 03:15:20 +03:00
rm -f /tmp/$SDK
2016-10-05 13:46:59 +03:00
#install deps for android sdk
2016-10-18 01:57:45 +03:00
$HOME/android-sdk-linux/tools/android list sdk
echo "y" | $HOME/android-sdk-linux/tools/android -s update sdk -f -u -t 1,2,3,5
2016-10-05 13:46:59 +03:00
#download and install android ndk
2016-10-06 03:15:20 +03:00
NDK=android-ndk-r12b-linux-x86_64.zip
2016-10-07 20:14:46 +03:00
curl -sL --retry 10 --retry-delay 10 -o /tmp/$NDK https://dl.google.com/android/repository/$NDK
2016-10-06 04:28:49 +03:00
unzip -qq /tmp/$NDK -d $HOME
2016-10-06 03:15:20 +03:00
rm -f /tmp/$NDK
2016-10-06 17:14:10 +03:00
2016-10-07 22:59:16 +03:00
#install openjdk8
sudo add-apt-repository -y ppa:openjdk-r/ppa
sudo apt-get -qq update
sudo apt-get -y -qq install openjdk-8-jdk
2016-10-07 20:14:46 +03:00
#prepare env
sudo chown $USER /usr/local/bin
2016-10-07 22:14:21 +03:00
sudo chown $USER $GOROOT/pkg | true
2016-10-07 20:14:46 +03:00
2016-10-06 17:53:27 +03:00
#check env
2016-10-06 17:14:10 +03:00
df -h
ls $HOME/*
du -sh $HOME/*