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.

118 lines
3.5KB

  1. #!/bin/bash
  2. ### fluidsynth.pc:
  3. # -lglib-2.0 -lgthread-2.0 -lsndfile -lFLAC -lvorbisenc -lvorbis -logg -lm -ldsound -lwinmm -lole32 -lws2_32
  4. ### linuxsampler.pc:
  5. # -L${prefix}/lib/libgig -llinuxsampler -lgig -lsndfile -lFLAC -lvorbisenc -lvorbis -logg -lm -lrpcrt4
  6. set -e
  7. MINGW=x86_64-w64-mingw32
  8. MINGW_PATH=/opt/mingw64
  9. JOBS="-j 2"
  10. if [ ! -f Makefile ]; then
  11. cd ../..
  12. fi
  13. export WIN32=true
  14. export WIN64=true
  15. export PATH=$MINGW_PATH/bin:$MINGW_PATH/$MINGW/bin:$PATH
  16. export CC=$MINGW-gcc
  17. export CXX=$MINGW-g++
  18. export WINDRES=$MINGW-windres
  19. export CFLAGS="-DBUILDING_CARLA_FOR_WINDOWS -DPTW32_STATIC_LIB"
  20. export CXXFLAGS="$CFLAGS -DFLUIDSYNTH_NOT_A_DLL"
  21. unset CPPFLAGS
  22. unset LDFLAGS
  23. export WINEARCH=win64
  24. export WINEPREFIX=~/.winepy3_x64
  25. export PYTHON_EXE="wine C:\\\\Python34\\\\python.exe"
  26. export CXFREEZE="$PYTHON_EXE C:\\\\Python34\\\\Scripts\\\\cxfreeze"
  27. export PYUIC="$PYTHON_EXE -m PyQt5.uic.pyuic"
  28. export PYRCC="wine C:\\\\Python34\\\\Lib\\\\site-packages\\\\PyQt5\\\\pyrcc5.exe"
  29. export DEFAULT_QT=5
  30. # Clean build
  31. make clean
  32. # Build PyQt5 resources
  33. make $JOBS UI RES WIDGETS
  34. # Build discovery
  35. make $JOBS discovery
  36. rm -f bin/carla-discovery-win64.exe
  37. cp bin/carla-discovery-native.exe bin/carla-discovery-win64.exe
  38. # Build backend
  39. make $JOBS backend
  40. # Build Plugin bridges
  41. # make $JOBS bridges
  42. # Build UI bridges
  43. make $JOBS -C source/bridges-ui ui_lv2-windows
  44. export PYTHONPATH=`pwd`/source
  45. rm -rf ./data/windows/Carla
  46. cp ./source/carla ./source/Carla.pyw
  47. $PYTHON_EXE ./data/windows/app.py build_exe
  48. rm -f ./source/Carla.pyw
  49. cd data/windows/
  50. cp ../../bin/*.dll Carla/
  51. cp ../../bin/*.exe Carla/
  52. rm Carla/carla-discovery-native.exe
  53. rm -f Carla/PyQt5.Qsci.pyd Carla/PyQt5.QtNetwork.pyd Carla/PyQt5.QtSql.pyd Carla/PyQt5.QtTest.pyd
  54. cp $WINEPREFIX/drive_c/Python34/python34.dll Carla/
  55. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icudt49.dll Carla/
  56. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icuin49.dll Carla/
  57. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icuuc49.dll Carla/
  58. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libEGL.dll Carla/
  59. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libGLESv2.dll Carla/
  60. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Core.dll Carla/
  61. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Gui.dll Carla/
  62. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Widgets.dll Carla/
  63. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5OpenGL.dll Carla/
  64. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5PrintSupport.dll Carla/
  65. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Svg.dll Carla/
  66. # Build unzipfx
  67. make -C unzipfx-carla -f Makefile.win32
  68. # Create static build
  69. rm -f Carla.zip CarlaControl.zip
  70. zip -r -9 Carla.zip Carla
  71. rm -f Carla.exe CarlaControl.exe
  72. cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe
  73. chmod +x Carla.exe
  74. # Cleanup
  75. make -C unzipfx-carla -f Makefile.win32 clean
  76. make -C unzipfx-carla-control -f Makefile.win32 clean
  77. rm -f Carla.zip CarlaControl.zip
  78. rm -f unzipfx-*/*.exe
  79. rm -rf Carla-2.0beta3-win64
  80. mkdir Carla-2.0beta3-win64
  81. mkdir Carla-2.0beta3-win64/vcredist
  82. cp Carla.exe README.txt Carla-2.0beta3-win64
  83. cp ~/.cache/winetricks/vcrun2010/vcredist_x64.exe Carla-2.0beta3-win64/vcredist
  84. zip -r -9 Carla-2.0beta3-win64.zip Carla-2.0beta3-win64
  85. cd ../..
  86. # Testing:
  87. echo "export WINEPREFIX=~/.winepy3_x64"
  88. echo "$PYTHON_EXE ./source/carla -platformpluginpath \"C:\\\\Python34\\\\Lib\\\\site-packages\\\\PyQt5\\\\plugins\\\\platforms\""