-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
executable file
·48 lines (42 loc) · 1.51 KB
/
init.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
#!/bin/bash
mkdir -p repos
GR="\033[32m"
RED="\033[91m"
RST="\033[0m"
function install_brew_if_needed() {
if ! command -v brew > /dev/null; then
echo "Brew not installed; installing"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
}
function assert_has_xcodebuild() {
XCODE_VERSION="none"
XCODE_MAJOR_VERSION="0"
XCODE_MINOR_VERSION="0"
if command -v xcodebuild > /dev/null; then
XCODE_VERSION=`xcodebuild -version | grep Xcode | tr -d "\n" | perl -pe 's/Xcode //'`
XCODE_MAJOR_VERSION=`echo $XCODE_VERSION | perl -pe 's/([0-9]+)\.[0-9]+/$1/'`
XCODE_MINOR_VERSION=`echo $XCODE_VERSION | perl -pe 's/[0-9]+\.([0-9]+)/$1/'`
fi
#echo "XCODE Version: $XCODE_VERSION"
#echo "XCODE Version: Major = $XCODE_MAJOR_VERSION, Minor = $XCODE_MINOR_VERSION"
if [ $XCODE_MAJOR_VERSION > 10 ]; then
echo -e "${GR}Xcode $XCODE_VERSION installed$RST"
elif [ "$XCODE_VERSION" == "10.3" ]; then
echo -e "${GR}Xcode 10.3 installed$RST"
else
echo -e "${RED}Xcode 10.3+ not installed$RST"
echo -e "${RED}You need to install it and then rerun init.sh$RST"
exit 1
fi
}
install_brew_if_needed
assert_has_xcodebuild
./util/brewser.pl installdeps stf_ios_support.rb
./util/brewser.pl ensurehead libplist 2.2.1
./util/brewser.pl fixpc libplist 2.0
./util/brewser.pl ensurehead libusbmuxd 2.0.3
./util/brewser.pl fixpc libusbmuxd 2.0
./util/brewser.pl ensurehead libimobiledevice 1.3.1
./util/brewser.pl fixpc libimobiledevice 1.0
#make libimd