From 0cae9f805e418dcfa912e6594f5fce91fc4f4c42 Mon Sep 17 00:00:00 2001 From: Florian Agbuya Date: Tue, 29 Oct 2024 15:45:57 +0800 Subject: [PATCH] python-nidaqmx: new package --- .../0001-use-poetry-core-backend.patch | 15 ++++++ mingw-w64-python-nidaqmx/PKGBUILD | 54 +++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 mingw-w64-python-nidaqmx/0001-use-poetry-core-backend.patch create mode 100644 mingw-w64-python-nidaqmx/PKGBUILD diff --git a/mingw-w64-python-nidaqmx/0001-use-poetry-core-backend.patch b/mingw-w64-python-nidaqmx/0001-use-poetry-core-backend.patch new file mode 100644 index 0000000000..5b80403fe6 --- /dev/null +++ b/mingw-w64-python-nidaqmx/0001-use-poetry-core-backend.patch @@ -0,0 +1,15 @@ +diff --git a/pyproject.toml b/pyproject.toml +index 3779276..b5f3a81 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -127,8 +127,8 @@ markers = [ + ] + + [build-system] +-requires = ["poetry>=1.2"] +-build-backend = "poetry.masonry.api" ++requires = ["poetry-core"] ++build-backend = "poetry.core.masonry.api" + + [tool.mypy] + files = "generated/,tests/" diff --git a/mingw-w64-python-nidaqmx/PKGBUILD b/mingw-w64-python-nidaqmx/PKGBUILD new file mode 100644 index 0000000000..955b61bfef --- /dev/null +++ b/mingw-w64-python-nidaqmx/PKGBUILD @@ -0,0 +1,54 @@ +# Maintainer: fsagbuya + +_realname=nidaqmx +pkgbase=mingw-w64-python-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}") +pkgver=1.0.1 +pkgrel=1 +pkgdesc="A Python API for interacting with NI-DAQmx (mingw-w64)" +arch=('any') +mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') +url="https://nidaqmx-python.readthedocs.io/" +msys2_repository_url="https://github.com/ni/nidaqmx-python" +msys2_references=( + 'pypi: nidaqmx' +) +license=('spdx:MIT') +depends=("${MINGW_PACKAGE_PREFIX}-python" + "${MINGW_PACKAGE_PREFIX}-python-click" + "${MINGW_PACKAGE_PREFIX}-python-decouple" + "${MINGW_PACKAGE_PREFIX}-python-deprecation" + "${MINGW_PACKAGE_PREFIX}-python-hightime" + "${MINGW_PACKAGE_PREFIX}-python-numpy" + "${MINGW_PACKAGE_PREFIX}-python-requests" + "${MINGW_PACKAGE_PREFIX}-python-tzlocal") +makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" + "${MINGW_PACKAGE_PREFIX}-python-installer" + "${MINGW_PACKAGE_PREFIX}-python-poetry-core") +options=('!strip') +source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz" + "0001-use-poetry-core-backend.patch") +sha256sums=('fcbb0ff8f1f618b38ea5fab8a8c6ed24cc32d4b4e935cb1221ce4480e428de9f' + '243c74402bdb75bd9dd668f4e879f300a5bca2156c5969f225f48ab00a4fe899') + +prepare() { + cd "${_realname}-${pkgver}" + + patch -Np1 -i "${srcdir}/0001-use-poetry-core-backend.patch" +} + +build() { + cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}" + + python -m build --wheel --skip-dependency-check --no-isolation +} + +package() { + cd "python-build-${MSYSTEM}" + + MSYS2_ARG_CONV_EXCL="--prefix=" \ + python -m installer --prefix=${MINGW_PREFIX} \ + --destdir="${pkgdir}" dist/*.whl + + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE" +} \ No newline at end of file