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.

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