From 9cc58cf067ef953ccba9835c161b1b8df9d22316 Mon Sep 17 00:00:00 2001 From: "MARINA\\jpmug" Date: Wed, 24 Apr 2024 08:33:08 -0400 Subject: [PATCH 1/4] mingw-w64-rst2pdf - add optional dependencies. mingw-w64-python-aafigure - new package. mingw-w64-python-pyphen - new package. --- mingw-w64-python-aafigure/PKGBUILD | 57 +++++++++++++++++++++++++++++ mingw-w64-python-pyphen/PKGBUILD | 58 ++++++++++++++++++++++++++++++ mingw-w64-python-rst2pdf/PKGBUILD | 8 ++++- 3 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 mingw-w64-python-aafigure/PKGBUILD create mode 100644 mingw-w64-python-pyphen/PKGBUILD diff --git a/mingw-w64-python-aafigure/PKGBUILD b/mingw-w64-python-aafigure/PKGBUILD new file mode 100644 index 0000000000..532480b434 --- /dev/null +++ b/mingw-w64-python-aafigure/PKGBUILD @@ -0,0 +1,57 @@ +# Maintainer: J. Peter Mugaas + +_realname=aafigure +pkgbase=mingw-w64-python-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}") +pkgver=0.6 +pkgrel=1 +pkgdesc="ASCII art to image converte (mingw-w64)" +arch=('any') +mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') +url='https://github.com/aafigure/aafigure' +license=('BSD-3-Clause') +depends=("${MINGW_PACKAGE_PREFIX}-python" + "${MINGW_PACKAGE_PREFIX}-python-pillow" + "${MINGW_PACKAGE_PREFIX}-python-reportlab") +makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" "${MINGW_PACKAGE_PREFIX}-python-installer") +checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest") +options=('!strip') +source=("https://files.pythonhosted.org/packages/f3/13/8516bd4dd1520c02797e4544bfac7a03521b28bb9404588197af2803ad89/${_realname}-${pkgver}.tar.gz") +sha256sums=('49f2c1fd2b579c1fffbac1386a2670b3f6f475cc7ff6cc04d8b984888c2d9e1e') + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + + ## (OPTIONAL) Only if setuptools-scm is used + # Set version for setuptools_scm + export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver} +} + +build() { + msg "Python build for ${MSYSTEM}" + cd "${srcdir}" + 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}" + +# The test command will usually depend upon what is contained in the tox.ini file +# or in the [testenv:py] section of the pyproject.toml file. + ${MINGW_PREFIX}/bin/python -m pytest -v +} + +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 -vDm 644 {CHANGES.txt,README.rst} -t "${pkgdir}${MINGW_PREFIX}/dshare/doc/python-${_realname}/" + install -Dm644 LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE" +} diff --git a/mingw-w64-python-pyphen/PKGBUILD b/mingw-w64-python-pyphen/PKGBUILD new file mode 100644 index 0000000000..559e077236 --- /dev/null +++ b/mingw-w64-python-pyphen/PKGBUILD @@ -0,0 +1,58 @@ +# Maintainer: J. Peter Mugaas + +_realname=pyphen +pkgbase=mingw-w64-python-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}") +pkgver=0.15.0 +pkgrel=1 +pkgdesc="Pure Python module to hyphenate text (mingw-w64)" +arch=('any') +mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') +url='https://pyphen.org/' +_url=https://github.com/Kozea/Pyphen +license=("GPL-2.0-or-later" "LGPL-2.1-or-later" "MPL-1.1") +depends=("${MINGW_PACKAGE_PREFIX}-python") +makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" + "${MINGW_PACKAGE_PREFIX}-python-flit-core" + "${MINGW_PACKAGE_PREFIX}-python-installer" + "${MINGW_PACKAGE_PREFIX}-python-wheel") +checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest") +options=('!strip') +source=("https://files.pythonhosted.org/packages/4c/d1/f6bc803daa4c1cfe5b1176427f46dfe3ffee524bea1dee8bdde532e17c41/${_realname}-${pkgver}.tar.gz") +sha256sums=('a430623decac53dc3691241253263cba36b9dd7a44ffd2680b706af368cda2f2') + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + + ## (OPTIONAL) Only if setuptools-scm is used + # Set version for setuptools_scm + export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver} +} + +build() { + msg "Python build for ${MSYSTEM}" + cd "${srcdir}" + 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}" + +# The test command will usually depend upon what is contained in the tox.ini file +# or in the [testenv:py] section of the pyproject.toml file. + ${MINGW_PREFIX}/bin/python -m pytest -vv +} + +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" +} diff --git a/mingw-w64-python-rst2pdf/PKGBUILD b/mingw-w64-python-rst2pdf/PKGBUILD index a1a79e5df5..adf1f1b8d5 100644 --- a/mingw-w64-python-rst2pdf/PKGBUILD +++ b/mingw-w64-python-rst2pdf/PKGBUILD @@ -8,7 +8,7 @@ provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}" conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") pkgver=0.101 -pkgrel=2 +pkgrel=3 pkgdesc="Create PDFs from simple text markup, no LaTeX required (mingw-w64)" arch=('any') mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') @@ -27,6 +27,12 @@ depends=("${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-python-reportlab" "${MINGW_PACKAGE_PREFIX}-python-smartypants" "${MINGW_PACKAGE_PREFIX}-python-yaml") +# TODO: package python-xhtml2pdf +# https://github.com/xhtml2pdf/xhtml2pdf/issues/560 +optdepends=("${MINGW_PACKAGE_PREFIX}-python-pyphen: for hyphenation support" + "${MINGW_PACKAGE_PREFIX}-python-matplotlib: for math support'" + "${MINGW_PACKAGE_PREFIX}-python-sphinx: for sphinx support" + "${MINGW_PACKAGE_PREFIX}-python-svglib: for SVG support") makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" "${MINGW_PACKAGE_PREFIX}-python-installer" "${MINGW_PACKAGE_PREFIX}-python-setuptools" From e7bda3f7982d7bd6246f70c21a9be4b9b80b2913 Mon Sep 17 00:00:00 2001 From: "MARINA\\jpmug" Date: Wed, 24 Apr 2024 08:45:41 -0400 Subject: [PATCH 2/4] add setuptools to aafigure. --- mingw-w64-python-aafigure/PKGBUILD | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mingw-w64-python-aafigure/PKGBUILD b/mingw-w64-python-aafigure/PKGBUILD index 532480b434..2b09a1d772 100644 --- a/mingw-w64-python-aafigure/PKGBUILD +++ b/mingw-w64-python-aafigure/PKGBUILD @@ -13,7 +13,9 @@ license=('BSD-3-Clause') depends=("${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-python-pillow" "${MINGW_PACKAGE_PREFIX}-python-reportlab") -makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" "${MINGW_PACKAGE_PREFIX}-python-installer") +makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" + "${MINGW_PACKAGE_PREFIX}-python-installer" + "${MINGW_PACKAGE_PREFIX}-python-setuptools") checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest") options=('!strip') source=("https://files.pythonhosted.org/packages/f3/13/8516bd4dd1520c02797e4544bfac7a03521b28bb9404588197af2803ad89/${_realname}-${pkgver}.tar.gz") From d742d4df9a4d37a0f17142d2c23554f9bdb5b269 Mon Sep 17 00:00:00 2001 From: "MARINA\\jpmug" Date: Wed, 24 Apr 2024 08:51:07 -0400 Subject: [PATCH 3/4] add wheel to aafigure. --- mingw-w64-python-wheel/PKGBUILD | 66 +++++++++++++++++---------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/mingw-w64-python-wheel/PKGBUILD b/mingw-w64-python-wheel/PKGBUILD index 6a554c80b0..959ea6c35d 100644 --- a/mingw-w64-python-wheel/PKGBUILD +++ b/mingw-w64-python-wheel/PKGBUILD @@ -1,56 +1,60 @@ # Maintainer: J. Peter Mugaas -_realname=wheel +_realname=aafigure pkgbase=mingw-w64-python-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}") -provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") -conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") -replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") -pkgver=0.42.0 +pkgver=0.6 pkgrel=1 -pkgdesc="A built-package format for Python (mingw-w64)" +pkgdesc="ASCII art to image converte (mingw-w64)" arch=('any') -mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') -msys2_references=( - 'pypi: wheel' - "cpe: cpe:/a:wheel_project:wheel" -) -url="https://github.com/pypa/wheel" -license=('spdx:MIT') +mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') +url='https://github.com/aafigure/aafigure' +license=('BSD-3-Clause') depends=("${MINGW_PACKAGE_PREFIX}-python" - "${MINGW_PACKAGE_PREFIX}-python-packaging") -makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" + "${MINGW_PACKAGE_PREFIX}-python-pillow" + "${MINGW_PACKAGE_PREFIX}-python-reportlab") +makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" "${MINGW_PACKAGE_PREFIX}-python-installer" - "${MINGW_PACKAGE_PREFIX}-python-flit-core") + "${MINGW_PACKAGE_PREFIX}-python-setuptools" + "${MINGW_PACKAGE_PREFIX}-python-wheel") +checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest") options=('!strip') -source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz") -sha256sums=('c45be39f7882c9d34243236f2d63cbd58039e360f85d0913425fbd7ceea617a8') +source=("https://files.pythonhosted.org/packages/f3/13/8516bd4dd1520c02797e4544bfac7a03521b28bb9404588197af2803ad89/${_realname}-${pkgver}.tar.gz") +sha256sums=('49f2c1fd2b579c1fffbac1386a2670b3f6f475cc7ff6cc04d8b984888c2d9e1e') prepare() { - cd "${srcdir}"/${_realname}-${pkgver} + cd "${srcdir}/${_realname}-${pkgver}" - # revert https://github.com/pypa/wheel/pull/365 - rm -r src/wheel/vendored - sed -i 's/from .vendored.packaging import tags/from packaging import tags/' src/wheel/bdist_wheel.py - sed -i 's/from .vendored.packaging import version as _packaging_version/from packaging import version as _packaging_version/' src/wheel/bdist_wheel.py - sed -i 's/from .vendored.packaging.requirements import Requirement/from packaging.requirements import Requirement/' src/wheel/metadata.py - sed -i 's/from wheel.vendored.packaging import tags/from packaging import tags/' tests/test_bdist_wheel.py - - cd "${srcdir}" - rm -rf python-build-${MSYSTEM} | true - cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" + ## (OPTIONAL) Only if setuptools-scm is used + # Set version for setuptools_scm + export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver} } build() { - cd "${srcdir}/python-build-${MSYSTEM}" + msg "Python build for ${MSYSTEM}" + cd "${srcdir}" + cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}" + ${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation } -package() { +check() { + msg "Python test for ${MSYSTEM}" cd "${srcdir}/python-build-${MSYSTEM}" + +# The test command will usually depend upon what is contained in the tox.ini file +# or in the [testenv:py] section of the pyproject.toml file. + ${MINGW_PREFIX}/bin/python -m pytest -v +} + +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 -vDm 644 {CHANGES.txt,README.rst} -t "${pkgdir}${MINGW_PREFIX}/dshare/doc/python-${_realname}/" install -Dm644 LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE" } From 72c5e5d37c2f08d4d8a06689aea471734a9df1fb Mon Sep 17 00:00:00 2001 From: "MARINA\\jpmug" Date: Wed, 24 Apr 2024 09:00:47 -0400 Subject: [PATCH 4/4] Restore wheel and checkin aafigure. --- mingw-w64-python-aafigure/PKGBUILD | 3 +- mingw-w64-python-wheel/PKGBUILD | 64 ++++++++++++++---------------- 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/mingw-w64-python-aafigure/PKGBUILD b/mingw-w64-python-aafigure/PKGBUILD index 2b09a1d772..959ea6c35d 100644 --- a/mingw-w64-python-aafigure/PKGBUILD +++ b/mingw-w64-python-aafigure/PKGBUILD @@ -15,7 +15,8 @@ depends=("${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-python-reportlab") makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" "${MINGW_PACKAGE_PREFIX}-python-installer" - "${MINGW_PACKAGE_PREFIX}-python-setuptools") + "${MINGW_PACKAGE_PREFIX}-python-setuptools" + "${MINGW_PACKAGE_PREFIX}-python-wheel") checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest") options=('!strip') source=("https://files.pythonhosted.org/packages/f3/13/8516bd4dd1520c02797e4544bfac7a03521b28bb9404588197af2803ad89/${_realname}-${pkgver}.tar.gz") diff --git a/mingw-w64-python-wheel/PKGBUILD b/mingw-w64-python-wheel/PKGBUILD index 959ea6c35d..6a554c80b0 100644 --- a/mingw-w64-python-wheel/PKGBUILD +++ b/mingw-w64-python-wheel/PKGBUILD @@ -1,60 +1,56 @@ # Maintainer: J. Peter Mugaas -_realname=aafigure +_realname=wheel pkgbase=mingw-w64-python-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}") -pkgver=0.6 +provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") +conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") +replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") +pkgver=0.42.0 pkgrel=1 -pkgdesc="ASCII art to image converte (mingw-w64)" +pkgdesc="A built-package format for Python (mingw-w64)" arch=('any') -mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') -url='https://github.com/aafigure/aafigure' -license=('BSD-3-Clause') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') +msys2_references=( + 'pypi: wheel' + "cpe: cpe:/a:wheel_project:wheel" +) +url="https://github.com/pypa/wheel" +license=('spdx:MIT') depends=("${MINGW_PACKAGE_PREFIX}-python" - "${MINGW_PACKAGE_PREFIX}-python-pillow" - "${MINGW_PACKAGE_PREFIX}-python-reportlab") -makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" + "${MINGW_PACKAGE_PREFIX}-python-packaging") +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") + "${MINGW_PACKAGE_PREFIX}-python-flit-core") options=('!strip') -source=("https://files.pythonhosted.org/packages/f3/13/8516bd4dd1520c02797e4544bfac7a03521b28bb9404588197af2803ad89/${_realname}-${pkgver}.tar.gz") -sha256sums=('49f2c1fd2b579c1fffbac1386a2670b3f6f475cc7ff6cc04d8b984888c2d9e1e') +source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz") +sha256sums=('c45be39f7882c9d34243236f2d63cbd58039e360f85d0913425fbd7ceea617a8') prepare() { - cd "${srcdir}/${_realname}-${pkgver}" + cd "${srcdir}"/${_realname}-${pkgver} - ## (OPTIONAL) Only if setuptools-scm is used - # Set version for setuptools_scm - export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver} + # revert https://github.com/pypa/wheel/pull/365 + rm -r src/wheel/vendored + sed -i 's/from .vendored.packaging import tags/from packaging import tags/' src/wheel/bdist_wheel.py + sed -i 's/from .vendored.packaging import version as _packaging_version/from packaging import version as _packaging_version/' src/wheel/bdist_wheel.py + sed -i 's/from .vendored.packaging.requirements import Requirement/from packaging.requirements import Requirement/' src/wheel/metadata.py + sed -i 's/from wheel.vendored.packaging import tags/from packaging import tags/' tests/test_bdist_wheel.py + + cd "${srcdir}" + rm -rf python-build-${MSYSTEM} | true + cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" } build() { - msg "Python build for ${MSYSTEM}" - cd "${srcdir}" - cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}" - + cd "${srcdir}/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}" - -# The test command will usually depend upon what is contained in the tox.ini file -# or in the [testenv:py] section of the pyproject.toml file. - ${MINGW_PREFIX}/bin/python -m pytest -v -} - 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 -vDm 644 {CHANGES.txt,README.rst} -t "${pkgdir}${MINGW_PREFIX}/dshare/doc/python-${_realname}/" install -Dm644 LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE" }