From bfb969795df0050f3b39c33677ccebdbca61401c Mon Sep 17 00:00:00 2001
From: Clayton Craft <clayton@craftyguy.net>
Date: Fri, 5 Feb 2021 13:26:32 -0800
Subject: [PATCH] testing/py3-solo: new aport

---
 testing/py3-solo/70-solokey.rules     |  8 +++++
 testing/py3-solo/APKBUILD             | 46 +++++++++++++++++++++++++++
 testing/py3-solo/create-setuppy.patch | 14 ++++++++
 3 files changed, 68 insertions(+)
 create mode 100644 testing/py3-solo/70-solokey.rules
 create mode 100644 testing/py3-solo/APKBUILD
 create mode 100644 testing/py3-solo/create-setuppy.patch

diff --git a/testing/py3-solo/70-solokey.rules b/testing/py3-solo/70-solokey.rules
new file mode 100644
index 000000000000..c1424979d680
--- /dev/null
+++ b/testing/py3-solo/70-solokey.rules
@@ -0,0 +1,8 @@
+KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", TAG+="uaccess", SYMLINK+="solokey"
+
+# Solo bootloader + firmware access
+KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", TAG+="uaccess"
+KERNEL=="hidraw*", SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", TAG+="uaccess"
+
+# ST DFU access
+KERNEL=="hidraw*", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess"
diff --git a/testing/py3-solo/APKBUILD b/testing/py3-solo/APKBUILD
new file mode 100644
index 000000000000..2af17d909350
--- /dev/null
+++ b/testing/py3-solo/APKBUILD
@@ -0,0 +1,46 @@
+# Contributor: Clayton Craft <clayton@craftyguy.net>
+# Maintainer: Clayton Craft <clayton@craftyguy.net>
+pkgname=py3-solo
+_pkgname=solo-python
+pkgver=0.0.27
+pkgrel=0
+pkgdesc="Python3 tool and library for SoloKeys"
+url="https://github.com/solokeys/solo-python"
+arch="noarch"
+license="MIT"
+depends="
+	py3-click
+	py3-cryptography
+	py3-ecdsa
+	py3-fido2
+	py3-intelhex
+	py3-pyserial
+	py3-requests
+	py3-usb
+	"
+makedepends="pyproject2setuppy"
+source="
+	$pkgname-$pkgver.tar.gz::https://github.com/solokeys/solo-python/archive/$pkgver.tar.gz
+	create-setuppy.patch
+	70-solokey.rules
+	"
+builddir="$srcdir/$_pkgname-$pkgver"
+
+build() {
+	python3 setup.py build
+}
+
+check() {
+	python3 setup.py check
+}
+
+package() {
+	python3 setup.py install --prefix=/usr --root="$pkgdir"
+
+	install -Dm644 "$srcdir"/70-solokey.rules \
+		"$pkgdir"/usr/lib/udev/rules.d/70-solokey.rules
+}
+
+sha512sums="50d564916e07a0c65a843bd2d0328a735ba71eadcfc893b13fac84a3e51822ed2bf80fc3f7662943a5635c6cd6b3ded8ba5b5a9ac2282c9f9bcdfe9de191e445  py3-solo-0.0.27.tar.gz
+1b561db05974468eecec48f2b4e0f705b4bb9bdfdf6a1c1ce40ad884824ca468243cd4296325674fa311b3ce32827d924383f814c8475b6ccddad302a5c23f51  create-setuppy.patch
+1965441c95bcc534192f979bd1bf59dc0c6738e417a5688dd065c81963f5db29e7683e1d771d3eb9e875e93669999a21bd9bbf48a570ab161db3b5323a169526  70-solokey.rules"
diff --git a/testing/py3-solo/create-setuppy.patch b/testing/py3-solo/create-setuppy.patch
new file mode 100644
index 000000000000..0beee91e9faa
--- /dev/null
+++ b/testing/py3-solo/create-setuppy.patch
@@ -0,0 +1,14 @@
+Author: Francesco Colista <fcolista@alpinelinux.org>
+Date:   Tue May 19 18:56:39 2020 +0000
+
+    added setup.py to build package with setuptools
+
+diff --git a/setup.py b/setup.py
+new file mode 100644
+index 0000000..ebe2f51
+--- /dev/null
++++ b/setup.py
+@@ -0,0 +1,3 @@
++#!/usr/bin/env python3
++from pyproject2setuppy.main import main
++main()
-- 
GitLab