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.

653 lines
18KB

  1. #!/bin/bash
  2. # ---------------------------------------------------------------------------------------------------------------------
  3. function download() {
  4. local name="${1}"
  5. local version="${2}"
  6. local dlbaseurl="${3}"
  7. local dlext="${4}"
  8. local dlmethod="${5}"
  9. local dlname="${6}"
  10. if [ -z "${dlext}" ]; then
  11. dlext="tar.gz"
  12. fi
  13. if [ -z "${dlname}" ]; then
  14. dlname="${name}"
  15. fi
  16. local dlfile="${PAWPAW_DOWNLOADDIR}/${dlname}-${version}.${dlext}"
  17. local dlfolder="${PAWPAW_BUILDDIR}/${name}-${version}"
  18. if [ ! -f "${dlfile}" ]; then
  19. if [ -n "${dlmethod}" ] && [ "${dlmethod}" = "git" ]; then
  20. local tmprepodir="${PAWPAW_TMPDIR}/${dlname}-${version}"
  21. rm -rf "${tmprepodir}"
  22. git clone --recursive "${dlbaseurl}" "${tmprepodir}"
  23. git -C "${tmprepodir}" checkout "${version}"
  24. git -C "${tmprepodir}" submodule update
  25. tar --exclude=".git" -czf "${dlfile}" -C "${PAWPAW_TMPDIR}" "${dlname}-${version}"
  26. rm -rf "${tmprepodir}"
  27. else
  28. local dlurl
  29. if echo ${dlbaseurl} | grep -q github.com | grep -q -v releases; then
  30. if [ x"${dlmethod}" = x"nv" ]; then
  31. dlurl="${dlbaseurl}/${version}.${dlext}"
  32. else
  33. dlurl="${dlbaseurl}/v${version}.${dlext}"
  34. fi
  35. elif [ "${dlext}" = "orig.tar.gz" ]; then
  36. dlurl="${dlbaseurl}/${dlname}_${version}.${dlext}"
  37. else
  38. dlurl="${dlbaseurl}/${dlname}-${version}.${dlext}"
  39. fi
  40. curl -L "${dlurl}" -o "${dlfile}" --fail
  41. fi
  42. fi
  43. if [ ! -d "${dlfolder}" ]; then
  44. mkdir "${dlfolder}"
  45. tar -xf "${dlfile}" -C "${dlfolder}" --strip-components=1
  46. fi
  47. }
  48. function copy_download() {
  49. local name1="${1}"
  50. local name2="${2}"
  51. local version="${3}"
  52. local dlext="${4}"
  53. if [ -z "${dlext}" ]; then
  54. dlext="tar.gz"
  55. fi
  56. local dlfile1="${PAWPAW_DOWNLOADDIR}/${name1}-${version}.${dlext}"
  57. local dlfolder2="${PAWPAW_BUILDDIR}/${name2}-${version}"
  58. if [ ! -d "${dlfolder2}" ]; then
  59. mkdir "${dlfolder2}"
  60. tar -xf "${dlfile1}" -C "${dlfolder2}" --strip-components=1
  61. fi
  62. }
  63. # ---------------------------------------------------------------------------------------------------------------------
  64. function _prebuild() {
  65. local name="${1}"
  66. local pkgdir="${2}"
  67. export AR="${TARGET_AR}"
  68. export CC="${TARGET_CC}"
  69. export CXX="${TARGET_CXX}"
  70. export DLLWRAP="${TARGET_DLLWRAP}"
  71. export LD="${TARGET_LD}"
  72. export STRIP="${TARGET_STRIP}"
  73. export WINDRES="${TARGET_WINDRES}"
  74. export CFLAGS="${TARGET_CFLAGS} ${EXTRA_CFLAGS}"
  75. export CXXFLAGS="${TARGET_CXXFLAGS} ${EXTRA_CXXFLAGS}"
  76. export LDFLAGS="${TARGET_LDFLAGS} ${EXTRA_LDFLAGS}"
  77. export PKG_CONFIG_PATH="${TARGET_PKG_CONFIG_PATH}"
  78. unset CPPFLAGS
  79. export OLD_PATH="${PATH}"
  80. export PATH="${TARGET_PATH}"
  81. if [ -d "${PAWPAW_ROOT}/patches/${name}" ] && [ ! -f "${pkgdir}/.stamp_cleanup" ]; then
  82. for p in $(ls "${PAWPAW_ROOT}/patches/${name}/" | grep "\.patch$" | sort); do
  83. if [ ! -f "${pkgdir}/.stamp_applied_${p}" ]; then
  84. patch -p1 -d "${pkgdir}" -i "${PAWPAW_ROOT}/patches/${name}/${p}"
  85. touch "${pkgdir}/.stamp_applied_${p}"
  86. fi
  87. done
  88. fi
  89. if [ -d "${PAWPAW_ROOT}/patches/${name}/${PAWPAW_TARGET}" ] && [ ! -f "${pkgdir}/.stamp_cleanup" ]; then
  90. for p in $(ls "${PAWPAW_ROOT}/patches/${name}/${PAWPAW_TARGET}/" | grep "\.patch$" | sort); do
  91. if [ ! -f "${pkgdir}/.stamp_applied_${p}" ]; then
  92. patch -p1 -d "${pkgdir}" -i "${PAWPAW_ROOT}/patches/${name}/${PAWPAW_TARGET}/${p}"
  93. touch "${pkgdir}/.stamp_applied_${p}"
  94. fi
  95. done
  96. fi
  97. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  98. rm -f "${pkgdir}/.stamp_built"
  99. rm -f "${pkgdir}/.stamp_installed"
  100. rm -f "${pkgdir}/.stamp_verified"
  101. rm -f "${pkgdir}/CMakeCache.txt"
  102. elif [ ! -f "${pkgdir}/.stamp_built" ]; then
  103. rm -f "${pkgdir}/.stamp_installed"
  104. rm -f "${pkgdir}/.stamp_verified"
  105. elif [ ! -f "${pkgdir}/.stamp_installed" ]; then
  106. rm -f "${pkgdir}/.stamp_verified"
  107. fi
  108. }
  109. function _postbuild() {
  110. unset AR
  111. unset CC
  112. unset CXX
  113. unset DLLWRAP
  114. unset LD
  115. unset STRIP
  116. unset WINDRES
  117. unset CFLAGS
  118. unset CPPFLAGS
  119. unset CXXFLAGS
  120. unset LDFLAGS
  121. unset PKG_CONFIG_PATH
  122. unset EXTRA_CFLAGS
  123. unset EXTRA_CXXFLAGS
  124. unset EXTRA_LDFLAGS
  125. unset EXTRA_MAKE_ARGS
  126. export PATH="${OLD_PATH}"
  127. }
  128. # ---------------------------------------------------------------------------------------------------------------------
  129. function build_autoconf() {
  130. local name="${1}"
  131. local version="${2}"
  132. local extraconfrules="${3}"
  133. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  134. if [ "${CROSS_COMPILING}" -eq 1 ]; then
  135. extraconfrules="--host=${TOOLCHAIN_PREFIX} ${extraconfrules}"
  136. fi
  137. _prebuild "${name}" "${pkgdir}"
  138. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  139. pushd "${pkgdir}"
  140. ./configure --enable-static --disable-shared --disable-debug --disable-doc --disable-docs --disable-maintainer-mode --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
  141. touch .stamp_configured
  142. popd
  143. fi
  144. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  145. pushd "${pkgdir}"
  146. make ${MAKE_ARGS} ${EXTRA_MAKE_ARGS}
  147. touch .stamp_built
  148. popd
  149. fi
  150. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  151. pushd "${pkgdir}"
  152. make ${MAKE_ARGS} install -j 1
  153. touch .stamp_installed
  154. popd
  155. fi
  156. _postbuild
  157. }
  158. function build_autoconfgen() {
  159. local name="${1}"
  160. local version="${2}"
  161. local extraconfrules="${3}"
  162. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  163. local EXTRA_CFLAGS2="${EXTRA_CFLAGS}"
  164. local EXTRA_CXXFLAGS2="${EXTRA_CXXFLAGS}"
  165. local EXTRA_LDFLAGS2="${EXTRA_LDFLAGS}"
  166. local EXTRA_MAKE_ARGS2="${EXTRA_MAKE_ARGS}"
  167. _prebuild "${name}" "${pkgdir}"
  168. if [ ! -f "${pkgdir}/.stamp_preconfigured" ]; then
  169. pushd "${pkgdir}"
  170. if [ -f utils/autogen.sh ]; then
  171. ./utils/autogen.sh
  172. else
  173. autoconf
  174. fi
  175. touch .stamp_preconfigured
  176. popd
  177. fi
  178. _postbuild
  179. export EXTRA_CFLAGS="${EXTRA_CFLAGS2}"
  180. export EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS2}"
  181. export EXTRA_LDFLAGS="${EXTRA_LDFLAGS2}"
  182. export EXTRA_MAKE_ARGS="${EXTRA_MAKE_ARGS2}"
  183. build_autoconf "${name}" "${version}" "${extraconfrules}"
  184. }
  185. function build_conf() {
  186. local name="${1}"
  187. local version="${2}"
  188. local extraconfrules="${3}"
  189. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  190. _prebuild "${name}" "${pkgdir}"
  191. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  192. pushd "${pkgdir}"
  193. ./configure ${extraconfrules}
  194. touch .stamp_configured
  195. popd
  196. fi
  197. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  198. pushd "${pkgdir}"
  199. make ${MAKE_ARGS} ${EXTRA_MAKE_ARGS}
  200. touch .stamp_built
  201. popd
  202. fi
  203. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  204. pushd "${pkgdir}"
  205. make ${MAKE_ARGS} -j 1 install
  206. touch .stamp_installed
  207. popd
  208. fi
  209. _postbuild
  210. }
  211. function build_cmake() {
  212. local name="${1}"
  213. local version="${2}"
  214. local extraconfrules="${3}"
  215. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  216. _prebuild "${name}" "${pkgdir}"
  217. mkdir -p "${pkgdir}/build"
  218. if [ "${CROSS_COMPILING}" -eq 1 ]; then
  219. extraconfrules+=" -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}"
  220. fi
  221. if [ "${MACOS}" -eq 1 ]; then
  222. if [ "${MACOS_OLD}" -eq 1 ]; then
  223. OSX_ARCHS="i686"
  224. OSX_TARGET="10.5"
  225. elif [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
  226. OSX_ARCHS="arm64;x86_64"
  227. OSX_TARGET="10.12"
  228. else
  229. OSX_ARCHS="x86_64"
  230. OSX_TARGET="10.8"
  231. fi
  232. extraconfrules+=" -DCMAKE_OSX_ARCHITECTURES=${OSX_ARCHS}"
  233. extraconfrules+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=${OSX_TARGET}"
  234. fi
  235. if [ "${WIN32}" -eq 1 ]; then
  236. extraconfrules+=" -DCMAKE_RC_COMPILER=${WINDRES}"
  237. fi
  238. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  239. pushd "${pkgdir}/build"
  240. cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX="${PAWPAW_PREFIX}" ${extraconfrules} ..
  241. touch ../.stamp_configured
  242. popd
  243. fi
  244. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  245. pushd "${pkgdir}/build"
  246. make ${MAKE_ARGS} ${EXTRA_MAKE_ARGS}
  247. touch ../.stamp_built
  248. popd
  249. fi
  250. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  251. pushd "${pkgdir}/build"
  252. make ${MAKE_ARGS} -j 1 install
  253. touch ../.stamp_installed
  254. popd
  255. fi
  256. _postbuild
  257. }
  258. function build_make() {
  259. local name="${1}"
  260. local version="${2}"
  261. local extraconfrules="${3}"
  262. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  263. _prebuild "${name}" "${pkgdir}"
  264. touch "${pkgdir}/.stamp_configured"
  265. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  266. pushd "${pkgdir}"
  267. make PREFIX="${PAWPAW_PREFIX}" PKG_CONFIG="${TARGET_PKG_CONFIG}" ${MAKE_ARGS} ${extraconfrules}
  268. touch .stamp_built
  269. popd
  270. fi
  271. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  272. pushd "${pkgdir}"
  273. make PREFIX="${PAWPAW_PREFIX}" PKG_CONFIG="${TARGET_PKG_CONFIG}" ${MAKE_ARGS} ${extraconfrules} -j 1 install
  274. touch .stamp_installed
  275. popd
  276. fi
  277. _postbuild
  278. }
  279. function build_meson() {
  280. local name="${1}"
  281. local version="${2}"
  282. local extraconfrules="${3}"
  283. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  284. if [ "${CROSS_COMPILING}" -eq 1 ]; then
  285. extraconfrules="--cross-file "${PAWPAW_ROOT}/setup/meson/${PAWPAW_TARGET}.ini" ${extraconfrules}"
  286. fi
  287. _prebuild "${name}" "${pkgdir}"
  288. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  289. pushd "${pkgdir}"
  290. meson build --buildtype release --prefix "${PAWPAW_PREFIX}" ${extraconfrules}
  291. touch .stamp_configured
  292. popd
  293. fi
  294. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  295. pushd "${pkgdir}"
  296. ninja -v -C build
  297. touch .stamp_built
  298. popd
  299. fi
  300. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  301. pushd "${pkgdir}"
  302. ninja -C build install
  303. touch .stamp_installed
  304. popd
  305. fi
  306. _postbuild
  307. }
  308. function build_python() {
  309. local name="${1}"
  310. local version="${2}"
  311. local extraconfrules="${3}"
  312. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  313. local python="python$(echo ${PYTHON_VERSION} | cut -b 1,2,3)"
  314. _prebuild "${name}" "${pkgdir}"
  315. # fix build of python packages
  316. export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fvisibility=hidden//')"
  317. export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-ffast-math//')"
  318. export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fdata-sections -ffunction-sections//')"
  319. export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fvisibility=hidden//')"
  320. export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-ffast-math//')"
  321. export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fvisibility-inlines-hidden//')"
  322. export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fdata-sections -ffunction-sections//')"
  323. export LDFLAGS="$(echo ${LDFLAGS} | sed -e 's/-Wl,-dead_strip -Wl,-dead_strip_dylibs//')"
  324. export LDFLAGS="$(echo ${LDFLAGS} | sed -e 's/-Wl,--strip-all//')"
  325. export LDFLAGS="$(echo ${LDFLAGS} | sed -e 's/-Wl,--gc-sections//')"
  326. export LDFLAGS="$(echo ${LDFLAGS} | sed -e 's/-fdata-sections -ffunction-sections//')"
  327. touch "${pkgdir}/.stamp_configured"
  328. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  329. pushd "${pkgdir}"
  330. ${python} setup.py build ${extraconfrules} --verbose
  331. touch .stamp_built
  332. popd
  333. fi
  334. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  335. pushd "${pkgdir}"
  336. ${python} setup.py install --prefix="${PAWPAW_PREFIX}" ${extraconfrules} --verbose
  337. touch .stamp_installed
  338. popd
  339. fi
  340. _postbuild
  341. }
  342. function build_qmake() {
  343. local name="${1}"
  344. local version="${2}"
  345. local extraconfrules="${3}"
  346. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  347. _prebuild "${name}" "${pkgdir}"
  348. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  349. pushd "${pkgdir}"
  350. qmake ${extraconfrules}
  351. touch .stamp_configured
  352. popd
  353. fi
  354. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  355. pushd "${pkgdir}"
  356. make ${MAKE_ARGS} ${EXTRA_MAKE_ARGS}
  357. touch .stamp_built
  358. popd
  359. fi
  360. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  361. pushd "${pkgdir}"
  362. make ${MAKE_ARGS} -j 1 install
  363. touch .stamp_installed
  364. popd
  365. fi
  366. _postbuild
  367. }
  368. function build_waf() {
  369. local name="${1}"
  370. local version="${2}"
  371. local extraconfrules="${3}"
  372. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  373. local python=python3
  374. if ! which python3 > /dev/null; then
  375. python=python
  376. fi
  377. _prebuild "${name}" "${pkgdir}"
  378. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  379. pushd "${pkgdir}"
  380. ${python} waf configure --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
  381. touch .stamp_configured
  382. popd
  383. fi
  384. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  385. pushd "${pkgdir}"
  386. ${python} waf build ${WAF_ARGS}
  387. touch .stamp_built
  388. popd
  389. fi
  390. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  391. pushd "${pkgdir}"
  392. ${python} waf install ${WAF_ARGS} --prefix="${PAWPAW_PREFIX}" ${extraconfrules} -j 1
  393. rm -f ${PAWPAW_PREFIX}/lib/lv2/*/*.a
  394. touch .stamp_installed
  395. popd
  396. fi
  397. _postbuild
  398. }
  399. # ---------------------------------------------------------------------------------------------------------------------
  400. function build_host_autoconf() {
  401. local name="${1}"
  402. local version="${2}"
  403. local extraconfrules="${3}"
  404. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  405. unset AR
  406. unset CC
  407. unset CXX
  408. unset LD
  409. unset STRIP
  410. unset CFLAGS
  411. unset CPPFLAGS
  412. unset CXXFLAGS
  413. unset LDFLAGS
  414. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  415. pushd "${pkgdir}"
  416. ./configure --enable-static --disable-shared --disable-maintainer-mode --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
  417. touch .stamp_configured
  418. popd
  419. fi
  420. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  421. pushd "${pkgdir}"
  422. make ${MAKE_ARGS}
  423. touch .stamp_built
  424. popd
  425. fi
  426. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  427. pushd "${pkgdir}"
  428. make ${MAKE_ARGS} install -j 1
  429. touch .stamp_installed
  430. popd
  431. fi
  432. }
  433. # ---------------------------------------------------------------------------------------------------------------------
  434. function patch_file() {
  435. local name="${1}"
  436. local version="${2}"
  437. local file="${3}"
  438. local rule="${4}"
  439. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  440. if [ -e "${pkgdir}/${file}" ]; then
  441. sed -i -e "${rule}" "${pkgdir}/${file}"
  442. fi
  443. }
  444. function copy_file() {
  445. local name="${1}"
  446. local version="${2}"
  447. local source="${3}"
  448. local target="${4}"
  449. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  450. if [ ! -e "${pkgdir}/${target}" ] || [ "${source}" -nt "${target}" ]; then
  451. pushd "${pkgdir}"
  452. cp -v "${source}" "${target}"
  453. popd
  454. fi
  455. }
  456. function install_file() {
  457. local name="${1}"
  458. local version="${2}"
  459. local source="${3}"
  460. local targetdir="${4}"
  461. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  462. if [ ! -e "${PAWPAW_PREFIX}/${targetdir}/$(basename ${source})" ]; then
  463. pushd "${pkgdir}"
  464. cp -v "${source}" "${PAWPAW_PREFIX}/${targetdir}/"
  465. popd
  466. fi
  467. }
  468. function link_file() {
  469. local name="${1}"
  470. local version="${2}"
  471. local source="${3}"
  472. local target="${4}"
  473. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  474. if [ ! -e "${pkgdir}/${target}" ]; then
  475. pushd "${pkgdir}"
  476. ln -sfv "${source}" "${target}"
  477. popd
  478. fi
  479. }
  480. function remove_file() {
  481. local name="${1}"
  482. local version="${2}"
  483. local file="${3}"
  484. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  485. if [ -e "${pkgdir}/${file}" ]; then
  486. rm -fv "${pkgdir}/${file}"
  487. fi
  488. }
  489. # ---------------------------------------------------------------------------------------------------------------------
  490. function patch_osx_binary_libs() {
  491. local file="${1}"
  492. if [ -L "${file}" ]; then
  493. return 0
  494. fi
  495. idname=$(otool -D "${file}")
  496. if otool -L "${file}" | grep -v ":" | grep -v "${idname}" | grep -q "${PAWPAW_PREFIX}"; then
  497. #install_name_tool -change "@rpath/QtCore.framework/Versions/5/QtCore" "@executable_path/QtCore" "${file}"
  498. #install_name_tool -change "@rpath/QtGui.framework/Versions/5/QtGui" "@executable_path/QtGui" "${file}"
  499. #install_name_tool -change "@rpath/QtWidgets.framework/Versions/5/QtWidgets" "@executable_path/QtWidgets" "${file}"
  500. #install_name_tool -change "@rpath/QtXml.framework/Versions/5/QtXml" "@executable_path/QtXml" "${file}"
  501. install_name_tool -change "@executable_path/../Frameworks/libjack.0.dylib" "/usr/local/lib/libjack.0.dylib" "${file}"
  502. install_name_tool -change "${PAWPAW_PREFIX}/jack2/lib/libjack.0.dylib" "/usr/local/lib/libjack.0.dylib" "${file}"
  503. install_name_tool -change "${PAWPAW_PREFIX}/jack2/lib/libjacknet.0.dylib" "/usr/local/lib/libjacknet.0.dylib" "${file}"
  504. install_name_tool -change "${PAWPAW_PREFIX}/jack2/lib/libjackserver.0.dylib" "/usr/local/lib/libjackserver.0.dylib" "${file}"
  505. fi
  506. }
  507. function patch_osx_qtapp() {
  508. local name="${1}"
  509. local version="${2}"
  510. local appfile="${3}"
  511. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  512. _prebuild "${name}" "${pkgdir}"
  513. mkdir -p "${appfile}/Contents/PlugIns/platforms"
  514. mkdir -p "${appfile}/Contents/PlugIns/printsupport"
  515. cp -v "${PAWPAW_PREFIX}/lib/qt5/plugins/platforms/libqcocoa.dylib" "${appfile}/Contents/PlugIns/platforms/"
  516. cp -v "${PAWPAW_PREFIX}/lib/qt5/plugins/printsupport/libcocoaprintersupport.dylib" "${appfile}/Contents/PlugIns/printsupport/"
  517. macdeployqt "${appfile}"
  518. rm -f "${appfile}/Contents/Frameworks/libjack.0.dylib"
  519. _postbuild
  520. }
  521. # ---------------------------------------------------------------------------------------------------------------------