diff options
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 51 |
3 files changed, 74 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..1abf696d7fdd --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = python-hidapi-git + pkgdesc = A Cython interface to the hidapi from signal11/hidapi + pkgver = 0.10.1.r10.g2353c96 + pkgrel = 1 + url = https://github.com/trezor/cython-hidapi + arch = any + license = custom + makedepends = cython + makedepends = python-setuptools + makedepends = udev + depends = python + depends = hidapi + provides = python-hidapi + conflicts = python-hidapi + source = python-hidapi-git::git+https://github.com/trezor/cython-hidapi#branch=master + sha512sums = SKIP + +pkgname = python-hidapi-git diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..a8da84be3eb4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +* + +!.SRCINFO +!.gitignore +!PKGBUILD diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..4efa7c18f9b7 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,51 @@ +# Maintainer: Jonas Malaco <jonas@protocubo.io> +# Contributor: Morten Linderud <foxboron@archlinux.org> +# Contributor: Timothy Redaelli <timothy.redaelli@gmail.com> +# Contributor: Andy Weidenbaum <archbaum@gmail.com> +# Contributor: Kevin Azzam <arch@kevin.azz.am> + +pkgname=python-hidapi-git +pkgver=0.10.1.r10.g2353c96 +pkgrel=1 +arch=('any') +pkgdesc="A Cython interface to the hidapi from signal11/hidapi" +url="https://github.com/trezor/cython-hidapi" +depends=('python' 'hidapi') +makedepends=('cython' 'python-setuptools' 'udev') +provides=("${pkgname%-git}") +conflicts=("${pkgname%-git}") +license=('custom') +source=("$pkgname::git+$url#branch=master") +sha512sums=('SKIP') + +pkgver() { + cd "$srcdir/$pkgname" + + git describe --tags --long --abbrev=7 | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g' +} + +build() { + cd "$srcdir/$pkgname" + + python setup.py build \ + --without-libusb --with-system-hidapi +} + +check() { + cd "$srcdir/$pkgname" + + local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))') + PYTHONPATH="$PWD/build/lib.linux-$CARCH-${python_version}" python tests.py +} + +package() { + cd "$srcdir/$pkgname" + + python setup.py install --root="$pkgdir" --optimize=1 --skip-build \ + --without-libusb --with-system-hidapi + + install -Dm 755 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt + install -Dm 755 LICENSE-bsd.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE-bsd.txt + install -Dm 755 LICENSE-gpl3.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE-gpl3.txt + install -Dm 755 LICENSE-orig.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE-orig.txt +} |