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.

107 lines
3.1KB

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