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.5KB

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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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.1a1-macos"
  13. source data/macos/common.env
  14. export MACOS="true"
  15. if [ $(clang -v 2>&1 | grep version | cut -d' ' -f4 | cut -d'.' -f1) -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 USING_JUCE=true ${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. # FIXME install old xcode in new macos
  37. # make USING_JUCE=true posix32 ${MAKE_ARGS}
  38. ##############################################################################################
  39. # Build Mac App
  40. export PATH=${TARGETDIR}/carla/bin:${TARGETDIR}/carla64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  41. export PYTHONPATH=$(pwd)/source/frontend
  42. unset CFLAGS
  43. unset CXXFLAGS
  44. unset LDLAGS
  45. unset PKG_CONFIG_PATH
  46. rm -rf ./build/Carla
  47. rm -rf ./build/CarlaControl
  48. rm -rf ./build/Carla.app
  49. rm -rf ./build/CarlaControl.app
  50. rm -rf ./build/exe.*
  51. rm -rf ./build/*.lv2
  52. cp ./source/frontend/carla ./source/frontend/Carla.pyw
  53. cp ./source/frontend/carla-control ./source/frontend/Carla-Control.pyw
  54. cp ./bin/resources/carla-plugin ./source/frontend/carla-plugin.pyw
  55. cp ./bin/resources/bigmeter-ui ./source/frontend/bigmeter-ui.pyw
  56. cp ./bin/resources/midipattern-ui ./source/frontend/midipattern-ui.pyw
  57. cp ./bin/resources/notes-ui ./source/frontend/notes-ui.pyw
  58. env SCRIPT_NAME=Carla python3 ./data/macos/bundle.py bdist_mac --bundle-name=Carla
  59. env SCRIPT_NAME=Carla-Control python3 ./data/macos/bundle.py bdist_mac --bundle-name=Carla-Control
  60. env SCRIPT_NAME=carla-plugin python3 ./data/macos/bundle.py bdist_mac --bundle-name=carla-plugin
  61. env SCRIPT_NAME=bigmeter-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=bigmeter-ui
  62. env SCRIPT_NAME=midipattern-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=midipattern-ui
  63. env SCRIPT_NAME=notes-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=notes-ui
  64. rm ./source/frontend/*.pyw
  65. mkdir -p build/Carla.app/Contents/MacOS/resources
  66. mkdir -p build/Carla.app/Contents/MacOS/styles
  67. mkdir -p build/Carla-Control.app/Contents/MacOS/styles
  68. cp bin/*.dylib build/Carla.app/Contents/MacOS/
  69. cp bin/carla-bridge-* build/Carla.app/Contents/MacOS/
  70. cp bin/carla-discovery-* build/Carla.app/Contents/MacOS/
  71. cp -LR bin/resources/* build/Carla.app/Contents/MacOS/resources/
  72. cp bin/styles/* build/Carla.app/Contents/MacOS/styles/
  73. cp bin/*utils.dylib build/Carla-Control.app/Contents/MacOS/
  74. cp bin/styles/* build/Carla-Control.app/Contents/MacOS/styles/
  75. rm -f build/Carla.app/Contents/MacOS/carla-bridge-lv2-qt5
  76. find build/ -type f -name "*.py" -delete
  77. rm build/Carla.app/Contents/MacOS/resources/carla-plugin
  78. rm build/Carla.app/Contents/MacOS/resources/carla-plugin-patchbay
  79. rm build/Carla.app/Contents/MacOS/resources/*-ui
  80. rm -rf build/Carla.app/Contents/MacOS/resources/__pycache__
  81. rm -rf build/Carla.app/Contents/MacOS/resources/at1
  82. rm -rf build/Carla.app/Contents/MacOS/resources/bls1
  83. rm -rf build/Carla.app/Contents/MacOS/resources/rev1
  84. rm -rf build/Carla.app/Contents/MacOS/resources/zynaddsubfx
  85. rm -rf build/Carla-Control.app/Contents/MacOS/resources/__pycache__
  86. cd build/Carla.app/Contents/MacOS
  87. for f in `find . | grep -e Qt -e libq -e carlastyle.dylib`; do
  88. install_name_tool -change "@rpath/QtCore.framework/Versions/5/QtCore" @executable_path/QtCore $f
  89. install_name_tool -change "@rpath/QtGui.framework/Versions/5/QtGui" @executable_path/QtGui $f
  90. install_name_tool -change "@rpath/QtOpenGL.framework/Versions/5/QtOpenGL" @executable_path/QtOpenGL $f
  91. install_name_tool -change "@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport" @executable_path/QtPrintSupport $f
  92. install_name_tool -change "@rpath/QtSvg.framework/Versions/5/QtSvg" @executable_path/QtSvg $f
  93. install_name_tool -change "@rpath/QtWidgets.framework/Versions/5/QtWidgets" @executable_path/QtWidgets $f
  94. done
  95. cd ../../../..
  96. cd build/Carla-Control.app/Contents/MacOS
  97. for f in `find . | grep -e Qt -e libq -e carlastyle.dylib`; do
  98. install_name_tool -change "@rpath/QtCore.framework/Versions/5/QtCore" @executable_path/QtCore $f
  99. install_name_tool -change "@rpath/QtGui.framework/Versions/5/QtGui" @executable_path/QtGui $f
  100. install_name_tool -change "@rpath/QtOpenGL.framework/Versions/5/QtOpenGL" @executable_path/QtOpenGL $f
  101. install_name_tool -change "@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport" @executable_path/QtPrintSupport $f
  102. install_name_tool -change "@rpath/QtSvg.framework/Versions/5/QtSvg" @executable_path/QtSvg $f
  103. install_name_tool -change "@rpath/QtWidgets.framework/Versions/5/QtWidgets" @executable_path/QtWidgets $f
  104. done
  105. cd ../../../..
  106. cp build/carla-plugin.app/Contents/MacOS/carla-plugin build/Carla.app/Contents/MacOS/resources/
  107. cp build/carla-plugin.app/Contents/MacOS/fcntl.so build/Carla.app/Contents/MacOS/resources/ 2>/dev/null || true
  108. cp build/bigmeter-ui.app/Contents/MacOS/bigmeter-ui build/Carla.app/Contents/MacOS/resources/
  109. cp build/midipattern-ui.app/Contents/MacOS/midipattern-ui build/Carla.app/Contents/MacOS/resources/
  110. cp build/notes-ui.app/Contents/MacOS/notes-ui build/Carla.app/Contents/MacOS/resources/
  111. rm -rf build/carla-plugin.app build/bigmeter-ui.app build/midipattern-ui.app build/notes-ui.app
  112. cd build/Carla.app/Contents/MacOS/resources/
  113. ln -sf ../*.so* ../Qt* ../imageformats ../platforms .
  114. ln -sf carla-plugin carla-plugin-patchbay
  115. cd ../../../../..
  116. mkdir build/carla.lv2
  117. mkdir build/carla.lv2/resources
  118. mkdir build/carla.lv2/styles
  119. cp bin/carla.lv2/*.* build/carla.lv2/
  120. cp bin/carla-bridge-* build/carla.lv2/
  121. cp bin/carla-discovery-* build/carla.lv2/
  122. cp bin/libcarla_utils.dylib build/carla.lv2/
  123. rm -f build/carla.lv2/carla-bridge-lv2-qt5
  124. cp -LR build/Carla.app/Contents/MacOS/resources/* build/carla.lv2/resources/
  125. cp build/Carla.app/Contents/MacOS/styles/* build/carla.lv2/styles/
  126. ##############################################################################################
  127. rm -rf ${PKG_FOLDER}
  128. mkdir ${PKG_FOLDER}
  129. cp data/macos/README ${PKG_FOLDER}/
  130. mv build/carla.lv2 ${PKG_FOLDER}/
  131. mv build/Carla.app ${PKG_FOLDER}/
  132. mv build/Carla-Control.app ${PKG_FOLDER}/
  133. ##############################################################################################