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.

115 lines
3.9KB

  1. #!/bin/bash
  2. set -e
  3. MINGW=i686-w64-mingw32
  4. MINGW_PATH=/opt/mingw32
  5. JOBS="-j 2"
  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_LIBS1="-lglib-2.0 -lgthread-2.0 -lgig -lsndfile -lFLAC -lvorbisenc -lvorbis -logg -ldsound -lole32 -lrpcrt4 -lws2_32"
  22. export EXTRA_LIBS2="$MINGW_PATH/lib/qt4/plugins/imageformats/libqsvg.a"
  23. export WINEARCH=win32
  24. export WINEPREFIX=~/.winepy3
  25. export PYTHON_EXE="C:\\\\Python33\\\\python.exe"
  26. export CXFREEZE="wine $PYTHON_EXE C:\\\\Python33\\\\Scripts\\\\cxfreeze"
  27. export PYUIC="wine $PYTHON_EXE C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\uic\\\\pyuic.py"
  28. export PYRCC="wine C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\pyrcc4.exe -py3"
  29. # Clean build
  30. make clean
  31. # Build PyQt4 resources
  32. make $JOBS UI RES WIDGETS
  33. # Build discovery
  34. make $JOBS discovery EXTRA_LIBS="$EXTRA_LIBS1"
  35. mv source/discovery/carla-discovery-native.exe source/discovery/carla-discovery-win32.exe
  36. # Build backend
  37. make $JOBS backend EXTRA_LIBS="$EXTRA_LIBS1 $EXTRA_LIBS2"
  38. # Build Plugin bridges
  39. # make $JOBS bridges EXTRA_LIBS="$EXTRA_LIBS1 $EXTRA_LIBS2"
  40. # Build UI bridges
  41. make $JOBS -C source/bridges ui_lv2-win32 ui_vst-hwnd EXTRA_LIBS="$EXTRA_LIBS2"
  42. rm -rf ./data/windows/Carla
  43. cp ./source/carla.py ./source/carla.pyw
  44. $CXFREEZE --target-dir=".\\data\\windows\\Carla" ".\\source\\carla.pyw"
  45. rm -f ./source/carla.pyw
  46. rm -rf ./data/windows/CarlaControl
  47. cp ./source/carla_control.py ./source/carla_control.pyw
  48. $CXFREEZE --target-dir=".\\data\\windows\\CarlaControl" ".\\source\\carla_control.pyw"
  49. rm -f ./source/carla_control.pyw
  50. cd data/windows
  51. mkdir Carla/backend
  52. mkdir Carla/bridges
  53. mkdir Carla/discovery
  54. cp ../../source/backend/*.dll Carla/backend/
  55. cp ../../source/discovery/*.exe Carla/discovery/
  56. mv CarlaControl/carla_control.exe CarlaControl/CarlaControl.exe
  57. cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll Carla/
  58. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll Carla/
  59. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll Carla/
  60. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtOpenGL4.dll Carla/
  61. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtSvg4.dll Carla/
  62. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtXml4.dll Carla/
  63. cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ Carla/
  64. cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ Carla/
  65. cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll CarlaControl/
  66. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll CarlaControl/
  67. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll CarlaControl/
  68. cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ CarlaControl/
  69. cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ CarlaControl/
  70. # Build unzipfx
  71. make -C unzipfx-carla -f Makefile.win32
  72. make -C unzipfx-carla-control -f Makefile.win32
  73. # Create static build
  74. rm -f Carla.zip CarlaControl.zip
  75. zip -r -9 Carla.zip Carla
  76. zip -r -9 CarlaControl.zip CarlaControl
  77. rm -f Carla.exe CarlaControl.exe
  78. cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe
  79. cat unzipfx-carla-control/unzipfx2cat.exe CarlaControl.zip > CarlaControl.exe
  80. chmod +x Carla.exe
  81. chmod +x CarlaControl.exe
  82. # Cleanup
  83. make -C unzipfx-carla -f Makefile.win32 clean
  84. make -C unzipfx-carla-control -f Makefile.win32 clean
  85. rm -f Carla.zip CarlaControl.zip
  86. rm -f unzipfx-*/*.exe
  87. # Testing:
  88. echo "export WINEPREFIX=~/.winepy3"
  89. echo "wine $PYTHON_EXE ../../source/carla.py"