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.

96 lines
2.9KB

  1. #!/bin/bash
  2. set -e
  3. MINGW=x86_64-w64-mingw32
  4. MINGW_PATH=/opt/mingw64
  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_x64
  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 CARLA_RTAUDIO_SUPPORT=true 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. cd data/windows
  43. mkdir Carla/backend
  44. mkdir Carla/bridges
  45. mkdir Carla/discovery
  46. cp ../../source/backend/*.dll Carla/backend/
  47. cp ../../source/discovery/*.exe Carla/discovery/
  48. cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll Carla/
  49. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll Carla/
  50. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll Carla/
  51. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtOpenGL4.dll Carla/
  52. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtSvg4.dll Carla/
  53. cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtXml4.dll Carla/
  54. cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ Carla/
  55. cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ Carla/
  56. rm -f pkg-config
  57. # Build unzipfx
  58. make -C unzipfx-carla -f Makefile.win32
  59. # Create static build
  60. rm -f Carla.zip
  61. zip -r -9 Carla.zip Carla
  62. rm -f Carla.exe
  63. cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe
  64. chmod +x Carla.exe
  65. # Cleanup
  66. make -C unzipfx-carla -f Makefile.win32 clean
  67. rm -f Carla.zip
  68. rm -f unzipfx-*/*.exe
  69. # Testing:
  70. echo "export WINEPREFIX=~/.winepy3_x64"
  71. echo "wine $PYTHON_EXE ../../source/carla.py"