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.

158 lines
7.0KB

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