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.

148 lines
6.6KB

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