aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Clausecker <fuz@FreeBSD.org>2023-05-24 07:33:43 +0000
committerRobert Clausecker <fuz@FreeBSD.org>2023-05-25 09:39:34 +0000
commita1fbebbcb6fc7439b6c01c63d2a39b1ee48e5246 (patch)
tree36059b59e68d9c38b2f71323967fbfe23a7ee19a
parent41cce74a9e4c1727c4120517724059f68f27404f (diff)
downloadports-a1fbebbcb6fc7439b6c01c63d2a39b1ee48e5246.tar.gz
ports-a1fbebbcb6fc7439b6c01c63d2a39b1ee48e5246.zip
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
-rw-r--r--sysutils/py-py-cpuinfo/Makefile6
-rw-r--r--sysutils/py-py-cpuinfo/files/patch-cpuinfo_cpuinfo.py11
2 files changed, 17 insertions, 0 deletions
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):