compileDebugLibraries.sh 2.65 KB
Newer Older
Felix Paul Kühne's avatar
Felix Paul Kühne committed
1 2
#!/bin/sh
# Copyright (C) Pierre d'Herbemont, 2010
Felix Paul Kühne's avatar
Felix Paul Kühne committed
3
# Copyright (C) Felix Paul Kühne, 2012-2015
Felix Paul Kühne's avatar
Felix Paul Kühne committed
4 5 6

set -e

7
SDK=`xcrun --sdk iphoneos --show-sdk-version`
Felix Paul Kühne's avatar
Felix Paul Kühne committed
8
SDK_MIN=7.0
Felix Paul Kühne's avatar
Felix Paul Kühne committed
9
VERBOSE=no
10
CONFIGURATION="Release"
11
NONETWORK=no
12
SKIPLIBVLCCOMPILATION=no
13
TVOS=no
14

15
TESTEDVLCKITHASH=a0bf5544
16
TESTEDMEDIALIBRARYKITHASH=f8142c56
Felix Paul Kühne's avatar
Felix Paul Kühne committed
17 18 19 20

usage()
{
cat << EOF
21
usage: $0 [-v] [-k sdk] [-d] [-n] [-l] [-t]
Felix Paul Kühne's avatar
Felix Paul Kühne committed
22 23 24 25 26

OPTIONS
   -k       Specify which sdk to use (see 'xcodebuild -showsdks', current: ${SDK})
   -v       Be more verbose
   -d       Enable Debug
27
   -n       Skip script steps requiring network interaction
28
   -l       Skip libvlc compilation
29
   -t       Build for TV
Felix Paul Kühne's avatar
Felix Paul Kühne committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
EOF
}

spushd()
{
     pushd "$1" 2>&1> /dev/null
}

spopd()
{
     popd 2>&1> /dev/null
}

info()
{
     local green="\033[1;32m"
     local normal="\033[0m"
     echo "[${green}info${normal}] $1"
}

50
while getopts "hvsdtnluk:" OPTION
Felix Paul Kühne's avatar
Felix Paul Kühne committed
51 52 53 54 55 56 57 58 59 60 61
do
     case $OPTION in
         h)
             usage
             exit 1
             ;;
         v)
             VERBOSE=yes
             ;;
         d)  CONFIGURATION="Debug"
             ;;
62 63 64
         n)
             NONETWORK=yes
             ;;
65 66 67
         l)
             SKIPLIBVLCCOMPILATION=yes
             ;;
Felix Paul Kühne's avatar
Felix Paul Kühne committed
68 69 70
         k)
             SDK=$OPTARG
             ;;
71 72
         t)
             TVOS=yes
73 74
             SDK=`xcrun --sdk appletvos --show-sdk-version`
             SDK_MIN=9.0
75
             ;;
Felix Paul Kühne's avatar
Felix Paul Kühne committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
         ?)
             usage
             exit 1
             ;;
     esac
done
shift $(($OPTIND - 1))

out="/dev/null"
if [ "$VERBOSE" = "yes" ]; then
   out="/dev/stdout"
fi

if [ "x$1" != "x" ]; then
    usage
    exit 1
fi

info "Preparing build dirs"

mkdir -p ImportedSources

spushd ImportedSources

100
if [ "$NONETWORK" != "yes" ]; then
Felix Paul Kühne's avatar
Felix Paul Kühne committed
101
if ! [ -e MediaLibraryKit ]; then
Felix Paul Kühne's avatar
Felix Paul Kühne committed
102
git clone http://code.videolan.org/videolan/MediaLibraryKit.git
103
cd MediaLibraryKit
104
# git reset --hard ${TESTEDMEDIALIBRARYKITHASH}
105 106 107
cd ..
else
cd MediaLibraryKit
108
git pull --rebase
109
# git reset --hard ${TESTEDMEDIALIBRARYKITHASH}
110
cd ..
Felix Paul Kühne's avatar
Felix Paul Kühne committed
111 112
fi
if ! [ -e VLCKit ]; then
Felix Paul Kühne's avatar
Felix Paul Kühne committed
113
git clone http://code.videolan.org/videolan/VLCKit.git
114
cd VLCKit
115
git reset --hard ${TESTEDVLCKITHASH}
116 117 118
cd ..
else
cd VLCKit
119
git pull --rebase
120
git reset --hard ${TESTEDVLCKITHASH}
121
cd ..
Felix Paul Kühne's avatar
Felix Paul Kühne committed
122
fi
123
fi
124

Felix Paul Kühne's avatar
Felix Paul Kühne committed
125 126 127 128 129 130 131 132 133 134
spopd #ImportedSources

#
# Build time
#

info "Building"

spushd ImportedSources

135 136
spushd VLCKit
echo `pwd`
Felix Paul Kühne's avatar
Felix Paul Kühne committed
137 138 139 140
args=""
if [ "$VERBOSE" = "yes" ]; then
    args="${args} -v"
fi
141 142
if [ "$NONETWORK" = "yes" ]; then
    args="${args} -n"
143
fi
144 145 146
if [ "$SKIPLIBVLCCOMPILATION" = "yes" ]; then
    args="${args} -l"
fi
147 148 149
if [ "$TVOS" = "yes" ]; then
    args="${args} -t"
fi
150
./buildMobileVLCKit.sh ${args} -k "${SDK}"
Felix Paul Kühne's avatar
Felix Paul Kühne committed
151 152
spopd

Felix Paul Kühne's avatar
Felix Paul Kühne committed
153 154
spopd # ImportedSources

155 156 157
#install pods
info "installing pods"
pod install
Felix Paul Kühne's avatar
Felix Paul Kühne committed
158 159

info "Build completed"