From cc800e977411fc6dcaaef656f021eeeffe1fa466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=85=D9=87=D8=AF=D9=8A=20=D8=B4=D9=8A=D9=86=D9=88=D9=86?= =?UTF-8?q?=20=28Mehdi=20Chinoune=29?= Date: Tue, 20 Sep 2022 05:54:30 +0100 Subject: [PATCH] [new-package] python-pylev 1.4.0 --- mingw-w64-python-pylev/PKGBUILD | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 mingw-w64-python-pylev/PKGBUILD diff --git a/mingw-w64-python-pylev/PKGBUILD b/mingw-w64-python-pylev/PKGBUILD new file mode 100644 index 0000000000..390f64d0b9 --- /dev/null +++ b/mingw-w64-python-pylev/PKGBUILD @@ -0,0 +1,45 @@ +# Contributor: Mehdi Chinoune + +_realname=pylev +pkgbase=mingw-w64-python-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}") +pkgver=1.4.0 +pkgrel=1 +pkgdesc="A pure Python Levenshtein implementation that's not freaking GPL'd. (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32') +url='http://github.com/toastdriven/pylev' +license=('BSD') +depends=("${MINGW_PACKAGE_PREFIX}-python") +makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" + "${MINGW_PACKAGE_PREFIX}-python-installer" + "${MINGW_PACKAGE_PREFIX}-python-setuptools" + "${MINGW_PACKAGE_PREFIX}-python-wheel") +checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest") +source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz") +sha256sums=('9e77e941042ad3a4cc305dcdf2b2dec1aec2fbe3dd9015d2698ad02b173006d1') + +build() { + msg "Python build for ${MSYSTEM}" + cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}" + + ${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation +} + +check() { + msg "Python test for ${MSYSTEM}" + cd "${srcdir}/python-build-${MSYSTEM}" + + ${MINGW_PREFIX}/bin/python -m pytest +} + +package() { + msg "Python install for ${MSYSTEM}" + cd "${srcdir}/python-build-${MSYSTEM}" + + MSYS2_ARG_CONV_EXCL="--prefix=" \ + ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \ + --destdir="${pkgdir}" dist/*.whl + + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE" +}