build.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/bash
  2. # Builds blender-legacy for testing
  3. #
  4. # Generated files/directories:
  5. # ./build.log
  6. # ./install.log
  7. # ./build/*
  8. # ./release/*
  9. # Define paths
  10. BUILD_PATH="$(realpath ./build)"
  11. RELEASE_PATH="$(realpath ./release)"
  12. # Create paths
  13. mkdir -p "${BUILD_PATH}"
  14. mkdir -p "${RELEASE_PATH}"
  15. # Get python version
  16. _pyver=$(python -c "from sys import version_info; print(\"%d.%d\" % (version_info[0],version_info[1]))")
  17. # CMake
  18. cmake -G "Ninja" -S "blender-2.79b" -B "${BUILD_PATH}" \
  19. -C "./blender-2.79b/build_files/cmake/config/blender_release.cmake" \
  20. -DCMAKE_INSTALL_PREFIX=/usr \
  21. -DCMAKE_BUILD_TYPE=Release \
  22. -DWITH_INSTALL_PORTABLE=OFF \
  23. -DWITH_GL_PROFILE_CORE=OFF \
  24. -DWITH_GL_PROFILE_ES20=OFF \
  25. -DWITH_SYSTEM_GLEW=ON \
  26. -DWITH_PYTHON_INSTALL=OFF \
  27. -DPYTHON_VERSION="${_pyver}" \
  28. -DWITH_LLVM=ON \
  29. -DWITH_CODEC_FFMPEG=ON \
  30. -DWITH_CYCLES=ON \
  31. -DWITH_OPENCOLLADA=ON \
  32. -DWITH_OPENCOLORIO=ON \
  33. -DWITH_OPENVDB=ON \
  34. -DWITH_OPENIMAGEIO=ON \
  35. -DWITH_GAMEENGINE=ON \
  36. -DWITH_PLAYER=ON \
  37. -DWITH_PYTHON_MODULE=OFF \
  38. -DWITH_CYCLES_OSL=NO \
  39. -DWITH_CYCLES_CUDA_BINARIES=OFF
  40. export NINJA_STATUS="[%p | %f<%r<%u | %cbps ] "
  41. set -o pipefail
  42. ninja -C "${BUILD_PATH}" 2>&1 | tee build.log;
  43. if [[ $? -eq 0 ]]; then
  44. DESTDIR="${RELEASE_PATH}" ninja -C "${BUILD_PATH}" install | tee install.log;
  45. if [[ $? -eq 0 ]]; then
  46. echo ""
  47. echo "You may want to try blender with command:"
  48. echo " BLENDER_SYSTEM_SCRIPTS=${RELEASE_PATH}/usr/2.79/scripts \\"
  49. echo " BLENDER_SYSTEM_DATAFILES=${RELEASE_PATH}/usr/2.79/datafiles \\"
  50. echo " ${RELEASE_PATH}/usr/bin/blender"
  51. fi
  52. fi
  53. set +o pipefail