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.

197 lines
7.8KB

  1. #!/bin/bash
  2. set -e
  3. cd $(dirname ${0})
  4. PAWPAW_ROOT="${PWD}"
  5. # ---------------------------------------------------------------------------------------------------------------------
  6. target="${1}"
  7. if [ -z "${target}" ]; then
  8. echo "usage: ${0} <target>"
  9. exit 1
  10. fi
  11. # ---------------------------------------------------------------------------------------------------------------------
  12. # TODO check for depedencies:
  13. # - curl
  14. # - cmake
  15. # - make
  16. # - jq
  17. # - patch
  18. # - python (waf, meson)
  19. # - sed
  20. # - tar
  21. source setup/check_target.sh
  22. source setup/env.sh
  23. source setup/functions.sh
  24. source setup/versions.sh
  25. mkdir -p ${PAWPAW_BUILDDIR}
  26. mkdir -p ${PAWPAW_DOWNLOADDIR}
  27. mkdir -p ${PAWPAW_PREFIX}
  28. mkdir -p ${PAWPAW_TMPDIR}
  29. # ---------------------------------------------------------------------------------------------------------------------
  30. # pkgconfig
  31. download pkg-config "${PKG_CONFIG_VERSION}" "https://pkg-config.freedesktop.org/releases"
  32. build_host_autoconf pkg-config "${PKG_CONFIG_VERSION}" "--enable-indirect-deps --with-internal-glib --with-pc-path=${TARGET_PKG_CONFIG_PATH}"
  33. # ---------------------------------------------------------------------------------------------------------------------
  34. # file/magic (posix only)
  35. # if [ "${WIN32}" -eq 0 ]; then
  36. # download file "${FILE_VERSION}" "ftp://ftp.astron.com/pub/file"
  37. # build_autoconf file "${FILE_VERSION}"
  38. # fi
  39. # ---------------------------------------------------------------------------------------------------------------------
  40. # glib
  41. if [ -n "${GLIB_VERSION}" ]; then
  42. GLIB_EXTRAFLAGS=""
  43. if [ "${WIN32}" -eq 0 ]; then
  44. GLIB_EXTRAFLAGS+=" --with-threads=win32"
  45. fi
  46. download glib ${GLIB_VERSION} "http://caesar.ftp.acc.umu.se/pub/GNOME/sources/glib/${GLIB_MVERSION}" "${GLIB_TAR_EXT}"
  47. # remove_file glib ${GLIB_VERSION} "m4macros/glib-gettext.m4"
  48. build_autoconfgen glib ${GLIB_VERSION} "${GLIB_EXTRAFLAGS}"
  49. fi
  50. # ---------------------------------------------------------------------------------------------------------------------
  51. # liblo
  52. download liblo "${LIBLO_VERSION}" "http://download.sourceforge.net/liblo"
  53. build_autoconf liblo "${LIBLO_VERSION}" "--enable-threads --disable-examples --disable-tests --disable-tools"
  54. # ---------------------------------------------------------------------------------------------------------------------
  55. # libogg
  56. download libogg "${LIBOGG_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/ogg"
  57. patch_file libogg "${LIBOGG_VERSION}" "include/ogg/os_types.h" 's/__MACH__/__MACH_SKIP__/'
  58. build_autoconf libogg "${LIBOGG_VERSION}"
  59. # ---------------------------------------------------------------------------------------------------------------------
  60. # libvorbis
  61. download libvorbis "${LIBVORBIS_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/vorbis"
  62. build_autoconf libvorbis "${LIBVORBIS_VERSION}" "--disable-examples"
  63. # ---------------------------------------------------------------------------------------------------------------------
  64. # flac
  65. FLAC_EXTRAFLAGS="--disable-doxygen-docs --disable-examples --disable-thorough-tests"
  66. if [ "${MACOS_OLD}" -eq 1 ]; then
  67. FLAC_EXTRAFLAGS="${FLAC_EXTRAFLAGS} --disable-asm-optimizations"
  68. fi
  69. download flac "${FLAC_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/flac" "tar.xz"
  70. build_autoconf flac "${FLAC_VERSION}" "${FLAC_EXTRAFLAGS}"
  71. # ---------------------------------------------------------------------------------------------------------------------
  72. # fftw
  73. FFTW_EXTRAFLAGS="--enable-sse2 --disable-alloca --disable-fortran --with-our-malloc"
  74. # if [ "${WIN32}" -eq 0 ]; then
  75. # FFTW_EXTRAFLAGS="${FFTW_EXTRAFLAGS} --enable-threads"
  76. # fi
  77. download fftw "${FFTW_VERSION}" "http://www.fftw.org"
  78. if [ "${MACOS_OLD}" -eq 1 ]; then
  79. patch_file fftw "${FFTW_VERSION}" "configure" 's/CFLAGS="$CFLAGS -Wl,-no_compact_unwind"/CFLAGS="$CFLAGS"/'
  80. patch_file fftw "${FFTW_VERSION}" "libbench2/timer.c" 's/#if defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_TIMER)/#ifndef HAVE_TIMER/'
  81. fi
  82. build_autoconf fftw "${FFTW_VERSION}" "${FFTW_EXTRAFLAGS}"
  83. # ---------------------------------------------------------------------------------------------------------------------
  84. # fftwf
  85. FFTWF_EXTRAFLAGS="${FFTW_EXTRAFLAGS} --enable-single"
  86. copy_download fftw fftwf "${FFTW_VERSION}"
  87. if [ "${MACOS_OLD}" -eq 1 ]; then
  88. patch_file fftwf "${FFTW_VERSION}" "configure" 's/CFLAGS="$CFLAGS -Wl,-no_compact_unwind"/CFLAGS="$CFLAGS"/'
  89. patch_file fftwf "${FFTW_VERSION}" "libbench2/timer.c" 's/#if defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_TIMER)/#ifndef HAVE_TIMER/'
  90. fi
  91. build_autoconf fftwf "${FFTW_VERSION}" "${FFTWF_EXTRAFLAGS}"
  92. # ---------------------------------------------------------------------------------------------------------------------
  93. # libsamplerate
  94. download libsamplerate "${LIBSAMPLERATE_VERSION}" "http://www.mega-nerd.com/SRC"
  95. build_autoconf libsamplerate "${LIBSAMPLERATE_VERSION}" "--disable-fftw --disable-sndfile"
  96. # ---------------------------------------------------------------------------------------------------------------------
  97. # libsndfile
  98. download libsndfile "${LIBSNDFILE_VERSION}" "http://www.mega-nerd.com/libsndfile/files"
  99. patch_file libsndfile "${LIBSNDFILE_VERSION}" "configure" 's/ -Wvla//'
  100. build_autoconf libsndfile "${LIBSNDFILE_VERSION}" "--disable-full-suite --disable-alsa --disable-sqlite"
  101. # ---------------------------------------------------------------------------------------------------------------------
  102. # lv2
  103. download lv2 "${LV2_VERSION}" "http://lv2plug.in/spec" "tar.bz2"
  104. build_waf lv2 "${LV2_VERSION}" "--lv2dir=${PAWPAW_PREFIX}/lib/lv2 --no-coverage --no-plugins"
  105. # ---------------------------------------------------------------------------------------------------------------------
  106. # fluidsynth
  107. FLUIDSYNTH_EXTRAFLAGS="-Denable-floats=ON"
  108. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-alsa=OFF"
  109. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-aufile=OFF"
  110. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-coreaudio=OFF"
  111. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-coremidi=OFF"
  112. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-dbus=OFF"
  113. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-debug=OFF"
  114. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-fpe-check=OFF"
  115. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-framework=OFF"
  116. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-ipv6=OFF"
  117. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-jack=OFF"
  118. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-ladcca=OFF"
  119. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-ladspa=OFF"
  120. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-lash=OFF"
  121. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-midishare=OFF"
  122. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-oss=OFF"
  123. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-portaudio=OFF"
  124. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-profiling=OFF"
  125. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-pulseaudio=OFF"
  126. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-readline=OFF"
  127. FLUIDSYNTH_EXTRAFLAGS+=" -Denable-trap-on-fpe=OFF"
  128. download fluidsynth ${FLUIDSYNTH_VERSION} "https://github.com/FluidSynth/fluidsynth/archive"
  129. patch_file fluidsynth ${FLUIDSYNTH_VERSION} "CMakeLists.txt" 's/_init_lib_suffix "64"/_init_lib_suffix ""/'
  130. build_cmake fluidsynth ${FLUIDSYNTH_VERSION} "${FLUIDSYNTH_EXTRAFLAGS}"
  131. # touch src/fluidsynth
  132. # 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
  133. # ---------------------------------------------------------------------------------------------------------------------
  134. # mxml
  135. download mxml ${MXML_VERSION} "https://github.com/michaelrsweet/mxml/archive"
  136. build_autoconf mxml ${MXML_VERSION} "--disable-shared --prefix=${PAWPAW_PREFIX}"
  137. # ---------------------------------------------------------------------------------------------------------------------
  138. # zlib
  139. if [ "${MACOS}" -eq 0 ]; then
  140. download zlib ${ZLIB_VERSION} "https://github.com/madler/zlib/archive"
  141. build_conf zlib ${ZLIB_VERSION} "--static --prefix=${PAWPAW_PREFIX}"
  142. fi
  143. # ---------------------------------------------------------------------------------------------------------------------