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.

build-win32.sh 3.9KB

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