<pre style='margin:0'>
Renee Otten (reneeotten) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/2d43c39219ddf87886ad3b257867842266df4486">https://github.com/macports/macports-ports/commit/2d43c39219ddf87886ad3b257867842266df4486</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 2d43c39219d py-hid: new port
</span>2d43c39219d is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 2d43c39219ddf87886ad3b257867842266df4486
</span>Author: Basil Shubin <basil.shubin@gmail.com>
AuthorDate: Thu Dec 15 22:05:48 2022 +0600
<span style='display:block; white-space:pre;color:#404040;'> py-hid: new port
</span>---
python/py-hid/Portfile | 37 ++++++++++++++++++++++++++
python/py-hid/files/hid-__init__.py.patch | 43 +++++++++++++++++++++++++++++++
2 files changed, 80 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-hid/Portfile b/python/py-hid/Portfile
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..ca1f16b5192
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-hid/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,37 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+PortSystem 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+PortGroup python 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+name py-hid
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+version 1.0.5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+categories-append comms
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+license MIT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+supported_archs noarch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+platforms {darwin any}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+maintainers {@bashu gmail.com:bashu.was.here} openmaintainer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+description Python hidapi bindings in ctypes (aka pyhidapi)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+long_description {*}${description}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+homepage https://github.com/apmorton/pyhidapi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+checksums rmd160 8afa962c1e67e7d0f06e1cf9d28f8737e8f1e19e \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 1e954e7f7ab9b7c9dfc78db59504692c17db3b71249492b976b1525b97dbb0e8 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 3881
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles hid-__init__.py.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+python.versions 37 38 39 310
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${name} ne ${subport}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_build-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:py${python.version}-setuptools
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:hidapi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-hid/files/hid-__init__.py.patch b/python/py-hid/files/hid-__init__.py.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..f506c9e1da4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-hid/files/hid-__init__.py.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,43 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- hid/__init__.py.orig 2022-12-15 21:22:07.000000000 +0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ hid/__init__.py 2022-12-15 21:49:43.000000000 +0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,12 +1,13 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ import os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ import ctypes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++from ctypes import util
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ import atexit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ __all__ = ['HIDException', 'DeviceInfo', 'Device', 'enumerate']
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ hidapi = None
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-library_paths = (
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++library_names = (
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 'libhidapi-hidraw.so',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 'libhidapi-hidraw.so.0',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 'libhidapi-libusb.so',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -15,18 +16,20 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 'libhidapi-iohidmanager.so.0',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 'libhidapi.dylib',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 'hidapi.dll',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- 'libhidapi-0.dll'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ 'libhidapi-0.dll',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-for lib in library_paths:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++for libname in library_names:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hidapi = ctypes.cdll.LoadLibrary(lib)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ libpath = util.find_library(libname)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if libpath:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hidapi = ctypes.cdll.LoadLibrary(libpath)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ except OSError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pass
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ error = "Unable to load any of the following libraries:{}"\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- .format(' '.join(library_paths))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ .format(' '.join(library_names))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ raise ImportError(error)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span></pre><pre style='margin:0'>
</pre>