diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-08-17 22:31:25 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-08-22 19:43:26 +0300 |
commit | 60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch) | |
tree | ecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers/yocto-poky/meta/recipes-devtools/python/python3 | |
parent | e18c61205e0234b03697129c20cc69c9b3940efc (diff) | |
download | openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.xz |
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to
hold all of the layers that we import with git-subtree.
Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-devtools/python/python3')
32 files changed, 1604 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/000-cross-compile.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/000-cross-compile.patch new file mode 100644 index 000000000..28fe70adb --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/000-cross-compile.patch @@ -0,0 +1,85 @@ +We cross compile python. This patch uses tools from host/native +python instead of in-tree tools + +-Khem + +Upstream-Status: Inappropriate[Configuration Specific] + +--- + Makefile.pre.in | 25 +++++++++++++------------ + 1 file changed, 13 insertions(+), 12 deletions(-) + +Index: Python-3.5.1/Makefile.pre.in +=================================================================== +--- Python-3.5.1.orig/Makefile.pre.in ++++ Python-3.5.1/Makefile.pre.in +@@ -220,6 +220,7 @@ LIBOBJS= @LIBOBJS@ + + PYTHON= python$(EXE) + BUILDPYTHON= python$(BUILDEXE) ++HOSTPYTHON= $(BUILDPYTHON) + + PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@ + _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@ +@@ -276,6 +277,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ + ########################################################################## + # Parser + PGEN= Parser/pgen$(EXE) ++HOSTPGEN= $(PGEN)$(EXE) + + PSRCS= \ + Parser/acceler.c \ +@@ -506,7 +508,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) +@@ -779,7 +781,7 @@ $(IO_OBJS): $(IO_H) + + $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN) + @$(MKDIR_P) Include +- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) ++ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) + $(GRAMMAR_C): $(GRAMMAR_H) + touch $(GRAMMAR_C) + +@@ -968,7 +970,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Programs/pyth + ###################################################################### + + TESTOPTS= $(EXTRATESTOPTS) +-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS) ++TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS) + TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py + TESTTIMEOUT= 3600 + +@@ -1455,7 +1457,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 +@@ -1521,7 +1523,7 @@ config.status: $(srcdir)/configure + + # 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 +@@ -1656,7 +1658,7 @@ funny: + + # Perform some verification checks on any modified files. + patchcheck: all +- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py ++ $(RUNSHARED) ./$(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py + + # Dependencies + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch new file mode 100644 index 000000000..b7e0ac635 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch @@ -0,0 +1,38 @@ +From 045c99b5f1eb6e4e0d8ad1ef9f0ba6574f738150 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 d7fc9a0..47e60bc 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1270,12 +1270,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} + 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.1.4 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch new file mode 100644 index 000000000..dd6b24fe9 --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch new file mode 100644 index 000000000..819ba69ed --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch @@ -0,0 +1,48 @@ +Dont cross compile site packages + +-Khem + +Upstream-Status: Inappropriate[Embedded-Specific] + +--- + Makefile.pre.in | 16 ---------------- + 1 file changed, 16 deletions(-) + +Index: Python-3.5.0/Makefile.pre.in +=================================================================== +--- Python-3.5.0.orig/Makefile.pre.in ++++ Python-3.5.0/Makefile.pre.in +@@ -1262,33 +1262,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +- $(DESTDIR)$(LIBDEST) +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +- $(DESTDIR)$(LIBDEST) +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +- $(DESTDIR)$(LIBDEST) +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch new file mode 100644 index 000000000..fddfd2b2f --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch new file mode 100644 index 000000000..6beac7b80 --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch new file mode 100644 index 000000000..789929b71 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch @@ -0,0 +1,36 @@ +consider opkg directories when cleaning up + +-Khem + +Upstream-Status: Inappropriate [OE specific] + +--- + Makefile.pre.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1306,8 +1306,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 +@@ -1321,9 +1321,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 'fficonfig.py' -exec rm -f {} ';' || true + -rm -f Lib/lib2to3/*Grammar*.pickle diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch new file mode 100644 index 000000000..b96419a63 --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/110-enable-zlib.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/110-enable-zlib.patch new file mode 100644 index 000000000..fb92a1916 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/110-enable-zlib.patch @@ -0,0 +1,21 @@ +Enable zlib in python + +-Khem + +Upstream-Status: Inappropriate [OE-Specific] + +--- + Modules/Setup.dist | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/Modules/Setup.dist ++++ b/Modules/Setup.dist +@@ -354,7 +354,7 @@ _symtable symtablemodule.c + # Andrew Kuchling's zlib module. + # This require zlib 1.1.3 (or later). + # See http://www.gzip.org/zlib/ +-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz ++zlib zlibmodule.c -lz + + # Interface to the Expat XML parser + # diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch new file mode 100644 index 000000000..8b93c1cf4 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch @@ -0,0 +1,88 @@ +From d4dd67daa1555bf13272cc071706338572539bad 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> + +--- +diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py +index 573724d..418b478 100644 +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -17,10 +17,11 @@ import sys + from .errors import DistutilsPlatformError + + # These are needed in a couple of spots, so just compute them once. +-PREFIX = os.path.normpath(sys.prefix) +-EXEC_PREFIX = os.path.normpath(sys.exec_prefix) +-BASE_PREFIX = os.path.normpath(sys.base_prefix) +-BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) ++PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) ++EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) ++BASE_PREFIX = os.path.normpath(sys.base_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) ++BASE_EXEC_PREFIX= os.path.normpath(sys.base_exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) ++ + + # Path to the base directory of the project. On Windows the binary may + # live in project/PCBuild/win32 or project/PCBuild/amd64. +@@ -84,7 +85,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 +128,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 +140,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: +@@ -233,7 +240,7 @@ def get_config_h_filename(): + else: + inc_dir = get_python_inc(plat_specific=1) + +- return os.path.join(inc_dir, 'pyconfig.h') ++ return os.path.join(inc_dir, 'pyconfig.h'.replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )) + + + def get_makefile_filename(): +@@ -242,7 +249,7 @@ def get_makefile_filename(): + return os.path.join(_sys_home or project_base, "Makefile") + lib_dir = get_python_lib(plat_specific=0, standard_lib=1) + config_file = 'config-{}{}'.format(get_python_version(), build_flags) +- return os.path.join(lib_dir, config_file, 'Makefile') ++ return os.path.join(lib_dir, config_file, 'Makefile').replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) + + + def parse_config_h(fp, g=None): +-- +2.7.0 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/130-readline-setup.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/130-readline-setup.patch new file mode 100644 index 000000000..c805652d6 --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch new file mode 100644 index 000000000..78d7c7867 --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch new file mode 100644 index 000000000..f29ae5337 --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch new file mode 100644 index 000000000..3347321fd --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch @@ -0,0 +1,39 @@ +_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-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py 2012-04-05 23:18:38.500136647 +0300 ++++ Python-2.7.2/setup.py 2012-04-05 23:19:35.888134969 +0300 +@@ -1634,8 +1634,10 @@ + # Call the method for detecting whether _tkinter can be compiled + 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') + + return missing + +diff --git Python-3.5.1.orig/setup.py Python-3.5.1/setup.py +index b4633b9..d7588c0 100644 +--- Python-3.5.1.orig/setup.py ++++ Python-3.5.1/setup.py +@@ -1536,7 +1536,7 @@ 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) + + # tkinter module will not be avalaible as yocto + # doesn't have tk integrated (yet) diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/cgi_py.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/cgi_py.patch new file mode 100644 index 000000000..de504f9dc --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch new file mode 100644 index 000000000..97214f9aa --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch new file mode 100644 index 000000000..cd1a978eb --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/host_include_contamination.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/host_include_contamination.patch new file mode 100644 index 000000000..ef2054d9a --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch new file mode 100644 index 000000000..44ec424cd --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch @@ -0,0 +1,312 @@ +Upstream-Status: Pending + +get the sys.lib from python itself and do not use hardcoded value of 'lib' + +02/2015 Rebased for 3.4.2 + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> + +Index: Python-3.5.0/Include/pythonrun.h +=================================================================== +--- Python-3.5.0.orig/Include/pythonrun.h ++++ Python-3.5.0/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.0/Lib/distutils/command/install.py +=================================================================== +--- Python-3.5.0.orig/Lib/distutils/command/install.py ++++ Python-3.5.0/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', +@@ -30,7 +32,7 @@ WINDOWS_SCHEME = { + INSTALL_SCHEMES = { + 'unix_prefix': { + 'purelib': '$base/lib/python$py_version_short/site-packages', +- 'platlib': '$platbase/lib/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.0/Lib/pydoc.py +=================================================================== +--- Python-3.5.0.orig/Lib/pydoc.py ++++ Python-3.5.0/Lib/pydoc.py +@@ -393,7 +393,7 @@ class Doc: + + docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS) + +- 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]) + if (isinstance(object, type(os)) and + (object.__name__ in ('errno', 'exceptions', 'gc', 'imp', +Index: Python-3.5.0/Lib/trace.py +=================================================================== +--- Python-3.5.0.orig/Lib/trace.py ++++ Python-3.5.0/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.0/Makefile.pre.in +=================================================================== +--- Python-3.5.0.orig/Makefile.pre.in ++++ Python-3.5.0/Makefile.pre.in +@@ -101,6 +101,8 @@ PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS + + # Machine-dependent subdirectories + MACHDEP= @MACHDEP@ ++LIB= @LIB@ ++ARCH= @ARCH@ + + # Multiarch directory (may be empty) + MULTIARCH= @MULTIARCH@ +@@ -120,7 +122,7 @@ LIBDIR= @libdir@ + MANDIR= @mandir@ + INCLUDEDIR= @includedir@ + CONFINCLUDEDIR= $(exec_prefix)/include +-SCRIPTDIR= $(prefix)/lib ++SCRIPTDIR= @libdir@ + ABIFLAGS= @ABIFLAGS@ + + # Detailed destination directories +@@ -729,6 +731,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 +@@ -798,7 +801,7 @@ $(OPCODE_H): $(srcdir)/Lib/opcode.py $(O + Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(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.0/Modules/getpath.c +=================================================================== +--- Python-3.5.0.orig/Modules/getpath.c ++++ Python-3.5.0/Modules/getpath.c +@@ -117,9 +117,11 @@ + #define EXEC_PREFIX PREFIX + #endif + ++#define LIB_PYTHON LIB "/python" VERSION ++ + #ifndef PYTHONPATH +-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \ +- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload" ++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \ ++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload" + #endif + + #ifndef LANDMARK +@@ -130,6 +132,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. */ + +Index: Python-3.5.0/Python/getplatform.c +=================================================================== +--- Python-3.5.0.orig/Python/getplatform.c ++++ Python-3.5.0/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.0/Python/sysmodule.c +=================================================================== +--- Python-3.5.0.orig/Python/sysmodule.c ++++ Python-3.5.0/Python/sysmodule.c +@@ -1767,6 +1767,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.0/setup.py +=================================================================== +--- Python-3.5.0.orig/setup.py ++++ Python-3.5.0/setup.py +@@ -472,7 +472,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: +@@ -530,8 +530,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: +@@ -716,11 +715,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: +Index: Python-3.5.0/Lib/sysconfig.py +=================================================================== +--- Python-3.5.0.orig/Lib/sysconfig.py ++++ Python-3.5.0/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}', ++ 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}', ++ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}', + 'purelib': '{base}/lib/python{py_version_short}/site-packages', +- 'platlib': '{platbase}/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', ++ 'stdlib': '{installed_base}/'+sys.lib+'/python', ++ 'platstdlib': '{base}/'+sys.lib+'/python', + 'purelib': '{base}/lib/python', +- 'platlib': '{base}/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}', ++ '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', +- 'platlib': '{userbase}/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.0/configure.ac +=================================================================== +--- Python-3.5.0.orig/configure.ac ++++ Python-3.5.0/configure.ac +@@ -858,6 +858,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" diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-config.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-config.patch new file mode 100644 index 000000000..f23b8b7df --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch new file mode 100644 index 000000000..2bc8b8c46 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch @@ -0,0 +1,33 @@ +From 43238e1ac13e32984d015c92a5841f3de1fe1d15 Mon Sep 17 00:00:00 2001 +From: Jackie Huang <jackie.huang@windriver.com> +Date: Tue, 18 Nov 2014 00:07:07 -0500 +Subject: [PATCH] setup.py: no host headers libs + +When we are cross-compiling, setup.py should never look in /usr +or /usr/local to find headers or libraries. + +Upstream-Status: Inappropriate [Cross compile specific] + +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +--- + setup.py | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/setup.py b/setup.py +index f020b28..e8339cd 100644 +--- a/setup.py ++++ b/setup.py +@@ -444,10 +444,7 @@ class PyBuildExt(build_ext): + if not cross_compiling: + 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: + self.add_gcc_paths() +- if not cross_compiling: + self.add_multiarch_paths() + + # Add paths specified in the environment variables LDFLAGS and +-- +2.0.0 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch new file mode 100644 index 000000000..74490d93a --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch @@ -0,0 +1,28 @@ +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(-) + +diff --git a/configure.ac b/configure.ac +index 989baf9..2890c96 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -67,7 +67,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]) +-- +2.0.1 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch new file mode 100644 index 000000000..fc2e12dfe --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch new file mode 100644 index 000000000..f26bd38b0 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch @@ -0,0 +1,30 @@ +Patch setup.py so that the detect_modules() function looks for required +libraries and headers in STAGING_LIBDIR / STAGING_INCDIR. + +Without this patch, several extension modules are not built, even though +their dependencies are present in the compiler's search paths. +The result is the following warning, and ultimately incomplete packages: + +| The necessary bits to build these optional modules were not found: +| _bz2 _curses_panel _dbm +| _gdbm _lzma _sqlite3 +| nis readline zlib +| To find the necessary bits, look in setup.py in detect_modules() for the module's name. + +Upstream-Status: Inappropriate [Cross compile specific] + +Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de> + +Index: Python-3.4.3/setup.py +=================================================================== +--- Python-3.4.3.orig/setup.py ++++ Python-3.4.3/setup.py +@@ -521,6 +521,8 @@ class PyBuildExt(build_ext): + else: + lib_dirs = self.compiler.library_dirs[:] + inc_dirs = self.compiler.include_dirs[:] ++ lib_dirs.append(os.environ.get('STAGING_LIBDIR')) ++ inc_dirs.append(os.environ.get('STAGING_INCDIR')) + exts = [] + missing = [] + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setuptweaks.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setuptweaks.patch new file mode 100644 index 000000000..3a91b1916 --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch new file mode 100644 index 000000000..802b1c720 --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sitecustomize.py b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sitecustomize.py new file mode 100644 index 000000000..4c8b5e2ba --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch new file mode 100644 index 000000000..de07643f2 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch @@ -0,0 +1,54 @@ +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(-) + +diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py +index a545ab9..74317d1 100644 +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -554,7 +554,10 @@ def get_config_vars(*args): + _config_vars['exec_prefix'] = EXEC_PREFIX + + # 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/Lib/sysconfig.py b/Lib/sysconfig.py +index 7287f11..cc92998 100644 +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -562,7 +562,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 '..') +-- +1.7.9.5 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch new file mode 100644 index 000000000..785b5567f --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch new file mode 100644 index 000000000..8d037278b --- /dev/null +++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/unixccompiler.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/unixccompiler.patch new file mode 100644 index 000000000..7b90f1388 --- /dev/null +++ b/import-layers/yocto-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 diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/use_packed_importlib.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/use_packed_importlib.patch new file mode 100644 index 000000000..6c4b0cda9 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/use_packed_importlib.patch @@ -0,0 +1,31 @@ + +Upstream-Status: Inappropriate [embedded specific] + +The binary _freeze_importlib is built and also used during build time to generate +importlib*.h files, this is impossible to do on a cross-compile environment, +this avoids executing the binary and forces it to use the packed importlib*.h files. + + +Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> + +Index: Python-3.5.0/Makefile.pre.in +=================================================================== +--- Python-3.5.0.orig/Makefile.pre.in ++++ Python-3.5.0/Makefile.pre.in +@@ -700,12 +700,12 @@ Programs/_freeze_importlib.o: Programs/_ + Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) + $(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + +-Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib +- ./Programs/_freeze_importlib \ ++#Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib ++# ./Programs/_freeze_importlib \ + $(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h + +-Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib +- ./Programs/_freeze_importlib \ ++#Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib ++# ./Programs/_freeze_importlib \ + $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h + + |