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.

114 lines
3.8KB

  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_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
  24. export PYTHON_EXE="C:\\\\Python33\\\\python.exe"
  25. export CXFREEZE="wine $PYTHON_EXE C:\\\\Python33\\\\Scripts\\\\cxfreeze"
  26. export PYUIC="wine $PYTHON_EXE C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\uic\\\\pyuic.py"
  27. export PYRCC="wine C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\pyrcc4.exe -py3"
  28. # Clean build
  29. make clean
  30. # Build PyQt4 resources
  31. make $JOBS UI RES WIDGETS
  32. # Build discovery
  33. make $JOBS discovery EXTRA_LIBS="$EXTRA_LIBS"
  34. mv source/discovery/carla-discovery-native.exe source/discovery/carla-discovery-win32.exe
  35. # Build backend
  36. make $JOBS backend EXTRA_LIBS="$EXTRA_LIBS"
  37. # Build Plugin bridges
  38. # make $JOBS bridges EXTRA_LIBS="$EXTRA_LIBS"
  39. # Build UI bridges
  40. # make $JOBS -C source/bridges ui_lv2-win32 ui_vst-hwnd
  41. rm -rf ./data/windows/Carla
  42. cp ./source/carla ./source/carla.pyw
  43. $CXFREEZE --target-dir=".\\data\\windows\\Carla" ".\\source\\carla.pyw"
  44. rm -f ./source/carla.pyw
  45. # rm -rf ./data/windows/CarlaControl
  46. # cp ./source/carla_control.py ./source/carla_control.pyw
  47. # $CXFREEZE --target-dir=".\\data\\windows\\CarlaControl" ".\\source\\carla_control.pyw"
  48. # rm -f ./source/carla_control.pyw
  49. cd data/windows
  50. mkdir Carla/backend
  51. mkdir Carla/bridges
  52. mkdir Carla/discovery
  53. cp ../../source/backend/*.dll Carla/backend/
  54. cp ../../source/discovery/*.exe Carla/discovery/
  55. # mv CarlaControl/carla_control.exe CarlaControl/CarlaControl.exe
  56. cp $WINEPREFIX/drive_c/windows/system32/python33.dll Carla/
  57. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll Carla/
  58. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll Carla/
  59. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtOpenGL4.dll Carla/
  60. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtSvg4.dll Carla/
  61. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtXml4.dll Carla/
  62. cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ Carla/
  63. cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ Carla/
  64. # cp $WINEPREFIX/drive_c/windows/system32/python33.dll CarlaControl/
  65. # cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll CarlaControl/
  66. # cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll CarlaControl/
  67. # cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ CarlaControl/
  68. # cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ CarlaControl/
  69. # Build unzipfx
  70. make -C unzipfx-carla -f Makefile.win32
  71. # make -C unzipfx-carla-control -f Makefile.win32
  72. # Create static build
  73. rm -f Carla.zip CarlaControl.zip
  74. zip -r -9 Carla.zip Carla
  75. # zip -r -9 CarlaControl.zip CarlaControl
  76. rm -f Carla.exe CarlaControl.exe
  77. cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe
  78. # cat unzipfx-carla-control/unzipfx2cat.exe CarlaControl.zip > CarlaControl.exe
  79. chmod +x Carla.exe
  80. # chmod +x CarlaControl.exe
  81. # Cleanup
  82. make -C unzipfx-carla -f Makefile.win32 clean
  83. make -C unzipfx-carla-control -f Makefile.win32 clean
  84. rm -f Carla.zip CarlaControl.zip
  85. rm -f unzipfx-*/*.exe
  86. # Testing:
  87. echo "export WINEPREFIX=~/.winepy3"
  88. echo "wine $PYTHON_EXE ../../source/carla.py"