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.

171 lines
7.0KB

  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 [ "${MACOS}" -eq 1 ]; then
  44. extraconfrules="--enable-posixmutexes ${extraconfrules}"
  45. fi
  46. if [ "${WIN32}" -eq 1 ]; then
  47. extraconfrules="--enable-mingw ${extraconfrules}"
  48. fi
  49. _prebuild "${name}" "${pkgdir}"
  50. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  51. pushd "${pkgdir}/build_unix"
  52. ../dist/configure --enable-static --disable-shared --disable-debug --disable-doc --disable-maintainer-mode --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
  53. touch ../.stamp_configured
  54. popd
  55. fi
  56. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  57. pushd "${pkgdir}/build_unix"
  58. make ${MAKE_ARGS}
  59. touch ../.stamp_built
  60. popd
  61. fi
  62. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  63. pushd "${pkgdir}/build_unix"
  64. make ${MAKE_ARGS} install
  65. touch ../.stamp_installed
  66. popd
  67. fi
  68. _postbuild
  69. }
  70. patch_file db "${DB_VERSION}" "src/dbinc/atomic.h" 's/__atomic_compare_exchange/__db_atomic_compare_exchange/'
  71. build_custom_db db "${DB_VERSION}" "--disable-java --disable-replication --disable-sql --disable-tcl"
  72. # --enable-posixmutexes --enable-compat185 --enable-cxx --enable-dbm --enable-stl
  73. # ---------------------------------------------------------------------------------------------------------------------
  74. # opus
  75. download opus "${OPUS_VERSION}" "https://archive.mozilla.org/pub/opus"
  76. build_autoconf opus "${OPUS_VERSION}" "--disable-extra-programs --enable-custom-modes --enable-float-approx"
  77. # ---------------------------------------------------------------------------------------------------------------------
  78. # rtaudio (download, win32 only)
  79. if [ "${WIN32}" -eq 1 ]; then
  80. download rtaudio "${RTAUDIO_VERSION}" "https://github.com/falkTX/rtaudio.git" "" "git"
  81. # fixes for portaudio
  82. ASIO_DIR="${PAWPAW_BUILDDIR}/rtaudio-${RTAUDIO_VERSION}/include"
  83. if [ -d "${ASIO_DIR}" ]; then
  84. link_file rtaudio "${RTAUDIO_VERSION}" "." "include/common"
  85. link_file rtaudio "${RTAUDIO_VERSION}" "." "include/host"
  86. link_file rtaudio "${RTAUDIO_VERSION}" "." "include/pc"
  87. fi
  88. fi
  89. # ---------------------------------------------------------------------------------------------------------------------
  90. # portaudio (win32 only)
  91. if [ "${WIN32}" -eq 1 ]; then
  92. export EXTRA_CFLAGS="-I${ASIO_DIR}"
  93. export EXTRA_CXXFLAGS="-I${ASIO_DIR}"
  94. export EXTRA_MAKE_ARGS="-j 1"
  95. download portaudio19 "${PORTAUDIO_VERSION}" "http://deb.debian.org/debian/pool/main/p/portaudio19" "orig.tar.gz"
  96. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/audioclient.h"
  97. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/devicetopology.h"
  98. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/endpointvolume.h"
  99. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/functiondiscoverykeys.h"
  100. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksguid.h"
  101. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksproxy.h"
  102. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksuuids.h"
  103. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/mmdeviceapi.h"
  104. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/propkeydef.h"
  105. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/propsys.h"
  106. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/rpcsal.h"
  107. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/sal.h"
  108. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/structuredquery.h"
  109. build_autoconf portaudio19 "${PORTAUDIO_VERSION}" "--enable-cxx --with-asiodir="${ASIO_DIR}" --with-winapi=asio,directx,wasapi,wdmks,wmme"
  110. install_file portaudio19 "${PORTAUDIO_VERSION}" "include/pa_asio.h" "include"
  111. fi
  112. # ---------------------------------------------------------------------------------------------------------------------
  113. # tre (win32 only)
  114. if [ "${WIN32}" -eq 1 ]; then
  115. download tre "${TRE_VERSION}" "https://laurikari.net/tre"
  116. build_autoconf tre "${TRE_VERSION}" "--disable-nls"
  117. fi
  118. # ---------------------------------------------------------------------------------------------------------------------
  119. # tre (win64 32bit build)
  120. # NOTE this must be the last item to build
  121. if [ "${WIN64}" -eq 1 ]; then
  122. target="win32"
  123. source setup/check_target.sh
  124. source setup/env.sh
  125. PAWPAW_BUILDDIR="${PAWPAW_DIR}/builds/win64"
  126. PAWPAW_PREFIX="${PAWPAW_DIR}/targets/win64"
  127. source setup/functions.sh
  128. copy_download tre tre-x32 "${TRE_VERSION}"
  129. build_autoconf tre-x32 "${TRE_VERSION}" "--disable-nls --libdir="${PAWPAW_PREFIX}"/lib32"
  130. if [ ! -e "${PAWPAW_PREFIX}/lib/libtre32.a" ]; then
  131. ln -s "${PAWPAW_PREFIX}/lib32/libtre.a" "${PAWPAW_PREFIX}/lib/libtre32.a"
  132. fi
  133. fi
  134. # ---------------------------------------------------------------------------------------------------------------------