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.

107 lines
4.1KB

  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. # TODO check for depedencies:
  14. # - curl
  15. # - cmake
  16. # - make
  17. # - jq
  18. # - patch
  19. # - python (waf, meson)
  20. # - sed
  21. # - tar
  22. # ---------------------------------------------------------------------------------------------------------------------
  23. # source setup code
  24. source setup/check_target.sh
  25. source setup/env.sh
  26. source setup/functions.sh
  27. source setup/versions.sh
  28. # ---------------------------------------------------------------------------------------------------------------------
  29. # create common directories
  30. mkdir -p "${PAWPAW_BUILDDIR}"
  31. mkdir -p "${PAWPAW_DOWNLOADDIR}"
  32. mkdir -p "${PAWPAW_PREFIX}"
  33. mkdir -p "${PAWPAW_TMPDIR}"
  34. # ---------------------------------------------------------------------------------------------------------------------
  35. # let's use native glib for linux builds
  36. if [ "${LINUX}" -eq 1 ]; then
  37. mkdir -p ${TARGET_PKG_CONFIG_PATH}
  38. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/glib-2.0.pc" ]; then
  39. ln -s $(pkg-config --variable=pcfiledir glib-2.0)/g{io,lib,module,object,thread}-2.0.pc ${TARGET_PKG_CONFIG_PATH}/
  40. fi
  41. if [ "${LINUX}" -eq 1 ] && [ ! -e "${TARGET_PKG_CONFIG_PATH}/libpcre.pc" ]; then
  42. ln -s $(pkg-config --variable=pcfiledir libpcre)/libpcre.pc ${TARGET_PKG_CONFIG_PATH}/
  43. fi
  44. fi
  45. # ---------------------------------------------------------------------------------------------------------------------
  46. # pkgconfig
  47. download pkg-config "${PKG_CONFIG_VERSION}" "https://pkg-config.freedesktop.org/releases"
  48. build_host_autoconf pkg-config "${PKG_CONFIG_VERSION}" "--enable-indirect-deps --with-internal-glib --with-pc-path=${TARGET_PKG_CONFIG_PATH}"
  49. # ---------------------------------------------------------------------------------------------------------------------
  50. # libogg
  51. download libogg "${LIBOGG_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/ogg"
  52. patch_file libogg "${LIBOGG_VERSION}" "include/ogg/os_types.h" 's/__MACH__/__MACH_SKIP__/'
  53. build_autoconf libogg "${LIBOGG_VERSION}"
  54. # ---------------------------------------------------------------------------------------------------------------------
  55. # libvorbis
  56. download libvorbis "${LIBVORBIS_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/vorbis"
  57. build_autoconf libvorbis "${LIBVORBIS_VERSION}" "--disable-examples"
  58. # ---------------------------------------------------------------------------------------------------------------------
  59. # flac
  60. FLAC_EXTRAFLAGS="--disable-doxygen-docs --disable-examples --disable-thorough-tests --disable-xmms-plugin"
  61. if [ "${MACOS_OLD}" -eq 1 ]; then
  62. FLAC_EXTRAFLAGS+=" --disable-asm-optimizations"
  63. elif [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
  64. FLAC_EXTRAFLAGS+=" ac_cv_header_x86intrin_h=yes asm_opt=yes"
  65. fi
  66. download flac "${FLAC_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/flac" "tar.xz"
  67. patch_file flac "${FLAC_VERSION}" "configure" 's/amd64|x86_64/amd64|arm|x86_64/'
  68. build_autoconf flac "${FLAC_VERSION}" "${FLAC_EXTRAFLAGS}"
  69. # ---------------------------------------------------------------------------------------------------------------------
  70. # libsamplerate
  71. download libsamplerate "${LIBSAMPLERATE_VERSION}" "http://www.mega-nerd.com/SRC"
  72. build_autoconf libsamplerate "${LIBSAMPLERATE_VERSION}" "--disable-fftw --disable-sndfile"
  73. # ---------------------------------------------------------------------------------------------------------------------
  74. # libsndfile
  75. download libsndfile "${LIBSNDFILE_VERSION}" "http://www.mega-nerd.com/libsndfile/files"
  76. patch_file libsndfile "${LIBSNDFILE_VERSION}" "configure" 's/ -Wvla//'
  77. build_autoconf libsndfile "${LIBSNDFILE_VERSION}" "--disable-alsa --disable-full-suite --disable-sqlite"
  78. # ---------------------------------------------------------------------------------------------------------------------