From bba27ccd29d91bdeeae7ce5aee74dca5420ce33a Mon Sep 17 00:00:00 2001 From: Florian Agbuya Date: Wed, 17 Jul 2024 16:21:08 +0800 Subject: [PATCH] python-pyvisa: new package --- mingw-w64-python-pyvisa/PKGBUILD | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 mingw-w64-python-pyvisa/PKGBUILD diff --git a/mingw-w64-python-pyvisa/PKGBUILD b/mingw-w64-python-pyvisa/PKGBUILD new file mode 100644 index 0000000000..5266260584 --- /dev/null +++ b/mingw-w64-python-pyvisa/PKGBUILD @@ -0,0 +1,54 @@ +# Maintainer: fsagbuya + +_realname=pyvisa +pkgbase=mingw-w64-python-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}") +pkgver=1.14.1 +pkgrel=1 +pkgdesc="Python VISA bindings for GPIB, RS232, TCPIP and USB instruments (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +url="https://github.com/pyvisa/pyvisa" +msys2_references=( + 'pypi: PyVISA' +) +license=('MIT') +depends=("${MINGW_PACKAGE_PREFIX}-python" + "${MINGW_PACKAGE_PREFIX}-python-typing_extensions") +makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" + "${MINGW_PACKAGE_PREFIX}-python-installer" + "${MINGW_PACKAGE_PREFIX}-python-setuptools-scm" + "${MINGW_PACKAGE_PREFIX}-python-wheel") +checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest") +options=('!strip') +source=("${_realname}-${pkgver}.tar.gz::${url}/archive/refs/tags/${pkgver}.tar.gz") +sha256sums=('4e6aada5677a88c1a77f89aec55cc7b52dbb87015484ec3c1f7c646c9fc9ad02') + +prepare() { + cd "${srcdir}" + rm -rf python-build-${MSYSTEM} | true + cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" + export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver} +} + +build() { + msg "Python build for ${MSYSTEM}" + cd "${srcdir}/python-build-${MSYSTEM}" + ${MINGW_PREFIX}/bin/python -m build --wheel --no-isolation +} + +check() { + msg "Python test for ${MSYSTEM}" + cd "${srcdir}/python-build-${MSYSTEM}" + ${MINGW_PREFIX}/bin/python -m pytest -v --pyargs pyvisa \ + --ignore=pyvisa/testsuite/test_cmd_line_tools.py || warning "Tests failed" +} + +package() { + cd "${srcdir}/python-build-${MSYSTEM}" + MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ + ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \ + --destdir="${pkgdir}" dist/*.whl + + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE" +}