Cross-Platform build scripts for audio plugins
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.

135 lines
4.9KB

  1. #!/bin/bash
  2. set -e
  3. cd $(dirname ${0})
  4. PAWPAW_ROOT="${PWD}"
  5. # ---------------------------------------------------------------------------------------------------------------------
  6. # check target
  7. target="${1}"
  8. if [ -z "${target}" ]; then
  9. echo "usage: ${0} <target>"
  10. exit 1
  11. fi
  12. # ---------------------------------------------------------------------------------------------------------------------
  13. # run bootstrap dependencies
  14. ./bootstrap-common.sh "${target}"
  15. ./bootstrap-plugins.sh "${target}"
  16. ./bootstrap-qt.sh "${target}"
  17. # ---------------------------------------------------------------------------------------------------------------------
  18. # source setup code
  19. source setup/check_target.sh
  20. source setup/env.sh
  21. source setup/functions.sh
  22. source setup/versions.sh
  23. # ---------------------------------------------------------------------------------------------------------------------
  24. # custom function as needed for pyqt packages
  25. function build_pyqt() {
  26. local name="${1}"
  27. local version="${2}"
  28. local extraconfrules="${3}"
  29. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  30. local python=python3
  31. if ! which python3 > /dev/null; then
  32. python=python
  33. fi
  34. local EXTRA_CFLAGS2="${EXTRA_CFLAGS}"
  35. local EXTRA_CXXFLAGS2="${EXTRA_CXXFLAGS}"
  36. local EXTRA_LDFLAGS2="${EXTRA_LDFLAGS}"
  37. local EXTRA_MAKE_ARGS2="${EXTRA_MAKE_ARGS}"
  38. _prebuild "${name}" "${pkgdir}"
  39. if [ ! -f "${pkgdir}/.stamp_preconfigured" ]; then
  40. pushd "${pkgdir}"
  41. ${python} configure.py build ${extraconfrules}
  42. touch .stamp_preconfigured
  43. popd
  44. fi
  45. _postbuild
  46. export EXTRA_CFLAGS="${EXTRA_CFLAGS2}"
  47. export EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS2}"
  48. export EXTRA_LDFLAGS="${EXTRA_LDFLAGS2}"
  49. export EXTRA_MAKE_ARGS="${EXTRA_MAKE_ARGS2}"
  50. build_make "${name}" "${version}"
  51. }
  52. # ---------------------------------------------------------------------------------------------------------------------
  53. # file/magic (posix only)
  54. if [ "${WIN32}" -eq 0 ]; then
  55. download file "${FILE_VERSION}" "ftp://ftp.astron.com/pub/file"
  56. build_autoconf file "${FILE_VERSION}"
  57. fi
  58. # ---------------------------------------------------------------------------------------------------------------------
  59. # python
  60. download Python "${PYTHON_VERSION}" "https://www.python.org/ftp/python/${PYTHON_VERSION}" "tgz"
  61. if [ "${MACOS}" -eq 0 ]; then
  62. sed -i -e "s/#zlib zlibmodule.c/zlib zlibmodule.c/" Modules/Setup.dist
  63. fi
  64. build_conf Python "${PYTHON_VERSION}" "--enable-optimizations --enable-shared"
  65. # ---------------------------------------------------------------------------------------------------------------------
  66. # sip
  67. download sip "${SIP_VERSION}" "https://files.kde.org/krita/build/dependencies"
  68. build_pyqt sip "${SIP_VERSION}" "--sip-module PyQt5.sip"
  69. # ---------------------------------------------------------------------------------------------------------------------
  70. # pyqt5
  71. download PyQt5_gpl "${PYQT5_VERSION}" "https://files.kde.org/krita/build/dependencies"
  72. build_pyqt PyQt5_gpl "${PYQT5_VERSION}" "--concatenate --confirm-license -c"
  73. # ---------------------------------------------------------------------------------------------------------------------
  74. # pyliblo
  75. download pyliblo "${PYLIBLO_VERSION}" "http://das.nasophon.de/download"
  76. build_python pyliblo "${PYLIBLO_VERSION}"
  77. # ---------------------------------------------------------------------------------------------------------------------
  78. # toml
  79. download toml "${TOML_VERSION}" "https://files.pythonhosted.org/packages/be/ba/1f744cdc819428fc6b5084ec34d9b30660f6f9daaf70eead706e3203ec3c"
  80. build_python toml "${TOML_VERSION}"
  81. # ---------------------------------------------------------------------------------------------------------------------
  82. # zipp
  83. download zipp "${ZIPP_VERSION}" "https://files.pythonhosted.org/packages/ce/b0/757db659e8b91cb3ea47d90350d7735817fe1df36086afc77c1c4610d559"
  84. build_python zipp "${ZIPP_VERSION}"
  85. # ---------------------------------------------------------------------------------------------------------------------
  86. # importlib_metadata
  87. download importlib_metadata "${IMPORTLIB_METADATA_VERSION}" "https://files.pythonhosted.org/packages/3f/a8/16dc098b0addd1c20719c18a86e985be851b3ec1e103e703297169bb22cc"
  88. build_python importlib_metadata "${IMPORTLIB_METADATA_VERSION}"
  89. # ---------------------------------------------------------------------------------------------------------------------
  90. # cxfreeze
  91. download cx_Freeze "${CXFREEZE_VERSION}" "https://github.com/anthony-tuininga/cx_Freeze/archive"
  92. sed -i -e 's/, use_builtin_types=False//' cx_Freeze/macdist.py
  93. sed -i -e 's/"python%s.%s"/"python%s.%sm"/' setup.py
  94. sed -i -e 's/extra_postargs=extraArgs,/extra_postargs=extraArgs+os.getenv("LDFLAGS").split(),/' setup.py
  95. build_python cx_Freeze "${CXFREEZE_VERSION}"
  96. # ---------------------------------------------------------------------------------------------------------------------