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.

130 lines
5.2KB

  1. #!/bin/bash
  2. set -e
  3. cd $(dirname ${0})
  4. PAWPAW_ROOT="${PWD}"
  5. JACK2_VERSION=${JACK2_VERSION:=git}
  6. JACK_ROUTER_VERSION=${JACK_ROUTER_VERSION:=6c2e532bb05d2ba59ef210bef2fe270d588c2fdf}
  7. QJACKCTL_VERSION=${QJACKCTL_VERSION:=0.9.0}
  8. # ---------------------------------------------------------------------------------------------------------------------
  9. target="${1}"
  10. if [ -z "${target}" ]; then
  11. echo "usage: ${0} <target> [package-build?]"
  12. exit 1
  13. fi
  14. # TODO check that bootstrap-jack.sh has been run
  15. # ---------------------------------------------------------------------------------------------------------------------
  16. source setup/check_target.sh
  17. source setup/env.sh
  18. source setup/functions.sh
  19. source setup/versions.sh
  20. # ---------------------------------------------------------------------------------------------------------------------
  21. jack2_repo="https://github.com/jackaudio/jack2.git"
  22. jack2_prefix="${PAWPAW_PREFIX}-jack2"
  23. if [ "${MACOS}" -eq 1 ]; then
  24. jack2_extra_prefix="/usr/local"
  25. fi
  26. # ---------------------------------------------------------------------------------------------------------------------
  27. if [ ! -e jack2 ]; then
  28. ln -s "${PAWPAW_BUILDDIR}/jack2-${JACK2_VERSION}" jack2
  29. fi
  30. # ---------------------------------------------------------------------------------------------------------------------
  31. if [ "${WIN32}" -eq 1 ]; then
  32. # setup innosetup
  33. dlfile="${PAWPAW_DOWNLOADDIR}/innosetup-6.0.5.exe"
  34. innodir="${PAWPAW_BUILDDIR}/innosetup-6.0.5"
  35. iscc="${innodir}/drive_c/InnoSeup/ISCC.exe"
  36. wine="env WINEARCH="${PAWPAW_TARGET}" WINEDLLOVERRIDES="mscoree,mshtml=" WINEPREFIX="${innodir}" wine"
  37. # download it
  38. if [ ! -f "${dlfile}" ]; then
  39. # FIXME proper dl version
  40. curl -L https://jrsoftware.org/download.php/is.exe?site=2 -o "${dlfile}"
  41. fi
  42. # initialize wine
  43. if [ ! -d "${innodir}"/drive_c ]; then
  44. ${wine}boot -u
  45. fi
  46. # install innosetup in custom wineprefix
  47. if [ ! -f "${innodir}"/drive_c/InnoSeup/ISCC.exe ]; then
  48. ${wine} "${dlfile}" /allusers /dir=C:\\InnoSeup /nocancel /norestart /verysilent
  49. fi
  50. # copy jackrouter binaries
  51. mkdir -p "${jack2_prefix}/jack-router/win32"
  52. mkdir -p "${jack2_prefix}/jack-router/win64"
  53. copy_file jack-router "${JACK_ROUTER_VERSION}" "README-win" "${jack2_prefix}/jack-router/README.txt"
  54. copy_file jack-router "${JACK_ROUTER_VERSION}" "binaries/win32/JackRouter.dll" "${jack2_prefix}/jack-router/win32/JackRouter.dll"
  55. copy_file jack-router "${JACK_ROUTER_VERSION}" "binaries/win32/JackRouter.ini" "${jack2_prefix}/jack-router/win32/JackRouter.ini"
  56. if [ "${WIN64}" -eq 1 ]; then
  57. copy_file jack-router "${JACK_ROUTER_VERSION}" "binaries/win64/JackRouter.dll" "${jack2_prefix}/jack-router/win64/JackRouter.dll"
  58. copy_file jack-router "${JACK_ROUTER_VERSION}" "binaries/win64/JackRouter.ini" "${jack2_prefix}/jack-router/win64/JackRouter.ini"
  59. fi
  60. # finally create the installer file
  61. pushd "${PAWPAW_BUILDDIR}/jack2-${JACK2_VERSION}/windows/inno"
  62. echo "#define VERSION \"${JACK2_VERSION}\"" > "version.iss"
  63. ln -sf "${PAWPAW_PREFIX}/bin/Qt5"{Core,Gui,Network,Widgets,Xml}".dll" .
  64. ln -sf "${PAWPAW_PREFIX}/lib/qt5/plugins/platforms/qwindows.dll" .
  65. ln -sf "${jack2_prefix}" "${PAWPAW_TARGET}"
  66. ${wine} "${iscc}" "${PAWPAW_TARGET}.iss"
  67. popd
  68. # and move installer file where CI expects it to be
  69. mv "${PAWPAW_BUILDDIR}/jack2-${JACK2_VERSION}/windows/inno/"*.exe .
  70. elif [ "${MACOS}" -eq 1 ]; then
  71. for f in $(ls "${jack2_prefix}${jack2_extra_prefix}/bin"/* \
  72. "${jack2_prefix}${jack2_extra_prefix}/lib"/*.dylib \
  73. "${jack2_prefix}${jack2_extra_prefix}/lib/jack"/*); do
  74. patch_osx_binary_libs "${f}"
  75. done
  76. jack2_lastversion=$(cat jack2/wscript | awk 'sub("VERSION=","")' | tr -d "'")
  77. ./jack2/macosx/generate-pkg.sh "${jack2_prefix}${jack2_extra_prefix}/"
  78. qjackctl_app="${PAWPAW_PREFIX}/bin/qjackctl.app"
  79. qjackctl_dir="${qjackctl_app}/Contents/MacOS"
  80. patch_osx_qtapp qjackctl "${QJACKCTL_VERSION}" "${qjackctl_app}"
  81. patch_osx_binary_libs "${qjackctl_dir}/qjackctl"
  82. cp "${PAWPAW_ROOT}/patches/qjackctl/QjackCtl.icns" "${qjackctl_app}/Contents/Resources/QjackCtl.icns"
  83. sed -i -e 's|Created by Qt/QMake|JACK Audio Connection Kit Qt GUI Interface|' "${qjackctl_app}/Contents/Info.plist"
  84. sed -i -e 's|com.yourcompany.qjackctl|org.rncbc.QjackCtl|' "${qjackctl_app}/Contents/Info.plist"
  85. sed -i -e 's|string>qjackctl</string>|string>QjackCtl</string>|' "${qjackctl_app}/Contents/Info.plist"
  86. sed -i -e 's|<string></string>|<string>QjackCtl.icns</string>|' "${qjackctl_app}/Contents/Info.plist"
  87. rm "${qjackctl_app}/Contents/Info.plist-e"
  88. mv "${qjackctl_app}/Contents/MacOS/qjackctl" "${qjackctl_app}/Contents/MacOS/QjackCtl"
  89. rm -rf jack2/macosx/qjackctl.app
  90. cp -rv "${qjackctl_app}" jack2/macosx/QjackCtl.app
  91. if [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
  92. variant="universal"
  93. else
  94. variant="intel"
  95. fi
  96. rm -f jack2-macOS-${variant}-${JACK2_VERSION}.tar.gz
  97. tar czf jack2-macOS-${variant}-${JACK2_VERSION}.tar.gz -C jack2/macosx jack2-osx-${jack2_lastversion}.pkg QjackCtl.app
  98. fi
  99. # ---------------------------------------------------------------------------------------------------------------------