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 5.1KB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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-beta6-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 WINEPREFIX=~/.winepy3_x${ARCH}
  45. export PYTHON_EXE="wine C:\\\\Python34\\\\python.exe"
  46. export CXFREEZE="$PYTHON_EXE C:\\\\Python34\\\\Scripts\\\\cxfreeze"
  47. export PYUIC="$PYTHON_EXE -m PyQt5.uic.pyuic"
  48. export PYRCC="wine C:\\\\Python34\\\\Lib\\\\site-packages\\\\PyQt5\\\\pyrcc5.exe"
  49. export PYTHONPATH=`pwd`/source
  50. rm -rf ./data/windows/Carla
  51. mkdir -p ./data/windows/Carla/Debug
  52. cp ./source/carla ./source/Carla.pyw
  53. $PYTHON_EXE ./data/windows/app-console.py build_exe
  54. mv ./data/windows/Carla/carla.exe ./data/windows/Carla/Debug/Carla.exe
  55. $PYTHON_EXE ./data/windows/app-gui.py build_exe
  56. rm -f ./source/Carla.pyw
  57. cd data/windows/
  58. rm -rf dist
  59. $CXFREEZE ../../bin/resources/bigmeter-ui
  60. $CXFREEZE ../../bin/resources/midipattern-ui
  61. $CXFREEZE ../../bin/resources/notes-ui
  62. $CXFREEZE ../../bin/resources/carla-plugin
  63. $CXFREEZE ../../bin/resources/carla-plugin-patchbay
  64. cp ../../bin/*.dll Carla/
  65. cp ../../bin/*.exe Carla/
  66. rm Carla/carla-bridge-lv2-windows.exe
  67. rm Carla/carla-discovery-native.exe
  68. rm Carla/carla-lv2-export.exe
  69. rm -f Carla/PyQt5.Qsci.pyd Carla/PyQt5.QtNetwork.pyd Carla/PyQt5.QtSql.pyd Carla/PyQt5.QtTest.pyd Carla/PyQt5.QtXml.pyd
  70. rm -f dist/PyQt5.Qsci.pyd dist/PyQt5.QtNetwork.pyd dist/PyQt5.QtSql.pyd dist/PyQt5.QtTest.pyd dist/PyQt5.QtXml.pyd
  71. cp $WINEPREFIX/drive_c/Python34/python34.dll Carla/
  72. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icu*.dll Carla/
  73. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libEGL.dll Carla/
  74. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libGLESv2.dll Carla/
  75. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Core.dll Carla/
  76. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Gui.dll Carla/
  77. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Widgets.dll Carla/
  78. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5OpenGL.dll Carla/
  79. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Svg.dll Carla/
  80. mv dist Carla/resources
  81. cp $WINEPREFIX/drive_c/Python34/python34.dll Carla/resources/
  82. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icu*.dll Carla/resources/
  83. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libEGL.dll Carla/resources/
  84. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libGLESv2.dll Carla/resources/
  85. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Core.dll Carla/resources/
  86. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Gui.dll Carla/resources/
  87. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Widgets.dll Carla/resources/
  88. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5OpenGL.dll Carla/resources/
  89. cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Svg.dll Carla/resources/
  90. # Build unzipfx
  91. make -C unzipfx-carla -f Makefile.win32 clean
  92. make -C unzipfx-carla -f Makefile.win32 ${MAKE_ARGS}
  93. # Create zip of Carla
  94. rm -f Carla.zip CarlaControl.zip
  95. zip -r -9 Carla.zip Carla
  96. # Create static build
  97. rm -f Carla.exe CarlaControl.exe
  98. cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe
  99. chmod +x Carla.exe
  100. # Cleanup
  101. rm -f Carla.zip CarlaControl.zip
  102. if [ x"${ARCH}" = x"32" ]; then
  103. VCARCH="86"
  104. else
  105. VCARCH="${ARCH}"
  106. fi
  107. # Create release zip
  108. rm -rf ${PKG_FOLDER}
  109. mkdir ${PKG_FOLDER}
  110. mkdir ${PKG_FOLDER}/vcredist
  111. cp Carla.exe README.txt ${PKG_FOLDER}
  112. cp ~/.cache/winetricks/vcrun2010/vcredist_x${VCARCH}.exe ${PKG_FOLDER}/vcredist
  113. zip -r -9 ${PKG_FOLDER}.zip ${PKG_FOLDER}
  114. cd ../..