compileDebugLibraries.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. fi
  109. spopd #ImportedSources
  110. #
  111. # Build time
  112. #
  113. info "Building"
  114. spushd ImportedSources
  115. spushd VLCKit
  116. echo `pwd`
  117. args=""
  118. if [ "$VERBOSE" = "yes" ]; then
  119. args="${args} -v"
  120. fi
  121. if [ "$NONETWORK" = "yes" ]; then
  122. args="${args} -n"
  123. fi
  124. if [ "$SKIPLIBVLCCOMPILATION" = "yes" ]; then
  125. args="${args} -l"
  126. fi
  127. if [ "$TVOS" = "yes" ]; then
  128. args="${args} -t"
  129. fi
  130. ./buildMobileVLCKit.sh ${args} -k "${SDK}"
  131. spopd
  132. spopd # ImportedSources
  133. #install pods
  134. info "installing pods"
  135. pod install
  136. info "Build completed"