[OE-core] [PATCH] python3: fix multilib in distutils

Dan McGregor danismostlikely at gmail.com
Thu Nov 30 16:28:57 UTC 2017


From: Dan McGregor <dan.mcgregor at usask.ca>

Update the multilib patch to also use sys.lib in distutils.

Signed-off-by: Dan McGregor <dan.mcgregor at usask.ca>
---
 meta/recipes-devtools/python/python3-native_3.5.3.bb    |  2 +-
 .../12-distutils-prefix-is-inside-staging-area.patch    | 10 +++++-----
 .../python/python3/python-3.3-multilib.patch            | 17 ++++++++++++++++-
 3 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/meta/recipes-devtools/python/python3-native_3.5.3.bb b/meta/recipes-devtools/python/python3-native_3.5.3.bb
index 8cd9c88a821..da67801a05d 100644
--- a/meta/recipes-devtools/python/python3-native_3.5.3.bb
+++ b/meta/recipes-devtools/python/python3-native_3.5.3.bb
@@ -5,7 +5,6 @@ PYTHON_MAJMIN = "3.5"
 DISTRO_SRC_URI ?= "file://sitecustomize.py"
 DISTRO_SRC_URI_linuxstdbase = ""
 SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
-file://12-distutils-prefix-is-inside-staging-area.patch \
 file://python-config.patch \
 file://0001-cross-compile-support.patch \
 file://030-fixup-include-dirs.patch \
@@ -14,6 +13,7 @@ file://080-distutils-dont_adjust_files.patch \
 file://130-readline-setup.patch \
 file://150-fix-setupterm.patch \
 file://python-3.3-multilib.patch \
+file://12-distutils-prefix-is-inside-staging-area.patch \
 file://03-fix-tkinter-detection.patch \
 file://avoid_warning_about_tkinter.patch \
 file://shutil-follow-symlink-fix.patch \
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
index c53ec0cfc85..57aca2e76f2 100644
--- 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
@@ -18,7 +18,7 @@ Upstream-Status: Inappropriate [embedded specific]
  1 file changed, 8 insertions(+), 2 deletions(-)
 
 diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
-index 573724d..390c485 100644
+index 217ec94c37..a55e722fed 100644
 --- a/Lib/distutils/sysconfig.py
 +++ b/Lib/distutils/sysconfig.py
 @@ -84,7 +84,9 @@ def get_python_inc(plat_specific=0, prefix=None):
@@ -43,12 +43,12 @@ index 573724d..390c485 100644
      if prefix is None:
          if standard_lib:
              prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
-@@ -133,7 +139,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+@@ -132,7 +138,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+             prefix = plat_specific and EXEC_PREFIX or PREFIX
  
      if os.name == "posix":
-         libpython = os.path.join(prefix,
--                                 "lib", "python" + get_python_version())
-+                                 lib_basename, "python" + get_python_version())
+-        libpython = os.path.join(prefix, sys.lib, "python" + get_python_version())
++        libpython = os.path.join(prefix, lib_basename, "python" + get_python_version())
          if standard_lib:
              return libpython
          else:
diff --git a/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
index 08c4403cbfa..dd44aa63782 100644
--- a/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
+++ b/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
@@ -13,6 +13,7 @@ Signed-off-by: Alejandro Hernandez <alejandro.hernandez at linux.intel.com>
 ---
  Include/pythonrun.h              |  3 +++
  Lib/distutils/command/install.py |  4 +++-
+ Lib/distutils/sysconfig.py       |  3 +--
  Lib/pydoc.py                     |  2 +-
  Lib/site.py                      |  4 ++--
  Lib/sysconfig.py                 | 18 +++++++++---------
@@ -23,7 +24,7 @@ Signed-off-by: Alejandro Hernandez <alejandro.hernandez at linux.intel.com>
  Python/sysmodule.c               |  4 ++++
  configure.ac                     | 35 +++++++++++++++++++++++++++++++++++
  setup.py                         |  9 ++++-----
- 12 files changed, 97 insertions(+), 23 deletions(-)
+ 13 files changed, 98 insertions(+), 25 deletions(-)
 
 diff --git a/Include/pythonrun.h b/Include/pythonrun.h
 index 9c2e813..2f79cb6 100644
@@ -61,6 +62,20 @@ index 67db007..b46b45b 100644
          'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
          'scripts': '$base/bin',
          'data'   : '$base',
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 573724ddd7..217ec94c37 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -132,8 +132,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+             prefix = plat_specific and EXEC_PREFIX or PREFIX
+ 
+     if os.name == "posix":
+-        libpython = os.path.join(prefix,
+-                                 "lib", "python" + get_python_version())
++        libpython = os.path.join(prefix, sys.lib, "python" + get_python_version())
+         if standard_lib:
+             return libpython
+         else:
 diff --git a/Lib/pydoc.py b/Lib/pydoc.py
 index 3ca08c9..6528730 100755
 --- a/Lib/pydoc.py
-- 
2.14.1




More information about the Openembedded-core mailing list