diff options
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 37 | ||||
-rw-r--r-- | pr41.patch | 24 |
4 files changed, 64 insertions, 17 deletions
@@ -1,15 +1,21 @@ pkgbase = python-uinput pkgdesc = Pythonic API to Linux uinput kernel module pkgver = 0.11.2 - pkgrel = 2 + pkgrel = 3 url = https://github.com/tuomasjjrasanen/python-uinput - arch = any + arch = x86_64 + arch = aarch64 license = GPL - makedepends = python-setuptools + makedepends = python-build + makedepends = python-installer + makedepends = python-wheel depends = python + depends = glibc + depends = systemd-libs options = !emptydirs - source = https://codeload.github.com/tuomasjjrasanen/python-uinput/tar.gz/0.11.2 + source = python-uinput-0.11.2.tar.gz::https://github.com/tuomasjjrasanen/python-uinput/archive/refs/tags/0.11.2.tar.gz + source = pr41.patch::https://patch-diff.githubusercontent.com/raw/tuomasjjrasanen/python-uinput/pull/41.patch sha512sums = 50fedc43fddbb690782196af6e9e9363f73d4ec65c7d356750db0ac846dfc7cf7f98d406aaa035684f1fe7f17e02679047cccd07c9c232d1bbdc2f1fc2a8d97e + sha512sums = a53b925d1314e24a13703f598eec4774452bfa33046d0d15a04aa70d2ddfe77ab08c6fb46e8b947adce9f3a9e8d27d0e923233e8cac66f6ab46a0d9e9a5d02ec pkgname = python-uinput - diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..3069deb1417e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +src/ +pkg/ +*.pkg.* +*.tar.* @@ -1,20 +1,33 @@ # Maintainer: johnjq <dev [at] johnjq (dot) com> +# Co-maintainer: Ewout van Mansom <ewout@vanmansom.name> pkgname=python-uinput pkgver=0.11.2 -pkgrel=2 -pkgdesc="Pythonic API to Linux uinput kernel module" -arch=("any") -url="https://github.com/tuomasjjrasanen/python-uinput" -license=("GPL") -depends=("python") -makedepends=("python-setuptools") -options=("!emptydirs") -source=("https://codeload.github.com/tuomasjjrasanen/python-uinput/tar.gz/0.11.2") -sha512sums=("50fedc43fddbb690782196af6e9e9363f73d4ec65c7d356750db0ac846dfc7cf7f98d406aaa035684f1fe7f17e02679047cccd07c9c232d1bbdc2f1fc2a8d97e") +pkgrel=3 +pkgdesc='Pythonic API to Linux uinput kernel module' +arch=('x86_64' 'aarch64') +url='https://github.com/tuomasjjrasanen/python-uinput' +license=('GPL') +depends=('python' 'glibc' 'systemd-libs') +makedepends=(python-build python-installer python-wheel) +options=('!emptydirs') +source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/${pkgver}.tar.gz" + "pr41.patch::https://patch-diff.githubusercontent.com/raw/tuomasjjrasanen/python-uinput/pull/41.patch") +sha512sums=('50fedc43fddbb690782196af6e9e9363f73d4ec65c7d356750db0ac846dfc7cf7f98d406aaa035684f1fe7f17e02679047cccd07c9c232d1bbdc2f1fc2a8d97e' + 'a53b925d1314e24a13703f598eec4774452bfa33046d0d15a04aa70d2ddfe77ab08c6fb46e8b947adce9f3a9e8d27d0e923233e8cac66f6ab46a0d9e9a5d02ec') + +prepare() { + cd "${pkgname}-${pkgver}" + patch --forward --strip=1 --input="${srcdir}/pr41.patch" +} + +build() { + cd "${pkgname}-${pkgver}" + python -m build --wheel --no-isolation +} package() { - cd "$srcdir/python-uinput-$pkgver" - python setup.py install --root="$pkgdir/" --optimize=1 + cd "${pkgname}-${pkgver}" + python -m installer --destdir="$pkgdir" dist/*.whl install -m 644 -D COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } diff --git a/pr41.patch b/pr41.patch new file mode 100644 index 000000000000..63b7cdab5c31 --- /dev/null +++ b/pr41.patch @@ -0,0 +1,24 @@ +From 81b776c3f27cb909cec52d8abe5528541005b75f Mon Sep 17 00:00:00 2001 +From: Felix Geyer <debfx@fobos.de> +Date: Sun, 13 Nov 2022 11:26:48 +0100 +Subject: [PATCH] Add support for Python 3.11 + +The "SO" sysconfig has been removed in Python 3.11. +"EXT_SUFFIX" has been available since Python 3.4. +--- + src/__init__.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/__init__.py b/src/__init__.py +index 396cf66..974c8e1 100644 +--- a/src/__init__.py ++++ b/src/__init__.py +@@ -83,7 +83,7 @@ def _error_handler(result, fn, args): + def fdopen(): + return _libsuinput.suinput_open() + +-_libsuinput_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "_libsuinput" + sysconfig.get_config_var("SO"))) ++_libsuinput_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "_libsuinput" + sysconfig.get_config_var("EXT_SUFFIX"))) + _libsuinput = ctypes.CDLL(_libsuinput_path, use_errno=True) + _libsuinput.suinput_open.errcheck = _open_error_handler + _libsuinput.suinput_enable_event.errcheck = _error_handler |