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.

177 lines
7.2KB

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