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.

138 lines
5.5KB

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