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.

117 lines
3.8KB

  1. #!/bin/bash
  2. set -e
  3. cd $(dirname ${0})
  4. PAWPAW_ROOT="${PWD}"
  5. # ---------------------------------------------------------------------------------------------------------------------
  6. target="${1}"
  7. if [ -z "${target}" ]; then
  8. echo "usage: ${0} <target>"
  9. exit 1
  10. fi
  11. # ---------------------------------------------------------------------------------------------------------------------
  12. # TODO check that bootstrap.sh has been run
  13. # TODO
  14. # - portaudio (with asio support) for windows
  15. # - readline for windows?
  16. source setup/check_target.sh
  17. source setup/env.sh
  18. source setup/functions.sh
  19. source setup/versions.sh
  20. # ---------------------------------------------------------------------------------------------------------------------
  21. # aften (macos only)
  22. if [ "${MACOS}" -eq 1 ]; then
  23. download aften "${AFTEN_VERSION}" "http://downloads.sourceforge.net/aften" "tar.bz2"
  24. build_cmake aften "${AFTEN_VERSION}"
  25. if [ ! -f "${PAWPAW_BUILDDIR}/aften-${AFTEN_VERSION}/.stamp_installed_libs" ]; then
  26. cp -v "${PAWPAW_BUILDDIR}/aften-${AFTEN_VERSION}/build/libaften_pcm.a" "${PAWPAW_PREFIX}/lib/libaften_pcm.a"
  27. cp -v "${PAWPAW_BUILDDIR}/aften-${AFTEN_VERSION}/build/libaften_static.a" "${PAWPAW_PREFIX}/lib/libaften.a"
  28. touch "${PAWPAW_BUILDDIR}/aften-${AFTEN_VERSION}/.stamp_installed_libs"
  29. fi
  30. fi
  31. # ---------------------------------------------------------------------------------------------------------------------
  32. # db
  33. download db "${DB_VERSION}" "https://download.oracle.com/berkeley-db"
  34. # based on build_autoconf
  35. function build_custom_db() {
  36. local name="${1}"
  37. local version="${2}"
  38. local extraconfrules="${3}"
  39. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  40. if [ "${CROSS_COMPILING}" -eq 1 ]; then
  41. extraconfrules="--host=${TOOLCHAIN_PREFIX} ${extraconfrules}"
  42. fi
  43. if [ "${WIN32}" -eq 1 ]; then
  44. extraconfrules="--enable-mingw ${extraconfrules}"
  45. fi
  46. _prebuild "${name}" "${pkgdir}"
  47. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  48. pushd "${pkgdir}/build_unix"
  49. ../dist/configure --enable-static --disable-shared --disable-maintainer-mode --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
  50. touch ../.stamp_configured
  51. popd
  52. fi
  53. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  54. pushd "${pkgdir}/build_unix"
  55. make ${MAKE_ARGS}
  56. touch ../.stamp_built
  57. popd
  58. fi
  59. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  60. pushd "${pkgdir}/build_unix"
  61. make ${MAKE_ARGS} install
  62. touch ../.stamp_installed
  63. popd
  64. fi
  65. _postbuild
  66. }
  67. patch_file db "${DB_VERSION}" "src/dbinc/atomic.h" 's/__atomic_compare_exchange/__db_atomic_compare_exchange/'
  68. build_custom_db db "${DB_VERSION}" "--disable-java --disable-replication --disable-sql --disable-tcl"
  69. # --enable-posixmutexes --enable-compat185 --enable-cxx --enable-dbm --enable-stl
  70. # ---------------------------------------------------------------------------------------------------------------------
  71. # opus
  72. download opus "${OPUS_VERSION}" "https://archive.mozilla.org/pub/opus"
  73. build_autoconf opus "${OPUS_VERSION}" "--disable-extra-programs --enable-custom-modes --enable-float-approx"
  74. # ---------------------------------------------------------------------------------------------------------------------
  75. # and finally jack2
  76. if [ ! -d jack2 ]; then
  77. git clone --recursive git@github.com:jackaudio/jack2.git
  78. fi
  79. jack2_args="--prefix=\"${PAWPAW_PREFIX}/jack2\""
  80. # if [ "${MACOS_OLD}" -eq 1 ] || [ "${WIN32}" -eq 1 ]; then
  81. # jack2_args="${jack2_args} --mixed"
  82. # fi
  83. ln -sf "$(pwd)/jack2" "${PAWPAW_BUILDDIR}/jack2-git"
  84. rm -f "${PAWPAW_BUILDDIR}/jack2-git/.stamp_built"
  85. build_waf jack2 "git" "${jack2_args}"
  86. # ---------------------------------------------------------------------------------------------------------------------