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.

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