summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorAlphaJack2024-01-05 15:44:59 +0100
committerAlphaJack2024-01-05 15:44:59 +0100
commit0aaac799f3ae964e71254ee0d7c204e884cbfe1c (patch)
tree540c28fd3d6221f379bf239e29910d4a9146eea2 /PKGBUILD
parent2373557c06e1a82aa5cab16aed3cb34ea050be12 (diff)
downloadaur-python-ws4py.tar.gz
Replaced distutils with setuptools and asyncio.async with asyncio.ensure_future, using modern python installation stack
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD57
1 files changed, 35 insertions, 22 deletions
diff --git a/PKGBUILD b/PKGBUILD
index f768a4c3e098..fe98475b0cb9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,29 +1,42 @@
-# Maintainer: ValHue <vhuelamo at gmail dot com>
-#
+# Maintainer: AlphaJack <alphajack at tuta dot io>
+# Contributor: ValHue <vhuelamo at gmail dot com>
# Contributor: korjjj <korjjj+aur[at]gmail[dot]com>
-#
-_pkgname="ws4py"
-pkgname="python-${_pkgname}"
+
+_name="ws4py"
+pkgname="python-${_name}"
pkgver=0.5.1
-pkgrel=1
-pkgdesc="WebSocket client and server library for Python."
+pkgrel=2
+pkgdesc="WebSocket client and server library for Python"
url="https://github.com/Lawouach/WebSocket-for-Python"
-license=('BSD')
-arch=('any')
-depends=('python')
-makedepends=('python-setuptools')
-provides=("${_pkgname}")
-source=("${_pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz")
-sha256sums=('3fb493bd1af767a46cd6cb9db4c7d7b8db5eac3466f7513aa9cd20385e4740d4')
+license=("BSD")
+arch=("any")
+depends=("python")
+makedepends=("python-build" "python-installer" "python-wheel" "python-setuptools")
+provides=("$_name" "$pkgname")
+source=("$_name-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
+b2sums=('31db304800f0d3da61dc4c1a3381a8fcfcfa8f16b36d916311cc32f1d294c9f7b3627dac673edf824f529f485f825ca418ab1e1a8a2fda5583c6a6a1bd9b752c')
+
+prepare(){
+ cd "WebSocket-for-Python-$pkgver"
+ # installation warning
+ sed -i "setup.py" \
+ -e "s|distutils|setuptools|g"
+ # https://github.com/Lawouach/WebSocket-for-Python/issues/250
+ IFS=$'\n' fileList=($(grep -rnl "asyncio.async"))
+ for file in "${fileList[@]}"; do
+ sed -i "$file" \
+ -e "s|asyncio.async|asyncio.ensure_future|g"
+ done
+}
+
+build(){
+ cd "WebSocket-for-Python-$pkgver"
+ python -m build --wheel --no-isolation
+}
-package() {
- cd "${srcdir}/WebSocket-for-Python-${pkgver}"
- python setup.py install --optimize=1 \
- --prefix=/usr \
- --root="${pkgdir}"
- install -vDm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
- install -vDm 644 {CHANGELOG,README}.md \
- -t "${pkgdir}/usr/share/doc/${pkgname}"
+package(){
+ cd "WebSocket-for-Python-$pkgver"
+ python -m installer --destdir="$pkgdir" dist/*.whl
}
# vim:set ts=4 sw=4 ft=sh et: