Skip to content

Commit

Permalink
meson: port to pep517
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Jun 17, 2022
1 parent de7ed29 commit 4fbed3f
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions mingw-w64-meson/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ _realname=meson
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.62.2
pkgrel=2
pkgrel=3
pkgdesc="High-productivity build system (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url="https://mesonbuild.com/"
license=("spdx:Apache-2.0")
options=('strip' 'staticlibs')
options=('!strip' 'staticlibs')
depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-ninja")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools" "${MINGW_PACKAGE_PREFIX}-cc")
makedepends=(
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer")
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'
Expand All @@ -38,19 +41,15 @@ build() {
[[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH}
cp -rf "${srcdir}"/${_realname}-${pkgver}/. "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH}

${MINGW_PREFIX}/bin/python setup.py build
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
cd "${srcdir}"/build-${CARCH}

MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python setup.py \
install --prefix=${MINGW_PREFIX} --root="${pkgdir}"

PREFIX_WIN=$(cygpath -m ${MINGW_PREFIX})
sed -s "s|${PREFIX_WIN}/bin/||g" \
-i "${pkgdir}${MINGW_PREFIX}/bin/meson-script.py"
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/python -m installer --compile-bytecode=0 --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl

install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING"
}

0 comments on commit 4fbed3f

Please sign in to comment.