[arch-commits] Commit in python-imagesize/trunk (PKGBUILD)

Daniel M. Capella polyzen at gemini.archlinux.org
Sun Sep 4 18:59:48 UTC 2022


    Date: Sunday, September 4, 2022 @ 18:59:48
  Author: polyzen
Revision: 1292877

upgpkg: python-imagesize 1.4.1-2: Use PEP 517

Modified:
  python-imagesize/trunk/PKGBUILD

----------+
 PKGBUILD |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-09-04 18:57:16 UTC (rev 1292876)
+++ PKGBUILD	2022-09-04 18:59:48 UTC (rev 1292877)
@@ -3,7 +3,7 @@
 
 pkgname=python-imagesize
 pkgver=1.4.1
-pkgrel=1
+pkgrel=2
 
 pkgdesc='Analyzes JPEG/JPEG 2000/PNG/GIF/TIFF/SVG/Netpbm/WebP image headers and returns image size or DPI'
 url='https://github.com/shibukawa/imagesize_py'
@@ -11,7 +11,8 @@
 license=('MIT')
 
 depends=('python')
-makedepends=('python-setuptools')
+makedepends=('python-build' 'python-installer' 'python-setuptools'
+             'python-wheel')
 
 source=("https://files.pythonhosted.org/packages/source/i/imagesize/imagesize-$pkgver.tar.gz")
 
@@ -19,7 +20,7 @@
 
 build() {
   cd imagesize-$pkgver
-  python setup.py build
+  python -m build --wheel --skip-dependency-check --no-isolation
 }
 
 check() {
@@ -29,6 +30,11 @@
 
 package() {
   cd imagesize-$pkgver
-  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
-  install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE.rst
+  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"/imagesize-$pkgver.dist-info/LICENSE.rst \
+    "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.rst
 }



More information about the arch-commits mailing list