From e458a39ddc3d9a99ba79d980fde8535d1b030855 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 27 Sep 2021 16:08:20 -0700 Subject: [PATCH] allow building with different compilers on debian/ubuntu --- ...compiling-on-debian-ubuntu-with-a-di.patch | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 build/pkgs/python3/patches/0001-bpo-22699-Allow-compiling-on-debian-ubuntu-with-a-di.patch diff --git a/build/pkgs/python3/patches/0001-bpo-22699-Allow-compiling-on-debian-ubuntu-with-a-di.patch b/build/pkgs/python3/patches/0001-bpo-22699-Allow-compiling-on-debian-ubuntu-with-a-di.patch new file mode 100644 index 00000000000..146738d6d4c --- /dev/null +++ b/build/pkgs/python3/patches/0001-bpo-22699-Allow-compiling-on-debian-ubuntu-with-a-di.patch @@ -0,0 +1,48 @@ +From aef4a7749dec9ecf942647af39d7a1303c758131 Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Thu, 16 Sep 2021 15:46:09 -0500 +Subject: [PATCH 08/24] bpo-22699: Allow compiling on debian/ubuntu with a + different compiler + +This PR fixes one issue mentioned in the bpo +https://bugs.python.org/issue22699#msg364685 with a slightly better +patch than given +--- + setup.py | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 8fb8ea5c47..783d20bdcd 100644 +--- a/setup.py ++++ b/setup.py +@@ -663,9 +663,26 @@ def add_multiarch_paths(self): + # Debian/Ubuntu multiarch support. + # https://wiki.ubuntu.com/MultiarchSpec + cc = sysconfig.get_config_var('CC') +- tmpfile = os.path.join(self.build_temp, 'multiarch') + if not os.path.exists(self.build_temp): + os.makedirs(self.build_temp) ++ ++ tmpfile_sysroot = os.path.join(self.build_temp, 'sysroot') ++ ret_sysroot = run_command( ++ '%s -print-sysroot > %s 2> /dev/null' % (cc, tmpfile_sysroot)) ++ ++ try: ++ if ret_sysroot == 0: ++ with open(tmpfile_sysroot) as fp: ++ sysroot = fp.readline().strip() ++ # if the sysroot is not /, then we are not using ++ # the compiler from debian/ubuntu ++ if sysroot not in ['', '/']: ++ return ++ finally: ++ os.unlink(tmpfile_sysroot) ++ ++ tmpfile = os.path.join(self.build_temp, 'multiarch') ++ + ret = run_command( + '%s -print-multiarch > %s 2> /dev/null' % (cc, tmpfile)) + multiarch_path_component = '' +-- +2.30.2 +