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.

129 lines
4.1 KiB

  1. #!/bin/bash
  2. if [[ ! $2 ]] ; then
  3. echo " * Unable to install"
  4. exit 1
  5. fi
  6. TARGET=$1
  7. LUX_TAG=$2
  8. DIST=$3
  9. # Check if I have to build the stand alone version or the SDK version
  10. if echo $LUX_TAG | grep -iq 'sdk' ; then
  11. echo
  12. echo " * 安装SDK版本在 $TARGET/$LUX_TAG"
  13. rm -rf $TARGET/$LUX_TAG
  14. mkdir $TARGET/$LUX_TAG
  15. mkdir $TARGET/$LUX_TAG/bin
  16. cp $LUX_TAG/bin/luxcoreui $LUX_TAG/bin/luxcoreconsole $LUX_TAG/bin/luxcoredemo \
  17. $LUX_TAG/bin/luxcorescenedemo $TARGET/$LUX_TAG/bin
  18. mkdir $TARGET/$LUX_TAG/lib
  19. cp $LUX_TAG/lib/*.so $TARGET/$LUX_TAG/lib
  20. cp $TARGET/lib/libOpenImageDenoise.so.1 $TARGET/lib/libembree3.so.3 $TARGET/lib/libtbb.so.12 $TARGET/lib/libtbb.so.2 $TARGET/$LUX_TAG/lib
  21. cp -a $TARGET/lib/libnvrtc* $TARGET/$LUX_TAG
  22. cp $LUX_TAG/README.md $TARGET/$LUX_TAG
  23. cp $LUX_TAG/COPYING.txt $TARGET/$LUX_TAG
  24. cp $LUX_TAG/AUTHORS.txt $TARGET/$LUX_TAG
  25. cp $LUX_TAG/sdk/CMakeLists.txt $TARGET/$LUX_TAG
  26. mkdir $TARGET/$LUX_TAG/cmake
  27. mkdir $TARGET/$LUX_TAG/include
  28. mkdir $TARGET/$LUX_TAG/include/luxrays
  29. mkdir $TARGET/$LUX_TAG/include/luxrays/utils
  30. cp -r $LUX_TAG/include/luxrays/utils/cyhair $TARGET/$LUX_TAG/include/luxrays/utils
  31. cp $LUX_TAG/include/luxrays/utils/exportdefs.h $TARGET/$LUX_TAG/include/luxrays/utils
  32. cp $LUX_TAG/include/luxrays/utils/properties.h $TARGET/$LUX_TAG/include/luxrays/utils
  33. cp $LUX_TAG/include/luxrays/utils/utils.h $TARGET/$LUX_TAG/include/luxrays/utils
  34. mkdir $TARGET/$LUX_TAG/include/luxcore
  35. cp $LUX_TAG/generated/include/luxcore/cfg.h $TARGET/$LUX_TAG/include/luxcore
  36. cp $LUX_TAG/include/luxcore/luxcore.h $TARGET/$LUX_TAG/include/luxcore
  37. cp -r $LUX_TAG/samples $TARGET/$LUX_TAG
  38. cp -r $LUX_TAG/scenes $TARGET/$LUX_TAG
  39. cd $TARGET
  40. tar -cvjf ${LUX_TAG}.tar.bz2 $LUX_TAG
  41. cd ..
  42. echo
  43. else
  44. echo
  45. echo " * 安装独立版本在 $TARGET/$LUX_TAG"
  46. rm -rf $TARGET/$LUX_TAG
  47. mkdir $TARGET/$LUX_TAG
  48. # Build PyInstaller
  49. #
  50. # PyInstaller is pretty much broken on Linux: https://github.com/LuxCoreRender/LuxCore/issues/80
  51. # cd $LUX_TAG
  52. # pyinstaller samples/pyluxcoretool/pyluxcoretool.linux.spec
  53. # cd -
  54. #
  55. # cp $LUX_TAG/bin/luxcoreui $LUX_TAG/dist/pyluxcoretool $TARGET/$LUX_TAG
  56. # Workaround to PyInstaller, just run "python3 pyluxcoretools.zip"
  57. cp $LUX_TAG/lib/pyluxcoretools.zip $TARGET/$LUX_TAG
  58. cp $LUX_TAG/bin/luxcoreui $TARGET/$LUX_TAG
  59. cp $LUX_TAG/lib/*.so $TARGET/$LUX_TAG
  60. cp $TARGET/lib/libOpenImageDenoise.so.1 $TARGET/lib/libembree3.so.3 $TARGET/lib/libtbb.so.12 $TARGET/lib/libtbb.so.2 $TARGET/$LUX_TAG
  61. cp -a $TARGET/lib/libnvrtc* $TARGET/$LUX_TAG
  62. cp $LUX_TAG/README.md $TARGET/$LUX_TAG
  63. cp $LUX_TAG/COPYING.txt $TARGET/$LUX_TAG
  64. cp $LUX_TAG/AUTHORS.txt $TARGET/$LUX_TAG
  65. mkdir -p $TARGET/$LUX_TAG/scenes/cornell
  66. cp $LUX_TAG/scenes/cornell/cornell.cfg $TARGET/$LUX_TAG/scenes/cornell
  67. cp $LUX_TAG/scenes/cornell/cornell.scn $TARGET/$LUX_TAG/scenes/cornell
  68. cp $LUX_TAG/scenes/cornell/Khaki.ply $TARGET/$LUX_TAG/scenes/cornell
  69. cp $LUX_TAG/scenes/cornell/HalveRed.ply $TARGET/$LUX_TAG/scenes/cornell
  70. cp $LUX_TAG/scenes/cornell/DarkGreen.ply $TARGET/$LUX_TAG/scenes/cornell
  71. cp $LUX_TAG/scenes/cornell/Grey.ply $TARGET/$LUX_TAG/scenes/cornell
  72. cd $TARGET
  73. tar -cvjf ${LUX_TAG}.tar.bz2 $LUX_TAG
  74. cd ..
  75. echo
  76. fi
  77. # Check if I have to pack LuxMark too
  78. if [[ -d "LuxMark" ]] ; then
  79. echo
  80. echo " * 安装LuxMark在 $TARGET/luxmark"
  81. rm -rf $TARGET/luxmark
  82. mkdir $TARGET/luxmark
  83. mkdir $TARGET/luxmark/lib
  84. cp $LUX_TAG/bin/luxcoreui $TARGET/luxmark
  85. cp $TARGET/lib/libOpenImageDenoise.so.1 $TARGET/lib/libembree3.so.3 $TARGET/lib/libtbb.so.12 $TARGET/lib/libtbb.so.2 $TARGET/luxmark/lib
  86. #cp $TARGET/qt5-v5.12.2/lib/libQt5Widgets.so $TARGET/luxmark/libQt5Widgets.so.5
  87. #cp $TARGET/qt5-v5.12.2/lib/libQt5Network.so $TARGET/luxmark/libQt5Network.so.5
  88. #cp $TARGET/qt5-v5.12.2/lib/libQt5Gui.so $TARGET/luxmark/libQt5Gui.so.5
  89. #cp $TARGET/qt5-v5.12.2/lib/libQt5Core.so $TARGET/luxmark/libQt5Core.so.5
  90. cp LuxMark/README.md $TARGET/luxmark
  91. cp LuxMark/COPYING.txt $TARGET/luxmark
  92. cp LuxMark/AUTHORS.txt $TARGET/luxmark
  93. cp LuxMark/bin/luxmark $TARGET/luxmark/luxmark.bin
  94. cp ${SHELLROOT}/installLib/luxmark.start $TARGET/luxmark/luxmark
  95. tar zxf $DIST/scenes.tgz -C $TARGET/luxmark
  96. cd $TARGET
  97. tar cvjf luxmark.tar.bz2 luxmark
  98. cd ..
  99. echo
  100. fi