summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python/0001-python-Resolve-intermediate-staging-issues.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python/0001-python-Resolve-intermediate-staging-issues.patch')
-rw-r--r--meta/recipes-devtools/python/python/0001-python-Resolve-intermediate-staging-issues.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python/0001-python-Resolve-intermediate-staging-issues.patch b/meta/recipes-devtools/python/python/0001-python-Resolve-intermediate-staging-issues.patch
new file mode 100644
index 0000000000..2ff2ccc43d
--- /dev/null
+++ b/meta/recipes-devtools/python/python/0001-python-Resolve-intermediate-staging-issues.patch
@@ -0,0 +1,59 @@
1From 77bcb3238b2853d511714544e0f84a37be6c79bf Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Wed, 14 Nov 2012 14:31:24 +0000
4Subject: [PATCH] python: Resolve intermediate staging issues
5
6When cross compiling python, we used to need to install the Makefile, pyconfig.h
7and the python library to their final location before being able to compile the
8rest of python. This change allows us to point python at its own source when
9building, avoiding a variety of sysroot staging issues and simplifying the main
10python recipe.
11
12Upstream-Status: Inappropriate
13RP 2012/11/13
14
15---
16 Lib/distutils/sysconfig.py | 3 +++
17 Lib/sysconfig.py | 5 ++++-
18 2 files changed, 7 insertions(+), 1 deletion(-)
19
20diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
21index 2f4b8ca..15bceb5 100644
22--- a/Lib/distutils/sysconfig.py
23+++ b/Lib/distutils/sysconfig.py
24@@ -31,6 +31,9 @@ else:
25 # sys.executable can be empty if argv[0] has been changed and Python is
26 # unable to retrieve the real program name
27 project_base = os.getcwd()
28+_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None)
29+if _PYTHONBUILDDIR:
30+ project_base = _PYTHONBUILDDIR
31 if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
32 project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
33 # PC/VS7.1
34diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
35index 9c8350d..bddbe2e 100644
36--- a/Lib/sysconfig.py
37+++ b/Lib/sysconfig.py
38@@ -93,6 +93,7 @@ _PREFIX = os.path.normpath(sys.prefix)
39 _EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
40 _CONFIG_VARS = None
41 _USER_BASE = None
42+_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None)
43
44 def _safe_realpath(path):
45 try:
46@@ -100,7 +101,9 @@ def _safe_realpath(path):
47 except OSError:
48 return path
49
50-if sys.executable:
51+if _PYTHONBUILDDIR:
52+ _PROJECT_BASE = _PYTHONBUILDDIR
53+elif sys.executable:
54 _PROJECT_BASE = os.path.dirname(_safe_realpath(sys.executable))
55 else:
56 # sys.executable can be empty if argv[0] has been changed and Python is
57--
582.17.1
59