git: a1fbebbcb6fc - main - sysutils/py-py-cpuinfo: fix on armv7, add lscpu dependency

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Thu, 25 May 2023 09:44:08 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a1fbebbcb6fc7439b6c01c63d2a39b1ee48e5246

commit a1fbebbcb6fc7439b6c01c63d2a39b1ee48e5246
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-05-24 07:33:43 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-05-25 09:39:34 +0000

    sysutils/py-py-cpuinfo: fix on armv7, add lscpu dependency
    
    On FreeBSD, armv[67] both report "arm" in "uname -m", but this package
    expected the string armv6 or armv7.  Fix the port by adding an extra
    case for just "arm" to the architecture detection logic.
    
    While we are at it, optionally depend on sysutils/lscpu as an
    additional data source for architecture features.
    
    See also:       https://github.com/workhorsy/py-cpuinfo/issues/197
    Approved by:    yuri (maintainer)
    Differential Revision: https://reviews.freebsd.org/D40252
---
 sysutils/py-py-cpuinfo/Makefile                       |  6 ++++++
 sysutils/py-py-cpuinfo/files/patch-cpuinfo_cpuinfo.py | 11 +++++++++++
 2 files changed, 17 insertions(+)

diff --git a/sysutils/py-py-cpuinfo/Makefile b/sysutils/py-py-cpuinfo/Makefile
index 8293a493a925..628fe54b95ae 100644
--- a/sysutils/py-py-cpuinfo/Makefile
+++ b/sysutils/py-py-cpuinfo/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	py-cpuinfo
 DISTVERSION=	8.0.0
+PORTREVISION=	1
 CATEGORIES=	sysutils python
 MASTER_SITES=	PYPI
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -16,4 +17,9 @@ USE_PYTHON=	distutils concurrent autoplist
 
 NO_ARCH=	yes
 
+OPTIONS_DEFINE=	LSCPU
+OPTIONS_DEFAULT=	LSCPU
+LSCPU_DESC=	Use sysutils/lscpu as a data source
+LSCPU_RUN_DEPENDS=	lscpu:sysutils/lscpu
+
 .include <bsd.port.mk>
diff --git a/sysutils/py-py-cpuinfo/files/patch-cpuinfo_cpuinfo.py b/sysutils/py-py-cpuinfo/files/patch-cpuinfo_cpuinfo.py
new file mode 100644
index 000000000000..ffbfc56cbdb1
--- /dev/null
+++ b/sysutils/py-py-cpuinfo/files/patch-cpuinfo_cpuinfo.py
@@ -0,0 +1,11 @@
+--- cpuinfo/cpuinfo.py.orig	2023-05-24 07:26:57 UTC
++++ cpuinfo/cpuinfo.py
+@@ -797,7 +797,7 @@ def _parse_arch(arch_string_raw):
+ 	elif re.match(r'^armv8-a|aarch64|arm64$', arch_string_raw):
+ 		arch = 'ARM_8'
+ 		bits = 64
+-	elif re.match(r'^armv7$|^armv7[a-z]$|^armv7-[a-z]$|^armv6[a-z]$', arch_string_raw):
++	elif re.match(r'^armv7$|^armv7[a-z]$|^armv7-[a-z]$|^armv6[a-z]$|^arm$', arch_string_raw):
+ 		arch = 'ARM_7'
+ 		bits = 32
+ 	elif re.match(r'^armv8$|^armv8[a-z]$|^armv8-[a-z]$', arch_string_raw):