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.

93 lines
2.9KB

  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 [ ! -d "${pkgdir}"/drive_c ]; then
  24. env WINEARCH="${PAWPAW_TARGET}" WINEDLLOVERRIDES="mscoree,mshtml=" WINEPREFIX="${pkgdir}" wineboot -u
  25. fi
  26. if [ ! -f "${pkgdir}"/drive_c/InnoSeup/ISCC.exe ]; then
  27. env WINEARCH="${PAWPAW_TARGET}" WINEPREFIX="${pkgdir}" wine "${dlfile}" /allusers /dir=C:\\InnoSeup /nocancel /norestart /verysilent
  28. fi
  29. }
  30. function create_innosetup_exe {
  31. local pkgdir="${PAWPAW_BUILDDIR}/innosetup-6.0.5"
  32. local iscc="${pkgdir}/drive_c/InnoSeup/ISCC.exe"
  33. env WINEARCH="${PAWPAW_TARGET}" WINEPREFIX="${pkgdir}" wine "${iscc}" "setup/inno/${PAWPAW_TARGET}.iss"
  34. }
  35. # ---------------------------------------------------------------------------------------------------------------------
  36. if [ "${WIN32}" -eq 1 ]; then
  37. download_and_install_innosetup
  38. rm -rf /tmp/pawpaw
  39. mkdir /tmp/pawpaw
  40. touch /tmp/pawpaw/components.txt
  41. touch /tmp/pawpaw/lv2bundles.txt
  42. PAWPAW_WINE_LV2DIR="Z:$(echo ${PAWPAW_PREFIX} | tr -t '/' '\\')\\lib\\lv2\\"
  43. fi
  44. # ---------------------------------------------------------------------------------------------------------------------
  45. for plugin in ${@}; do
  46. pfile="${PAWPAW_ROOT}/plugins/${plugin}.json"
  47. if [ ! -e "${pfile}" ]; then
  48. echo "Requested plugin file '${pfile}' does not exist"
  49. exit 2
  50. fi
  51. name=$(jq -crM .name ${pfile})
  52. sname=$(echo ${name} | tr -t '-' '_')
  53. lv2bundles=($(jq -crM .lv2bundles[] ${pfile}))
  54. if [ "${WIN32}" -eq 1 ]; then
  55. echo "Name: ${sname}; Description: \"${name}\"; Types: full;" >> /tmp/pawpaw/components.txt
  56. fi
  57. for lv2bundle in ${lv2bundles[@]}; do
  58. if [ "${WIN32}" -eq 1 ]; then
  59. echo "Source: \"${PAWPAW_WINE_LV2DIR}${lv2bundle}\\*\"; DestDir: \"{commoncf}\\LV2\\${lv2bundle}\"; Components: ${sname}; Flags: recursesubdirs" >> /tmp/pawpaw/lv2bundles.txt
  60. fi
  61. done
  62. done
  63. if [ "${WIN32}" -eq 1 ]; then
  64. create_innosetup_exe
  65. rm -rf /tmp/pawpaw
  66. fi
  67. # ---------------------------------------------------------------------------------------------------------------------