compileVLCforiOS.sh 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. #!/bin/sh
  2. # Copyright (C) Pierre d'Herbemont, 2010
  3. # Copyright (C) Felix Paul Kühne, 2012-2015
  4. set -e
  5. SDK=`xcrun --sdk iphoneos --show-sdk-version`
  6. SDK_MIN=7.0
  7. VERBOSE=no
  8. CONFIGURATION="Release"
  9. NONETWORK=no
  10. SKIPLIBVLCCOMPILATION=no
  11. TVOS=no
  12. TESTEDVLCKITHASH=a0bf5544
  13. TESTEDMEDIALIBRARYKITHASH=f8142c56
  14. usage()
  15. {
  16. cat << EOF
  17. usage: $0 [-v] [-k sdk] [-d] [-n] [-l] [-t]
  18. OPTIONS
  19. -k Specify which sdk to use (see 'xcodebuild -showsdks', current: ${SDK})
  20. -v Be more verbose
  21. -d Enable Debug
  22. -n Skip script steps requiring network interaction
  23. -l Skip libvlc compilation
  24. -t Build for TV
  25. EOF
  26. }
  27. spushd()
  28. {
  29. pushd "$1" 2>&1> /dev/null
  30. }
  31. spopd()
  32. {
  33. popd 2>&1> /dev/null
  34. }
  35. info()
  36. {
  37. local green="\033[1;32m"
  38. local normal="\033[0m"
  39. echo "[${green}info${normal}] $1"
  40. }
  41. while getopts "hvsdtnluk:" OPTION
  42. do
  43. case $OPTION in
  44. h)
  45. usage
  46. exit 1
  47. ;;
  48. v)
  49. VERBOSE=yes
  50. ;;
  51. d) CONFIGURATION="Debug"
  52. ;;
  53. n)
  54. NONETWORK=yes
  55. ;;
  56. l)
  57. SKIPLIBVLCCOMPILATION=yes
  58. ;;
  59. k)
  60. SDK=$OPTARG
  61. ;;
  62. t)
  63. TVOS=yes
  64. SDK=`xcrun --sdk appletvos --show-sdk-version`
  65. SDK_MIN=9.0
  66. ;;
  67. ?)
  68. usage
  69. exit 1
  70. ;;
  71. esac
  72. done
  73. shift $(($OPTIND - 1))
  74. out="/dev/null"
  75. if [ "$VERBOSE" = "yes" ]; then
  76. out="/dev/stdout"
  77. fi
  78. if [ "x$1" != "x" ]; then
  79. usage
  80. exit 1
  81. fi
  82. info "Preparing build dirs"
  83. mkdir -p ImportedSources
  84. spushd ImportedSources
  85. if [ "$NONETWORK" != "yes" ]; then
  86. if ! [ -e MediaLibraryKit ]; then
  87. git clone http://code.videolan.org/videolan/MediaLibraryKit.git
  88. cd MediaLibraryKit
  89. # git reset --hard ${TESTEDMEDIALIBRARYKITHASH}
  90. cd ..
  91. else
  92. cd MediaLibraryKit
  93. git pull --rebase
  94. # git reset --hard ${TESTEDMEDIALIBRARYKITHASH}
  95. cd ..
  96. fi
  97. if ! [ -e VLCKit ]; then
  98. git clone http://code.videolan.org/videolan/VLCKit.git
  99. cd VLCKit
  100. git reset --hard ${TESTEDVLCKITHASH}
  101. cd ..
  102. else
  103. cd VLCKit
  104. git pull --rebase
  105. git reset --hard ${TESTEDVLCKITHASH}
  106. cd ..
  107. fi
  108. if ! [ -e GDrive ]; then
  109. svn checkout http://google-api-objectivec-client.googlecode.com/svn/trunk/Source GDrive
  110. cd GDrive
  111. patch -p0 < ../../patches/gdrive/gdrive-base.diff
  112. cd ..
  113. cd GDrive/HTTPFetcher && patch -p0 < ../../../patches/gdrive/gdrive-session-fetcher.diff
  114. cd ../..
  115. cd GDrive/OAuth2 && patch -p0 < ../../../patches/gdrive/gdrive-oauth.diff
  116. cd ../..
  117. else
  118. cd GDrive
  119. svn up
  120. cd ..
  121. fi
  122. if ! [ -e LXReorderableCollectionViewFlowLayout ]; then
  123. git clone git://github.com/fkuehne/LXReorderableCollectionViewFlowLayout.git
  124. else
  125. cd LXReorderableCollectionViewFlowLayout && git pull --rebase && cd ..
  126. fi
  127. if ! [ -e WhiteRaccoon ]; then
  128. git clone git://github.com/fkuehne/WhiteRaccoon.git
  129. else
  130. cd WhiteRaccoon && git pull --rebase && cd ..
  131. fi
  132. if ! [ -e Dropbox ]; then
  133. DROPBOXSDKVERSION=1.3.13
  134. curl -L -O https://www.dropbox.com/static/developers/dropbox-ios-sdk-${DROPBOXSDKVERSION}.zip
  135. unzip -q dropbox-ios-sdk-${DROPBOXSDKVERSION}.zip
  136. mv dropbox-ios-sdk-${DROPBOXSDKVERSION} Dropbox
  137. cd Dropbox
  138. patch -p1 < ../../patches/dropbox/DropboxTV.patch
  139. cd ..
  140. rm dropbox-ios-sdk-${DROPBOXSDKVERSION}.zip
  141. rm -rf __MACOSX
  142. fi
  143. if ! [ -e HockeySDK-tvOS ]; then
  144. curl -L -O https://www.dropbox.com/s/pie0xxmf6xmj6wl/HockeySDK-tvOS.zip?dl=0
  145. unzip -q HockeySDK-tvOS.zip?dl=0
  146. cd HockeySDK-tvOS
  147. patch -p1 < ../../patches/hockey/hockey.patch
  148. cd ..
  149. rm HockeySDK-tvOS.zip?dl=0
  150. rm -rf __MACOSX
  151. fi
  152. if ! [ -e OneDrive ]; then
  153. git clone git://github.com/liveservices/LiveSDK-for-iOS.git OneDrive
  154. cd OneDrive && git am ../../patches/onedrive/*.patch && cd ..
  155. else
  156. cd OneDrive && git pull --rebase && cd ..
  157. fi
  158. fi
  159. spopd #ImportedSources
  160. #
  161. # Build time
  162. #
  163. info "Building"
  164. spushd ImportedSources
  165. spushd VLCKit
  166. echo `pwd`
  167. args=""
  168. if [ "$VERBOSE" = "yes" ]; then
  169. args="${args} -v"
  170. fi
  171. if [ "$NONETWORK" = "yes" ]; then
  172. args="${args} -n"
  173. fi
  174. if [ "$SKIPLIBVLCCOMPILATION" = "yes" ]; then
  175. args="${args} -l"
  176. fi
  177. if [ "$TVOS" = "yes" ]; then
  178. args="${args} -t"
  179. fi
  180. ./buildMobileVLCKit.sh ${args} -k "${SDK}"
  181. spopd
  182. spopd # ImportedSources
  183. #install pods
  184. info "installing pods"
  185. pod install
  186. info "Build completed"