Audio plugin host https://kx.studio/carla
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.

build.sh 7.4KB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
6 years ago
10 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. #!/bin/bash
  2. # ------------------------------------------------------------------------------------
  3. # stop on error
  4. set -e
  5. # ------------------------------------------------------------------------------------
  6. # cd to correct path
  7. if [ ! -f Makefile ]; then
  8. cd ../..
  9. fi
  10. # ---------------------------------------------------------------------------------------------------------------------
  11. # set variables
  12. PKG_FOLDER="Carla_2.0-RC3-macos"
  13. source data/macos/common.env
  14. export MACOS="true"
  15. if [ $(clang -v 2>&1 | sed -n 's/.*version \([0-9]\).*/\1/p') -lt 9 ]; then
  16. export MACOS_OLD="true"
  17. fi
  18. export CC=clang
  19. export CXX=clang++
  20. unset CPPFLAGS
  21. ##############################################################################################
  22. # Complete 64bit build
  23. export CFLAGS="-I${TARGETDIR}/carla64/include -m64"
  24. export CXXFLAGS="${CFLAGS}"
  25. export LDFLAGS="-L${TARGETDIR}/carla64/lib -m64"
  26. export PATH=${TARGETDIR}/carla/bin:${TARGETDIR}/carla64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  27. export PKG_CONFIG_PATH=${TARGETDIR}/carla/lib/pkgconfig:${TARGETDIR}/carla64/lib/pkgconfig
  28. make ${MAKE_ARGS}
  29. ##############################################################################################
  30. # Build 32bit bridges
  31. export CFLAGS="-I${TARGETDIR}/carla32/include -m32"
  32. export CXXFLAGS="${CFLAGS}"
  33. export LDFLAGS="-L${TARGETDIR}/carla32/lib -m32"
  34. export PATH=${TARGETDIR}/carla32/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  35. export PKG_CONFIG_PATH=${TARGETDIR}/carla32/lib/pkgconfig
  36. make posix32 ${MAKE_ARGS}
  37. ##############################################################################################
  38. # Build Mac App
  39. export PATH=${TARGETDIR}/carla/bin:${TARGETDIR}/carla64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  40. export PYTHONPATH=$(pwd)/source/frontend
  41. unset CFLAGS
  42. unset CXXFLAGS
  43. unset LDLAGS
  44. unset PKG_CONFIG_PATH
  45. rm -rf ./build/Carla
  46. rm -rf ./build/CarlaControl
  47. rm -rf ./build/Carla.app
  48. rm -rf ./build/CarlaControl.app
  49. rm -rf ./build/exe.*
  50. rm -rf ./build/*.lv2
  51. cp ./source/frontend/carla ./source/frontend/Carla.pyw
  52. cp ./source/frontend/carla-control ./source/frontend/Carla-Control.pyw
  53. cp ./bin/resources/carla-plugin ./source/frontend/carla-plugin.pyw
  54. cp ./bin/resources/bigmeter-ui ./source/frontend/bigmeter-ui.pyw
  55. cp ./bin/resources/midipattern-ui ./source/frontend/midipattern-ui.pyw
  56. cp ./bin/resources/notes-ui ./source/frontend/notes-ui.pyw
  57. env SCRIPT_NAME=Carla python3 ./data/macos/bundle.py bdist_mac --bundle-name=Carla
  58. env SCRIPT_NAME=Carla-Control python3 ./data/macos/bundle.py bdist_mac --bundle-name=Carla-Control
  59. env SCRIPT_NAME=carla-plugin python3 ./data/macos/bundle.py bdist_mac --bundle-name=carla-plugin
  60. env SCRIPT_NAME=bigmeter-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=bigmeter-ui
  61. env SCRIPT_NAME=midipattern-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=midipattern-ui
  62. env SCRIPT_NAME=notes-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=notes-ui
  63. rm ./source/frontend/*.pyw
  64. mkdir -p build/Carla.app/Contents/MacOS/resources
  65. mkdir -p build/Carla.app/Contents/MacOS/styles
  66. mkdir -p build/Carla-Control.app/Contents/MacOS/styles
  67. cp bin/*.dylib build/Carla.app/Contents/MacOS/
  68. cp bin/carla-bridge-* build/Carla.app/Contents/MacOS/
  69. cp bin/carla-discovery-* build/Carla.app/Contents/MacOS/
  70. cp -LR bin/resources/* build/Carla.app/Contents/MacOS/resources/
  71. cp bin/styles/* build/Carla.app/Contents/MacOS/styles/
  72. cp bin/*utils.dylib build/Carla-Control.app/Contents/MacOS/
  73. cp bin/styles/* build/Carla-Control.app/Contents/MacOS/styles/
  74. rm -f build/Carla.app/Contents/MacOS/carla-bridge-lv2-qt5
  75. find build/ -type f -name "*.py" -delete
  76. rm build/Carla.app/Contents/MacOS/resources/carla-plugin
  77. rm build/Carla.app/Contents/MacOS/resources/carla-plugin-patchbay
  78. rm build/Carla.app/Contents/MacOS/resources/*-ui
  79. rm -rf build/Carla.app/Contents/MacOS/resources/__pycache__
  80. rm -rf build/Carla.app/Contents/MacOS/resources/at1
  81. rm -rf build/Carla.app/Contents/MacOS/resources/bls1
  82. rm -rf build/Carla.app/Contents/MacOS/resources/rev1
  83. rm -rf build/Carla.app/Contents/MacOS/resources/zynaddsubfx
  84. rm -rf build/Carla-Control.app/Contents/MacOS/resources/__pycache__
  85. cd build/Carla.app/Contents/MacOS
  86. for f in `find . | grep -e Qt -e libq -e carlastyle.dylib`; do
  87. install_name_tool -change "@rpath/QtCore.framework/Versions/5/QtCore" @executable_path/QtCore $f
  88. install_name_tool -change "@rpath/QtGui.framework/Versions/5/QtGui" @executable_path/QtGui $f
  89. install_name_tool -change "@rpath/QtOpenGL.framework/Versions/5/QtOpenGL" @executable_path/QtOpenGL $f
  90. install_name_tool -change "@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport" @executable_path/QtPrintSupport $f
  91. install_name_tool -change "@rpath/QtSvg.framework/Versions/5/QtSvg" @executable_path/QtSvg $f
  92. install_name_tool -change "@rpath/QtWidgets.framework/Versions/5/QtWidgets" @executable_path/QtWidgets $f
  93. done
  94. cd ../../../..
  95. cd build/Carla-Control.app/Contents/MacOS
  96. for f in `find . | grep -e Qt -e libq -e carlastyle.dylib`; do
  97. install_name_tool -change "@rpath/QtCore.framework/Versions/5/QtCore" @executable_path/QtCore $f
  98. install_name_tool -change "@rpath/QtGui.framework/Versions/5/QtGui" @executable_path/QtGui $f
  99. install_name_tool -change "@rpath/QtOpenGL.framework/Versions/5/QtOpenGL" @executable_path/QtOpenGL $f
  100. install_name_tool -change "@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport" @executable_path/QtPrintSupport $f
  101. install_name_tool -change "@rpath/QtSvg.framework/Versions/5/QtSvg" @executable_path/QtSvg $f
  102. install_name_tool -change "@rpath/QtWidgets.framework/Versions/5/QtWidgets" @executable_path/QtWidgets $f
  103. done
  104. cd ../../../..
  105. cp build/carla-plugin.app/Contents/MacOS/carla-plugin build/Carla.app/Contents/MacOS/resources/
  106. cp build/carla-plugin.app/Contents/MacOS/fcntl.so build/Carla.app/Contents/MacOS/resources/ 2>/dev/null || true
  107. cp build/bigmeter-ui.app/Contents/MacOS/bigmeter-ui build/Carla.app/Contents/MacOS/resources/
  108. cp build/midipattern-ui.app/Contents/MacOS/midipattern-ui build/Carla.app/Contents/MacOS/resources/
  109. cp build/notes-ui.app/Contents/MacOS/notes-ui build/Carla.app/Contents/MacOS/resources/
  110. rm -rf build/carla-plugin.app build/bigmeter-ui.app build/midipattern-ui.app build/notes-ui.app
  111. cd build/Carla.app/Contents/MacOS/resources/
  112. ln -sf ../*.so* ../Qt* ../imageformats ../platforms .
  113. ln -sf carla-plugin carla-plugin-patchbay
  114. cd ../../../../..
  115. mkdir build/carla.lv2
  116. mkdir build/carla.lv2/resources
  117. mkdir build/carla.lv2/styles
  118. cp bin/carla.lv2/*.* build/carla.lv2/
  119. cp bin/carla-bridge-* build/carla.lv2/
  120. cp bin/carla-discovery-* build/carla.lv2/
  121. cp bin/libcarla_utils.dylib build/carla.lv2/
  122. rm -f build/carla.lv2/carla-bridge-lv2-qt5
  123. cp -LR build/Carla.app/Contents/MacOS/resources/* build/carla.lv2/resources/
  124. cp build/Carla.app/Contents/MacOS/styles/* build/carla.lv2/styles/
  125. ##############################################################################################
  126. rm -rf ${PKG_FOLDER}
  127. mkdir ${PKG_FOLDER}
  128. cp data/macos/README ${PKG_FOLDER}/
  129. mv build/carla.lv2 ${PKG_FOLDER}/
  130. mv build/Carla.app ${PKG_FOLDER}/
  131. mv build/Carla-Control.app ${PKG_FOLDER}/
  132. ##############################################################################################