Skip to content

Commit

Permalink
py-cpuinfo: fix for powerpc
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed Nov 8, 2024
1 parent d611b25 commit c24aacc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/py-cpuinfo/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PortGroup python 1.0
name py-cpuinfo
python.rootname ${name}
version 9.0.0
revision 0
revision 1

supported_archs noarch
platforms {darwin any}
Expand All @@ -29,5 +29,8 @@ checksums rmd160 70ee76ca118f099879d834bb52ff9557e7077570 \
python.versions 38 39 310 311 312 313

if {${name} ne ${subport}} {
# https://github.com/workhorsy/py-cpuinfo/issues/217
patchfiles-append \
patch-cpuinfo.py.diff
test.run yes
}
21 changes: 21 additions & 0 deletions python/py-cpuinfo/files/patch-cpuinfo.py.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- cpuinfo/cpuinfo.py 2022-10-26 03:07:15.000000000 +0800
+++ cpuinfo/cpuinfo.py 2024-11-08 17:01:28.000000000 +0800
@@ -361,7 +361,7 @@
def _check_arch():
arch, bits = _parse_arch(DataSource.arch_string_raw)
if not arch in ['X86_32', 'X86_64', 'ARM_7', 'ARM_8',
- 'PPC_64', 'S390X', 'MIPS_32', 'MIPS_64',
+ 'PPC_32', 'PPC_64', 'S390X', 'MIPS_32', 'MIPS_64',
"RISCV_32", "RISCV_64"]:
raise Exception("py-cpuinfo currently only works on X86 "
"and some ARM/PPC/S390X/MIPS/RISCV CPUs.")
@@ -829,6 +829,9 @@
elif re.match(r'^riscv64$|^riscv64be$', arch_string_raw):
arch = 'RISCV_64'
bits = 64
+ else:
+ arch = 'PPC_32'
+ bits = 32

return (arch, bits)

0 comments on commit c24aacc

Please sign in to comment.