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.

112 lines
4.1KB

  1. #!/bin/bash
  2. set -e
  3. JOBS="-j 2"
  4. if [ ! -f Makefile ]; then
  5. cd ../..
  6. fi
  7. export MACOS="true"
  8. export CC=clang
  9. export CXX=clang++
  10. export CXFREEZE="/opt/carla/bin/cxfreeze --include-modules=re,sip,subprocess,inspect"
  11. export DEFAULT_QT=5
  12. export PYUIC5=/opt/carla/bin/pyuic5
  13. unset CPPFLAGS
  14. ##############################################################################################
  15. # Complete 64bit build
  16. export CFLAGS=-m64
  17. export CXXFLAGS=-m64
  18. export LDLAGS=-m64
  19. export PATH=/opt/carla/bin:/opt/carla64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  20. export PKG_CONFIG_PATH=/opt/carla/lib/pkgconfig:/opt/carla64/lib/pkgconfig
  21. make clean
  22. make $JOBS
  23. ##############################################################################################
  24. # Build 32bit bridges
  25. export CFLAGS=-m32
  26. export CXXFLAGS=-m32
  27. export LDLAGS=-m32
  28. export PATH=/opt/carla32/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  29. export PKG_CONFIG_PATH=/opt/carla32/lib/pkgconfig
  30. make posix32 $JOBS
  31. ##############################################################################################
  32. # Build Mac App
  33. export PATH=/opt/carla/bin:/opt/carla64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  34. export PYTHONPATH=`pwd`/source
  35. unset CFLAGS
  36. unset CXXFLAGS
  37. unset LDLAGS
  38. unset PKG_CONFIG_PATH
  39. rm -rf ./build
  40. rm -rf ./build-lv2
  41. rm -f bin/carla-bridge-lv2-qt5 bin/carla.lv2/carla-bridge-lv2-qt5
  42. mkdir build
  43. cp ./source/carla ./source/Carla.pyw
  44. cp ./bin/resources/carla-plugin ./source/carla-plugin.pyw
  45. cp ./bin/resources/bigmeter-ui ./source/bigmeter-ui.pyw
  46. cp ./bin/resources/notes-ui ./source/notes-ui.pyw
  47. env SCRIPT_NAME=Carla python3 ./data/macos/bundle.py bdist_mac --bundle-name=Carla
  48. env SCRIPT_NAME=carla-plugin python3 ./data/macos/bundle.py bdist_mac --bundle-name=carla-plugin
  49. env SCRIPT_NAME=bigmeter-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=bigmeter-ui
  50. env SCRIPT_NAME=notes-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=notes-ui
  51. rm ./source/*.pyw
  52. mkdir -p build/Carla.app/Contents/MacOS/resources
  53. mkdir -p build/Carla.app/Contents/MacOS/styles
  54. cp bin/*.dylib build/Carla.app/Contents/MacOS/
  55. cp bin/carla-bridge-* build/Carla.app/Contents/MacOS/
  56. cp bin/carla-discovery-* build/Carla.app/Contents/MacOS/
  57. cp -LR bin/resources/* build/Carla.app/Contents/MacOS/resources/
  58. cp bin/styles/* build/Carla.app/Contents/MacOS/styles/
  59. find build/ -type f -name "*.py" -delete
  60. rm build/Carla.app/Contents/MacOS/resources/carla-plugin
  61. rm build/Carla.app/Contents/MacOS/resources/*-ui
  62. rm -rf build/Carla.app/Contents/MacOS/resources/__pycache__
  63. cd build/Carla.app/Contents/MacOS/resources/
  64. ln -sf ../*.so* ../Qt* ../imageformats ../platforms .
  65. cd ../../../../..
  66. cd build/Carla.app/Contents/MacOS/styles
  67. install_name_tool -change "/opt/carla/lib/QtCore.framework/Versions/5/QtCore" @executable_path/QtCore carlastyle.dylib
  68. install_name_tool -change "/opt/carla/lib/QtGui.framework/Versions/5/QtGui" @executable_path/QtGui carlastyle.dylib
  69. install_name_tool -change "/opt/carla/lib/QtWidgets.framework/Versions/5/QtWidgets" @executable_path/QtWidgets carlastyle.dylib
  70. cd ../../../../..
  71. cp build/carla-plugin.app/Contents/MacOS/carla-plugin build/Carla.app/Contents/MacOS/resources/
  72. cp build/carla-plugin.app/Contents/MacOS/fcntl.so build/Carla.app/Contents/MacOS/resources/
  73. cp build/bigmeter-ui.app/Contents/MacOS/bigmeter-ui build/Carla.app/Contents/MacOS/resources/
  74. cp build/notes-ui.app/Contents/MacOS/notes-ui build/Carla.app/Contents/MacOS/resources/
  75. rm -rf build/carla-plugin.app build/bigmeter-ui.app build/notes-ui.app
  76. mkdir build-lv2
  77. mkdir build-lv2/carla.lv2
  78. mkdir build-lv2/carla.lv2/resources
  79. mkdir build-lv2/carla.lv2/styles
  80. cp bin/carla.lv2/*.* build-lv2/carla.lv2/
  81. cp bin/carla-bridge-* build-lv2/carla.lv2/
  82. cp bin/carla-discovery-* build-lv2/carla.lv2/
  83. cp -LR build/Carla.app/Contents/MacOS/resources/* build-lv2/carla.lv2/resources/
  84. cp build/Carla.app/Contents/MacOS/styles/* build-lv2/carla.lv2/styles/
  85. ##############################################################################################