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.

160 lines
4.3KB

  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. cleanup
  37. # ---------------------------------------------------------------------------------------------------------------------
  38. # python
  39. if [ ! -d Python-${PYTHON_VERSION} ]; then
  40. aria2c https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
  41. tar -xf Python-${PYTHON_VERSION}.tgz
  42. fi
  43. if [ ! -f Python-${PYTHON_VERSION}/build-done ]; then
  44. cd Python-${PYTHON_VERSION}
  45. ./configure --prefix=${PREFIX}
  46. make
  47. make install
  48. touch build-done
  49. cd ..
  50. fi
  51. # ---------------------------------------------------------------------------------------------------------------------
  52. # sip
  53. if [ ! -d sip-${SIP_VERSION} ]; then
  54. aria2c http://sourceforge.net/projects/pyqt/files/sip/sip-${SIP_VERSION}/sip-${SIP_VERSION}.tar.gz
  55. tar -xf sip-${SIP_VERSION}.tar.gz
  56. fi
  57. if [ ! -f sip-${SIP_VERSION}/build-done ]; then
  58. cd sip-${SIP_VERSION}
  59. python3 configure.py --sip-module PyQt5.sip
  60. make ${MAKE_ARGS}
  61. make install
  62. touch build-done
  63. cd ..
  64. fi
  65. # ---------------------------------------------------------------------------------------------------------------------
  66. # pyqt5
  67. if [ ! -d PyQt5_gpl-${PYQT5_VERSION} ]; then
  68. aria2c http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-${PYQT5_VERSION}/PyQt5_gpl-${PYQT5_VERSION}.tar.gz
  69. tar -xf PyQt5_gpl-${PYQT5_VERSION}.tar.gz
  70. fi
  71. if [ ! -f PyQt5_gpl-${PYQT5_VERSION}/build-done ]; then
  72. cd PyQt5_gpl-${PYQT5_VERSION}
  73. python3 configure.py --confirm-license -c
  74. make ${MAKE_ARGS}
  75. make install
  76. touch build-done
  77. cd ..
  78. fi
  79. # ---------------------------------------------------------------------------------------------------------------------
  80. # pyliblo
  81. if [ ! -d pyliblo-${PYLIBLO_VERSION} ]; then
  82. aria2c http://das.nasophon.de/download/pyliblo-${PYLIBLO_VERSION}.tar.gz
  83. tar -xf pyliblo-${PYLIBLO_VERSION}.tar.gz
  84. fi
  85. if [ ! -f pyliblo-${PYLIBLO_VERSION}/build-done ]; then
  86. cd pyliblo-${PYLIBLO_VERSION}
  87. if [ ! -f patched ]; then
  88. ls ../../macos/patches
  89. patch -p1 -i ../../macos/patches/pyliblo-python3.7.patch
  90. touch patched
  91. fi
  92. python3 setup.py build
  93. python3 setup.py install --prefix=${PREFIX}
  94. touch build-done
  95. cd ..
  96. fi
  97. }
  98. # ---------------------------------------------------------------------------------------------------------------------
  99. # cxfreeze
  100. if [ ! -d cx_Freeze-${CXFREEZE_VERSION} ]; then
  101. aria2c https://github.com/anthony-tuininga/cx_Freeze/archive/${CXFREEZE_VERSION}.tar.gz
  102. tar -xf cx_Freeze-${CXFREEZE_VERSION}.tar.gz
  103. fi
  104. if [ ! -f cx_Freeze-${CXFREEZE_VERSION}/build-done ]; then
  105. cd cx_Freeze-${CXFREEZE_VERSION}
  106. python3 setup.py build
  107. python3 setup.py install --prefix=${PREFIX}
  108. touch build-done
  109. cd ..
  110. fi
  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. # ---------------------------------------------------------------------------------------------------------------------