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.

136 lines
5.1KB

  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. # liblo
  35. download liblo "${LIBLO_VERSION}" "http://download.sourceforge.net/liblo"
  36. build_autoconf liblo "${LIBLO_VERSION}" "--enable-threads --disable-examples --disable-tools"
  37. # ---------------------------------------------------------------------------------------------------------------------
  38. # zlib
  39. download zlib "${ZLIB_VERSION}" "https://github.com/madler/zlib/archive"
  40. build_conf zlib "${ZLIB_VERSION}" "--static --prefix=${PAWPAW_PREFIX}"
  41. # ---------------------------------------------------------------------------------------------------------------------
  42. # libogg
  43. download libogg "${LIBOGG_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/ogg"
  44. patch_file libogg "${LIBOGG_VERSION}" "include/ogg/os_types.h" 's/__MACH__/__MACH_SKIP__/'
  45. build_autoconf libogg "${LIBOGG_VERSION}"
  46. # ---------------------------------------------------------------------------------------------------------------------
  47. # file/magic (posix only)
  48. # if [ "${WIN32}" -eq 0 ]; then
  49. # download file "${FILE_VERSION}" "ftp://ftp.astron.com/pub/file"
  50. # build_autoconf file "${FILE_VERSION}"
  51. # fi
  52. # ---------------------------------------------------------------------------------------------------------------------
  53. # libvorbis
  54. download libvorbis "${LIBVORBIS_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/vorbis"
  55. build_autoconf libvorbis "${LIBVORBIS_VERSION}"
  56. # ---------------------------------------------------------------------------------------------------------------------
  57. # flac
  58. download flac "${FLAC_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/flac" "tar.xz"
  59. build_autoconf flac "${FLAC_VERSION}"
  60. # ---------------------------------------------------------------------------------------------------------------------
  61. # libsamplerate
  62. download libsamplerate "${LIBSAMPLERATE_VERSION}" "http://www.mega-nerd.com/SRC"
  63. build_autoconf libsamplerate "${LIBSAMPLERATE_VERSION}" "--disable-fftw --disable-sndfile"
  64. # ---------------------------------------------------------------------------------------------------------------------
  65. # libsndfile
  66. download libsndfile "${LIBSNDFILE_VERSION}" "http://www.mega-nerd.com/libsndfile/files"
  67. patch_file libsndfile "${LIBSNDFILE_VERSION}" "configure" 's/ -Wvla//'
  68. build_autoconf libsndfile "${LIBSNDFILE_VERSION}" "--disable-full-suite --disable-alsa --disable-sqlite"
  69. # ---------------------------------------------------------------------------------------------------------------------
  70. # lv2
  71. download lv2 "${LV2_VERSION}" "http://lv2plug.in/spec" "tar.bz2"
  72. build_waf lv2 "${LV2_VERSION}" "--lv2dir=${PAWPAW_PREFIX}/lib/lv2"
  73. # ---------------------------------------------------------------------------------------------------------------------
  74. # fftw
  75. FFTW_EXTRAFLAGS="--enable-sse2 --disable-debug --disable-alloca --disable-doc --disable-fortran --with-our-malloc"
  76. # if [ "${WIN32}" -eq 0 ]; then
  77. # FFTW_EXTRAFLAGS="${FFTW_EXTRAFLAGS} --enable-threads"
  78. # fi
  79. download fftw "${FFTW_VERSION}" "http://www.fftw.org"
  80. if [ "${MACOS_OLD}" -eq 1 ]; then
  81. patch_file fftw "${FFTW_VERSION}" "configure" 's/CFLAGS="$CFLAGS -Wl,-no_compact_unwind"/CFLAGS="$CFLAGS"/'
  82. patch_file fftw "${FFTW_VERSION}" "libbench2/timer.c" 's/#if defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_TIMER)/#ifndef HAVE_TIMER/'
  83. fi
  84. build_autoconf fftw "${FFTW_VERSION}" "${FFTW_EXTRAFLAGS}"
  85. # ---------------------------------------------------------------------------------------------------------------------
  86. # fftwf
  87. FFTWF_EXTRAFLAGS="${FFTW_EXTRAFLAGS} --enable-single"
  88. copy_download fftw fftwf "${FFTW_VERSION}"
  89. if [ "${MACOS_OLD}" -eq 1 ]; then
  90. patch_file fftwf "${FFTW_VERSION}" "configure" 's/CFLAGS="$CFLAGS -Wl,-no_compact_unwind"/CFLAGS="$CFLAGS"/'
  91. patch_file fftwf "${FFTW_VERSION}" "libbench2/timer.c" 's/#if defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_TIMER)/#ifndef HAVE_TIMER/'
  92. fi
  93. build_autoconf fftwf "${FFTW_VERSION}" "${FFTWF_EXTRAFLAGS}"
  94. # ---------------------------------------------------------------------------------------------------------------------