[arch-commits] Commit in python-pyocd/repos/community-any (4 files)
David Runge
dvzrv at gemini.archlinux.org
Sat Aug 27 08:28:22 UTC 2022
Date: Saturday, August 27, 2022 @ 08:28:22
Author: dvzrv
Revision: 1284564
archrelease: copy trunk to community-any
Added:
python-pyocd/repos/community-any/PKGBUILD
(from rev 1284563, python-pyocd/trunk/PKGBUILD)
python-pyocd/repos/community-any/python-pyocd-0.33.1-optional_libusb_package.patch
(from rev 1284563, python-pyocd/trunk/python-pyocd-0.33.1-optional_libusb_package.patch)
Deleted:
python-pyocd/repos/community-any/PKGBUILD
python-pyocd/repos/community-any/python-pyocd-0.33.1-optional_libusb_package.patch
---------------------------------------------------+
PKGBUILD | 147 +++++-----
python-pyocd-0.33.1-optional_libusb_package.patch | 276 ++++++++++----------
2 files changed, 212 insertions(+), 211 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2022-08-27 08:28:09 UTC (rev 1284563)
+++ PKGBUILD 2022-08-27 08:28:22 UTC (rev 1284564)
@@ -1,73 +0,0 @@
-# Maintainer: David Runge <dvzrv at archlinux.org>
-
-_name=pyocd
-pkgname=python-pyocd
-pkgver=0.34.0
-pkgrel=1
-pkgdesc="Programming and debugging Arm Cortex-M microcontrollers"
-arch=(any)
-url="https://github.com/pyocd/pyOCD"
-license=(Apache)
-depends=(
- python-capstone
- python-cmsis-pack-manager
- python-colorama
- python-intelhex
- python-intervaltree
- python-natsort
- python-prettytable
- python-pyelftools
- python-pylink-square
- python-pyusb
- python-pyyaml
- python-six
- python-typing-extensions
-)
-makedepends=(python-build python-installer python-setuptools python-setuptools-scm python-toml python-wheel)
-checkdepends=(python-pytest python-typing-extensions)
-provides=(pyocd)
-conflicts=(pyocd)
-replaces=(pyocd)
-source=(
- https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz
- $pkgname-0.33.1-optional_libusb_package.patch
-)
-sha512sums=('e74c95259e4528af132179088d3dd43047bbf6cf0b2f87a14d90b9be4f0245019f54a71ff109f41f17afbf18e5c08da936a05a3d88df21aaaa4e56ead6ac692d'
- 'cbcf65ead4f72025c28e9d42e7947db9671c8de62a797dc27d1198dbdb164afe51b5cafb83224e5c0797b5ae6ea8a9f91080aae81f00934309645a47d0154eaf')
-b2sums=('d293b251f1c74a6827440384fee8387eedabc7a4e502eda6b3bd4f4e8c8f208412b5e59576ac3e3945f90e0deceb5daf67fdebb5d0521803ac128203cae79cc6'
- 'dfed46c4e852cf28029573acd49aef06e51a3280851111ebc40bd7110c1900f480e77ade970c9b4d5574e9966cab996014b503991fdb8879aa9113f9d8091edb')
-
-prepare() {
- cd $_name-$pkgver
-
- # we remove the dependency for libusb-package, because it would vendor libusb
- # https://github.com/pyocd/pyOCD/issues/1331
- sed '/libusb-package/d' -i setup.cfg
- patch -Np1 -i ../$pkgname-0.33.1-optional_libusb_package.patch
-
- # tag devices with uaccess to automatically make them available to active user sessions
- sed -e 's|MODE:="666"|MODE:="0660", TAG+="uaccess"|g' -i udev/*{cmsis,pico}*.rules
- sed -e 's|MODE:="0666"|MODE:="0660", TAG+="uaccess"|g' -i udev/*stlink*.rules
-}
-
-build() {
- cd $_name-$pkgver
- python -m build --wheel --no-isolation
-}
-
-check() {
- local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
-
- cd $_name-$pkgver
- # install to temporary location
- python -m installer --destdir=test_dir dist/*.whl
- export PYTHONPATH="test_dir/$_site_packages:$PYTHONPATH"
- pytest -vv
-}
-
-package() {
- cd $_name-$pkgver
- python -m installer --destdir="$pkgdir" dist/*.whl
- install -vDm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
- install -vDm 644 udev/*.rules -t "$pkgdir/usr/lib/udev/rules.d/"
-}
Copied: python-pyocd/repos/community-any/PKGBUILD (from rev 1284563, python-pyocd/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2022-08-27 08:28:22 UTC (rev 1284564)
@@ -0,0 +1,74 @@
+# Maintainer: David Runge <dvzrv at archlinux.org>
+
+_name=pyocd
+pkgname=python-pyocd
+pkgver=0.34.1
+pkgrel=1
+pkgdesc="Programming and debugging Arm Cortex-M microcontrollers"
+arch=(any)
+url="https://github.com/pyocd/pyOCD"
+license=(Apache)
+depends=(
+ python-capstone
+ python-cmsis-pack-manager
+ python-colorama
+ python-intelhex
+ python-intervaltree
+ python-natsort
+ python-prettytable
+ python-pyelftools
+ python-pylink-square
+ python-pyusb
+ python-pyyaml
+ python-six
+ python-typing-extensions
+)
+makedepends=(python-build python-installer python-setuptools python-setuptools-scm python-toml python-wheel)
+checkdepends=(python-pytest python-typing-extensions)
+optdepends=('python-setuptools: for plugin support')
+provides=(pyocd)
+conflicts=(pyocd)
+replaces=(pyocd)
+source=(
+ https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz
+ $pkgname-0.33.1-optional_libusb_package.patch
+)
+sha512sums=('c5265a959040de37dce1f9ce5de554722cd5f62d9c1e7f2f9995c31cc953daed67a2ffb9c534ab9c16f4aab3b1ae6c43dc4c7e08f648361aacac5c5d28f20286'
+ 'cbcf65ead4f72025c28e9d42e7947db9671c8de62a797dc27d1198dbdb164afe51b5cafb83224e5c0797b5ae6ea8a9f91080aae81f00934309645a47d0154eaf')
+b2sums=('cbd0513f403f7685040db4a3492723eb119414e2515b346a15fcd85b2cfbad6236a8ada8b6f5bbbf25df6103453c00842d64bb7c85836e6e15d66059cf106a22'
+ 'dfed46c4e852cf28029573acd49aef06e51a3280851111ebc40bd7110c1900f480e77ade970c9b4d5574e9966cab996014b503991fdb8879aa9113f9d8091edb')
+
+prepare() {
+ cd $_name-$pkgver
+
+ # we remove the dependency for libusb-package, because it would vendor libusb
+ # https://github.com/pyocd/pyOCD/issues/1331
+ sed '/libusb-package/d' -i setup.cfg
+ patch -Np1 -i ../$pkgname-0.33.1-optional_libusb_package.patch
+
+ # tag devices with uaccess to automatically make them available to active user sessions
+ sed -e 's|MODE:="666"|MODE:="0660", TAG+="uaccess"|g' -i udev/*{cmsis,pico}*.rules
+ sed -e 's|MODE:="0666"|MODE:="0660", TAG+="uaccess"|g' -i udev/*stlink*.rules
+}
+
+build() {
+ cd $_name-$pkgver
+ python -m build --wheel --no-isolation
+}
+
+check() {
+ local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
+
+ cd $_name-$pkgver
+ # install to temporary location
+ python -m installer --destdir=test_dir dist/*.whl
+ export PYTHONPATH="test_dir/$_site_packages:$PYTHONPATH"
+ pytest -vv
+}
+
+package() {
+ cd $_name-$pkgver
+ python -m installer --destdir="$pkgdir" dist/*.whl
+ install -vDm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
+ install -vDm 644 udev/*.rules -t "$pkgdir/usr/lib/udev/rules.d/"
+}
Deleted: python-pyocd-0.33.1-optional_libusb_package.patch
===================================================================
--- python-pyocd-0.33.1-optional_libusb_package.patch 2022-08-27 08:28:09 UTC (rev 1284563)
+++ python-pyocd-0.33.1-optional_libusb_package.patch 2022-08-27 08:28:22 UTC (rev 1284564)
@@ -1,138 +0,0 @@
-diff --git c/pyocd/probe/picoprobe.py w/pyocd/probe/picoprobe.py
-index 481e984f..14d1214d 100644
---- c/pyocd/probe/picoprobe.py
-+++ w/pyocd/probe/picoprobe.py
-@@ -18,8 +18,12 @@
- from array import array
-
- from time import sleep
-+try:
-+ from libusb_package import find as usb_find
-+except ImportError:
-+ from usb.core import find as usb_find
-+
- from usb import core, util
--import libusb_package
-
- import platform
- import errno
-@@ -108,7 +112,7 @@ class PicoLink(object):
- """@brief Find and return all Picoprobes """
- try:
- # Use a custom matcher to make sure the probe is a Picoprobe and accessible.
-- return [PicoLink(probe) for probe in libusb_package.find(find_all=True, custom_match=FindPicoprobe(uid))]
-+ return [PicoLink(probe) for probe in usb_find(find_all=True, custom_match=FindPicoprobe(uid))]
- except core.NoBackendError:
- show_no_libusb_warning()
- return []
-diff --git c/pyocd/probe/pydapaccess/interface/pyusb_backend.py w/pyocd/probe/pydapaccess/interface/pyusb_backend.py
-index cf240043..229fc7c5 100644
---- c/pyocd/probe/pydapaccess/interface/pyusb_backend.py
-+++ w/pyocd/probe/pydapaccess/interface/pyusb_backend.py
-@@ -37,7 +37,6 @@ TRACE = LOG.getChild("trace")
- TRACE.setLevel(logging.CRITICAL)
-
- try:
-- import libusb_package
- import usb.core
- import usb.util
- except ImportError:
-@@ -45,6 +44,12 @@ except ImportError:
- else:
- IS_AVAILABLE = True
-
-+try:
-+ from libusb_package import find as usb_find
-+except ImportError:
-+ from usb.core import find as usb_find
-+
-+
- class PyUSB(Interface):
- """@brief CMSIS-DAP USB interface class using pyusb for the backend."""
-
-@@ -70,7 +75,7 @@ class PyUSB(Interface):
- assert self.closed is True
-
- # Get device handle
-- dev = libusb_package.find(custom_match=FindDap(self.serial_number))
-+ dev = usb_find(custom_match=FindDap(self.serial_number))
- if dev is None:
- raise DAPAccessIntf.DeviceError("Device %s not found" % self.serial_number)
-
-@@ -161,7 +166,7 @@ class PyUSB(Interface):
- """
- # find all cmsis-dap devices
- try:
-- all_devices = libusb_package.find(find_all=True, custom_match=FindDap())
-+ all_devices = usb_find(find_all=True, custom_match=FindDap())
- except usb.core.NoBackendError:
- if not PyUSB.did_show_no_libusb_warning:
- LOG.warning("CMSIS-DAPv1 probes may not be detected because no libusb library was found.")
-diff --git c/pyocd/probe/pydapaccess/interface/pyusb_v2_backend.py w/pyocd/probe/pydapaccess/interface/pyusb_v2_backend.py
-index a9b0a1a0..e2007908 100644
---- c/pyocd/probe/pydapaccess/interface/pyusb_v2_backend.py
-+++ w/pyocd/probe/pydapaccess/interface/pyusb_v2_backend.py
-@@ -38,7 +38,6 @@ TRACE = LOG.getChild("trace")
- TRACE.setLevel(logging.CRITICAL)
-
- try:
-- import libusb_package
- import usb.core
- import usb.util
- except ImportError:
-@@ -46,6 +45,12 @@ except ImportError:
- else:
- IS_AVAILABLE = True
-
-+try:
-+ from libusb_package import find as usb_find
-+except ImportError:
-+ from usb.core import find as usb_find
-+
-+
- class PyUSBv2(Interface):
- """@brief CMSIS-DAPv2 interface using pyUSB."""
-
-@@ -84,7 +89,7 @@ class PyUSBv2(Interface):
- assert self.closed is True
-
- # Get device handle
-- dev = libusb_package.find(custom_match=HasCmsisDapv2Interface(self.serial_number))
-+ dev = usb_find(custom_match=HasCmsisDapv2Interface(self.serial_number))
- if dev is None:
- raise DAPAccessIntf.DeviceError("Device %s not found" %
- self.serial_number)
-@@ -187,7 +192,7 @@ class PyUSBv2(Interface):
- """@brief Returns all the connected devices with a CMSIS-DAPv2 interface."""
- # find all cmsis-dap devices
- try:
-- all_devices = libusb_package.find(find_all=True, custom_match=HasCmsisDapv2Interface())
-+ all_devices = usb_find(find_all=True, custom_match=HasCmsisDapv2Interface())
- except usb.core.NoBackendError:
- common.show_no_libusb_warning()
- return []
-diff --git c/pyocd/probe/stlink/usb.py w/pyocd/probe/stlink/usb.py
-index c9a400af..883c014c 100644
---- c/pyocd/probe/stlink/usb.py
-+++ w/pyocd/probe/stlink/usb.py
-@@ -15,7 +15,10 @@
- # See the License for the specific language governing permissions and
- # limitations under the License.
-
--import libusb_package
-+try:
-+ from libusb_package import find as usb_find
-+except ImportError:
-+ from usb.core import find as usb_find
- import usb.core
- import usb.util
- import logging
-@@ -101,7 +104,7 @@ class STLinkUSBInterface:
- @classmethod
- def get_all_connected_devices(cls):
- try:
-- devices = libusb_package.find(find_all=True, custom_match=cls._usb_match)
-+ devices = usb_find(find_all=True, custom_match=cls._usb_match)
- except usb.core.NoBackendError:
- common.show_no_libusb_warning()
- return []
Copied: python-pyocd/repos/community-any/python-pyocd-0.33.1-optional_libusb_package.patch (from rev 1284563, python-pyocd/trunk/python-pyocd-0.33.1-optional_libusb_package.patch)
===================================================================
--- python-pyocd-0.33.1-optional_libusb_package.patch (rev 0)
+++ python-pyocd-0.33.1-optional_libusb_package.patch 2022-08-27 08:28:22 UTC (rev 1284564)
@@ -0,0 +1,138 @@
+diff --git c/pyocd/probe/picoprobe.py w/pyocd/probe/picoprobe.py
+index 481e984f..14d1214d 100644
+--- c/pyocd/probe/picoprobe.py
++++ w/pyocd/probe/picoprobe.py
+@@ -18,8 +18,12 @@
+ from array import array
+
+ from time import sleep
++try:
++ from libusb_package import find as usb_find
++except ImportError:
++ from usb.core import find as usb_find
++
+ from usb import core, util
+-import libusb_package
+
+ import platform
+ import errno
+@@ -108,7 +112,7 @@ class PicoLink(object):
+ """@brief Find and return all Picoprobes """
+ try:
+ # Use a custom matcher to make sure the probe is a Picoprobe and accessible.
+- return [PicoLink(probe) for probe in libusb_package.find(find_all=True, custom_match=FindPicoprobe(uid))]
++ return [PicoLink(probe) for probe in usb_find(find_all=True, custom_match=FindPicoprobe(uid))]
+ except core.NoBackendError:
+ show_no_libusb_warning()
+ return []
+diff --git c/pyocd/probe/pydapaccess/interface/pyusb_backend.py w/pyocd/probe/pydapaccess/interface/pyusb_backend.py
+index cf240043..229fc7c5 100644
+--- c/pyocd/probe/pydapaccess/interface/pyusb_backend.py
++++ w/pyocd/probe/pydapaccess/interface/pyusb_backend.py
+@@ -37,7 +37,6 @@ TRACE = LOG.getChild("trace")
+ TRACE.setLevel(logging.CRITICAL)
+
+ try:
+- import libusb_package
+ import usb.core
+ import usb.util
+ except ImportError:
+@@ -45,6 +44,12 @@ except ImportError:
+ else:
+ IS_AVAILABLE = True
+
++try:
++ from libusb_package import find as usb_find
++except ImportError:
++ from usb.core import find as usb_find
++
++
+ class PyUSB(Interface):
+ """@brief CMSIS-DAP USB interface class using pyusb for the backend."""
+
+@@ -70,7 +75,7 @@ class PyUSB(Interface):
+ assert self.closed is True
+
+ # Get device handle
+- dev = libusb_package.find(custom_match=FindDap(self.serial_number))
++ dev = usb_find(custom_match=FindDap(self.serial_number))
+ if dev is None:
+ raise DAPAccessIntf.DeviceError("Device %s not found" % self.serial_number)
+
+@@ -161,7 +166,7 @@ class PyUSB(Interface):
+ """
+ # find all cmsis-dap devices
+ try:
+- all_devices = libusb_package.find(find_all=True, custom_match=FindDap())
++ all_devices = usb_find(find_all=True, custom_match=FindDap())
+ except usb.core.NoBackendError:
+ if not PyUSB.did_show_no_libusb_warning:
+ LOG.warning("CMSIS-DAPv1 probes may not be detected because no libusb library was found.")
+diff --git c/pyocd/probe/pydapaccess/interface/pyusb_v2_backend.py w/pyocd/probe/pydapaccess/interface/pyusb_v2_backend.py
+index a9b0a1a0..e2007908 100644
+--- c/pyocd/probe/pydapaccess/interface/pyusb_v2_backend.py
++++ w/pyocd/probe/pydapaccess/interface/pyusb_v2_backend.py
+@@ -38,7 +38,6 @@ TRACE = LOG.getChild("trace")
+ TRACE.setLevel(logging.CRITICAL)
+
+ try:
+- import libusb_package
+ import usb.core
+ import usb.util
+ except ImportError:
+@@ -46,6 +45,12 @@ except ImportError:
+ else:
+ IS_AVAILABLE = True
+
++try:
++ from libusb_package import find as usb_find
++except ImportError:
++ from usb.core import find as usb_find
++
++
+ class PyUSBv2(Interface):
+ """@brief CMSIS-DAPv2 interface using pyUSB."""
+
+@@ -84,7 +89,7 @@ class PyUSBv2(Interface):
+ assert self.closed is True
+
+ # Get device handle
+- dev = libusb_package.find(custom_match=HasCmsisDapv2Interface(self.serial_number))
++ dev = usb_find(custom_match=HasCmsisDapv2Interface(self.serial_number))
+ if dev is None:
+ raise DAPAccessIntf.DeviceError("Device %s not found" %
+ self.serial_number)
+@@ -187,7 +192,7 @@ class PyUSBv2(Interface):
+ """@brief Returns all the connected devices with a CMSIS-DAPv2 interface."""
+ # find all cmsis-dap devices
+ try:
+- all_devices = libusb_package.find(find_all=True, custom_match=HasCmsisDapv2Interface())
++ all_devices = usb_find(find_all=True, custom_match=HasCmsisDapv2Interface())
+ except usb.core.NoBackendError:
+ common.show_no_libusb_warning()
+ return []
+diff --git c/pyocd/probe/stlink/usb.py w/pyocd/probe/stlink/usb.py
+index c9a400af..883c014c 100644
+--- c/pyocd/probe/stlink/usb.py
++++ w/pyocd/probe/stlink/usb.py
+@@ -15,7 +15,10 @@
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+
+-import libusb_package
++try:
++ from libusb_package import find as usb_find
++except ImportError:
++ from usb.core import find as usb_find
+ import usb.core
+ import usb.util
+ import logging
+@@ -101,7 +104,7 @@ class STLinkUSBInterface:
+ @classmethod
+ def get_all_connected_devices(cls):
+ try:
+- devices = libusb_package.find(find_all=True, custom_match=cls._usb_match)
++ devices = usb_find(find_all=True, custom_match=cls._usb_match)
+ except usb.core.NoBackendError:
+ common.show_no_libusb_warning()
+ return []
More information about the arch-commits
mailing list