summaryrefslogtreecommitdiff
path: root/app-text/xml2rfc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-10-29 22:01:57 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-10-29 22:01:57 +0100
commit009897642a869d630779716efc51af1554f72867 (patch)
tree879100d35e2fd1f39b32b68b2abe220f156b3a20 /app-text/xml2rfc
parent9cd7e710ac676c1a318d09e665ca3558bb5c5323 (diff)
gentoo auto-resync : 29:10:2022 - 22:01:57
Diffstat (limited to 'app-text/xml2rfc')
-rw-r--r--app-text/xml2rfc/Manifest4
-rw-r--r--app-text/xml2rfc/files/xml2rfc-Remove-broken-test.patch79
-rw-r--r--app-text/xml2rfc/metadata.xml12
-rw-r--r--app-text/xml2rfc/xml2rfc-3.15.2.ebuild54
4 files changed, 149 insertions, 0 deletions
diff --git a/app-text/xml2rfc/Manifest b/app-text/xml2rfc/Manifest
new file mode 100644
index 000000000000..48b845ae317a
--- /dev/null
+++ b/app-text/xml2rfc/Manifest
@@ -0,0 +1,4 @@
+AUX xml2rfc-Remove-broken-test.patch 3455 BLAKE2B a5faf688b52a7dc34a99e096a56433103e01f28f8c4b4cf75b4816683b1e7fcd60131d2170f5fdf65fc1c4621099694de682e5b017d6d045bc795bf3f8ecbd31 SHA512 9f54ef323f7f89f89b847fc00731115d2ee8302b7352c43549176cbdcafd79edd8a91dcf2e329e690833bb19f0f6ed0fd8ca5ee22e92299df54b505f2af0aaa7
+DIST xml2rfc-3.15.2.gh.tar.gz 2849091 BLAKE2B e792d07a2c8123dc32f4c2cfe794420f98db13da1812a4a7e82a4f2a2e2e70fa0e6b7385e189e70eba47c9be7e0ac281d3858437103b828ea8dbaaf8cef73b87 SHA512 5953ae40ad479b0aa6ab90f08f235ceddfa9c7e1edd868ee43bfd261f4c4d0fdfbbe052ff8a3274c39d283efc1105a0be3b4578fa372269f3274a72acdc950e8
+EBUILD xml2rfc-3.15.2.ebuild 1448 BLAKE2B 9bae39e448d758f2cc3e945a934523adff76f241cce9b6805f21752075251ed439e020fa3590d7cd557be10b1e0b6cfbbc6d187239a370c2c7e1506e50998dd0 SHA512 14fe82df07f7e4ec7138a0f5a071af148963934df62ebebdc9bdb1d119b3d47f318d5422e22b9db89136cae3be2af9ffa657d492ee7f5816bef161639cf8749b
+MISC metadata.xml 374 BLAKE2B 3514fd485c7ca895f1b9f4a809ed97bb55396c1abd6a52ae6602e61b836fac3a0fbcbeec7dcb0789a6510cabb9920a33bfae4dfeb9bfba86ad9d02fbf917a720 SHA512 0e4697e08615993939416355b5d112f5f6ab1aad0bc74a3e33f6d3e7d0178ddf9b5fba70aa50fc6babed1ca27d89d1b0bff53223c1a55e636e82b6c617860cb9
diff --git a/app-text/xml2rfc/files/xml2rfc-Remove-broken-test.patch b/app-text/xml2rfc/files/xml2rfc-Remove-broken-test.patch
new file mode 100644
index 000000000000..d7d027962c24
--- /dev/null
+++ b/app-text/xml2rfc/files/xml2rfc-Remove-broken-test.patch
@@ -0,0 +1,79 @@
+From ed27e2983c27065bd88ac82cd26a5b9128544b45 Mon Sep 17 00:00:00 2001
+From: Florian Schmaus <flo@geekplace.eu>
+Date: Fri, 28 Oct 2022 20:18:10 +0200
+Subject: [PATCH] Remove broken test
+
+--- a/test.py
++++ b/test.py
+@@ -466,71 +466,6 @@ class WriterRfcTest(WriterRootTest):
+ return self.status_test()
+
+
+-class PdfWriterTests(unittest.TestCase):
+- elements_root = None
+- elements_pdfxml = None
+-
+- @classmethod
+- def setUpClass(cls) -> None:
+- # Putting this in setUpClass() allows this module to be imported even if this
+- # procedure will fail. This improves some error messages and makes debugging
+- # a little bit easier. The setUpClass() method is run by unittest during init.
+- # This happens only once, avoiding repeated execution of slow operations.
+- def _pdfwriter(path):
+- """ Parse a minimal RFC tree and instantiate a writer """
+- parser = xml2rfc.XmlRfcParser(path, quiet=True, **options_for_xmlrfcparser)
+- xmlrfc = parser.parse()
+- writer = xml2rfc.writers.pdf.PdfWriter(xmlrfc, quiet=True, )
+- return writer
+-
+- elements_writer = _pdfwriter('tests/input/elements.xml')
+- try:
+- elements_pdfdoc = elements_writer.pdf() # has side effects on .root
+- except Exception as e:
+- print(e)
+- raise
+- cls.pdf_writer = elements_writer
+- cls.elements_root = elements_writer.root
+- cls.elements_pdfxml = xmldoc(None, bytes=elements_pdfdoc)
+-
+- def setUp(self):
+- xml2rfc.log.quiet = True
+- self.pdfxml = copy.deepcopy(self.elements_pdfxml)
+- self.root = copy.deepcopy(self.elements_root)
+-
+- def test_text_content(self):
+- def norm(t):
+- return re.sub(r'\s+', ' ', t).strip()
+- #
+- text = norm('\n'.join( p.text for p in self.pdfxml.xpath('.//Page/text') ))
+- for e in self.root.xpath('./middle//*'):
+- if e.text and e.text.strip() and e.tag not in xml2rfc.util.unicode.unicode_content_tags and not xml2rfc.util.unicode.is_svg(e):
+- t = norm(e.text.split(None, 1)[0])
+- self.assertIn(t, text)
+-
+- def test_included_fonts(self):
+- if xml2rfc.HAVE_WEASYPRINT and xml2rfc.HAVE_PANGO:
+- font_families = set([ f.text for f in self.pdfxml.xpath('.//FontFamily') ])
+- for script in self.root.get('scripts').split(','):
+- family = xml2rfc.util.fonts.get_noto_serif_family_for_script(script)
+- self.assertIn(family, font_families, 'Missing font match for %s' % script)
+-
+- def test_flatten_unicode_spans(self):
+- input_html = '<body><p>f<span class="unicode">o</span>o<span class="unicode">ba</span>r</p></body>'
+- output_html = self.pdf_writer.flatten_unicode_spans(input_html)
+- self.assertEqual(output_html, '<body><p>foobar</p></body>')
+-
+- def test_get_serif_fonts(self):
+- fonts = self.pdf_writer.get_serif_fonts()
+- for font in ['Noto Serif', 'Noto Sans Cherokee', 'Noto Serif CJK SC', 'Noto Serif Hebrew']:
+- self.assertIn(font, fonts)
+-
+- def test_get_mono_fonts(self):
+- fonts = self.pdf_writer.get_mono_fonts()
+- for font in ['Roboto Mono', 'Noto Sans Cherokee', 'Noto Serif CJK SC', 'Noto Serif Hebrew']:
+- self.assertIn(font, fonts)
+-
+-
+ class HtmlWriterTest(unittest.TestCase):
+ '''HtmlWriter tests'''
+
diff --git a/app-text/xml2rfc/metadata.xml b/app-text/xml2rfc/metadata.xml
new file mode 100644
index 000000000000..53c1b948fa53
--- /dev/null
+++ b/app-text/xml2rfc/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <name>Florian Schmaus</name>
+ <email>flow@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="pypi">xml2rfc</remote-id>
+ <remote-id type="github">ietf-tools/xml2rfc</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-text/xml2rfc/xml2rfc-3.15.2.ebuild b/app-text/xml2rfc/xml2rfc-3.15.2.ebuild
new file mode 100644
index 000000000000..fb60768a8577
--- /dev/null
+++ b/app-text/xml2rfc/xml2rfc-3.15.2.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit distutils-r1
+
+DESCRIPTION="Generates RFCs and IETF drafts from document source in XML"
+HOMEPAGE="https://ietf-tools.github.io/xml2rfc/ https://github.com/ietf-tools/xml2rfc"
+SRC_URI="https://github.com/ietf-tools/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
+
+RESTRICT="!test? ( test )"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+BDEPEND="
+ test? (
+ dev-python/PyPDF2[${PYTHON_USEDEP}]
+ dev-python/decorator[${PYTHON_USEDEP}]
+ dev-python/dict2xml[${PYTHON_USEDEP}]
+ dev-python/weasyprint[${PYTHON_USEDEP}]
+ media-fonts/noto[cjk]
+ )
+"
+
+RDEPEND="
+ dev-python/appdirs[${PYTHON_USEDEP}]
+ dev-python/ConfigArgParse[${PYTHON_USEDEP}]
+ dev-python/intervaltree[${PYTHON_USEDEP}]
+ dev-python/google-i18n-address[${PYTHON_USEDEP}]
+ >=dev-python/html5lib-1.0.1[${PYTHON_USEDEP}]
+ >=dev-python/jinja-3.1.2[${PYTHON_USEDEP}]
+ dev-python/lxml[${PYTHON_USEDEP}]
+ >=dev-python/markupsafe-2.1.1[${PYTHON_USEDEP}]
+ dev-python/pycountry[${PYTHON_USEDEP}]
+ >=dev-python/pyyaml-5.3.1[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]
+"
+
+PATCHES=(
+ "${FILESDIR}/xml2rfc-Remove-broken-test.patch"
+)
+
+distutils_enable_tests setup.py
+
+#src_test() {
+ # https://github.com/ietf-tools/xml2rfc/issues/561
+# emake tests-no-network
+#}