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.

147 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. CROSS_COMPILING=0
  13. MACOS=0
  14. MACOS_OLD=0
  15. WIN32=0
  16. WIN64=0
  17. case ${target} in
  18. "macos")
  19. MACOS=1
  20. ;;
  21. "macos-old")
  22. MACOS=1
  23. MACOS_OLD=1
  24. CROSS_COMPILING=1
  25. ;;
  26. "win32")
  27. WIN32=1
  28. CROSS_COMPILING=1
  29. ;;
  30. "win64")
  31. WIN32=1
  32. WIN64=1
  33. CROSS_COMPILING=1
  34. ;;
  35. "native")
  36. echo "TODO"
  37. exit 2
  38. ;;
  39. default)
  40. echo "Invalid target '${target}', possible values are:"
  41. echo "\tmacos"
  42. echo "\tmacos-old"
  43. echo "\twin32"
  44. echo "\twin64"
  45. echo "\tnative"
  46. exit 2
  47. ;;
  48. esac
  49. # ---------------------------------------------------------------------------------------------------------------------
  50. # TODO check for depedencies:
  51. # - curl
  52. # - cmake
  53. # - make
  54. # - jq
  55. # - python (waf, meson)
  56. # - sed
  57. # - tar
  58. source setup/env.sh
  59. source setup/functions.sh
  60. source setup/versions.sh
  61. mkdir -p ${PAWPAW_BUILDDIR}
  62. mkdir -p ${PAWPAW_DOWNLOADDIR}
  63. mkdir -p ${PAWPAW_PREFIX}
  64. mkdir -p ${PAWPAW_TMPDIR}
  65. # ---------------------------------------------------------------------------------------------------------------------
  66. # pkgconfig
  67. download pkg-config "${PKG_CONFIG_VERSION}" "https://pkg-config.freedesktop.org/releases"
  68. build_host_autoconf pkg-config "${PKG_CONFIG_VERSION}" "--enable-indirect-deps --with-internal-glib --with-pc-path=${TARGET_PKG_CONFIG_PATH}"
  69. # ---------------------------------------------------------------------------------------------------------------------
  70. # liblo
  71. download liblo "${LIBLO_VERSION}" "http://download.sourceforge.net/liblo"
  72. build_autoconf liblo "${LIBLO_VERSION}" "--enable-threads --disable-examples --disable-tools"
  73. # ---------------------------------------------------------------------------------------------------------------------
  74. # zlib
  75. download zlib "${ZLIB_VERSION}" "https://github.com/madler/zlib/archive"
  76. build_conf zlib "${ZLIB_VERSION}" "--static --prefix=${PAWPAW_PREFIX}"
  77. # ---------------------------------------------------------------------------------------------------------------------
  78. # libogg
  79. download libogg "${LIBOGG_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/ogg"
  80. patch_file libogg "${LIBOGG_VERSION}" "include/ogg/os_types.h" 's/__MACH__/__MACH_SKIP__/'
  81. build_autoconf libogg "${LIBOGG_VERSION}"
  82. # ---------------------------------------------------------------------------------------------------------------------
  83. # file/magic
  84. # download file "${FILE_VERSION}" "ftp://ftp.astron.com/pub/file"
  85. # build_autoconf file "${FILE_VERSION}"
  86. # ---------------------------------------------------------------------------------------------------------------------
  87. # libvorbis
  88. download libvorbis "${LIBVORBIS_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/vorbis"
  89. build_autoconf libvorbis "${LIBVORBIS_VERSION}"
  90. # ---------------------------------------------------------------------------------------------------------------------
  91. # flac
  92. download flac "${FLAC_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/flac" "tar.xz"
  93. build_autoconf flac "${FLAC_VERSION}"
  94. # ---------------------------------------------------------------------------------------------------------------------
  95. # libsndfile
  96. download libsndfile "${LIBSNDFILE_VERSION}" "http://www.mega-nerd.com/libsndfile/files"
  97. patch_file libsndfile "${LIBSNDFILE_VERSION}" "configure" 's/ -Wvla//'
  98. build_autoconf libsndfile "${LIBSNDFILE_VERSION}" "--disable-full-suite --disable-alsa --disable-sqlite"
  99. # ---------------------------------------------------------------------------------------------------------------------
  100. # lv2
  101. download lv2 "${LV2_VERSION}" "http://lv2plug.in/spec" "tar.bz2"
  102. build_waf lv2 "${LV2_VERSION}" "--lv2dir=${PAWPAW_PREFIX}/lib/lv2"
  103. # ---------------------------------------------------------------------------------------------------------------------
  104. # fftw
  105. download fftw "${FFTW_VERSION}" "http://www.fftw.org"
  106. build_autoconf fftw "${FFTW_VERSION}" "--enable-sse2 --disable-debug --disable-alloca --disable-fortran --with-our-malloc"
  107. # ---------------------------------------------------------------------------------------------------------------------
  108. # fftwf
  109. copy_download fftw fftwf "${FFTW_VERSION}"
  110. build_autoconf fftwf "${FFTW_VERSION}" "--enable-single --enable-sse2 --disable-debug --disable-alloca --disable-fortran --with-our-malloc"
  111. # ---------------------------------------------------------------------------------------------------------------------