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.

159 lines
4.4KB

  1. #!/bin/bash
  2. # apt-get install build-essential autoconf libtool cmake libglib2.0-dev libgl1-mesa-dev
  3. # ---------------------------------------------------------------------------------------------------------------------
  4. # stop on error
  5. set -e
  6. # ---------------------------------------------------------------------------------------------------------------------
  7. # cd to correct path
  8. cd $(dirname $0)
  9. # ---------------------------------------------------------------------------------------------------------------------
  10. # set variables
  11. source common.env
  12. # ---------------------------------------------------------------------------------------------------------------------
  13. # function to remove old stuff
  14. cleanup()
  15. {
  16. rm -rf cx_Freeze-*
  17. rm -rf Python-*
  18. rm -rf PyQt-*
  19. rm -rf PyQt5_*
  20. rm -rf pyliblo-*
  21. rm -rf sip-*
  22. }
  23. # ---------------------------------------------------------------------------------------------------------------------
  24. # function to build base libs
  25. build_pyqt()
  26. {
  27. export CC=gcc
  28. export CXX=g++
  29. export PREFIX=${TARGETDIR}/carla${ARCH}
  30. export PATH=${PREFIX}/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  31. export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
  32. export CFLAGS="-O3 -mtune=generic -msse -msse2 -mfpmath=sse -fPIC -DPIC -DNDEBUG -m${ARCH}"
  33. export CXXFLAGS="${CFLAGS}"
  34. export LDFLAGS="-m${ARCH} -Wl,-O1"
  35. # TODO build libffi statically
  36. # ---------------------------------------------------------------------------------------------------------------------
  37. # python
  38. if [ ! -d Python-${PYTHON_VERSION} ]; then
  39. aria2c https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
  40. tar -xf Python-${PYTHON_VERSION}.tgz
  41. fi
  42. if [ ! -f Python-${PYTHON_VERSION}/build-done ]; then
  43. cd Python-${PYTHON_VERSION}
  44. ./configure --prefix=${PREFIX}
  45. make
  46. make install
  47. touch build-done
  48. cd ..
  49. fi
  50. # ---------------------------------------------------------------------------------------------------------------------
  51. # sip
  52. if [ ! -d sip-${SIP_VERSION} ]; then
  53. aria2c http://sourceforge.net/projects/pyqt/files/sip/sip-${SIP_VERSION}/sip-${SIP_VERSION}.tar.gz
  54. tar -xf sip-${SIP_VERSION}.tar.gz
  55. fi
  56. if [ ! -f sip-${SIP_VERSION}/build-done ]; then
  57. cd sip-${SIP_VERSION}
  58. python3 configure.py --sip-module PyQt5.sip
  59. make ${MAKE_ARGS}
  60. make install
  61. touch build-done
  62. cd ..
  63. fi
  64. # ---------------------------------------------------------------------------------------------------------------------
  65. # pyqt5
  66. if [ ! -d PyQt5_gpl-${PYQT5_VERSION} ]; then
  67. aria2c http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-${PYQT5_VERSION}/PyQt5_gpl-${PYQT5_VERSION}.tar.gz
  68. tar -xf PyQt5_gpl-${PYQT5_VERSION}.tar.gz
  69. fi
  70. if [ ! -f PyQt5_gpl-${PYQT5_VERSION}/build-done ]; then
  71. cd PyQt5_gpl-${PYQT5_VERSION}
  72. python3 configure.py --confirm-license -c
  73. make ${MAKE_ARGS}
  74. make install
  75. touch build-done
  76. cd ..
  77. fi
  78. # ---------------------------------------------------------------------------------------------------------------------
  79. # cxfreeze
  80. if [ ! -d cx_Freeze-${CXFREEZE_VERSION} ]; then
  81. aria2c https://github.com/anthony-tuininga/cx_Freeze/archive/${CXFREEZE_VERSION}.tar.gz
  82. tar -xf cx_Freeze-${CXFREEZE_VERSION}.tar.gz
  83. fi
  84. if [ ! -f cx_Freeze-${CXFREEZE_VERSION}/build-done ]; then
  85. cd cx_Freeze-${CXFREEZE_VERSION}
  86. python3 setup.py build
  87. python3 setup.py install --prefix=${PREFIX}
  88. touch build-done
  89. cd ..
  90. fi
  91. # ---------------------------------------------------------------------------------------------------------------------
  92. # pyliblo (needs to be last as it modifies CFLAGS)
  93. if [ ! -d pyliblo-${PYLIBLO_VERSION} ]; then
  94. aria2c http://das.nasophon.de/download/pyliblo-${PYLIBLO_VERSION}.tar.gz
  95. tar -xf pyliblo-${PYLIBLO_VERSION}.tar.gz
  96. fi
  97. if [ ! -f pyliblo-${PYLIBLO_VERSION}/build-done ]; then
  98. cd pyliblo-${PYLIBLO_VERSION}
  99. if [ ! -f patched ]; then
  100. ls ../../macos/patches
  101. patch -p1 -i ../../macos/patches/pyliblo-python3.7.patch
  102. touch patched
  103. fi
  104. export CFLAGS="${CFLAGS} -I${PREFIX}/include -L${PREFIX}/lib"
  105. python3 setup.py build
  106. python3 setup.py install --prefix=${PREFIX}
  107. touch build-done
  108. cd ..
  109. fi
  110. }
  111. # ---------------------------------------------------------------------------------------------------------------------
  112. # build base libs
  113. export TARGET="${1}"
  114. if [ x"${TARGET}" = x"32" ]; then
  115. export ARCH=32
  116. else
  117. export ARCH=64
  118. fi
  119. build_pyqt
  120. # ---------------------------------------------------------------------------------------------------------------------