summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Martinez2022-12-15 16:32:52 -0600
committerLuis Martinez2022-12-15 16:32:52 -0600
commite464f934d4c0b36369e7ee6ece10f5df6c046894 (patch)
tree008a25000f25d008f5e12b199f7bc477bde2367c
parent4631cc23e8dc23a7100a53700bbb91a74cd11026 (diff)
downloadaur-python-libnxctrl-git.tar.gz
packaging cleanup
-rw-r--r--.SRCINFO30
-rw-r--r--PKGBUILD67
2 files changed, 67 insertions, 30 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0dfb78fc947c..4475796a3994 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,25 +1,35 @@
pkgbase = python-libnxctrl-git
pkgdesc = Python Library Emulating Nintendo Switch Controllers
- pkgver = 0.1.7.e3ed8bc
+ pkgver = 0.2.1.r0.g2ae6347
pkgrel = 1
url = https://github.com/Victrid/libnxctrl
- arch = i686
- arch = x86_64
+ arch = any
license = GPL3
makedepends = git
+ makedepends = openssh
+ makedepends = python-build
+ makedepends = python-installer
+ makedepends = python-wheel
depends = dbus-python
- depends = python-flask
- depends = python-flask-socketio
- depends = python-eventlet
+ depends = python-aioconsole
depends = python-blessed
- depends = python-pynput
- depends = python-psutil
depends = python-cryptography
+ depends = python-eventlet
+ depends = python-flask
+ depends = python-flask-socketio
depends = python-hid
- depends = python-aioconsole
+ depends = python-psutil
+ depends = python-pynput
+ depends = python-setuptools
provides = python-libnxctrl
conflicts = python-libnxctrl
- source = python-libnxctrl::git+https://github.com/Victrid/libnxctrl.git
+ source = python-libnxctrl::git+https://github.com/Victrid/libnxctrl
+ source = poohl_joycontrol::git+https://github.com/poohl/joycontrol
+ source = mart1nro_joycontrol::git+https://github.com/mart1nro/joycontrol
+ source = nxbt::git+https://github.com/brikwerk/nxbt
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
sha256sums = SKIP
pkgname = python-libnxctrl-git
diff --git a/PKGBUILD b/PKGBUILD
index 5c1d6d769860..1205d93ca492 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,31 +1,58 @@
+# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>
+
pkgname=python-libnxctrl-git
-_pkgname="python-libnxctrl"
-pkgdesc="Python Library Emulating Nintendo Switch Controllers"
-pkgver=0.1.7.e3ed8bc
+_pkgname="${pkgname%-git}"
+_pkg="${_pkgname#python-}"
+pkgdesc='Python Library Emulating Nintendo Switch Controllers'
+pkgver=0.2.1.r0.g2ae6347
pkgrel=1
-arch=('i686' 'x86_64')
-conflicts=($_pkgname)
-provides=($_pkgname)
-url="https://github.com/Victrid/libnxctrl"
+arch=('any')
+url='https://github.com/Victrid/libnxctrl'
license=('GPL3')
depends=(
- "dbus-python" "python-flask" "python-flask-socketio" "python-eventlet"
- "python-blessed" "python-pynput" "python-psutil" "python-cryptography"
- "python-hid" "python-aioconsole"
-)
+ 'dbus-python'
+ 'python-aioconsole'
+ 'python-blessed'
+ 'python-cryptography'
+ 'python-eventlet'
+ 'python-flask'
+ 'python-flask-socketio'
+ 'python-hid'
+ 'python-psutil'
+ 'python-pynput'
+ 'python-setuptools')
optdepends=()
-makedepends=('git')
-source=("$_pkgname::git+https://github.com/Victrid/libnxctrl.git")
-sha256sums=('SKIP')
+makedepends=('git' 'python-build' 'python-installer' 'python-wheel')
+provides=("$_pkgname")
+conflicts=("$_pkgname")
+source=("$_pkgname::git+$url"
+ 'poohl_joycontrol::git+https://github.com/poohl/joycontrol'
+ 'mart1nro_joycontrol::git+https://github.com/mart1nro/joycontrol'
+ 'nxbt::git+https://github.com/brikwerk/nxbt')
+sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP')
pkgver() {
- cd $_pkgname
- printf "%s.%s" "$(python setup.py --version)" "$(git rev-parse --short HEAD)"
+ git -C "$_pkgname" describe --long --tags | sed 's/^v//;s/-/.r/;s/-/./'
+}
+
+prepare() {
+ cd "$_pkgname"
+ git submodule init
+ git config submodule.Poohl_joycontrol.url "$srcdir/poohl_joycontrol"
+ git config submodule.mart1no_joycontrol.url "$srcdir/mart1nro_joycontrol"
+ git config submodule.nxbt.url "$srcdir/nxbt"
+ git -c protocol.file.allow=always submodule update
+}
+
+build() {
+ cd "$_pkgname"
+ python -m build --wheel --no-isolation
}
package() {
- cd $_pkgname
- git submodule update --init --recursive --depth 1
- python setup.py install --root="$pkgdir/" --optimize=1
- install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ cd "$_pkgname"
+ python -m installer --destdir="$pkgdir" dist/*.whl
+ local _site="$(python -c 'import site; print(site.getsitepackages()[0])')"
+ install -dv "$pkgdir/usr/share/licenses/$pkgname/"
+ ln -sv "$_site/$_pkg-${pkgver%.r*}.dist-info/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"
}