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.

129 lines
4.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. # - realpath
  20. # - sed
  21. # - tar
  22. source setup/check_target.sh
  23. source setup/env.sh
  24. source setup/functions.sh
  25. source setup/versions.sh
  26. mkdir -p ${PAWPAW_BUILDDIR}
  27. mkdir -p ${PAWPAW_DOWNLOADDIR}
  28. mkdir -p ${PAWPAW_PREFIX}
  29. mkdir -p ${PAWPAW_TMPDIR}
  30. # ---------------------------------------------------------------------------------------------------------------------
  31. # pkgconfig
  32. download pkg-config "${PKG_CONFIG_VERSION}" "https://pkg-config.freedesktop.org/releases"
  33. build_host_autoconf pkg-config "${PKG_CONFIG_VERSION}" "--enable-indirect-deps --with-internal-glib --with-pc-path=${TARGET_PKG_CONFIG_PATH}"
  34. # ---------------------------------------------------------------------------------------------------------------------
  35. # liblo
  36. download liblo "${LIBLO_VERSION}" "http://download.sourceforge.net/liblo"
  37. build_autoconf liblo "${LIBLO_VERSION}" "--enable-threads --disable-examples --disable-tools"
  38. # ---------------------------------------------------------------------------------------------------------------------
  39. # zlib
  40. download zlib "${ZLIB_VERSION}" "https://github.com/madler/zlib/archive"
  41. build_conf zlib "${ZLIB_VERSION}" "--static --prefix=${PAWPAW_PREFIX}"
  42. # ---------------------------------------------------------------------------------------------------------------------
  43. # libogg
  44. download libogg "${LIBOGG_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/ogg"
  45. patch_file libogg "${LIBOGG_VERSION}" "include/ogg/os_types.h" 's/__MACH__/__MACH_SKIP__/'
  46. build_autoconf libogg "${LIBOGG_VERSION}"
  47. # ---------------------------------------------------------------------------------------------------------------------
  48. # file/magic
  49. # download file "${FILE_VERSION}" "ftp://ftp.astron.com/pub/file"
  50. # build_autoconf file "${FILE_VERSION}"
  51. # ---------------------------------------------------------------------------------------------------------------------
  52. # libvorbis
  53. download libvorbis "${LIBVORBIS_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/vorbis"
  54. build_autoconf libvorbis "${LIBVORBIS_VERSION}"
  55. # ---------------------------------------------------------------------------------------------------------------------
  56. # flac
  57. download flac "${FLAC_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/flac" "tar.xz"
  58. build_autoconf flac "${FLAC_VERSION}"
  59. # ---------------------------------------------------------------------------------------------------------------------
  60. # libsndfile
  61. download libsndfile "${LIBSNDFILE_VERSION}" "http://www.mega-nerd.com/libsndfile/files"
  62. patch_file libsndfile "${LIBSNDFILE_VERSION}" "configure" 's/ -Wvla//'
  63. build_autoconf libsndfile "${LIBSNDFILE_VERSION}" "--disable-full-suite --disable-alsa --disable-sqlite"
  64. # ---------------------------------------------------------------------------------------------------------------------
  65. # lv2
  66. download lv2 "${LV2_VERSION}" "http://lv2plug.in/spec" "tar.bz2"
  67. build_waf lv2 "${LV2_VERSION}" "--lv2dir=${PAWPAW_PREFIX}/lib/lv2"
  68. # ---------------------------------------------------------------------------------------------------------------------
  69. # fftw
  70. FFTW_EXTRAFLAGS="--enable-sse2 --disable-debug --disable-alloca --disable-doc --disable-fortran --with-our-malloc"
  71. # if [ "${WIN32}" -eq 0 ]; then
  72. # FFTW_EXTRAFLAGS="${FFTW_EXTRAFLAGS} --enable-threads"
  73. # fi
  74. download fftw "${FFTW_VERSION}" "http://www.fftw.org"
  75. if [ "${MACOS_OLD}" -eq 1 ]; then
  76. patch_file fftw "${FFTW_VERSION}" "configure" 's/CFLAGS="$CFLAGS -Wl,-no_compact_unwind"/CFLAGS="$CFLAGS"/'
  77. patch_file fftw "${FFTW_VERSION}" "libbench2/timer.c" 's/#if defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_TIMER)/#ifndef HAVE_TIMER/'
  78. fi
  79. build_autoconf fftw "${FFTW_VERSION}" "${FFTW_EXTRAFLAGS}"
  80. # ---------------------------------------------------------------------------------------------------------------------
  81. # fftwf
  82. FFTWF_EXTRAFLAGS="${FFTW_EXTRAFLAGS} --enable-single"
  83. copy_download fftw fftwf "${FFTW_VERSION}"
  84. if [ "${MACOS_OLD}" -eq 1 ]; then
  85. patch_file fftwf "${FFTW_VERSION}" "configure" 's/CFLAGS="$CFLAGS -Wl,-no_compact_unwind"/CFLAGS="$CFLAGS"/'
  86. patch_file fftwf "${FFTW_VERSION}" "libbench2/timer.c" 's/#if defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_TIMER)/#ifndef HAVE_TIMER/'
  87. fi
  88. build_autoconf fftwf "${FFTW_VERSION}" "${FFTWF_EXTRAFLAGS}"
  89. # ---------------------------------------------------------------------------------------------------------------------