summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch')
-rw-r--r--meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
new file mode 100644
index 0000000000..c5846a5af8
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
@@ -0,0 +1,78 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3# The proper prefix is inside our staging area.
4# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
5# Signed-off-by: Phil Blundell <philb@gnu.org>
6# Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8Index: Python-3.3.2/Lib/distutils/sysconfig.py
9===================================================================
10--- Python-3.3.2.orig/Lib/distutils/sysconfig.py 2013-07-30 00:00:52.769749805 -0700
11+++ Python-3.3.2/Lib/distutils/sysconfig.py 2013-07-30 00:16:22.545767248 -0700
12@@ -16,10 +16,11 @@
13 from .errors import DistutilsPlatformError
14
15 # These are needed in a couple of spots, so just compute them once.
16-PREFIX = os.path.normpath(sys.prefix)
17-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
18-BASE_PREFIX = os.path.normpath(sys.base_prefix)
19-BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
20+PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
21+EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
22+BASE_PREFIX = os.path.normpath(sys.base_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
23+BASE_EXEC_PREFIX= os.path.normpath(sys.base_exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
24+
25
26 # Path to the base directory of the project. On Windows the binary may
27 # live in project/PCBuild9. If we're dealing with an x64 Windows build,
28@@ -93,7 +94,9 @@
29 If 'prefix' is supplied, use it instead of sys.base_prefix or
30 sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
31 """
32- if prefix is None:
33+ if prefix is None and os.environ['STAGING_INCDIR'] != "":
34+ prefix = os.environ['STAGING_INCDIR'].rstrip('include')
35+ elif prefix is None:
36 prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
37 if os.name == "posix":
38 if python_build:
39@@ -136,6 +139,12 @@
40 If 'prefix' is supplied, use it instead of sys.base_prefix or
41 sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
42 """
43+ if prefix is None and os.environ['STAGING_LIBDIR'] != "":
44+ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
45+ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
46+ else:
47+ lib_basename = sys.lib
48+
49 if prefix is None:
50 if standard_lib:
51 prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
52@@ -144,7 +153,7 @@
53
54 if os.name == "posix":
55 libpython = os.path.join(prefix,
56- "lib", "python" + get_python_version())
57+ lib_basename, "python" + get_python_version())
58 if standard_lib:
59 return libpython
60 else:
61@@ -249,7 +258,7 @@
62 else:
63 # The name of the config.h file changed in 2.2
64 config_h = 'pyconfig.h'
65- return os.path.join(inc_dir, config_h)
66+ return os.path.join(inc_dir, config_h).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
67
68
69 def get_makefile_filename():
70@@ -258,7 +267,7 @@
71 return os.path.join(_sys_home or project_base, "Makefile")
72 lib_dir = get_python_lib(plat_specific=0, standard_lib=1)
73 config_file = 'config-{}{}'.format(get_python_version(), build_flags)
74- return os.path.join(lib_dir, config_file, 'Makefile')
75+ return os.path.join(lib_dir, config_file, 'Makefile').replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
76
77
78 def parse_config_h(fp, g=None):