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.

168 lines
6.9KB

  1. #!/bin/bash
  2. set -e
  3. cd $(dirname ${0})
  4. PAWPAW_ROOT="${PWD}"
  5. JACK2_VERSION=${JACK2_VERSION:=git}
  6. QJACKCTL_VERSION=${QJACKCTL_VERSION:=0.6.2}
  7. # ---------------------------------------------------------------------------------------------------------------------
  8. target="${1}"
  9. if [ -z "${target}" ]; then
  10. echo "usage: ${0} <target> [package-build?]"
  11. exit 1
  12. fi
  13. # ---------------------------------------------------------------------------------------------------------------------
  14. ./bootstrap-common.sh "${target}"
  15. # ---------------------------------------------------------------------------------------------------------------------
  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-debug --disable-doc --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. # rtaudio (download, win32 only)
  76. if [ "${WIN32}" -eq 1 ]; then
  77. download rtaudio "${RTAUDIO_VERSION}" "https://github.com/falkTX/rtaudio.git" "" "git"
  78. # fixes for portaudio
  79. ASIO_DIR="${PAWPAW_BUILDDIR}/rtaudio-${RTAUDIO_VERSION}/include"
  80. if [ -d "${ASIO_DIR}" ]; then
  81. link_file rtaudio "${RTAUDIO_VERSION}" "." "include/common"
  82. link_file rtaudio "${RTAUDIO_VERSION}" "." "include/host"
  83. link_file rtaudio "${RTAUDIO_VERSION}" "." "include/pc"
  84. fi
  85. fi
  86. # ---------------------------------------------------------------------------------------------------------------------
  87. # portaudio (win32 only)
  88. if [ "${WIN32}" -eq 1 ]; then
  89. export EXTRA_CFLAGS="-I${ASIO_DIR}"
  90. export EXTRA_CXXFLAGS="-I${ASIO_DIR}"
  91. export EXTRA_MAKE_ARGS="-j 1"
  92. download portaudio19 "${PORTAUDIO_VERSION}" "http://deb.debian.org/debian/pool/main/p/portaudio19" "orig.tar.gz"
  93. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/audioclient.h"
  94. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/devicetopology.h"
  95. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/endpointvolume.h"
  96. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/functiondiscoverykeys.h"
  97. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksguid.h"
  98. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksproxy.h"
  99. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksuuids.h"
  100. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/mmdeviceapi.h"
  101. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/propkeydef.h"
  102. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/propsys.h"
  103. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/rpcsal.h"
  104. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/sal.h"
  105. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/structuredquery.h"
  106. build_autoconf portaudio19 "${PORTAUDIO_VERSION}" "--enable-cxx --with-asiodir="${ASIO_DIR}" --with-winapi=asio,directx,wasapi,wdmks,wmme"
  107. install_file portaudio19 "${PORTAUDIO_VERSION}" "include/pa_asio.h" "include"
  108. fi
  109. # ---------------------------------------------------------------------------------------------------------------------
  110. # tre (win32 only)
  111. if [ "${WIN32}" -eq 1 ]; then
  112. download tre "${TRE_VERSION}" "https://laurikari.net/tre"
  113. build_autoconf tre "${TRE_VERSION}" "--disable-nls"
  114. fi
  115. # ---------------------------------------------------------------------------------------------------------------------
  116. # tre (win64 32bit build)
  117. # NOTE this must be the last item to build
  118. if [ "${WIN64}" -eq 1 ]; then
  119. target="win32"
  120. source setup/check_target.sh
  121. source setup/env.sh
  122. PAWPAW_BUILDDIR="${PAWPAW_DIR}/builds/win64"
  123. PAWPAW_PREFIX="${PAWPAW_DIR}/targets/win64"
  124. source setup/functions.sh
  125. copy_download tre tre-x32 "${TRE_VERSION}"
  126. build_autoconf tre-x32 "${TRE_VERSION}" "--disable-nls --libdir="${PAWPAW_PREFIX}"/lib32"
  127. if [ ! -e "${PAWPAW_PREFIX}/lib/libtre32.a" ]; then
  128. ln -s "${PAWPAW_PREFIX}/lib32/libtre.a" "${PAWPAW_PREFIX}/lib/libtre32.a"
  129. fi
  130. fi
  131. # ---------------------------------------------------------------------------------------------------------------------