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.

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