Skip to content

Commit

Permalink
Merge pull request #20718 from JPeterMugaas/rst2pdf
Browse files Browse the repository at this point in the history
mingw-w64-rst2pdf - add optional dependencies.
  • Loading branch information
lazka authored Jun 15, 2024
2 parents 9e50b31 + 72c5e5d commit 2ed5c42
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 1 deletion.
60 changes: 60 additions & 0 deletions mingw-w64-python-aafigure/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Maintainer: J. Peter Mugaas <[email protected]>

_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"
"${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")
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"
}
58 changes: 58 additions & 0 deletions mingw-w64-python-pyphen/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Maintainer: J. Peter Mugaas <[email protected]>

_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"
}
8 changes: 7 additions & 1 deletion mingw-w64-python-rst2pdf/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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"
Expand Down

0 comments on commit 2ed5c42

Please sign in to comment.