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.

122 lines
4.7KB

  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 CLANG="true"
  9. export MACOS="true"
  10. export CC=clang
  11. export CXX=clang++
  12. export DEFAULT_QT=5
  13. export PYUIC5=$TARGETDIR/carla/bin/pyuic5
  14. unset CPPFLAGS
  15. ##############################################################################################
  16. # Complete 64bit build
  17. export CFLAGS="-O2 -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 $JOBS
  23. ##############################################################################################
  24. # Build 32bit bridges
  25. export CFLAGS="-O2 -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 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
  65. for f in `find . | grep -e Qt -e libq -e carlastyle.dylib`; do
  66. install_name_tool -change "@rpath/QtCore.framework/Versions/5/QtCore" @executable_path/QtCore $f
  67. install_name_tool -change "@rpath/QtGui.framework/Versions/5/QtGui" @executable_path/QtGui $f
  68. install_name_tool -change "@rpath/QtOpenGL.framework/Versions/5/QtOpenGL" @executable_path/QtOpenGL $f
  69. install_name_tool -change "@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport" @executable_path/QtPrintSupport $f
  70. install_name_tool -change "@rpath/QtSvg.framework/Versions/5/QtSvg" @executable_path/QtSvg $f
  71. install_name_tool -change "@rpath/QtWidgets.framework/Versions/5/QtWidgets" @executable_path/QtWidgets $f
  72. done
  73. cd ../../../..
  74. cd build/Carla.app/Contents/MacOS/resources/
  75. ln -sf ../*.so* ../Qt* ../imageformats ../platforms .
  76. cd ../../../../..
  77. cp build/carla-plugin.app/Contents/MacOS/carla-plugin build/Carla.app/Contents/MacOS/resources/
  78. cp build/carla-plugin.app/Contents/MacOS/fcntl.so build/Carla.app/Contents/MacOS/resources/ 2>/dev/null || true
  79. cp build/bigmeter-ui.app/Contents/MacOS/bigmeter-ui build/Carla.app/Contents/MacOS/resources/
  80. cp build/notes-ui.app/Contents/MacOS/notes-ui build/Carla.app/Contents/MacOS/resources/
  81. cp bin/resources/zynaddsubfx-ui build/Carla.app/Contents/MacOS/resources/
  82. rm -rf build/carla-plugin.app build/bigmeter-ui.app build/notes-ui.app
  83. mkdir build/carla.lv2
  84. mkdir build/carla.lv2/resources
  85. mkdir build/carla.lv2/styles
  86. cp bin/carla.lv2/*.* build/carla.lv2/
  87. cp bin/carla-bridge-* build/carla.lv2/
  88. cp bin/carla-discovery-* build/carla.lv2/
  89. cp bin/libcarla_utils.dylib build/carla.lv2/
  90. rm -f build/carla.lv2/carla-bridge-lv2-modgui
  91. rm -f build/carla.lv2/carla-bridge-lv2-qt5
  92. cp -LR build/Carla.app/Contents/MacOS/resources/* build/carla.lv2/resources/
  93. cp build/Carla.app/Contents/MacOS/styles/* build/carla.lv2/styles/
  94. ##############################################################################################