This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow building with different compilers on debian/ubuntu
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
build/pkgs/python3/patches/0001-bpo-22699-Allow-compiling-on-debian-ubuntu-with-a-di.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
From aef4a7749dec9ecf942647af39d7a1303c758131 Mon Sep 17 00:00:00 2001 | ||
From: Isuru Fernando <[email protected]> | ||
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 | ||
|