-
Notifications
You must be signed in to change notification settings - Fork 750
/
darwin.sh
executable file
·68 lines (58 loc) · 1.95 KB
/
darwin.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
set -ev
#check env
df -h
diskutil list
ls $HOME/*
du -sh $HOME/*
if [ "$QT_HOMEBREW" == "true" ]
then
#download and install qt with brew
brew update
brew install qt5
brew outdated qt5 || brew upgrade qt5
ln -s /usr/local/Cellar/qt/5.12.3 $HOME/Desktop/Qt
else
#download and install qt
QT=qt-unified-mac-x64-online
curl -sL --retry 10 --retry-delay 10 -o /tmp/$QT.dmg https://download.qt.io/official_releases/online_installers/$QT.dmg
hdiutil attach -noverify -noautofsck -quiet /tmp/$QT.dmg
QT=qt-unified-mac-x64-3.0.5-online
if [ "$IOS" == "true" ] || [ "$IOS_SIMULATOR" == "true" ]
then
/Volumes/$QT/$QT.app/Contents/MacOS/$QT -v --script $GOPATH/src/github.com/therecipe/qt/internal/ci/iscript.qs IOS=true
else
/Volumes/$QT/$QT.app/Contents/MacOS/$QT -v --script $GOPATH/src/github.com/therecipe/qt/internal/ci/iscript.qs DARWIN=true
fi
diskutil unmountDisk disk1
rm -f /tmp/$QT.dmg
ln -s $HOME/Qt $HOME/Desktop
fi
if [ "$ANDROID" == "true" ]
then
#download and install android sdk
SDK=sdk-tools-darwin-3859397.zip
curl -sL --retry 10 --retry-delay 10 -o /tmp/$SDK https://dl.google.com/android/repository/$SDK
unzip -qq /tmp/$SDK -d $HOME/android-sdk-macosx/
rm -f /tmp/$SDK
ln -s $HOME/android-sdk-macosx $HOME/Desktop
#install deps for android sdk
$HOME/android-sdk-macosx/tools/bin/sdkmanager --list --verbose
echo "y" | $HOME/android-sdk-macosx/tools/bin/sdkmanager "platform-tools" "build-tools;28.0.3" "platforms;android-28"
echo "y" | $HOME/android-sdk-macosx/tools/bin/sdkmanager --update
#download and install android ndk
NDK=android-ndk-r18b-darwin-x86_64.zip
curl -sL --retry 10 --retry-delay 10 -o /tmp/$NDK https://dl.google.com/android/repository/$NDK
unzip -qq /tmp/$NDK -d $HOME
rm -f /tmp/$NDK
ln -s $HOME/android-ndk-r18b $HOME/Desktop
fi
#prepare env
sudo chown $USER /usr/local/bin
sudo chown $USER $GOROOT/pkg | true
#check env
df -h
diskutil list
ls $HOME/*
du -sh $HOME/*
exit 0