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.

89 lines
2.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> <plugin1> ..."
  9. exit 1
  10. fi
  11. shift
  12. # ---------------------------------------------------------------------------------------------------------------------
  13. source setup/check_target.sh
  14. source setup/env.sh
  15. # ---------------------------------------------------------------------------------------------------------------------
  16. function download_and_install_innosetup {
  17. local dlfile="${PAWPAW_DOWNLOADDIR}/innosetup-6.0.5.exe"
  18. local pkgdir="${PAWPAW_BUILDDIR}/innosetup-6.0.5"
  19. if [ ! -f "${dlfile}" ]; then
  20. # FIXME proper dl version
  21. curl -L https://jrsoftware.org/download.php/is.exe?site=2 -o "${dlfile}"
  22. fi
  23. if [ ! -f "${pkgdir}"/drive_c/InnoSeup/ISCC.exe ]; then
  24. env WINEARCH="${PAWPAW_TARGET}" WINEPREFIX="${pkgdir}" wine "${dlfile}" /allusers /dir=C:\\InnoSeup /nocancel /norestart /verysilent
  25. fi
  26. }
  27. function create_innosetup_exe {
  28. local pkgdir="${PAWPAW_BUILDDIR}/innosetup-6.0.5"
  29. local iscc="${pkgdir}/drive_c/InnoSeup/ISCC.exe"
  30. env WINEARCH="${PAWPAW_TARGET}" WINEPREFIX="${pkgdir}" wine "${iscc}" setup/inno/plugins.iss
  31. }
  32. # ---------------------------------------------------------------------------------------------------------------------
  33. if [ "${WIN32}" -eq 1 ]; then
  34. download_and_install_innosetup
  35. rm -rf /tmp/pawpaw
  36. mkdir /tmp/pawpaw
  37. touch /tmp/pawpaw/components.txt
  38. touch /tmp/pawpaw/lv2bundles.txt
  39. PAWPAW_WINE_LV2DIR="Z:$(echo ${PAWPAW_PREFIX} | tr -t '/' '\\')\\lib\\lv2\\"
  40. fi
  41. # ---------------------------------------------------------------------------------------------------------------------
  42. for plugin in ${@}; do
  43. pfile="${PAWPAW_ROOT}/plugins/${plugin}.json"
  44. if [ ! -e "${pfile}" ]; then
  45. echo "Requested plugin file '${pfile}' does not exist"
  46. exit 2
  47. fi
  48. name=$(jq -crM .name ${pfile})
  49. sname=$(echo ${name} | tr -t '-' '_')
  50. lv2bundles=($(jq -crM .lv2bundles[] ${pfile}))
  51. if [ "${WIN32}" -eq 1 ]; then
  52. echo "Name: ${sname}; Description: \"${name}\"; Types: full;" >> /tmp/pawpaw/components.txt
  53. fi
  54. for lv2bundle in ${lv2bundles[@]}; do
  55. if [ "${WIN32}" -eq 1 ]; then
  56. echo "Source: \"${PAWPAW_WINE_LV2DIR}${lv2bundle}\\*\"; DestDir: \"{commoncf}\\LV2\\${lv2bundle}\"; Components: ${sname}; Flags: recursesubdirs" >> /tmp/pawpaw/lv2bundles.txt
  57. fi
  58. done
  59. done
  60. if [ "${WIN32}" -eq 1 ]; then
  61. create_innosetup_exe
  62. rm -rf /tmp/pawpaw
  63. fi
  64. # ---------------------------------------------------------------------------------------------------------------------