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.

117 lines
4.5KB

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