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.

pack-win.sh 6.1KB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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-RC1-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
  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-bridge-lv2-windows.exe
  81. rm Carla/carla-discovery-native.exe
  82. rm Carla/carla-lv2-export.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 ../../bin/carla.lv2/*.dll Carla.lv2/
  106. cp ../../bin/carla.lv2/*.exe 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. if [ x"${CARLA_DEV}" != x"" ]; then
  111. exit 0
  112. fi
  113. # Build unzipfx
  114. make -C unzipfx-carla -f Makefile.win32 clean
  115. make -C unzipfx-carla -f Makefile.win32 ${MAKE_ARGS}
  116. # Create zip of Carla
  117. rm -f Carla.zip CarlaControl.zip
  118. zip -r -9 Carla.zip Carla
  119. # Create static build
  120. rm -f Carla.exe CarlaControl.exe
  121. cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe
  122. chmod +x Carla.exe
  123. # Cleanup
  124. rm -f Carla.zip CarlaControl.zip
  125. if [ x"${ARCH}" = x"32" ]; then
  126. VCARCH="86"
  127. else
  128. VCARCH="${ARCH}"
  129. fi
  130. # Create release zip
  131. rm -rf ${PKG_FOLDER}
  132. mkdir ${PKG_FOLDER}
  133. mkdir ${PKG_FOLDER}/vcredist
  134. cp -r Carla.exe Carla.lv2 README.txt ${PKG_FOLDER}
  135. cp ~/.cache/winetricks/vcrun2010/vcredist_x${VCARCH}.exe ${PKG_FOLDER}/vcredist
  136. zip -r -9 ${PKG_FOLDER}.zip ${PKG_FOLDER}
  137. cd ../..