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.

180 lines
7.8KB

  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.1-RC1-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. # export USING_JUCE="false"
  18. #else
  19. export USING_JUCE="true"
  20. #fi
  21. export CC=clang
  22. export CXX=clang++
  23. unset CPPFLAGS
  24. ##############################################################################################
  25. # Complete 64bit build
  26. export CFLAGS="-I${TARGETDIR}/carla64/include -m64 -mmacosx-version-min=10.8"
  27. export CXXFLAGS="${CFLAGS} -stdlib=libc++"
  28. export LDFLAGS="-L${TARGETDIR}/carla64/lib -m64 -mmacosx-version-min=10.8"
  29. export PATH=${TARGETDIR}/carla/bin:${TARGETDIR}/carla64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  30. export PKG_CONFIG_PATH=${TARGETDIR}/carla/lib/pkgconfig:${TARGETDIR}/carla64/lib/pkgconfig
  31. export MOC_QT5=moc
  32. export RCC_QT5=rcc
  33. export UIC_QT5=uic
  34. make USING_JUCE=${USING_JUCE} ${MAKE_ARGS}
  35. ##############################################################################################
  36. # Build 32bit bridges
  37. export CFLAGS="-I${TARGETDIR}/carla32/include -m32 -mmacosx-version-min=10.8"
  38. export CXXFLAGS="${CFLAGS} -stdlib=libc++"
  39. export LDFLAGS="-L${TARGETDIR}/carla32/lib -m32 -mmacosx-version-min=10.8"
  40. export PATH=${TARGETDIR}/carla32/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  41. export PKG_CONFIG_PATH=${TARGETDIR}/carla32/lib/pkgconfig
  42. # FIXME install old xcode in new macos
  43. #if [ MACOS_OLD = "true" ]; then
  44. make USING_JUCE=${USING_JUCE} posix32 ${MAKE_ARGS}
  45. #fi
  46. ##############################################################################################
  47. # Build Mac App
  48. export PATH=${TARGETDIR}/carla/bin:${TARGETDIR}/carla64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  49. export PYTHONPATH=$(pwd)/source/frontend
  50. unset CFLAGS
  51. unset CXXFLAGS
  52. unset LDLAGS
  53. unset PKG_CONFIG_PATH
  54. rm -rf ./build/Carla
  55. rm -rf ./build/CarlaControl
  56. rm -rf ./build/Carla.app
  57. rm -rf ./build/CarlaControl.app
  58. rm -rf ./build/exe.*
  59. rm -rf ./build/*.lv2
  60. cp ./source/frontend/carla ./source/frontend/Carla.pyw
  61. cp ./source/frontend/carla-control ./source/frontend/Carla-Control.pyw
  62. cp ./bin/resources/carla-plugin ./source/frontend/carla-plugin.pyw
  63. cp ./bin/resources/bigmeter-ui ./source/frontend/bigmeter-ui.pyw
  64. cp ./bin/resources/midipattern-ui ./source/frontend/midipattern-ui.pyw
  65. cp ./bin/resources/notes-ui ./source/frontend/notes-ui.pyw
  66. env SCRIPT_NAME=Carla python3 ./data/macos/bundle.py bdist_mac --bundle-name=Carla
  67. env SCRIPT_NAME=Carla-Control python3 ./data/macos/bundle.py bdist_mac --bundle-name=Carla-Control
  68. env SCRIPT_NAME=carla-plugin python3 ./data/macos/bundle.py bdist_mac --bundle-name=carla-plugin
  69. env SCRIPT_NAME=bigmeter-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=bigmeter-ui
  70. env SCRIPT_NAME=midipattern-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=midipattern-ui
  71. env SCRIPT_NAME=notes-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=notes-ui
  72. rm ./source/frontend/*.pyw
  73. mkdir -p build/Carla.app/Contents/MacOS/resources
  74. mkdir -p build/Carla.app/Contents/MacOS/styles
  75. mkdir -p build/Carla-Control.app/Contents/MacOS/styles
  76. cp bin/*.dylib build/Carla.app/Contents/MacOS/
  77. cp bin/carla-bridge-* build/Carla.app/Contents/MacOS/
  78. cp bin/carla-discovery-* build/Carla.app/Contents/MacOS/
  79. cp -LR bin/resources/* build/Carla.app/Contents/MacOS/resources/
  80. cp bin/styles/* build/Carla.app/Contents/MacOS/styles/
  81. cp bin/*utils.dylib build/Carla-Control.app/Contents/MacOS/
  82. cp bin/styles/* build/Carla-Control.app/Contents/MacOS/styles/
  83. rm -f build/Carla.app/Contents/MacOS/carla-bridge-lv2-qt5
  84. find build/ -type f -name "*.py" -delete
  85. rm build/Carla.app/Contents/MacOS/resources/carla-plugin
  86. rm build/Carla.app/Contents/MacOS/resources/carla-plugin-patchbay
  87. rm build/Carla.app/Contents/MacOS/resources/*-ui
  88. rm -rf build/Carla.app/Contents/MacOS/resources/__pycache__
  89. rm -rf build/Carla.app/Contents/MacOS/resources/at1
  90. rm -rf build/Carla.app/Contents/MacOS/resources/bls1
  91. rm -rf build/Carla.app/Contents/MacOS/resources/rev1
  92. rm -rf build/Carla.app/Contents/MacOS/resources/zynaddsubfx
  93. rm -rf build/Carla-Control.app/Contents/MacOS/resources/__pycache__
  94. cd build/Carla.app/Contents/MacOS
  95. for f in `find . | grep -e Qt -e libq -e carlastyle.dylib`; do
  96. install_name_tool -change "@rpath/QtCore.framework/Versions/5/QtCore" @executable_path/QtCore $f
  97. install_name_tool -change "@rpath/QtGui.framework/Versions/5/QtGui" @executable_path/QtGui $f
  98. install_name_tool -change "@rpath/QtOpenGL.framework/Versions/5/QtOpenGL" @executable_path/QtOpenGL $f
  99. install_name_tool -change "@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport" @executable_path/QtPrintSupport $f
  100. install_name_tool -change "@rpath/QtSvg.framework/Versions/5/QtSvg" @executable_path/QtSvg $f
  101. install_name_tool -change "@rpath/QtWidgets.framework/Versions/5/QtWidgets" @executable_path/QtWidgets $f
  102. done
  103. cd ../../../..
  104. cd build/Carla-Control.app/Contents/MacOS
  105. for f in `find . | grep -e Qt -e libq -e carlastyle.dylib`; do
  106. install_name_tool -change "@rpath/QtCore.framework/Versions/5/QtCore" @executable_path/QtCore $f
  107. install_name_tool -change "@rpath/QtGui.framework/Versions/5/QtGui" @executable_path/QtGui $f
  108. install_name_tool -change "@rpath/QtOpenGL.framework/Versions/5/QtOpenGL" @executable_path/QtOpenGL $f
  109. install_name_tool -change "@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport" @executable_path/QtPrintSupport $f
  110. install_name_tool -change "@rpath/QtSvg.framework/Versions/5/QtSvg" @executable_path/QtSvg $f
  111. install_name_tool -change "@rpath/QtWidgets.framework/Versions/5/QtWidgets" @executable_path/QtWidgets $f
  112. done
  113. cd ../../../..
  114. cp build/carla-plugin.app/Contents/MacOS/carla-plugin build/Carla.app/Contents/MacOS/resources/
  115. cp build/carla-plugin.app/Contents/MacOS/fcntl.so build/Carla.app/Contents/MacOS/resources/ 2>/dev/null || true
  116. cp build/bigmeter-ui.app/Contents/MacOS/bigmeter-ui build/Carla.app/Contents/MacOS/resources/
  117. cp build/midipattern-ui.app/Contents/MacOS/midipattern-ui build/Carla.app/Contents/MacOS/resources/
  118. cp build/notes-ui.app/Contents/MacOS/notes-ui build/Carla.app/Contents/MacOS/resources/
  119. rm -rf build/carla-plugin.app build/bigmeter-ui.app build/midipattern-ui.app build/notes-ui.app
  120. cd build/Carla.app/Contents/MacOS/resources/
  121. ln -sf ../*.so* ../Qt* ../imageformats ../platforms .
  122. ln -sf carla-plugin carla-plugin-patchbay
  123. cd ../../../../..
  124. mkdir build/carla.lv2
  125. mkdir build/carla.lv2/resources
  126. mkdir build/carla.lv2/styles
  127. cp bin/carla.lv2/*.* build/carla.lv2/
  128. cp bin/carla-bridge-* build/carla.lv2/
  129. cp bin/carla-discovery-* build/carla.lv2/
  130. cp bin/libcarla_utils.dylib build/carla.lv2/
  131. rm -f build/carla.lv2/carla-bridge-lv2-qt5
  132. cp -LR build/Carla.app/Contents/MacOS/resources/* build/carla.lv2/resources/
  133. cp build/Carla.app/Contents/MacOS/styles/* build/carla.lv2/styles/
  134. ##############################################################################################
  135. rm -rf ${PKG_FOLDER}
  136. mkdir ${PKG_FOLDER}
  137. cp data/macos/README ${PKG_FOLDER}/
  138. mv build/carla.lv2 ${PKG_FOLDER}/
  139. mv build/Carla.app ${PKG_FOLDER}/
  140. mv build/Carla-Control.app ${PKG_FOLDER}/
  141. ##############################################################################################