-
-
Notifications
You must be signed in to change notification settings - Fork 544
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #33055: conda-forge: Fix build of python3 spkg
(split out from #32113) URL: https://trac.sagemath.org/33055 Reported by: mkoeppe Ticket author(s): Isuru Fernando Reviewer(s): Matthias Koeppe
- Loading branch information
Showing
2 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
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,64 @@ | ||
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,30 @@ 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 ['', '/']: | ||
+ add_dir_to_list(self.compiler.library_dirs, | ||
+ sysroot + '/usr/lib') | ||
+ add_dir_to_list(self.compiler.include_dirs, | ||
+ sysroot + '/usr/include') | ||
+ 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 = '' | ||
--- a/setup.py 2021-09-28 23:49:53.193868987 -0700 | ||
+++ b/setup.py 2021-09-28 23:50:13.554098642 -0700 | ||
@@ -738,7 +738,8 @@ | ||
for env_var, arg_name, dir_list in ( | ||
('LDFLAGS', '-R', self.compiler.runtime_library_dirs), | ||
('LDFLAGS', '-L', self.compiler.library_dirs), | ||
- ('CPPFLAGS', '-I', self.compiler.include_dirs)): | ||
+ ('CPPFLAGS', '-I', self.compiler.include_dirs), | ||
+ ('CPPFLAGS', '-isystem', self.compiler.include_dirs)): | ||
env_val = sysconfig.get_config_var(env_var) | ||
if env_val: | ||
parser = argparse.ArgumentParser() | ||
-- | ||
2.30.2 | ||
|
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