You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

238 lines
5.2 KiB

  1. #!/bin/bash
  2. # 接收参数
  3. TARGET="$2"
  4. WORK="$3"
  5. STAGE=$9
  6. # 记录已经完成的编译阶段,如果上一次编译发生错误,则提前终此脚本运行
  7. function complete_stage() {
  8. local next=$1
  9. cd $SHELLROOT
  10. if [ $2 -eq 0 ]
  11. then
  12. echo -n $next > $TARGET/stage
  13. else
  14. exit 1
  15. fi
  16. sleep 2
  17. }
  18. #######################################################################################################################################################################################
  19. # 开始编译
  20. cd $SHELLROOT # 建入到 本编译脚本项目 的根目录
  21. mkdir -p tempDIR # 新建 本编译脚本项目 在运行所需要的临时工作目录
  22. echo -ne "\033]0;Preparing\007" # 检查当前编译工作已经进入哪个阶段
  23. if [ ! $STAGE ] ; then
  24. S=`cat $TARGET/stage 2>/dev/null`
  25. if [[ ! $S ]] ; then
  26. STAGE=0
  27. else
  28. STAGE=$S
  29. fi
  30. fi
  31. echo " * 使用 GCC 编译器"
  32. # # STAGE 0.1 -- zlib
  33. # NEXT=0.2
  34. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  35. # echo $BOUNDARYSTART
  36. # ${SHELLROOT}/compileing/compile-zlib.sh "$TARGET"
  37. # complete_stage $NEXT $?
  38. # echo $BOUNDARYEND
  39. # fi
  40. # # STAGE 0.2 -- bzip2
  41. # NEXT=0.3
  42. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  43. # echo $BOUNDARYSTART
  44. # ${SHELLROOT}/compileing/compile-bzip2.sh "$TARGET"
  45. # complete_stage $NEXT $?
  46. # echo $BOUNDARYEND
  47. # fi
  48. # # STAGE 0.3 -- lzma
  49. # NEXT=0.4
  50. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  51. # echo $BOUNDARYSTART
  52. # ${SHELLROOT}/compileing/compile-lzma.sh "$TARGET" "$CONFIGOPTS"
  53. # complete_stage $NEXT $?
  54. # echo $BOUNDARYEND
  55. # fi
  56. # # STAGE 1.1 -- Boost
  57. # NEXT=1.2
  58. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  59. # echo $BOUNDARYSTART
  60. # ${SHELLROOT}/compileing/compile-boost.sh "$TARGET" "$CONFIGOPTS"
  61. # complete_stage $NEXT $?
  62. # echo $BOUNDARYEND
  63. # fi
  64. # # STAGE 1.2 -- Jpeg
  65. # NEXT=1.3
  66. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  67. # echo $BOUNDARYSTART
  68. # ${SHELLROOT}/compileing/compile-Jpeg.sh "$TARGET" "$CONFIGOPTS"
  69. # complete_stage $NEXT $?
  70. # echo $BOUNDARYEND
  71. # fi
  72. # # STAGE 1.3 -- Tiff
  73. # NEXT=1.4
  74. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  75. # echo $BOUNDARYSTART
  76. # ${SHELLROOT}/compileing/compile-Tiff.sh "$TARGET" "$CONFIGOPTS"
  77. # complete_stage $NEXT $?
  78. # echo $BOUNDARYEND
  79. # fi
  80. # # STAGE 1.4 -- PNG
  81. # NEXT=1.5
  82. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  83. # echo $BOUNDARYSTART
  84. # ${SHELLROOT}/compileing/compile-PNG.sh "$TARGET" "$CONFIGOPTS"
  85. # complete_stage $NEXT $?
  86. # echo $BOUNDARYEND
  87. # fi
  88. # # STAGE 1.5 -- FreeType
  89. # NEXT=1.6
  90. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  91. # echo $BOUNDARYSTART
  92. # ${SHELLROOT}/compileing/compile-FreeType.sh "$TARGET" "$CONFIGOPTS"
  93. # complete_stage $NEXT $?
  94. # echo $BOUNDARYEND
  95. # fi
  96. # # STAGE 1.6 -- OpenEXR
  97. # NEXT=2.1
  98. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  99. # echo $BOUNDARYSTART
  100. # ${SHELLROOT}/compileing/compile-OpenEXR.sh "$TARGET" "$CONFIGOPTS"
  101. # complete_stage $NEXT $?
  102. # echo $BOUNDARYEND
  103. # fi
  104. # STAGE 2.1 -- OpenImageIO
  105. NEXT=2.2
  106. if [[ $STAGE && $STAGE < $NEXT ]] ; then
  107. echo $BOUNDARYSTART
  108. ${SHELLROOT}/compileing/compile-OpenImageIO.sh "$TARGET" "$CONFIGOPTS"
  109. complete_stage $NEXT $?
  110. echo $BOUNDARYEND
  111. fi
  112. # # STAGE 3 -- Qt
  113. # NEXT=4.1
  114. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  115. # echo $BOUNDARYSTART
  116. # ${SHELLROOT}/compileing/compile-qt.sh "$TARGET" "$CONFIGOPTS"
  117. # complete_stage $NEXT $?
  118. # echo $BOUNDARYEND
  119. # fi
  120. # # STAGE 4.1 -- Embree
  121. # NEXT=4.2
  122. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  123. # echo $BOUNDARYSTART
  124. # ${SHELLROOT}/compileing/compile-Embree.sh "$TARGET"
  125. # complete_stage $NEXT $?
  126. # echo $BOUNDARYEND
  127. # fi
  128. # # STAGE 4.2 -- Oidn
  129. # NEXT=4.3
  130. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  131. # echo $BOUNDARYSTART
  132. # ${SHELLROOT}/compileing/compile-Oidn.sh "$TARGET"
  133. # complete_stage $NEXT $?
  134. # echo $BOUNDARYEND
  135. # fi
  136. # # STAGE 4.3 -- C-blosc
  137. # NEXT=4.4
  138. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  139. # echo $BOUNDARYSTART
  140. # ${SHELLROOT}/compileing/compile-CBlosc.sh "$TARGET"
  141. # complete_stage $NEXT $?
  142. # echo $BOUNDARYEND
  143. # fi
  144. # # STAGE 4.4 -- TBB
  145. # NEXT=4.5
  146. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  147. # echo $BOUNDARYSTART
  148. # ${SHELLROOT}/compileing/compile-TBB.sh "$TARGET"
  149. # complete_stage $NEXT $?
  150. # echo $BOUNDARYEND
  151. # fi
  152. # # STAGE 4.5 -- NVRTC
  153. # NEXT=5
  154. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  155. # echo $BOUNDARYSTART
  156. # ${SHELLROOT}/compileing/compile-NVRTC.sh "$TARGET"
  157. # complete_stage $NEXT $?
  158. # echo $BOUNDARYEND
  159. # fi
  160. # # STAGE 5 -- LuxCore
  161. # NEXT=6
  162. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  163. # echo $BOUNDARYSTART
  164. # ${SHELLROOT}/compileing/compile-LuxCore.sh "$TARGET"
  165. # complete_stage $NEXT $?
  166. # echo -n "export PATH=${SHELLROOT}/LuxCore/bin:\$PATH" | sudo tee -a /etc/profile
  167. # echo -e "\n\n"
  168. # echo $BOUNDARYEND
  169. # fi
  170. # # STAGE 6 -- LuxMark
  171. # NEXT=7
  172. # if [[ $STAGE && $STAGE < $NEXT ]] ; then
  173. # echo $BOUNDARYSTART
  174. # ${SHELLROOT}/compileing/compile-LuxMark.sh
  175. # complete_stage $NEXT $?
  176. # echo $BOUNDARYEND
  177. # fi
  178. # # 编译已经完成,执行 install脚本,完成最后的安装部署
  179. # echo $BOUNDARYSTART
  180. # echo -e "\n 正在完成最后的安装部署\n"
  181. # if ! ${SHELLROOT}/utils/install "$TARGET" "LuxCore" "${SHELLROOT}/distfiles" ; then
  182. # echo " * 安装失败"
  183. # else
  184. # echo -e "\n * 安装成功 $TARGET/$LUX_TAG"
  185. # echo -e " * 恭喜你,LuxCore已经编译安装成功\n"
  186. # fi
  187. # echo $BOUNDARYEND
  188. sleep 2
  189. exit 0