diff --git a/srcpkgs/python3-rst2ansi/patches/table-fix.patch b/srcpkgs/python3-rst2ansi/patches/table-fix.patch new file mode 100644 index 00000000000..61e28098c7c --- /dev/null +++ b/srcpkgs/python3-rst2ansi/patches/table-fix.patch @@ -0,0 +1,31 @@ +From 1b1b963804bcc87a7187d07c3943585d9385ea92 Mon Sep 17 00:00:00 2001 +From: Jakub Wilk +Date: Thu, 14 Jul 2016 13:39:31 +0200 +Subject: [PATCH 1/2] Fix name error + +--- + rst2ansi/table.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/rst2ansi/table.py b/rst2ansi/table.py +index 389eb38..9f867a5 100644 +--- a/rst2ansi/table.py ++++ b/rst2ansi/table.py +@@ -91,7 +91,7 @@ def noop(*args, **kwargs): + + def visit_table(self, node): + if self.level > 0: +- raise SkipChildren ++ raise nodes.SkipChildren + self.level += 1 + + def depart_table(self, node): +@@ -197,7 +197,7 @@ def _draw_rule(self): + + def visit_table(self, node): + if self.level > 0: +- raise SkipChildren ++ raise nodes.SkipChildren + self.level += 1 + self._draw_rule() + diff --git a/srcpkgs/python3-rst2ansi/patches/unicode.patch b/srcpkgs/python3-rst2ansi/patches/unicode.patch new file mode 100644 index 00000000000..591eb070423 --- /dev/null +++ b/srcpkgs/python3-rst2ansi/patches/unicode.patch @@ -0,0 +1,25 @@ +From c6f390b45be689a5760060c990e3fe10f502e671 Mon Sep 17 00:00:00 2001 +From: "Franklin \"Snaipe\" Mathieu" +Date: Mon, 25 Jan 2021 18:06:51 +0100 +Subject: [PATCH 2/2] api: fix AttributeError on decode when feeding unicode + strings in python3 + +Fixes #12, #13 +--- + rst2ansi/__init__.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/rst2ansi/__init__.py b/rst2ansi/__init__.py +index f0665f4..0ea9a97 100644 +--- a/rst2ansi/__init__.py ++++ b/rst2ansi/__init__.py +@@ -45,5 +45,8 @@ def style_role(name, rawtext, text, lineno, inliner, options={}, content=[]): + for style in STYLES: + roles.register_local_role('ansi-' + style, style_role) + +- out = core.publish_string(input_string.decode('utf-8'), settings_overrides=overrides, writer=Writer(unicode=output_encoding.startswith('utf'))) ++ if hasattr(input_string, 'decode'): ++ input_string = input_string.decode('utf-8') ++ ++ out = core.publish_string(input_string, settings_overrides=overrides, writer=Writer(unicode=output_encoding.startswith('utf'))) + return out.decode(output_encoding) diff --git a/srcpkgs/python3-rst2ansi/template b/srcpkgs/python3-rst2ansi/template new file mode 100644 index 00000000000..31734232678 --- /dev/null +++ b/srcpkgs/python3-rst2ansi/template @@ -0,0 +1,23 @@ +# Template file for 'python3-rst2ansi' +pkgname=python3-rst2ansi +version=0.1.5 +revision=1 +build_style=python3-module +hostmakedepends="python3-setuptools" +depends="python3-docutils" +short_desc="Python utility for rendering RST in the terminal" +maintainer="Andrew J. Hesford " +license="MIT" +homepage="https://github.com/Snaipe/python-rst2ansi" +distfiles=" + ${PYPI_SITE}/r/rst2ansi/rst2ansi-${version}.tar.gz + https://raw.githubusercontent.com/Snaipe/python-rst2ansi/v${version}/LICENSE +" +checksum="1b17fb9a628d40f57933ad1a3aa952346444be069469508e73e95060da33fe6f + f9e900cbd36e32459517036a0e55e437c6311dca5eee1a9086df9f525e94d8c0" +make_check=no # package defines no tests +skip_extraction="LICENSE" + +post_install() { + vlicense "${XBPS_SRCDISTDIR}/${sourcepkg}-${version}/LICENSE" +}