Skip to contentSkip to conversation

python: add 2.7.17 from oe-core

PATCH In review Ross Burton 2 participants 2 messages Jan 20, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 python: add 2.7.17 from oe-core

Python 2 ceased being maintained on the 1st January 2020. All users of Python 2 in oe-core have already been ported to Python 3, so in oe-core 390f3eda Python 2 was finally removed from oe-core itself.

The following are added to meta-python2 in this commit:
- python and python-native 2.7.17
- python-setuptools
- The classes pythonnative, pythondir, distutils, setuptools

---
 classes/distutils-base.bbclass                |    4 +
 classes/distutils.bbclass                     |   87 ++
 classes/python-dir.bbclass                    |    5 +
 classes/pythonnative.bbclass                  |   27 +
 classes/setuptools.bbclass                    |    3 +
 ...-fix-one-do_populate_sysroot-warning.patch |   40 +
 .../10-distutils-fix-swig-parameter.patch     |   18 +
 ...-distutils-never-modify-shebang-line.patch |   20 +
 .../python/python-native/multilib.patch       |  235 ++++
 .../python/python-native/nohostlibs.patch     |   54 +
 .../revert_use_of_sysconfigdata.patch         |   86 ++
 .../python/python-native/unixccompiler.patch  |   20 +
 .../python/python-native_2.7.17.bb            |   90 ++
 recipes-devtools/python/python-setuptools.inc |   50 +
 .../python/python-setuptools_42.0.2.bb        |    9 +
 recipes-devtools/python/python.inc            |   59 +
 ...e-prefix-to-be-inside-staging-direct.patch |   51 +
 ...-Resolve-intermediate-staging-issues.patch |   59 +
 ...asename-to-replace-CC-for-checking-c.patch |  114 ++
 .../01-use-proper-tools-for-cross-build.patch |   49 +
 .../python/03-fix-tkinter-detection.patch     |   46 +
 .../python/05-enable-ctypes-cross-build.patch |   27 +
 ...void_usr_lib_termcap_path_in_linking.patch |   35 +
 ...CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch |   28 +
 .../python/python/add-md5module-support.patch |   18 +
 .../python/avoid_warning_about_tkinter.patch  |   29 +
 ...id_warning_for_sunos_specific_module.patch |   23 +
 recipes-devtools/python/python/cgi_py.patch   |   23 +
 .../check-if-target-is-64b-not-host.patch     |   57 +
 .../python/python/create_manifest2.py         |  298 +++++
 .../fix_for_using_different_libdir.patch      |   77 ++
 .../python/python/float-endian.patch          |  216 ++++
 .../python/python/get_module_deps2.py         |  112 ++
 .../python/host_include_contamination.patch   |   28 +
 recipes-devtools/python/python/multilib.patch |  298 +++++
 .../parallel-makeinst-create-bindir.patch     |   19 +
 ...ssing-libraries-to-Extension-for-mul.patch |   82 ++
 .../python-2.7.3-remove-bsdb-rpath.patch      |   28 +
 .../python/python/python2-manifest.json       | 1138 +++++++++++++++++
 recipes-devtools/python/python/run-ptest      |    3 +
 ...h_db_h_in_inc_dirs_and_avoid_warning.patch |   35 +
 .../setup_py_skip_cross_import_check.patch    |   27 +
 .../python/python/setuptweaks.patch           |   57 +
 .../python/python/sitecustomize.py            |   37 +
 ..._SOURCE_DATE_EPOCH_in_py_compile_2.7.patch |   34 +
 .../use_sysroot_ncurses_instead_of_host.patch |   21 +
 recipes-devtools/python/python_2.7.17.bb      |  260 ++++
 47 files changed, 4136 insertions(+)
 create mode 100644 classes/distutils-base.bbclass
 create mode 100644 classes/distutils.bbclass
 create mode 100644 classes/python-dir.bbclass
 create mode 100644 classes/pythonnative.bbclass
 create mode 100644 classes/setuptools.bbclass
 create mode 100644 recipes-devtools/python/python-native/0001-python-native-fix-one-do_populate_sysroot-warning.patch
 create mode 100644 recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
 create mode 100644 recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
 create mode 100644 recipes-devtools/python/python-native/multilib.patch
 create mode 100644 recipes-devtools/python/python-native/nohostlibs.patch
 create mode 100644 recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch
 create mode 100644 recipes-devtools/python/python-native/unixccompiler.patch
 create mode 100644 recipes-devtools/python/python-native_2.7.17.bb
 create mode 100644 recipes-devtools/python/python-setuptools.inc
 create mode 100644 recipes-devtools/python/python-setuptools_42.0.2.bb
 create mode 100644 recipes-devtools/python/python.inc
 create mode 100644 recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch
 create mode 100644 recipes-devtools/python/python/0001-python-Resolve-intermediate-staging-issues.patch
 create mode 100644 recipes-devtools/python/python/0001-python2-use-cc_basename-to-replace-CC-for-checking-c.patch
 create mode 100644 recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
 create mode 100644 recipes-devtools/python/python/03-fix-tkinter-detection.patch
 create mode 100644 recipes-devtools/python/python/05-enable-ctypes-cross-build.patch
 create mode 100644 recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
 create mode 100644 recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
 create mode 100644 recipes-devtools/python/python/add-md5module-support.patch
 create mode 100644 recipes-devtools/python/python/avoid_warning_about_tkinter.patch
 create mode 100644 recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch
 create mode 100644 recipes-devtools/python/python/cgi_py.patch
 create mode 100644 recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
 create mode 100644 recipes-devtools/python/python/create_manifest2.py
 create mode 100644 recipes-devtools/python/python/fix_for_using_different_libdir.patch
 create mode 100644 recipes-devtools/python/python/float-endian.patch
 create mode 100644 recipes-devtools/python/python/get_module_deps2.py
 create mode 100644 recipes-devtools/python/python/host_include_contamination.patch
 create mode 100644 recipes-devtools/python/python/multilib.patch
 create mode 100644 recipes-devtools/python/python/parallel-makeinst-create-bindir.patch
 create mode 100644 recipes-devtools/python/python/pass-missing-libraries-to-Extension-for-mul.patch
 create mode 100644 recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch
 create mode 100644 recipes-devtools/python/python/python2-manifest.json
 create mode 100644 recipes-devtools/python/python/run-ptest
 create mode 100644 recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
 create mode 100644 recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
 create mode 100644 recipes-devtools/python/python/setuptweaks.patch
 create mode 100644 recipes-devtools/python/python/sitecustomize.py
 create mode 100644 recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch
 create mode 100644 recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch
 create mode 100644 recipes-devtools/python/python_2.7.17.bb
classes/distutils-base.bbclass new file +4 -0
new file mode 100644
index 0000000..9f398d7
@@ -0,0 +1,4 @@
+DEPENDS  += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES') == '')]}"
+RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}"
+
+inherit distutils-common-base pythonnative
classes/distutils.bbclass new file +87 -0

87 lines not on this page · raw message

classes/python-dir.bbclass new file +5 -0
new file mode 100644
index 0000000..a11dc35
@@ -0,0 +1,5 @@
+PYTHON_BASEVERSION = "2.7"
+PYTHON_ABI = ""
+PYTHON_DIR = "python${PYTHON_BASEVERSION}"
+PYTHON_PN = "python"
+PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages"
classes/pythonnative.bbclass new file +27 -0
new file mode 100644
index 0000000..0e9019d
@@ -0,0 +1,27 @@
+
+inherit python-dir
+
+PYTHON="${STAGING_BINDIR_NATIVE}/python-native/python"
+# PYTHON_EXECUTABLE is used by cmake
+PYTHON_EXECUTABLE="${PYTHON}"
+EXTRANATIVEPATH += "python-native"
+DEPENDS_append = " python-native "
+
+# python-config and other scripts are using distutils modules
+# which we patch to access these variables
+export STAGING_INCDIR
+export STAGING_LIBDIR
+
+# Packages can use
+# find_package(PythonInterp REQUIRED)
+# find_package(PythonLibs REQUIRED)
+# which ends up using libs/includes from build host
+# Therefore pre-empt that effort
+export PYTHON_LIBRARY="${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so"
+export PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
+
+# suppress host user's site-packages dirs.
+export PYTHONNOUSERSITE = "1"
+
+# autoconf macros will use their internal default preference otherwise
+export PYTHON
classes/setuptools.bbclass new file +3 -0
new file mode 100644
index 0000000..a923ea3
@@ -0,0 +1,3 @@
+inherit distutils
+
+DEPENDS += "python-setuptools-native"
recipes-devtools/python/python-native/0001-python-native-fix-one-do_populate_sysroot-warning.patch new file +40 -0
new file mode 100644
index 0000000..707ee59
@@ -0,0 +1,40 @@
+From 6cbb7529cf7ff0da3ca649fb3486facd9620d625 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Thu, 25 Oct 2018 07:32:14 +0000
+Subject: [PATCH] python-native: fix one do_populate_sysroot warning
+
+Fix below warning:
+WARNING: Skipping RPATH /usr/lib64 as is a standard search path for
+work/x86_64-linux/python-native/2.7.15-r1.1/recipe-sysroot-native/
+usr/lib/python2.7/lib-dynload/_bsddb.so
+
+setup.py will check db.h under include_dirs, for native build,
+/usr/lib64 will be insert to postion 0 of include_dirs, so
+it's priority is higher then our sysroot, cause db.h sysroot
+is ignored, and rpath set to /usr/lib64. and this cause warning
+when do_populate_sysroot. use append to fix it.
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Changqing Li <[email protected]>
+
+---
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index a2c8127..22f9e23 100644
+--- a/setup.py
++++ b/setup.py
+@@ -47,7 +47,7 @@ def add_dir_to_list(dirlist, dir):
+         else:
+             dir_exists = os.path.isdir(dir)
+         if dir_exists:
+-            dirlist.insert(0, dir)
++            dirlist.append(dir)
+ 
+ MACOS_SDK_ROOT = None
+ 
+-- 
+2.17.1
+
recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch new file +18 -0
new file mode 100644
index 0000000..a39247c
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+# Some versions of SWIG do not use the extension parameter.
+# Make it optional.
+# Signed-Off: Michael 'Mickey' Lauer <[email protected]>
+Index: Python-2.6.1/Lib/distutils/command/build_ext.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/command/build_ext.py
++++ Python-2.6.1/Lib/distutils/command/build_ext.py
+@@ -566,7 +566,7 @@ class build_ext (Command):
+             target_lang=language)
+ 
+ 
+-    def swig_sources (self, sources, extension):
++    def swig_sources (self, sources, extension=None):
+ 
+         """Walk the list of source files in 'sources', looking for SWIG
+         interface (.i) files.  Run SWIG on all that are found, and
recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch new file +20 -0
new file mode 100644
index 0000000..c92469b
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+# Don't modify the she-bang line for a cross-build.
+# Otherwise it points to our hostpython (which we do not want)
+#
+# Signed-Off: Michael 'Mickey' Lauer <[email protected]>
+
+Index: Python-2.6.1/Lib/distutils/command/build_scripts.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/command/build_scripts.py
++++ Python-2.6.1/Lib/distutils/command/build_scripts.py
+@@ -87,7 +87,7 @@ class build_scripts (Command):
+                     continue
+ 
+                 match = first_line_re.match(first_line)
+-                if match:
++                if False: #match:
+                     adjust = 1
+                     post_interp = match.group(1) or ''
+ 
recipes-devtools/python/python-native/multilib.patch new file +235 -0

235 lines not on this page · raw message

recipes-devtools/python/python-native/nohostlibs.patch new file +54 -0

54 lines not on this page · raw message

recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch new file +86 -0

86 lines not on this page · raw message

recipes-devtools/python/python-native/unixccompiler.patch new file +20 -0
new file mode 100644
index 0000000..4502829
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+The CC variable,sometimes like:"x86_64-poky-linux-gcc   -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information. 
+This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name.
+
+Signed-off-by: Mei Lei <[email protected]>
+Signed-off-by: Khem Raj <[email protected]>
+Index: Python-2.7.2/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-2.7.2.orig/Lib/distutils/unixccompiler.py	2011-11-24 13:51:10.539998722 -0800
++++ Python-2.7.2/Lib/distutils/unixccompiler.py	2011-11-24 15:54:36.872137766 -0800
+@@ -282,7 +282,7 @@
+         # this time, there's no way to determine this information from
+         # the configuration data stored in the Python installation, so
+         # we use this hack.
+-        compiler = os.path.basename(sysconfig.get_config_var("CC"))
++        compiler = sysconfig.get_config_var("CC")
+         if sys.platform[:6] == "darwin":
+             # MacOSX's linker doesn't understand the -R flag at all
+             return "-L" + dir
recipes-devtools/python/python-native_2.7.17.bb new file +90 -0

90 lines not on this page · raw message

recipes-devtools/python/python-setuptools.inc new file +50 -0

50 lines not on this page · raw message

recipes-devtools/python/python-setuptools_42.0.2.bb new file +9 -0
new file mode 100644
index 0000000..cf94404
@@ -0,0 +1,9 @@
+require python-setuptools.inc
+
+PROVIDES = "python-distribute"
+
+inherit setuptools
+
+RREPLACES_${PN} = "python-distribute"
+RPROVIDES_${PN} = "python-distribute"
+RCONFLICTS_${PN} = "python-distribute"
recipes-devtools/python/python.inc new file +59 -0

59 lines not on this page · raw message

recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch new file +51 -0

51 lines not on this page · raw message

recipes-devtools/python/python/0001-python-Resolve-intermediate-staging-issues.patch new file +59 -0

59 lines not on this page · raw message

recipes-devtools/python/python/0001-python2-use-cc_basename-to-replace-CC-for-checking-c.patch new file +114 -0

114 lines not on this page · raw message

recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch new file +49 -0

49 lines not on this page · raw message

recipes-devtools/python/python/03-fix-tkinter-detection.patch new file +46 -0

46 lines not on this page · raw message

recipes-devtools/python/python/05-enable-ctypes-cross-build.patch new file +27 -0
new file mode 100644
index 0000000..5cc8742
@@ -0,0 +1,27 @@
+Rebased for python 2.7.9
+
+Upstream-Status: Inappropriate [embedded specific]
+
+# CTypes need to know the actual host we are building on.
+# Signed-Off: Michael Dietrich <[email protected]>
+
+Index: Python-2.7.9/setup.py
+===================================================================
+--- Python-2.7.9.orig/setup.py
++++ Python-2.7.9/setup.py
+@@ -2028,12 +2028,12 @@ class PyBuildExt(build_ext):
+ 
+                 # Pass empty CFLAGS because we'll just append the resulting
+                 # CFLAGS to Python's; -g or -O2 is to be avoided.
+-                cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
+-                      % (ffi_builddir, ffi_srcdir, " ".join(config_args))
++                cmd = "(cd %s && autoconf -W cross) && (cd %s && env CFLAGS='' '%s/configure' %s)" \
++                    % (ffi_srcdir, ffi_builddir, ffi_srcdir, " ".join(config_args))
+ 
+                 res = os.system(cmd)
+                 if res or not os.path.exists(ffi_configfile):
+-                    print "Failed to configure _ctypes module"
++                    print "Failed to configure _ctypes module (res=%d) or missing conffile=%s" % ( res, ffi_configfile )
+                     return False
+ 
+             fficonfig = {}
recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch new file +35 -0
new file mode 100644
index 0000000..435b319
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+The poison directories patch has detected library path issue while 
+compiling the python in cross environment, as seen bellow.
+
+warning: library search path "/usr/lib/termcap" is unsafe for cross-compilation
+
+This Patch fixes this issue in the python build environment.
+11 Oct 2010
+Nitin A Kamble <[email protected]>
+
+2011/09/29
+Rebased for python 2.7.2
+Signed-off-by: Nitin A Kamble <[email protected]>
+
+Signed-off-by: Paul Eggleton <[email protected]>
+
+diff --git a/setup.py b/setup.py
+index 67eda74..59c537e 100644
+--- a/setup.py
++++ b/setup.py
+@@ -761,12 +761,10 @@ class PyBuildExt(build_ext):
+                 pass # Issue 7384: Already linked against curses or tinfo.
+             elif curses_library:
+                 readline_libs.append(curses_library)
+-            elif self.compiler.find_library_file(lib_dirs +
+-                                                     ['/usr/lib/termcap'],
++            elif self.compiler.find_library_file(lib_dirs,
+                                                      'termcap'):
+                 readline_libs.append('termcap')
+             exts.append( Extension('readline', ['readline.c'],
+-                                   library_dirs=['/usr/lib/termcap'],
+                                    extra_link_args=readline_extra_link_args,
+                                    libraries=readline_libs) )
+         else:
recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch new file +28 -0
new file mode 100644
index 0000000..3297340
@@ -0,0 +1,28 @@
+configure.ac: add CROSSPYTHONPATH into PYTHONPATH for PYTHON_FOR_BUILD
+
+When building x86->x86 the system will try to execute .so and related items
+from the default PYTHONPATH.  This will fail if the target CPU contains
+instructions that the host CPU does not have, add CROSSPYTHONPATH
+into PYTHONPATH so we can prepend the list to find correct libs.
+
+Upstream-Status: Inappropriate [OE-Core integration specific]
+
+Signed-off-by: Mark Hatle <[email protected]>
+Signed-off-by: Jackie Huang <[email protected]>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: Python-2.7.14/configure.ac
+===================================================================
+--- Python-2.7.14.orig/configure.ac
++++ Python-2.7.14/configure.ac
+@@ -36,7 +36,7 @@ if test "$cross_compiling" = yes; then
+ 	    AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
+ 	fi
+         AC_MSG_RESULT($interp)
+-	PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
++	PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH):$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) '$interp
+     fi
+ elif test "$cross_compiling" = maybe; then
+     AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
recipes-devtools/python/python/add-md5module-support.patch new file +18 -0
new file mode 100644
index 0000000..33fea77
@@ -0,0 +1,18 @@
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Saul Wold <[email protected]>
+
+Index: Python-2.7.2/Modules/Setup.dist
+===================================================================
+--- Python-2.7.2.orig/Modules/Setup.dist	2011-06-11 08:46:26.000000000 -0700
++++ Python-2.7.2/Modules/Setup.dist	2011-12-27 15:51:41.244623219 -0800
+@@ -248,7 +248,7 @@
+ # Message-Digest Algorithm, described in RFC 1321.  The necessary files
+ # md5.c and md5.h are included here.
+ 
+-#_md5 md5module.c md5.c
++_md5 md5module.c md5.c
+ 
+ 
+ # The _sha module implements the SHA checksum algorithms.
recipes-devtools/python/python/avoid_warning_about_tkinter.patch new file +29 -0
new file mode 100644
index 0000000..287095f
@@ -0,0 +1,29 @@
+_tkinter module needs tk module along with tcl. tk is not yet integrated
+in yocto so we skip the check for this module.
+Avoid a warning by not adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Also simply disable the tk module since its not in DEPENDS.
+Signed-off-by: Andrei Gherzan <[email protected]>
+
+Index: Python-2.7.13/setup.py
+===================================================================
+--- Python-2.7.13.orig/setup.py
++++ Python-2.7.13/setup.py
+@@ -1783,10 +1783,12 @@ class PyBuildExt(build_ext):
+         self.extensions.extend(exts)
+ 
+         # Call the method for detecting whether _tkinter can be compiled
+-        self.detect_tkinter(inc_dirs, lib_dirs)
++        # self.detect_tkinter(inc_dirs, lib_dirs)
+ 
+-        if '_tkinter' not in [e.name for e in self.extensions]:
+-            missing.append('_tkinter')
++        # tkinter module will not be avalaible as yocto
++        # doesn't have tk integrated (yet)
++        #if '_tkinter' not in [e.name for e in self.extensions]:
++        #    missing.append('_tkinter')
+ 
+ ##         # Uncomment these lines if you want to play with xxmodule.c
+ ##         ext = Extension('xx', ['xxmodule.c'])
recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch new file +23 -0
new file mode 100644
index 0000000..8ba5823
@@ -0,0 +1,23 @@
+sunaudiodev module is sunos specific so we avoid a warning by not 
+adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Andrei Gherzan <[email protected]>
+
+Index: Python-2.7.13/setup.py
+===================================================================
+--- Python-2.7.13.orig/setup.py
++++ Python-2.7.13/setup.py
+@@ -1671,8 +1671,9 @@ class PyBuildExt(build_ext):
+         if host_platform == 'sunos5':
+             # SunOS specific modules
+             exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
+-        else:
+-            missing.append('sunaudiodev')
++        # If platform is not sunos warning is useless
++        #else:
++        #    missing.append('sunaudiodev')
+ 
+         if host_platform == 'darwin':
+             # _scproxy
recipes-devtools/python/python/cgi_py.patch new file +23 -0
new file mode 100644
index 0000000..de504f9
@@ -0,0 +1,23 @@
+Lib/cgi.py: Update the script as mentioned in the comment
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Mark Hatle <[email protected]>
+
+--- Python-2.6.6/Lib/cgi.py.orig	2010-08-01 22:14:27.000000000 -0500
++++ Python-2.6.6/Lib/cgi.py	2011-09-21 15:28:40.478208631 -0500
+@@ -1,13 +1,4 @@
+-#! /usr/local/bin/python
+-
+-# NOTE: the above "/usr/local/bin/python" is NOT a mistake.  It is
+-# intentionally NOT "/usr/bin/env python".  On many systems
+-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
+-# scripts, and /usr/local/bin is the default directory where Python is
+-# installed, so /usr/bin/env would be unable to find python.  Granted,
+-# binary installations by Linux vendors often install Python in
+-# /usr/bin.  So let those vendors patch cgi.py to match their choice
+-# of installation.
++#! /usr/bin/env python
+ 
+ """Support module for CGI (Common Gateway Interface) scripts.
+ 
recipes-devtools/python/python/check-if-target-is-64b-not-host.patch new file +57 -0

57 lines not on this page · raw message

recipes-devtools/python/python/create_manifest2.py new file +298 -0

298 lines not on this page · raw message

recipes-devtools/python/python/fix_for_using_different_libdir.patch new file +77 -0

77 lines not on this page · raw message

recipes-devtools/python/python/float-endian.patch new file +216 -0

216 lines not on this page · raw message

recipes-devtools/python/python/get_module_deps2.py new file +112 -0

112 lines not on this page · raw message

recipes-devtools/python/python/host_include_contamination.patch new file +28 -0
new file mode 100644
index 0000000..e0aafb2
@@ -0,0 +1,28 @@
+when building python for qemux86-64 on ubuntu 11.10/64bit
+it gropes into host includes and then mixes them with cross
+includes and as a result some modules fail to compile and link
+one of the modules is python-elementtree which is then not
+found during image creation
+
+Proble is that setup.py tries to add native includes that newer
+ubuntu has introduced for multiarch support. But that should
+only happen for native builds and not cross building python
+so we add a check here.
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Pending
+
+
+diff --git a/setup.py b/setup.py
+index ba2d242..bf859be 100644
+--- a/setup.py
++++ b/setup.py
+@@ -393,6 +393,8 @@ class PyBuildExt(build_ext):
+ 
+         if not find_executable('dpkg-architecture'):
+             return
++        if os.environ.get('CROSS_COMPILE') is not None:
++            return
+         opt = ''
+         if cross_compiling:
+             opt = '-t' + sysconfig.get_config_var('HOST_GNU_TYPE')
recipes-devtools/python/python/multilib.patch new file +298 -0

298 lines not on this page · raw message

recipes-devtools/python/python/parallel-makeinst-create-bindir.patch new file +19 -0
new file mode 100644
index 0000000..abab41e
@@ -0,0 +1,19 @@
+When using make -j with the 'install' target, it's possible for altbininstall
+(which normally creates BINDIR) and libainstall (which doesn't, though it
+installs python-config there) to race, resulting in a failure due to
+attempting to install python-config into a nonexistent BINDIR. Ensure it also
+exists in the libainstall target.
+
+Upstream-Status: Pending
+
+--- Python-2.7.3.orig/Makefile.pre.in
++++ Python-2.7.3/Makefile.pre.in
+@@ -1187,7 +1187,7 @@
+ LIBPC=		$(LIBDIR)/pkgconfig
+ 
+ libainstall:	@DEF_MAKE_RULE@ python-config
+-	@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
++	@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC) $(BINDIR); \
+ 	do \
+ 		if test ! -d $(DESTDIR)$$i; then \
+ 			echo "Creating directory $$i"; \
recipes-devtools/python/python/pass-missing-libraries-to-Extension-for-mul.patch new file +82 -0

82 lines not on this page · raw message

recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch new file +28 -0
new file mode 100644
index 0000000..216be0a
@@ -0,0 +1,28 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Remove the RPATH to avoid QA issue warning.
+
+RP: Added secondary unnecessary rpath to the list 2012/8/7
+Signed-off-by: Jackie Huang <[email protected]>
+
+
+Index: Python-2.7.3/setup.py
+===================================================================
+--- Python-2.7.3.orig/setup.py	2012-08-07 10:41:58.560132529 +0000
++++ Python-2.7.3/setup.py	2012-08-07 11:09:47.852094515 +0000
+@@ -1042,7 +1042,6 @@
+             exts.append(Extension('_bsddb', ['_bsddb.c'],
+                                   depends = ['bsddb.h'],
+                                   library_dirs=dblib_dir,
+-                                  runtime_library_dirs=dblib_dir,
+                                   include_dirs=db_incs,
+                                   libraries=dblibs))
+         else:
+@@ -1252,7 +1251,6 @@
+                         print "building dbm using bdb"
+                         dbmext = Extension('dbm', ['dbmmodule.c'],
+                                            library_dirs=dblib_dir,
+-                                           runtime_library_dirs=dblib_dir,
+                                            include_dirs=db_incs,
+                                            define_macros=[
+                                                ('HAVE_BERKDB_H', None),
recipes-devtools/python/python/python2-manifest.json new file +1138 -0

476 lines not on this page · raw message

recipes-devtools/python/python/run-ptest new file +3 -0
new file mode 100644
index 0000000..c7002a4

Lines of this file are not shown. View the raw message.

recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch new file +35 -0
new file mode 100644
index 0000000..dacb552

Lines of this file are not shown. View the raw message.

recipes-devtools/python/python/setup_py_skip_cross_import_check.patch new file +27 -0
new file mode 100644
index 0000000..6ccdb94

Lines of this file are not shown. View the raw message.

recipes-devtools/python/python/setuptweaks.patch new file +57 -0

57 lines not on this page · raw message

recipes-devtools/python/python/sitecustomize.py new file +37 -0
new file mode 100644
index 0000000..4c8b5e2

Lines of this file are not shown. View the raw message.

recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch new file +34 -0
new file mode 100644
index 0000000..1265179

Lines of this file are not shown. View the raw message.

recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch new file +21 -0
new file mode 100644
index 0000000..fb4a3bc

Lines of this file are not shown. View the raw message.

recipes-devtools/python/python_2.7.17.bb new file +260 -0

260 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.20.1

Part of the diff is not shown here. View the raw message.

#1 lore raw

There was one additional patch for python-setuptools-native needed, but I have taken care of that under separate cover.

Can you double check that anything remaining in oe-core is cleaned up, while I continue to focus on meta-python2?

This is now merged (as is the other python-setuptools patch).

THANK YOU!

Quoted 24 lines · Ross Burton

Python 2 ceased being maintained on the 1st January 2020. All users of Python 2 in oe-core have already been ported to Python 3, so in oe-core 390f3eda Python 2 was finally removed from oe-core itself.

The following are added to meta-python2 in this commit:
- python and python-native 2.7.17
- python-setuptools
- The classes pythonnative, pythondir, distutils, setuptools

---
 classes/distutils-base.bbclass                |    4 +
 classes/distutils.bbclass                     |   87 ++
 classes/python-dir.bbclass                    |    5 +
 classes/pythonnative.bbclass                  |   27 +
 classes/setuptools.bbclass                    |    3 +

<snip>

--
2.20.1