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.

154 lines
5.2KB

  1. #!/bin/bash
  2. # ---------------------------------------------------------------------------------------------------------------------
  3. # check input
  4. ARCH="${1}"
  5. if [ x"${ARCH}" != x"32" ] && [ x"${ARCH}" != x"64" ]; then
  6. echo "usage: $0 32|64"
  7. exit 1
  8. fi
  9. # ---------------------------------------------------------------------------------------------------------------------
  10. # stop on error
  11. set -e
  12. # ---------------------------------------------------------------------------------------------------------------------
  13. # cd to correct path
  14. if [ ! -f Makefile ]; then
  15. cd $(dirname $0)/../..
  16. fi
  17. # ---------------------------------------------------------------------------------------------------------------------
  18. # set variables
  19. source data/windows/common.env
  20. PKG_FOLDER="Carla_2.0-beta7-win${ARCH}"
  21. if [ x"${ARCH}" != x"32" ]; then
  22. CPUARCH="x86_64"
  23. else
  24. CPUARCH="i686"
  25. fi
  26. MINGW_PREFIX="${CPUARCH}-w64-mingw32"
  27. export PREFIX=${TARGETDIR}/carla-w${ARCH}
  28. export PATH=/opt/mingw${ARCH}/bin:${PREFIX}/bin/usr/sbin:/usr/bin:/sbin:/bin
  29. export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
  30. export AR=${MINGW_PREFIX}-ar
  31. export CC=${MINGW_PREFIX}-gcc
  32. export CXX=${MINGW_PREFIX}-g++
  33. export STRIP=${MINGW_PREFIX}-strip
  34. export WINDRES=${MINGW_PREFIX}-windres
  35. export CFLAGS="-DPTW32_STATIC_LIB -DFLUIDSYNTH_NOT_A_DLL"
  36. export CFLAGS="${CFLAGS} -I${PREFIX}/include -I/opt/mingw${ARCH}/include -I/opt/mingw${ARCH}/${MINGW_PREFIX}/include"
  37. export CXXFLAGS="${CFLAGS}"
  38. export LDFLAGS="-L${PREFIX}/lib -L/opt/mingw${ARCH}/lib -L/opt/mingw${ARCH}/${MINGW_PREFIX}/lib"
  39. export WIN32=true
  40. if [ x"${ARCH}" != x"32" ]; then
  41. export WIN64=true
  42. fi
  43. export WINEARCH=win${ARCH}
  44. export WINEDEBUG=-all
  45. export WINEPREFIX=~/.winepy3_x${ARCH}
  46. export PYTHON_EXE="wine C:\\\\Python34\\\\python.exe"
  47. export CXFREEZE="$PYTHON_EXE C:\\\\Python34\\\\Scripts\\\\cxfreeze"
  48. export PYUIC="$PYTHON_EXE -m PyQt5.uic.pyuic"
  49. export PYRCC="wine C:\\\\Python34\\\\Lib\\\\site-packages\\\\PyQt5\\\\pyrcc5.exe"
  50. export PYTHONPATH=`pwd`/source
  51. rm -rf ./data/windows/Carla
  52. mkdir -p ./data/windows/Carla/Debug
  53. cp ./source/carla ./source/Carla.pyw
  54. $PYTHON_EXE ./data/windows/app-console.py build_exe
  55. mv ./data/windows/Carla/carla.exe ./data/windows/Carla/Debug/Carla.exe
  56. $PYTHON_EXE ./data/windows/app-gui.py build_exe
  57. rm -f ./source/Carla.pyw
  58. cd data/windows/
  59. rm -rf dist
  60. $CXFREEZE ../../bin/resources/bigmeter-ui
  61. $CXFREEZE ../../bin/resources/midipattern-ui
  62. $CXFREEZE ../../bin/resources/notes-ui
  63. $CXFREEZE ../../bin/resources/carla-plugin
  64. $CXFREEZE ../../bin/resources/carla-plugin-patchbay
  65. cp ../../bin/*.dll Carla/
  66. cp ../../bin/*.exe Carla/
  67. rm Carla/carla-bridge-lv2-windows.exe
  68. rm Carla/carla-discovery-native.exe
  69. rm Carla/carla-lv2-export.exe
  70. rm -f Carla/PyQt5.Qsci.pyd Carla/PyQt5.QtNetwork.pyd Carla/PyQt5.QtSql.pyd Carla/PyQt5.QtTest.pyd Carla/PyQt5.QtXml.pyd
  71. rm -f dist/PyQt5.Qsci.pyd dist/PyQt5.QtNetwork.pyd dist/PyQt5.QtSql.pyd dist/PyQt5.QtTest.pyd dist/PyQt5.QtXml.pyd
  72. cp $WINEPREFIX/drive_c/Python34/python34.dll Carla/
  73. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icu*.dll Carla/
  74. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libEGL.dll Carla/
  75. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libGLESv2.dll Carla/
  76. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Core.dll Carla/
  77. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Gui.dll Carla/
  78. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Widgets.dll Carla/
  79. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5OpenGL.dll Carla/
  80. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Svg.dll Carla/
  81. mv dist Carla/resources
  82. cp $WINEPREFIX/drive_c/Python34/python34.dll Carla/resources/
  83. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icu*.dll Carla/resources/
  84. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libEGL.dll Carla/resources/
  85. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libGLESv2.dll Carla/resources/
  86. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Core.dll Carla/resources/
  87. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Gui.dll Carla/resources/
  88. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Widgets.dll Carla/resources/
  89. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5OpenGL.dll Carla/resources/
  90. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Svg.dll Carla/resources/
  91. if [ x"${CARLA_DEV}" != x"" ]; then
  92. exit 0
  93. fi
  94. # Build unzipfx
  95. make -C unzipfx-carla -f Makefile.win32 clean
  96. make -C unzipfx-carla -f Makefile.win32 ${MAKE_ARGS}
  97. # Create zip of Carla
  98. rm -f Carla.zip CarlaControl.zip
  99. zip -r -9 Carla.zip Carla
  100. # Create static build
  101. rm -f Carla.exe CarlaControl.exe
  102. cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe
  103. chmod +x Carla.exe
  104. # Cleanup
  105. rm -f Carla.zip CarlaControl.zip
  106. if [ x"${ARCH}" = x"32" ]; then
  107. VCARCH="86"
  108. else
  109. VCARCH="${ARCH}"
  110. fi
  111. # Create release zip
  112. rm -rf ${PKG_FOLDER}
  113. mkdir ${PKG_FOLDER}
  114. mkdir ${PKG_FOLDER}/vcredist
  115. cp Carla.exe README.txt ${PKG_FOLDER}
  116. cp ~/.cache/winetricks/vcrun2010/vcredist_x${VCARCH}.exe ${PKG_FOLDER}/vcredist
  117. zip -r -9 ${PKG_FOLDER}.zip ${PKG_FOLDER}
  118. cd ../..