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.

192 lines
6.4KB

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