diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /poky/meta/recipes-devtools/python/python3 | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/recipes-devtools/python/python3')
34 files changed, 3377 insertions, 0 deletions
diff --git a/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch b/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch new file mode 100644 index 0000000000..8ea3f03fe0 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch @@ -0,0 +1,38 @@ +From 04df959365e2b54d7503edf0e5534ff094284f2d Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Fri, 23 Oct 2015 12:25:09 +0300 +Subject: [PATCH] Do not use the shell version of python-config that was + introduced in 3.4 + +Revert instead to the original python version: it has our tweaks and +outputs directories correctly. + +Upstream-Status: Inappropriate [oe-specific] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + Makefile.pre.in | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 236f005..5c4337f 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1348,12 +1348,9 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh + sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py + # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR} + LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config +- # On Darwin, always use the python version of the script, the shell +- # version doesn't use the compiler customizations that are provided +- # in python (_osx_support.py). +- if test `uname -s` = Darwin; then \ +- cp python-config.py python-config; \ +- fi ++ # In OpenEmbedded, always use the python version of the script, the shell ++ # version is broken in multiple ways, and doesn't return correct directories ++ cp python-config.py python-config + + + # Install the include files +-- +2.11.0 + diff --git a/poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch b/poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch new file mode 100644 index 0000000000..d1c92e9eed --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch @@ -0,0 +1,66 @@ +From bcddbf40c7f1b80336268cdddacc17369fb0ccea Mon Sep 17 00:00:00 2001 +From: Libin Dang <libin.dang@windriver.com> +Date: Tue, 11 Apr 2017 14:12:15 +0800 +Subject: [PATCH] Issue #21272: Use _sysconfigdata.py to initialize + distutils.sysconfig + +Backport upstream commit +https://github.com/python/cpython/commit/409482251b06fe75c4ee56e85ffbb4b23d934159 + +Upstream-Status: Backport + +Signed-off-by: Li Zhou <li.zhou@windriver.com> +--- + Lib/distutils/sysconfig.py | 35 ++++------------------------------- + 1 file changed, 4 insertions(+), 31 deletions(-) + +diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py +index 6d5cfd0..9925d24 100644 +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -424,38 +424,11 @@ _config_vars = None + + def _init_posix(): + """Initialize the module as appropriate for POSIX systems.""" +- g = {} +- # load the installed Makefile: +- try: +- filename = get_makefile_filename() +- parse_makefile(filename, g) +- except OSError as msg: +- my_msg = "invalid Python installation: unable to open %s" % filename +- if hasattr(msg, "strerror"): +- my_msg = my_msg + " (%s)" % msg.strerror +- +- raise DistutilsPlatformError(my_msg) +- +- # load the installed pyconfig.h: +- try: +- filename = get_config_h_filename() +- with open(filename) as file: +- parse_config_h(file, g) +- except OSError as msg: +- my_msg = "invalid Python installation: unable to open %s" % filename +- if hasattr(msg, "strerror"): +- my_msg = my_msg + " (%s)" % msg.strerror +- +- raise DistutilsPlatformError(my_msg) +- +- # On AIX, there are wrong paths to the linker scripts in the Makefile +- # -- these paths are relative to the Python source, but when installed +- # the scripts are in another directory. +- if python_build: +- g['LDSHARED'] = g['BLDSHARED'] +- ++ # _sysconfigdata is generated at build time, see the sysconfig module ++ from _sysconfigdata import build_time_vars + global _config_vars +- _config_vars = g ++ _config_vars = {} ++ _config_vars.update(build_time_vars) + + + def _init_nt(): +-- +1.8.3.1 + diff --git a/poky/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch b/poky/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch new file mode 100644 index 0000000000..7cd7e3b490 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch @@ -0,0 +1,96 @@ +From ecde3ea170999a9ef734e8af4d7c25be5ba81697 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Fri, 31 Mar 2017 15:42:46 +0300 +Subject: [PATCH] cross-compile support + +We cross compile python. This patch uses tools from host/native +python instead of in-tree tools + +-Khem + +Rebased on 3.5.4 + +Upstream-Status: Inappropriate[Configuration Specific] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +Signed-off-by: Derek Straka <derek@asterius.io> +--- + Makefile.pre.in | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 144c1f8629..f252ac2417 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -223,6 +223,7 @@ LIBOBJS= @LIBOBJS@ + + PYTHON= python$(EXE) + BUILDPYTHON= python$(BUILDEXE) ++HOSTPYTHON= $(BUILDPYTHON) + + PYTHON_FOR_REGEN=@PYTHON_FOR_REGEN@ + PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@ +@@ -277,6 +278,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ + ########################################################################## + # Parser + PGEN= Parser/pgen$(EXE) ++HOSTPGEN= $(PGEN)$(EXE) + + PSRCS= \ + Parser/acceler.c \ +@@ -478,7 +480,7 @@ build_all_generate_profile: + + run_profile_task: + : # FIXME: can't run for a cross build +- $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true ++ $(LLVM_PROF_FILE) $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK) || true + + build_all_merge_profile: + $(LLVM_PROF_MERGER) +@@ -772,7 +774,7 @@ regen-grammar: $(PGEN) + # Regenerate Include/graminit.h and Python/graminit.c + # from Grammar/Grammar using pgen + @$(MKDIR_P) Include +- $(PGEN) $(srcdir)/Grammar/Grammar \ ++ $(HOSTPGEN) $(srcdir)/Grammar/Grammar \ + $(srcdir)/Include/graminit.h \ + $(srcdir)/Python/graminit.c + +@@ -978,7 +980,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS) + ###################################################################### + + TESTOPTS= $(EXTRATESTOPTS) +-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS) ++TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS) + TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py + TESTTIMEOUT= 3600 + +@@ -1470,7 +1472,7 @@ frameworkinstallstructure: $(LDLIBRARY) + fi; \ + done + $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers +- sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist ++ sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist + $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current + $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK) + $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers +@@ -1543,7 +1545,7 @@ Python/dtoa.o: Python/dtoa.c + + # Run reindent on the library + reindent: +- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib ++ $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib + + # Rerun configure with the same options as it was run last time, + # provided the config.status script exists +@@ -1678,7 +1680,7 @@ funny: + + # Perform some verification checks on any modified files. + patchcheck: @DEF_MAKE_RULE@ +- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py ++ $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py + + # Dependencies + +-- +2.11.0 + diff --git a/poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch b/poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch new file mode 100644 index 0000000000..dd6b24fe92 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch @@ -0,0 +1,37 @@ +From 2f5a4c708d90fa8db21f446ae879cff79387448d Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 20 May 2013 21:03:16 -0700 +Subject: [PATCH] h2py: Fix issue 13032 where it fails with UnicodeDecodeError + +use utf-8 to open the files + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Upstream-Status: Pending +--- + Tools/scripts/h2py.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py +index 4f871d9..a53fbe0 100755 +--- a/Tools/scripts/h2py.py ++++ b/Tools/scripts/h2py.py +@@ -69,13 +69,13 @@ def main(): + sys.stdout.write('# Generated by h2py from stdin\n') + process(sys.stdin, sys.stdout) + else: +- fp = open(filename, 'r') ++ fp = open(filename, 'r', encoding='utf-8') + outfile = os.path.basename(filename) + i = outfile.rfind('.') + if i > 0: outfile = outfile[:i] + modname = outfile.upper() + outfile = modname + '.py' +- outfp = open(outfile, 'w') ++ outfp = open(outfile, 'w', encoding='utf-8') + outfp.write('# Generated by h2py from %s\n' % filename) + filedict = {} + for dir in searchdirs: +-- +1.8.1.2 + diff --git a/poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch b/poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch new file mode 100644 index 0000000000..fddfd2b2f6 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch @@ -0,0 +1,42 @@ +Upstream-Status: Inappropriate [embedded specific] + +# We need to supply STAGING_INCDIR here, otherwise the Tk headers +# will not be found. +# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille.de> + +Index: Python-3.3.0rc2/setup.py +=================================================================== +--- Python-3.3.0rc2.orig/setup.py 2012-09-20 15:24:14.009124003 -0700 ++++ Python-3.3.0rc2/setup.py 2012-09-20 15:25:08.449124963 -0700 +@@ -1620,7 +1620,7 @@ + dotversion = dotversion[:-1] + '.' + dotversion[-1] + tcl_include_sub = [] + tk_include_sub = [] +- for dir in inc_dirs: ++ for dir in [os.getenv("STAGING_INCDIR")]: + tcl_include_sub += [dir + os.sep + "tcl" + dotversion] + tk_include_sub += [dir + os.sep + "tk" + dotversion] + tk_include_sub += tcl_include_sub +@@ -1639,22 +1639,6 @@ + if dir not in include_dirs: + include_dirs.append(dir) + +- # Check for various platform-specific directories +- if host_platform == 'sunos5': +- include_dirs.append('/usr/openwin/include') +- added_lib_dirs.append('/usr/openwin/lib') +- elif os.path.exists('/usr/X11R6/include'): +- include_dirs.append('/usr/X11R6/include') +- added_lib_dirs.append('/usr/X11R6/lib64') +- added_lib_dirs.append('/usr/X11R6/lib') +- elif os.path.exists('/usr/X11R5/include'): +- include_dirs.append('/usr/X11R5/include') +- added_lib_dirs.append('/usr/X11R5/lib') +- else: +- # Assume default location for X11 +- include_dirs.append('/usr/X11/include') +- added_lib_dirs.append('/usr/X11/lib') +- + # If Cygwin, then verify that X is installed before proceeding + if host_platform == 'cygwin': + x11_inc = find_file('X11/Xlib.h', [], include_dirs) diff --git a/poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch b/poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch new file mode 100644 index 0000000000..6beac7b805 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch @@ -0,0 +1,33 @@ +Do not hardcode /usr into include paths when cross compiling + +-Khem + +Upstream-Status: Pending + +--- + setup.py | 15 ++------------- + 1 file changed, 2 insertions(+), 13 deletions(-) + +Index: Python-3.3.2/setup.py +=================================================================== +--- Python-3.3.2.orig/setup.py ++++ Python-3.3.2/setup.py +@@ -444,7 +444,8 @@ class PyBuildExt(build_ext): + # only change this for cross builds for 3.3, issues on Mageia + if cross_compiling: + self.add_gcc_paths() +- self.add_multiarch_paths() ++ if not cross_compiling: ++ self.add_multiarch_paths() + + # Add paths specified in the environment variables LDFLAGS and + # CPPFLAGS for header and library files. +@@ -480,7 +481,7 @@ class PyBuildExt(build_ext): + for directory in reversed(options.dirs): + add_dir_to_list(dir_list, directory) + +- if os.path.normpath(sys.base_prefix) != '/usr' \ ++ if not cross_compiling and os.path.normpath(sys.base_prefix) != '/usr' \ + and not sysconfig.get_config_var('PYTHONFRAMEWORK'): + # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework + # (PYTHONFRAMEWORK is set) to avoid # linking problems when diff --git a/poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch b/poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch new file mode 100644 index 0000000000..f9971c6baf --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch @@ -0,0 +1,38 @@ +consider opkg directories when cleaning up + +-Khem + +Upstream-Status: Inappropriate [OE specific] + +--- + Makefile.pre.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +Index: Python-3.5.3/Makefile.pre.in +=================================================================== +--- Python-3.5.3.orig/Makefile.pre.in ++++ Python-3.5.3/Makefile.pre.in +@@ -1574,8 +1574,8 @@ touch: + # Sanitation targets -- clean leaves libraries, executables and tags + # files, which clobber removes as well + pycremoval: +- -find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';' +- -find $(srcdir) -name '*.py[co]' -exec rm -f {} ';' ++ -find $(srcdir) ! -path './ipkg-install/*' -depth -name '__pycache__' -exec rm -rf {} ';' ++ -find $(srcdir) ! -path './ipkg-install/*' -name '*.py[co]' -exec rm -f {} ';' + + rmtestturds: + -rm -f *BAD *GOOD *SKIPPED +@@ -1589,9 +1589,9 @@ docclean: + -rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils + + clean: pycremoval +- find . -name '*.[oa]' -exec rm -f {} ';' +- find . -name '*.s[ol]' -exec rm -f {} ';' +- find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';' ++ find . ! -path './ipkg-install/*' -name '*.[oa]' -exec rm -f {} ';' ++ find . ! -path './ipkg-install/*' -name '*.s[ol]' -exec rm -f {} ';' ++ find . ! -path './ipkg-install/*' -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';' + find build -name 'fficonfig.h' -exec rm -f {} ';' || true + find build -name '*.py' -exec rm -f {} ';' || true + find build -name '*.py[co]' -exec rm -f {} ';' || true diff --git a/poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch b/poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch new file mode 100644 index 0000000000..b96419a638 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch @@ -0,0 +1,92 @@ +do not "adjust" python files before copying + +-Khem + +Upstream-Status: Inappropriate [Embedded-Specific] + +--- + Lib/distutils/command/build_scripts.py | 43 +++------------------------------ + 1 file changed, 4 insertions(+), 39 deletions(-) + +--- a/Lib/distutils/command/build_scripts.py ++++ b/Lib/distutils/command/build_scripts.py +@@ -51,10 +51,7 @@ class build_scripts(Command): + + + def copy_scripts(self): +- """Copy each script listed in 'self.scripts'; if it's marked as a +- Python script in the Unix way (first line matches 'first_line_re', +- ie. starts with "\#!" and contains "python"), then adjust the first +- line to refer to the current Python interpreter as we copy. ++ """Copy each script listed in 'self.scripts' + """ + self.mkpath(self.build_dir) + outfiles = [] +@@ -78,64 +75,10 @@ class build_scripts(Command): + if not self.dry_run: + raise + f = None +- else: +- encoding, lines = tokenize.detect_encoding(f.readline) +- f.seek(0) +- first_line = f.readline() +- if not first_line: +- self.warn("%s is an empty file (skipping)" % script) +- continue +- +- match = first_line_re.match(first_line) +- if match: +- adjust = True +- post_interp = match.group(1) or b'' +- +- if adjust: +- log.info("copying and adjusting %s -> %s", script, +- self.build_dir) +- updated_files.append(outfile) +- if not self.dry_run: +- if not sysconfig.python_build: +- executable = self.executable +- else: +- executable = os.path.join( +- sysconfig.get_config_var("BINDIR"), +- "python%s%s" % (sysconfig.get_config_var("VERSION"), +- sysconfig.get_config_var("EXE"))) +- executable = os.fsencode(executable) +- shebang = b"#!" + executable + post_interp + b"\n" +- # Python parser starts to read a script using UTF-8 until +- # it gets a #coding:xxx cookie. The shebang has to be the +- # first line of a file, the #coding:xxx cookie cannot be +- # written before. So the shebang has to be decodable from +- # UTF-8. +- try: +- shebang.decode('utf-8') +- except UnicodeDecodeError: +- raise ValueError( +- "The shebang ({!r}) is not decodable " +- "from utf-8".format(shebang)) +- # If the script is encoded to a custom encoding (use a +- # #coding:xxx cookie), the shebang has to be decodable from +- # the script encoding too. +- try: +- shebang.decode(encoding) +- except UnicodeDecodeError: +- raise ValueError( +- "The shebang ({!r}) is not decodable " +- "from the script encoding ({})" +- .format(shebang, encoding)) +- with open(outfile, "wb") as outf: +- outf.write(shebang) +- outf.writelines(f.readlines()) +- if f: +- f.close() +- else: +- if f: ++ if f: + f.close() +- updated_files.append(outfile) +- self.copy_file(script, outfile) ++ updated_files.append(outfile) ++ self.copy_file(script, outfile) + + if os.name == 'posix': + for file in outfiles: diff --git a/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch new file mode 100644 index 0000000000..c53ec0cfc8 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch @@ -0,0 +1,57 @@ +From 7630ab22578746d3d790d0598c0d279cf7afed97 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 14 May 2013 15:00:26 -0700 +Subject: [PATCH 01/20] python3: Add target and native recipes + +Upstream-Status: Inappropriate [embedded specific] + +02/2015 Rebased for Python 3.4.2 + +# The proper prefix is inside our staging area. +# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de> +# Signed-off-by: Phil Blundell <philb@gnu.org> +# Signed-off-by: Khem Raj <raj.khem@gmail.com> +# Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> + +--- + Lib/distutils/sysconfig.py | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py +index 573724d..390c485 100644 +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -84,7 +84,9 @@ def get_python_inc(plat_specific=0, prefix=None): + If 'prefix' is supplied, use it instead of sys.base_prefix or + sys.base_exec_prefix -- i.e., ignore 'plat_specific'. + """ +- if prefix is None: ++ if prefix is None and os.environ['STAGING_INCDIR'] != "": ++ prefix = os.environ['STAGING_INCDIR'].rstrip('include') ++ elif prefix is None: + prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX + if os.name == "posix": + if python_build: +@@ -125,6 +127,10 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): + If 'prefix' is supplied, use it instead of sys.base_prefix or + sys.base_exec_prefix -- i.e., ignore 'plat_specific'. + """ ++ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1] ++ if prefix is None and os.environ['STAGING_LIBDIR'] != "": ++ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename) ++ + 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): + + if os.name == "posix": + libpython = os.path.join(prefix, +- "lib", "python" + get_python_version()) ++ lib_basename, "python" + get_python_version()) + if standard_lib: + return libpython + else: +-- +2.8.0.rc3 + diff --git a/poky/meta/recipes-devtools/python/python3/130-readline-setup.patch b/poky/meta/recipes-devtools/python/python3/130-readline-setup.patch new file mode 100644 index 0000000000..c805652d69 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/130-readline-setup.patch @@ -0,0 +1,55 @@ +package python-readline + +-Khem + +Upstream-Status: Inappropriate [Embedded Specific] + +--- a/setup.py ++++ b/setup.py +@@ -666,45 +666,7 @@ class PyBuildExt(build_ext): + # readline + do_readline = self.compiler.find_library_file(lib_dirs, 'readline') + readline_termcap_library = "" +- curses_library = "" +- # Cannot use os.popen here in py3k. +- tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib') +- if not os.path.exists(self.build_temp): +- os.makedirs(self.build_temp) +- # Determine if readline is already linked against curses or tinfo. +- if do_readline: +- if cross_compiling: +- ret = os.system("%s -d %s | grep '(NEEDED)' > %s" \ +- % (sysconfig.get_config_var('READELF'), +- do_readline, tmpfile)) +- elif find_executable('ldd'): +- ret = os.system("ldd %s > %s" % (do_readline, tmpfile)) +- else: +- ret = 256 +- if ret >> 8 == 0: +- with open(tmpfile) as fp: +- for ln in fp: +- if 'curses' in ln: +- readline_termcap_library = re.sub( +- r'.*lib(n?cursesw?)\.so.*', r'\1', ln +- ).rstrip() +- break +- # termcap interface split out from ncurses +- if 'tinfo' in ln: +- readline_termcap_library = 'tinfo' +- break +- if os.path.exists(tmpfile): +- os.unlink(tmpfile) +- # Issue 7384: If readline is already linked against curses, +- # use the same library for the readline and curses modules. +- if 'curses' in readline_termcap_library: +- curses_library = readline_termcap_library +- elif self.compiler.find_library_file(lib_dirs, 'ncursesw'): +- curses_library = 'ncursesw' +- elif self.compiler.find_library_file(lib_dirs, 'ncurses'): +- curses_library = 'ncurses' +- elif self.compiler.find_library_file(lib_dirs, 'curses'): +- curses_library = 'curses' ++ curses_library = "ncurses" + + if host_platform == 'darwin': + os_release = int(os.uname()[2].split('.')[0]) diff --git a/poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch b/poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch new file mode 100644 index 0000000000..78d7c78670 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch @@ -0,0 +1,17 @@ +Fix warning with newer compiler + +-Khem + +Upstream-Status: Pending + +--- a/Modules/_cursesmodule.c ++++ b/Modules/_cursesmodule.c +@@ -116,7 +116,7 @@ char *PyCursesVersion = "2.2"; + #defines many common symbols (such as "lines") which breaks the + curses module in other ways. So the code will just specify + explicit prototypes here. */ +-extern int setupterm(char *,int,int *); ++//extern int setupterm(char *,int,int *); + #ifdef __sgi + #include <term.h> + #endif diff --git a/poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch b/poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch new file mode 100644 index 0000000000..f29ae53371 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch @@ -0,0 +1,21 @@ +Upstream-Status: Pending + +We should make sure that sysroot is used by gcc instead of assuming +hardcoded locations for include paths + + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Index: Python-3.4.2/configure.ac +=================================================================== +--- Python-3.4.2.orig/configure.ac ++++ Python-3.4.2/configure.ac +@@ -4434,7 +4434,7 @@ fi + + # first curses header check + ac_save_cppflags="$CPPFLAGS" +-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" ++CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw" + + AC_CHECK_HEADERS(curses.h ncurses.h) + diff --git a/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch b/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch new file mode 100644 index 0000000000..a3cc48c9a4 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch @@ -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 <andrei@gherzan.ro> + +Index: Python-3.5.3/setup.py +=================================================================== +--- Python-3.5.3.orig/setup.py ++++ Python-3.5.3/setup.py +@@ -1558,10 +1558,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']) diff --git a/poky/meta/recipes-devtools/python/python3/cgi_py.patch b/poky/meta/recipes-devtools/python/python3/cgi_py.patch new file mode 100644 index 0000000000..de504f9dcf --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/cgi_py.patch @@ -0,0 +1,23 @@ +Lib/cgi.py: Update the script as mentioned in the comment + +Upstream-Status: Inappropriate [distribution] + +Signed-off-by: Mark Hatle <mark.hatle@windriver.com> + +--- 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. + diff --git a/poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch b/poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch new file mode 100644 index 0000000000..97214f9aa4 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch @@ -0,0 +1,30 @@ +From 7c4f8d87473d6238c120ec6031b58f83a17a39a5 Mon Sep 17 00:00:00 2001 +From: Robert Yang <liezhi.yang@windriver.com> +Date: Mon, 28 Dec 2015 22:52:06 -0800 +Subject: [PATCH] configure.ac: fix LIBPL + +Use LIBDIR rather than prefix/lib, so that it would work when lib64. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 63aef8e..aefb27f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4366,7 +4366,7 @@ AC_MSG_RESULT($LDVERSION) + + dnl define LIBPL after ABIFLAGS and LDVERSION is defined. + AC_SUBST(PY_ENABLE_SHARED) +-LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}" ++LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}" + AC_SUBST(LIBPL) + + # Check whether right shifting a negative integer extends the sign bit +-- +1.7.9.5 + diff --git a/poky/meta/recipes-devtools/python/python3/create_manifest3.py b/poky/meta/recipes-devtools/python/python3/create_manifest3.py new file mode 100644 index 0000000000..2f944f9b13 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/create_manifest3.py @@ -0,0 +1,354 @@ +# This script is used as a bitbake task to create a new python manifest +# $ bitbake python -c create_manifest +# +# Our goal is to keep python-core as small as posible and add other python +# packages only when the user needs them, hence why we split upstream python +# into several packages. +# +# In a very simplistic way what this does is: +# Launch python and see specifically what is required for it to run at a minimum +# +# Go through the python-manifest file and launch a separate task for every single +# one of the files on each package, this task will check what was required for that +# specific module to run, these modules will be called dependencies. +# The output of such task will be a list of the modules or dependencies that were +# found for that file. +# +# Such output will be parsed by this script, we will look for each dependency on the +# manifest and if we find that another package already includes it, then we will add +# that package as an RDEPENDS to the package we are currently checking; in case we dont +# find the current dependency on any other package we will add it to the current package +# as part of FILES. +# +# +# This way we will create a new manifest from the data structure that was built during +# this process, ont this new manifest each package will contain specifically only +# what it needs to run. +# +# There are some caveats which we try to deal with, such as repeated files on different +# packages, packages that include folders, wildcards, and special packages. +# Its also important to note that this method only works for python files, and shared +# libraries. Static libraries, header files and binaries need to be dealt with manually. +# +# This script differs from its python2 version mostly on how shared libraries are handled +# The manifest file for python3 has an extra field which contains the cached files for +# each package. +# Tha method to handle cached files does not work when a module includes a folder which +# itself contains the pycache folder, gladly this is almost never the case. +# +# Author: Alejandro Enedino Hernandez Samaniego "aehs29" <aehs29@gmail.com> + + +import sys +import subprocess +import json +import os + +# Hack to get native python search path (for folders), not fond of it but it works for now +pivot='recipe-sysroot-native' +for p in sys.path: + if pivot in p: + nativelibfolder=p[:p.find(pivot)+len(pivot)] + +# Empty dict to hold the whole manifest +new_manifest = {} + +# Check for repeated files, folders and wildcards +allfiles=[] +repeated=[] +wildcards=[] + +hasfolders=[] +allfolders=[] + +def isFolder(value): + if os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib64')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib32')): + return True + else: + return False + +def isCached(item): + if '__pycache__' in item: + return True + else: + return False + +# Read existing JSON manifest +with open('python3-manifest.json') as manifest: + old_manifest=json.load(manifest) + + +# First pass to get core-package functionality, because we base everything on the fact that core is actually working +# Not exactly the same so it should not be a function +print ('Getting dependencies for package: core') + +# Special call to check for core package +output = subprocess.check_output([sys.executable, 'get_module_deps3.py', 'python-core-package']).decode('utf8') +for item in output.split(): + # We append it so it doesnt hurt what we currently have: + if isCached(item): + if item not in old_manifest['core']['cached']: + # We use the same data structure since its the one which will be used to check + # dependencies for other packages + old_manifest['core']['cached'].append(item) + else: + if item not in old_manifest['core']['files']: + # We use the same data structure since its the one which will be used to check + # dependencies for other packages + old_manifest['core']['files'].append(item) + +for value in old_manifest['core']['files']: + # Ignore folders, since we don't import those, difficult to handle multilib + if isFolder(value): + # Pass it directly + if isCached(value): + if value not in old_manifest['core']['cached']: + old_manifest['core']['cached'].append(value) + else: + if value not in old_manifest['core']['files']: + old_manifest['core']['files'].append(value) + continue + # Ignore binaries, since we don't import those, assume it was added correctly (manually) + if '${bindir}' in value: + # Pass it directly + if value not in old_manifest['core']['files']: + old_manifest['core']['files'].append(value) + continue + # Ignore empty values + if value == '': + continue + if '${includedir}' in value: + if value not in old_manifest['core']['files']: + old_manifest['core']['files'].append(value) + continue + # Get module name , shouldnt be affected by libdir/bindir + value = os.path.splitext(os.path.basename(os.path.normpath(value)))[0] + + # Launch separate task for each module for deterministic behavior + # Each module will only import what is necessary for it to work in specific + print ('Getting dependencies for module: %s' % value) + output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % value]).decode('utf8') + print ('The following dependencies were found for module %s:\n' % value) + print (output) + for item in output.split(): + # We append it so it doesnt hurt what we currently have: + if isCached(item): + if item not in old_manifest['core']['cached']: + # We use the same data structure since its the one which will be used to check + # dependencies for other packages + old_manifest['core']['cached'].append(item) + else: + if item not in old_manifest['core']['files']: + # We use the same data structure since its the one which will be used to check + # dependencies for other packages + old_manifest['core']['files'].append(item) + + +# We check which packages include folders +for key in old_manifest: + for value in old_manifest[key]['files']: + # Ignore folders, since we don't import those, difficult to handle multilib + if isFolder(value): + print ('%s is a folder' % value) + if key not in hasfolders: + hasfolders.append(key) + if value not in allfolders: + allfolders.append(value) + +for key in old_manifest: + # Use an empty dict as data structure to hold data for each package and fill it up + new_manifest[key]={} + new_manifest[key]['files']=[] + + new_manifest[key]['rdepends']=[] + # All packages should depend on core + if key != 'core': + new_manifest[key]['rdepends'].append('core') + new_manifest[key]['cached']=[] + else: + new_manifest[key]['cached']=old_manifest[key]['cached'] + new_manifest[key]['summary']=old_manifest[key]['summary'] + + # Handle special cases, we assume that when they were manually added + # to the manifest we knew what we were doing. + print('\n') + print('--------------------------') + print ('Handling package %s' % key) + print('--------------------------') + special_packages=['misc', 'modules', 'dev'] + if key in special_packages or 'staticdev' in key: + print('Passing %s package directly' % key) + new_manifest[key]=old_manifest[key] + continue + + for value in old_manifest[key]['files']: + # We already handled core on the first pass + if key == 'core': + new_manifest[key]['files'].append(value) + continue + # Ignore folders, since we don't import those, difficult to handle multilib + if isFolder(value): + # Pass folders directly + new_manifest[key]['files'].append(value) + # Ignore binaries, since we don't import those + if '${bindir}' in value: + # Pass it directly to the new manifest data structure + if value not in new_manifest[key]['files']: + new_manifest[key]['files'].append(value) + continue + # Ignore empty values + if value == '': + continue + if '${includedir}' in value: + if value not in new_manifest[key]['files']: + new_manifest[key]['files'].append(value) + continue + + # Get module name , shouldnt be affected by libdir/bindir + # We need to check if the imported module comes from another (e.g. sqlite3.dump) + path,value = os.path.split(value) + path = os.path.basename(path) + value = os.path.splitext(os.path.basename(value))[0] + + # If this condition is met, it means we need to import it from another module + # or its the folder itself (e.g. unittest) + if path == key: + if value: + value = path + '.' + value + else: + value = path + + # Launch separate task for each module for deterministic behavior + # Each module will only import what is necessary for it to work in specific + print ('\nGetting dependencies for module: %s' % value) + output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % value]).decode('utf8') + # We can print dependencies for debugging purposes + print ('The following dependencies were found for module %s:\n' % value) + print (output) + # Output will have all dependencies + + reportFILES = [] + reportRDEPS = [] + + for item in output.split(): + + # Warning: This first part is ugly + # One of the dependencies that was found, could be inside of one of the folders included by another package + # We need to check if this happens so we can add the package containing the folder as an rdependency + # e.g. Folder encodings contained in codecs + # This would be solved if no packages included any folders + + # This can be done in two ways: + # 1 - We assume that if we take out the filename from the path we would get + # the folder string, then we would check if folder string is in the list of folders + # This would not work if a package contains a folder which contains another folder + # e.g. path/folder1/folder2/filename folder_string= path/folder1/folder2 + # folder_string would not match any value contained in the list of folders + # + # 2 - We do it the other way around, checking if the folder is contained in the path + # e.g. path/folder1/folder2/filename folder_string= path/folder1/folder2 + # is folder_string inside path/folder1/folder2/filename?, + # Yes, it works, but we waste a couple of milliseconds. + + inFolders=False + for folder in allfolders: + if folder in item: + inFolders = True # Did we find a folder? + folderFound = False # Second flag to break inner for + # Loop only through packages which contain folders + for keyfolder in hasfolders: + if (folderFound == False): + #print('Checking folder %s on package %s' % (item,keyfolder)) + for file_folder in old_manifest[keyfolder]['files'] or file_folder in old_manifest[keyfolder]['cached']: + if file_folder==folder: + print ('%s folder found in %s' % (folder, keyfolder)) + folderFound = True + if keyfolder not in new_manifest[key]['rdepends'] and keyfolder != key: + new_manifest[key]['rdepends'].append(keyfolder) + + else: + break + + # A folder was found so we're done with this item, we can go on + if inFolders: + continue + + + # We might already have it on the dictionary since it could depend on a (previously checked) module + if item not in new_manifest[key]['files'] and item not in new_manifest[key]['cached']: + # Handle core as a special package, we already did it so we pass it to NEW data structure directly + if key=='core': + print('Adding %s to %s FILES' % (item, key)) + if item.endswith('*'): + wildcards.append(item) + if isCached(item): + new_manifest[key]['cached'].append(item) + else: + new_manifest[key]['files'].append(item) + + # Check for repeated files + if item not in allfiles: + allfiles.append(item) + else: + repeated.append(item) + + else: + + + # Check if this dependency is already contained on another package, so we add it + # as an RDEPENDS, or if its not, it means it should be contained on the current + # package, so we should add it to FILES + for newkey in old_manifest: + # Debug + #print('Checking %s ' % item + ' in %s' % newkey) + if item in old_manifest[newkey]['files'] or item in old_manifest[newkey]['cached']: + # Since were nesting, we need to check its not the same key + if(newkey!=key): + if newkey not in new_manifest[key]['rdepends']: + # Add it to the new manifest data struct + reportRDEPS.append('Adding %s to %s RDEPENDS, because it contains %s\n' % (newkey, key, item)) + new_manifest[key]['rdepends'].append(newkey) + break + else: + # A module shouldn't contain itself (${libdir}/python3/sqlite3 shouldnt be on sqlite3 files) + if os.path.basename(item) != key: + reportFILES.append(('Adding %s to %s FILES\n' % (item, key))) + # Since it wasnt found on another package, its not an RDEP, so add it to FILES for this package + if isCached(item): + new_manifest[key]['cached'].append(item) + else: + new_manifest[key]['files'].append(item) + + if item.endswith('*'): + wildcards.append(item) + if item not in allfiles: + allfiles.append(item) + else: + repeated.append(item) + + print('\n') + print('#################################') + print('Summary for module %s' % value) + print('FILES found for module %s:' % value) + print(''.join(reportFILES)) + print('RDEPENDS found for module %s:' % value) + print(''.join(reportRDEPS)) + print('#################################') + +print ('The following files are repeated (contained in more than one package), please check which package should get it:') +print (repeated) +print('The following files contain wildcards, please check they are necessary') +print(wildcards) +print('The following files contain folders, please check they are necessary') +print(hasfolders) + +# Sort it just so it looks nicer +for key in new_manifest: + new_manifest[key]['files'].sort() + new_manifest[key]['cached'].sort() + new_manifest[key]['rdepends'].sort() + +# Create the manifest from the data structure that was built +with open('python3-manifest.json.new','w') as outfile: + json.dump(new_manifest,outfile,sort_keys=True, indent=4) + outfile.write('\n') diff --git a/poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch b/poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch new file mode 100644 index 0000000000..0610565d3c --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch @@ -0,0 +1,54 @@ +Upstream-Status: Inappropriate [Embedded specific] + +This patch fixes issuing with different libdir like lib64. +This patch makes the native python binary modules findable +in the install process of the host python. + +Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> +Date: 2012/03/14 + +Updated for python 2.7.3 +Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> +Date: 2012/05/01 + +Index: Python-3.3.0rc2/Lib/sysconfig.py +=================================================================== +--- Python-3.3.0rc2.orig/Lib/sysconfig.py 2012-09-20 22:50:11.000000000 -0700 ++++ Python-3.3.0rc2/Lib/sysconfig.py 2012-09-20 22:53:01.561123396 -0700 +@@ -21,9 +21,9 @@ + + _INSTALL_SCHEMES = { + 'posix_prefix': { +- 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}', ++ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}', + 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}', +- 'purelib': '{base}/lib/python{py_version_short}/site-packages', ++ 'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages', + 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages', + 'include': + '{installed_base}/include/python{py_version_short}{abiflags}', +@@ -83,7 +83,7 @@ + 'posix_user': { + 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', + 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', +- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', ++ 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages', + 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages', + 'include': '{userbase}/include/python{py_version_short}', + 'scripts': '{userbase}/bin', +Index: Python-3.3.0rc2/Makefile.pre.in +=================================================================== +--- Python-3.3.0rc2.orig/Makefile.pre.in 2012-09-20 22:50:11.000000000 -0700 ++++ Python-3.3.0rc2/Makefile.pre.in 2012-09-20 22:50:54.245123997 -0700 +@@ -1080,9 +1080,9 @@ + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt + + # Create the PLATDIR source directory, if one wasn't distributed.. diff --git a/poky/meta/recipes-devtools/python/python3/get_module_deps3.py b/poky/meta/recipes-devtools/python/python3/get_module_deps3.py new file mode 100644 index 0000000000..fd12baad84 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/get_module_deps3.py @@ -0,0 +1,146 @@ +# This script is launched on separate task for each python module +# It checks for dependencies for that specific module and prints +# them out, the output of this execution will have all dependencies +# for a specific module, which will be parsed an dealt on create_manifest.py +# +# Author: Alejandro Enedino Hernandez Samaniego "aehs29" <aehs29@gmail.com> + +# We can get a log per module, for all the dependencies that were found, but its messy. +debug=False + +import sys + +# We can get a list of the modules which are currently required to run python +# so we run python-core and get its modules, we then import what we need +# and check what modules are currently running, if we substract them from the +# modules we had initially, we get the dependencies for the module we imported. + +# We use importlib to achieve this, so we also need to know what modules importlib needs +import importlib + +core_deps=set(sys.modules) + +def fix_path(dep_path): + import os + # We DONT want the path on our HOST system + pivot='recipe-sysroot-native' + dep_path=dep_path[dep_path.find(pivot)+len(pivot):] + + if '/usr/bin' in dep_path: + dep_path = dep_path.replace('/usr/bin''${bindir}') + + # Handle multilib, is there a better way? + if '/usr/lib32' in dep_path: + dep_path = dep_path.replace('/usr/lib32','${libdir}') + if '/usr/lib64' in dep_path: + dep_path = dep_path.replace('/usr/lib64','${libdir}') + if '/usr/lib' in dep_path: + dep_path = dep_path.replace('/usr/lib','${libdir}') + if '/usr/include' in dep_path: + dep_path = dep_path.replace('/usr/include','${includedir}') + if '__init__.' in dep_path: + dep_path = os.path.split(dep_path)[0] + return dep_path + + +# Module to import was passed as an argument +current_module = str(sys.argv[1]).rstrip() +if(debug==True): + log = open('log_%s' % current_module,'w') + log.write('Module %s generated the following dependencies:\n' % current_module) +try: + importlib.import_module('%s' % current_module) +except ImportError as e: + if (debug==True): + log.write('Module was not found') + pass + + +# Get current module dependencies, dif will contain a list of specific deps for this module +module_deps=set(sys.modules) + +# We handle the core package (1st pass on create_manifest.py) as a special case +if current_module == 'python-core-package': + dif = core_deps +else: + # We know this is not the core package, so there must be a difference. + dif = module_deps-core_deps + + +# Check where each dependency came from +for item in dif: + dep_path='' + try: + if (debug==True): + log.write('Calling: sys.modules[' + '%s' % item + '].__file__\n') + dep_path = sys.modules['%s' % item].__file__ + except AttributeError as e: + # Deals with thread (builtin module) not having __file__ attribute + if debug==True: + log.write(item + ' ') + log.write(str(e)) + log.write('\n') + pass + except NameError as e: + # Deals with NameError: name 'dep_path' is not defined + # because module is not found (wasn't compiled?), e.g. bddsm + if (debug==True): + log.write(item+' ') + log.write(str(e)) + pass + + # Site-customize is a special case since we (OpenEmbedded) put it there manually + if 'sitecustomize' in dep_path: + dep_path = '${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py' + # Prints out result, which is what will be used by create_manifest + print (dep_path) + continue + + dep_path = fix_path(dep_path) + + import sysconfig + soabi=sysconfig.get_config_var('SOABI') + # Check if its a shared library and deconstruct it + if soabi in dep_path: + if (debug==True): + log.write('Shared library found in %s' % dep_path) + dep_path = dep_path.replace(soabi,'*') + print (dep_path) + continue + + if (debug==True): + log.write(dep_path+'\n') + # Prints out result, which is what will be used by create_manifest + print (dep_path) + + + import imp + cpython_tag = imp.get_tag() + cached='' + # Theres no naive way to find *.pyc files on python3 + try: + if (debug==True): + log.write('Calling: sys.modules[' + '%s' % item + '].__cached__\n') + cached = sys.modules['%s' % item].__cached__ + except AttributeError as e: + # Deals with thread (builtin module) not having __cached__ attribute + if debug==True: + log.write(item + ' ') + log.write(str(e)) + log.write('\n') + pass + except NameError as e: + # Deals with NameError: name 'cached' is not defined + if (debug==True): + log.write(item+' ') + log.write(str(e)) + pass + if cached is not None: + if (debug==True): + log.write(cached) + cached = fix_path(cached) + cached = cached.replace(cpython_tag,'*') + print (cached) + +if debug==True: + log.close() diff --git a/poky/meta/recipes-devtools/python/python3/host_include_contamination.patch b/poky/meta/recipes-devtools/python/python3/host_include_contamination.patch new file mode 100644 index 0000000000..ef2054d9a9 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/host_include_contamination.patch @@ -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 <raj.khem@gmail.com> +Upstream-Status: Pending + +Index: Python-3.3.0rc2/setup.py +=================================================================== +--- Python-3.3.0rc2.orig/setup.py 2012-09-20 21:54:50.000000000 -0700 ++++ Python-3.3.0rc2/setup.py 2012-09-20 21:57:35.029123858 -0700 +@@ -402,6 +402,9 @@ + + if not find_executable('dpkg-architecture'): + return ++ if cross_compiling: ++ return ++ + opt = '' + if cross_compiling: + opt = '-t' + sysconfig.get_config_var('HOST_GNU_TYPE') diff --git a/poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch b/poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch new file mode 100644 index 0000000000..5c3af6b626 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch @@ -0,0 +1,82 @@ +From a784b70d47ba2104afbcfd805e2a66cdc2109ec5 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Fri, 4 Aug 2017 11:16:14 +0800 +Subject: [PATCH] setup.py: pass missing libraries to Extension for multiprocessing module + +In the following commit: +... +commit e711cafab13efc9c1fe6c5cd75826401445eb585 +Author: Benjamin Peterson <benjamin@python.org> +Date: Wed Jun 11 16:44:04 2008 +0000 + + Merged revisions 64104,64117 via svnmerge from + svn+ssh://pythondev@svn.python.org/python/trunk +... +(see diff in setup.py) +It assigned libraries for multiprocessing module according +the host_platform, but not pass it to Extension. + +In glibc, the following commit caused two definition of +sem_getvalue are different. +https://sourceware.org/git/?p=glibc.git;a=commit;h=042e1521c794a945edc43b5bfa7e69ad70420524 +(see diff in nptl/sem_getvalue.c for detail) +`__new_sem_getvalue' is the latest sem_getvalue@@GLIBC_2.1 +and `__old_sem_getvalue' is to compat the old version +sem_getvalue@GLIBC_2.0. + +To build python for embedded Linux systems: +http://www.yoctoproject.org/docs/2.3.1/yocto-project-qs/yocto-project-qs.html +If not explicitly link to library pthread (-lpthread), it will +load glibc's sem_getvalue randomly at runtime. + +Such as build python on linux x86_64 host and run the python +on linux x86_32 target. If not link library pthread, it caused +multiprocessing bounded semaphore could not work correctly. +... +>>> import multiprocessing +>>> pool_sema = multiprocessing.BoundedSemaphore(value=1) +>>> pool_sema.acquire() +True +>>> pool_sema.release() +Traceback (most recent call last): + File "<stdin>", line 1, in <module> +ValueError: semaphore or lock released too many times +... + +And the semaphore issue also caused multiprocessing.Queue().put() hung. + +Upstream-Status: Submitted [https://github.com/python/cpython/pull/2999] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + setup.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/setup.py b/setup.py +index 4f0f522..d05707d 100644 +--- a/setup.py ++++ b/setup.py +@@ -1606,8 +1606,10 @@ class PyBuildExt(build_ext): + elif host_platform.startswith('netbsd'): + macros = dict() + libraries = [] +- +- else: # Linux and other unices ++ elif host_platform.startswith(('linux')): ++ macros = dict() ++ libraries = ['pthread'] ++ else: # Other unices + macros = dict() + libraries = ['rt'] + +@@ -1626,6 +1628,7 @@ class PyBuildExt(build_ext): + if sysconfig.get_config_var('WITH_THREAD'): + exts.append ( Extension('_multiprocessing', multiprocessing_srcs, + define_macros=list(macros.items()), ++ libraries=libraries, + include_dirs=["Modules/_multiprocessing"])) + else: + missing.append('_multiprocessing') +-- +2.7.4 + diff --git a/poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch new file mode 100644 index 0000000000..cc35dc1617 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch @@ -0,0 +1,363 @@ +From 51fe6f22d0ba113674fb358bd11d75fe659bd26e Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 14 May 2013 15:00:26 -0700 +Subject: [PATCH 01/13] get the sys.lib from python itself and do not use + hardcoded value of 'lib' + +02/2015 Rebased for 3.4.2 + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> + +--- + Include/pythonrun.h | 3 +++ + Lib/distutils/command/install.py | 4 +++- + Lib/pydoc.py | 2 +- + Lib/site.py | 4 ++-- + Lib/sysconfig.py | 18 +++++++++--------- + Lib/trace.py | 4 ++-- + Makefile.pre.in | 7 +++++-- + Modules/getpath.c | 10 +++++++++- + Python/getplatform.c | 20 ++++++++++++++++++++ + Python/sysmodule.c | 4 ++++ + configure.ac | 35 +++++++++++++++++++++++++++++++++++ + setup.py | 9 ++++----- + 12 files changed, 97 insertions(+), 23 deletions(-) + +Index: Python-3.5.4/Include/pythonrun.h +=================================================================== +--- Python-3.5.4.orig/Include/pythonrun.h ++++ Python-3.5.4/Include/pythonrun.h +@@ -23,6 +23,9 @@ typedef struct { + } PyCompilerFlags; + #endif + ++PyAPI_FUNC(const char *) Py_GetArch(void); ++PyAPI_FUNC(const char *) Py_GetLib(void); ++ + #ifndef Py_LIMITED_API + PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *); + PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *); +Index: Python-3.5.4/Lib/distutils/command/install.py +=================================================================== +--- Python-3.5.4.orig/Lib/distutils/command/install.py ++++ Python-3.5.4/Lib/distutils/command/install.py +@@ -19,6 +19,8 @@ from site import USER_BASE + from site import USER_SITE + HAS_USER_SITE = True + ++libname = sys.lib ++ + WINDOWS_SCHEME = { + 'purelib': '$base/Lib/site-packages', + 'platlib': '$base/Lib/site-packages', +@@ -29,8 +31,8 @@ WINDOWS_SCHEME = { + + INSTALL_SCHEMES = { + 'unix_prefix': { +- 'purelib': '$base/lib/python$py_version_short/site-packages', +- 'platlib': '$platbase/lib/python$py_version_short/site-packages', ++ 'purelib': '$platbase/'+libname+'/python$py_version_short/site-packages', ++ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages', + 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', + 'scripts': '$base/bin', + 'data' : '$base', +Index: Python-3.5.4/Lib/pydoc.py +=================================================================== +--- Python-3.5.4.orig/Lib/pydoc.py ++++ Python-3.5.4/Lib/pydoc.py +@@ -389,7 +389,7 @@ class Doc: + docmodule = docclass = docroutine = docother = docproperty = docdata = fail + + def getdocloc(self, object, +- basedir=os.path.join(sys.base_exec_prefix, "lib", ++ basedir=os.path.join(sys.base_exec_prefix, sys.lib, + "python%d.%d" % sys.version_info[:2])): + """Return the location of module docs or None""" + +Index: Python-3.5.4/Lib/site.py +=================================================================== +--- Python-3.5.4.orig/Lib/site.py ++++ Python-3.5.4/Lib/site.py +@@ -303,12 +303,12 @@ def getsitepackages(prefixes=None): + seen.add(prefix) + + if os.sep == '/': +- sitepackages.append(os.path.join(prefix, "lib", ++ sitepackages.append(os.path.join(prefix, sys.lib, + "python" + sys.version[:3], + "site-packages")) + else: + sitepackages.append(prefix) +- sitepackages.append(os.path.join(prefix, "lib", "site-packages")) ++ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages")) + if sys.platform == "darwin": + # for framework builds *only* we add the standard Apple + # locations. +Index: Python-3.5.4/Lib/sysconfig.py +=================================================================== +--- Python-3.5.4.orig/Lib/sysconfig.py ++++ Python-3.5.4/Lib/sysconfig.py +@@ -20,10 +20,10 @@ __all__ = [ + + _INSTALL_SCHEMES = { + 'posix_prefix': { +- 'stdlib': '{installed_base}/lib/python{py_version_short}', +- 'platstdlib': '{platbase}/lib/python{py_version_short}', +- 'purelib': '{base}/lib/python{py_version_short}/site-packages', +- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', ++ 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}', ++ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}', ++ 'purelib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages', ++ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages', + 'include': + '{installed_base}/include/python{py_version_short}{abiflags}', + 'platinclude': +@@ -32,10 +32,10 @@ _INSTALL_SCHEMES = { + 'data': '{base}', + }, + 'posix_home': { +- 'stdlib': '{installed_base}/lib/python', +- 'platstdlib': '{base}/lib/python', +- 'purelib': '{base}/lib/python', +- 'platlib': '{base}/lib/python', ++ 'stdlib': '{installed_base}/'+sys.lib+'/python', ++ 'platstdlib': '{base}/'+sys.lib+'/python', ++ 'purelib': '{base}/'+sys.lib+'/python', ++ 'platlib': '{base}/'+sys.lib+'/python', + 'include': '{installed_base}/include/python', + 'platinclude': '{installed_base}/include/python', + 'scripts': '{base}/bin', +@@ -61,10 +61,10 @@ _INSTALL_SCHEMES = { + 'data': '{userbase}', + }, + 'posix_user': { +- 'stdlib': '{userbase}/lib/python{py_version_short}', +- 'platstdlib': '{userbase}/lib/python{py_version_short}', +- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', +- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages', ++ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', ++ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', ++ 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages', ++ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages', + 'include': '{userbase}/include/python{py_version_short}', + 'scripts': '{userbase}/bin', + 'data': '{userbase}', +Index: Python-3.5.4/Lib/trace.py +=================================================================== +--- Python-3.5.4.orig/Lib/trace.py ++++ Python-3.5.4/Lib/trace.py +@@ -749,10 +749,10 @@ def main(argv=None): + # should I also call expanduser? (after all, could use $HOME) + + s = s.replace("$prefix", +- os.path.join(sys.base_prefix, "lib", ++ os.path.join(sys.base_prefix, sys.lib, + "python" + sys.version[:3])) + s = s.replace("$exec_prefix", +- os.path.join(sys.base_exec_prefix, "lib", ++ os.path.join(sys.base_exec_prefix, sys.lib, + "python" + sys.version[:3])) + s = os.path.normpath(s) + ignore_dirs.append(s) +Index: Python-3.5.4/Makefile.pre.in +=================================================================== +--- Python-3.5.4.orig/Makefile.pre.in ++++ Python-3.5.4/Makefile.pre.in +@@ -109,6 +109,8 @@ CFLAGS_ALIASING=@CFLAGS_ALIASING@ + + # Machine-dependent subdirectories + MACHDEP= @MACHDEP@ ++LIB= @LIB@ ++ARCH= @ARCH@ + + # Multiarch directory (may be empty) + MULTIARCH= @MULTIARCH@ +@@ -128,7 +130,7 @@ LIBDIR= @libdir@ + MANDIR= @mandir@ + INCLUDEDIR= @includedir@ + CONFINCLUDEDIR= $(exec_prefix)/include +-SCRIPTDIR= $(prefix)/lib ++SCRIPTDIR= @libdir@ + ABIFLAGS= @ABIFLAGS@ + + # Detailed destination directories +@@ -731,6 +733,7 @@ Modules/getpath.o: $(srcdir)/Modules/get + -DEXEC_PREFIX='"$(exec_prefix)"' \ + -DVERSION='"$(VERSION)"' \ + -DVPATH='"$(VPATH)"' \ ++ -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \ + -o $@ $(srcdir)/Modules/getpath.c + + Programs/python.o: $(srcdir)/Programs/python.c +@@ -813,7 +816,7 @@ regen-opcode: + Python/compile.o Python/symtable.o Python/ast.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h + + Python/getplatform.o: $(srcdir)/Python/getplatform.c +- $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c ++ $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c + + Python/importdl.o: $(srcdir)/Python/importdl.c + $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c +Index: Python-3.5.4/Modules/getpath.c +=================================================================== +--- Python-3.5.4.orig/Modules/getpath.c ++++ Python-3.5.4/Modules/getpath.c +@@ -105,6 +105,13 @@ + #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined" + #endif + ++#define LIB_PYTHON LIB "/python" VERSION ++ ++#ifndef PYTHONPATH ++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \ ++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload" ++#endif ++ + #ifndef LANDMARK + #define LANDMARK L"os.py" + #endif +@@ -113,6 +120,7 @@ static wchar_t prefix[MAXPATHLEN+1]; + static wchar_t exec_prefix[MAXPATHLEN+1]; + static wchar_t progpath[MAXPATHLEN+1]; + static wchar_t *module_search_path = NULL; ++static wchar_t *lib_python = L"" LIB_PYTHON; + + /* Get file status. Encode the path to the locale encoding. */ + +@@ -494,7 +502,7 @@ calculate_path(void) + _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL); + _prefix = Py_DecodeLocale(PREFIX, NULL); + _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL); +- lib_python = Py_DecodeLocale("lib/python" VERSION, NULL); ++ lib_python = Py_DecodeLocale(LIB_PYTHON, NULL); + + if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) { + Py_FatalError( +Index: Python-3.5.4/Python/getplatform.c +=================================================================== +--- Python-3.5.4.orig/Python/getplatform.c ++++ Python-3.5.4/Python/getplatform.c +@@ -10,3 +10,23 @@ Py_GetPlatform(void) + { + return PLATFORM; + } ++ ++#ifndef ARCH ++#define ARCH "unknown" ++#endif ++ ++const char * ++Py_GetArch(void) ++{ ++ return ARCH; ++} ++ ++#ifndef LIB ++#define LIB "lib" ++#endif ++ ++const char * ++Py_GetLib(void) ++{ ++ return LIB; ++} +Index: Python-3.5.4/Python/sysmodule.c +=================================================================== +--- Python-3.5.4.orig/Python/sysmodule.c ++++ Python-3.5.4/Python/sysmodule.c +@@ -1827,6 +1827,10 @@ _PySys_Init(void) + PyUnicode_FromString(Py_GetCopyright())); + SET_SYS_FROM_STRING("platform", + PyUnicode_FromString(Py_GetPlatform())); ++ SET_SYS_FROM_STRING("arch", ++ PyUnicode_FromString(Py_GetArch())); ++ SET_SYS_FROM_STRING("lib", ++ PyUnicode_FromString(Py_GetLib())); + SET_SYS_FROM_STRING("executable", + PyUnicode_FromWideChar( + Py_GetProgramFullPath(), -1)); +Index: Python-3.5.4/configure.ac +=================================================================== +--- Python-3.5.4.orig/configure.ac ++++ Python-3.5.4/configure.ac +@@ -885,6 +885,41 @@ PLATDIR=plat-$MACHDEP + AC_SUBST(PLATDIR) + AC_SUBST(PLATFORM_TRIPLET) + ++AC_SUBST(ARCH) ++AC_MSG_CHECKING(ARCH) ++ARCH=`uname -m` ++case $ARCH in ++i?86) ARCH=i386;; ++esac ++AC_MSG_RESULT($ARCH) ++ ++AC_SUBST(LIB) ++AC_MSG_CHECKING(LIB) ++case $ac_sys_system in ++Linux*) ++ # Test if the compiler is 64bit ++ echo 'int i;' > conftest.$ac_ext ++ python_cv_cc_64bit_output=no ++ if AC_TRY_EVAL(ac_compile); then ++ case `/usr/bin/file conftest.$ac_objext` in ++ *"ELF 64"*) ++ python_cv_cc_64bit_output=yes ++ ;; ++ esac ++ fi ++ rm -rf conftest* ++ ;; ++esac ++ ++case $ARCH:$python_cv_cc_64bit_output in ++ppc64:yes | powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) ++ LIB="lib64" ++ ;; ++*:*) ++ LIB="lib" ++ ;; ++esac ++AC_MSG_RESULT($LIB) + + AC_MSG_CHECKING([for -Wl,--no-as-needed]) + save_LDFLAGS="$LDFLAGS" +Index: Python-3.5.4/setup.py +=================================================================== +--- Python-3.5.4.orig/setup.py ++++ Python-3.5.4/setup.py +@@ -494,7 +494,7 @@ class PyBuildExt(build_ext): + # directories (i.e. '.' and 'Include') must be first. See issue + # 10520. + if not cross_compiling: +- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') ++ add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib)) + add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') + # only change this for cross builds for 3.3, issues on Mageia + if cross_compiling: +@@ -552,8 +552,7 @@ class PyBuildExt(build_ext): + # be assumed that no additional -I,-L directives are needed. + if not cross_compiling: + lib_dirs = self.compiler.library_dirs + [ +- '/lib64', '/usr/lib64', +- '/lib', '/usr/lib', ++ '/' + sys.lib, '/usr/' + sys.lib, + ] + inc_dirs = self.compiler.include_dirs + ['/usr/include'] + else: +@@ -745,11 +744,11 @@ class PyBuildExt(build_ext): + elif curses_library: + readline_libs.append(curses_library) + elif self.compiler.find_library_file(lib_dirs + +- ['/usr/lib/termcap'], ++ ['/usr/'+sys.lib+'/termcap'], + 'termcap'): + readline_libs.append('termcap') + exts.append( Extension('readline', ['readline.c'], +- library_dirs=['/usr/lib/termcap'], ++ library_dirs=['/usr/'+sys.lib+'/termcap'], + extra_link_args=readline_extra_link_args, + libraries=readline_libs) ) + else: diff --git a/poky/meta/recipes-devtools/python/python3/python-config.patch b/poky/meta/recipes-devtools/python/python3/python-config.patch new file mode 100644 index 0000000000..f23b8b7df0 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/python-config.patch @@ -0,0 +1,46 @@ +python-config: Revert to using distutils.sysconfig + +The newer sysconfig module shares some code with distutils.sysconfig, but the same modifications as in + +12-distutils-prefix-is-inside-staging-area.patch makes distutils.sysconfig + +affect the native runtime as well as cross building. Use the old, patched +implementation which returns paths in the staging directory and for the target, +as appropriate. + +Upstream-Status: Inappropriate [Embedded Specific] + +Signed-off-by: Tyler Hall <tylerwhall@gmail.com> +: +Index: Python-3.3.3/Misc/python-config.in +=================================================================== +--- Python-3.3.3.orig/Misc/python-config.in ++++ Python-3.3.3/Misc/python-config.in +@@ -4,7 +4,7 @@ + import getopt + import os + import sys +-import sysconfig ++from distutils import sysconfig + + valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags', + 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir'] +@@ -32,14 +32,14 @@ if '--help' in opt_flags: + + for opt in opt_flags: + if opt == '--prefix': +- print(sysconfig.get_config_var('prefix')) ++ print(sysconfig.PREFIX) + + elif opt == '--exec-prefix': +- print(sysconfig.get_config_var('exec_prefix')) ++ print(sysconfig.EXEC_PREFIX) + + elif opt in ('--includes', '--cflags'): +- flags = ['-I' + sysconfig.get_path('include'), +- '-I' + sysconfig.get_path('platinclude')] ++ flags = ['-I' + sysconfig.get_python_inc(), ++ '-I' + sysconfig.get_python_inc(plat_specific=True)] + if opt == '--cflags': + flags.extend(getvar('CFLAGS').split()) + print(' '.join(flags)) diff --git a/poky/meta/recipes-devtools/python/python3/python3-manifest.json b/poky/meta/recipes-devtools/python/python3/python3-manifest.json new file mode 100644 index 0000000000..2491f36db2 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/python3-manifest.json @@ -0,0 +1,1149 @@ +{ + "2to3": { + "cached": [], + "files": [ + "${bindir}/2to3-*", + "${libdir}/python3.5/lib2to3" + ], + "rdepends": [ + "core" + ], + "summary": "Python automated Python 2 to 3 code translator" + }, + "asyncio": { + "cached": [], + "files": [ + "${libdir}/python3.5/asyncio", + "${libdir}/python3.5/concurrent", + "${libdir}/python3.5/concurrent/futures" + ], + "rdepends": [ + "compression", + "core", + "crypt", + "io", + "logging", + "math", + "multiprocessing", + "netclient", + "pickle", + "shell", + "stringold", + "threading", + "unixadmin" + ], + "summary": "Python Asynchronous I/" + }, + "audio": { + "cached": [ + "${libdir}/python3.5/__pycache__/chunk.*.pyc", + "${libdir}/python3.5/__pycache__/sndhdr.*.pyc", + "${libdir}/python3.5/__pycache__/sunau.*.pyc", + "${libdir}/python3.5/__pycache__/wave.*.pyc" + ], + "files": [ + "${libdir}/python3.5/chunk.py", + "${libdir}/python3.5/lib-dynload/audioop.*.so", + "${libdir}/python3.5/lib-dynload/ossaudiodev.*.so", + "${libdir}/python3.5/sndhdr.py", + "${libdir}/python3.5/sunau.py", + "${libdir}/python3.5/wave.py" + ], + "rdepends": [ + "core" + ], + "summary": "Python Audio Handling" + }, + "codecs": { + "cached": [ + "${libdir}/python3.5/__pycache__/xdrlib.*.pyc" + ], + "files": [ + "${libdir}/python3.5/lib-dynload/_multibytecodec.*.so", + "${libdir}/python3.5/xdrlib.py" + ], + "rdepends": [ + "core" + ], + "summary": "Python codec" + }, + "compile": { + "cached": [ + "${libdir}/python3.5/__pycache__/compileall.*.pyc", + "${libdir}/python3.5/__pycache__/py_compile.*.pyc" + ], + "files": [ + "${libdir}/python3.5/compileall.py", + "${libdir}/python3.5/py_compile.py" + ], + "rdepends": [ + "asyncio", + "compression", + "core", + "crypt", + "io", + "logging", + "math", + "multiprocessing", + "pickle", + "shell", + "stringold", + "threading", + "unixadmin" + ], + "summary": "Python bytecode compilation support" + }, + "compression": { + "cached": [ + "${libdir}/python3.5/__pycache__/_compression.*.pyc", + "${libdir}/python3.5/__pycache__/bz2.*.pyc", + "${libdir}/python3.5/__pycache__/gzip.*.pyc", + "${libdir}/python3.5/__pycache__/lzma.*.pyc", + "${libdir}/python3.5/__pycache__/tarfile.*.pyc", + "${libdir}/python3.5/__pycache__/zipfile.*.pyc" + ], + "files": [ + "${libdir}/python3.5/_compression.py", + "${libdir}/python3.5/bz2.py", + "${libdir}/python3.5/gzip.py", + "${libdir}/python3.5/lib-dynload/_bz2.*.so", + "${libdir}/python3.5/lib-dynload/_lzma.*.so", + "${libdir}/python3.5/lib-dynload/zlib.*.so", + "${libdir}/python3.5/lzma.py", + "${libdir}/python3.5/tarfile.py", + "${libdir}/python3.5/zipfile.py" + ], + "rdepends": [ + "core", + "shell", + "unixadmin" + ], + "summary": "Python high-level compression support" + }, + "core": { + "cached": [ + "${libdir}/python3.5/__pycache__/__future__.*.pyc", + "${libdir}/python3.5/__pycache__/_bootlocale.*.pyc", + "${libdir}/python3.5/__pycache__/_collections_abc.*.pyc", + "${libdir}/python3.5/__pycache__/_markupbase.*.pyc", + "${libdir}/python3.5/__pycache__/_sitebuiltins.*.pyc", + "${libdir}/python3.5/__pycache__/_sysconfigdata.*.pyc", + "${libdir}/python3.5/__pycache__/_weakrefset.*.pyc", + "${libdir}/python3.5/__pycache__/abc.*.pyc", + "${libdir}/python3.5/__pycache__/argparse.*.pyc", + "${libdir}/python3.5/__pycache__/ast.*.pyc", + "${libdir}/python3.5/__pycache__/bisect.*.pyc", + "${libdir}/python3.5/__pycache__/code.*.pyc", + "${libdir}/python3.5/__pycache__/codecs.*.pyc", + "${libdir}/python3.5/__pycache__/codeop.*.pyc", + "${libdir}/python3.5/__pycache__/configparser.*.pyc", + "${libdir}/python3.5/__pycache__/contextlib.*.pyc", + "${libdir}/python3.5/__pycache__/copy.*.pyc", + "${libdir}/python3.5/__pycache__/copyreg.*.pyc", + "${libdir}/python3.5/__pycache__/csv.*.pyc", + "${libdir}/python3.5/__pycache__/dis.*.pyc", + "${libdir}/python3.5/__pycache__/enum.*.pyc", + "${libdir}/python3.5/__pycache__/functools.*.pyc", + "${libdir}/python3.5/__pycache__/genericpath.*.pyc", + "${libdir}/python3.5/__pycache__/getopt.*.pyc", + "${libdir}/python3.5/__pycache__/gettext.*.pyc", + "${libdir}/python3.5/__pycache__/heapq.*.pyc", + "${libdir}/python3.5/__pycache__/imp.*.pyc", + "${libdir}/python3.5/__pycache__/inspect.*.pyc", + "${libdir}/python3.5/__pycache__/io.*.pyc", + "${libdir}/python3.5/__pycache__/keyword.*.pyc", + "${libdir}/python3.5/__pycache__/linecache.*.pyc", + "${libdir}/python3.5/__pycache__/locale.*.pyc", + "${libdir}/python3.5/__pycache__/opcode.*.pyc", + "${libdir}/python3.5/__pycache__/operator.*.pyc", + "${libdir}/python3.5/__pycache__/optparse.*.pyc", + "${libdir}/python3.5/__pycache__/os.*.pyc", + "${libdir}/python3.5/__pycache__/platform.*.pyc", + "${libdir}/python3.5/__pycache__/posixpath.*.pyc", + "${libdir}/python3.5/__pycache__/re.*.pyc", + "${libdir}/python3.5/__pycache__/reprlib.*.pyc", + "${libdir}/python3.5/__pycache__/rlcompleter.*.pyc", + "${libdir}/python3.5/__pycache__/selectors.*.pyc", + "${libdir}/python3.5/__pycache__/signal.*.pyc", + "${libdir}/python3.5/__pycache__/site.*.pyc", + "${libdir}/python3.5/__pycache__/sre_compile.*.pyc", + "${libdir}/python3.5/__pycache__/sre_constants.*.pyc", + "${libdir}/python3.5/__pycache__/sre_parse.*.pyc", + "${libdir}/python3.5/__pycache__/stat.*.pyc", + "${libdir}/python3.5/__pycache__/stringprep.*.pyc", + "${libdir}/python3.5/__pycache__/struct.*.pyc", + "${libdir}/python3.5/__pycache__/subprocess.*.pyc", + "${libdir}/python3.5/__pycache__/symbol.*.pyc", + "${libdir}/python3.5/__pycache__/sysconfig.*.pyc", + "${libdir}/python3.5/__pycache__/textwrap.*.pyc", + "${libdir}/python3.5/__pycache__/threading.*.pyc", + "${libdir}/python3.5/__pycache__/token.*.pyc", + "${libdir}/python3.5/__pycache__/tokenize.*.pyc", + "${libdir}/python3.5/__pycache__/traceback.*.pyc", + "${libdir}/python3.5/__pycache__/types.*.pyc", + "${libdir}/python3.5/__pycache__/warnings.*.pyc", + "${libdir}/python3.5/__pycache__/weakref.*.pyc", + "${libdir}/python3.5/collections/__pycache__", + "${libdir}/python3.5/collections/__pycache__/abc.*.pyc", + "${libdir}/python3.5/encodings/__pycache__", + "${libdir}/python3.5/encodings/__pycache__/aliases.*.pyc", + "${libdir}/python3.5/encodings/__pycache__/latin_1.*.pyc", + "${libdir}/python3.5/encodings/__pycache__/utf_8.*.pyc", + "${libdir}/python3.5/importlib/__pycache__", + "${libdir}/python3.5/importlib/__pycache__/abc.*.pyc", + "${libdir}/python3.5/importlib/__pycache__/machinery.*.pyc", + "${libdir}/python3.5/importlib/__pycache__/util.*.pyc" + ], + "files": [ + "${bindir}/python*[!-config]", + "${includedir}/python${PYTHON_BINABI}/pyconfig*.h", + "${libdir}/python${PYTHON_MAJMIN}/_collections_abc.py", + "${libdir}/python${PYTHON_MAJMIN}/_sitebuiltins.py", + "${libdir}/python${PYTHON_MAJMIN}/collections", + "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py", + "${libdir}/python3.5/UserDict.py", + "${libdir}/python3.5/UserList.py", + "${libdir}/python3.5/UserString.py", + "${libdir}/python3.5/__future__.py", + "${libdir}/python3.5/_abcoll.py", + "${libdir}/python3.5/_bootlocale.py", + "${libdir}/python3.5/_collections_abc.py", + "${libdir}/python3.5/_markupbase.py", + "${libdir}/python3.5/_sitebuiltins.py", + "${libdir}/python3.5/_sysconfigdata.py", + "${libdir}/python3.5/_weakrefset.py", + "${libdir}/python3.5/abc.py", + "${libdir}/python3.5/argparse.py", + "${libdir}/python3.5/ast.py", + "${libdir}/python3.5/bisect.py", + "${libdir}/python3.5/code.py", + "${libdir}/python3.5/codecs.py", + "${libdir}/python3.5/codeop.py", + "${libdir}/python3.5/collections", + "${libdir}/python3.5/collections/abc.py", + "${libdir}/python3.5/configparser.py", + "${libdir}/python3.5/contextlib.py", + "${libdir}/python3.5/copy.py", + "${libdir}/python3.5/copyreg.py", + "${libdir}/python3.5/csv.py", + "${libdir}/python3.5/dis.py", + "${libdir}/python3.5/encodings", + "${libdir}/python3.5/encodings/aliases.py", + "${libdir}/python3.5/encodings/latin_1.py", + "${libdir}/python3.5/encodings/utf_8.py", + "${libdir}/python3.5/enum.py", + "${libdir}/python3.5/functools.py", + "${libdir}/python3.5/genericpath.py", + "${libdir}/python3.5/getopt.py", + "${libdir}/python3.5/gettext.py", + "${libdir}/python3.5/heapq.py", + "${libdir}/python3.5/imp.py", + "${libdir}/python3.5/importlib", + "${libdir}/python3.5/importlib/_bootstrap.py", + "${libdir}/python3.5/importlib/_bootstrap_external.py", + "${libdir}/python3.5/importlib/abc.py", + "${libdir}/python3.5/importlib/machinery.py", + "${libdir}/python3.5/importlib/util.py", + "${libdir}/python3.5/inspect.py", + "${libdir}/python3.5/io.py", + "${libdir}/python3.5/keyword.py", + "${libdir}/python3.5/lib-dynload/__pycache__/_struct.*.so", + "${libdir}/python3.5/lib-dynload/__pycache__/binascii.*.so", + "${libdir}/python3.5/lib-dynload/__pycache__/time.*.so", + "${libdir}/python3.5/lib-dynload/__pycache__/xreadlines.*.so", + "${libdir}/python3.5/lib-dynload/_bisect.*.so", + "${libdir}/python3.5/lib-dynload/_csv.*.so", + "${libdir}/python3.5/lib-dynload/_heapq.*.so", + "${libdir}/python3.5/lib-dynload/_opcode.*.so", + "${libdir}/python3.5/lib-dynload/_posixsubprocess.*.so", + "${libdir}/python3.5/lib-dynload/_struct.*.so", + "${libdir}/python3.5/lib-dynload/array.*.so", + "${libdir}/python3.5/lib-dynload/binascii.*.so", + "${libdir}/python3.5/lib-dynload/math.*.so", + "${libdir}/python3.5/lib-dynload/parser.*.so", + "${libdir}/python3.5/lib-dynload/readline.*.so", + "${libdir}/python3.5/lib-dynload/select.*.so", + "${libdir}/python3.5/lib-dynload/time.*.so", + "${libdir}/python3.5/lib-dynload/unicodedata.*.so", + "${libdir}/python3.5/lib-dynload/xreadlines.*.so", + "${libdir}/python3.5/linecache.py", + "${libdir}/python3.5/locale.py", + "${libdir}/python3.5/new.py", + "${libdir}/python3.5/opcode.py", + "${libdir}/python3.5/operator.py", + "${libdir}/python3.5/optparse.py", + "${libdir}/python3.5/os.py", + "${libdir}/python3.5/platform.py", + "${libdir}/python3.5/posixpath.py", + "${libdir}/python3.5/re.py", + "${libdir}/python3.5/reprlib.py", + "${libdir}/python3.5/rlcompleter.py", + "${libdir}/python3.5/selectors.py", + "${libdir}/python3.5/signal.py", + "${libdir}/python3.5/site.py", + "${libdir}/python3.5/sre_compile.py", + "${libdir}/python3.5/sre_constants.py", + "${libdir}/python3.5/sre_parse.py", + "${libdir}/python3.5/stat.py", + "${libdir}/python3.5/stringprep.py", + "${libdir}/python3.5/struct.py", + "${libdir}/python3.5/subprocess.py", + "${libdir}/python3.5/symbol.py", + "${libdir}/python3.5/sysconfig.py", + "${libdir}/python3.5/textwrap.py", + "${libdir}/python3.5/threading.py", + "${libdir}/python3.5/token.py", + "${libdir}/python3.5/tokenize.py", + "${libdir}/python3.5/traceback.py", + "${libdir}/python3.5/types.py", + "${libdir}/python3.5/warnings.py", + "${libdir}/python3.5/weakref.py" + ], + "rdepends": [], + "summary": "Python interpreter and core modules" + }, + "crypt": { + "cached": [ + "${libdir}/python3.5/__pycache__/crypt.*.pyc", + "${libdir}/python3.5/__pycache__/hashlib.*.pyc" + ], + "files": [ + "${libdir}/python3.5/crypt.py", + "${libdir}/python3.5/hashlib.py", + "${libdir}/python3.5/lib-dynload/_crypt.*.so", + "${libdir}/python3.5/lib-dynload/_hashlib.*.so", + "${libdir}/python3.5/lib-dynload/_sha256.*.so", + "${libdir}/python3.5/lib-dynload/_sha512.*.so" + ], + "rdepends": [ + "core", + "math", + "stringold" + ], + "summary": "Python basic cryptographic and hashing support" + }, + "ctypes": { + "cached": [], + "files": [ + "${libdir}/python3.5/ctypes", + "${libdir}/python3.5/lib-dynload/_ctypes.*.so", + "${libdir}/python3.5/lib-dynload/_ctypes_test.*.so" + ], + "rdepends": [ + "core" + ], + "summary": "Python C types support" + }, + "curses": { + "cached": [], + "files": [ + "${libdir}/python3.5/curses", + "${libdir}/python3.5/lib-dynload/_curses.*.so", + "${libdir}/python3.5/lib-dynload/_curses_panel.*.so" + ], + "rdepends": [ + "core" + ], + "summary": "Python curses support" + }, + "datetime": { + "cached": [ + "${libdir}/python3.5/__pycache__/_strptime.*.pyc", + "${libdir}/python3.5/__pycache__/calendar.*.pyc", + "${libdir}/python3.5/__pycache__/datetime.*.pyc" + ], + "files": [ + "${libdir}/python3.5/_strptime.py", + "${libdir}/python3.5/calendar.py", + "${libdir}/python3.5/datetime.py", + "${libdir}/python3.5/lib-dynload/_datetime.*.so" + ], + "rdepends": [ + "core" + ], + "summary": "Python calendar and time support" + }, + "db": { + "cached": [], + "files": [ + "${libdir}/python3.5/dbm", + "${libdir}/python3.5/lib-dynload/_dbm.*.so" + ], + "rdepends": [ + "core" + ], + "summary": "Python file-based database support" + }, + "debugger": { + "cached": [ + "${libdir}/python3.5/__pycache__/bdb.*.pyc", + "${libdir}/python3.5/__pycache__/pdb.*.pyc" + ], + "files": [ + "${libdir}/python3.5/bdb.py", + "${libdir}/python3.5/pdb.py" + ], + "rdepends": [ + "core", + "pprint", + "shell", + "stringold" + ], + "summary": "Python debugger" + }, + "dev": { + "cached": [], + "files": [ + "${base_libdir}/*.a", + "${base_libdir}/*.o", + "${bindir}/python*-config", + "${datadir}/aclocal", + "${datadir}/pkgconfig", + "${includedir}", + "${libdir}/*.a", + "${libdir}/*.la", + "${libdir}/*.o", + "${libdir}/lib*${SOLIBSDEV}", + "${libdir}/pkgconfig", + "${libdir}/python3.5/config*/Makefile", + "${libdir}/python3.5/config*/Makefile/__pycache__" + ], + "rdepends": [ + "core" + ], + "summary": "Python development package" + }, + "difflib": { + "cached": [ + "${libdir}/python3.5/__pycache__/difflib.*.pyc" + ], + "files": [ + "${libdir}/python3.5/difflib.py" + ], + "rdepends": [ + "core" + ], + "summary": "Python helpers for computing deltas between objects" + }, + "distutils": { + "cached": [], + "files": [ + "${libdir}/python3.5/distutils" + ], + "rdepends": [ + "core" + ], + "summary": "Python Distribution Utilities" + }, + "distutils-staticdev": { + "cached": [ + "${libdir}/python3.5/config/__pycache__/lib*.a" + ], + "files": [ + "${libdir}/python3.5/config/lib*.a" + ], + "rdepends": [ + "distutils" + ], + "summary": "Python distribution utilities (static libraries)" + }, + "doctest": { + "cached": [ + "${libdir}/python3.5/__pycache__/doctest.*.pyc" + ], + "files": [ + "${libdir}/python3.5/doctest.py" + ], + "rdepends": [ + "core", + "debugger", + "difflib", + "logging", + "pprint", + "shell", + "stringold", + "unittest" + ], + "summary": "Python framework for running examples in docstrings" + }, + "email": { + "cached": [ + "${libdir}/python3.5/__pycache__/imaplib.*.pyc" + ], + "files": [ + "${libdir}/python3.5/email", + "${libdir}/python3.5/imaplib.py" + ], + "rdepends": [ + "core", + "crypt", + "datetime", + "io", + "math", + "netclient" + ], + "summary": "Python email support" + }, + "fcntl": { + "cached": [], + "files": [ + "${libdir}/python3.5/lib-dynload/fcntl.*.so" + ], + "rdepends": [ + "core" + ], + "summary": "Python's fcntl interface" + }, + "gdbm": { + "cached": [], + "files": [ + "${libdir}/python3.5/lib-dynload/_gdbm.*.so" + ], + "rdepends": [ + "core" + ], + "summary": "Python GNU database support" + }, + "html": { + "cached": [ + "${libdir}/python3.5/__pycache__/formatter.*.pyc" + ], + "files": [ + "${libdir}/python3.5/formatter.py", + "${libdir}/python3.5/html" + ], + "rdepends": [ + "core" + ], + "summary": "Python HTML processing support" + }, + "idle": { + "cached": [], + "files": [ + "${bindir}/idle*", + "${libdir}/python3.5/idlelib" + ], + "rdepends": [ + "core" + ], + "summary": "Python Integrated Development Environment" + }, + "image": { + "cached": [ + "${libdir}/python3.5/__pycache__/colorsys.*.pyc", + "${libdir}/python3.5/__pycache__/imghdr.*.pyc" + ], + "files": [ + "${libdir}/python3.5/colorsys.py", + "${libdir}/python3.5/imghdr.py" + ], + "rdepends": [ + "core" + ], + "summary": "Python graphical image handling" + }, + "io": { + "cached": [ + "${libdir}/python3.5/__pycache__/_pyio.*.pyc", + "${libdir}/python3.5/__pycache__/ipaddress.*.pyc", + "${libdir}/python3.5/__pycache__/pipes.*.pyc", + "${libdir}/python3.5/__pycache__/socket.*.pyc", + "${libdir}/python3.5/__pycache__/ssl.*.pyc", + "${libdir}/python3.5/__pycache__/tempfile.*.pyc" + ], + "files": [ + "${libdir}/python3.5/_pyio.py", + "${libdir}/python3.5/ipaddress.py", + "${libdir}/python3.5/lib-dynload/_socket.*.so", + "${libdir}/python3.5/lib-dynload/_ssl.*.so", + "${libdir}/python3.5/lib-dynload/termios.*.so", + "${libdir}/python3.5/pipes.py", + "${libdir}/python3.5/socket.py", + "${libdir}/python3.5/ssl.py", + "${libdir}/python3.5/tempfile.py" + ], + "rdepends": [ + "compression", + "core", + "crypt", + "math", + "netclient", + "shell", + "unixadmin" + ], + "summary": "Python low-level I/O" + }, + "json": { + "cached": [], + "files": [ + "${libdir}/python3.5/json", + "${libdir}/python3.5/lib-dynload/_json.*.so" + ], + "rdepends": [ + "core" + ], + "summary": "Python JSON support" + }, + "logging": { + "cached": [], + "files": [ + "${libdir}/python3.5/logging" + ], + "rdepends": [ + "core", + "stringold" + ], + "summary": "Python logging support" + }, + "mailbox": { + "cached": [ + "${libdir}/python3.5/__pycache__/mailbox.*.pyc" + ], + "files": [ + "${libdir}/python3.5/mailbox.py" + ], + "rdepends": [ + "core", + "crypt", + "datetime", + "email", + "fcntl", + "io", + "math", + "mime", + "netclient", + "stringold" + ], + "summary": "Python mailbox format support" + }, + "math": { + "cached": [ + "${libdir}/python3.5/__pycache__/random.*.pyc" + ], + "files": [ + "${libdir}/python3.5/lib-dynload/_random.*.so", + "${libdir}/python3.5/lib-dynload/cmath.*.so", + "${libdir}/python3.5/random.py" + ], + "rdepends": [ + "core", + "crypt" + ], + "summary": "Python math support" + }, + "mime": { + "cached": [ + "${libdir}/python3.5/__pycache__/quopri.*.pyc", + "${libdir}/python3.5/__pycache__/uu.*.pyc" + ], + "files": [ + "${libdir}/python3.5/quopri.py", + "${libdir}/python3.5/uu.py" + ], + "rdepends": [ + "core" + ], + "summary": "Python MIME handling APIs" + }, + "mmap": { + "cached": [], + "files": [ + "${libdir}/python3.5/lib-dynload/mmap.*.so" + ], + "rdepends": [ + "core" + ], + "summary": "Python memory-mapped file support" + }, + "modules": { + "cached": [], + "files": [], + "rdepends": [ + "2to3", + "asyncio", + "audio", + "codecs", + "compile", + "compression", + "core", + "crypt", + "ctypes", + "curses", + "datetime", + "db", + "debugger", + "difflib", + "distutils", + "doctest", + "email", + "fcntl", + "html", + "idle", + "image", + "io", + "json", + "logging", + "mailbox", + "math", + "mime", + "mmap", + "multiprocessing", + "netclient", + "netserver", + "numbers", + "pickle", + "pkgutil", + "plistlib", + "pprint", + "profile", + "pydoc", + "resource", + "runpy", + "shell", + "smtpd", + "sqlite3", + "stringold", + "syslog", + "terminal", + "threading", + "tkinter", + "typing", + "unittest", + "unixadmin", + "xml", + "xmlrpc" + ], + "summary": "All Python modules" + }, + "multiprocessing": { + "cached": [], + "files": [ + "${libdir}/python3.5/lib-dynload/_multiprocessing.*.so", + "${libdir}/python3.5/multiprocessing" + ], + "rdepends": [ + "core" + ], + "summary": "Python multiprocessing support" + }, + "netclient": { + "cached": [ + "${libdir}/python3.5/__pycache__/base64.*.pyc", + "${libdir}/python3.5/__pycache__/ftplib.*.pyc", + "${libdir}/python3.5/__pycache__/hmac.*.pyc", + "${libdir}/python3.5/__pycache__/mimetypes.*.pyc", + "${libdir}/python3.5/__pycache__/nntplib.*.pyc", + "${libdir}/python3.5/__pycache__/poplib.*.pyc", + "${libdir}/python3.5/__pycache__/smtplib.*.pyc", + "${libdir}/python3.5/__pycache__/telnetlib.*.pyc", + "${libdir}/python3.5/__pycache__/uuid.*.pyc" + ], + "files": [ + "${libdir}/python3.5/base64.py", + "${libdir}/python3.5/ftplib.py", + "${libdir}/python3.5/hmac.py", + "${libdir}/python3.5/http", + "${libdir}/python3.5/http/__pycache__", + "${libdir}/python3.5/mimetypes.py", + "${libdir}/python3.5/nntplib.py", + "${libdir}/python3.5/poplib.py", + "${libdir}/python3.5/smtplib.py", + "${libdir}/python3.5/telnetlib.py", + "${libdir}/python3.5/urllib", + "${libdir}/python3.5/urllib/__pycache__", + "${libdir}/python3.5/uuid.py" + ], + "rdepends": [ + "compression", + "core", + "crypt", + "ctypes", + "datetime", + "email", + "io", + "math", + "mime", + "shell", + "stringold", + "unixadmin" + ], + "summary": "Python Internet Protocol clients" + }, + "netserver": { + "cached": [ + "${libdir}/python3.5/__pycache__/cgi.*.pyc", + "${libdir}/python3.5/__pycache__/socketserver.*.pyc" + ], + "files": [ + "${libdir}/python3.5/cgi.py", + "${libdir}/python3.5/socketserver.py" + ], + "rdepends": [ + "compression", + "core", + "crypt", + "datetime", + "email", + "html", + "io", + "math", + "mime", + "netclient", + "shell", + "stringold", + "unixadmin" + ], + "summary": "Python Internet Protocol servers" + }, + "numbers": { + "cached": [ + "${libdir}/python3.5/__pycache__/_pydecimal.*.pyc", + "${libdir}/python3.5/__pycache__/decimal.*.pyc", + "${libdir}/python3.5/__pycache__/fractions.*.pyc", + "${libdir}/python3.5/__pycache__/numbers.*.pyc" + ], + "files": [ + "${libdir}/python3.5/_pydecimal.py", + "${libdir}/python3.5/decimal.py", + "${libdir}/python3.5/fractions.py", + "${libdir}/python3.5/lib-dynload/_decimal.*.so", + "${libdir}/python3.5/numbers.py" + ], + "rdepends": [ + "core" + ], + "summary": "Python number APIs" + }, + "pickle": { + "cached": [ + "${libdir}/python3.5/__pycache__/_compat_pickle.*.pyc", + "${libdir}/python3.5/__pycache__/pickle.*.pyc", + "${libdir}/python3.5/__pycache__/pickletools.*.pyc", + "${libdir}/python3.5/__pycache__/shelve.*.pyc" + ], + "files": [ + "${libdir}/python3.5/_compat_pickle.py", + "${libdir}/python3.5/lib-dynload/_pickle.*.so", + "${libdir}/python3.5/pickle.py", + "${libdir}/python3.5/pickletools.py", + "${libdir}/python3.5/shelve.py" + ], + "rdepends": [ + "core" + ], + "summary": "Python serialisation/persistence support" + }, + "pkgutil": { + "cached": [ + "${libdir}/python3.5/__pycache__/pkgutil.*.pyc" + ], + "files": [ + "${libdir}/python3.5/pkgutil.py" + ], + "rdepends": [ + "core" + ], + "summary": "Python package extension utility support" + }, + "plistlib": { + "cached": [ + "${libdir}/python3.5/__pycache__/plistlib.*.pyc" + ], + "files": [ + "${libdir}/python3.5/plistlib.py" + ], + "rdepends": [ + "core", + "datetime", + "xml" + ], + "summary": "Generate and parse Mac OS X .plist files" + }, + "pprint": { + "cached": [ + "${libdir}/python3.5/__pycache__/pprint.*.pyc" + ], + "files": [ + "${libdir}/python3.5/pprint.py" + ], + "rdepends": [ + "core" + ], + "summary": "Python pretty-print support" + }, + "profile": { + "cached": [ + "${libdir}/python3.5/__pycache__/cProfile.*.pyc", + "${libdir}/python3.5/__pycache__/profile.*.pyc", + "${libdir}/python3.5/__pycache__/pstats.*.pyc" + ], + "files": [ + "${libdir}/python3.5/cProfile.py", + "${libdir}/python3.5/lib-dynload/_lsprof.*.so", + "${libdir}/python3.5/profile.py", + "${libdir}/python3.5/pstats.py" + ], + "rdepends": [ + "core" + ], + "summary": "Python basic performance profiling support" + }, + "pydoc": { + "cached": [ + "${libdir}/python3.5/__pycache__/pydoc.*.pyc" + ], + "files": [ + "${bindir}/pydoc*", + "${libdir}/python3.5/pydoc.py", + "${libdir}/python3.5/pydoc_data" + ], + "rdepends": [ + "core", + "netclient", + "pkgutil" + ], + "summary": "Python interactive help support" + }, + "resource": { + "cached": [], + "files": [ + "${libdir}/python3.5/lib-dynload/resource.*.so" + ], + "rdepends": [ + "core" + ], + "summary": "Python resource control interface" + }, + "runpy": { + "cached": [ + "${libdir}/python3.5/__pycache__/runpy.*.pyc" + ], + "files": [ + "${libdir}/python3.5/runpy.py" + ], + "rdepends": [ + "core", + "pkgutil" + ], + "summary": "Python helper for locating/executing scripts in module namespace" + }, + "shell": { + "cached": [ + "${libdir}/python3.5/__pycache__/cmd.*.pyc", + "${libdir}/python3.5/__pycache__/fnmatch.*.pyc", + "${libdir}/python3.5/__pycache__/glob.*.pyc", + "${libdir}/python3.5/__pycache__/shlex.*.pyc", + "${libdir}/python3.5/__pycache__/shutil.*.pyc" + ], + "files": [ + "${libdir}/python3.5/cmd.py", + "${libdir}/python3.5/fnmatch.py", + "${libdir}/python3.5/glob.py", + "${libdir}/python3.5/shlex.py", + "${libdir}/python3.5/shutil.py" + ], + "rdepends": [ + "compression", + "core", + "stringold", + "unixadmin" + ], + "summary": "Python shell-like functionality" + }, + "smtpd": { + "cached": [ + "${libdir}/python3.5/__pycache__/asynchat.*.pyc", + "${libdir}/python3.5/__pycache__/asyncore.*.pyc", + "${libdir}/python3.5/__pycache__/smtpd.*.pyc" + ], + "files": [ + "${bindir}/smtpd.py", + "${libdir}/python3.5/asynchat.py", + "${libdir}/python3.5/asyncore.py", + "${libdir}/python3.5/smtpd.py" + ], + "rdepends": [ + "core", + "crypt", + "datetime", + "email", + "io", + "math", + "mime", + "netclient", + "stringold" + ], + "summary": "Python Simple Mail Transport Daemon" + }, + "sqlite3": { + "cached": [ + "${libdir}/python3.5/sqlite3/__pycache__", + "${libdir}/python3.5/sqlite3/__pycache__/dbapi2.*.pyc", + "${libdir}/python3.5/sqlite3/__pycache__/dump.*.pyc" + ], + "files": [ + "${libdir}/python3.5/lib-dynload/_sqlite3.*.so", + "${libdir}/python3.5/sqlite3/dbapi2.py", + "${libdir}/python3.5/sqlite3/dump.py" + ], + "rdepends": [ + "core", + "datetime" + ], + "summary": "Python Sqlite3 database support" + }, + "sqlite3-tests": { + "cached": [], + "files": [ + "${libdir}/python3.5/sqlite3/test" + ], + "rdepends": [ + "core", + "tests" + ], + "summary": "Python Sqlite3 database support tests" + }, + "stringold": { + "cached": [ + "${libdir}/python3.5/__pycache__/string.*.pyc" + ], + "files": [ + "${libdir}/python3.5/string.py" + ], + "rdepends": [ + "core" + ], + "summary": "Python string APIs [deprecated]" + }, + "syslog": { + "cached": [], + "files": [ + "${libdir}/python3.5/lib-dynload/syslog.*.so" + ], + "rdepends": [ + "core" + ], + "summary": "Python syslog interface" + }, + "terminal": { + "cached": [ + "${libdir}/python3.5/__pycache__/pty.*.pyc", + "${libdir}/python3.5/__pycache__/tty.*.pyc" + ], + "files": [ + "${libdir}/python3.5/pty.py", + "${libdir}/python3.5/tty.py" + ], + "rdepends": [ + "core", + "io" + ], + "summary": "Python terminal controlling support" + }, + "tests": { + "cached": [], + "files": [ + "${libdir}/python3.5/test" + ], + "rdepends": [ + "core" + ], + "summary": "Python tests" + }, + "threading": { + "cached": [ + "${libdir}/python3.5/__pycache__/_dummy_thread.*.pyc", + "${libdir}/python3.5/__pycache__/_threading_local.*.pyc", + "${libdir}/python3.5/__pycache__/dummy_threading.*.pyc", + "${libdir}/python3.5/__pycache__/queue.*.pyc" + ], + "files": [ + "${libdir}/python3.5/_dummy_thread.py", + "${libdir}/python3.5/_threading_local.py", + "${libdir}/python3.5/dummy_threading.py", + "${libdir}/python3.5/queue.py" + ], + "rdepends": [ + "core" + ], + "summary": "Python threading & synchronization support" + }, + "tkinter": { + "cached": [], + "files": [ + "${libdir}/python3.5/tkinter" + ], + "rdepends": [ + "core" + ], + "summary": "Python Tcl/Tk bindings" + }, + "typing": { + "cached": [ + "${libdir}/python3.5/__pycache__/typing.*.pyc" + ], + "files": [ + "${libdir}/python3.5/typing.py" + ], + "rdepends": [ + "core" + ], + "summary": "Python typing support" + }, + "unittest": { + "cached": [], + "files": [ + "${libdir}/python3.5/unittest", + "${libdir}/python3.5/unittest/", + "${libdir}/python3.5/unittest/__pycache__" + ], + "rdepends": [ + "core", + "difflib", + "logging", + "pprint", + "shell", + "stringold" + ], + "summary": "Python unit testing framework" + }, + "unixadmin": { + "cached": [ + "${libdir}/python3.5/__pycache__/getpass.*.pyc" + ], + "files": [ + "${libdir}/python3.5/getpass.py", + "${libdir}/python3.5/lib-dynload/grp.*.so", + "${libdir}/python3.5/lib-dynload/nis.*.so" + ], + "rdepends": [ + "core", + "io" + ], + "summary": "Python Unix administration support" + }, + "xml": { + "cached": [], + "files": [ + "${libdir}/python3.5/lib-dynload/_elementtree.*.so", + "${libdir}/python3.5/lib-dynload/pyexpat.*.so", + "${libdir}/python3.5/xml" + ], + "rdepends": [ + "core" + ], + "summary": "Python basic XML support" + }, + "xmlrpc": { + "cached": [], + "files": [ + "${libdir}/python3.5/xmlrpc", + "${libdir}/python3.5/xmlrpc/__pycache__" + ], + "rdepends": [ + "core", + "xml" + ], + "summary": "Python XML-RPC support" + } +}
\ No newline at end of file diff --git a/poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch new file mode 100644 index 0000000000..a4f8bd4710 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch @@ -0,0 +1,25 @@ +From 53ed216d7bf70dd2a925432b6805a701e5fc3e0e Mon Sep 17 00:00:00 2001 +From: Jackie Huang <jackie.huang@windriver.com> +Date: Mon, 17 Nov 2014 06:44:47 +0000 +Subject: [PATCH] python3 use CROSSPYTHONPATH for PYTHON_FOR_BUILD + +Upstream-Status: Inappropriate [Cross compile specific] + +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: Python-3.5.4/configure.ac +=================================================================== +--- Python-3.5.4.orig/configure.ac ++++ Python-3.5.4/configure.ac +@@ -73,7 +73,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) '$interp + fi + elif test "$cross_compiling" = maybe; then + AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH]) diff --git a/poky/meta/recipes-devtools/python/python3/regen-all.patch b/poky/meta/recipes-devtools/python/python3/regen-all.patch new file mode 100644 index 0000000000..36b9d9d919 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/regen-all.patch @@ -0,0 +1,25 @@ +python3-native: run regen-importlib target correctly + +regen-importlib depends on other regen- targets, so we must be sure to +run it after (most of) the others. In reality, we do not need to run it +at all since "make" will invoke it, if necessary. We do not want to +rely on that, though. + +Upstream-Status: Pending + +Signed-off-by: Joe Slater <joe.slater@windriver.com> + + + +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -709,7 +709,8 @@ regen-importlib: Programs/_freeze_import + ############################################################################ + # Regenerate all generated files + +-regen-all: regen-opcode regen-opcode-targets regen-typeslots regen-grammar regen-ast regen-importlib ++regen-all: regen-opcode regen-opcode-targets regen-typeslots regen-grammar regen-ast ++ $(MAKE) regen-importlib + + ############################################################################ + # Special rules for object files diff --git a/poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch b/poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch new file mode 100644 index 0000000000..fc2e12dfe5 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch @@ -0,0 +1,50 @@ +From 8dad810f3a3d073f09ad72e1a3ee0a895eab2ca1 Mon Sep 17 00:00:00 2001 +From: Robert Yang <liezhi.yang@windriver.com> +Date: Sun, 18 Jan 2015 19:05:36 -0800 +Subject: [PATCH] setup.py:check cross_compiling when get FLAGS + +Fixed when compile target pythnon3: +gcc -isystem/path/to/sysroots/x86_64-linux/usr/include \ + -L=/path/to/sysroots/x86_64-linux/usr/lib + +This is incorrect, the native sysroot should not be used by target +python3. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- + setup.py | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/setup.py b/setup.py +index e8339cd..83fd31f 100644 +--- a/setup.py ++++ b/setup.py +@@ -238,7 +238,10 @@ class PyBuildExt(build_ext): + # unfortunately, distutils doesn't let us provide separate C and C++ + # compilers + if compiler is not None: +- (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS') ++ if cross_compiling: ++ (ccshared,cflags) = (os.environ.get('CCSHARED') or '', os.environ.get('CFLAGS') or '') ++ else: ++ (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS') + args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags + self.compiler.set_executables(**args) + +@@ -457,7 +460,10 @@ class PyBuildExt(build_ext): + ('LDFLAGS', '-R', self.compiler.runtime_library_dirs), + ('LDFLAGS', '-L', self.compiler.library_dirs), + ('CPPFLAGS', '-I', self.compiler.include_dirs)): +- env_val = sysconfig.get_config_var(env_var) ++ if cross_compiling: ++ env_val = os.environ.get(env_var) ++ else: ++ env_val = sysconfig.get_config_var(env_var) + if env_val: + # To prevent optparse from raising an exception about any + # options in env_val that it doesn't know about we strip out +-- +1.7.9.5 + diff --git a/poky/meta/recipes-devtools/python/python3/setuptweaks.patch b/poky/meta/recipes-devtools/python/python3/setuptweaks.patch new file mode 100644 index 0000000000..3a91b1916c --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/setuptweaks.patch @@ -0,0 +1,57 @@ +This patch removes various ways native system options can pass into the python +compilation and somehow break C modules. + +Upstream-Status: Inappropriate [OE Specific] + +RP 2012/04/23 + +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py 2012-04-23 20:03:47.295582553 +0000 ++++ Python-2.7.2/setup.py 2012-04-23 20:03:15.000000000 +0000 +@@ -231,7 +231,13 @@ + # compilers + if compiler is not None: + (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS') +- args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags ++ # Need to filter out -isysroot from the flags. Ideally should ++ # figure out target flags here. ++ flags = [] ++ for f in cflags.split(): ++ if not f.startswith("-isystem"): ++ flags.append(f) ++ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + ' '.join(flags) + self.compiler.set_executables(**args) + + build_ext.build_extensions(self) +@@ -393,7 +399,6 @@ + # into configure and stored in the Makefile (issue found on OS X 10.3). + 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)): + env_val = sysconfig.get_config_var(env_var) + if env_val: +@@ -419,16 +424,16 @@ + for directory in reversed(options.dirs): + add_dir_to_list(dir_list, directory) + +- if os.path.normpath(sys.prefix) != '/usr' \ +- and not sysconfig.get_config_var('PYTHONFRAMEWORK'): ++# if os.path.normpath(sys.prefix) != '/usr' \ ++# and not sysconfig.get_config_var('PYTHONFRAMEWORK'): + # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework + # (PYTHONFRAMEWORK is set) to avoid # linking problems when + # building a framework with different architectures than + # the one that is currently installed (issue #7473) +- add_dir_to_list(self.compiler.library_dirs, +- sysconfig.get_config_var("LIBDIR")) +- add_dir_to_list(self.compiler.include_dirs, +- sysconfig.get_config_var("INCLUDEDIR")) ++# add_dir_to_list(self.compiler.library_dirs, ++# sysconfig.get_config_var("LIBDIR")) ++# add_dir_to_list(self.compiler.include_dirs, ++# sysconfig.get_config_var("INCLUDEDIR")) + + try: + have_unicode = unicode diff --git a/poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch b/poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch new file mode 100644 index 0000000000..802b1c7203 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch @@ -0,0 +1,17 @@ +shutils should consider symlinks + +-Khem + +Upstream-Status: Pending + +--- a/Lib/shutil.py 2013-01-29 12:31:06.926555779 -0800 ++++ b/Lib/shutil.py 2013-01-29 16:31:39.097554182 -0800 +@@ -132,7 +132,7 @@ def copymode(src, dst, *, follow_symlink + st = stat_func(src) + chmod_func(dst, stat.S_IMODE(st.st_mode)) + +-if hasattr(os, 'listxattr'): ++if hasattr(os, 'listxattr') and os.listxattr in os.supports_follow_symlinks: + def _copyxattr(src, dst, *, follow_symlinks=True): + """Copy extended filesystem attributes from `src` to `dst`. + diff --git a/poky/meta/recipes-devtools/python/python3/sitecustomize.py b/poky/meta/recipes-devtools/python/python3/sitecustomize.py new file mode 100644 index 0000000000..4c8b5e2ba3 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/sitecustomize.py @@ -0,0 +1,37 @@ +# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de> +# GPLv2 or later +# Version: 20081123 +# Features: +# * set proper default encoding +# * enable readline completion in the interactive interpreter +# * load command line history on startup +# * save command line history on exit + +import os + +def __exithandler(): + try: + readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) ) + except IOError: + pass + +def __registerExitHandler(): + import atexit + atexit.register( __exithandler ) + +def __enableReadlineSupport(): + readline.set_history_length( 1000 ) + readline.parse_and_bind( "tab: complete" ) + try: + readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) ) + except IOError: + pass + +import sys +try: + import rlcompleter, readline +except ImportError: + pass +else: + __registerExitHandler() + __enableReadlineSupport() diff --git a/poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch b/poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch new file mode 100644 index 0000000000..32ecab9fec --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch @@ -0,0 +1,97 @@ +The compiled .pyc files contain time stamp corresponding to the compile time. +This prevents binary reproducibility. This patch allows to achieve binary +reproducibility by overriding the build time stamp by the value +exported via SOURCE_DATE_EPOCH. + +Upstream-Status: Backport + +Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> + + +From aeab488630fdb1b56a8d0b0c13fa88706b2afe9b Mon Sep 17 00:00:00 2001 +From: "Bernhard M. Wiedemann" <bwiedemann@suse.de> +Date: Sat, 25 Feb 2017 06:42:28 +0100 +Subject: [PATCH] bpo-29708: support SOURCE_DATE_EPOCH env var in py_compile + +to allow for reproducible builds of python packages + +See https://reproducible-builds.org/ for why this is good +and https://reproducible-builds.org/specs/source-date-epoch/ +for the definition of this variable. + +Background: +In some distributions like openSUSE, binary rpms contain precompiled .pyc files. + +And packages like amqp or twisted dynamically generate .py files at build time +so those have the current time and that timestamp gets embedded +into the .pyc file header. +When we then adapt file timestamps in rpms to be constant, +the timestamp in the .pyc header will no more match +the .py timestamp in the filesystem. +The software will still work, but it will not use the .pyc file as it should. +--- + Doc/library/py_compile.rst | 4 ++++ + Lib/py_compile.py | 4 ++++ + Lib/test/test_py_compile.py | 19 +++++++++++++++++++ + 3 files changed, 27 insertions(+) + +diff --git a/Doc/library/py_compile.rst b/Doc/library/py_compile.rst +index 0af8fb1..841f3e8 100644 +--- a/Doc/library/py_compile.rst ++++ b/Doc/library/py_compile.rst +@@ -53,6 +53,10 @@ byte-code cache files in the directory containing the source code. + :func:`compile` function. The default of ``-1`` selects the optimization + level of the current interpreter. + ++ If the SOURCE_DATE_EPOCH environment variable is set, the .py file mtime ++ and timestamp entry in .pyc file header, will be limited to this value. ++ See https://reproducible-builds.org/specs/source-date-epoch/ for more info. ++ + .. versionchanged:: 3.2 + Changed default value of *cfile* to be :PEP:`3147`-compliant. Previous + default was *file* + ``'c'`` (``'o'`` if optimization was enabled). +diff --git a/Lib/py_compile.py b/Lib/py_compile.py +index 11c5b50..62dcdc7 100644 +--- a/Lib/py_compile.py ++++ b/Lib/py_compile.py +@@ -137,6 +137,10 @@ def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1): + except FileExistsError: + pass + source_stats = loader.path_stats(file) ++ sde = os.environ.get('SOURCE_DATE_EPOCH') ++ if sde and source_stats['mtime'] > int(sde): ++ source_stats['mtime'] = int(sde) ++ os.utime(file, (source_stats['mtime'], source_stats['mtime'])) + bytecode = importlib._bootstrap_external._code_to_bytecode( + code, source_stats['mtime'], source_stats['size']) + mode = importlib._bootstrap_external._calc_mode(file) +diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py +index 4a6caa5..3d09963 100644 +--- a/Lib/test/test_py_compile.py ++++ b/Lib/test/test_py_compile.py +@@ -98,6 +98,25 @@ def test_bad_coding(self): + self.assertFalse(os.path.exists( + importlib.util.cache_from_source(bad_coding))) + ++ def test_source_date_epoch(self): ++ testtime = 123456789 ++ orig_sde = os.getenv("SOURCE_DATE_EPOCH") ++ os.environ["SOURCE_DATE_EPOCH"] = str(testtime) ++ py_compile.compile(self.source_path, self.pyc_path) ++ if orig_sde: ++ os.environ["SOURCE_DATE_EPOCH"] = orig_sde ++ else: ++ del os.environ["SOURCE_DATE_EPOCH"] ++ self.assertTrue(os.path.exists(self.pyc_path)) ++ self.assertFalse(os.path.exists(self.cache_path)) ++ statinfo = os.stat(self.source_path) ++ self.assertEqual(statinfo.st_mtime, testtime) ++ f = open(self.pyc_path, "rb") ++ f.read(4) ++ timebytes = f.read(4) # read timestamp from pyc header ++ f.close() ++ self.assertEqual(timebytes, (testtime).to_bytes(4, 'little')) ++ + @unittest.skipIf(sys.flags.optimize > 0, 'test does not work with -O') + def test_double_dot_no_clobber(self): + # http://bugs.python.org/issue22966 diff --git a/poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch b/poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch new file mode 100644 index 0000000000..c89d9a3d83 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch @@ -0,0 +1,51 @@ +From fc93b3cc23b4f9698ae92a42986dbb02b6f19588 Mon Sep 17 00:00:00 2001 +From: Robert Yang <liezhi.yang@windriver.com> +Date: Sun, 18 Jan 2015 06:29:50 -0800 +Subject: [PATCH] sysconfig.py: add _PYTHON_PROJECT_SRC + +python3 has introduced _PYTHON_PROJECT_BASE which is used for separate B +and S, but it doesn't work when compile Modules, the target python3 runs +python3-native's sysconfig to get srcdir which is the native's, there +would be errors when native's srcdir has been removed, add +_PYTHON_PROJECT_SRC to fix the problem. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- + Lib/distutils/sysconfig.py | 5 ++++- + Lib/sysconfig.py | 5 ++++- + 2 files changed, 8 insertions(+), 2 deletions(-) + +Index: Python-3.5.3/Lib/distutils/sysconfig.py +=================================================================== +--- Python-3.5.3.orig/Lib/distutils/sysconfig.py ++++ Python-3.5.3/Lib/distutils/sysconfig.py +@@ -498,7 +498,10 @@ def get_config_vars(*args): + _config_vars['SO'] = SO + + # Always convert srcdir to an absolute path +- srcdir = _config_vars.get('srcdir', project_base) ++ if "_PYTHON_PROJECT_SRC" in os.environ: ++ srcdir = os.path.abspath(os.environ["_PYTHON_PROJECT_SRC"]) ++ else: ++ srcdir = _config_vars.get('srcdir', project_base) + if os.name == 'posix': + if python_build: + # If srcdir is a relative path (typically '.' or '..') +Index: Python-3.5.3/Lib/sysconfig.py +=================================================================== +--- Python-3.5.3.orig/Lib/sysconfig.py ++++ Python-3.5.3/Lib/sysconfig.py +@@ -544,7 +544,10 @@ def get_config_vars(*args): + _CONFIG_VARS['userbase'] = _getuserbase() + + # Always convert srcdir to an absolute path +- srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE) ++ if "_PYTHON_PROJECT_SRC" in os.environ: ++ srcdir = os.path.abspath(os.environ["_PYTHON_PROJECT_SRC"]) ++ else: ++ srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE) + if os.name == 'posix': + if _PYTHON_BUILD: + # If srcdir is a relative path (typically '.' or '..') diff --git a/poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch b/poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch new file mode 100644 index 0000000000..785b5567f2 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch @@ -0,0 +1,35 @@ +Dont search hardcoded paths, we might be doing a cross-build +Use '=' in-front to let compiler append sysroot, if it can + +Should fix things like + +configure:6972: arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 -DNDEBUG -fno-inline -D__SOFTFP__ --sysroot=/build/v2013.06/build/tmp-angstrom_v2013_06-eglibc/sysroots/beaglebone -c -O2 -pipe -g -feliminate-unused-debug-types -I/usr/include/ncursesw conftest.c >&5 +cc1: warning: include location "/usr/include/ncursesw" is unsafe for cross-compilation [-Wpoison-system-directories] + + +Signed-off-by: Khem Raj +Upstream-Status: Pending + + +Index: Python-3.3.2/setup.py +=================================================================== +--- Python-3.3.2.orig/setup.py 2013-07-30 01:30:48.000000000 -0700 ++++ Python-3.3.2/setup.py 2013-07-30 01:41:11.697862723 -0700 +@@ -1210,7 +1210,7 @@ + panel_library = 'panel' + if curses_library == 'ncursesw': + curses_defines.append(('HAVE_NCURSESW', '1')) +- curses_includes.append('/usr/include/ncursesw') ++ curses_includes.append('=/usr/include/ncursesw') + # Bug 1464056: If _curses.so links with ncursesw, + # _curses_panel.so must link with panelw. + panel_library = 'panelw' +@@ -1819,7 +1819,7 @@ + if host_platform == 'darwin': + # OS X 10.5 comes with libffi.dylib; the include files are + # in /usr/include/ffi +- inc_dirs.append('/usr/include/ffi') ++ inc_dirs.append('=/usr/include/ffi') + + ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")] + if not ffi_inc or ffi_inc[0] == '': diff --git a/poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch b/poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch new file mode 100644 index 0000000000..8d037278bd --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch @@ -0,0 +1,52 @@ +From 5d6509313198ec9b686cad50b002212e4344004b Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Fri, 11 Mar 2016 01:15:45 -0500 +Subject: [PATCH] configure.ac: tweak MULTIARCH for powerpc-linux-gnuspe + +For p1022ds bsp, the MULTIARCH is powerpc-linux-gnuspev1 and +python3 did not recognize the extra 'v1' which caused python3 +configure error for the platform triplet. + +Q:Why Python3 check platform triplet? + +A:Under Linux, GNU/KFreeBSD and the Hurd, C extensions now include +the architecture triplet in the extension name, to make it easy to +test builds for different ABIs in the same working tree. + +Here is the generated C extensions which take platform triplet into account. +... +|image/usr/lib/python3.5/lib-dynload/_datetime.cpython-35m-powerpc-linux-gnuspe.so +... + +https://bugs.python.org/issue22980 +https://www.python.org/dev/peps/pep-3149/ +https://bugs.python.org/review/22980/patch/14593/54808 + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + configure.ac | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 9eb3d22..c34a9a0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -724,6 +724,13 @@ fi + + + MULTIARCH=$($CC --print-multiarch 2>/dev/null) ++ ++# Tweak MULTIARCH ++if test x$MULTIARCH = xpowerpc-linux-gnuspev1 ++then ++ MULTIARCH="powerpc-linux-gnuspe" ++fi ++ + AC_SUBST(MULTIARCH) + + AC_MSG_CHECKING([for the platform triplet based on compiler characteristics]) +-- +1.9.1 + diff --git a/poky/meta/recipes-devtools/python/python3/unixccompiler.patch b/poky/meta/recipes-devtools/python/python3/unixccompiler.patch new file mode 100644 index 0000000000..3e2b1d1c2e --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/unixccompiler.patch @@ -0,0 +1,35 @@ +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. + +Secondly add -L=<path> this way linker will be able to resolve /usr/lib w.r.t sysroot and not +use hardcoded /usr/lib to look for libs which is wrong in cross compile environment and this will work +ok on native systems too since sysroot for native compilers is / + +Signed-off-by: Mei Lei <lei.mei@intel.com> +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Index: Python-3.3.2/Lib/distutils/unixccompiler.py +=================================================================== +--- Python-3.3.2.orig/Lib/distutils/unixccompiler.py 2013-05-15 09:32:54.000000000 -0700 ++++ Python-3.3.2/Lib/distutils/unixccompiler.py 2013-08-01 00:58:18.629056286 -0700 +@@ -202,7 +202,9 @@ + # ccompiler.py. + + def library_dir_option(self, dir): +- return "-L" + dir ++ if dir.startswith("/"): ++ return "-L=" + dir ++ return "-L" + dir + + def _is_gcc(self, compiler_name): + return "gcc" in compiler_name or "g++" in compiler_name +@@ -221,7 +221,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 |