python3Packages.sip: fix builds of dependents on non-x86 Linux

This commit is contained in:
Thomas Watson 2022-03-27 11:28:43 -05:00 committed by Frederik Rietdijk
parent 3b8a5bfefa
commit 22773bb820
2 changed files with 26 additions and 0 deletions

View file

@ -10,6 +10,13 @@ buildPythonPackage rec {
sha256 = "a1cf8431a8eb9392b3ff6dc61d832d0447bfdcae5b3e4256a5fa74dbc25b0734";
};
patches = [
# on non-x86 Linux platforms, sip incorrectly detects the manylinux version
# and PIP will refuse to install the resulting wheel.
# remove once upstream fixes this, hopefully in 6.5.2
./fix-manylinux-version.patch
];
propagatedBuildInputs = [ packaging toml ];
# There aren't tests

View file

@ -0,0 +1,19 @@
diff --git a/sipbuild/project.py b/sipbuild/project.py
--- a/sipbuild/project.py
+++ b/sipbuild/project.py
@@ -336,13 +336,13 @@ class Project(AbstractProject, Configurable):
# We expect a two part tag so leave anything else unchanged.
parts = platform_tag.split('-')
if len(parts) == 2:
- if self.minimum_glibc_version > (2, 17):
+ if self.minimum_glibc_version > (2, 17) or parts[1] not in {"x86_64", "i686", "aarch64", "armv7l", "ppc64", "ppc64le", "s390x"}:
# PEP 600.
parts[0] = 'manylinux'
parts.insert(1,
'{}.{}'.format(self.minimum_glibc_version[0],
self.minimum_glibc_version[1]))
- elif self.minimum_glibc_version > (2, 12):
+ elif self.minimum_glibc_version > (2, 12) or parts[1] not in {"x86_64", "i686"}:
# PEP 599.
parts[0] = 'manylinux2014'
elif self.minimum_glibc_version > (2, 5):