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.

100 lines
2.8KB

  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|32nonosse|64"
  8. exit 1
  9. fi
  10. # ---------------------------------------------------------------------------------------------------------------------
  11. # stop on error
  12. set -e
  13. # ---------------------------------------------------------------------------------------------------------------------
  14. # cd to correct path
  15. if [ ! -f Makefile ]; then
  16. cd $(dirname $0)/../..
  17. fi
  18. # ---------------------------------------------------------------------------------------------------------------------
  19. # set variables
  20. source data/windows/common.env
  21. if [ x"${ARCH}" = x"32nosse" ]; then
  22. ARCH="32"
  23. MAKE_ARGS="${MAKE_ARGS} NOOPT=true"
  24. fi
  25. MAKE_ARGS="${MAKE_ARGS} BUILDING_FOR_WINDOWS=true USING_JUCE=true"
  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 DEPS_PREFIX=${TARGETDIR}/carla-w${ARCH_PREFIX}
  39. export MSYS2_PREFIX=${TARGETDIR}/msys2-${CPUARCH}/mingw${ARCH}
  40. export PATH=${DEPS_PREFIX}/bin:/opt/wine-staging/bin:/usr/sbin:/usr/bin:/sbin:/bin
  41. export PKG_CONFIG_PATH=${DEPS_PREFIX}/lib/pkgconfig:${MSYS2_PREFIX}/lib/pkgconfig
  42. export AR=${_MINGW_PREFIX}-ar
  43. export CC=${_MINGW_PREFIX}-gcc
  44. export CXX=${_MINGW_PREFIX}-g++
  45. export STRIP=${_MINGW_PREFIX}-strip
  46. export WINDRES=${_MINGW_PREFIX}-windres
  47. export CFLAGS="-DPTW32_STATIC_LIB -DFLUIDSYNTH_NOT_A_DLL"
  48. export CFLAGS="${CFLAGS} -I${DEPS_PREFIX}/include"
  49. export CXXFLAGS="${CFLAGS}"
  50. export LDFLAGS="-L${DEPS_PREFIX}/lib"
  51. export MOC_QT5="wine ${MSYS2_PREFIX}/bin/moc.exe"
  52. export RCC_QT5="wine ${MSYS2_PREFIX}/bin/rcc.exe"
  53. export UIC_QT5="wine ${MSYS2_PREFIX}/bin/uic.exe"
  54. }
  55. # ---------------------------------------------------------------------------------------------------------------------
  56. export_vars "${ARCH}" "${ARCH_PREFIX}" "${CPUARCH}"
  57. export WINEARCH=win${ARCH}
  58. export WINEDEBUG=-all
  59. export WINEPREFIX=~/.winepy3_x${ARCH}
  60. export PYTHON_EXE="wine ${MSYS2_PREFIX}/bin/python.exe"
  61. export PYRCC5="${PYTHON_EXE} -m PyQt5.pyrcc_main"
  62. export PYUIC5="${PYTHON_EXE} -m PyQt5.uic.pyuic"
  63. make ${MAKE_ARGS}
  64. if [ x"${ARCH}" != x"32" ]; then
  65. export_vars "32" "32" "i686"
  66. make ${MAKE_ARGS} win32
  67. fi
  68. # Testing:
  69. echo "export WINEPREFIX=~/.winepy3_x${ARCH}"
  70. echo "/opt/wine-staging/bin/${PYTHON_EXE} ./source/frontend/carla"
  71. # ---------------------------------------------------------------------------------------------------------------------