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.

137 lines
5.6KB

  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 AR=$MINGW-ar
  12. export CC=$MINGW-gcc
  13. export CXX=$MINGW-g++
  14. export MOC=$MINGW-moc
  15. export RCC=$MINGW-rcc
  16. export UIC=$MINGW-uic
  17. export STRIP=$MINGW-strip
  18. export WINDRES=$MINGW-windres
  19. export CFLAGS="-DPTW32_STATIC_LIB -I$MINGW_PATH/include"
  20. export CXXFLAGS="-DPTW32_STATIC_LIB -DFLUIDSYNTH_NOT_A_DLL -I$MINGW_PATH/include"
  21. export EXTRA_LIBS="-lglib-2.0 -lgthread-2.0 -lgig -lsndfile -lFLAC -lvorbisenc -lvorbis -logg -ldsound -lole32 -lrpcrt4 -lws2_32 -lwinmm"
  22. export WINEARCH=win32
  23. export WINEPREFIX=~/.winepy3_x86
  24. export PYTHON_EXE="C:\\\\Python33\\\\python.exe"
  25. export CXFREEZE="wine $PYTHON_EXE C:\\\\Python33\\\\Scripts\\\\cxfreeze"
  26. export PYUIC="wine $PYTHON_EXE -m PyQt5.uic.pyuic"
  27. export PYRCC="wine C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt5\\\\pyrcc5.exe"
  28. # Clean build
  29. make clean
  30. # Build PyQt5 resources
  31. make source/carla_config.py
  32. sed "s/config_UseQt5 = False/config_UseQt5 = True/" -i source/carla_config.py
  33. make $JOBS UI RES WIDGETS
  34. # Build discovery
  35. make $JOBS discovery EXTRA_LIBS="$EXTRA_LIBS"
  36. mv source/discovery/carla-discovery-native.exe source/discovery/carla-discovery-win32.exe
  37. # Build backend
  38. make $JOBS backend EXTRA_LIBS="$EXTRA_LIBS"
  39. # Build Plugin bridges
  40. # make $JOBS bridges EXTRA_LIBS="$EXTRA_LIBS"
  41. # Build UI bridges
  42. # make $JOBS -C source/bridges ui_lv2-win32 ui_vst-hwnd
  43. rm -rf ./data/windows/Carla
  44. cp ./source/carla ./source/carla.pyw
  45. $CXFREEZE --include-modules=subprocess,inspect --target-dir=".\\data\\windows\\Carla" ".\\source\\carla.pyw"
  46. rm -f ./source/carla.pyw
  47. # rm -rf ./data/windows/CarlaControl
  48. # cp ./source/carla_control.py ./source/carla_control.pyw
  49. # $CXFREEZE --include-modules=subprocess,inspect --target-dir=".\\data\\windows\\CarlaControl" ".\\source\\carla_control.pyw"
  50. # rm -f ./source/carla_control.pyw
  51. cd data/windows
  52. mkdir Carla/backend
  53. mkdir Carla/bridges
  54. mkdir Carla/discovery
  55. cp ../../source/backend/*.dll Carla/backend/
  56. cp ../../source/discovery/*.exe Carla/discovery/
  57. # mv CarlaControl/carla_control.exe CarlaControl/CarlaControl.exe
  58. # rm -f Carla/imageformats/*.so
  59. cp $WINEPREFIX/drive_c/Python33/python33.dll Carla/
  60. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/libEGL.dll Carla/
  61. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/libGLESv2.dll Carla/
  62. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/icuin49.dll Carla/
  63. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/icuuc49.dll Carla/
  64. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/icudt49.dll Carla/
  65. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/Qt5Core.dll Carla/
  66. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/Qt5Gui.dll Carla/
  67. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/Qt5Widgets.dll Carla/
  68. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/Qt5OpenGL.dll Carla/
  69. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/Qt5PrintSupport.dll Carla/
  70. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/Qt5Svg.dll Carla/
  71. cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/plugins/imageformats/ Carla/
  72. cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/plugins/iconengines/ Carla/
  73. cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/plugins/platforms/ Carla/
  74. # cp $WINEPREFIX/drive_c/Python33/python33.dll CarlaControl/
  75. # cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/libEGL.dll CarlaControl/
  76. # cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/libGLESv2.dll CarlaControl/
  77. # cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/icuin49.dll CarlaControl/
  78. # cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/icuuc49.dll CarlaControl/
  79. # cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/icudt49.dll CarlaControl/
  80. # cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/Qt5Core.dll CarlaControl/
  81. # cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/Qt5Gui.dll CarlaControl/
  82. # cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/Qt5Widgets.dll CarlaControl/
  83. # cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/Qt5OpenGL.dll CarlaControl/
  84. # cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/Qt5PrintSupport.dll CarlaControl/
  85. # cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/Qt5Svg.dll CarlaControl/
  86. # cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/plugins/imageformats/ CarlaControl/
  87. # cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/plugins/iconengines/ CarlaControl/
  88. # cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt5/plugins/platforms/ CarlaControl/
  89. # Build unzipfx
  90. make -C unzipfx-carla -f Makefile.win32
  91. # make -C unzipfx-carla-control -f Makefile.win32
  92. # Create static build
  93. rm -f Carla.zip CarlaControl.zip
  94. zip -r -9 Carla.zip Carla
  95. # zip -r -9 CarlaControl.zip CarlaControl
  96. rm -f Carla.exe CarlaControl.exe
  97. cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe
  98. # cat unzipfx-carla-control/unzipfx2cat.exe CarlaControl.zip > CarlaControl.exe
  99. chmod +x Carla.exe
  100. # chmod +x CarlaControl.exe
  101. # Cleanup
  102. make -C unzipfx-carla -f Makefile.win32 clean
  103. make -C unzipfx-carla-control -f Makefile.win32 clean
  104. rm -f Carla.zip CarlaControl.zip
  105. rm -f unzipfx-*/*.exe
  106. cd ../..
  107. # Testing:
  108. echo "export WINEPREFIX=~/.winepy3_x86"
  109. echo "wine $PYTHON_EXE ./source/carla -platformpluginpath \"C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt5\\\\plugins\\\\platforms\""