Date: Tuesday, September 6, 2022 @ 20:11:07
  Author: polyzen
Revision: 1294857

upgpkg: python-sphinxcontrib-jsmath 1.0.1-12: Use PEP 517

Modified:
  python-sphinxcontrib-jsmath/trunk/PKGBUILD

----------+
 PKGBUILD |   30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2022-09-06 20:10:55 UTC (rev 1294856)
+++ PKGBUILD    2022-09-06 20:11:07 UTC (rev 1294857)
@@ -3,19 +3,30 @@
 _name=sphinxcontrib-jsmath
 pkgname=python-sphinxcontrib-jsmath
 pkgver=1.0.1
-pkgrel=11
+pkgrel=12
 pkgdesc='Sphinx extension which renders display math in HTML via JavaScript'
 arch=('any')
 url=https://github.com/sphinx-doc/sphinxcontrib-jsmath
 license=('BSD')
-makedepends=('python-setuptools')
+makedepends=('python-build' 'python-installer' 'python-setuptools'
+             'python-wheel')
 checkdepends=('python-pytest' 'python-sphinx')
-source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz";)
-sha256sums=('a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8')
+source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz";
+        
'jsmath-read_text.patch::https://github.com/sphinx-doc/sphinxcontrib-jsmath/commit/3297b27177ab4862d1b2408a2db66235397fe212.patch')
+sha256sums=('a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8'
+            '697764efeaa1a6ef234d516a4a6b3fde0c77197a89eaae3246daf8b3ad1f12df')
+b2sums=('055ff298e11678d7d30975e4bef509ece0128be30ca0c5fd2be1323c2eb4fe92f861826ea5ddfcbd2d3e3a80535b374d2b1a13446c2604f3e448d5a8982b9881'
+        
'028e21e345de13f86e11bd5e7b5bd80c1add25b50321c983db3c61ebf5de9c776750fc763584abab0485a6e5e470b19dcbdbd1a068be35ddd18e4b4285fe569a')
 
+prepare() {
+  cd $_name-$pkgver
+  # https://github.com/sphinx-doc/sphinxcontrib-jsmath/pull/10
+  patch --forward --strip=1 --input=../jsmath-read_text.patch
+}
+
 build() {
   cd $_name-$pkgver
-  python setup.py build
+  python -m build --wheel --skip-dependency-check --no-isolation
 }
 
 check() {
@@ -25,6 +36,11 @@
 
 package() {
   cd $_name-$pkgver
-  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
-  install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE
+  python -m installer --destdir="$pkgdir" dist/*.whl
+
+  # Symlink license file
+  local site_packages=$(python -c "import site; 
print(site.getsitepackages()[0])")
+  install -d "$pkgdir"/usr/share/licenses/$pkgname
+  ln -s "$site_packages"/sphinxcontrib_jsmath-$pkgver.dist-info/LICENSE \
+    "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
 }

Reply via email to