# Maintainer: Andrea Zagli _realname=meson pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=1.10.1 pkgrel=2 pkgdesc="High-productivity build system (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64') url="https://mesonbuild.com/" msys2_repository_url="https://github.com/mesonbuild/meson" msys2_references=( 'archlinux: meson' 'purl: pkg:pypi/meson' ) license=("spdx:Apache-2.0") depends=("${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-ninja" "${MINGW_PACKAGE_PREFIX}-pkgconf") makedepends=( "${MINGW_PACKAGE_PREFIX}-python-build" "${MINGW_PACKAGE_PREFIX}-python-installer" "${MINGW_PACKAGE_PREFIX}-python-setuptools" ) optdepends=("${MINGW_PACKAGE_PREFIX}-ccache: for a faster compilation" "${MINGW_PACKAGE_PREFIX}-sccache: for a faster compilation (preferred over ccache)") options=('!strip') source=("https://github.com/mesonbuild/${_realname}/releases/download/${pkgver}/${_realname}-${pkgver}.tar.gz" 'color-term.patch' '0002-Default-to-sys.prefix-as-the-default-prefix.patch' '0004-fix-gtk-doc.patch' 'install-man.patch' 'https://github.com/mesonbuild/meson/pull/15387.patch' '0006-allow-drive-relative-prefix.patch') sha256sums=('c42296f12db316a4515b9375a5df330f2e751ccdd4f608430d41d7d6210e4317' '5805aed0a117536eb16dd8eef978c6be57c2471b655ede63e25517c28b4f4cf0' '032b38f0b2765dc88e1fcb34e27b69b611e07c869c13c6e703bcf182e586fccb' 'bc43a2695498885afa08f2aeb927d6958741aa1a9fc66850de1a6c79fdf59241' '0682a36cb75e545a78b81293303835a16171f25baf949905dc08029436efff84' 'dda29950cd44fa947b2eecea33d764b8c276e3cbf58897780128d3b551fe7209' '8d636db57fdd44abcbc0201d001c599bfa5bbbac6d787e002ead54021c1b14e3') apply_patch_with_msg() { for _patch in "$@" do msg2 "Applying $_patch" patch -Nbp1 -i "${srcdir}/$_patch" done } prepare() { cd "${_realname}-${pkgver}" apply_patch_with_msg \ color-term.patch \ 0002-Default-to-sys.prefix-as-the-default-prefix.patch \ 0004-fix-gtk-doc.patch \ install-man.patch # https://github.com/msys2/MINGW-packages/issues/26812 apply_patch_with_msg \ 15387.patch # Allow /clang64 as prefix # See https://github.com/python/cpython/pull/113829 apply_patch_with_msg \ 0006-allow-drive-relative-prefix.patch } build() { cd "${_realname}-${pkgver}" ${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation } package() { cd "${_realname}-${pkgver}" MSYS2_ARG_CONV_EXCL="--prefix=" \ ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \ --destdir="${pkgdir}" dist/*.whl install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" }