From 22773bb820a745a5d442012acac0d4c61bc76242 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Sun, 27 Mar 2022 11:28:43 -0500 Subject: [PATCH] python3Packages.sip: fix builds of dependents on non-x86 Linux --- .../python-modules/sip/default.nix | 7 +++++++ .../sip/fix-manylinux-version.patch | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/python-modules/sip/fix-manylinux-version.patch diff --git a/pkgs/development/python-modules/sip/default.nix b/pkgs/development/python-modules/sip/default.nix index 5cd8136f84ef..6904714a60c7 100644 --- a/pkgs/development/python-modules/sip/default.nix +++ b/pkgs/development/python-modules/sip/default.nix @@ -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 diff --git a/pkgs/development/python-modules/sip/fix-manylinux-version.patch b/pkgs/development/python-modules/sip/fix-manylinux-version.patch new file mode 100644 index 000000000000..4b8e99ae8e47 --- /dev/null +++ b/pkgs/development/python-modules/sip/fix-manylinux-version.patch @@ -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):