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.

192 lines
7.7KB

  1. #!/bin/bash
  2. set -e
  3. cd $(dirname ${0})
  4. PAWPAW_ROOT="${PWD}"
  5. # ---------------------------------------------------------------------------------------------------------------------
  6. # check target
  7. target="${1}"
  8. if [ -z "${target}" ]; then
  9. echo "usage: ${0} <target>"
  10. exit 1
  11. fi
  12. # ---------------------------------------------------------------------------------------------------------------------
  13. # run bootstrap dependencies
  14. ./bootstrap-common.sh "${target}"
  15. # ---------------------------------------------------------------------------------------------------------------------
  16. # source setup code
  17. source setup/check_target.sh
  18. source setup/env.sh
  19. source setup/functions.sh
  20. source setup/versions.sh
  21. # ---------------------------------------------------------------------------------------------------------------------
  22. # fftw
  23. FFTW_EXTRAFLAGS="--disable-alloca --disable-fortran --with-our-malloc"
  24. if [ "${MACOS_UNIVERSAL}" -eq 0 ]; then
  25. FFTW_EXTRAFLAGS+=" --enable-sse2"
  26. fi
  27. # if [ "${WIN32}" -eq 0 ]; then
  28. # FFTW_EXTRAFLAGS+=" --enable-threads"
  29. # fi
  30. download fftw "${FFTW_VERSION}" "http://www.fftw.org"
  31. if [ "${MACOS_OLD}" -eq 1 ]; then
  32. patch_file fftw "${FFTW_VERSION}" "configure" 's/CFLAGS="$CFLAGS -Wl,-no_compact_unwind"/CFLAGS="$CFLAGS"/'
  33. patch_file fftw "${FFTW_VERSION}" "libbench2/timer.c" 's/#if defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_TIMER)/#ifndef HAVE_TIMER/'
  34. fi
  35. build_autoconf fftw "${FFTW_VERSION}" "${FFTW_EXTRAFLAGS}"
  36. # ---------------------------------------------------------------------------------------------------------------------
  37. # fftwf
  38. FFTWF_EXTRAFLAGS="${FFTW_EXTRAFLAGS} --enable-single"
  39. copy_download fftw fftwf "${FFTW_VERSION}"
  40. if [ "${MACOS_OLD}" -eq 1 ]; then
  41. patch_file fftwf "${FFTW_VERSION}" "configure" 's/CFLAGS="$CFLAGS -Wl,-no_compact_unwind"/CFLAGS="$CFLAGS"/'
  42. patch_file fftwf "${FFTW_VERSION}" "libbench2/timer.c" 's/#if defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_TIMER)/#ifndef HAVE_TIMER/'
  43. fi
  44. build_autoconf fftwf "${FFTW_VERSION}" "${FFTWF_EXTRAFLAGS}"
  45. # ---------------------------------------------------------------------------------------------------------------------
  46. # glib
  47. if [ "${MACOS}" -eq 1 ] || [ "${WIN32}" -eq 1 ]; then
  48. if [ "${WIN32}" -eq 1 ]; then
  49. GLIB_EXTRAFLAGS="--with-threads=win32"
  50. else
  51. GLIB_EXTRAFLAGS="--with-threads=posix"
  52. fi
  53. download glib ${GLIB_VERSION} "http://caesar.ftp.acc.umu.se/pub/GNOME/sources/glib/${GLIB_MVERSION}" "${GLIB_TAR_EXT}"
  54. if [ "${MACOS}" -eq 1 ]; then
  55. export EXTRA_LDFLAGS="-lresolv"
  56. patch_file glib ${GLIB_VERSION} "glib/gconvert.c" '/#error/g'
  57. if [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
  58. patch_file glib ${GLIB_VERSION} "glib/gatomic.c" 's/G_ATOMIC_ARM/__aarch64__/'
  59. patch_file glib ${GLIB_VERSION} "glib/gatomic.c" 's/G_ATOMIC_X86_64/__SSE2__/'
  60. elif [ "${MACOS_OLD}" -eq 1 ]; then
  61. GLIB_EXTRAFLAGS+=" glib_cv_stack_grows=yes"
  62. GLIB_EXTRAFLAGS+=" glib_cv_rtldglobal_broken=no"
  63. GLIB_EXTRAFLAGS+=" glib_cv_uscore=no"
  64. GLIB_EXTRAFLAGS+=" ac_cv_func_posix_getpwuid_r=yes"
  65. GLIB_EXTRAFLAGS+=" ac_cv_func_posix_getgrgid_r=yes"
  66. patch_file glib ${GLIB_VERSION} "configure.in" 's/G_ATOMIC_I486/G_ATOMIC_NOT_I486/'
  67. fi
  68. fi
  69. build_autoconfgen glib ${GLIB_VERSION} "${GLIB_EXTRAFLAGS}"
  70. fi
  71. # ---------------------------------------------------------------------------------------------------------------------
  72. # liblo
  73. download liblo "${LIBLO_VERSION}" "http://download.sourceforge.net/liblo"
  74. build_autoconf liblo "${LIBLO_VERSION}" "--enable-threads --disable-examples --disable-tests --disable-tools"
  75. # ---------------------------------------------------------------------------------------------------------------------
  76. # lv2
  77. download lv2 "${LV2_VERSION}" "http://lv2plug.in/spec" "tar.bz2"
  78. build_waf lv2 "${LV2_VERSION}" "--lv2dir=${PAWPAW_PREFIX}/lib/lv2 --no-coverage --no-plugins"
  79. # ---------------------------------------------------------------------------------------------------------------------
  80. # serd
  81. download serd "${SERD_VERSION}" "http://download.drobilla.net/" "tar.bz2"
  82. build_waf serd "${SERD_VERSION}" "--static --no-shared"
  83. # ---------------------------------------------------------------------------------------------------------------------
  84. # sord
  85. download sord "${SORD_VERSION}" "http://download.drobilla.net/" "tar.bz2"
  86. build_waf sord "${SORD_VERSION}" "--static --no-shared --no-utils"
  87. # ---------------------------------------------------------------------------------------------------------------------
  88. # sratom
  89. download sratom "${SRATOM_VERSION}" "http://download.drobilla.net/" "tar.bz2"
  90. build_waf sratom "${SRATOM_VERSION}" "--static --no-shared"
  91. # ---------------------------------------------------------------------------------------------------------------------
  92. # lilv
  93. download lilv "${LILV_VERSION}" "http://download.drobilla.net/" "tar.bz2"
  94. build_waf lilv "${LILV_VERSION}" "--static --no-bash-completion --no-bindings --no-shared"
  95. # --static-progs
  96. # ---------------------------------------------------------------------------------------------------------------------
  97. # lv2lint
  98. if [ "${MACOS_OLD}" -eq 0 ] && [ "${CROSS_COMPILING}" -eq 0 ]; then
  99. download lv2lint "${LV2LINT_VERSION}" "https://gitlab.com/OpenMusicKontrollers/lv2lint/-/archive/${LV2LINT_VERSION}"
  100. build_meson lv2lint "${LV2LINT_VERSION}"
  101. # "-Donline-tests=true -Delf-tests=true"
  102. fi
  103. # ---------------------------------------------------------------------------------------------------------------------
  104. # fluidsynth
  105. FLUIDSYNTH_EXTRAFLAGS="-Denable-floats=ON"
  106. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-alsa=OFF"
  107. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-aufile=OFF"
  108. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-coreaudio=OFF"
  109. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-coremidi=OFF"
  110. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-dbus=OFF"
  111. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-debug=OFF"
  112. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-fpe-check=OFF"
  113. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-framework=OFF"
  114. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-ipv6=OFF"
  115. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-jack=OFF"
  116. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-ladcca=OFF"
  117. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-ladspa=OFF"
  118. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-lash=OFF"
  119. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-midishare=OFF"
  120. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-oss=OFF"
  121. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-portaudio=OFF"
  122. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-profiling=OFF"
  123. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-pulseaudio=OFF"
  124. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-readline=OFF"
  125. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-trap-on-fpe=OFF"
  126. download fluidsynth ${FLUIDSYNTH_VERSION} "https://github.com/FluidSynth/fluidsynth/archive"
  127. patch_file fluidsynth ${FLUIDSYNTH_VERSION} "CMakeLists.txt" 's/_init_lib_suffix "64"/_init_lib_suffix ""/'
  128. build_cmake fluidsynth ${FLUIDSYNTH_VERSION} "${FLUIDSYNTH_EXTRAFLAGS}"
  129. # touch src/fluidsynth
  130. # sed -i -e "s|-lfluidsynth|-lfluidsynth -lglib-2.0 -lgthread-2.0 -lsndfile -lFLAC -lvorbisenc -lvorbis -logg -lpthread -lm -liconv|" ${PREFIX}/lib/pkgconfig/fluidsynth.pc
  131. # ---------------------------------------------------------------------------------------------------------------------
  132. # mxml
  133. download mxml ${MXML_VERSION} "https://github.com/michaelrsweet/mxml/archive"
  134. build_autoconf mxml ${MXML_VERSION} "--disable-shared --prefix=${PAWPAW_PREFIX}"
  135. # ---------------------------------------------------------------------------------------------------------------------
  136. # zlib
  137. if [ "${MACOS}" -eq 0 ]; then
  138. download zlib ${ZLIB_VERSION} "https://github.com/madler/zlib/archive"
  139. build_conf zlib ${ZLIB_VERSION} "--static --prefix=${PAWPAW_PREFIX}"
  140. fi
  141. # ---------------------------------------------------------------------------------------------------------------------