diff options
author | prspkt <prspkt@protonmail.com> | 2019-06-24 23:31:46 +0300 |
---|---|---|
committer | prspkt <prspkt@protonmail.com> | 2019-06-24 23:46:58 +0300 |
commit | 4f7c7ce63d1b6094ed8b17bf1ec9386f21f5979f (patch) | |
tree | 6f9f527beea4ba3778cf2296ca3756b12a6fb041 | |
parent | f6bb6d19682979e070f128795e57d37bd170d351 (diff) | |
download | aports-4f7c7ce63d1b6094ed8b17bf1ec9386f21f5979f.tar.bz2 aports-4f7c7ce63d1b6094ed8b17bf1ec9386f21f5979f.tar.xz |
testing/py3-py-cpuinfo: enable s390x, modernize
-rw-r--r-- | testing/py3-py-cpuinfo/APKBUILD | 11 | ||||
-rw-r--r-- | testing/py3-py-cpuinfo/add-s390x.patch | 37 |
2 files changed, 42 insertions, 6 deletions
diff --git a/testing/py3-py-cpuinfo/APKBUILD b/testing/py3-py-cpuinfo/APKBUILD index eee04cf426..327b7ba8f0 100644 --- a/testing/py3-py-cpuinfo/APKBUILD +++ b/testing/py3-py-cpuinfo/APKBUILD @@ -3,32 +3,31 @@ pkgname=py3-py-cpuinfo _pkgname=py-cpuinfo pkgver=5.0.0 -pkgrel=1 +pkgrel=2 pkgdesc="A module for getting CPU info" url="https://github.com/workhorsy/py3-cpuinfo" arch="noarch !s390x" license="MIT" depends="python3" makedepends="py3-setuptools" -source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" +source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz + add-s390x.patch" builddir="$srcdir"/$_pkgname-$pkgver replaces="py-cpuinfo" # Backwards compatibility provides="py-cpuinfo=$pkgver-r$pkgrel" # Backwards compatibility build() { - cd "$builddir" python3 setup.py build } check() { - cd "$builddir" python3 setup.py test } package() { - cd "$builddir" python3 setup.py install --prefix=/usr --root="$pkgdir" } -sha512sums="d3a22ffdc4d1668a58330016e3297e57c07f6380e544497b1ad9dfcf0410b000f69418bf1cb9a434a2ffdbc8f17be89a25d33c65817913a823c6e181df6b760e py-cpuinfo-5.0.0.tar.gz" +sha512sums="d3a22ffdc4d1668a58330016e3297e57c07f6380e544497b1ad9dfcf0410b000f69418bf1cb9a434a2ffdbc8f17be89a25d33c65817913a823c6e181df6b760e py-cpuinfo-5.0.0.tar.gz +98b361419e54b0386dc026575d5be18494c2c22f0a102045bd84af18e0691427327421721e0d747b823cb583f02a74606195bf2e4ab990ffaedd39fd0ca0118c add-s390x.patch" diff --git a/testing/py3-py-cpuinfo/add-s390x.patch b/testing/py3-py-cpuinfo/add-s390x.patch new file mode 100644 index 0000000000..9b768dabf2 --- /dev/null +++ b/testing/py3-py-cpuinfo/add-s390x.patch @@ -0,0 +1,37 @@ +--- a/cpuinfo/cpuinfo.py ++++ b/cpuinfo/cpuinfo.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # -*- coding: UTF-8 -*- + + # Copyright (c) 2014-2019, Matthew Brennan Jones <matthew.brennan.jones@gmail.com> +@@ -228,8 +227,8 @@ + # Make sure we are running on a supported system + def _check_arch(): + arch, bits = _parse_arch(DataSource.raw_arch_string) +- if not arch in ['X86_32', 'X86_64', 'ARM_7', 'ARM_8', 'PPC_64']: +- raise Exception("py-cpuinfo currently only works on X86 and some PPC and ARM CPUs.") ++ if not arch in ['X86_32', 'X86_64', 'ARM_7', 'ARM_8', 'PPC_64', 'S390X']: ++ raise Exception("py-cpuinfo currently only works on X86 and some PPC and ARM and S390X CPUs.") + + def _obj_to_b64(thing): + import pickle +@@ -583,6 +582,10 @@ + bits = 32 + elif re.match('^powerpc$|^ppc64$|^ppc64le$', raw_arch_string): + arch = 'PPC_64' ++ bits = 64 ++ # S390X ++ elif re.match('^s390x$', raw_arch_string): ++ arch = 'S390X' + bits = 64 + # SPARC + elif re.match('^sparc32$|^sparc$', raw_arch_string): +--- a/tests/test_invalid_cpu.py ++++ b/tests/test_invalid_cpu.py +@@ -32,4 +32,4 @@ + cpuinfo._check_arch() + self.fail('Failed to raise Exception') + except Exception as err: +- self.assertEqual('py-cpuinfo currently only works on X86 and some PPC and ARM CPUs.', err.args[0]) ++ self.assertEqual('py-cpuinfo currently only works on X86 and some PPC and ARM and S390X CPUs.', err.args[0]) |