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.

104 lines
2.9KB

  1. #!/bin/bash
  2. set -e
  3. MINGW=i686-w64-mingw32
  4. MINGW_PATH=/opt/mingw32
  5. JOBS="-j 8"
  6. if [ ! -f Makefile ]; then
  7. cd ../..
  8. fi
  9. export WIN32=true
  10. export PATH=$MINGW_PATH/bin:$MINGW_PATH/$MINGW/bin:$PATH
  11. export CC=$MINGW-gcc
  12. export CXX=$MINGW-g++
  13. export WINDRES=$MINGW-windres
  14. export CFLAGS=-DPTW32_STATIC_LIB
  15. export CXXFLAGS=-DPTW32_STATIC_LIB
  16. export WINEARCH=win32
  17. export WINEPREFIX=~/.winepy3_x86
  18. export PYTHON_EXE="wine C:\\\\Python34\\\\python.exe"
  19. export CXFREEZE="$PYTHON_EXE C:\\\\Python34\\\\Scripts\\\\cxfreeze"
  20. export PYUIC="$PYTHON_EXE -m PyQt5.uic.pyuic"
  21. export PYRCC="wine C:\\\\Python34\\\\Lib\\\\site-packages\\\\PyQt5\\\\pyrcc5.exe"
  22. export DEFAULT_QT=5
  23. # Clean build
  24. make clean
  25. # Build PyQt5 resources
  26. make $JOBS UI RES WIDGETS
  27. # Build discovery
  28. make $JOBS discovery
  29. mv bin/carla-discovery-native.exe bin/carla-discovery-win32.exe
  30. # Build backend
  31. make $JOBS backend
  32. # Build Plugin bridges
  33. # make $JOBS bridges
  34. # Build UI bridges
  35. # make $JOBS -C source/bridges ui_lv2-win32 ui_vst-hwnd
  36. export PYTHONPATH=`pwd`/source
  37. rm -rf ./data/windows/Carla
  38. cp ./source/carla ./source/carla.pyw
  39. $PYTHON_EXE ./data/windows/app.py build_exe
  40. rm -f ./source/carla.pyw
  41. mv build data/windows/Carla
  42. cd data/windows/
  43. cp ../../bin/*.dll Carla/
  44. cp ../../bin/*.exe Carla/
  45. mv Carla/exe.*/* Carla/
  46. rmdir Carla/exe.*
  47. rm -f Carla/PyQt5.Qsci.pyd Carla/PyQt5.QtNetwork.pyd Carla/PyQt5.QtSql.pyd Carla/PyQt5.QtTest.pyd
  48. cp $WINEPREFIX/drive_c/Python34/python34.dll Carla/
  49. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icudt49.dll Carla/
  50. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icuin49.dll Carla/
  51. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icuuc49.dll Carla/
  52. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libEGL.dll Carla/
  53. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libGLESv2.dll Carla/
  54. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Core.dll Carla/
  55. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Gui.dll Carla/
  56. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Widgets.dll Carla/
  57. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5OpenGL.dll Carla/
  58. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5PrintSupport.dll Carla/
  59. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Svg.dll Carla/
  60. # Build unzipfx
  61. make -C unzipfx-carla -f Makefile.win32
  62. # Create static build
  63. rm -f Carla.zip CarlaControl.zip
  64. zip -r -9 Carla.zip Carla
  65. rm -f Carla.exe CarlaControl.exe
  66. cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe
  67. chmod +x Carla.exe
  68. # Cleanup
  69. make -C unzipfx-carla -f Makefile.win32 clean
  70. make -C unzipfx-carla-control -f Makefile.win32 clean
  71. rm -f Carla.zip CarlaControl.zip
  72. rm -f unzipfx-*/*.exe
  73. cd ../..
  74. # Testing:
  75. echo "export WINEPREFIX=~/.winepy3_x86"
  76. echo "$PYTHON_EXE ./source/carla -platformpluginpath \"C:\\\\Python34\\\\Lib\\\\site-packages\\\\PyQt5\\\\plugins\\\\platforms\""