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.

174 lines
7.1KB

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