[arch-commits] Commit in python-recommonmark/trunk (2 files)

Evangelos Foutras foutrelis at gemini.archlinux.org
Tue May 31 10:41:52 UTC 2022


    Date: Tuesday, May 31, 2022 @ 10:41:51
  Author: foutrelis
Revision: 1217831

upgpkg: python-recommonmark 0.7.1-4: re-add for llvm

Need it for LLVM docs until it switches to MyST-Parser.

https://discourse.llvm.org/t/switch-recommonmark-to-myst-parser/3259
https://github.com/llvm/llvm-project/issues/55787

Added:
  python-recommonmark/trunk/autostructify-tab_width-fallback.patch
Modified:
  python-recommonmark/trunk/PKGBUILD

----------------------------------------+
 PKGBUILD                               |   62 ++++++++++++++++---------------
 autostructify-tab_width-fallback.patch |   12 ++++++
 2 files changed, 45 insertions(+), 29 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-05-31 09:50:24 UTC (rev 1217830)
+++ PKGBUILD	2022-05-31 10:41:51 UTC (rev 1217831)
@@ -1,42 +1,46 @@
-# Maintainer: Caleb Maclennan <caleb at alerque.com>
+# Maintainer: Evangelos Foutras <evangelos at foutrelis.com>
+# Contributor: Caleb Maclennan <caleb at alerque.com>
 # Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>
 
-_pyname=recommonmark
-pkgname=python-$_pyname
+_name=recommonmark
+pkgname=python-$_name
 pkgver=0.7.1
-pkgrel=3
+pkgrel=4
 pkgdesc='Markdown parser for docutils'
-url="https://$_pyname.readthedocs.io/"
-arch=(any)
-license=(MIT)
-_pydeps=(commonmark
-         docutils
-         sphinx)
-depends=(python
-         "${_pydeps[@]/#/python-}")
-makedepends=(python-setuptools)
-checkdepends=(python-pytest)
-_archive="$_pyname-$pkgver"
-source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/$_pyname/$_archive.tar.gz")
-sha256sums=('bdb4db649f2222dcd8d2d844f0006b958d627f732415d399791ee436a3686d67')
+arch=('any')
+url="https://recommonmark.readthedocs.io/"
+license=('MIT')
+depends=('python' 'python-commonmark' 'python-docutils' 'python-sphinx')
+makedepends=('python-setuptools')
+checkdepends=('python-pytest')
+source=(https://files.pythonhosted.org/packages/source/r/$_name/$_name-$pkgver.tar.gz
+        autostructify-tab_width-fallback.patch)
+sha256sums=('bdb4db649f2222dcd8d2d844f0006b958d627f732415d399791ee436a3686d67'
+            '0672b55c9bd49d24cfe86cd29fa93d1ebde3f757df606e7aea74ba6e58deff26')
 
+prepare() {
+  cd $_name-$pkgver
+  patch -Np1 -i ../autostructify-tab_width-fallback.patch
+}
+
 build() {
-	cd "$_archive"
-	python setup.py build
-	make -C docs text man
+  cd $_name-$pkgver
+  python setup.py build
+  make -C docs text man
 }
 
 check() {
-	cd "$_archive"
-	pytest \
-		--deselect tests/test_sphinx.py
+  cd $_name-$pkgver
+  pytest --deselect tests/test_sphinx.py
 }
 
 package() {
-	cd "$_archive"
-	python setup.py install --root="$pkgdir" --optimize=1 --skip-build
-	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" license.md
-	install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md CHANGELOG.md
-	install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname/" docs/_build/text/*.txt
-	install -Dm0644 -t "$pkgdir/usr/share/man/man1/" "docs/_build/man/$_pyname.1"
+  cd $_name-$pkgver
+  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" license.md
+  install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname" \
+    README.md CHANGELOG.md docs/_build/text/*.txt
+  install -Dm644 -t "$pkgdir/usr/share/man/man1" docs/_build/man/$_name.1
 }
+
+# vim:set ts=2 sw=2 et:

Added: autostructify-tab_width-fallback.patch
===================================================================
--- autostructify-tab_width-fallback.patch	                        (rev 0)
+++ autostructify-tab_width-fallback.patch	2022-05-31 10:41:51 UTC (rev 1217831)
@@ -0,0 +1,12 @@
+diff -upr recommonmark-0.7.1.orig/recommonmark/transform.py recommonmark-0.7.1/recommonmark/transform.py
+--- recommonmark-0.7.1.orig/recommonmark/transform.py	2019-08-09 21:38:35.000000000 +0300
++++ recommonmark-0.7.1/recommonmark/transform.py	2022-05-31 13:35:09.247049278 +0300
+@@ -28,6 +28,8 @@ class AutoStructify(transforms.Transform
+             self.config.update(new_cfg)
+         except AttributeError:
+             pass
++        # provide fallback like https://repo.or.cz/docutils.git/commit/e3bd0958bac8
++        self.document.settings.setdefault('tab_width', 8)
+ 
+         # Deprecation notices
+         # TODO move this check to an extension pattern, and only call once



More information about the arch-commits mailing list