[arch-commits] Commit in python-hidapi/repos (3 files)

Morten Linderud foxboron at archlinux.org
Sun Nov 1 18:44:44 UTC 2020


    Date: Sunday, November 1, 2020 @ 18:44:43
  Author: foxboron
Revision: 738928

archrelease: copy trunk to community-staging-x86_64

Added:
  python-hidapi/repos/community-staging-x86_64/
  python-hidapi/repos/community-staging-x86_64/PKGBUILD
    (from rev 738927, python-hidapi/trunk/PKGBUILD)
  python-hidapi/repos/community-staging-x86_64/revert-hid_get_input_report.patch
    (from rev 738927, python-hidapi/trunk/revert-hid_get_input_report.patch)

-----------------------------------+
 PKGBUILD                          |   45 ++++++++++++++++++++
 revert-hid_get_input_report.patch |   79 ++++++++++++++++++++++++++++++++++++
 2 files changed, 124 insertions(+)

Copied: python-hidapi/repos/community-staging-x86_64/PKGBUILD (from rev 738927, python-hidapi/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2020-11-01 18:44:43 UTC (rev 738928)
@@ -0,0 +1,45 @@
+# Maintainer: Morten Linderud <foxboron at archlinux.org>
+# Contributor: Timothy Redaelli <timothy.redaelli at gmail.com>
+# Contributor: Andy Weidenbaum <archbaum at gmail.com>
+# Contributor: Kevin Azzam <arch at kevin.azz.am>
+
+pkgname=python-hidapi
+_pipname=hidapi
+pkgver=0.10.0.1
+_pkgver=${pkgver%.*}.post${pkgver##*.}
+pkgrel=5
+arch=('x86_64')
+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')
+license=('custom')
+source=("https://pypi.org/packages/source/${_pipname:0:1}/$_pipname/$_pipname-$_pkgver.tar.gz")
+sha512sums=('edd3fd0adf986add89721ff9cdf91d001024f9aceb93f4b3ff6d9d211fa93f301b0bacc6f2acebf81d1d70996fd977ee7fa5ba7dc9bfdc3ef2354de23f6be42a')
+
+build() {
+  cd "$_pipname-$_pkgver"
+
+  python setup.py build \
+        --without-libusb --with-system-hidapi
+}
+
+check() {
+  cd "$_pipname-$_pkgver"
+
+  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_python-hidapi() {
+  cd "$_pipname-$_pkgver"
+
+  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
+}
+

Copied: python-hidapi/repos/community-staging-x86_64/revert-hid_get_input_report.patch (from rev 738927, python-hidapi/trunk/revert-hid_get_input_report.patch)
===================================================================
--- community-staging-x86_64/revert-hid_get_input_report.patch	                        (rev 0)
+++ community-staging-x86_64/revert-hid_get_input_report.patch	2020-11-01 18:44:43 UTC (rev 738928)
@@ -0,0 +1,79 @@
+diff --unified --recursive --text package.orig/chid.pxd package.new/chid.pxd
+--- package.orig/chid.pxd	2020-07-05 23:48:53.567649269 -0300
++++ package.new/chid.pxd	2020-07-05 23:49:40.391130648 -0300
+@@ -29,7 +29,6 @@
+   int hid_set_nonblocking(hid_device* device, int value)
+   int hid_send_feature_report(hid_device* device, unsigned char *data, int length) nogil
+   int hid_get_feature_report(hid_device* device, unsigned char *data, int length) nogil
+-  int hid_get_input_report(hid_device* device, unsigned char *data, int length) nogil
+ 
+   int hid_get_manufacturer_string(hid_device*, wchar_t *, size_t)
+   int hid_get_product_string(hid_device*, wchar_t *, size_t)
+diff --unified --recursive --text package.orig/hid.pyx package.new/hid.pyx
+--- package.orig/hid.pyx	2020-07-05 23:48:53.567649269 -0300
++++ package.new/hid.pyx	2020-07-05 23:49:40.391130648 -0300
+@@ -206,30 +206,6 @@
+           free(cbuff)
+       return res
+ 
+-  def get_input_report(self, int report_num, int max_length):
+-      if self._c_hid == NULL:
+-          raise ValueError('not open')
+-      cdef hid_device * c_hid = self._c_hid
+-      cdef unsigned char lbuff[16]
+-      cdef unsigned char* cbuff
+-      cdef size_t c_max_length = max_length
+-      cdef int n
+-      if max_length <= 16:
+-          cbuff = lbuff
+-      else:
+-          cbuff = <unsigned char *>malloc(max_length)
+-      cbuff[0] = report_num
+-      with nogil:
+-          n = hid_get_input_report(c_hid, cbuff, c_max_length)
+-      res = []
+-      if n < 0:
+-          raise IOError('read error')
+-      for i in range(n):
+-          res.append(cbuff[i])
+-      if max_length > 16:
+-          free(cbuff)
+-      return res
+-
+   def error(self):
+       if self._c_hid == NULL:
+           raise ValueError('not open')
+diff --unified --recursive --text package.orig/hidraw.pyx package.new/hidraw.pyx
+--- package.orig/hidraw.pyx	2020-07-05 23:48:53.570982615 -0300
++++ package.new/hidraw.pyx	2020-07-05 23:49:40.391130648 -0300
+@@ -206,30 +206,6 @@
+           free(cbuff)
+       return res
+ 
+-  def get_input_report(self, int report_num, int max_length):
+-      if self._c_hid == NULL:
+-          raise ValueError('not open')
+-      cdef hid_device * c_hid = self._c_hid
+-      cdef unsigned char lbuff[16]
+-      cdef unsigned char* cbuff
+-      cdef size_t c_max_length = max_length
+-      cdef int n
+-      if max_length <= 16:
+-          cbuff = lbuff
+-      else:
+-          cbuff = <unsigned char *>malloc(max_length)
+-      cbuff[0] = report_num
+-      with nogil:
+-          n = hid_get_input_report(c_hid, cbuff, c_max_length)
+-      res = []
+-      if n < 0:
+-          raise IOError('read error')
+-      for i in range(n):
+-          res.append(cbuff[i])
+-      if max_length > 16:
+-          free(cbuff)
+-      return res
+-
+   def error(self):
+       if self._c_hid == NULL:
+           raise ValueError('not open')



More information about the arch-commits mailing list