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.

bootstrap-common.sh 5.0KB

7 months ago
7 months ago
1 month ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. # opus
  71. OPUS_EXTRAFLAGS="--disable-extra-programs --enable-custom-modes --enable-float-approx"
  72. # FIXME
  73. if [ "${MACOS_OLD}" -eq 1 ] || [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
  74. OPUS_EXTRAFLAGS+=" --disable-asm --disable-rtcd --disable-intrinsics"
  75. fi
  76. download opus "${OPUS_VERSION}" "https://archive.mozilla.org/pub/opus"
  77. build_autoconf opus "${OPUS_VERSION}" "${OPUS_EXTRAFLAGS}"
  78. # ---------------------------------------------------------------------------------------------------------------------
  79. # libsamplerate
  80. download libsamplerate "${LIBSAMPLERATE_VERSION}" "http://www.mega-nerd.com/SRC"
  81. build_autoconf libsamplerate "${LIBSAMPLERATE_VERSION}" "--disable-fftw --disable-sndfile"
  82. # ---------------------------------------------------------------------------------------------------------------------
  83. # libsndfile
  84. download libsndfile "${LIBSNDFILE_VERSION}" "https://github.com/libsndfile/libsndfile/releases/download/${LIBSNDFILE_VERSION}" "tar.bz2"
  85. if [ "${MACOS_OLD}" -eq 1 ]; then
  86. patch_file libsndfile "${LIBSNDFILE_VERSION}" "src/sfconfig.h" 's/#define USE_SSE2/#undef USE_SSE2/'
  87. fi
  88. build_autoconf libsndfile "${LIBSNDFILE_VERSION}" "--disable-alsa --disable-full-suite --disable-sqlite"
  89. # ---------------------------------------------------------------------------------------------------------------------
  90. # zlib (skipped on macOS)
  91. if [ "${MACOS}" -eq 0 ]; then
  92. download zlib ${ZLIB_VERSION} "https://github.com/madler/zlib.git" "" "git"
  93. build_conf zlib ${ZLIB_VERSION} "--static --prefix=${PAWPAW_PREFIX}"
  94. fi
  95. # ---------------------------------------------------------------------------------------------------------------------