Add some Python packages for glib

python-docutils for man pages, the rest for API docs, though
that also needs introspection, and we don't have any of that yet.
This commit is contained in:
Christoph Reiter 2024-07-02 07:38:25 +02:00
parent 793662aeae
commit 8f77eedde0
5 changed files with 189 additions and 0 deletions

39
gi-docgen/PKGBUILD Normal file
View File

@ -0,0 +1,39 @@
# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>
_pyname=gi_docgen
pkgname=gi-docgen
pkgver=2024.1
pkgrel=1
pkgdesc="Documentation generator for GObject-based libraries"
url="https://gnome.pages.gitlab.gnome.org/gi-docgen/"
msys2_repository_url="https://gitlab.gnome.org/GNOME/gi-docgen"
arch=(any)
license=("spdx:Apache-2.0 OR GPL-3.0-or-later")
depends=(
python
python-jinja
python-markdown
python-markupsafe
python-packaging
python-pygments
)
makedepends=(
python-build
python-installer
python-setuptools
python-wheel
)
source=("https://pypi.org/packages/source/${_pyname::1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
sha256sums=('2a4a5569f91109777481aa71451751289227f7c2652cfac366184a41eb19c231')
build() {
cd "$_pyname-$pkgver"
python -m build --wheel --no-isolation
}
package() {
cd "$_pyname-$pkgver"
python -m installer --destdir="$pkgdir" dist/*.whl
}

30
python-docutils/PKGBUILD Normal file
View File

@ -0,0 +1,30 @@
# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>
pkgname=python-docutils
_name=${pkgname#python-}
pkgver=0.21.2
pkgrel=1
pkgdesc='Set of tools for processing plaintext docs into formats such as HTML, XML, or LaTeX'
arch=('any')
url='http://docutils.sourceforge.net'
license=('custom')
depends=('python')
makedepends=(
'python-build'
'python-flit-core'
'python-installer'
)
source=("https://downloads.sourceforge.net/$_name/$_name-$pkgver.tar.gz")
sha256sums=('3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f')
build() {
cd "$_name"-$pkgver
python -m build --wheel --skip-dependency-check --no-isolation
}
package() {
cd "$_name"-$pkgver
python -m installer --destdir="$pkgdir" dist/*.whl
}

View File

@ -0,0 +1,33 @@
# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>
pkgname=python-smartypants
_pyname=smartypants
pkgver=2.0.1
pkgrel=1
pkgdesc="Python with the SmartyPants"
url="https://github.com/leohemsted/smartypants.py"
license=('spdx:BSD-2-Clause')
arch=('any')
depends=('python')
makedepends=(
'python-setuptools'
'python-build'
'python-installer'
'python-wheel'
)
sha256sums=('b98191911ff3b4144ef8ad53e776a2d0ad24bd508a905c6ce523597c40022773')
source=("$pkgname-$pkgver.tar.gz::https://github.com/leohemsted/${_pyname}.py/archive/v${pkgver}.tar.gz")
build() {
cd "$_pyname.py-$pkgver"
python -m build --wheel --no-isolation
}
package() {
cd "$_pyname.py-$pkgver"
python -m installer --destdir="$pkgdir" dist/*.whl
install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}

42
python-typogrify/PKGBUILD Normal file
View File

@ -0,0 +1,42 @@
# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>
pkgname=python-typogrify
_pyname=typogrify
pkgver=2.0.7
pkgrel=1
pkgdesc='filters to make caring about typography on the web a bit easier'
arch=('any')
url='https://github.com/mintchaos/typogrify'
license=('spdx:BSD-3-Clause')
depends=('python' 'python-smartypants')
makedepends=(
'python-setuptools'
'python-build'
'python-installer'
'python-wheel'
)
source=("https://pypi.python.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz"
jinja-3.1.patch)
sha256sums=('8be4668cda434163ce229d87ca273a11922cb1614cb359970b7dc96eed13cb38'
'bda1b57207e46d3d399b830e603493505bcbc1414342b823d81345a4ac8a4cfb')
prepare() {
cd "${_pyname}-${pkgver}"
patch -Np1 -i ../jinja-3.1.patch
}
build() {
cd "${_pyname}-${pkgver}"
python -m build --wheel --no-isolation
}
package() {
cd "${_pyname}-${pkgver}"
python -m installer --destdir="$pkgdir" dist/*.whl
install -D -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

View File

@ -0,0 +1,45 @@
From 34b6e01b71afd6876bbd2ef7ad134d11d05c82a0 Mon Sep 17 00:00:00 2001
From: Jordan Yelloz <jordan@yelloz.me>
Date: Sat, 2 Apr 2022 11:29:31 -0600
Subject: [PATCH] jinja_filters: Updated import for Jinja 3.1.
Added some fallback imports just to reduce the possibility of breakage with
users running the latest version of typogrify and older versions of Flask/Jinja
for whatever reason.
Jinja 3.1.x has removed the jinja2.Markup function which was deprecated in Jinja
3.0.x.
See:
- https://jinja.palletsprojects.com/en/3.1.x/changes/#version-3-1-0
- https://github.com/pallets/jinja/pull/1544
(cherry picked from commit 279c6b6c9f3a8b1bd065960a0e0bbe73236d717f)
---
typogrify/templatetags/jinja_filters.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/typogrify/templatetags/jinja_filters.py b/typogrify/templatetags/jinja_filters.py
index 0596c0b..d6e9b9e 100644
--- a/typogrify/templatetags/jinja_filters.py
+++ b/typogrify/templatetags/jinja_filters.py
@@ -1,6 +1,9 @@
from typogrify.filters import amp, caps, initial_quotes, smartypants, titlecase, typogrify, widont, TypogrifyError
from functools import wraps
-import jinja2
+try:
+ from markupsafe import Markup
+except ImportError:
+ from jinja2 import Markup
from jinja2.exceptions import TemplateError
@@ -18,7 +21,7 @@ def make_safe(f):
out = f(text)
except TypogrifyError as e:
raise TemplateError(e.message)
- return jinja2.Markup(out)
+ return Markup(out)
wrapper.is_safe = True
return wrapper