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.

build.sh 7.0KB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
6 years ago
10 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. #!/bin/bash
  2. # ------------------------------------------------------------------------------------
  3. # stop on error
  4. set -e
  5. # ------------------------------------------------------------------------------------
  6. # cd to correct path
  7. if [ ! -f Makefile ]; then
  8. cd ../..
  9. fi
  10. # ---------------------------------------------------------------------------------------------------------------------
  11. # set variables
  12. source data/macos/common.env
  13. export MACOS="true"
  14. if [ $(clang -v 2>&1 | sed -n 's/.*version \([0-9]\).*/\1/p') -lt 9 ]; then
  15. export MACOS_OLD="true"
  16. fi
  17. export CC=clang
  18. export CXX=clang++
  19. unset CPPFLAGS
  20. ##############################################################################################
  21. # Complete 64bit build
  22. export CFLAGS="-I${TARGETDIR}/carla64/include -m64"
  23. export CXXFLAGS="${CFLAGS}"
  24. export LDFLAGS="-L${TARGETDIR}/carla64/lib -m64"
  25. export PATH=${TARGETDIR}/carla/bin:${TARGETDIR}/carla64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  26. export PKG_CONFIG_PATH=${TARGETDIR}/carla/lib/pkgconfig:${TARGETDIR}/carla64/lib/pkgconfig
  27. make ${MAKE_ARGS}
  28. ##############################################################################################
  29. # Build 32bit bridges
  30. export CFLAGS="-I${TARGETDIR}/carla32/include -m32"
  31. export CXXFLAGS="${CFLAGS}"
  32. export LDFLAGS="-L${TARGETDIR}/carla32/lib -m32"
  33. export PATH=${TARGETDIR}/carla32/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  34. export PKG_CONFIG_PATH=${TARGETDIR}/carla32/lib/pkgconfig
  35. make posix32 ${MAKE_ARGS}
  36. ##############################################################################################
  37. # Build Mac App
  38. export PATH=${TARGETDIR}/carla/bin:${TARGETDIR}/carla64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  39. export PYTHONPATH=$(pwd)/source
  40. unset CFLAGS
  41. unset CXXFLAGS
  42. unset LDLAGS
  43. unset PKG_CONFIG_PATH
  44. rm -rf ./build/Carla
  45. rm -rf ./build/CarlaControl
  46. rm -rf ./build/Carla.app
  47. rm -rf ./build/CarlaControl.app
  48. rm -rf ./build/exe.*
  49. rm -rf ./build/*.lv2
  50. cp ./source/carla ./source/Carla.pyw
  51. cp ./source/carla-control ./source/Carla-Control.pyw
  52. cp ./bin/resources/carla-plugin ./source/carla-plugin.pyw
  53. cp ./bin/resources/bigmeter-ui ./source/bigmeter-ui.pyw
  54. cp ./bin/resources/midipattern-ui ./source/midipattern-ui.pyw
  55. cp ./bin/resources/notes-ui ./source/notes-ui.pyw
  56. env SCRIPT_NAME=Carla python3 ./data/macos/bundle.py bdist_mac --bundle-name=Carla
  57. env SCRIPT_NAME=Carla-Control python3 ./data/macos/bundle.py bdist_mac --bundle-name=Carla-Control
  58. env SCRIPT_NAME=carla-plugin python3 ./data/macos/bundle.py bdist_mac --bundle-name=carla-plugin
  59. env SCRIPT_NAME=bigmeter-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=bigmeter-ui
  60. env SCRIPT_NAME=midipattern-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=midipattern-ui
  61. env SCRIPT_NAME=notes-ui python3 ./data/macos/bundle.py bdist_mac --bundle-name=notes-ui
  62. rm ./source/*.pyw
  63. mkdir -p build/Carla.app/Contents/MacOS/resources
  64. mkdir -p build/Carla.app/Contents/MacOS/styles
  65. mkdir -p build/Carla-Control.app/Contents/MacOS/styles
  66. cp bin/*.dylib build/Carla.app/Contents/MacOS/
  67. cp bin/carla-bridge-* build/Carla.app/Contents/MacOS/
  68. cp bin/carla-discovery-* build/Carla.app/Contents/MacOS/
  69. cp -LR bin/resources/* build/Carla.app/Contents/MacOS/resources/
  70. cp bin/styles/* build/Carla.app/Contents/MacOS/styles/
  71. cp bin/*utils.dylib build/Carla-Control.app/Contents/MacOS/
  72. cp bin/styles/* build/Carla-Control.app/Contents/MacOS/styles/
  73. rm -f build/Carla.app/Contents/MacOS/carla-bridge-lv2-qt5
  74. find build/ -type f -name "*.py" -delete
  75. rm build/Carla.app/Contents/MacOS/resources/carla-plugin
  76. rm build/Carla.app/Contents/MacOS/resources/carla-plugin-patchbay
  77. rm build/Carla.app/Contents/MacOS/resources/*-ui
  78. rm -rf build/Carla.app/Contents/MacOS/resources/__pycache__
  79. rm -rf build/Carla.app/Contents/MacOS/resources/at1
  80. rm -rf build/Carla.app/Contents/MacOS/resources/bls1
  81. rm -rf build/Carla.app/Contents/MacOS/resources/rev1
  82. rm -rf build/Carla.app/Contents/MacOS/resources/zynaddsubfx
  83. rm -rf build/Carla-Control.app/Contents/MacOS/resources/__pycache__
  84. cd build/Carla.app/Contents/MacOS
  85. for f in `find . | grep -e Qt -e libq -e carlastyle.dylib`; do
  86. install_name_tool -change "@rpath/QtCore.framework/Versions/5/QtCore" @executable_path/QtCore $f
  87. install_name_tool -change "@rpath/QtGui.framework/Versions/5/QtGui" @executable_path/QtGui $f
  88. install_name_tool -change "@rpath/QtOpenGL.framework/Versions/5/QtOpenGL" @executable_path/QtOpenGL $f
  89. install_name_tool -change "@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport" @executable_path/QtPrintSupport $f
  90. install_name_tool -change "@rpath/QtSvg.framework/Versions/5/QtSvg" @executable_path/QtSvg $f
  91. install_name_tool -change "@rpath/QtWidgets.framework/Versions/5/QtWidgets" @executable_path/QtWidgets $f
  92. done
  93. cd ../../../..
  94. cd build/Carla-Control.app/Contents/MacOS
  95. for f in `find . | grep -e Qt -e libq -e carlastyle.dylib`; do
  96. install_name_tool -change "@rpath/QtCore.framework/Versions/5/QtCore" @executable_path/QtCore $f
  97. install_name_tool -change "@rpath/QtGui.framework/Versions/5/QtGui" @executable_path/QtGui $f
  98. install_name_tool -change "@rpath/QtOpenGL.framework/Versions/5/QtOpenGL" @executable_path/QtOpenGL $f
  99. install_name_tool -change "@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport" @executable_path/QtPrintSupport $f
  100. install_name_tool -change "@rpath/QtSvg.framework/Versions/5/QtSvg" @executable_path/QtSvg $f
  101. install_name_tool -change "@rpath/QtWidgets.framework/Versions/5/QtWidgets" @executable_path/QtWidgets $f
  102. done
  103. cd ../../../..
  104. cp build/carla-plugin.app/Contents/MacOS/carla-plugin build/Carla.app/Contents/MacOS/resources/
  105. cp build/carla-plugin.app/Contents/MacOS/fcntl.so build/Carla.app/Contents/MacOS/resources/ 2>/dev/null || true
  106. cp build/bigmeter-ui.app/Contents/MacOS/bigmeter-ui build/Carla.app/Contents/MacOS/resources/
  107. cp build/midipattern-ui.app/Contents/MacOS/midipattern-ui build/Carla.app/Contents/MacOS/resources/
  108. cp build/notes-ui.app/Contents/MacOS/notes-ui build/Carla.app/Contents/MacOS/resources/
  109. rm -rf build/carla-plugin.app build/bigmeter-ui.app build/midipattern-ui.app build/notes-ui.app
  110. cd build/Carla.app/Contents/MacOS/resources/
  111. ln -sf ../*.so* ../Qt* ../imageformats ../platforms .
  112. ln -sf carla-plugin carla-plugin-patchbay
  113. cd ../../../../..
  114. mkdir build/carla.lv2
  115. mkdir build/carla.lv2/resources
  116. mkdir build/carla.lv2/styles
  117. cp bin/carla.lv2/*.* build/carla.lv2/
  118. cp bin/carla-bridge-* build/carla.lv2/
  119. cp bin/carla-discovery-* build/carla.lv2/
  120. cp bin/libcarla_utils.dylib build/carla.lv2/
  121. rm -f build/carla.lv2/carla-bridge-lv2-qt5
  122. cp -LR build/Carla.app/Contents/MacOS/resources/* build/carla.lv2/resources/
  123. cp build/Carla.app/Contents/MacOS/styles/* build/carla.lv2/styles/
  124. ##############################################################################################