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.

79 lines
2.3KB

  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> <plugin1> ..."
  9. exit 1
  10. fi
  11. shift
  12. # TODO check that bootstrap.sh has been run
  13. # ---------------------------------------------------------------------------------------------------------------------
  14. source setup/check_target.sh
  15. source setup/env.sh
  16. source setup/functions.sh
  17. source setup/versions.sh
  18. # ---------------------------------------------------------------------------------------------------------------------
  19. if [ "${WIN32}" -eq 1 ] && [ ! -d "${HOME}/.wine" ]; then
  20. env WINEARCH="${PAWPAW_TARGET}" WINEDLLOVERRIDES="mscoree,mshtml=" wineboot -u
  21. fi
  22. # ---------------------------------------------------------------------------------------------------------------------
  23. for plugin in ${@}; do
  24. pfile="${PAWPAW_ROOT}/plugins/${plugin}.json"
  25. if [ ! -e "${pfile}" ]; then
  26. echo "Requested plugin file '${pfile}' does not exist"
  27. exit 2
  28. fi
  29. name=$(jq -crM .name ${pfile})
  30. version=$(jq -crM .version ${pfile})
  31. buildtype=$(jq -crM .buildtype ${pfile})
  32. dlbaseurl=$(jq -crM .dlbaseurl ${pfile})
  33. # optional args
  34. buildargs=$(echo -e $(jq -ecrM .buildargs ${pfile} || echo '\n\n') | tail -n 1)
  35. dlext=$(echo -e $(jq -ecrM .dlext ${pfile} || echo '\n\n') | tail -n 1)
  36. dlmethod=$(echo -e $(jq -ecrM .dlmethod ${pfile} || echo '\n\n') | tail -n 1)
  37. download "${name}" "${version}" "${dlbaseurl}" "${dlext}" "${dlmethod}"
  38. case ${buildtype} in
  39. "autoconf")
  40. build_autoconf "${name}" "${version}" "${buildargs}"
  41. ;;
  42. "conf")
  43. build_conf "${name}" "${version}" "${buildargs}"
  44. ;;
  45. "cmake")
  46. build_cmake "${name}" "${version}" "${buildargs}"
  47. ;;
  48. "make")
  49. build_make "${name}" "${version}" "${buildargs}"
  50. ;;
  51. "meson")
  52. build_meson "${name}" "${version}" "${buildargs}"
  53. ;;
  54. "waf")
  55. build_waf "${name}" "${version}" "${buildargs}"
  56. ;;
  57. esac
  58. done
  59. # ---------------------------------------------------------------------------------------------------------------------