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.

108 lines
4.0KB

  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. ##############################################################################################
  12. # Complete 64bit build
  13. export CFLAGS=-m64
  14. export CXXFLAGS=-m64
  15. export LDLAGS=-m64
  16. export PATH=/opt/carla/bin:/opt/carla64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  17. export PKG_CONFIG_PATH=/opt/carla/lib/pkgconfig:/opt/carla64/lib/pkgconfig
  18. make clean
  19. make $JOBS
  20. ##############################################################################################
  21. # Build 32bit bridges
  22. export CFLAGS=-m32
  23. export CXXFLAGS=-m32
  24. export LDLAGS=-m32
  25. export PATH=/opt/carla32/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  26. export PKG_CONFIG_PATH=/opt/carla32/lib/pkgconfig
  27. make posix32 $JOBS
  28. ##############################################################################################
  29. # Build Mac App
  30. export PATH=/opt/carla/bin:/opt/carla64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  31. export PYTHONPATH=`pwd`/source
  32. unset CFLAGS
  33. unset CXXFLAGS
  34. unset LDLAGS
  35. unset PKG_CONFIG_PATH
  36. rm -rf ./build
  37. rm -rf ./build-lv2
  38. rm -f bin/carla-bridge-lv2-qt5 bin/carla.lv2/carla-bridge-lv2-qt5
  39. mkdir build
  40. cp ./source/carla ./source/Carla.pyw
  41. cp ./bin/resources/carla-plugin ./source/carla-plugin.pyw
  42. cp ./bin/resources/bigmeter-ui ./source/bigmeter-ui.pyw
  43. cp ./bin/resources/notes-ui ./source/notes-ui.pyw
  44. env SCRIPT_NAME=Carla python3 ./data/macos/bundle.py bdist_mac --bundle-name=Carla
  45. env SCRIPT_NAME=carla-plugin python3 ./data/macos/bundle.py bdist_mac --bundle-name=carla-plugin
  46. env SCRIPT_NAME=bigmeter-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=bigmeter-ui
  47. env SCRIPT_NAME=notes-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=notes-ui
  48. rm ./source/*.pyw
  49. mkdir -p build/Carla.app/Contents/MacOS/resources
  50. mkdir -p build/Carla.app/Contents/MacOS/styles
  51. cp bin/*.dylib build/Carla.app/Contents/MacOS/
  52. cp bin/carla-bridge-* build/Carla.app/Contents/MacOS/
  53. cp bin/carla-discovery-* build/Carla.app/Contents/MacOS/
  54. cp -LR bin/resources/* build/Carla.app/Contents/MacOS/resources/
  55. cp bin/styles/* build/Carla.app/Contents/MacOS/styles/
  56. find build/ -type f -name "*.py" -delete
  57. rm build/Carla.app/Contents/MacOS/resources/carla-plugin
  58. rm build/Carla.app/Contents/MacOS/resources/*-ui
  59. rm -rf build/Carla.app/Contents/MacOS/resources/__pycache__
  60. cd build/Carla.app/Contents/MacOS/resources/
  61. ln -sf ../*.so* ../Qt* ../imageformats ../platforms .
  62. cd ../../../../..
  63. cd build/Carla.app/Contents/MacOS/styles
  64. install_name_tool -change "/opt/carla/lib/QtCore.framework/Versions/5/QtCore" @executable_path/QtCore carlastyle.dylib
  65. install_name_tool -change "/opt/carla/lib/QtGui.framework/Versions/5/QtGui" @executable_path/QtGui carlastyle.dylib
  66. install_name_tool -change "/opt/carla/lib/QtWidgets.framework/Versions/5/QtWidgets" @executable_path/QtWidgets carlastyle.dylib
  67. cd ../../../../..
  68. cp build/carla-plugin.app/Contents/MacOS/carla-plugin build/Carla.app/Contents/MacOS/resources/
  69. cp build/carla-plugin.app/Contents/MacOS/fcntl.so build/Carla.app/Contents/MacOS/resources/
  70. cp build/bigmeter-ui.app/Contents/MacOS/bigmeter-ui build/Carla.app/Contents/MacOS/resources/
  71. cp build/notes-ui.app/Contents/MacOS/notes-ui build/Carla.app/Contents/MacOS/resources/
  72. rm -rf build/carla-plugin.app build/bigmeter-ui.app build/notes-ui.app
  73. mkdir build-lv2
  74. mkdir build-lv2/carla.lv2
  75. mkdir build-lv2/carla.lv2/resources
  76. mkdir build-lv2/carla.lv2/styles
  77. cp bin/carla.lv2/*.* build-lv2/carla.lv2/
  78. cp bin/carla-bridge-* build-lv2/carla.lv2/
  79. cp bin/carla-discovery-* build-lv2/carla.lv2/
  80. cp -LR build/Carla.app/Contents/MacOS/resources/* build-lv2/carla.lv2/resources/
  81. cp build/Carla.app/Contents/MacOS/styles/* build-lv2/carla.lv2/styles/
  82. ##############################################################################################