compileVLCforiOS.sh 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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 LXReorderableCollectionViewFlowLayout ]; then
  109. git clone git://github.com/fkuehne/LXReorderableCollectionViewFlowLayout.git
  110. else
  111. cd LXReorderableCollectionViewFlowLayout && git pull --rebase && cd ..
  112. fi
  113. if ! [ -e WhiteRaccoon ]; then
  114. git clone git://github.com/fkuehne/WhiteRaccoon.git
  115. else
  116. cd WhiteRaccoon && git pull --rebase && cd ..
  117. fi
  118. if ! [ -e Dropbox ]; then
  119. DROPBOXSDKVERSION=1.3.13
  120. curl -L -O https://www.dropbox.com/static/developers/dropbox-ios-sdk-${DROPBOXSDKVERSION}.zip
  121. unzip -q dropbox-ios-sdk-${DROPBOXSDKVERSION}.zip
  122. mv dropbox-ios-sdk-${DROPBOXSDKVERSION} Dropbox
  123. cd Dropbox
  124. patch -p1 < ../../patches/dropbox/DropboxTV.patch
  125. cd ..
  126. rm dropbox-ios-sdk-${DROPBOXSDKVERSION}.zip
  127. rm -rf __MACOSX
  128. fi
  129. if ! [ -e HockeySDK-tvOS ]; then
  130. curl -L -O https://www.dropbox.com/s/pie0xxmf6xmj6wl/HockeySDK-tvOS.zip?dl=0
  131. unzip -q HockeySDK-tvOS.zip?dl=0
  132. cd HockeySDK-tvOS
  133. patch -p1 < ../../patches/hockey/hockey.patch
  134. cd ..
  135. rm HockeySDK-tvOS.zip?dl=0
  136. rm -rf __MACOSX
  137. fi
  138. if ! [ -e OneDrive ]; then
  139. git clone git://github.com/liveservices/LiveSDK-for-iOS.git OneDrive
  140. cd OneDrive && git am ../../patches/onedrive/*.patch && cd ..
  141. else
  142. cd OneDrive && git pull --rebase && cd ..
  143. fi
  144. fi
  145. spopd #ImportedSources
  146. #
  147. # Build time
  148. #
  149. info "Building"
  150. spushd ImportedSources
  151. spushd VLCKit
  152. echo `pwd`
  153. args=""
  154. if [ "$VERBOSE" = "yes" ]; then
  155. args="${args} -v"
  156. fi
  157. if [ "$NONETWORK" = "yes" ]; then
  158. args="${args} -n"
  159. fi
  160. if [ "$SKIPLIBVLCCOMPILATION" = "yes" ]; then
  161. args="${args} -l"
  162. fi
  163. if [ "$TVOS" = "yes" ]; then
  164. args="${args} -t"
  165. fi
  166. ./buildMobileVLCKit.sh ${args} -k "${SDK}"
  167. spopd
  168. spopd # ImportedSources
  169. #install pods
  170. info "installing pods"
  171. pod install
  172. info "Build completed"