From 972dcfcdbfe75dcfeb777150c136576cf1a71e99 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 9 Oct 2015 22:59:03 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- .../python/python-2.7-manifest.inc | 280 ++++ .../python/python-3.3-manifest.inc | 268 ++++ .../python/python-argparse_1.2.1.bb | 17 + meta/recipes-devtools/python/python-async_0.6.1.bb | 17 + meta/recipes-devtools/python/python-dbus_1.2.0.bb | 29 + .../python/python-distribute_0.6.32.bb | 55 + .../python/python-docutils_0.12.bb | 18 + .../python/python-git_0.3.2.RC1.bb | 22 + meta/recipes-devtools/python/python-gitdb_0.5.4.bb | 18 + .../python/python-gst/python-path.patch | 28 + meta/recipes-devtools/python/python-gst_0.10.22.bb | 29 + ...ing-setup.py-force-paths-for-zlib-freetyp.patch | 55 + .../allow.to.disable.some.features.patch | 65 + .../python-imaging/fix-freetype-includes.patch | 30 + .../python/python-imaging_1.1.7.bb | 45 + meta/recipes-devtools/python/python-mako_0.9.1.bb | 20 + .../10-distutils-fix-swig-parameter.patch | 18 + .../11-distutils-never-modify-shebang-line.patch | 20 + ...2-distutils-prefix-is-inside-staging-area.patch | 65 + .../python/python-native/debug.patch | 29 + .../python/python-native/multilib.patch | 243 +++ .../python/python-native/nohostlibs.patch | 67 + .../python/python-native/unixccompiler.patch | 20 + .../recipes-devtools/python/python-native_2.7.3.bb | 65 + meta/recipes-devtools/python/python-nose_1.2.1.bb | 16 + .../python/python-numpy/aarch64/_numpyconfig.h | 30 + .../python/python-numpy/aarch64/config.h | 139 ++ .../python/python-numpy/arm/config.h | 21 + .../python/python-numpy/arm/numpyconfig.h | 17 + .../python/python-numpy/armeb/config.h | 21 + .../python/python-numpy/armeb/numpyconfig.h | 17 + .../python/python-numpy/i586/config.h | 108 ++ .../python/python-numpy/i586/numpyconfig.h | 24 + .../python/python-numpy/mips/_numpyconfig.h | 30 + .../python/python-numpy/mips/config.h | 139 ++ .../python/python-numpy/mips64/_numpyconfig.h | 30 + .../python/python-numpy/mips64/config.h | 139 ++ .../python/python-numpy/mips64n32/_numpyconfig.h | 30 + .../python/python-numpy/mips64n32/config.h | 139 ++ .../python/python-numpy/mipsel/config.h | 21 + .../python/python-numpy/mipsel/numpyconfig.h | 17 + .../python/python-numpy/no-host-paths.patch | 57 + .../python/python-numpy/powerpc/_numpyconfig.h | 30 + .../python/python-numpy/powerpc/config.h | 139 ++ .../python/python-numpy/powerpc64/_numpyconfig.h | 30 + .../python/python-numpy/powerpc64/config.h | 139 ++ .../python/python-numpy/trycompile.diff | 36 + .../python/python-numpy/unbreak-assumptions.diff | 19 + .../python/python-numpy/x86-64/_numpyconfig.h | 30 + .../python/python-numpy/x86-64/config.h | 139 ++ meta/recipes-devtools/python/python-numpy_1.7.0.bb | 99 ++ .../python/python-pycairo_1.10.0.bb | 41 + .../python/python-pycurl/no-static-link.patch | 17 + .../python/python-pycurl_7.19.3.1.bb | 34 + .../obsolete_automake_macros.patch | 23 + .../python/python-pygobject_2.28.3.bb | 39 + .../python/python-pygtk/acinclude.m4 | 90 ++ .../add-gtk-types.defs-into-gdk.c-dependence.patch | 32 + .../python/python-pygtk/fix-gtkunixprint.patch | 20 + .../python/python-pygtk/fix-pygtk-2.0.pc.patch | 13 + .../python/python-pygtk/nodocs.patch | 15 + .../prevent_to_get_display_during_import.patch | 16 + .../python/python-pygtk/python-pygtk2/acinclude.m4 | 90 ++ .../update-dependences-of-defs.c.patch | 38 + .../recipes-devtools/python/python-pygtk_2.24.0.bb | 74 + .../python/python-pyrex-native_0.9.9.bb | 5 + .../python-pyrex/pyrex-fix-optimized-mode.patch | 15 + meta/recipes-devtools/python/python-pyrex_0.9.9.bb | 22 + .../python/python-scons-native_2.3.2.bb | 8 + meta/recipes-devtools/python/python-scons_2.3.2.bb | 14 + .../smart-already-installed-message.patch | 54 + .../python/python-smartpm/smart-attempt.patch | 223 +++ .../python/python-smartpm/smart-channelsdir.patch | 24 + .../smart-config-ignore-all-recommends.patch | 24 + .../python-smartpm/smart-conflict-provider.patch | 196 +++ .../python/python-smartpm/smart-dflags.patch | 45 + .../python-smartpm/smart-filename-NAME_MAX.patch | 35 + .../smart-flag-exclude-packages.patch | 70 + .../smart-flag-ignore-recommends.patch | 60 + .../smart-improve-error-reporting.patch | 253 +++ .../python-smartpm/smart-metadata-match.patch | 28 + .../python-smartpm/smart-multilib-fixes.patch | 22 + .../python/python-smartpm/smart-recommends.patch | 1362 +++++++++++++++++ .../python-smartpm/smart-rpm-extra-macros.patch | 27 + .../python/python-smartpm/smart-rpm-md-parse.patch | 26 + .../python/python-smartpm/smart-rpm-root.patch | 80 + .../python/python-smartpm/smart-rpm4-fixes.patch | 49 + .../python/python-smartpm/smart-tmpdir.patch | 30 + .../python/python-smartpm/smart-yaml-error.patch | 86 ++ .../python/python-smartpm/smartpm-rpm5-nodig.patch | 46 + .../python/python-smartpm_1.4.1.bb | 148 ++ meta/recipes-devtools/python/python-smmap_0.8.2.bb | 20 + meta/recipes-devtools/python/python.inc | 31 + .../01-use-proper-tools-for-cross-build.patch | 138 ++ .../python/python/03-fix-tkinter-detection.patch | 42 + .../python/05-enable-ctypes-cross-build.patch | 30 + .../06-avoid_usr_lib_termcap_path_in_linking.patch | 33 + .../python/06-ctypes-libffi-fix-configure.patch | 44 + .../python/python/CVE-2013-4073_py27.patch | 251 +++ .../python/python/add-md5module-support.patch | 18 + .../python/avoid_warning_about_tkinter.patch | 30 + .../avoid_warning_for_sunos_specific_module.patch | 23 + meta/recipes-devtools/python/python/builddir.patch | 55 + meta/recipes-devtools/python/python/cgi_py.patch | 23 + .../python/check-if-target-is-64b-not-host.patch | 57 + .../python/python/ctypes-libffi-aarch64.patch | 22 + .../python/python/fix-makefile-for-ptest.patch | 33 + .../python/fix_for_using_different_libdir.patch | 82 + .../python/gcc-4.8-fix-configure-Wformat.patch | 20 + .../python/python/host_include_contamination.patch | 27 + .../python/python/json-flaw-fix.patch | 27 + .../python/python/libffi-aarch64.patch | 1608 ++++++++++++++++++++ meta/recipes-devtools/python/python/multilib.patch | 257 ++++ .../python/parallel-makeinst-create-bindir.patch | 19 + .../python/python/posix_close.patch | 43 + .../python/python/pypirc-secure.patch | 35 + .../python/python/python-2.7.3-CVE-2012-2135.patch | 73 + .../python-2.7.3-CVE-2013-1752-smtplib-fix.patch | 101 ++ .../python/python/python-2.7.3-CVE-2014-1912.patch | 26 + .../python/python/python-2.7.3-CVE-2014-7185.patch | 75 + .../python/python-2.7.3-berkeley-db-5.3.patch | 1572 +++++++++++++++++++ .../python/python-2.7.3-remove-bsdb-rpath.patch | 28 + .../python-fix-build-error-with-Readline-6.3.patch | 62 + .../python/python/python2.7.3-nossl3.patch | 37 + .../python/python/remove_sqlite_rpath.patch | 19 + meta/recipes-devtools/python/python/run-ptest | 5 + ...search_db_h_in_inc_dirs_and_avoid_warning.patch | 40 + .../python/setup_py_skip_cross_import_check.patch | 27 + .../python/python/setuptweaks.patch | 57 + .../python/python/sitecustomize.py | 45 + .../python/python3-distribute_0.6.32.bb | 51 + .../python/python3-native_3.3.3.bb | 77 + .../python/python3/000-cross-compile.patch | 83 + ...sue-13032-where-it-fails-with-UnicodeDeco.patch | 37 + .../python3/020-dont-compile-python-files.patch | 37 + .../python/python3/03-fix-tkinter-detection.patch | 42 + .../python/python3/030-fixup-include-dirs.patch | 33 + .../python/python3/04-default-is-optimized.patch | 58 + .../python3/06-ctypes-libffi-fix-configure.patch | 44 + .../python3/070-dont-clean-ipkg-install.patch | 36 + .../python3/080-distutils-dont_adjust_files.patch | 92 ++ .../python/python3/110-enable-zlib.patch | 21 + ...2-distutils-prefix-is-inside-staging-area.patch | 78 + .../python/python3/130-readline-setup.patch | 55 + .../python/python3/150-fix-setupterm.patch | 17 + .../python3/avoid-ncursesw-include-path.patch | 29 + .../python3/avoid_warning_about_tkinter.patch | 25 + meta/recipes-devtools/python/python3/cgi_py.patch | 23 + .../python/python3/fix-ast.h-dependency.patch | 26 + .../python3/fix_for_using_different_libdir.patch | 54 + .../python3/host_include_contamination.patch | 28 + .../recipes-devtools/python/python3/makerace.patch | 28 + .../python/python3/python-3.3-multilib.patch | 336 ++++ .../python/python3/python-config.patch | 46 + ...python3-fix-build-error-with-Readline-6.3.patch | 62 + .../python3-setup.py-no-host-headers-libs.patch | 32 + ...-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch | 27 + .../python/python3/remove_sqlite_rpath.patch | 19 + .../python/python3/setuptweaks.patch | 57 + .../python/python3/shutil-follow-symlink-fix.patch | 17 + .../python/python3/sitecustomize.py | 37 + .../sys_platform_is_now_always_linux2.patch | 29 + .../python/python3/sysroot-include-headers.patch | 35 + .../python/python3/unixccompiler.patch | 35 + meta/recipes-devtools/python/python3_3.3.3.bb | 219 +++ meta/recipes-devtools/python/python_2.7.3.bb | 195 +++ 166 files changed, 13928 insertions(+) create mode 100644 meta/recipes-devtools/python/python-2.7-manifest.inc create mode 100644 meta/recipes-devtools/python/python-3.3-manifest.inc create mode 100644 meta/recipes-devtools/python/python-argparse_1.2.1.bb create mode 100644 meta/recipes-devtools/python/python-async_0.6.1.bb create mode 100644 meta/recipes-devtools/python/python-dbus_1.2.0.bb create mode 100644 meta/recipes-devtools/python/python-distribute_0.6.32.bb create mode 100644 meta/recipes-devtools/python/python-docutils_0.12.bb create mode 100644 meta/recipes-devtools/python/python-git_0.3.2.RC1.bb create mode 100644 meta/recipes-devtools/python/python-gitdb_0.5.4.bb create mode 100644 meta/recipes-devtools/python/python-gst/python-path.patch create mode 100644 meta/recipes-devtools/python/python-gst_0.10.22.bb create mode 100644 meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch create mode 100644 meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch create mode 100644 meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch create mode 100644 meta/recipes-devtools/python/python-imaging_1.1.7.bb create mode 100644 meta/recipes-devtools/python/python-mako_0.9.1.bb create mode 100644 meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch create mode 100644 meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch create mode 100644 meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch create mode 100644 meta/recipes-devtools/python/python-native/debug.patch create mode 100644 meta/recipes-devtools/python/python-native/multilib.patch create mode 100644 meta/recipes-devtools/python/python-native/nohostlibs.patch create mode 100644 meta/recipes-devtools/python/python-native/unixccompiler.patch create mode 100644 meta/recipes-devtools/python/python-native_2.7.3.bb create mode 100644 meta/recipes-devtools/python/python-nose_1.2.1.bb create mode 100644 meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h create mode 100644 meta/recipes-devtools/python/python-numpy/aarch64/config.h create mode 100644 meta/recipes-devtools/python/python-numpy/arm/config.h create mode 100644 meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h create mode 100644 meta/recipes-devtools/python/python-numpy/armeb/config.h create mode 100644 meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h create mode 100644 meta/recipes-devtools/python/python-numpy/i586/config.h create mode 100644 meta/recipes-devtools/python/python-numpy/i586/numpyconfig.h create mode 100644 meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h create mode 100644 meta/recipes-devtools/python/python-numpy/mips/config.h create mode 100644 meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h create mode 100644 meta/recipes-devtools/python/python-numpy/mips64/config.h create mode 100644 meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h create mode 100644 meta/recipes-devtools/python/python-numpy/mips64n32/config.h create mode 100644 meta/recipes-devtools/python/python-numpy/mipsel/config.h create mode 100644 meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h create mode 100644 meta/recipes-devtools/python/python-numpy/no-host-paths.patch create mode 100644 meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h create mode 100644 meta/recipes-devtools/python/python-numpy/powerpc/config.h create mode 100644 meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h create mode 100644 meta/recipes-devtools/python/python-numpy/powerpc64/config.h create mode 100644 meta/recipes-devtools/python/python-numpy/trycompile.diff create mode 100644 meta/recipes-devtools/python/python-numpy/unbreak-assumptions.diff create mode 100644 meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h create mode 100644 meta/recipes-devtools/python/python-numpy/x86-64/config.h create mode 100644 meta/recipes-devtools/python/python-numpy_1.7.0.bb create mode 100644 meta/recipes-devtools/python/python-pycairo_1.10.0.bb create mode 100644 meta/recipes-devtools/python/python-pycurl/no-static-link.patch create mode 100644 meta/recipes-devtools/python/python-pycurl_7.19.3.1.bb create mode 100644 meta/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch create mode 100644 meta/recipes-devtools/python/python-pygobject_2.28.3.bb create mode 100644 meta/recipes-devtools/python/python-pygtk/acinclude.m4 create mode 100644 meta/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch create mode 100644 meta/recipes-devtools/python/python-pygtk/fix-gtkunixprint.patch create mode 100644 meta/recipes-devtools/python/python-pygtk/fix-pygtk-2.0.pc.patch create mode 100644 meta/recipes-devtools/python/python-pygtk/nodocs.patch create mode 100644 meta/recipes-devtools/python/python-pygtk/prevent_to_get_display_during_import.patch create mode 100644 meta/recipes-devtools/python/python-pygtk/python-pygtk2/acinclude.m4 create mode 100644 meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch create mode 100644 meta/recipes-devtools/python/python-pygtk_2.24.0.bb create mode 100644 meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb create mode 100644 meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch create mode 100644 meta/recipes-devtools/python/python-pyrex_0.9.9.bb create mode 100644 meta/recipes-devtools/python/python-scons-native_2.3.2.bb create mode 100644 meta/recipes-devtools/python/python-scons_2.3.2.bb create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-attempt.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-config-ignore-all-recommends.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-conflict-provider.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-dflags.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-filename-NAME_MAX.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-flag-exclude-packages.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-flag-ignore-recommends.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-metadata-match.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-multilib-fixes.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-recommends.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-rpm-extra-macros.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-rpm-md-parse.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-rpm-root.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-tmpdir.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-yaml-error.patch create mode 100644 meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch create mode 100644 meta/recipes-devtools/python/python-smartpm_1.4.1.bb create mode 100644 meta/recipes-devtools/python/python-smmap_0.8.2.bb create mode 100644 meta/recipes-devtools/python/python.inc create mode 100644 meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch create mode 100644 meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch create mode 100644 meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch create mode 100644 meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch create mode 100644 meta/recipes-devtools/python/python/06-ctypes-libffi-fix-configure.patch create mode 100644 meta/recipes-devtools/python/python/CVE-2013-4073_py27.patch create mode 100644 meta/recipes-devtools/python/python/add-md5module-support.patch create mode 100644 meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch create mode 100644 meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch create mode 100644 meta/recipes-devtools/python/python/builddir.patch create mode 100644 meta/recipes-devtools/python/python/cgi_py.patch create mode 100644 meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch create mode 100644 meta/recipes-devtools/python/python/ctypes-libffi-aarch64.patch create mode 100644 meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch create mode 100644 meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch create mode 100644 meta/recipes-devtools/python/python/gcc-4.8-fix-configure-Wformat.patch create mode 100644 meta/recipes-devtools/python/python/host_include_contamination.patch create mode 100644 meta/recipes-devtools/python/python/json-flaw-fix.patch create mode 100644 meta/recipes-devtools/python/python/libffi-aarch64.patch create mode 100644 meta/recipes-devtools/python/python/multilib.patch create mode 100644 meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch create mode 100644 meta/recipes-devtools/python/python/posix_close.patch create mode 100644 meta/recipes-devtools/python/python/pypirc-secure.patch create mode 100644 meta/recipes-devtools/python/python/python-2.7.3-CVE-2012-2135.patch create mode 100644 meta/recipes-devtools/python/python/python-2.7.3-CVE-2013-1752-smtplib-fix.patch create mode 100644 meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-1912.patch create mode 100644 meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-7185.patch create mode 100644 meta/recipes-devtools/python/python/python-2.7.3-berkeley-db-5.3.patch create mode 100644 meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch create mode 100644 meta/recipes-devtools/python/python/python-fix-build-error-with-Readline-6.3.patch create mode 100644 meta/recipes-devtools/python/python/python2.7.3-nossl3.patch create mode 100644 meta/recipes-devtools/python/python/remove_sqlite_rpath.patch create mode 100644 meta/recipes-devtools/python/python/run-ptest create mode 100644 meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch create mode 100644 meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch create mode 100644 meta/recipes-devtools/python/python/setuptweaks.patch create mode 100644 meta/recipes-devtools/python/python/sitecustomize.py create mode 100644 meta/recipes-devtools/python/python3-distribute_0.6.32.bb create mode 100644 meta/recipes-devtools/python/python3-native_3.3.3.bb create mode 100644 meta/recipes-devtools/python/python3/000-cross-compile.patch create mode 100644 meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch create mode 100644 meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch create mode 100644 meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch create mode 100644 meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch create mode 100644 meta/recipes-devtools/python/python3/04-default-is-optimized.patch create mode 100644 meta/recipes-devtools/python/python3/06-ctypes-libffi-fix-configure.patch create mode 100644 meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch create mode 100644 meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch create mode 100644 meta/recipes-devtools/python/python3/110-enable-zlib.patch create mode 100644 meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch create mode 100644 meta/recipes-devtools/python/python3/130-readline-setup.patch create mode 100644 meta/recipes-devtools/python/python3/150-fix-setupterm.patch create mode 100644 meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch create mode 100644 meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch create mode 100644 meta/recipes-devtools/python/python3/cgi_py.patch create mode 100644 meta/recipes-devtools/python/python3/fix-ast.h-dependency.patch create mode 100644 meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch create mode 100644 meta/recipes-devtools/python/python3/host_include_contamination.patch create mode 100644 meta/recipes-devtools/python/python3/makerace.patch create mode 100644 meta/recipes-devtools/python/python3/python-3.3-multilib.patch create mode 100644 meta/recipes-devtools/python/python3/python-config.patch create mode 100644 meta/recipes-devtools/python/python3/python3-fix-build-error-with-Readline-6.3.patch create mode 100644 meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch create mode 100644 meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch create mode 100644 meta/recipes-devtools/python/python3/remove_sqlite_rpath.patch create mode 100644 meta/recipes-devtools/python/python3/setuptweaks.patch create mode 100644 meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch create mode 100644 meta/recipes-devtools/python/python3/sitecustomize.py create mode 100644 meta/recipes-devtools/python/python3/sys_platform_is_now_always_linux2.patch create mode 100644 meta/recipes-devtools/python/python3/sysroot-include-headers.patch create mode 100644 meta/recipes-devtools/python/python3/unixccompiler.patch create mode 100644 meta/recipes-devtools/python/python3_3.3.3.bb create mode 100644 meta/recipes-devtools/python/python_2.7.3.bb (limited to 'meta/recipes-devtools/python') diff --git a/meta/recipes-devtools/python/python-2.7-manifest.inc b/meta/recipes-devtools/python/python-2.7-manifest.inc new file mode 100644 index 0000000000..5c2629e851 --- /dev/null +++ b/meta/recipes-devtools/python/python-2.7-manifest.inc @@ -0,0 +1,280 @@ + +# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file. +# Generator: 'scripts/contrib/python/generate-manifest-2.7.py' Version 20110222.2 (C) 2002-2010 Michael 'Mickey' Lauer +# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy + + + +PROVIDES+="${PN}-2to3 ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils ${PN}-distutils-staticdev ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-hotshot ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-zlib " + +PACKAGES="${PN}-dbg ${PN}-2to3 ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils-staticdev ${PN}-distutils ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-hotshot ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-zlib ${PN}-modules" + +SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator" +RDEPENDS_${PN}-2to3="${PN}-core" +FILES_${PN}-2to3="${bindir}/2to3 ${libdir}/python2.7/lib2to3 " + +SUMMARY_${PN}-audio="Python Audio Handling" +RDEPENDS_${PN}-audio="${PN}-core" +FILES_${PN}-audio="${libdir}/python2.7/wave.* ${libdir}/python2.7/chunk.* ${libdir}/python2.7/sndhdr.* ${libdir}/python2.7/lib-dynload/ossaudiodev.so ${libdir}/python2.7/lib-dynload/audioop.so ${libdir}/python2.7/audiodev.* ${libdir}/python2.7/sunaudio.* ${libdir}/python2.7/sunau.* ${libdir}/python2.7/toaiff.* " + +SUMMARY_${PN}-bsddb="Python bindings for the Berkeley Database" +RDEPENDS_${PN}-bsddb="${PN}-core" +FILES_${PN}-bsddb="${libdir}/python2.7/bsddb ${libdir}/python2.7/lib-dynload/_bsddb.so " + +SUMMARY_${PN}-codecs="Python codecs, encodings & i18n support" +RDEPENDS_${PN}-codecs="${PN}-core ${PN}-lang" +FILES_${PN}-codecs="${libdir}/python2.7/codecs.* ${libdir}/python2.7/encodings ${libdir}/python2.7/gettext.* ${libdir}/python2.7/locale.* ${libdir}/python2.7/lib-dynload/_locale.so ${libdir}/python2.7/lib-dynload/_codecs* ${libdir}/python2.7/lib-dynload/_multibytecodec.so ${libdir}/python2.7/lib-dynload/unicodedata.so ${libdir}/python2.7/stringprep.* ${libdir}/python2.7/xdrlib.* " + +SUMMARY_${PN}-compile="Python bytecode compilation support" +RDEPENDS_${PN}-compile="${PN}-core" +FILES_${PN}-compile="${libdir}/python2.7/py_compile.* ${libdir}/python2.7/compileall.* " + +SUMMARY_${PN}-compiler="Python compiler support" +RDEPENDS_${PN}-compiler="${PN}-core" +FILES_${PN}-compiler="${libdir}/python2.7/compiler " + +SUMMARY_${PN}-compression="Python high-level compression support" +RDEPENDS_${PN}-compression="${PN}-core ${PN}-zlib" +FILES_${PN}-compression="${libdir}/python2.7/gzip.* ${libdir}/python2.7/zipfile.* ${libdir}/python2.7/tarfile.* ${libdir}/python2.7/lib-dynload/bz2.so " + +SUMMARY_${PN}-core="Python interpreter and core modules" +RDEPENDS_${PN}-core="${PN}-lang ${PN}-re" +FILES_${PN}-core="${libdir}/python2.7/__future__.* ${libdir}/python2.7/_abcoll.* ${libdir}/python2.7/abc.* ${libdir}/python2.7/copy.* ${libdir}/python2.7/copy_reg.* ${libdir}/python2.7/ConfigParser.* ${libdir}/python2.7/genericpath.* ${libdir}/python2.7/getopt.* ${libdir}/python2.7/linecache.* ${libdir}/python2.7/new.* ${libdir}/python2.7/os.* ${libdir}/python2.7/posixpath.* ${libdir}/python2.7/struct.* ${libdir}/python2.7/warnings.* ${libdir}/python2.7/site.* ${libdir}/python2.7/stat.* ${libdir}/python2.7/UserDict.* ${libdir}/python2.7/UserList.* ${libdir}/python2.7/UserString.* ${libdir}/python2.7/lib-dynload/binascii.so ${libdir}/python2.7/lib-dynload/_struct.so ${libdir}/python2.7/lib-dynload/time.so ${libdir}/python2.7/lib-dynload/xreadlines.so ${libdir}/python2.7/types.* ${libdir}/python2.7/platform.* ${bindir}/python* ${libdir}/python2.7/_weakrefset.* ${libdir}/python2.7/sysconfig.* ${libdir}/python2.7/config/Makefile ${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py " + +SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support" +RDEPENDS_${PN}-crypt="${PN}-core" +FILES_${PN}-crypt="${libdir}/python2.7/hashlib.* ${libdir}/python2.7/md5.* ${libdir}/python2.7/sha.* ${libdir}/python2.7/lib-dynload/crypt.so ${libdir}/python2.7/lib-dynload/_hashlib.so ${libdir}/python2.7/lib-dynload/_sha256.so ${libdir}/python2.7/lib-dynload/_sha512.so " + +SUMMARY_${PN}-ctypes="Python C types support" +RDEPENDS_${PN}-ctypes="${PN}-core" +FILES_${PN}-ctypes="${libdir}/python2.7/ctypes ${libdir}/python2.7/lib-dynload/_ctypes.so ${libdir}/python2.7/lib-dynload/_ctypes_test.so " + +SUMMARY_${PN}-curses="Python curses support" +RDEPENDS_${PN}-curses="${PN}-core" +FILES_${PN}-curses="${libdir}/python2.7/curses ${libdir}/python2.7/lib-dynload/_curses.so ${libdir}/python2.7/lib-dynload/_curses_panel.so " + +SUMMARY_${PN}-datetime="Python calendar and time support" +RDEPENDS_${PN}-datetime="${PN}-core ${PN}-codecs" +FILES_${PN}-datetime="${libdir}/python2.7/_strptime.* ${libdir}/python2.7/calendar.* ${libdir}/python2.7/lib-dynload/datetime.so " + +SUMMARY_${PN}-db="Python file-based database support" +RDEPENDS_${PN}-db="${PN}-core" +FILES_${PN}-db="${libdir}/python2.7/anydbm.* ${libdir}/python2.7/dumbdbm.* ${libdir}/python2.7/whichdb.* " + +SUMMARY_${PN}-debugger="Python debugger" +RDEPENDS_${PN}-debugger="${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint" +FILES_${PN}-debugger="${libdir}/python2.7/bdb.* ${libdir}/python2.7/pdb.* " + +SUMMARY_${PN}-dev="Python development package" +RDEPENDS_${PN}-dev="${PN}-core" +FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig " + +SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects" +RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re" +FILES_${PN}-difflib="${libdir}/python2.7/difflib.* " + +SUMMARY_${PN}-distutils="Python Distribution Utilities" +RDEPENDS_${PN}-distutils="${PN}-core" +FILES_${PN}-distutils="${libdir}/python2.7/config ${libdir}/python2.7/distutils " + +SUMMARY_${PN}-distutils-staticdev="Python distribution utilities (static libraries)" +RDEPENDS_${PN}-distutils-staticdev="${PN}-distutils" +FILES_${PN}-distutils-staticdev="${libdir}/python2.7/config/lib*.a " + +SUMMARY_${PN}-doctest="Python framework for running examples in docstrings" +RDEPENDS_${PN}-doctest="${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib" +FILES_${PN}-doctest="${libdir}/python2.7/doctest.* " + +SUMMARY_${PN}-elementtree="Python elementree" +RDEPENDS_${PN}-elementtree="${PN}-core" +FILES_${PN}-elementtree="${libdir}/python2.7/lib-dynload/_elementtree.so " + +SUMMARY_${PN}-email="Python email support" +RDEPENDS_${PN}-email="${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient" +FILES_${PN}-email="${libdir}/python2.7/imaplib.* ${libdir}/python2.7/email " + +SUMMARY_${PN}-fcntl="Python's fcntl interface" +RDEPENDS_${PN}-fcntl="${PN}-core" +FILES_${PN}-fcntl="${libdir}/python2.7/lib-dynload/fcntl.so " + +SUMMARY_${PN}-gdbm="Python GNU database support" +RDEPENDS_${PN}-gdbm="${PN}-core" +FILES_${PN}-gdbm="${libdir}/python2.7/lib-dynload/gdbm.so " + +SUMMARY_${PN}-hotshot="Python hotshot performance profiler" +RDEPENDS_${PN}-hotshot="${PN}-core" +FILES_${PN}-hotshot="${libdir}/python2.7/hotshot ${libdir}/python2.7/lib-dynload/_hotshot.so " + +SUMMARY_${PN}-html="Python HTML processing support" +RDEPENDS_${PN}-html="${PN}-core" +FILES_${PN}-html="${libdir}/python2.7/formatter.* ${libdir}/python2.7/htmlentitydefs.* ${libdir}/python2.7/htmllib.* ${libdir}/python2.7/markupbase.* ${libdir}/python2.7/sgmllib.* ${libdir}/python2.7/HTMLParser.* " + +SUMMARY_${PN}-idle="Python Integrated Development Environment" +RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter" +FILES_${PN}-idle="${bindir}/idle ${libdir}/python2.7/idlelib " + +SUMMARY_${PN}-image="Python graphical image handling" +RDEPENDS_${PN}-image="${PN}-core" +FILES_${PN}-image="${libdir}/python2.7/colorsys.* ${libdir}/python2.7/imghdr.* ${libdir}/python2.7/lib-dynload/imageop.so ${libdir}/python2.7/lib-dynload/rgbimg.so " + +SUMMARY_${PN}-importlib="Python import implementation library" +RDEPENDS_${PN}-importlib="${PN}-core" +FILES_${PN}-importlib="${libdir}/python2.7/importlib " + +SUMMARY_${PN}-io="Python low-level I/O" +RDEPENDS_${PN}-io="${PN}-core ${PN}-math ${PN}-textutils ${PN}-netclient" +FILES_${PN}-io="${libdir}/python2.7/lib-dynload/_socket.so ${libdir}/python2.7/lib-dynload/_io.so ${libdir}/python2.7/lib-dynload/_ssl.so ${libdir}/python2.7/lib-dynload/select.so ${libdir}/python2.7/lib-dynload/termios.so ${libdir}/python2.7/lib-dynload/cStringIO.so ${libdir}/python2.7/pipes.* ${libdir}/python2.7/socket.* ${libdir}/python2.7/ssl.* ${libdir}/python2.7/tempfile.* ${libdir}/python2.7/StringIO.* ${libdir}/python2.7/io.* ${libdir}/python2.7/_pyio.* " + +SUMMARY_${PN}-json="Python JSON support" +RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re ${PN}-codecs" +FILES_${PN}-json="${libdir}/python2.7/json ${libdir}/python2.7/lib-dynload/_json.so " + +SUMMARY_${PN}-lang="Python low-level language support" +RDEPENDS_${PN}-lang="${PN}-core" +FILES_${PN}-lang="${libdir}/python2.7/lib-dynload/_bisect.so ${libdir}/python2.7/lib-dynload/_collections.so ${libdir}/python2.7/lib-dynload/_heapq.so ${libdir}/python2.7/lib-dynload/_weakref.so ${libdir}/python2.7/lib-dynload/_functools.so ${libdir}/python2.7/lib-dynload/array.so ${libdir}/python2.7/lib-dynload/itertools.so ${libdir}/python2.7/lib-dynload/operator.so ${libdir}/python2.7/lib-dynload/parser.so ${libdir}/python2.7/atexit.* ${libdir}/python2.7/bisect.* ${libdir}/python2.7/code.* ${libdir}/python2.7/codeop.* ${libdir}/python2.7/collections.* ${libdir}/python2.7/dis.* ${libdir}/python2.7/functools.* ${libdir}/python2.7/heapq.* ${libdir}/python2.7/inspect.* ${libdir}/python2.7/keyword.* ${libdir}/python2.7/opcode.* ${libdir}/python2.7/symbol.* ${libdir}/python2.7/repr.* ${libdir}/python2.7/token.* ${libdir}/python2.7/tokenize.* ${libdir}/python2.7/traceback.* ${libdir}/python2.7/weakref.* " + +SUMMARY_${PN}-logging="Python logging support" +RDEPENDS_${PN}-logging="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold" +FILES_${PN}-logging="${libdir}/python2.7/logging " + +SUMMARY_${PN}-mailbox="Python mailbox format support" +RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime" +FILES_${PN}-mailbox="${libdir}/python2.7/mailbox.* " + +SUMMARY_${PN}-math="Python math support" +RDEPENDS_${PN}-math="${PN}-core ${PN}-crypt" +FILES_${PN}-math="${libdir}/python2.7/lib-dynload/cmath.so ${libdir}/python2.7/lib-dynload/math.so ${libdir}/python2.7/lib-dynload/_random.so ${libdir}/python2.7/random.* ${libdir}/python2.7/sets.* " + +SUMMARY_${PN}-mime="Python MIME handling APIs" +RDEPENDS_${PN}-mime="${PN}-core ${PN}-io" +FILES_${PN}-mime="${libdir}/python2.7/mimetools.* ${libdir}/python2.7/uu.* ${libdir}/python2.7/quopri.* ${libdir}/python2.7/rfc822.* ${libdir}/python2.7/MimeWriter.* " + +SUMMARY_${PN}-mmap="Python memory-mapped file support" +RDEPENDS_${PN}-mmap="${PN}-core ${PN}-io" +FILES_${PN}-mmap="${libdir}/python2.7/lib-dynload/mmap.so " + +SUMMARY_${PN}-multiprocessing="Python multiprocessing support" +RDEPENDS_${PN}-multiprocessing="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap" +FILES_${PN}-multiprocessing="${libdir}/python2.7/lib-dynload/_multiprocessing.so ${libdir}/python2.7/multiprocessing " + +SUMMARY_${PN}-netclient="Python Internet Protocol clients" +RDEPENDS_${PN}-netclient="${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime" +FILES_${PN}-netclient="${libdir}/python2.7/*Cookie*.* ${libdir}/python2.7/base64.* ${libdir}/python2.7/cookielib.* ${libdir}/python2.7/ftplib.* ${libdir}/python2.7/gopherlib.* ${libdir}/python2.7/hmac.* ${libdir}/python2.7/httplib.* ${libdir}/python2.7/mimetypes.* ${libdir}/python2.7/nntplib.* ${libdir}/python2.7/poplib.* ${libdir}/python2.7/smtplib.* ${libdir}/python2.7/telnetlib.* ${libdir}/python2.7/urllib.* ${libdir}/python2.7/urllib2.* ${libdir}/python2.7/urlparse.* ${libdir}/python2.7/uuid.* ${libdir}/python2.7/rfc822.* ${libdir}/python2.7/mimetools.* " + +SUMMARY_${PN}-netserver="Python Internet Protocol servers" +RDEPENDS_${PN}-netserver="${PN}-core ${PN}-netclient" +FILES_${PN}-netserver="${libdir}/python2.7/cgi.* ${libdir}/python2.7/*HTTPServer.* ${libdir}/python2.7/SocketServer.* " + +SUMMARY_${PN}-numbers="Python number APIs" +RDEPENDS_${PN}-numbers="${PN}-core ${PN}-lang ${PN}-re" +FILES_${PN}-numbers="${libdir}/python2.7/decimal.* ${libdir}/python2.7/numbers.* " + +SUMMARY_${PN}-pickle="Python serialisation/persistence support" +RDEPENDS_${PN}-pickle="${PN}-core ${PN}-codecs ${PN}-io ${PN}-re" +FILES_${PN}-pickle="${libdir}/python2.7/pickle.* ${libdir}/python2.7/shelve.* ${libdir}/python2.7/lib-dynload/cPickle.so ${libdir}/python2.7/pickletools.* " + +SUMMARY_${PN}-pkgutil="Python package extension utility support" +RDEPENDS_${PN}-pkgutil="${PN}-core" +FILES_${PN}-pkgutil="${libdir}/python2.7/pkgutil.* " + +SUMMARY_${PN}-pprint="Python pretty-print support" +RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io" +FILES_${PN}-pprint="${libdir}/python2.7/pprint.* " + +SUMMARY_${PN}-profile="Python basic performance profiling support" +RDEPENDS_${PN}-profile="${PN}-core ${PN}-textutils" +FILES_${PN}-profile="${libdir}/python2.7/profile.* ${libdir}/python2.7/pstats.* ${libdir}/python2.7/cProfile.* ${libdir}/python2.7/lib-dynload/_lsprof.so " + +SUMMARY_${PN}-pydoc="Python interactive help support" +RDEPENDS_${PN}-pydoc="${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re" +FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python2.7/pydoc.* ${libdir}/python2.7/pydoc_data " + +SUMMARY_${PN}-re="Python Regular Expression APIs" +RDEPENDS_${PN}-re="${PN}-core" +FILES_${PN}-re="${libdir}/python2.7/re.* ${libdir}/python2.7/sre.* ${libdir}/python2.7/sre_compile.* ${libdir}/python2.7/sre_constants* ${libdir}/python2.7/sre_parse.* " + +SUMMARY_${PN}-readline="Python readline support" +RDEPENDS_${PN}-readline="${PN}-core" +FILES_${PN}-readline="${libdir}/python2.7/lib-dynload/readline.so ${libdir}/python2.7/rlcompleter.* " + +SUMMARY_${PN}-resource="Python resource control interface" +RDEPENDS_${PN}-resource="${PN}-core" +FILES_${PN}-resource="${libdir}/python2.7/lib-dynload/resource.so " + +SUMMARY_${PN}-robotparser="Python robots.txt parser" +RDEPENDS_${PN}-robotparser="${PN}-core ${PN}-netclient" +FILES_${PN}-robotparser="${libdir}/python2.7/robotparser.* " + +SUMMARY_${PN}-shell="Python shell-like functionality" +RDEPENDS_${PN}-shell="${PN}-core ${PN}-re" +FILES_${PN}-shell="${libdir}/python2.7/cmd.* ${libdir}/python2.7/commands.* ${libdir}/python2.7/dircache.* ${libdir}/python2.7/fnmatch.* ${libdir}/python2.7/glob.* ${libdir}/python2.7/popen2.* ${libdir}/python2.7/shlex.* ${libdir}/python2.7/shutil.* " + +SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon" +RDEPENDS_${PN}-smtpd="${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime" +FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python2.7/smtpd.* " + +SUMMARY_${PN}-sqlite3="Python Sqlite3 database support" +RDEPENDS_${PN}-sqlite3="${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading ${PN}-zlib" +FILES_${PN}-sqlite3="${libdir}/python2.7/lib-dynload/_sqlite3.so ${libdir}/python2.7/sqlite3/dbapi2.* ${libdir}/python2.7/sqlite3/__init__.* ${libdir}/python2.7/sqlite3/dump.* " + +SUMMARY_${PN}-sqlite3-tests="Python Sqlite3 database support tests" +RDEPENDS_${PN}-sqlite3-tests="${PN}-core ${PN}-sqlite3" +FILES_${PN}-sqlite3-tests="${libdir}/python2.7/sqlite3/test " + +SUMMARY_${PN}-stringold="Python string APIs [deprecated]" +RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re" +FILES_${PN}-stringold="${libdir}/python2.7/lib-dynload/strop.so ${libdir}/python2.7/string.* ${libdir}/python2.7/stringold.* " + +SUMMARY_${PN}-subprocess="Python subprocess support" +RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle" +FILES_${PN}-subprocess="${libdir}/python2.7/subprocess.* " + +SUMMARY_${PN}-syslog="Python syslog interface" +RDEPENDS_${PN}-syslog="${PN}-core" +FILES_${PN}-syslog="${libdir}/python2.7/lib-dynload/syslog.so " + +SUMMARY_${PN}-terminal="Python terminal controlling support" +RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io" +FILES_${PN}-terminal="${libdir}/python2.7/pty.* ${libdir}/python2.7/tty.* " + +SUMMARY_${PN}-tests="Python tests" +RDEPENDS_${PN}-tests="${PN}-core" +FILES_${PN}-tests="${libdir}/python2.7/test " + +SUMMARY_${PN}-textutils="Python option parsing, text wrapping and CSV support" +RDEPENDS_${PN}-textutils="${PN}-core ${PN}-io ${PN}-re ${PN}-stringold" +FILES_${PN}-textutils="${libdir}/python2.7/lib-dynload/_csv.so ${libdir}/python2.7/csv.* ${libdir}/python2.7/optparse.* ${libdir}/python2.7/textwrap.* " + +SUMMARY_${PN}-threading="Python threading & synchronization support" +RDEPENDS_${PN}-threading="${PN}-core ${PN}-lang" +FILES_${PN}-threading="${libdir}/python2.7/_threading_local.* ${libdir}/python2.7/dummy_thread.* ${libdir}/python2.7/dummy_threading.* ${libdir}/python2.7/mutex.* ${libdir}/python2.7/threading.* ${libdir}/python2.7/Queue.* " + +SUMMARY_${PN}-tkinter="Python Tcl/Tk bindings" +RDEPENDS_${PN}-tkinter="${PN}-core" +FILES_${PN}-tkinter="${libdir}/python2.7/lib-dynload/_tkinter.so ${libdir}/python2.7/lib-tk " + +SUMMARY_${PN}-unittest="Python unit testing framework" +RDEPENDS_${PN}-unittest="${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell" +FILES_${PN}-unittest="${libdir}/python2.7/unittest/ " + +SUMMARY_${PN}-unixadmin="Python Unix administration support" +RDEPENDS_${PN}-unixadmin="${PN}-core" +FILES_${PN}-unixadmin="${libdir}/python2.7/lib-dynload/nis.so ${libdir}/python2.7/lib-dynload/grp.so ${libdir}/python2.7/lib-dynload/pwd.so ${libdir}/python2.7/getpass.* " + +SUMMARY_${PN}-xml="Python basic XML support" +RDEPENDS_${PN}-xml="${PN}-core ${PN}-elementtree ${PN}-re" +FILES_${PN}-xml="${libdir}/python2.7/lib-dynload/pyexpat.so ${libdir}/python2.7/xml ${libdir}/python2.7/xmllib.* " + +SUMMARY_${PN}-xmlrpc="Python XML-RPC support" +RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang" +FILES_${PN}-xmlrpc="${libdir}/python2.7/xmlrpclib.* ${libdir}/python2.7/SimpleXMLRPCServer.* ${libdir}/python2.7/DocXMLRPCServer.* " + +SUMMARY_${PN}-zlib="Python zlib compression support" +RDEPENDS_${PN}-zlib="${PN}-core" +FILES_${PN}-zlib="${libdir}/python2.7/lib-dynload/zlib.so " + +SUMMARY_${PN}-modules="All Python modules" +RDEPENDS_${PN}-modules="${PN}-2to3 ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-difflib ${PN}-distutils ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-hotshot ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-zlib " +ALLOW_EMPTY_${PN}-modules = "1" + + diff --git a/meta/recipes-devtools/python/python-3.3-manifest.inc b/meta/recipes-devtools/python/python-3.3-manifest.inc new file mode 100644 index 0000000000..61119c687c --- /dev/null +++ b/meta/recipes-devtools/python/python-3.3-manifest.inc @@ -0,0 +1,268 @@ + +# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file. +# Generator: '../../../scripts/contrib/python/generate-manifest-3.3.py' Version 20140131 (C) 2002-2010 Michael 'Mickey' Lauer +# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy + + + +PROVIDES+="${PN}-2to3 ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils ${PN}-distutils-staticdev ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc " + +PACKAGES="${PN}-dbg ${PN}-2to3 ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils-staticdev ${PN}-distutils ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-modules" + +SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator" +RDEPENDS_${PN}-2to3="${PN}-core" +FILES_${PN}-2to3="${bindir}/2to3 ${libdir}/python3.3/lib2to3 " + +SUMMARY_${PN}-audio="Python Audio Handling" +RDEPENDS_${PN}-audio="${PN}-core" +FILES_${PN}-audio="${libdir}/python3.3/wave.* ${libdir}/python3.3/chunk.* ${libdir}/python3.3/sndhdr.* ${libdir}/python3.3/lib-dynload/ossaudiodev.*.so ${libdir}/python3.3/lib-dynload/audioop.*.so ${libdir}/python3.3/audiodev.* ${libdir}/python3.3/sunaudio.* ${libdir}/python3.3/sunau.* ${libdir}/python3.3/toaiff.* " + +SUMMARY_${PN}-codecs="Python codecs, encodings & i18n support" +RDEPENDS_${PN}-codecs="${PN}-core ${PN}-lang" +FILES_${PN}-codecs="${libdir}/python3.3/codecs.* ${libdir}/python3.3/encodings ${libdir}/python3.3/gettext.* ${libdir}/python3.3/locale.* ${libdir}/python3.3/lib-dynload/_locale.*.so ${libdir}/python3.3/lib-dynload/_codecs* ${libdir}/python3.3/lib-dynload/_multibytecodec.*.so ${libdir}/python3.3/lib-dynload/unicodedata.*.so ${libdir}/python3.3/stringprep.* ${libdir}/python3.3/xdrlib.* " + +SUMMARY_${PN}-compile="Python bytecode compilation support" +RDEPENDS_${PN}-compile="${PN}-core" +FILES_${PN}-compile="${libdir}/python3.3/py_compile.* ${libdir}/python3.3/compileall.* " + +SUMMARY_${PN}-compression="Python high-level compression support" +RDEPENDS_${PN}-compression="${PN}-core ${PN}-codecs" +FILES_${PN}-compression="${libdir}/python3.3/gzip.* ${libdir}/python3.3/zipfile.* ${libdir}/python3.3/tarfile.* ${libdir}/python3.3/lib-dynload/bz2.*.so " + +SUMMARY_${PN}-core="Python interpreter and core modules" +RDEPENDS_${PN}-core="${PN}-lang ${PN}-re ${PN}-reprlib ${PN}-codecs ${PN}-io ${PN}-math" +FILES_${PN}-core="${libdir}/python3.3/__future__.* ${libdir}/python3.3/_abcoll.* ${libdir}/python3.3/abc.* ${libdir}/python3.3/copy.* ${libdir}/python3.3/copyreg.* ${libdir}/python3.3/ConfigParser.* ${libdir}/python3.3/genericpath.* ${libdir}/python3.3/getopt.* ${libdir}/python3.3/linecache.* ${libdir}/python3.3/new.* ${libdir}/python3.3/os.* ${libdir}/python3.3/posixpath.* ${libdir}/python3.3/struct.* ${libdir}/python3.3/warnings.* ${libdir}/python3.3/site.* ${libdir}/python3.3/stat.* ${libdir}/python3.3/UserDict.* ${libdir}/python3.3/UserList.* ${libdir}/python3.3/UserString.* ${libdir}/python3.3/lib-dynload/binascii.*.so ${libdir}/python3.3/lib-dynload/_struct.*.so ${libdir}/python3.3/lib-dynload/time.*.so ${libdir}/python3.3/lib-dynload/xreadlines.*.so ${libdir}/python3.3/types.* ${libdir}/python3.3/platform.* ${bindir}/python* ${libdir}/python3.3/_weakrefset.* ${libdir}/python3.3/sysconfig.* ${libdir}/python3.3/_sysconfigdata.* ${libdir}/python3.3/config/Makefile ${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h ${libdir}/python${PYTHON_MAJMIN}/collections ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py " + +SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support" +RDEPENDS_${PN}-crypt="${PN}-core" +FILES_${PN}-crypt="${libdir}/python3.3/hashlib.* ${libdir}/python3.3/md5.* ${libdir}/python3.3/sha.* ${libdir}/python3.3/lib-dynload/crypt.*.so ${libdir}/python3.3/lib-dynload/_hashlib.*.so ${libdir}/python3.3/lib-dynload/_sha256.*.so ${libdir}/python3.3/lib-dynload/_sha512.*.so " + +SUMMARY_${PN}-ctypes="Python C types support" +RDEPENDS_${PN}-ctypes="${PN}-core" +FILES_${PN}-ctypes="${libdir}/python3.3/ctypes ${libdir}/python3.3/lib-dynload/_ctypes.*.so ${libdir}/python3.3/lib-dynload/_ctypes_test.*.so " + +SUMMARY_${PN}-curses="Python curses support" +RDEPENDS_${PN}-curses="${PN}-core" +FILES_${PN}-curses="${libdir}/python3.3/curses ${libdir}/python3.3/lib-dynload/_curses.*.so ${libdir}/python3.3/lib-dynload/_curses_panel.*.so " + +SUMMARY_${PN}-datetime="Python calendar and time support" +RDEPENDS_${PN}-datetime="${PN}-core ${PN}-codecs" +FILES_${PN}-datetime="${libdir}/python3.3/_strptime.* ${libdir}/python3.3/calendar.* ${libdir}/python3.3/lib-dynload/datetime.*.so " + +SUMMARY_${PN}-db="Python file-based database support" +RDEPENDS_${PN}-db="${PN}-core" +FILES_${PN}-db="${libdir}/python3.3/anydbm.* ${libdir}/python3.3/dumbdbm.* ${libdir}/python3.3/whichdb.* ${libdir}/python3.3/dbm ${libdir}/python3.3/lib-dynload/_dbm.*.so " + +SUMMARY_${PN}-debugger="Python debugger" +RDEPENDS_${PN}-debugger="${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint" +FILES_${PN}-debugger="${libdir}/python3.3/bdb.* ${libdir}/python3.3/pdb.* " + +SUMMARY_${PN}-dev="Python development package" +RDEPENDS_${PN}-dev="${PN}-core" +FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig " + +SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects" +RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re" +FILES_${PN}-difflib="${libdir}/python3.3/difflib.* " + +SUMMARY_${PN}-distutils="Python Distribution Utilities" +RDEPENDS_${PN}-distutils="${PN}-core" +FILES_${PN}-distutils="${libdir}/python3.3/config ${libdir}/python3.3/distutils " + +SUMMARY_${PN}-distutils-staticdev="Python distribution utilities (static libraries)" +RDEPENDS_${PN}-distutils-staticdev="${PN}-distutils" +FILES_${PN}-distutils-staticdev="${libdir}/python3.3/config/lib*.a " + +SUMMARY_${PN}-doctest="Python framework for running examples in docstrings" +RDEPENDS_${PN}-doctest="${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib" +FILES_${PN}-doctest="${libdir}/python3.3/doctest.* " + +SUMMARY_${PN}-elementtree="Python elementree" +RDEPENDS_${PN}-elementtree="${PN}-core" +FILES_${PN}-elementtree="${libdir}/python3.3/lib-dynload/_elementtree.*.so " + +SUMMARY_${PN}-email="Python email support" +RDEPENDS_${PN}-email="${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient" +FILES_${PN}-email="${libdir}/python3.3/imaplib.* ${libdir}/python3.3/email " + +SUMMARY_${PN}-fcntl="Python's fcntl interface" +RDEPENDS_${PN}-fcntl="${PN}-core" +FILES_${PN}-fcntl="${libdir}/python3.3/lib-dynload/fcntl.*.so " + +SUMMARY_${PN}-gdbm="Python GNU database support" +RDEPENDS_${PN}-gdbm="${PN}-core" +FILES_${PN}-gdbm="${libdir}/python3.3/lib-dynload/_gdbm.*.so " + +SUMMARY_${PN}-html="Python HTML processing support" +RDEPENDS_${PN}-html="${PN}-core" +FILES_${PN}-html="${libdir}/python3.3/formatter.* ${libdir}/python3.3/htmlentitydefs.* ${libdir}/python3.3/htmllib.* ${libdir}/python3.3/markupbase.* ${libdir}/python3.3/sgmllib.* ${libdir}/python3.3/HTMLParser.* " + +SUMMARY_${PN}-idle="Python Integrated Development Environment" +RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter" +FILES_${PN}-idle="${bindir}/idle ${libdir}/python3.3/idlelib " + +SUMMARY_${PN}-image="Python graphical image handling" +RDEPENDS_${PN}-image="${PN}-core" +FILES_${PN}-image="${libdir}/python3.3/colorsys.* ${libdir}/python3.3/imghdr.* ${libdir}/python3.3/lib-dynload/imageop.*.so ${libdir}/python3.3/lib-dynload/rgbimg.*.so " + +SUMMARY_${PN}-importlib="Python import implementation library" +RDEPENDS_${PN}-importlib="${PN}-core" +FILES_${PN}-importlib="${libdir}/python3.3/importlib " + +SUMMARY_${PN}-io="Python low-level I/O" +RDEPENDS_${PN}-io="${PN}-core ${PN}-math" +FILES_${PN}-io="${libdir}/python3.3/lib-dynload/_socket.*.so ${libdir}/python3.3/lib-dynload/_io.*.so ${libdir}/python3.3/lib-dynload/_ssl.*.so ${libdir}/python3.3/lib-dynload/select.*.so ${libdir}/python3.3/lib-dynload/termios.*.so ${libdir}/python3.3/lib-dynload/cStringIO.*.so ${libdir}/python3.3/pipes.* ${libdir}/python3.3/socket.* ${libdir}/python3.3/ssl.* ${libdir}/python3.3/tempfile.* ${libdir}/python3.3/StringIO.* ${libdir}/python3.3/io.* ${libdir}/python3.3/_pyio.* " + +SUMMARY_${PN}-json="Python JSON support" +RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re" +FILES_${PN}-json="${libdir}/python3.3/json ${libdir}/python3.3/lib-dynload/_json.*.so " + +SUMMARY_${PN}-lang="Python low-level language support" +RDEPENDS_${PN}-lang="${PN}-core" +FILES_${PN}-lang="${libdir}/python3.3/lib-dynload/_bisect.*.so ${libdir}/python3.3/lib-dynload/_collections.*.so ${libdir}/python3.3/lib-dynload/_heapq.*.so ${libdir}/python3.3/lib-dynload/_weakref.*.so ${libdir}/python3.3/lib-dynload/_functools.*.so ${libdir}/python3.3/lib-dynload/array.*.so ${libdir}/python3.3/lib-dynload/itertools.*.so ${libdir}/python3.3/lib-dynload/operator.*.so ${libdir}/python3.3/lib-dynload/parser.*.so ${libdir}/python3.3/atexit.* ${libdir}/python3.3/bisect.* ${libdir}/python3.3/code.* ${libdir}/python3.3/codeop.* ${libdir}/python3.3/collections.* ${libdir}/python3.3/dis.* ${libdir}/python3.3/functools.* ${libdir}/python3.3/heapq.* ${libdir}/python3.3/inspect.* ${libdir}/python3.3/keyword.* ${libdir}/python3.3/opcode.* ${libdir}/python3.3/symbol.* ${libdir}/python3.3/repr.* ${libdir}/python3.3/token.* ${libdir}/python3.3/tokenize.* ${libdir}/python3.3/traceback.* ${libdir}/python3.3/weakref.* " + +SUMMARY_${PN}-logging="Python logging support" +RDEPENDS_${PN}-logging="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold" +FILES_${PN}-logging="${libdir}/python3.3/logging " + +SUMMARY_${PN}-mailbox="Python mailbox format support" +RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime" +FILES_${PN}-mailbox="${libdir}/python3.3/mailbox.* " + +SUMMARY_${PN}-math="Python math support" +RDEPENDS_${PN}-math="${PN}-core" +FILES_${PN}-math="${libdir}/python3.3/lib-dynload/cmath.*.so ${libdir}/python3.3/lib-dynload/math.*.so ${libdir}/python3.3/lib-dynload/_random.*.so ${libdir}/python3.3/random.* ${libdir}/python3.3/sets.* " + +SUMMARY_${PN}-mime="Python MIME handling APIs" +RDEPENDS_${PN}-mime="${PN}-core ${PN}-io" +FILES_${PN}-mime="${libdir}/python3.3/mimetools.* ${libdir}/python3.3/uu.* ${libdir}/python3.3/quopri.* ${libdir}/python3.3/rfc822.* ${libdir}/python3.3/MimeWriter.* " + +SUMMARY_${PN}-mmap="Python memory-mapped file support" +RDEPENDS_${PN}-mmap="${PN}-core ${PN}-io" +FILES_${PN}-mmap="${libdir}/python3.3/lib-dynload/mmap.*.so " + +SUMMARY_${PN}-multiprocessing="Python multiprocessing support" +RDEPENDS_${PN}-multiprocessing="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap" +FILES_${PN}-multiprocessing="${libdir}/python3.3/lib-dynload/_multiprocessing.*.so ${libdir}/python3.3/multiprocessing " + +SUMMARY_${PN}-netclient="Python Internet Protocol clients" +RDEPENDS_${PN}-netclient="${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime" +FILES_${PN}-netclient="${libdir}/python3.3/*Cookie*.* ${libdir}/python3.3/base64.* ${libdir}/python3.3/cookielib.* ${libdir}/python3.3/ftplib.* ${libdir}/python3.3/gopherlib.* ${libdir}/python3.3/hmac.* ${libdir}/python3.3/httplib.* ${libdir}/python3.3/mimetypes.* ${libdir}/python3.3/nntplib.* ${libdir}/python3.3/poplib.* ${libdir}/python3.3/smtplib.* ${libdir}/python3.3/telnetlib.* ${libdir}/python3.3/urllib.* ${libdir}/python3.3/urllib2.* ${libdir}/python3.3/urlparse.* ${libdir}/python3.3/uuid.* ${libdir}/python3.3/rfc822.* ${libdir}/python3.3/mimetools.* " + +SUMMARY_${PN}-netserver="Python Internet Protocol servers" +RDEPENDS_${PN}-netserver="${PN}-core ${PN}-netclient" +FILES_${PN}-netserver="${libdir}/python3.3/cgi.* ${libdir}/python3.3/*HTTPServer.* ${libdir}/python3.3/SocketServer.* " + +SUMMARY_${PN}-numbers="Python number APIs" +RDEPENDS_${PN}-numbers="${PN}-core ${PN}-lang ${PN}-re" +FILES_${PN}-numbers="${libdir}/python3.3/decimal.* ${libdir}/python3.3/numbers.* " + +SUMMARY_${PN}-pickle="Python serialisation/persistence support" +RDEPENDS_${PN}-pickle="${PN}-core ${PN}-codecs ${PN}-io ${PN}-re" +FILES_${PN}-pickle="${libdir}/python3.3/pickle.* ${libdir}/python3.3/shelve.* ${libdir}/python3.3/lib-dynload/cPickle.*.so ${libdir}/python3.3/pickletools.* " + +SUMMARY_${PN}-pkgutil="Python package extension utility support" +RDEPENDS_${PN}-pkgutil="${PN}-core" +FILES_${PN}-pkgutil="${libdir}/python3.3/pkgutil.* " + +SUMMARY_${PN}-pprint="Python pretty-print support" +RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io" +FILES_${PN}-pprint="${libdir}/python3.3/pprint.* " + +SUMMARY_${PN}-profile="Python basic performance profiling support" +RDEPENDS_${PN}-profile="${PN}-core ${PN}-textutils" +FILES_${PN}-profile="${libdir}/python3.3/profile.* ${libdir}/python3.3/pstats.* ${libdir}/python3.3/cProfile.* ${libdir}/python3.3/lib-dynload/_lsprof.*.so " + +SUMMARY_${PN}-pydoc="Python interactive help support" +RDEPENDS_${PN}-pydoc="${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re" +FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python3.3/pydoc.* ${libdir}/python3.3/pydoc_data " + +SUMMARY_${PN}-re="Python Regular Expression APIs" +RDEPENDS_${PN}-re="${PN}-core" +FILES_${PN}-re="${libdir}/python3.3/re.* ${libdir}/python3.3/sre.* ${libdir}/python3.3/sre_compile.* ${libdir}/python3.3/sre_constants* ${libdir}/python3.3/sre_parse.* " + +SUMMARY_${PN}-readline="Python readline support" +RDEPENDS_${PN}-readline="${PN}-core" +FILES_${PN}-readline="${libdir}/python3.3/lib-dynload/readline.*.so ${libdir}/python3.3/rlcompleter.* " + +SUMMARY_${PN}-reprlib="Python alternate repr() implementation" +RDEPENDS_${PN}-reprlib="${PN}-core" +FILES_${PN}-reprlib="${libdir}/python3.3/reprlib.py " + +SUMMARY_${PN}-resource="Python resource control interface" +RDEPENDS_${PN}-resource="${PN}-core" +FILES_${PN}-resource="${libdir}/python3.3/lib-dynload/resource.*.so " + +SUMMARY_${PN}-robotparser="Python robots.txt parser" +RDEPENDS_${PN}-robotparser="${PN}-core ${PN}-netclient" +FILES_${PN}-robotparser="${libdir}/python3.3/urllib/robotparser.* " + +SUMMARY_${PN}-shell="Python shell-like functionality" +RDEPENDS_${PN}-shell="${PN}-core ${PN}-re" +FILES_${PN}-shell="${libdir}/python3.3/cmd.* ${libdir}/python3.3/commands.* ${libdir}/python3.3/dircache.* ${libdir}/python3.3/fnmatch.* ${libdir}/python3.3/glob.* ${libdir}/python3.3/popen2.* ${libdir}/python3.3/shlex.* ${libdir}/python3.3/shutil.* " + +SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon" +RDEPENDS_${PN}-smtpd="${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime" +FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python3.3/smtpd.* " + +SUMMARY_${PN}-sqlite3="Python Sqlite3 database support" +RDEPENDS_${PN}-sqlite3="${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading" +FILES_${PN}-sqlite3="${libdir}/python3.3/lib-dynload/_sqlite3.*.so ${libdir}/python3.3/sqlite3/dbapi2.* ${libdir}/python3.3/sqlite3/__init__.* ${libdir}/python3.3/sqlite3/dump.* " + +SUMMARY_${PN}-sqlite3-tests="Python Sqlite3 database support tests" +RDEPENDS_${PN}-sqlite3-tests="${PN}-core ${PN}-sqlite3" +FILES_${PN}-sqlite3-tests="${libdir}/python3.3/sqlite3/test " + +SUMMARY_${PN}-stringold="Python string APIs [deprecated]" +RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re" +FILES_${PN}-stringold="${libdir}/python3.3/lib-dynload/strop.*.so ${libdir}/python3.3/string.* ${libdir}/python3.3/stringold.* " + +SUMMARY_${PN}-subprocess="Python subprocess support" +RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle" +FILES_${PN}-subprocess="${libdir}/python3.3/subprocess.* " + +SUMMARY_${PN}-syslog="Python syslog interface" +RDEPENDS_${PN}-syslog="${PN}-core" +FILES_${PN}-syslog="${libdir}/python3.3/lib-dynload/syslog.*.so " + +SUMMARY_${PN}-terminal="Python terminal controlling support" +RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io" +FILES_${PN}-terminal="${libdir}/python3.3/pty.* ${libdir}/python3.3/tty.* " + +SUMMARY_${PN}-tests="Python tests" +RDEPENDS_${PN}-tests="${PN}-core" +FILES_${PN}-tests="${libdir}/python3.3/test " + +SUMMARY_${PN}-textutils="Python option parsing, text wrapping and CSV support" +RDEPENDS_${PN}-textutils="${PN}-core ${PN}-io ${PN}-re ${PN}-stringold" +FILES_${PN}-textutils="${libdir}/python3.3/lib-dynload/_csv.*.so ${libdir}/python3.3/csv.* ${libdir}/python3.3/optparse.* ${libdir}/python3.3/textwrap.* " + +SUMMARY_${PN}-threading="Python threading & synchronization support" +RDEPENDS_${PN}-threading="${PN}-core ${PN}-lang" +FILES_${PN}-threading="${libdir}/python3.3/_threading_local.* ${libdir}/python3.3/dummy_thread.* ${libdir}/python3.3/dummy_threading.* ${libdir}/python3.3/mutex.* ${libdir}/python3.3/threading.* ${libdir}/python3.3/Queue.* " + +SUMMARY_${PN}-tkinter="Python Tcl/Tk bindings" +RDEPENDS_${PN}-tkinter="${PN}-core" +FILES_${PN}-tkinter="${libdir}/python3.3/lib-dynload/_tkinter.*.so ${libdir}/python3.3/lib-tk ${libdir}/python3.3/tkinter " + +SUMMARY_${PN}-unittest="Python unit testing framework" +RDEPENDS_${PN}-unittest="${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell" +FILES_${PN}-unittest="${libdir}/python3.3/unittest/ " + +SUMMARY_${PN}-unixadmin="Python Unix administration support" +RDEPENDS_${PN}-unixadmin="${PN}-core" +FILES_${PN}-unixadmin="${libdir}/python3.3/lib-dynload/nis.*.so ${libdir}/python3.3/lib-dynload/grp.*.so ${libdir}/python3.3/lib-dynload/pwd.*.so ${libdir}/python3.3/getpass.* " + +SUMMARY_${PN}-xml="Python basic XML support" +RDEPENDS_${PN}-xml="${PN}-core ${PN}-elementtree ${PN}-re" +FILES_${PN}-xml="${libdir}/python3.3/lib-dynload/pyexpat.*.so ${libdir}/python3.3/xml ${libdir}/python3.3/xmllib.* " + +SUMMARY_${PN}-xmlrpc="Python XML-RPC support" +RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang" +FILES_${PN}-xmlrpc="${libdir}/python3.3/xmlrpclib.* ${libdir}/python3.3/SimpleXMLRPCServer.* ${libdir}/python3.3/DocXMLRPCServer.* ${libdir}/python3.3/xmlrpc " + +SUMMARY_${PN}-modules="All Python modules" +RDEPENDS_${PN}-modules="${PN}-2to3 ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-difflib ${PN}-distutils ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc " +ALLOW_EMPTY_${PN}-modules = "1" + + diff --git a/meta/recipes-devtools/python/python-argparse_1.2.1.bb b/meta/recipes-devtools/python/python-argparse_1.2.1.bb new file mode 100644 index 0000000000..b2850a3831 --- /dev/null +++ b/meta/recipes-devtools/python/python-argparse_1.2.1.bb @@ -0,0 +1,17 @@ +SUMMARY = "Python command-line parsing library" +SECTION = "devel/python" +LICENSE = "PSF" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=09d08bb5b7047e2688ea3faad6408aa8" +SRCNAME = "argparse" +PR = "r4" +RDEPENDS_${PN} += "python-codecs python-textutils" + +SRC_URI = "http://argparse.googlecode.com/files/${SRCNAME}-${PV}.tar.gz" +SRC_URI[md5sum] = "2fbef8cb61e506c706957ab6e135840c" +SRC_URI[sha256sum] = "ddaf4b0a618335a32b6664d4ae038a1de8fbada3b25033f9021510ed2b3941a4" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +inherit setuptools + +BBCLASSEXTEND = "native" diff --git a/meta/recipes-devtools/python/python-async_0.6.1.bb b/meta/recipes-devtools/python/python-async_0.6.1.bb new file mode 100644 index 0000000000..17948200e5 --- /dev/null +++ b/meta/recipes-devtools/python/python-async_0.6.1.bb @@ -0,0 +1,17 @@ +SUMMARY = "Python framework to process interdependent tasks in a pool of workers" +HOMEPAGE = "http://github.com/gitpython-developers/async" +SECTION = "devel/python" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=88df8e78b9edfd744953862179f2d14e" + +SRC_URI = "http://pypi.python.org/packages/source/a/async/async-${PV}.tar.gz" +SRC_URI[md5sum] = "6f0e2ced1fe85f8410b9bde11be08587" +SRC_URI[sha256sum] = "41d14cc0456e03f34d13af284f65821d07d05c20e621bcaebd38f9ab5095d5d1" + +S = "${WORKDIR}/async-${PV}" + +inherit distutils + +RDEPENDS_${PN} += "python-threading python-lang" + +BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-devtools/python/python-dbus_1.2.0.bb b/meta/recipes-devtools/python/python-dbus_1.2.0.bb new file mode 100644 index 0000000000..b314dce1c7 --- /dev/null +++ b/meta/recipes-devtools/python/python-dbus_1.2.0.bb @@ -0,0 +1,29 @@ +SUMMARY = "Python bindings for the DBus inter-process communication system" +SECTION = "devel/python" +HOMEPAGE = "http://www.freedesktop.org/Software/dbus" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=0b83047ce9e948b67c0facc5f233476a" +DEPENDS = "expat dbus dbus-glib virtual/libintl python-pyrex-native" + +SRC_URI = "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-${PV}.tar.gz \ +" + +SRC_URI[md5sum] = "b09cd2d1a057cc432ce944de3fc06bf7" +SRC_URI[sha256sum] = "e12c6c8b2bf3a9302f75166952cbe41d6b38c3441bbc6767dbd498942316c6df" +S = "${WORKDIR}/dbus-python-${PV}" + +inherit distutils-base autotools pkgconfig + +PACKAGECONFIG ?= "" +PACKAGECONFIG[docs] = "--enable-html-docs,--disable-html-docs,python-docutils-native" +PACKAGECONFIG[api-docs] = "--enable-api-docs,--disable-api-docs,python-docutils-native python-epydoc-native" + +export BUILD_SYS +export HOST_SYS + +export STAGING_LIBDIR +export STAGING_INCDIR + +RDEPENDS_${PN} = "python-io python-logging python-stringold python-threading python-xml" + +FILES_${PN}-dev += "${libdir}/pkgconfig" diff --git a/meta/recipes-devtools/python/python-distribute_0.6.32.bb b/meta/recipes-devtools/python/python-distribute_0.6.32.bb new file mode 100644 index 0000000000..70001457e0 --- /dev/null +++ b/meta/recipes-devtools/python/python-distribute_0.6.32.bb @@ -0,0 +1,55 @@ +SUMMARY = "Download, build, install, upgrade, and uninstall Python packages" +HOMEPAGE = "http://packages.python.org/distribute" +SECTION = "devel/python" +LICENSE = "PSF" +LIC_FILES_CHKSUM = "file://setup.py;beginline=234;endline=234;md5=26f6b02022b737126d3c88838782dddb" + +SRCNAME = "distribute" +PR = "ml5" +DEPENDS += "python" +DEPENDS_class-native += "python-native" + +SRC_URI = " \ + http://pypi.python.org/packages/source/d/distribute/${SRCNAME}-${PV}.tar.gz \ +" +SRC_URI[md5sum] = "acb7a2da81e3612bfb1608abe4f0e568" +SRC_URI[sha256sum] = "8970cd1e148b5d1fea9430584aea66c45ea22d80e0933393ec49ebc388f718df" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +# http://python-distribute.org/distribute_setup.py + +# force the selection of python3 +#PYTHON_BASEVERSION = "3.3" +#PYTHON_MAJMIN = "3.3" + +inherit distutils + +DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages" + +do_install_prepend() { + install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages +} + +# +# The installer puts the wrong path in the setuptools.pth file. Correct it. +# +do_install_append() { + rm ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth + echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth +} + +do_install_append_class-nativesdk() { + sed -i -e '1s|^#!.*|#!/usr/bin/env python|' ${D}${PYTHON_SITEPACKAGES_DIR}/distribute-${PV}-py${PYTHON_BASEVERSION}.egg/setuptools/tests/test_resources.py + sed -i -e '1s|^#!.*|#!/usr/bin/env python|' ${D}${bindir}/easy_install + sed -i -e '1s|^#!.*|#!/usr/bin/env python|' ${D}${bindir}/easy_install-${PYTHON_BASEVERSION} +} + +RDEPENDS_${PN} = "\ + python-distutils \ + python-compression \ +" + +RPROVIDES_${PN} += "python-setuptools" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/python/python-docutils_0.12.bb b/meta/recipes-devtools/python/python-docutils_0.12.bb new file mode 100644 index 0000000000..8cda88d277 --- /dev/null +++ b/meta/recipes-devtools/python/python-docutils_0.12.bb @@ -0,0 +1,18 @@ +SUMMARY = "Text processing system for documentation" +HOMEPAGE = "http://docutils.sourceforge.net" +SECTION = "devel/python" +LICENSE = "PSF & BSD-2-Clause & GPLv3" +LIC_FILES_CHKSUM = "file://COPYING.txt;md5=a722fbdc20347db7b69223594dd54574" + +DEPENDS = "python" + +SRC_URI = "${SOURCEFORGE_MIRROR}/docutils/docutils-${PV}.tar.gz" +SRC_URI[md5sum] = "4622263b62c5c771c03502afa3157768" +SRC_URI[sha256sum] = "c7db717810ab6965f66c8cf0398a98c9d8df982da39b4cd7f162911eb89596fa" + +S = "${WORKDIR}/docutils-${PV}" + +inherit distutils + +BBCLASSEXTEND = "native" + diff --git a/meta/recipes-devtools/python/python-git_0.3.2.RC1.bb b/meta/recipes-devtools/python/python-git_0.3.2.RC1.bb new file mode 100644 index 0000000000..02a0eac040 --- /dev/null +++ b/meta/recipes-devtools/python/python-git_0.3.2.RC1.bb @@ -0,0 +1,22 @@ +SUMMARY = "Python library used to interact with Git repositories" +DESCRIPTION = "GitPython provides object model read and write access to \ +a git repository. Access repository information conveniently, alter the \ +index directly, handle remotes, or go down to low-level object database \ +access with big-files support." +HOMEPAGE = "http://github.com/gitpython-developers/GitPython" +SECTION = "devel/python" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=8b8d26c37c1d5a04f9b0186edbebc183" +DEPENDS = "python-gitdb" + +SRC_URI = "http://pypi.python.org/packages/source/G/GitPython/GitPython-${PV}.tar.gz" +SRC_URI[md5sum] = "849082fe29adc653a3621465213cab96" +SRC_URI[sha256sum] = "fd6786684a0d0dd7ebb961da754e3312fafe0c8e88f55ceb09858aa0af6094e0" + +S = "${WORKDIR}/GitPython-${PV}" + +inherit setuptools + +RDEPENDS_${PN} += "python-gitdb python-lang python-io python-shell python-math python-re python-subprocess python-stringold" + +BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-devtools/python/python-gitdb_0.5.4.bb b/meta/recipes-devtools/python/python-gitdb_0.5.4.bb new file mode 100644 index 0000000000..9e961528b9 --- /dev/null +++ b/meta/recipes-devtools/python/python-gitdb_0.5.4.bb @@ -0,0 +1,18 @@ +SUMMARY = "A pure-Python git object database" +HOMEPAGE = "http://github.com/gitpython-developers/gitdb" +SECTION = "devel/python" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=59e5ecb13339a936eedf83282eaf4528" +DEPENDS = "python-async python-smmap" + +SRC_URI = "https://pypi.python.org/packages/source/g/gitdb/gitdb-${PV}.tar.gz" +SRC_URI[md5sum] = "25353bb8d3ea527ba443dd88cd4e8a1c" +SRC_URI[sha256sum] = "de5d2dac0daec4a9cd7bb1ae1cd42d53510dcf597397c608c12a154b69ad3783" + +S = "${WORKDIR}/gitdb-${PV}" + +inherit distutils + +RDEPENDS_${PN} += "python-smmap python-async python-mmap python-lang python-zlib python-io python-shell" + +BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-devtools/python/python-gst/python-path.patch b/meta/recipes-devtools/python/python-gst/python-path.patch new file mode 100644 index 0000000000..21b5bbfcfc --- /dev/null +++ b/meta/recipes-devtools/python/python-gst/python-path.patch @@ -0,0 +1,28 @@ +Upstream-Status:Pending + +Index: gst-python-0.10.19/acinclude.m4 +=================================================================== +--- gst-python-0.10.19.orig/acinclude.m4 2010-04-21 15:23:44.000000000 -0700 ++++ gst-python-0.10.19/acinclude.m4 2010-11-15 14:43:00.642994001 -0800 +@@ -43,6 +43,13 @@ + [AC_REQUIRE([AM_PATH_PYTHON]) + AC_MSG_CHECKING(for headers required to compile python extensions) + dnl deduce PYTHON_INCLUDES ++ ++AC_ARG_WITH(python-includes, ++ [ --with-python-includes=DIR path to Python includes], py_exec_prefix=$withval) ++if test x$py_exec_prefix != x; then ++PYTHON_INCLUDES="-I${py_exec_prefix}/include/python${PYTHON_VERSION}" ++py_prefix="${py_exec_prefix}" ++else + py_prefix=`$PYTHON -c "import sys; print sys.prefix"` + py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` + if $PYTHON-config --help 2>/dev/null; then +@@ -53,6 +60,7 @@ + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" + fi + fi ++fi + AC_SUBST(PYTHON_INCLUDES) + dnl check if the headers exist: + save_CPPFLAGS="$CPPFLAGS" diff --git a/meta/recipes-devtools/python/python-gst_0.10.22.bb b/meta/recipes-devtools/python/python-gst_0.10.22.bb new file mode 100644 index 0000000000..2a5f2b3239 --- /dev/null +++ b/meta/recipes-devtools/python/python-gst_0.10.22.bb @@ -0,0 +1,29 @@ +SUMMARY = "Python bindings for the GStreamer multimedia framework" +SECTION = "devel/python" +LICENSE = "LGPLv2.1" +DEPENDS = "gstreamer gst-plugins-base python-pygobject" +RDEPENDS_${PN} += "python-pygtk" +PR = "r2" + +SRC_URI = "http://gstreamer.freedesktop.org/src/gst-python/gst-python-${PV}.tar.bz2 \ + file://python-path.patch" + +SRC_URI[md5sum] = "937152fe896241f827689f4b53e79b22" +SRC_URI[sha256sum] = "8f26f519a5bccd770864317e098e5e307fc5ad1201eb96329634b6508b253178" +S = "${WORKDIR}/gst-python-${PV}" + +LIC_FILES_CHKSUM = "file://COPYING;md5=39ff67e932b7bdfa9b78bad67151690b" + +inherit autotools distutils-base pkgconfig + +EXTRA_OECONF += "--with-python-includes=${STAGING_INCDIR}/../" + +FILES_${PN} += "${datadir}/gst-python" +FILES_${PN}-dev += "${datadir}/gst-python/0.10/defs" +FILES_${PN}-dbg += "${libdir}/${PYTHON_DIR}/site-packages/gst-0.10/gst/.debug/ ${libdir}/gstreamer-0.10/.debug/" + +do_configure_prepend() { + if [ `find ${STAGING_LIBDIR} -name libpython*.so` ]; then + ln -sf ${STAGING_LIBDIR}/libpython*.so `find ${STAGING_LIBDIR} -name libpython*.a -exec dirname {} \;` + fi +} diff --git a/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch b/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch new file mode 100644 index 0000000000..2575306bec --- /dev/null +++ b/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch @@ -0,0 +1,55 @@ +From 07d4f095a9e22ae676a8d68073101131e65012dc Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Tue, 15 Nov 2011 13:16:54 +0100 +Subject: [PATCH] python imaging setup.py: force paths for zlib, freetype and jpeg and don't add host paths + +Signed-off-by: Koen Kooi + +Upstream-Status: Inappropriate [embedded specific] +--- + setup.py | 14 +++----------- + 1 files changed, 3 insertions(+), 11 deletions(-) + +diff --git a/setup.py b/setup.py +index 5d4d53a..b1a22ec 100644 +--- a/setup.py ++++ b/setup.py +@@ -34,10 +34,10 @@ def libinclude(root): + # TIFF_ROOT = libinclude("/opt/tiff") + + TCL_ROOT = None +-JPEG_ROOT = None +-ZLIB_ROOT = None ++JPEG_ROOT = os.environ['STAGING_LIBDIR'] ++ZLIB_ROOT = os.environ['STAGING_LIBDIR'] + TIFF_ROOT = None +-FREETYPE_ROOT = None ++FREETYPE_ROOT = os.environ['STAGING_LIBDIR'], os.environ['STAGING_INCDIR'] + LCMS_ROOT = None + + # FIXME: add mechanism to explicitly *disable* the use of a library +@@ -147,7 +147,6 @@ class pil_build_ext(build_ext): + add_directory(library_dirs, "/opt/local/lib") + add_directory(include_dirs, "/opt/local/include") + +- add_directory(library_dirs, "/usr/local/lib") + # FIXME: check /opt/stuff directories here? + + prefix = sysconfig.get_config_var("prefix") +@@ -207,13 +206,6 @@ class pil_build_ext(build_ext): + if os.path.isfile(os.path.join(tcl_dir, "tk.h")): + add_directory(include_dirs, tcl_dir) + +- # standard locations +- add_directory(library_dirs, "/usr/local/lib") +- add_directory(include_dirs, "/usr/local/include") +- +- add_directory(library_dirs, "/usr/lib") +- add_directory(include_dirs, "/usr/include") +- + # + # insert new dirs *before* default libs, to avoid conflicts + # between Python PYD stub libs and real libraries +-- +1.7.2.5 + diff --git a/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch b/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch new file mode 100644 index 0000000000..4960ed4661 --- /dev/null +++ b/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch @@ -0,0 +1,65 @@ +At least lcms wasn't deterministicly detected from sysroot. + +This will allow to export LCMS_ENABLED=False when lcms isn't in PACKAGECONFIG. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Martin Jansa + +diff -uNr Imaging-1.1.7.orig/setup.py Imaging-1.1.7/setup.py +--- Imaging-1.1.7.orig/setup.py 2013-07-22 10:17:02.081457075 +0200 ++++ Imaging-1.1.7/setup.py 2013-07-22 13:10:09.029707492 +0200 +@@ -39,6 +39,12 @@ + TIFF_ROOT = None + FREETYPE_ROOT = os.environ['STAGING_LIBDIR'], os.environ['STAGING_INCDIR'] + LCMS_ROOT = None ++TCL_ENABLED = os.getenv('TCL_ENABLED', "True") ++JPEG_ENABLED = os.getenv('JPEG_ENABLED', "True") ++ZLIB_ENABLED = os.getenv('ZLIB_ENABLED', "True") ++TIFF_ENABLED = os.getenv('TIFF_ENABLED', "True") ++FREETYPE_ENABLED = os.getenv('FREETYPE_ENABLED', "True") ++LCMS_ENABLED = os.getenv('LCMS_ENABLED', "True") + + # FIXME: add mechanism to explicitly *disable* the use of a library + +@@ -220,22 +226,22 @@ + zlib = jpeg = tiff = freetype = tcl = tk = lcms = None + feature = feature() + +- if find_include_file(self, "zlib.h"): ++ if ZLIB_ENABLED == 'True' and find_include_file(self, "zlib.h"): + if find_library_file(self, "z"): + feature.zlib = "z" + elif sys.platform == "win32" and find_library_file(self, "zlib"): + feature.zlib = "zlib" # alternative name + +- if find_include_file(self, "jpeglib.h"): ++ if JPEG_ENABLED == 'True' and find_include_file(self, "jpeglib.h"): + if find_library_file(self, "jpeg"): + feature.jpeg = "jpeg" + elif sys.platform == "win32" and find_library_file(self, "libjpeg"): + feature.jpeg = "libjpeg" # alternative name + +- if find_library_file(self, "tiff"): ++ if TIFF_ENABLED == 'True' and find_library_file(self, "tiff"): + feature.tiff = "tiff" + +- if find_library_file(self, "freetype"): ++ if FREETYPE_ENABLED == 'True' and find_library_file(self, "freetype"): + # look for freetype2 include files + freetype_version = 0 + for dir in self.compiler.include_dirs: +@@ -256,11 +262,11 @@ + if dir: + add_directory(self.compiler.include_dirs, dir, 0) + +- if find_include_file(self, "lcms.h"): ++ if LCMS_ENABLED == 'True' and find_include_file(self, "lcms.h"): + if find_library_file(self, "lcms"): + feature.lcms = "lcms" + +- if _tkinter and find_include_file(self, "tk.h"): ++ if TCL_ENABLED == 'True' and _tkinter and find_include_file(self, "tk.h"): + # the library names may vary somewhat (e.g. tcl84 or tcl8.4) + version = TCL_VERSION[0] + TCL_VERSION[2] + if find_library_file(self, "tcl" + version): diff --git a/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch b/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch new file mode 100644 index 0000000000..9ecc63a0d6 --- /dev/null +++ b/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch @@ -0,0 +1,30 @@ +Upstream-Status: Backport +Signed-off-by: Ross Burton + +From c6040f618d8f2706a7b46d1cdf37d1a587f9701f Mon Sep 17 00:00:00 2001 +From: Andrew Stromnov +Date: Thu, 28 Nov 2013 16:58:43 +0400 +Subject: [PATCH] fix compiling with FreeType 2.5.1 + +--- + _imagingft.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/_imagingft.c b/_imagingft.c +index 47d50bd..f19555b 100644 +--- a/_imagingft.c ++++ b/_imagingft.c +@@ -59,7 +59,11 @@ struct { + const char* message; + } ft_errors[] = + ++#if defined(USE_FREETYPE_2_1) ++#include FT_ERRORS_H ++#else + #include ++#endif + + /* -------------------------------------------------------------------- */ + /* font objects */ +-- +1.8.5.1 diff --git a/meta/recipes-devtools/python/python-imaging_1.1.7.bb b/meta/recipes-devtools/python/python-imaging_1.1.7.bb new file mode 100644 index 0000000000..a678328275 --- /dev/null +++ b/meta/recipes-devtools/python/python-imaging_1.1.7.bb @@ -0,0 +1,45 @@ +SUMMARY = "Python Imaging Library (PIL)" +SECTION = "devel/python" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://README;beginline=92;endline=120;md5=c4371af4579f1e489cf881c1443dd4ec" +DEPENDS = "freetype jpeg tiff" +SRCNAME = "Imaging" +PR = "r5" + +SRC_URI = "http://effbot.org/downloads/Imaging-${PV}.tar.gz \ + file://0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch \ + file://allow.to.disable.some.features.patch \ + file://fix-freetype-includes.patch" + +SRC_URI[md5sum] = "fc14a54e1ce02a0225be8854bfba478e" +SRC_URI[sha256sum] = "895bc7c2498c8e1f9b99938f1a40dc86b3f149741f105cf7c7bd2e0725405211" +S = "${WORKDIR}/${SRCNAME}-${PV}" + +# There isn't enable/disable option, and lcms is in meta-oe, at least make it explicit when enabled +# setup.py already has FIXME: add mechanism to explicitly *disable* the use of a library +PACKAGECONFIG ??= "" +PACKAGECONFIG[lcms] = ",,lcms" + +inherit distutils + +do_compile() { + export STAGING_LIBDIR=${STAGING_LIBDIR} + export STAGING_INCDIR=${STAGING_INCDIR} + export LCMS_ENABLED=${@bb.utils.contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)} + distutils_do_compile +} + +do_install() { + export STAGING_LIBDIR=${STAGING_LIBDIR} + export STAGING_INCDIR=${STAGING_INCDIR} + export LCMS_ENABLED=${@bb.utils.contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)} + distutils_do_install + install -d ${D}${datadir}/doc/${BPN}/html/ + install -m 0644 ${S}/README ${D}${datadir}/doc/${BPN}/ + install -m 0644 ${S}/Docs/* ${D}${datadir}/doc/${BPN}/html/ + + # get rid of #!/usr/local/bin/python + sed -i -e 's:/usr/local/bin/:${bindir}/env :g' ${D}${bindir}/* +} + +RDEPENDS_${PN} += "python-lang python-stringold" diff --git a/meta/recipes-devtools/python/python-mako_0.9.1.bb b/meta/recipes-devtools/python/python-mako_0.9.1.bb new file mode 100644 index 0000000000..57d4220477 --- /dev/null +++ b/meta/recipes-devtools/python/python-mako_0.9.1.bb @@ -0,0 +1,20 @@ +SUMMARY = "Templating library for Python" +SECTION = "devel/python" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=da2a9d126b93cab0996a8287dacc480b" + +SRC_URI = "https://pypi.python.org/packages/source/M/Mako/Mako-${PV}.tar.gz" +SRC_URI[md5sum] = "fe3f394ef714776d09ec6133923736a7" +SRC_URI[sha256sum] = "ed74d72b720a97a51590dfa839f2048ceeb76cc80d1d9ea5731a5262384316ae" + +S = "${WORKDIR}/Mako-${PV}" + +inherit setuptools + +RDEPENDS_${PN} = "python-threading \ + python-netclient \ + python-html \ +" +RDEPENDS_${PN}_class-native = "" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch b/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch new file mode 100644 index 0000000000..a39247ce70 --- /dev/null +++ b/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch @@ -0,0 +1,18 @@ +Upstream-Status: Pending + +# Some versions of SWIG do not use the extension parameter. +# Make it optional. +# Signed-Off: Michael 'Mickey' Lauer +Index: Python-2.6.1/Lib/distutils/command/build_ext.py +=================================================================== +--- Python-2.6.1.orig/Lib/distutils/command/build_ext.py ++++ Python-2.6.1/Lib/distutils/command/build_ext.py +@@ -566,7 +566,7 @@ class build_ext (Command): + target_lang=language) + + +- def swig_sources (self, sources, extension): ++ def swig_sources (self, sources, extension=None): + + """Walk the list of source files in 'sources', looking for SWIG + interface (.i) files. Run SWIG on all that are found, and diff --git a/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch b/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch new file mode 100644 index 0000000000..c92469b9b6 --- /dev/null +++ b/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch @@ -0,0 +1,20 @@ +Upstream-Status: Pending + +# Don't modify the she-bang line for a cross-build. +# Otherwise it points to our hostpython (which we do not want) +# +# Signed-Off: Michael 'Mickey' Lauer + +Index: Python-2.6.1/Lib/distutils/command/build_scripts.py +=================================================================== +--- Python-2.6.1.orig/Lib/distutils/command/build_scripts.py ++++ Python-2.6.1/Lib/distutils/command/build_scripts.py +@@ -87,7 +87,7 @@ class build_scripts (Command): + continue + + match = first_line_re.match(first_line) +- if match: ++ if False: #match: + adjust = 1 + post_interp = match.group(1) or '' + diff --git a/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch new file mode 100644 index 0000000000..f89aaff7b1 --- /dev/null +++ b/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch @@ -0,0 +1,65 @@ +Upstream-Status: Inappropriate [embedded specific] + +# The proper prefix is inside our staging area. +# Signed-Off: Michael 'Mickey' Lauer +# Signed-off-by: Phil Blundell + +--- Python-2.6.6/Lib/distutils/sysconfig.py.orig 2012-01-03 14:02:03.027005296 +0000 ++++ Python-2.6.6/Lib/distutils/sysconfig.py 2012-01-03 14:02:31.517601081 +0000 +@@ -19,8 +19,8 @@ + from distutils.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) ++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") ) + + # Path to the base directory of the project. On Windows the binary may + # live in project/PCBuild9. If we're dealing with an x64 Windows build, +@@ -70,7 +70,7 @@ + sys.exec_prefix -- i.e., ignore 'plat_specific'. + """ + if prefix is None: +- prefix = plat_specific and EXEC_PREFIX or PREFIX ++ prefix = os.environ['STAGING_INCDIR'].rstrip('include') + + if os.name == "posix": + if python_build: +@@ -115,12 +115,16 @@ + If 'prefix' is supplied, use it instead of sys.prefix or + sys.exec_prefix -- i.e., ignore 'plat_specific'. + """ ++ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1] + if prefix is None: +- prefix = plat_specific and EXEC_PREFIX or PREFIX ++ if plat_specific: ++ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename) ++ else: ++ prefix = PREFIX + + 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: +@@ -216,7 +220,7 @@ + else: + # The name of the config.h file changed in 2.2 + config_h = 'pyconfig.h' +- return os.path.join(inc_dir, config_h) ++ return os.path.join(inc_dir, config_h).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) + + + def get_makefile_filename(): +@@ -225,7 +229,7 @@ + return os.path.join(os.path.dirname(os.path.realpath(sys.executable)), + "Makefile") + lib_dir = get_python_lib(plat_specific=1, standard_lib=1) +- return os.path.join(lib_dir, "config", "Makefile") ++ return os.path.join(lib_dir, "config", "Makefile").replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) + + + def parse_config_h(fp, g=None): diff --git a/meta/recipes-devtools/python/python-native/debug.patch b/meta/recipes-devtools/python/python-native/debug.patch new file mode 100644 index 0000000000..5ec10d6b20 --- /dev/null +++ b/meta/recipes-devtools/python/python-native/debug.patch @@ -0,0 +1,29 @@ +Upstream-Status: Pending + +Index: Python-2.6.1/Lib/distutils/unixccompiler.py +=================================================================== +--- Python-2.6.1.orig/Lib/distutils/unixccompiler.py 2009-11-13 16:04:54.000000000 +0000 ++++ Python-2.6.1/Lib/distutils/unixccompiler.py 2009-11-13 16:06:27.000000000 +0000 +@@ -300,6 +300,8 @@ + dylib_f = self.library_filename(lib, lib_type='dylib') + static_f = self.library_filename(lib, lib_type='static') + ++ print "Looking in %s for %s" % (lib, dirs) ++ + for dir in dirs: + shared = os.path.join(dir, shared_f) + dylib = os.path.join(dir, dylib_f) +@@ -309,10 +311,13 @@ + # assuming that *all* Unix C compilers do. And of course I'm + # ignoring even GCC's "-static" option. So sue me. + if os.path.exists(dylib): ++ print "Found %s" % (dylib) + return dylib + elif os.path.exists(shared): ++ print "Found %s" % (shared) + return shared + elif os.path.exists(static): ++ print "Found %s" % (static) + return static + + # Oops, didn't find it in *any* of 'dirs' diff --git a/meta/recipes-devtools/python/python-native/multilib.patch b/meta/recipes-devtools/python/python-native/multilib.patch new file mode 100644 index 0000000000..0526031ada --- /dev/null +++ b/meta/recipes-devtools/python/python-native/multilib.patch @@ -0,0 +1,243 @@ +commit 248279e54467a8cd5cde98fc124d1d1384703513 +Author: Yu Ke +Date: Tue Jun 28 21:21:29 2011 +0800 + + SUSE patch for the lib64 issue + + see detail in http://bugs.python.org/issue1294959 + + also rebased a bit for Yocto python 2.6.6 + + Picked-by: Yu Ke + + +2011/09/29 +The python recipe building was failing because python-native +could not handle sys.lib var. sys.lib var is defined in the +multilib patch hence added this multilib.patch for python-native +recipe. + +Upstream-Status: Inappropriate [oe-specific] + +Signed-Off-By: Nitin A Kamble + +Index: Python-2.7.2/Include/pythonrun.h +=================================================================== +--- Python-2.7.2.orig/Include/pythonrun.h ++++ Python-2.7.2/Include/pythonrun.h +@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void); + /* In their own files */ + PyAPI_FUNC(const char *) Py_GetVersion(void); + PyAPI_FUNC(const char *) Py_GetPlatform(void); ++PyAPI_FUNC(const char *) Py_GetLib(void); + PyAPI_FUNC(const char *) Py_GetCopyright(void); + PyAPI_FUNC(const char *) Py_GetCompiler(void); + PyAPI_FUNC(const char *) Py_GetBuildInfo(void); +Index: Python-2.7.2/Lib/distutils/command/install.py +=================================================================== +--- Python-2.7.2.orig/Lib/distutils/command/install.py ++++ Python-2.7.2/Lib/distutils/command/install.py +@@ -22,6 +22,8 @@ from site import USER_BASE + from site import USER_SITE + + ++libname = sys.lib ++ + if sys.version < "2.2": + WINDOWS_SCHEME = { + 'purelib': '$base', +@@ -42,7 +44,7 @@ else: + 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/$dist_name', + 'scripts': '$base/bin', + 'data' : '$base', +Index: Python-2.7.2/Lib/pydoc.py +=================================================================== +--- Python-2.7.2.orig/Lib/pydoc.py ++++ Python-2.7.2/Lib/pydoc.py +@@ -352,7 +352,7 @@ class Doc: + + docloc = os.environ.get("PYTHONDOCS", + "http://docs.python.org/library") +- basedir = os.path.join(sys.exec_prefix, "lib", ++ basedir = os.path.join(sys.exec_prefix, sys.lib, + "python"+sys.version[0:3]) + if (isinstance(object, type(os)) and + (object.__name__ in ('errno', 'exceptions', 'gc', 'imp', +Index: Python-2.7.2/Lib/site.py +=================================================================== +--- Python-2.7.2.orig/Lib/site.py ++++ Python-2.7.2/Lib/site.py +@@ -300,13 +300,19 @@ def getsitepackages(): + if sys.platform in ('os2emx', 'riscos'): + sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) + elif os.sep == '/': +- sitepackages.append(os.path.join(prefix, "lib", ++ sitepackages.append(os.path.join(prefix, sys.lib, + "python" + sys.version[:3], + "site-packages")) +- sitepackages.append(os.path.join(prefix, "lib", "site-python")) ++ if sys.lib != "lib": ++ sitepackages.append(os.path.join(prefix, "lib", ++ "python" + sys.version[:3], ++ "site-packages")) ++ sitepackages.append(os.path.join(prefix, sys.lib, "site-python")) ++ if sys.lib != "lib": ++ sitepackages.append(os.path.join(prefix, "lib", "site-python")) + 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-2.7.2/Lib/test/test_dl.py +=================================================================== +--- Python-2.7.2.orig/Lib/test/test_dl.py ++++ Python-2.7.2/Lib/test/test_dl.py +@@ -5,10 +5,11 @@ + import unittest + from test.test_support import verbose, import_module + dl = import_module('dl', deprecated=True) ++import sys + + sharedlibs = [ +- ('/usr/lib/libc.so', 'getpid'), +- ('/lib/libc.so.6', 'getpid'), ++ ('/usr/'+sys.lib+'/libc.so', 'getpid'), ++ ('/'+sys.lib+'/libc.so.6', 'getpid'), + ('/usr/bin/cygwin1.dll', 'getpid'), + ('/usr/lib/libc.dylib', 'getpid'), + ] +Index: Python-2.7.2/Lib/trace.py +=================================================================== +--- Python-2.7.2.orig/Lib/trace.py ++++ Python-2.7.2/Lib/trace.py +@@ -762,10 +762,10 @@ def main(argv=None): + # should I also call expanduser? (after all, could use $HOME) + + s = s.replace("$prefix", +- os.path.join(sys.prefix, "lib", ++ os.path.join(sys.prefix, sys.lib, + "python" + sys.version[:3])) + s = s.replace("$exec_prefix", +- os.path.join(sys.exec_prefix, "lib", ++ os.path.join(sys.exec_prefix, sys.lib, + "python" + sys.version[:3])) + s = os.path.normpath(s) + ignore_dirs.append(s) +Index: Python-2.7.2/Makefile.pre.in +=================================================================== +--- Python-2.7.2.orig/Makefile.pre.in ++++ Python-2.7.2/Makefile.pre.in +@@ -81,6 +81,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG + + # Machine-dependent subdirectories + MACHDEP= @MACHDEP@ ++LIB= @LIB@ + + # Install prefix for architecture-independent files + prefix= @prefix@ +@@ -97,7 +98,7 @@ LIBDIR= @libdir@ + MANDIR= @mandir@ + INCLUDEDIR= @includedir@ + CONFINCLUDEDIR= $(exec_prefix)/include +-SCRIPTDIR= $(prefix)/lib ++SCRIPTDIR= $(prefix)/@LIB@ + + # Detailed destination directories + BINLIBDEST= $(LIBDIR)/python$(VERSION) +@@ -532,6 +533,7 @@ Modules/getpath.o: $(srcdir)/Modules/get + -DEXEC_PREFIX='"$(exec_prefix)"' \ + -DVERSION='"$(VERSION)"' \ + -DVPATH='"$(VPATH)"' \ ++ -DLIB='"$(LIB)"' \ + -o $@ $(srcdir)/Modules/getpath.c + + Modules/python.o: $(srcdir)/Modules/python.c +@@ -566,7 +568,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES) + Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) + + Python/getplatform.o: $(srcdir)/Python/getplatform.c +- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c ++ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c + + Python/importdl.o: $(srcdir)/Python/importdl.c + $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c +Index: Python-2.7.2/Modules/getpath.c +=================================================================== +--- Python-2.7.2.orig/Modules/getpath.c ++++ Python-2.7.2/Modules/getpath.c +@@ -116,9 +116,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 +@@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1]; + static char exec_prefix[MAXPATHLEN+1]; + static char progpath[MAXPATHLEN+1]; + static char *module_search_path = NULL; +-static char lib_python[] = "lib/python" VERSION; ++static char lib_python[] = LIB_PYTHON; + + static void + reduce(char *dir) +Index: Python-2.7.2/Python/getplatform.c +=================================================================== +--- Python-2.7.2.orig/Python/getplatform.c ++++ Python-2.7.2/Python/getplatform.c +@@ -10,3 +10,13 @@ Py_GetPlatform(void) + { + return PLATFORM; + } ++ ++#ifndef LIB ++#define LIB "lib" ++#endif ++ ++const char * ++Py_GetLib(void) ++{ ++ return LIB; ++} +Index: Python-2.7.2/Python/sysmodule.c +=================================================================== +--- Python-2.7.2.orig/Python/sysmodule.c ++++ Python-2.7.2/Python/sysmodule.c +@@ -1416,6 +1416,8 @@ _PySys_Init(void) + PyString_FromString(Py_GetCopyright())); + SET_SYS_FROM_STRING("platform", + PyString_FromString(Py_GetPlatform())); ++ SET_SYS_FROM_STRING("lib", ++ PyString_FromString(Py_GetLib())); + SET_SYS_FROM_STRING("executable", + PyString_FromString(Py_GetProgramFullPath())); + SET_SYS_FROM_STRING("prefix", +Index: Python-2.7.2/configure.in +=================================================================== +--- Python-2.7.2.orig/configure.in ++++ Python-2.7.2/configure.in +@@ -629,6 +629,10 @@ SunOS*) + ;; + esac + ++AC_SUBST(LIB) ++AC_MSG_CHECKING(LIB) ++LIB=`basename ${libdir}` ++AC_MSG_RESULT($LIB) + + AC_SUBST(LIBRARY) + AC_MSG_CHECKING(LIBRARY) diff --git a/meta/recipes-devtools/python/python-native/nohostlibs.patch b/meta/recipes-devtools/python/python-native/nohostlibs.patch new file mode 100644 index 0000000000..09c3fb808a --- /dev/null +++ b/meta/recipes-devtools/python/python-native/nohostlibs.patch @@ -0,0 +1,67 @@ +Upstream-Status: Inappropriate [embedded specific] + +2011/09/29 +rebased for python-2.7.2 +Signed-Off-By: Nitin A Kamble + +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py ++++ Python-2.7.2/setup.py +@@ -369,8 +369,8 @@ class PyBuildExt(build_ext): + + def detect_modules(self): + # Ensure that /usr/local is always used +- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') +- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') ++ #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') ++ #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') + self.add_multiarch_paths() + + # Add paths specified in the environment variables LDFLAGS and +@@ -407,15 +407,15 @@ class PyBuildExt(build_ext): + 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, ++ add_dir_to_list(self.compiler.library_dirs, + sysconfig.get_config_var("LIBDIR")) +- add_dir_to_list(self.compiler.include_dirs, ++ add_dir_to_list(self.compiler.include_dirs, + sysconfig.get_config_var("INCLUDEDIR")) + + try: +@@ -426,11 +426,8 @@ class PyBuildExt(build_ext): + # lib_dirs and inc_dirs are used to search for files; + # if a file is found in one of those directories, it can + # be assumed that no additional -I,-L directives are needed. +- lib_dirs = self.compiler.library_dirs + [ +- '/lib64', '/usr/lib64', +- '/lib', '/usr/lib', +- ] +- inc_dirs = self.compiler.include_dirs + ['/usr/include'] ++ lib_dirs = self.compiler.library_dirs ++ inc_dirs = self.compiler.include_dirs + exts = [] + missing = [] + +@@ -676,9 +673,8 @@ class PyBuildExt(build_ext): + pass # Issue 7384: Already linked against curses or tinfo. + elif curses_library: + readline_libs.append(curses_library) +- elif self.compiler.find_library_file(lib_dirs + +- ['/usr/lib/termcap'], +- 'termcap'): ++ elif self.compiler.find_library_file(lib_dirs, ++ 'termcap'): + readline_libs.append('termcap') + exts.append( Extension('readline', ['readline.c'], + library_dirs=['/usr/lib/termcap'], diff --git a/meta/recipes-devtools/python/python-native/unixccompiler.patch b/meta/recipes-devtools/python/python-native/unixccompiler.patch new file mode 100644 index 0000000000..4502829129 --- /dev/null +++ b/meta/recipes-devtools/python/python-native/unixccompiler.patch @@ -0,0 +1,20 @@ +Upstream-Status: Pending + +The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information. +This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name. + +Signed-off-by: Mei Lei +Signed-off-by: Khem Raj +Index: Python-2.7.2/Lib/distutils/unixccompiler.py +=================================================================== +--- Python-2.7.2.orig/Lib/distutils/unixccompiler.py 2011-11-24 13:51:10.539998722 -0800 ++++ Python-2.7.2/Lib/distutils/unixccompiler.py 2011-11-24 15:54:36.872137766 -0800 +@@ -282,7 +282,7 @@ + # this time, there's no way to determine this information from + # the configuration data stored in the Python installation, so + # we use this hack. +- compiler = os.path.basename(sysconfig.get_config_var("CC")) ++ compiler = sysconfig.get_config_var("CC") + if sys.platform[:6] == "darwin": + # MacOSX's linker doesn't understand the -R flag at all + return "-L" + dir diff --git a/meta/recipes-devtools/python/python-native_2.7.3.bb b/meta/recipes-devtools/python/python-native_2.7.3.bb new file mode 100644 index 0000000000..e55f5feac2 --- /dev/null +++ b/meta/recipes-devtools/python/python-native_2.7.3.bb @@ -0,0 +1,65 @@ +require python.inc + +EXTRANATIVEPATH += "bzip2-native" +DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native" +PR = "${INC_PR}.1" + +SRC_URI += "\ + file://05-enable-ctypes-cross-build.patch \ + file://06-ctypes-libffi-fix-configure.patch \ + file://10-distutils-fix-swig-parameter.patch \ + file://11-distutils-never-modify-shebang-line.patch \ + file://12-distutils-prefix-is-inside-staging-area.patch \ + file://debug.patch \ + file://unixccompiler.patch \ + file://nohostlibs.patch \ + file://multilib.patch \ + file://add-md5module-support.patch \ + file://builddir.patch \ + file://parallel-makeinst-create-bindir.patch \ + file://python-fix-build-error-with-Readline-6.3.patch \ + file://gcc-4.8-fix-configure-Wformat.patch \ + file://json-flaw-fix.patch \ + " +S = "${WORKDIR}/Python-${PV}" + +FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:" + +inherit native + +RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-codecs-native python-core-native" + +EXTRA_OECONF_append = " --bindir=${bindir}/${PN}" + +EXTRA_OEMAKE = '\ + BUILD_SYS="" \ + HOST_SYS="" \ + LIBC="" \ + STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \ + STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \ +' + +do_configure_prepend() { + autoreconf --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" +} + +do_install() { + oe_runmake 'DESTDIR=${D}' install + install -d ${D}${bindir}/${PN} + install -m 0755 Parser/pgen ${D}${bindir}/${PN} + + # Make sure we use /usr/bin/env python + for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do + sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT + done + + # Add a symlink to the native Python so that scripts can just invoke + # "nativepython" and get the right one without needing absolute paths + # (these often end up too long for the #! parser in the kernel as the + # buffer is 128 bytes long). + ln -s python-native/python ${D}${bindir}/nativepython + + # We don't want modules in ~/.local being used in preference to those + # installed in the native sysroot, so disable user site support. + sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py +} diff --git a/meta/recipes-devtools/python/python-nose_1.2.1.bb b/meta/recipes-devtools/python/python-nose_1.2.1.bb new file mode 100644 index 0000000000..f55461d047 --- /dev/null +++ b/meta/recipes-devtools/python/python-nose_1.2.1.bb @@ -0,0 +1,16 @@ +DESCRIPTION = "nose extends the test loading and running features of unittest, \ +making it easier to write, find and run tests." +SECTION = "devel/python" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://lgpl.txt;md5=a6f89e2100d9b6cdffcea4f398e37343" + +SRC_URI = "http://pypi.python.org/packages/source/n/nose/nose-${PV}.tar.gz" + +SRC_URI[md5sum] = "735e3f1ce8b07e70ee1b742a8a53585a" +SRC_URI[sha256sum] = "2171e9202d118d302d5db1decb52dd862b79e2a626ca19653a6914574a6ca7d9" + +S = "${WORKDIR}/nose-${PV}" + +inherit setuptools + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h new file mode 100644 index 0000000000..be57ac27bf --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h @@ -0,0 +1,30 @@ +#define NPY_HAVE_ENDIAN_H 1 +#define NPY_SIZEOF_SHORT SIZEOF_SHORT +#define NPY_SIZEOF_INT SIZEOF_INT +#define NPY_SIZEOF_LONG SIZEOF_LONG +#define NPY_SIZEOF_FLOAT 4 +#define NPY_SIZEOF_COMPLEX_FLOAT 8 +#define NPY_SIZEOF_DOUBLE 8 +#define NPY_SIZEOF_COMPLEX_DOUBLE 16 +#define NPY_SIZEOF_LONGDOUBLE 16 +#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 +#define NPY_SIZEOF_PY_INTPTR_T 8 +#define NPY_SIZEOF_PY_LONG_LONG 8 +#define NPY_SIZEOF_LONGLONG 8 +#define NPY_NO_SMP 0 +#define NPY_HAVE_DECL_ISNAN +#define NPY_HAVE_DECL_ISINF +#define NPY_HAVE_DECL_ISFINITE +#define NPY_HAVE_DECL_SIGNBIT +#define NPY_USE_C99_COMPLEX 1 +#define NPY_HAVE_COMPLEX_DOUBLE 1 +#define NPY_HAVE_COMPLEX_FLOAT 1 +#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 +#define NPY_USE_C99_FORMATS 1 +#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) +#define NPY_ABI_VERSION 0x01000009 +#define NPY_API_VERSION 0x00000007 + +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS 1 +#endif diff --git a/meta/recipes-devtools/python/python-numpy/aarch64/config.h b/meta/recipes-devtools/python/python-numpy/aarch64/config.h new file mode 100644 index 0000000000..c30b868f2f --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/aarch64/config.h @@ -0,0 +1,139 @@ +#define HAVE_ENDIAN_H 1 +#define SIZEOF_PY_INTPTR_T 8 +#define SIZEOF_PY_LONG_LONG 8 +#define MATHLIB m +#define HAVE_SIN 1 +#define HAVE_COS 1 +#define HAVE_TAN 1 +#define HAVE_SINH 1 +#define HAVE_COSH 1 +#define HAVE_TANH 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_CEIL 1 +#define HAVE_SQRT 1 +#define HAVE_LOG10 1 +#define HAVE_LOG 1 +#define HAVE_EXP 1 +#define HAVE_ASIN 1 +#define HAVE_ACOS 1 +#define HAVE_ATAN 1 +#define HAVE_FMOD 1 +#define HAVE_MODF 1 +#define HAVE_FREXP 1 +#define HAVE_LDEXP 1 +#define HAVE_RINT 1 +#define HAVE_TRUNC 1 +#define HAVE_EXP2 1 +#define HAVE_LOG2 1 +#define HAVE_ATAN2 1 +#define HAVE_POW 1 +#define HAVE_NEXTAFTER 1 +#define HAVE_SINF 1 +#define HAVE_COSF 1 +#define HAVE_TANF 1 +#define HAVE_SINHF 1 +#define HAVE_COSHF 1 +#define HAVE_TANHF 1 +#define HAVE_FABSF 1 +#define HAVE_FLOORF 1 +#define HAVE_CEILF 1 +#define HAVE_RINTF 1 +#define HAVE_TRUNCF 1 +#define HAVE_SQRTF 1 +#define HAVE_LOG10F 1 +#define HAVE_LOGF 1 +#define HAVE_LOG1PF 1 +#define HAVE_EXPF 1 +#define HAVE_EXPM1F 1 +#define HAVE_ASINF 1 +#define HAVE_ACOSF 1 +#define HAVE_ATANF 1 +#define HAVE_ASINHF 1 +#define HAVE_ACOSHF 1 +#define HAVE_ATANHF 1 +#define HAVE_HYPOTF 1 +#define HAVE_ATAN2F 1 +#define HAVE_POWF 1 +#define HAVE_FMODF 1 +#define HAVE_MODFF 1 +#define HAVE_FREXPF 1 +#define HAVE_LDEXPF 1 +#define HAVE_EXP2F 1 +#define HAVE_LOG2F 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_NEXTAFTERF 1 +#define HAVE_SINL 1 +#define HAVE_COSL 1 +#define HAVE_TANL 1 +#define HAVE_SINHL 1 +#define HAVE_COSHL 1 +#define HAVE_TANHL 1 +#define HAVE_FABSL 1 +#define HAVE_FLOORL 1 +#define HAVE_CEILL 1 +#define HAVE_RINTL 1 +#define HAVE_TRUNCL 1 +#define HAVE_SQRTL 1 +#define HAVE_LOG10L 1 +#define HAVE_LOGL 1 +#define HAVE_LOG1PL 1 +#define HAVE_EXPL 1 +#define HAVE_EXPM1L 1 +#define HAVE_ASINL 1 +#define HAVE_ACOSL 1 +#define HAVE_ATANL 1 +#define HAVE_ASINHL 1 +#define HAVE_ACOSHL 1 +#define HAVE_ATANHL 1 +#define HAVE_HYPOTL 1 +#define HAVE_ATAN2L 1 +#define HAVE_POWL 1 +#define HAVE_FMODL 1 +#define HAVE_MODFL 1 +#define HAVE_FREXPL 1 +#define HAVE_LDEXPL 1 +#define HAVE_EXP2L 1 +#define HAVE_LOG2L 1 +#define HAVE_COPYSIGNL 1 +#define HAVE_NEXTAFTERL 1 +#define HAVE_DECL_SIGNBIT +#define HAVE_COMPLEX_H 1 +#define HAVE_CREAL 1 +#define HAVE_CIMAG 1 +#define HAVE_CABS 1 +#define HAVE_CARG 1 +#define HAVE_CEXP 1 +#define HAVE_CSQRT 1 +#define HAVE_CLOG 1 +#define HAVE_CCOS 1 +#define HAVE_CSIN 1 +#define HAVE_CPOW 1 +#define HAVE_CREALF 1 +#define HAVE_CIMAGF 1 +#define HAVE_CABSF 1 +#define HAVE_CARGF 1 +#define HAVE_CEXPF 1 +#define HAVE_CSQRTF 1 +#define HAVE_CLOGF 1 +#define HAVE_CCOSF 1 +#define HAVE_CSINF 1 +#define HAVE_CPOWF 1 +#define HAVE_CREALL 1 +#define HAVE_CIMAGL 1 +#define HAVE_CABSL 1 +#define HAVE_CARGL 1 +#define HAVE_CEXPL 1 +#define HAVE_CSQRTL 1 +#define HAVE_CLOGL 1 +#define HAVE_CCOSL 1 +#define HAVE_CSINL 1 +#define HAVE_CPOWL 1 +#define HAVE_LDOUBLE_IEEE_QUAD_LE 1 +#ifndef __cplusplus +/* #undef inline */ +#endif + +#ifndef _NPY_NPY_CONFIG_H_ +#error config.h should never be included directly, include npy_config.h instead +#endif diff --git a/meta/recipes-devtools/python/python-numpy/arm/config.h b/meta/recipes-devtools/python/python-numpy/arm/config.h new file mode 100644 index 0000000000..17ef186d56 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/arm/config.h @@ -0,0 +1,21 @@ +/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */ +/* #define SIZEOF_SHORT 2 */ +/* #define SIZEOF_INT 4 */ +/* #define SIZEOF_LONG 4 */ +/* #define SIZEOF_FLOAT 4 */ +/* #define SIZEOF_DOUBLE 8 */ +#define SIZEOF_LONG_DOUBLE 12 +#define SIZEOF_PY_INTPTR_T 4 +/* #define SIZEOF_LONG_LONG 8 */ +#define SIZEOF_PY_LONG_LONG 8 +/* #define CHAR_BIT 8 */ +#define MATHLIB m +#define HAVE_FLOAT_FUNCS +#define HAVE_LOG1P +#define HAVE_EXPM1 +#define HAVE_INVERSE_HYPERBOLIC +#define HAVE_INVERSE_HYPERBOLIC_FLOAT +#define HAVE_ISNAN +#define HAVE_ISINF +#define HAVE_RINT + diff --git a/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h b/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h new file mode 100644 index 0000000000..c4bf6547f0 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h @@ -0,0 +1,17 @@ +/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */ +/* + * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT + * */ +#define NPY_SIZEOF_SHORT 2 +#define NPY_SIZEOF_INT 4 +#define NPY_SIZEOF_LONG 4 +#define NPY_SIZEOF_FLOAT 4 +#define NPY_SIZEOF_DOUBLE 8 +#define NPY_SIZEOF_LONGDOUBLE 12 +#define NPY_SIZEOF_PY_INTPTR_T 4 +#define NPY_NO_SMP 0 + +#define NPY_SIZEOF_LONGLONG 8 +#define NPY_SIZEOF_PY_LONG_LONG 8 +/* #define CHAR_BIT 8 */ + diff --git a/meta/recipes-devtools/python/python-numpy/armeb/config.h b/meta/recipes-devtools/python/python-numpy/armeb/config.h new file mode 100644 index 0000000000..17ef186d56 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/armeb/config.h @@ -0,0 +1,21 @@ +/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */ +/* #define SIZEOF_SHORT 2 */ +/* #define SIZEOF_INT 4 */ +/* #define SIZEOF_LONG 4 */ +/* #define SIZEOF_FLOAT 4 */ +/* #define SIZEOF_DOUBLE 8 */ +#define SIZEOF_LONG_DOUBLE 12 +#define SIZEOF_PY_INTPTR_T 4 +/* #define SIZEOF_LONG_LONG 8 */ +#define SIZEOF_PY_LONG_LONG 8 +/* #define CHAR_BIT 8 */ +#define MATHLIB m +#define HAVE_FLOAT_FUNCS +#define HAVE_LOG1P +#define HAVE_EXPM1 +#define HAVE_INVERSE_HYPERBOLIC +#define HAVE_INVERSE_HYPERBOLIC_FLOAT +#define HAVE_ISNAN +#define HAVE_ISINF +#define HAVE_RINT + diff --git a/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h b/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h new file mode 100644 index 0000000000..c4bf6547f0 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h @@ -0,0 +1,17 @@ +/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */ +/* + * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT + * */ +#define NPY_SIZEOF_SHORT 2 +#define NPY_SIZEOF_INT 4 +#define NPY_SIZEOF_LONG 4 +#define NPY_SIZEOF_FLOAT 4 +#define NPY_SIZEOF_DOUBLE 8 +#define NPY_SIZEOF_LONGDOUBLE 12 +#define NPY_SIZEOF_PY_INTPTR_T 4 +#define NPY_NO_SMP 0 + +#define NPY_SIZEOF_LONGLONG 8 +#define NPY_SIZEOF_PY_LONG_LONG 8 +/* #define CHAR_BIT 8 */ + diff --git a/meta/recipes-devtools/python/python-numpy/i586/config.h b/meta/recipes-devtools/python/python-numpy/i586/config.h new file mode 100644 index 0000000000..08e41e3d99 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/i586/config.h @@ -0,0 +1,108 @@ +#define SIZEOF_PY_INTPTR_T 4 +#define SIZEOF_PY_LONG_LONG 8 +#define MATHLIB m +#define HAVE_SIN +#define HAVE_COS +#define HAVE_TAN +#define HAVE_SINH +#define HAVE_COSH +#define HAVE_TANH +#define HAVE_FABS +#define HAVE_FLOOR +#define HAVE_CEIL +#define HAVE_SQRT +#define HAVE_LOG10 +#define HAVE_LOG +#define HAVE_EXP +#define HAVE_ASIN +#define HAVE_ACOS +#define HAVE_ATAN +#define HAVE_FMOD +#define HAVE_MODF +#define HAVE_FREXP +#define HAVE_LDEXP +#define HAVE_RINT +#define HAVE_TRUNC +#define HAVE_EXP2 +#define HAVE_LOG2 +#define HAVE_ATAN2 +#define HAVE_POW +#define HAVE_NEXTAFTER +#define HAVE_SINF +#define HAVE_COSF +#define HAVE_TANF +#define HAVE_SINHF +#define HAVE_COSHF +#define HAVE_TANHF +#define HAVE_FABSF +#define HAVE_FLOORF +#define HAVE_CEILF +#define HAVE_RINTF +#define HAVE_TRUNCF +#define HAVE_SQRTF +#define HAVE_LOG10F +#define HAVE_LOGF +#define HAVE_LOG1PF +#define HAVE_EXPF +#define HAVE_EXPM1F +#define HAVE_ASINF +#define HAVE_ACOSF +#define HAVE_ATANF +#define HAVE_ASINHF +#define HAVE_ACOSHF +#define HAVE_ATANHF +#define HAVE_HYPOTF +#define HAVE_ATAN2F +#define HAVE_POWF +#define HAVE_FMODF +#define HAVE_MODFF +#define HAVE_FREXPF +#define HAVE_LDEXPF +#define HAVE_EXP2F +#define HAVE_LOG2F +#define HAVE_COPYSIGNF +#define HAVE_NEXTAFTERF +#define HAVE_SINL +#define HAVE_COSL +#define HAVE_TANL +#define HAVE_SINHL +#define HAVE_COSHL +#define HAVE_TANHL +#define HAVE_FABSL +#define HAVE_FLOORL +#define HAVE_CEILL +#define HAVE_RINTL +#define HAVE_TRUNCL +#define HAVE_SQRTL +#define HAVE_LOG10L +#define HAVE_LOGL +#define HAVE_LOG1PL +#define HAVE_EXPL +#define HAVE_EXPM1L +#define HAVE_ASINL +#define HAVE_ACOSL +#define HAVE_ATANL +#define HAVE_ASINHL +#define HAVE_ACOSHL +#define HAVE_ATANHL +#define HAVE_HYPOTL +#define HAVE_ATAN2L +#define HAVE_POWL +#define HAVE_FMODL +#define HAVE_MODFL +#define HAVE_FREXPL +#define HAVE_LDEXPL +#define HAVE_EXP2L +#define HAVE_LOG2L +#define HAVE_COPYSIGNL +#define HAVE_NEXTAFTERL +#define HAVE_DECL_SIGNBIT +#define HAVE_COMPLEX_H +#define HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE 1 +#ifndef __cplusplus +/* #undef inline */ +#endif + +#ifndef _NPY_NPY_CONFIG_H_ +#error config.h should never be included directly, include npy_config.h instead +#endif diff --git a/meta/recipes-devtools/python/python-numpy/i586/numpyconfig.h b/meta/recipes-devtools/python/python-numpy/i586/numpyconfig.h new file mode 100644 index 0000000000..ff7938cd96 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/i586/numpyconfig.h @@ -0,0 +1,24 @@ +#ifndef _NPY_NUMPYCONFIG_H_ +#define _NPY_NUMPYCONFIG_H_ + +#include "_numpyconfig.h" + +/* + * On Mac OS X, because there is only one configuration stage for all the archs + * in universal builds, any macro which depends on the arch needs to be + * harcoded + */ +#ifdef __APPLE__ + #undef NPY_SIZEOF_LONG + #undef NPY_SIZEOF_PY_INTPTR_T + + #ifdef __LP64__ + #define NPY_SIZEOF_LONG 8 + #define NPY_SIZEOF_PY_INTPTR_T 8 + #else + #define NPY_SIZEOF_LONG 4 + #define NPY_SIZEOF_PY_INTPTR_T 4 + #endif +#endif + +#endif diff --git a/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h new file mode 100644 index 0000000000..c0c42851ba --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h @@ -0,0 +1,30 @@ +#define NPY_HAVE_ENDIAN_H 1 +#define NPY_SIZEOF_SHORT SIZEOF_SHORT +#define NPY_SIZEOF_INT SIZEOF_INT +#define NPY_SIZEOF_LONG SIZEOF_LONG +#define NPY_SIZEOF_FLOAT 4 +#define NPY_SIZEOF_COMPLEX_FLOAT 8 +#define NPY_SIZEOF_DOUBLE 8 +#define NPY_SIZEOF_COMPLEX_DOUBLE 16 +#define NPY_SIZEOF_LONGDOUBLE 8 +#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 16 +#define NPY_SIZEOF_PY_INTPTR_T 4 +#define NPY_SIZEOF_PY_LONG_LONG 8 +#define NPY_SIZEOF_LONGLONG 8 +#define NPY_NO_SMP 0 +#define NPY_HAVE_DECL_ISNAN +#define NPY_HAVE_DECL_ISINF +#define NPY_HAVE_DECL_ISFINITE +#define NPY_HAVE_DECL_SIGNBIT +#define NPY_USE_C99_COMPLEX 1 +#define NPY_HAVE_COMPLEX_DOUBLE 1 +#define NPY_HAVE_COMPLEX_FLOAT 1 +#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 +#define NPY_USE_C99_FORMATS 1 +#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) +#define NPY_ABI_VERSION 0x01000009 +#define NPY_API_VERSION 0x00000007 + +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS 1 +#endif diff --git a/meta/recipes-devtools/python/python-numpy/mips/config.h b/meta/recipes-devtools/python/python-numpy/mips/config.h new file mode 100644 index 0000000000..2f6135adce --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mips/config.h @@ -0,0 +1,139 @@ +#define HAVE_ENDIAN_H 1 +#define SIZEOF_PY_INTPTR_T 4 +#define SIZEOF_PY_LONG_LONG 8 +#define MATHLIB m +#define HAVE_SIN 1 +#define HAVE_COS 1 +#define HAVE_TAN 1 +#define HAVE_SINH 1 +#define HAVE_COSH 1 +#define HAVE_TANH 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_CEIL 1 +#define HAVE_SQRT 1 +#define HAVE_LOG10 1 +#define HAVE_LOG 1 +#define HAVE_EXP 1 +#define HAVE_ASIN 1 +#define HAVE_ACOS 1 +#define HAVE_ATAN 1 +#define HAVE_FMOD 1 +#define HAVE_MODF 1 +#define HAVE_FREXP 1 +#define HAVE_LDEXP 1 +#define HAVE_RINT 1 +#define HAVE_TRUNC 1 +#define HAVE_EXP2 1 +#define HAVE_LOG2 1 +#define HAVE_ATAN2 1 +#define HAVE_POW 1 +#define HAVE_NEXTAFTER 1 +#define HAVE_SINF 1 +#define HAVE_COSF 1 +#define HAVE_TANF 1 +#define HAVE_SINHF 1 +#define HAVE_COSHF 1 +#define HAVE_TANHF 1 +#define HAVE_FABSF 1 +#define HAVE_FLOORF 1 +#define HAVE_CEILF 1 +#define HAVE_RINTF 1 +#define HAVE_TRUNCF 1 +#define HAVE_SQRTF 1 +#define HAVE_LOG10F 1 +#define HAVE_LOGF 1 +#define HAVE_LOG1PF 1 +#define HAVE_EXPF 1 +#define HAVE_EXPM1F 1 +#define HAVE_ASINF 1 +#define HAVE_ACOSF 1 +#define HAVE_ATANF 1 +#define HAVE_ASINHF 1 +#define HAVE_ACOSHF 1 +#define HAVE_ATANHF 1 +#define HAVE_HYPOTF 1 +#define HAVE_ATAN2F 1 +#define HAVE_POWF 1 +#define HAVE_FMODF 1 +#define HAVE_MODFF 1 +#define HAVE_FREXPF 1 +#define HAVE_LDEXPF 1 +#define HAVE_EXP2F 1 +#define HAVE_LOG2F 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_NEXTAFTERF 1 +#define HAVE_SINL 1 +#define HAVE_COSL 1 +#define HAVE_TANL 1 +#define HAVE_SINHL 1 +#define HAVE_COSHL 1 +#define HAVE_TANHL 1 +#define HAVE_FABSL 1 +#define HAVE_FLOORL 1 +#define HAVE_CEILL 1 +#define HAVE_RINTL 1 +#define HAVE_TRUNCL 1 +#define HAVE_SQRTL 1 +#define HAVE_LOG10L 1 +#define HAVE_LOGL 1 +#define HAVE_LOG1PL 1 +#define HAVE_EXPL 1 +#define HAVE_EXPM1L 1 +#define HAVE_ASINL 1 +#define HAVE_ACOSL 1 +#define HAVE_ATANL 1 +#define HAVE_ASINHL 1 +#define HAVE_ACOSHL 1 +#define HAVE_ATANHL 1 +#define HAVE_HYPOTL 1 +#define HAVE_ATAN2L 1 +#define HAVE_POWL 1 +#define HAVE_FMODL 1 +#define HAVE_MODFL 1 +#define HAVE_FREXPL 1 +#define HAVE_LDEXPL 1 +#define HAVE_EXP2L 1 +#define HAVE_LOG2L 1 +#define HAVE_COPYSIGNL 1 +#define HAVE_NEXTAFTERL 1 +#define HAVE_DECL_SIGNBIT +#define HAVE_COMPLEX_H 1 +#define HAVE_CREAL 1 +#define HAVE_CIMAG 1 +#define HAVE_CABS 1 +#define HAVE_CARG 1 +#define HAVE_CEXP 1 +#define HAVE_CSQRT 1 +#define HAVE_CLOG 1 +#define HAVE_CCOS 1 +#define HAVE_CSIN 1 +#define HAVE_CPOW 1 +#define HAVE_CREALF 1 +#define HAVE_CIMAGF 1 +#define HAVE_CABSF 1 +#define HAVE_CARGF 1 +#define HAVE_CEXPF 1 +#define HAVE_CSQRTF 1 +#define HAVE_CLOGF 1 +#define HAVE_CCOSF 1 +#define HAVE_CSINF 1 +#define HAVE_CPOWF 1 +#define HAVE_CREALL 1 +#define HAVE_CIMAGL 1 +#define HAVE_CABSL 1 +#define HAVE_CARGL 1 +#define HAVE_CEXPL 1 +#define HAVE_CSQRTL 1 +#define HAVE_CLOGL 1 +#define HAVE_CCOSL 1 +#define HAVE_CSINL 1 +#define HAVE_CPOWL 1 +#define HAVE_LDOUBLE_IEEE_DOUBLE_BE 1 +#ifndef __cplusplus +/* #undef inline */ +#endif + +#ifndef _NPY_NPY_CONFIG_H_ +#error config.h should never be included directly, include npy_config.h instead +#endif diff --git a/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h new file mode 100644 index 0000000000..be57ac27bf --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h @@ -0,0 +1,30 @@ +#define NPY_HAVE_ENDIAN_H 1 +#define NPY_SIZEOF_SHORT SIZEOF_SHORT +#define NPY_SIZEOF_INT SIZEOF_INT +#define NPY_SIZEOF_LONG SIZEOF_LONG +#define NPY_SIZEOF_FLOAT 4 +#define NPY_SIZEOF_COMPLEX_FLOAT 8 +#define NPY_SIZEOF_DOUBLE 8 +#define NPY_SIZEOF_COMPLEX_DOUBLE 16 +#define NPY_SIZEOF_LONGDOUBLE 16 +#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 +#define NPY_SIZEOF_PY_INTPTR_T 8 +#define NPY_SIZEOF_PY_LONG_LONG 8 +#define NPY_SIZEOF_LONGLONG 8 +#define NPY_NO_SMP 0 +#define NPY_HAVE_DECL_ISNAN +#define NPY_HAVE_DECL_ISINF +#define NPY_HAVE_DECL_ISFINITE +#define NPY_HAVE_DECL_SIGNBIT +#define NPY_USE_C99_COMPLEX 1 +#define NPY_HAVE_COMPLEX_DOUBLE 1 +#define NPY_HAVE_COMPLEX_FLOAT 1 +#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 +#define NPY_USE_C99_FORMATS 1 +#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) +#define NPY_ABI_VERSION 0x01000009 +#define NPY_API_VERSION 0x00000007 + +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS 1 +#endif diff --git a/meta/recipes-devtools/python/python-numpy/mips64/config.h b/meta/recipes-devtools/python/python-numpy/mips64/config.h new file mode 100644 index 0000000000..c30b868f2f --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mips64/config.h @@ -0,0 +1,139 @@ +#define HAVE_ENDIAN_H 1 +#define SIZEOF_PY_INTPTR_T 8 +#define SIZEOF_PY_LONG_LONG 8 +#define MATHLIB m +#define HAVE_SIN 1 +#define HAVE_COS 1 +#define HAVE_TAN 1 +#define HAVE_SINH 1 +#define HAVE_COSH 1 +#define HAVE_TANH 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_CEIL 1 +#define HAVE_SQRT 1 +#define HAVE_LOG10 1 +#define HAVE_LOG 1 +#define HAVE_EXP 1 +#define HAVE_ASIN 1 +#define HAVE_ACOS 1 +#define HAVE_ATAN 1 +#define HAVE_FMOD 1 +#define HAVE_MODF 1 +#define HAVE_FREXP 1 +#define HAVE_LDEXP 1 +#define HAVE_RINT 1 +#define HAVE_TRUNC 1 +#define HAVE_EXP2 1 +#define HAVE_LOG2 1 +#define HAVE_ATAN2 1 +#define HAVE_POW 1 +#define HAVE_NEXTAFTER 1 +#define HAVE_SINF 1 +#define HAVE_COSF 1 +#define HAVE_TANF 1 +#define HAVE_SINHF 1 +#define HAVE_COSHF 1 +#define HAVE_TANHF 1 +#define HAVE_FABSF 1 +#define HAVE_FLOORF 1 +#define HAVE_CEILF 1 +#define HAVE_RINTF 1 +#define HAVE_TRUNCF 1 +#define HAVE_SQRTF 1 +#define HAVE_LOG10F 1 +#define HAVE_LOGF 1 +#define HAVE_LOG1PF 1 +#define HAVE_EXPF 1 +#define HAVE_EXPM1F 1 +#define HAVE_ASINF 1 +#define HAVE_ACOSF 1 +#define HAVE_ATANF 1 +#define HAVE_ASINHF 1 +#define HAVE_ACOSHF 1 +#define HAVE_ATANHF 1 +#define HAVE_HYPOTF 1 +#define HAVE_ATAN2F 1 +#define HAVE_POWF 1 +#define HAVE_FMODF 1 +#define HAVE_MODFF 1 +#define HAVE_FREXPF 1 +#define HAVE_LDEXPF 1 +#define HAVE_EXP2F 1 +#define HAVE_LOG2F 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_NEXTAFTERF 1 +#define HAVE_SINL 1 +#define HAVE_COSL 1 +#define HAVE_TANL 1 +#define HAVE_SINHL 1 +#define HAVE_COSHL 1 +#define HAVE_TANHL 1 +#define HAVE_FABSL 1 +#define HAVE_FLOORL 1 +#define HAVE_CEILL 1 +#define HAVE_RINTL 1 +#define HAVE_TRUNCL 1 +#define HAVE_SQRTL 1 +#define HAVE_LOG10L 1 +#define HAVE_LOGL 1 +#define HAVE_LOG1PL 1 +#define HAVE_EXPL 1 +#define HAVE_EXPM1L 1 +#define HAVE_ASINL 1 +#define HAVE_ACOSL 1 +#define HAVE_ATANL 1 +#define HAVE_ASINHL 1 +#define HAVE_ACOSHL 1 +#define HAVE_ATANHL 1 +#define HAVE_HYPOTL 1 +#define HAVE_ATAN2L 1 +#define HAVE_POWL 1 +#define HAVE_FMODL 1 +#define HAVE_MODFL 1 +#define HAVE_FREXPL 1 +#define HAVE_LDEXPL 1 +#define HAVE_EXP2L 1 +#define HAVE_LOG2L 1 +#define HAVE_COPYSIGNL 1 +#define HAVE_NEXTAFTERL 1 +#define HAVE_DECL_SIGNBIT +#define HAVE_COMPLEX_H 1 +#define HAVE_CREAL 1 +#define HAVE_CIMAG 1 +#define HAVE_CABS 1 +#define HAVE_CARG 1 +#define HAVE_CEXP 1 +#define HAVE_CSQRT 1 +#define HAVE_CLOG 1 +#define HAVE_CCOS 1 +#define HAVE_CSIN 1 +#define HAVE_CPOW 1 +#define HAVE_CREALF 1 +#define HAVE_CIMAGF 1 +#define HAVE_CABSF 1 +#define HAVE_CARGF 1 +#define HAVE_CEXPF 1 +#define HAVE_CSQRTF 1 +#define HAVE_CLOGF 1 +#define HAVE_CCOSF 1 +#define HAVE_CSINF 1 +#define HAVE_CPOWF 1 +#define HAVE_CREALL 1 +#define HAVE_CIMAGL 1 +#define HAVE_CABSL 1 +#define HAVE_CARGL 1 +#define HAVE_CEXPL 1 +#define HAVE_CSQRTL 1 +#define HAVE_CLOGL 1 +#define HAVE_CCOSL 1 +#define HAVE_CSINL 1 +#define HAVE_CPOWL 1 +#define HAVE_LDOUBLE_IEEE_QUAD_LE 1 +#ifndef __cplusplus +/* #undef inline */ +#endif + +#ifndef _NPY_NPY_CONFIG_H_ +#error config.h should never be included directly, include npy_config.h instead +#endif diff --git a/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h new file mode 100644 index 0000000000..be57ac27bf --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h @@ -0,0 +1,30 @@ +#define NPY_HAVE_ENDIAN_H 1 +#define NPY_SIZEOF_SHORT SIZEOF_SHORT +#define NPY_SIZEOF_INT SIZEOF_INT +#define NPY_SIZEOF_LONG SIZEOF_LONG +#define NPY_SIZEOF_FLOAT 4 +#define NPY_SIZEOF_COMPLEX_FLOAT 8 +#define NPY_SIZEOF_DOUBLE 8 +#define NPY_SIZEOF_COMPLEX_DOUBLE 16 +#define NPY_SIZEOF_LONGDOUBLE 16 +#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 +#define NPY_SIZEOF_PY_INTPTR_T 8 +#define NPY_SIZEOF_PY_LONG_LONG 8 +#define NPY_SIZEOF_LONGLONG 8 +#define NPY_NO_SMP 0 +#define NPY_HAVE_DECL_ISNAN +#define NPY_HAVE_DECL_ISINF +#define NPY_HAVE_DECL_ISFINITE +#define NPY_HAVE_DECL_SIGNBIT +#define NPY_USE_C99_COMPLEX 1 +#define NPY_HAVE_COMPLEX_DOUBLE 1 +#define NPY_HAVE_COMPLEX_FLOAT 1 +#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 +#define NPY_USE_C99_FORMATS 1 +#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) +#define NPY_ABI_VERSION 0x01000009 +#define NPY_API_VERSION 0x00000007 + +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS 1 +#endif diff --git a/meta/recipes-devtools/python/python-numpy/mips64n32/config.h b/meta/recipes-devtools/python/python-numpy/mips64n32/config.h new file mode 100644 index 0000000000..c30b868f2f --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mips64n32/config.h @@ -0,0 +1,139 @@ +#define HAVE_ENDIAN_H 1 +#define SIZEOF_PY_INTPTR_T 8 +#define SIZEOF_PY_LONG_LONG 8 +#define MATHLIB m +#define HAVE_SIN 1 +#define HAVE_COS 1 +#define HAVE_TAN 1 +#define HAVE_SINH 1 +#define HAVE_COSH 1 +#define HAVE_TANH 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_CEIL 1 +#define HAVE_SQRT 1 +#define HAVE_LOG10 1 +#define HAVE_LOG 1 +#define HAVE_EXP 1 +#define HAVE_ASIN 1 +#define HAVE_ACOS 1 +#define HAVE_ATAN 1 +#define HAVE_FMOD 1 +#define HAVE_MODF 1 +#define HAVE_FREXP 1 +#define HAVE_LDEXP 1 +#define HAVE_RINT 1 +#define HAVE_TRUNC 1 +#define HAVE_EXP2 1 +#define HAVE_LOG2 1 +#define HAVE_ATAN2 1 +#define HAVE_POW 1 +#define HAVE_NEXTAFTER 1 +#define HAVE_SINF 1 +#define HAVE_COSF 1 +#define HAVE_TANF 1 +#define HAVE_SINHF 1 +#define HAVE_COSHF 1 +#define HAVE_TANHF 1 +#define HAVE_FABSF 1 +#define HAVE_FLOORF 1 +#define HAVE_CEILF 1 +#define HAVE_RINTF 1 +#define HAVE_TRUNCF 1 +#define HAVE_SQRTF 1 +#define HAVE_LOG10F 1 +#define HAVE_LOGF 1 +#define HAVE_LOG1PF 1 +#define HAVE_EXPF 1 +#define HAVE_EXPM1F 1 +#define HAVE_ASINF 1 +#define HAVE_ACOSF 1 +#define HAVE_ATANF 1 +#define HAVE_ASINHF 1 +#define HAVE_ACOSHF 1 +#define HAVE_ATANHF 1 +#define HAVE_HYPOTF 1 +#define HAVE_ATAN2F 1 +#define HAVE_POWF 1 +#define HAVE_FMODF 1 +#define HAVE_MODFF 1 +#define HAVE_FREXPF 1 +#define HAVE_LDEXPF 1 +#define HAVE_EXP2F 1 +#define HAVE_LOG2F 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_NEXTAFTERF 1 +#define HAVE_SINL 1 +#define HAVE_COSL 1 +#define HAVE_TANL 1 +#define HAVE_SINHL 1 +#define HAVE_COSHL 1 +#define HAVE_TANHL 1 +#define HAVE_FABSL 1 +#define HAVE_FLOORL 1 +#define HAVE_CEILL 1 +#define HAVE_RINTL 1 +#define HAVE_TRUNCL 1 +#define HAVE_SQRTL 1 +#define HAVE_LOG10L 1 +#define HAVE_LOGL 1 +#define HAVE_LOG1PL 1 +#define HAVE_EXPL 1 +#define HAVE_EXPM1L 1 +#define HAVE_ASINL 1 +#define HAVE_ACOSL 1 +#define HAVE_ATANL 1 +#define HAVE_ASINHL 1 +#define HAVE_ACOSHL 1 +#define HAVE_ATANHL 1 +#define HAVE_HYPOTL 1 +#define HAVE_ATAN2L 1 +#define HAVE_POWL 1 +#define HAVE_FMODL 1 +#define HAVE_MODFL 1 +#define HAVE_FREXPL 1 +#define HAVE_LDEXPL 1 +#define HAVE_EXP2L 1 +#define HAVE_LOG2L 1 +#define HAVE_COPYSIGNL 1 +#define HAVE_NEXTAFTERL 1 +#define HAVE_DECL_SIGNBIT +#define HAVE_COMPLEX_H 1 +#define HAVE_CREAL 1 +#define HAVE_CIMAG 1 +#define HAVE_CABS 1 +#define HAVE_CARG 1 +#define HAVE_CEXP 1 +#define HAVE_CSQRT 1 +#define HAVE_CLOG 1 +#define HAVE_CCOS 1 +#define HAVE_CSIN 1 +#define HAVE_CPOW 1 +#define HAVE_CREALF 1 +#define HAVE_CIMAGF 1 +#define HAVE_CABSF 1 +#define HAVE_CARGF 1 +#define HAVE_CEXPF 1 +#define HAVE_CSQRTF 1 +#define HAVE_CLOGF 1 +#define HAVE_CCOSF 1 +#define HAVE_CSINF 1 +#define HAVE_CPOWF 1 +#define HAVE_CREALL 1 +#define HAVE_CIMAGL 1 +#define HAVE_CABSL 1 +#define HAVE_CARGL 1 +#define HAVE_CEXPL 1 +#define HAVE_CSQRTL 1 +#define HAVE_CLOGL 1 +#define HAVE_CCOSL 1 +#define HAVE_CSINL 1 +#define HAVE_CPOWL 1 +#define HAVE_LDOUBLE_IEEE_QUAD_LE 1 +#ifndef __cplusplus +/* #undef inline */ +#endif + +#ifndef _NPY_NPY_CONFIG_H_ +#error config.h should never be included directly, include npy_config.h instead +#endif diff --git a/meta/recipes-devtools/python/python-numpy/mipsel/config.h b/meta/recipes-devtools/python/python-numpy/mipsel/config.h new file mode 100644 index 0000000000..17ef186d56 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mipsel/config.h @@ -0,0 +1,21 @@ +/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */ +/* #define SIZEOF_SHORT 2 */ +/* #define SIZEOF_INT 4 */ +/* #define SIZEOF_LONG 4 */ +/* #define SIZEOF_FLOAT 4 */ +/* #define SIZEOF_DOUBLE 8 */ +#define SIZEOF_LONG_DOUBLE 12 +#define SIZEOF_PY_INTPTR_T 4 +/* #define SIZEOF_LONG_LONG 8 */ +#define SIZEOF_PY_LONG_LONG 8 +/* #define CHAR_BIT 8 */ +#define MATHLIB m +#define HAVE_FLOAT_FUNCS +#define HAVE_LOG1P +#define HAVE_EXPM1 +#define HAVE_INVERSE_HYPERBOLIC +#define HAVE_INVERSE_HYPERBOLIC_FLOAT +#define HAVE_ISNAN +#define HAVE_ISINF +#define HAVE_RINT + diff --git a/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h b/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h new file mode 100644 index 0000000000..c4bf6547f0 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h @@ -0,0 +1,17 @@ +/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */ +/* + * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT + * */ +#define NPY_SIZEOF_SHORT 2 +#define NPY_SIZEOF_INT 4 +#define NPY_SIZEOF_LONG 4 +#define NPY_SIZEOF_FLOAT 4 +#define NPY_SIZEOF_DOUBLE 8 +#define NPY_SIZEOF_LONGDOUBLE 12 +#define NPY_SIZEOF_PY_INTPTR_T 4 +#define NPY_NO_SMP 0 + +#define NPY_SIZEOF_LONGLONG 8 +#define NPY_SIZEOF_PY_LONG_LONG 8 +/* #define CHAR_BIT 8 */ + diff --git a/meta/recipes-devtools/python/python-numpy/no-host-paths.patch b/meta/recipes-devtools/python/python-numpy/no-host-paths.patch new file mode 100644 index 0000000000..0efb01a6bb --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/no-host-paths.patch @@ -0,0 +1,57 @@ +Don't search /usr and so on for libraries by default to avoid host contamination. + +Upstream-Status: Inapproprite (As the code stands, this is a hack) +Signed-off-by: Ross Burton + +diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py +index bac90fb..a63d796 100644 +--- a/numpy/distutils/system_info.py ++++ b/numpy/distutils/system_info.py +@@ -191,41 +191,12 @@ if sys.platform == 'win32': + default_x11_lib_dirs = [] + default_x11_include_dirs = [] + else: +- default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib', +- '/opt/local/lib', '/sw/lib'], platform_bits) +- default_include_dirs = ['/usr/local/include', +- '/opt/include', '/usr/include', +- # path of umfpack under macports +- '/opt/local/include/ufsparse', +- '/opt/local/include', '/sw/include', +- '/usr/include/suitesparse'] +- default_src_dirs = ['.', '/usr/local/src', '/opt/src', '/sw/src'] +- +- default_x11_lib_dirs = libpaths(['/usr/X11R6/lib', '/usr/X11/lib', +- '/usr/lib'], platform_bits) +- default_x11_include_dirs = ['/usr/X11R6/include', '/usr/X11/include', +- '/usr/include'] +- +- if os.path.exists('/usr/lib/X11'): +- globbed_x11_dir = glob('/usr/lib/*/libX11.so') +- if globbed_x11_dir: +- x11_so_dir = os.path.split(globbed_x11_dir[0])[0] +- default_x11_lib_dirs.extend([x11_so_dir, '/usr/lib/X11']) +- default_x11_include_dirs.extend(['/usr/lib/X11/include', +- '/usr/include/X11']) +- +- import subprocess as sp +- try: +- p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE, +- stderr=open(os.devnull, 'w')) +- except OSError: +- pass # gcc is not installed +- else: +- triplet = str(p.communicate()[0].decode().strip()) +- if p.returncode == 0: +- # gcc supports the "-print-multiarch" option +- default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)] +- default_lib_dirs += [os.path.join("/usr/lib/", triplet)] ++ default_lib_dirs = libpaths(['/deadir/lib'], platform_bits) ++ default_include_dirs = ['/deaddir/include'] ++ default_src_dirs = ['.', '/deaddir/src'] ++ ++ default_x11_lib_dirs = libpaths(['/deaddir/lib'], platform_bits) ++ default_x11_include_dirs = ['/deaddir/include'] + + if os.path.join(sys.prefix, 'lib') not in default_lib_dirs: + default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib')) diff --git a/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h new file mode 100644 index 0000000000..73cbfb1baa --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h @@ -0,0 +1,30 @@ +#define NPY_HAVE_ENDIAN_H 1 +#define NPY_SIZEOF_SHORT SIZEOF_SHORT +#define NPY_SIZEOF_INT SIZEOF_INT +#define NPY_SIZEOF_LONG SIZEOF_LONG +#define NPY_SIZEOF_FLOAT 4 +#define NPY_SIZEOF_COMPLEX_FLOAT 8 +#define NPY_SIZEOF_DOUBLE 8 +#define NPY_SIZEOF_COMPLEX_DOUBLE 16 +#define NPY_SIZEOF_LONGDOUBLE 16 +#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 +#define NPY_SIZEOF_PY_INTPTR_T 4 +#define NPY_SIZEOF_PY_LONG_LONG 8 +#define NPY_SIZEOF_LONGLONG 8 +#define NPY_NO_SMP 0 +#define NPY_HAVE_DECL_ISNAN +#define NPY_HAVE_DECL_ISINF +#define NPY_HAVE_DECL_ISFINITE +#define NPY_HAVE_DECL_SIGNBIT +#define NPY_USE_C99_COMPLEX 1 +#define NPY_HAVE_COMPLEX_DOUBLE 1 +#define NPY_HAVE_COMPLEX_FLOAT 1 +#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 +#define NPY_USE_C99_FORMATS 1 +#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) +#define NPY_ABI_VERSION 0x01000009 +#define NPY_API_VERSION 0x00000007 + +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS 1 +#endif diff --git a/meta/recipes-devtools/python/python-numpy/powerpc/config.h b/meta/recipes-devtools/python/python-numpy/powerpc/config.h new file mode 100644 index 0000000000..f65d39d5de --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/powerpc/config.h @@ -0,0 +1,139 @@ +#define HAVE_ENDIAN_H 1 +#define SIZEOF_PY_INTPTR_T 4 +#define SIZEOF_PY_LONG_LONG 8 +#define MATHLIB m +#define HAVE_SIN 1 +#define HAVE_COS 1 +#define HAVE_TAN 1 +#define HAVE_SINH 1 +#define HAVE_COSH 1 +#define HAVE_TANH 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_CEIL 1 +#define HAVE_SQRT 1 +#define HAVE_LOG10 1 +#define HAVE_LOG 1 +#define HAVE_EXP 1 +#define HAVE_ASIN 1 +#define HAVE_ACOS 1 +#define HAVE_ATAN 1 +#define HAVE_FMOD 1 +#define HAVE_MODF 1 +#define HAVE_FREXP 1 +#define HAVE_LDEXP 1 +#define HAVE_RINT 1 +#define HAVE_TRUNC 1 +#define HAVE_EXP2 1 +#define HAVE_LOG2 1 +#define HAVE_ATAN2 1 +#define HAVE_POW 1 +#define HAVE_NEXTAFTER 1 +#define HAVE_SINF 1 +#define HAVE_COSF 1 +#define HAVE_TANF 1 +#define HAVE_SINHF 1 +#define HAVE_COSHF 1 +#define HAVE_TANHF 1 +#define HAVE_FABSF 1 +#define HAVE_FLOORF 1 +#define HAVE_CEILF 1 +#define HAVE_RINTF 1 +#define HAVE_TRUNCF 1 +#define HAVE_SQRTF 1 +#define HAVE_LOG10F 1 +#define HAVE_LOGF 1 +#define HAVE_LOG1PF 1 +#define HAVE_EXPF 1 +#define HAVE_EXPM1F 1 +#define HAVE_ASINF 1 +#define HAVE_ACOSF 1 +#define HAVE_ATANF 1 +#define HAVE_ASINHF 1 +#define HAVE_ACOSHF 1 +#define HAVE_ATANHF 1 +#define HAVE_HYPOTF 1 +#define HAVE_ATAN2F 1 +#define HAVE_POWF 1 +#define HAVE_FMODF 1 +#define HAVE_MODFF 1 +#define HAVE_FREXPF 1 +#define HAVE_LDEXPF 1 +#define HAVE_EXP2F 1 +#define HAVE_LOG2F 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_NEXTAFTERF 1 +#define HAVE_SINL 1 +#define HAVE_COSL 1 +#define HAVE_TANL 1 +#define HAVE_SINHL 1 +#define HAVE_COSHL 1 +#define HAVE_TANHL 1 +#define HAVE_FABSL 1 +#define HAVE_FLOORL 1 +#define HAVE_CEILL 1 +#define HAVE_RINTL 1 +#define HAVE_TRUNCL 1 +#define HAVE_SQRTL 1 +#define HAVE_LOG10L 1 +#define HAVE_LOGL 1 +#define HAVE_LOG1PL 1 +#define HAVE_EXPL 1 +#define HAVE_EXPM1L 1 +#define HAVE_ASINL 1 +#define HAVE_ACOSL 1 +#define HAVE_ATANL 1 +#define HAVE_ASINHL 1 +#define HAVE_ACOSHL 1 +#define HAVE_ATANHL 1 +#define HAVE_HYPOTL 1 +#define HAVE_ATAN2L 1 +#define HAVE_POWL 1 +#define HAVE_FMODL 1 +#define HAVE_MODFL 1 +#define HAVE_FREXPL 1 +#define HAVE_LDEXPL 1 +#define HAVE_EXP2L 1 +#define HAVE_LOG2L 1 +#define HAVE_COPYSIGNL 1 +#define HAVE_NEXTAFTERL 1 +#define HAVE_DECL_SIGNBIT +#define HAVE_COMPLEX_H 1 +#define HAVE_CREAL 1 +#define HAVE_CIMAG 1 +#define HAVE_CABS 1 +#define HAVE_CARG 1 +#define HAVE_CEXP 1 +#define HAVE_CSQRT 1 +#define HAVE_CLOG 1 +#define HAVE_CCOS 1 +#define HAVE_CSIN 1 +#define HAVE_CPOW 1 +#define HAVE_CREALF 1 +#define HAVE_CIMAGF 1 +#define HAVE_CABSF 1 +#define HAVE_CARGF 1 +#define HAVE_CEXPF 1 +#define HAVE_CSQRTF 1 +#define HAVE_CLOGF 1 +#define HAVE_CCOSF 1 +#define HAVE_CSINF 1 +#define HAVE_CPOWF 1 +#define HAVE_CREALL 1 +#define HAVE_CIMAGL 1 +#define HAVE_CABSL 1 +#define HAVE_CARGL 1 +#define HAVE_CEXPL 1 +#define HAVE_CSQRTL 1 +#define HAVE_CLOGL 1 +#define HAVE_CCOSL 1 +#define HAVE_CSINL 1 +#define HAVE_CPOWL 1 +#define HAVE_LDOUBLE_DOUBLE_DOUBLE_BE 1 +#ifndef __cplusplus +/* #undef inline */ +#endif + +#ifndef _NPY_NPY_CONFIG_H_ +#error config.h should never be included directly, include npy_config.h instead +#endif diff --git a/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h new file mode 100644 index 0000000000..be57ac27bf --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h @@ -0,0 +1,30 @@ +#define NPY_HAVE_ENDIAN_H 1 +#define NPY_SIZEOF_SHORT SIZEOF_SHORT +#define NPY_SIZEOF_INT SIZEOF_INT +#define NPY_SIZEOF_LONG SIZEOF_LONG +#define NPY_SIZEOF_FLOAT 4 +#define NPY_SIZEOF_COMPLEX_FLOAT 8 +#define NPY_SIZEOF_DOUBLE 8 +#define NPY_SIZEOF_COMPLEX_DOUBLE 16 +#define NPY_SIZEOF_LONGDOUBLE 16 +#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 +#define NPY_SIZEOF_PY_INTPTR_T 8 +#define NPY_SIZEOF_PY_LONG_LONG 8 +#define NPY_SIZEOF_LONGLONG 8 +#define NPY_NO_SMP 0 +#define NPY_HAVE_DECL_ISNAN +#define NPY_HAVE_DECL_ISINF +#define NPY_HAVE_DECL_ISFINITE +#define NPY_HAVE_DECL_SIGNBIT +#define NPY_USE_C99_COMPLEX 1 +#define NPY_HAVE_COMPLEX_DOUBLE 1 +#define NPY_HAVE_COMPLEX_FLOAT 1 +#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 +#define NPY_USE_C99_FORMATS 1 +#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) +#define NPY_ABI_VERSION 0x01000009 +#define NPY_API_VERSION 0x00000007 + +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS 1 +#endif diff --git a/meta/recipes-devtools/python/python-numpy/powerpc64/config.h b/meta/recipes-devtools/python/python-numpy/powerpc64/config.h new file mode 100644 index 0000000000..c30b868f2f --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/powerpc64/config.h @@ -0,0 +1,139 @@ +#define HAVE_ENDIAN_H 1 +#define SIZEOF_PY_INTPTR_T 8 +#define SIZEOF_PY_LONG_LONG 8 +#define MATHLIB m +#define HAVE_SIN 1 +#define HAVE_COS 1 +#define HAVE_TAN 1 +#define HAVE_SINH 1 +#define HAVE_COSH 1 +#define HAVE_TANH 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_CEIL 1 +#define HAVE_SQRT 1 +#define HAVE_LOG10 1 +#define HAVE_LOG 1 +#define HAVE_EXP 1 +#define HAVE_ASIN 1 +#define HAVE_ACOS 1 +#define HAVE_ATAN 1 +#define HAVE_FMOD 1 +#define HAVE_MODF 1 +#define HAVE_FREXP 1 +#define HAVE_LDEXP 1 +#define HAVE_RINT 1 +#define HAVE_TRUNC 1 +#define HAVE_EXP2 1 +#define HAVE_LOG2 1 +#define HAVE_ATAN2 1 +#define HAVE_POW 1 +#define HAVE_NEXTAFTER 1 +#define HAVE_SINF 1 +#define HAVE_COSF 1 +#define HAVE_TANF 1 +#define HAVE_SINHF 1 +#define HAVE_COSHF 1 +#define HAVE_TANHF 1 +#define HAVE_FABSF 1 +#define HAVE_FLOORF 1 +#define HAVE_CEILF 1 +#define HAVE_RINTF 1 +#define HAVE_TRUNCF 1 +#define HAVE_SQRTF 1 +#define HAVE_LOG10F 1 +#define HAVE_LOGF 1 +#define HAVE_LOG1PF 1 +#define HAVE_EXPF 1 +#define HAVE_EXPM1F 1 +#define HAVE_ASINF 1 +#define HAVE_ACOSF 1 +#define HAVE_ATANF 1 +#define HAVE_ASINHF 1 +#define HAVE_ACOSHF 1 +#define HAVE_ATANHF 1 +#define HAVE_HYPOTF 1 +#define HAVE_ATAN2F 1 +#define HAVE_POWF 1 +#define HAVE_FMODF 1 +#define HAVE_MODFF 1 +#define HAVE_FREXPF 1 +#define HAVE_LDEXPF 1 +#define HAVE_EXP2F 1 +#define HAVE_LOG2F 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_NEXTAFTERF 1 +#define HAVE_SINL 1 +#define HAVE_COSL 1 +#define HAVE_TANL 1 +#define HAVE_SINHL 1 +#define HAVE_COSHL 1 +#define HAVE_TANHL 1 +#define HAVE_FABSL 1 +#define HAVE_FLOORL 1 +#define HAVE_CEILL 1 +#define HAVE_RINTL 1 +#define HAVE_TRUNCL 1 +#define HAVE_SQRTL 1 +#define HAVE_LOG10L 1 +#define HAVE_LOGL 1 +#define HAVE_LOG1PL 1 +#define HAVE_EXPL 1 +#define HAVE_EXPM1L 1 +#define HAVE_ASINL 1 +#define HAVE_ACOSL 1 +#define HAVE_ATANL 1 +#define HAVE_ASINHL 1 +#define HAVE_ACOSHL 1 +#define HAVE_ATANHL 1 +#define HAVE_HYPOTL 1 +#define HAVE_ATAN2L 1 +#define HAVE_POWL 1 +#define HAVE_FMODL 1 +#define HAVE_MODFL 1 +#define HAVE_FREXPL 1 +#define HAVE_LDEXPL 1 +#define HAVE_EXP2L 1 +#define HAVE_LOG2L 1 +#define HAVE_COPYSIGNL 1 +#define HAVE_NEXTAFTERL 1 +#define HAVE_DECL_SIGNBIT +#define HAVE_COMPLEX_H 1 +#define HAVE_CREAL 1 +#define HAVE_CIMAG 1 +#define HAVE_CABS 1 +#define HAVE_CARG 1 +#define HAVE_CEXP 1 +#define HAVE_CSQRT 1 +#define HAVE_CLOG 1 +#define HAVE_CCOS 1 +#define HAVE_CSIN 1 +#define HAVE_CPOW 1 +#define HAVE_CREALF 1 +#define HAVE_CIMAGF 1 +#define HAVE_CABSF 1 +#define HAVE_CARGF 1 +#define HAVE_CEXPF 1 +#define HAVE_CSQRTF 1 +#define HAVE_CLOGF 1 +#define HAVE_CCOSF 1 +#define HAVE_CSINF 1 +#define HAVE_CPOWF 1 +#define HAVE_CREALL 1 +#define HAVE_CIMAGL 1 +#define HAVE_CABSL 1 +#define HAVE_CARGL 1 +#define HAVE_CEXPL 1 +#define HAVE_CSQRTL 1 +#define HAVE_CLOGL 1 +#define HAVE_CCOSL 1 +#define HAVE_CSINL 1 +#define HAVE_CPOWL 1 +#define HAVE_LDOUBLE_IEEE_QUAD_LE 1 +#ifndef __cplusplus +/* #undef inline */ +#endif + +#ifndef _NPY_NPY_CONFIG_H_ +#error config.h should never be included directly, include npy_config.h instead +#endif diff --git a/meta/recipes-devtools/python/python-numpy/trycompile.diff b/meta/recipes-devtools/python/python-numpy/trycompile.diff new file mode 100644 index 0000000000..6824227cff --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/trycompile.diff @@ -0,0 +1,36 @@ +Upstream-Status: Pending +Signed-off-by: Koen Kooi + +--- /tmp/setup.py 2008-09-01 10:37:44.000000000 +0200 ++++ numpy-1.1.1/numpy/core/setup.py 2008-09-01 10:38:20.373198000 +0200 +@@ -80,8 +80,7 @@ + raise SystemError,\ + "Non-existing %s. Perhaps you need to install"\ + " python-dev|python-devel." % (python_h) +- result = config_cmd.try_run(tc,include_dirs=[python_include], +- library_dirs = default_lib_dirs) ++ result = config_cmd.try_compile(tc) + if not result: + raise SystemError,"Failed to test configuration. "\ + "See previous error messages for more information." +@@ -95,7 +94,7 @@ + if mathlib: + mathlibs_choices.insert(0,mathlib.split(',')) + for libs in mathlibs_choices: +- if config_cmd.try_run(tc,libraries=libs): ++ if config_cmd.try_compile(tc): + mathlibs = libs + break + else: +@@ -180,10 +179,7 @@ + " python-dev|python-devel." % (python_h) + + config.numpy_include_dirs +- result = config_cmd.try_run(testcode, +- include_dirs = [python_include] + \ +- config.numpy_include_dirs, +- library_dirs = default_lib_dirs) ++ result = config_cmd.try_compile(testcode) + + if not result: + raise SystemError,"Failed to generate numpy configuration. "\ diff --git a/meta/recipes-devtools/python/python-numpy/unbreak-assumptions.diff b/meta/recipes-devtools/python/python-numpy/unbreak-assumptions.diff new file mode 100644 index 0000000000..20ec6fdbc7 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/unbreak-assumptions.diff @@ -0,0 +1,19 @@ +Upstream-Status: Inappropriate +Signed-off-by: Koen Kooi + +--- /tmp/system_info.py 2008-08-22 00:38:16.000000000 +0200 ++++ numpy-1.1.1/numpy/distutils/system_info.py 2008-08-22 00:40:33.013198000 +0200 +@@ -137,11 +137,8 @@ + default_x11_lib_dirs = [] + default_x11_include_dirs = [] + else: +- default_lib_dirs = ['/usr/local/lib', '/opt/lib', '/usr/lib', +- '/opt/local/lib', '/sw/lib'] +- default_include_dirs = ['/usr/local/include', +- '/opt/include', '/usr/include', +- '/opt/local/include', '/sw/include'] ++ default_lib_dirs = ['/non-existant-dir'] ++ default_include_dirs = ['non-existant-dir'] + default_src_dirs = ['.','/usr/local/src', '/opt/src','/sw/src'] + + try: diff --git a/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h new file mode 100644 index 0000000000..be57ac27bf --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h @@ -0,0 +1,30 @@ +#define NPY_HAVE_ENDIAN_H 1 +#define NPY_SIZEOF_SHORT SIZEOF_SHORT +#define NPY_SIZEOF_INT SIZEOF_INT +#define NPY_SIZEOF_LONG SIZEOF_LONG +#define NPY_SIZEOF_FLOAT 4 +#define NPY_SIZEOF_COMPLEX_FLOAT 8 +#define NPY_SIZEOF_DOUBLE 8 +#define NPY_SIZEOF_COMPLEX_DOUBLE 16 +#define NPY_SIZEOF_LONGDOUBLE 16 +#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 +#define NPY_SIZEOF_PY_INTPTR_T 8 +#define NPY_SIZEOF_PY_LONG_LONG 8 +#define NPY_SIZEOF_LONGLONG 8 +#define NPY_NO_SMP 0 +#define NPY_HAVE_DECL_ISNAN +#define NPY_HAVE_DECL_ISINF +#define NPY_HAVE_DECL_ISFINITE +#define NPY_HAVE_DECL_SIGNBIT +#define NPY_USE_C99_COMPLEX 1 +#define NPY_HAVE_COMPLEX_DOUBLE 1 +#define NPY_HAVE_COMPLEX_FLOAT 1 +#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 +#define NPY_USE_C99_FORMATS 1 +#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) +#define NPY_ABI_VERSION 0x01000009 +#define NPY_API_VERSION 0x00000007 + +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS 1 +#endif diff --git a/meta/recipes-devtools/python/python-numpy/x86-64/config.h b/meta/recipes-devtools/python/python-numpy/x86-64/config.h new file mode 100644 index 0000000000..0ce63b7d22 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/x86-64/config.h @@ -0,0 +1,139 @@ +#define HAVE_ENDIAN_H 1 +#define SIZEOF_PY_INTPTR_T 8 +#define SIZEOF_PY_LONG_LONG 8 +#define MATHLIB m +#define HAVE_SIN 1 +#define HAVE_COS 1 +#define HAVE_TAN 1 +#define HAVE_SINH 1 +#define HAVE_COSH 1 +#define HAVE_TANH 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_CEIL 1 +#define HAVE_SQRT 1 +#define HAVE_LOG10 1 +#define HAVE_LOG 1 +#define HAVE_EXP 1 +#define HAVE_ASIN 1 +#define HAVE_ACOS 1 +#define HAVE_ATAN 1 +#define HAVE_FMOD 1 +#define HAVE_MODF 1 +#define HAVE_FREXP 1 +#define HAVE_LDEXP 1 +#define HAVE_RINT 1 +#define HAVE_TRUNC 1 +#define HAVE_EXP2 1 +#define HAVE_LOG2 1 +#define HAVE_ATAN2 1 +#define HAVE_POW 1 +#define HAVE_NEXTAFTER 1 +#define HAVE_SINF 1 +#define HAVE_COSF 1 +#define HAVE_TANF 1 +#define HAVE_SINHF 1 +#define HAVE_COSHF 1 +#define HAVE_TANHF 1 +#define HAVE_FABSF 1 +#define HAVE_FLOORF 1 +#define HAVE_CEILF 1 +#define HAVE_RINTF 1 +#define HAVE_TRUNCF 1 +#define HAVE_SQRTF 1 +#define HAVE_LOG10F 1 +#define HAVE_LOGF 1 +#define HAVE_LOG1PF 1 +#define HAVE_EXPF 1 +#define HAVE_EXPM1F 1 +#define HAVE_ASINF 1 +#define HAVE_ACOSF 1 +#define HAVE_ATANF 1 +#define HAVE_ASINHF 1 +#define HAVE_ACOSHF 1 +#define HAVE_ATANHF 1 +#define HAVE_HYPOTF 1 +#define HAVE_ATAN2F 1 +#define HAVE_POWF 1 +#define HAVE_FMODF 1 +#define HAVE_MODFF 1 +#define HAVE_FREXPF 1 +#define HAVE_LDEXPF 1 +#define HAVE_EXP2F 1 +#define HAVE_LOG2F 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_NEXTAFTERF 1 +#define HAVE_SINL 1 +#define HAVE_COSL 1 +#define HAVE_TANL 1 +#define HAVE_SINHL 1 +#define HAVE_COSHL 1 +#define HAVE_TANHL 1 +#define HAVE_FABSL 1 +#define HAVE_FLOORL 1 +#define HAVE_CEILL 1 +#define HAVE_RINTL 1 +#define HAVE_TRUNCL 1 +#define HAVE_SQRTL 1 +#define HAVE_LOG10L 1 +#define HAVE_LOGL 1 +#define HAVE_LOG1PL 1 +#define HAVE_EXPL 1 +#define HAVE_EXPM1L 1 +#define HAVE_ASINL 1 +#define HAVE_ACOSL 1 +#define HAVE_ATANL 1 +#define HAVE_ASINHL 1 +#define HAVE_ACOSHL 1 +#define HAVE_ATANHL 1 +#define HAVE_HYPOTL 1 +#define HAVE_ATAN2L 1 +#define HAVE_POWL 1 +#define HAVE_FMODL 1 +#define HAVE_MODFL 1 +#define HAVE_FREXPL 1 +#define HAVE_LDEXPL 1 +#define HAVE_EXP2L 1 +#define HAVE_LOG2L 1 +#define HAVE_COPYSIGNL 1 +#define HAVE_NEXTAFTERL 1 +#define HAVE_DECL_SIGNBIT +#define HAVE_COMPLEX_H 1 +#define HAVE_CREAL 1 +#define HAVE_CIMAG 1 +#define HAVE_CABS 1 +#define HAVE_CARG 1 +#define HAVE_CEXP 1 +#define HAVE_CSQRT 1 +#define HAVE_CLOG 1 +#define HAVE_CCOS 1 +#define HAVE_CSIN 1 +#define HAVE_CPOW 1 +#define HAVE_CREALF 1 +#define HAVE_CIMAGF 1 +#define HAVE_CABSF 1 +#define HAVE_CARGF 1 +#define HAVE_CEXPF 1 +#define HAVE_CSQRTF 1 +#define HAVE_CLOGF 1 +#define HAVE_CCOSF 1 +#define HAVE_CSINF 1 +#define HAVE_CPOWF 1 +#define HAVE_CREALL 1 +#define HAVE_CIMAGL 1 +#define HAVE_CABSL 1 +#define HAVE_CARGL 1 +#define HAVE_CEXPL 1 +#define HAVE_CSQRTL 1 +#define HAVE_CLOGL 1 +#define HAVE_CCOSL 1 +#define HAVE_CSINL 1 +#define HAVE_CPOWL 1 +#define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE 1 +#ifndef __cplusplus +/* #undef inline */ +#endif + +#ifndef _NPY_NPY_CONFIG_H_ +#error config.h should never be included directly, include npy_config.h instead +#endif diff --git a/meta/recipes-devtools/python/python-numpy_1.7.0.bb b/meta/recipes-devtools/python/python-numpy_1.7.0.bb new file mode 100644 index 0000000000..d4fd279230 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy_1.7.0.bb @@ -0,0 +1,99 @@ +SUMMARY = "A sophisticated Numeric Processing Package for Python" +SECTION = "devel/python" +LICENSE = "PSF" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f87832d854acbade6e9f5c601c8b30b1" +PR = "r1" + +SRC_URI = "${SOURCEFORGE_MIRROR}/numpy/numpy-${PV}.tar.gz \ + file://no-host-paths.patch \ + ${CONFIGFILESURI} " + +CONFIGFILESURI ?= "" + +CONFIGFILESURI_aarch64 = " \ + file://config.h \ + file://_numpyconfig.h \ +" +CONFIGFILESURI_arm = " \ + file://config.h \ + file://numpyconfig.h \ +" +CONFIGFILESURI_armeb = " \ + file://config.h \ + file://numpyconfig.h \ +" +CONFIGFILESURI_mipsel = " \ + file://config.h \ + file://numpyconfig.h \ +" +CONFIGFILESURI_i586 = " \ + file://config.h \ + file://numpyconfig.h \ +" +CONFIGFILESURI_x86-64 = " \ + file://config.h \ + file://_numpyconfig.h \ +" +CONFIGFILESURI_mips = " \ + file://config.h \ + file://_numpyconfig.h \ +" +CONFIGFILESURI_powerpc = " \ + file://config.h \ + file://_numpyconfig.h \ +" +CONFIGFILESURI_powerpc64 = " \ + file://config.h \ + file://_numpyconfig.h \ +" +CONFIGFILESURI_mips64 = " \ + file://config.h \ + file://_numpyconfig.h \ +" +CONFIGFILESURI_mips64n32 = " \ + file://config.h \ + file://_numpyconfig.h \ +" + +S = "${WORKDIR}/numpy-${PV}" + +inherit distutils + +# Make the build fail and replace *config.h with proper one +# This is a ugly, ugly hack - Koen +do_compile_prepend_class-target() { + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + ${STAGING_BINDIR_NATIVE}/python-native/python setup.py build ${DISTUTILS_BUILD_ARGS} || \ + true + cp ${WORKDIR}/*config.h ${S}/build/$(ls ${S}/build | grep src)/numpy/core/include/numpy/ +} + +FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a" + +SRC_URI[md5sum] = "4fa54e40b6a243416f0248123b6ec332" +SRC_URI[sha256sum] = "f4fa70b7edbab65ee6432eb63743f5489f1919c614632b20b2fb45aa7e682ac6" + +# install what is needed for numpy.test() +RDEPENDS_${PN} = "python-unittest \ + python-difflib \ + python-pprint \ + python-pickle \ + python-shell \ + python-nose \ + python-doctest \ + python-datetime \ + python-distutils \ + python-misc \ + python-mmap \ + python-netclient \ + python-numbers \ + python-pydoc \ + python-pkgutil \ + python-email \ + python-subprocess \ + python-compression \ +" + +RDEPENDS_${PN}_class-native = "" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/python/python-pycairo_1.10.0.bb b/meta/recipes-devtools/python/python-pycairo_1.10.0.bb new file mode 100644 index 0000000000..70fe25c1a1 --- /dev/null +++ b/meta/recipes-devtools/python/python-pycairo_1.10.0.bb @@ -0,0 +1,41 @@ +SUMMARY = "Python bindings for the Cairo canvas library" +HOMEPAGE = "http://cairographics.org/pycairo" +BUGTRACKER = "http://bugs.freedesktop.org" +SECTION = "python-devel" +LICENSE = "LGPLv2.1 & MPL-1.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=f2e071ab72978431b294a0d696327421 \ + file://COPYING-LGPL-2.1;md5=fad9b3332be894bab9bc501572864b29 \ + file://COPYING-MPL-1.1;md5=bfe1f75d606912a4111c90743d6c7325" + +# cairo >= 1.8.8 +DEPENDS = "cairo" +PR = "r2" + +SRC_URI = "http://cairographics.org/releases/py2cairo-${PV}.tar.bz2" + +SRC_URI[md5sum] = "20337132c4ab06c1146ad384d55372c5" +SRC_URI[sha256sum] = "d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431" + +S = "${WORKDIR}/py2cairo-${PV}" + +inherit distutils pkgconfig + +BBCLASSEXTEND = "native" + +do_configure() { + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} ./waf configure --prefix=${D}${prefix} --libdir=${D}${libdir} +} + +do_compile() { + ./waf build ${PARALLEL_MAKE} +} + +do_install() { + ./waf install + sed \ + -e 's:@prefix@:${prefix}:' \ + -e 's:@VERSION@:${PV}:' \ + -e 's:@includedir@:${includedir}:' \ + pycairo.pc.in > pycairo.pc + install -m 0644 pycairo.pc ${D}${libdir}/pkgconfig/ +} diff --git a/meta/recipes-devtools/python/python-pycurl/no-static-link.patch b/meta/recipes-devtools/python/python-pycurl/no-static-link.patch new file mode 100644 index 0000000000..c5349ee578 --- /dev/null +++ b/meta/recipes-devtools/python/python-pycurl/no-static-link.patch @@ -0,0 +1,17 @@ +Upstream-Status: Pending + +Signed-off-by: Laurentiu Palcu + +Index: pycurl-7.19.3.1/setup.py +=================================================================== +--- pycurl-7.19.3.1.orig/setup.py 2014-07-16 12:57:24.065346887 +0000 ++++ pycurl-7.19.3.1/setup.py 2014-07-16 12:57:53.057347678 +0000 +@@ -147,7 +147,7 @@ + optbuf = '' + sslhintbuf = '' + errtext = '' +- for option in ["--libs", "--static-libs"]: ++ for option in ["--libs"]: + p = subprocess.Popen((CURL_CONFIG, option), + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = p.communicate() diff --git a/meta/recipes-devtools/python/python-pycurl_7.19.3.1.bb b/meta/recipes-devtools/python/python-pycurl_7.19.3.1.bb new file mode 100644 index 0000000000..02d0ae9be0 --- /dev/null +++ b/meta/recipes-devtools/python/python-pycurl_7.19.3.1.bb @@ -0,0 +1,34 @@ +SUMMARY = "Python bindings for libcurl" +HOMEPAGE = "http://pycurl.sourceforge.net/" +SECTION = "devel/python" +LICENSE = "LGPLv2.1+ | MIT" +LIC_FILES_CHKSUM = "file://README.rst;beginline=148;endline=163;md5=57e5ab0c0f964533fc59d93dec5695bb \ + file://COPYING-LGPL;md5=3579a9fd0221d49a237aaa33492f988c \ + file://COPYING-MIT;md5=e8200955c773b2a0fd6cea36ea5e87be" + +DEPENDS = "curl python" +RDEPENDS_${PN} = "python-core curl" +SRCNAME = "pycurl" + +SRC_URI = "\ + http://${SRCNAME}.sourceforge.net/download/${SRCNAME}-${PV}.tar.gz;name=archive \ + file://no-static-link.patch \ +" + +SRC_URI[archive.md5sum] = "6df8fa7fe8b680d93248da1f8d4fcd12" +SRC_URI[archive.sha256sum] = "c0d673fe99a9de07239eabe77c798f1b043f60c02afaec1430ceaf59d7501a4f" +S = "${WORKDIR}/${SRCNAME}-${PV}" + +inherit distutils + +# need to export these variables for python-config to work +export BUILD_SYS +export HOST_SYS +export STAGING_INCDIR +export STAGING_LIBDIR + +BBCLASSEXTEND = "native" + +do_install_append() { + rm -rf ${D}${datadir}/share +} diff --git a/meta/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch b/meta/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch new file mode 100644 index 0000000000..c2591123b3 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch @@ -0,0 +1,23 @@ +Upstream-Status: Accepted [https://bugzilla.gnome.org/show_bug.cgi?id=691101] + +Signed-off-by: Marko Lindqvist +diff -Nurd pygobject-2.27.91/configure.ac pygobject-2.27.91/configure.ac +--- pygobject-2.27.91/configure.ac 2011-02-23 22:14:37.000000000 +0200 ++++ pygobject-2.27.91/configure.ac 2013-01-03 05:13:44.034949954 +0200 +@@ -35,7 +35,7 @@ + AC_DEFINE(PYGOBJECT_MICRO_VERSION, pygobject_micro_version, [pygobject micro version]) + AC_SUBST(PYGOBJECT_MICRO_VERSION, pygobject_micro_version) + +-AM_CONFIG_HEADER(config.h) ++AC_CONFIG_HEADERS(config.h) + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)]) + AM_INIT_AUTOMAKE(foreign) + AM_MAINTAINER_MODE +@@ -82,7 +82,6 @@ + m4_ifdef([LT_OUTPUT], [LT_OUTPUT]) + AC_ISC_POSIX + AC_PROG_CC +-AM_PROG_CC_STDC + AM_PROG_CC_C_O + + # check that we have the minimum version of python necisary to build diff --git a/meta/recipes-devtools/python/python-pygobject_2.28.3.bb b/meta/recipes-devtools/python/python-pygobject_2.28.3.bb new file mode 100644 index 0000000000..45a0603eb7 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygobject_2.28.3.bb @@ -0,0 +1,39 @@ +SUMMARY = "Python GObject bindings" +SECTION = "devel/python" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7" +DEPENDS = "python python-pygobject-native libffi glib-2.0" +DEPENDS_class-native = "python-native libffi-native glib-2.0-native" +RDEPENDS_class-native = "" + +MAJ_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}" + +SRC_URI = "${GNOME_MIRROR}/pygobject/${MAJ_VER}/pygobject-${PV}.tar.bz2 \ + file://obsolete_automake_macros.patch \ +" + +SRC_URI[md5sum] = "aa64900b274c4661a5c32e52922977f9" +SRC_URI[sha256sum] = "7da88c169a56efccc516cebd9237da3fe518a343095a664607b368fe21df95b6" +S = "${WORKDIR}/pygobject-${PV}" + +EXTRA_OECONF += "--disable-introspection" + +PARALLEL_MAKEINST = "" + +inherit autotools distutils-base pkgconfig + +# necessary to let the call for python-config succeed +export BUILD_SYS +export HOST_SYS +export STAGING_INCDIR +export STAGING_LIBDIR + +PACKAGES += "${PN}-lib" + +RDEPENDS_${PN} += "python-textutils" + +FILES_${PN} = "${libdir}/python*" +FILES_${PN}-lib = "${libdir}/lib*.so.*" +FILES_${PN}-dev += "${bindir} ${datadir}" + +BBCLASSEXTEND = "native" diff --git a/meta/recipes-devtools/python/python-pygtk/acinclude.m4 b/meta/recipes-devtools/python/python-pygtk/acinclude.m4 new file mode 100644 index 0000000000..53518fb2eb --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/acinclude.m4 @@ -0,0 +1,90 @@ +## this one is commonly used with AM_PATH_PYTHONDIR ... +dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) +dnl Check if a module containing a given symbol is visible to python. +AC_DEFUN(AM_CHECK_PYMOD, +[AC_REQUIRE([AM_PATH_PYTHON]) +py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` +AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1) +AC_CACHE_VAL(py_cv_mod_$py_mod_var, [ +ifelse([$2],[], [prog=" +import sys +try: + import $1 +except ImportError: + sys.exit(1) +except: + sys.exit(0) +sys.exit(0)"], [prog=" +import $1 +$1.$2"]) +if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC + then + eval "py_cv_mod_$py_mod_var=yes" + else + eval "py_cv_mod_$py_mod_var=no" + fi +]) +py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` +if test "x$py_val" != xno; then + AC_MSG_RESULT(yes) + ifelse([$3], [],, [$3 +])dnl +else + AC_MSG_RESULT(no) + ifelse([$4], [],, [$4 +])dnl +fi +]) + +dnl a macro to check for ability to create python extensions +dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) +dnl function also defines PYTHON_INCLUDES +AC_DEFUN([AM_CHECK_PYTHON_HEADERS], +[AC_REQUIRE([AM_PATH_PYTHON]) +AC_MSG_CHECKING(for headers required to compile python extensions) +dnl deduce PYTHON_INCLUDES +AC_ARG_WITH(python-includes, + [ --with-python-includes=DIR path to Python includes], py_exec_prefix=$withval) +if test x$py_exec_prefix != x; then +PYTHON_INCLUDES="-I${py_exec_prefix}/include/python${PYTHON_VERSION}" +else +py_prefix=`$PYTHON -c "import sys; print sys.prefix"` +py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` +PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" +if test "$py_prefix" != "$py_exec_prefix"; then + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" +fi +fi +AC_SUBST(PYTHON_INCLUDES) +dnl check if the headers exist: +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" +AC_TRY_CPP([#include ],dnl +[AC_MSG_RESULT(found) +$1],dnl +[AC_MSG_RESULT(not found) +$2]) +CPPFLAGS="$save_CPPFLAGS" +]) + +dnl +dnl JH_ADD_CFLAG(FLAG) +dnl checks whether the C compiler supports the given flag, and if so, adds +dnl it to $CFLAGS. If the flag is already present in the list, then the +dnl check is not performed. +AC_DEFUN([JH_ADD_CFLAG], +[ +case " $CFLAGS " in +*@<:@\ \ @:>@$1@<:@\ \ @:>@*) + ;; +*) + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + AC_MSG_CHECKING([whether [$]CC understands $1]) + AC_TRY_COMPILE([], [], [jh_has_option=yes], [jh_has_option=no]) + AC_MSG_RESULT($jh_has_option) + if test $jh_has_option = no; then + CFLAGS="$save_CFLAGS" + fi + ;; +esac]) diff --git a/meta/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch b/meta/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch new file mode 100644 index 0000000000..df0f9cd6c0 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch @@ -0,0 +1,32 @@ +Upstream-Status: Submitted + +add gtk-types.defs into gdk.c dependence + +gdk.c depends on gtk-types.defs but +gdk/Makefile.am miss this. This will cause +build error sometimes when built +with multi-jobbing, so add gtk-types.defs into +gdk.c dependence. + +Signed-off-by: Song.Li +Signed-off-by: Jackie Huang +--- + gtk/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/gtk/Makefile.am b/gtk/Makefile.am +index 7bb5d0c..4a88351 100644 +--- a/gtk/Makefile.am ++++ b/gtk/Makefile.am +@@ -214,7 +214,7 @@ gtkunixprint.defs: $(GTKUNIXPRINT_DEFS) Makefile + gtkunixprint-types.defs: $(GTKUNIXPRINT_TYPES_DEFS) Makefile + $(CREATEDEFS) $@ $(GTKUNIXPRINT_TYPES_DEFS) + +-gdk.c: gdk-types.defs gdk.defs $(GDK_OVERRIDES) ++gdk.c: gdk-types.defs gtk-types.defs gdk.defs $(GDK_OVERRIDES) + gtk.c: gdk-types.defs gtk-types.defs gtk.defs gdk-types.defs $(GTK_OVERRIDES) + _gtk_la_CFLAGS = $(PYCAIRO_CFLAGS) $(GTK_CFLAGS) + _gtk_la_LDFLAGS = $(common_ldflags) -export-symbols-regex init_gtk +-- +1.7.4 + diff --git a/meta/recipes-devtools/python/python-pygtk/fix-gtkunixprint.patch b/meta/recipes-devtools/python/python-pygtk/fix-gtkunixprint.patch new file mode 100644 index 0000000000..16c0e8e770 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/fix-gtkunixprint.patch @@ -0,0 +1,20 @@ +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Saul Wold + +Index: pygtk-2.24.0/gtk/gtkunixprint.override +=================================================================== +--- pygtk-2.24.0.orig/gtk/gtkunixprint.override ++++ pygtk-2.24.0/gtk/gtkunixprint.override +@@ -102,11 +102,6 @@ _wrap_gtk_print_job_get_surface(PyGObjec + if (pyg_error_check(&error)) + return NULL; + +-#if PYCAIRO_VERSION_HEX >= 0x1010600 +- return PycairoSurface_FromSurface(cairo_surface_reference(surface), NULL); +-#else +- return PycairoSurface_FromSurface(cairo_surface_reference(surface), NULL, NULL); +-#endif + } + %% + override gtk_print_job_send kwargs diff --git a/meta/recipes-devtools/python/python-pygtk/fix-pygtk-2.0.pc.patch b/meta/recipes-devtools/python/python-pygtk/fix-pygtk-2.0.pc.patch new file mode 100644 index 0000000000..b6156540bd --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/fix-pygtk-2.0.pc.patch @@ -0,0 +1,13 @@ +Upstream-Status: Inappropriate [configuration] + +Index: pygtk-2.24.0/pygtk-2.0.pc.in +=================================================================== +--- pygtk-2.24.0.orig/pygtk-2.0.pc.in ++++ pygtk-2.24.0/pygtk-2.0.pc.in +@@ -1,5 +1,6 @@ + prefix=@prefix@ + exec_prefix=@exec_prefix@ ++libdir=@libdir@ + includedir=@includedir@ + datarootdir=@datarootdir@ + datadir=@datadir@ diff --git a/meta/recipes-devtools/python/python-pygtk/nodocs.patch b/meta/recipes-devtools/python/python-pygtk/nodocs.patch new file mode 100644 index 0000000000..f07309a7ba --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/nodocs.patch @@ -0,0 +1,15 @@ +Upstream-Status: Inappropriate [configuration] + +Index: pygtk-2.17.0/Makefile.am +=================================================================== +--- pygtk-2.17.0.orig/Makefile.am ++++ pygtk-2.17.0/Makefile.am +@@ -4,7 +4,7 @@ if BUILD_GTK + GTK_SUBDIR = gtk + endif + +-SUBDIRS = . $(GTK_SUBDIR) examples tests docs ++SUBDIRS = . $(GTK_SUBDIR) examples tests + + PLATFORM_VERSION = 2.0 + diff --git a/meta/recipes-devtools/python/python-pygtk/prevent_to_get_display_during_import.patch b/meta/recipes-devtools/python/python-pygtk/prevent_to_get_display_during_import.patch new file mode 100644 index 0000000000..833038e7f8 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/prevent_to_get_display_during_import.patch @@ -0,0 +1,16 @@ +Upstream-Status: Pending + +Index: pygtk-2.10.4/gtk/__init__.py +=================================================================== +--- pygtk-2.10.4.orig/gtk/__init__.py 2007-11-27 19:27:05.000000000 -0300 ++++ pygtk-2.10.4/gtk/__init__.py 2007-11-27 19:28:22.000000000 -0300 +@@ -78,7 +78,8 @@ + + keysyms = LazyModule('keysyms', locals()) + +-_init() ++if not hasattr(sys.modules['__main__'], 'python_launcher_enabled'): ++ _init() + + # CAPI + _PyGtk_API = _gtk._PyGtk_API diff --git a/meta/recipes-devtools/python/python-pygtk/python-pygtk2/acinclude.m4 b/meta/recipes-devtools/python/python-pygtk/python-pygtk2/acinclude.m4 new file mode 100644 index 0000000000..53518fb2eb --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/python-pygtk2/acinclude.m4 @@ -0,0 +1,90 @@ +## this one is commonly used with AM_PATH_PYTHONDIR ... +dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) +dnl Check if a module containing a given symbol is visible to python. +AC_DEFUN(AM_CHECK_PYMOD, +[AC_REQUIRE([AM_PATH_PYTHON]) +py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` +AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1) +AC_CACHE_VAL(py_cv_mod_$py_mod_var, [ +ifelse([$2],[], [prog=" +import sys +try: + import $1 +except ImportError: + sys.exit(1) +except: + sys.exit(0) +sys.exit(0)"], [prog=" +import $1 +$1.$2"]) +if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC + then + eval "py_cv_mod_$py_mod_var=yes" + else + eval "py_cv_mod_$py_mod_var=no" + fi +]) +py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` +if test "x$py_val" != xno; then + AC_MSG_RESULT(yes) + ifelse([$3], [],, [$3 +])dnl +else + AC_MSG_RESULT(no) + ifelse([$4], [],, [$4 +])dnl +fi +]) + +dnl a macro to check for ability to create python extensions +dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) +dnl function also defines PYTHON_INCLUDES +AC_DEFUN([AM_CHECK_PYTHON_HEADERS], +[AC_REQUIRE([AM_PATH_PYTHON]) +AC_MSG_CHECKING(for headers required to compile python extensions) +dnl deduce PYTHON_INCLUDES +AC_ARG_WITH(python-includes, + [ --with-python-includes=DIR path to Python includes], py_exec_prefix=$withval) +if test x$py_exec_prefix != x; then +PYTHON_INCLUDES="-I${py_exec_prefix}/include/python${PYTHON_VERSION}" +else +py_prefix=`$PYTHON -c "import sys; print sys.prefix"` +py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` +PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" +if test "$py_prefix" != "$py_exec_prefix"; then + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" +fi +fi +AC_SUBST(PYTHON_INCLUDES) +dnl check if the headers exist: +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" +AC_TRY_CPP([#include ],dnl +[AC_MSG_RESULT(found) +$1],dnl +[AC_MSG_RESULT(not found) +$2]) +CPPFLAGS="$save_CPPFLAGS" +]) + +dnl +dnl JH_ADD_CFLAG(FLAG) +dnl checks whether the C compiler supports the given flag, and if so, adds +dnl it to $CFLAGS. If the flag is already present in the list, then the +dnl check is not performed. +AC_DEFUN([JH_ADD_CFLAG], +[ +case " $CFLAGS " in +*@<:@\ \ @:>@$1@<:@\ \ @:>@*) + ;; +*) + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + AC_MSG_CHECKING([whether [$]CC understands $1]) + AC_TRY_COMPILE([], [], [jh_has_option=yes], [jh_has_option=no]) + AC_MSG_RESULT($jh_has_option) + if test $jh_has_option = no; then + CFLAGS="$save_CFLAGS" + fi + ;; +esac]) diff --git a/meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch b/meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch new file mode 100644 index 0000000000..3ed954eee5 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch @@ -0,0 +1,38 @@ +From dc024e9079bbffbb44436ba3e70a758ebad5520f Mon Sep 17 00:00:00 2001 +From: "Song.Li" +Date: Sat, 5 Jan 2013 14:55:59 +0800 +Subject: [PATCH] update dependences of defs.c in Makefile.am + +In gtk/Makefile.am, defs.c should dependes on gdk-types.defs and +gtk-types.defs, otherwise it fails occasionally when parallel compile. +The error message: +"IOError: [Errno 2] No such file or directory: 'gtk-types.defs'" + +Add them to dependences of defs.c to fix this issue. + +Upstream-Status: Submitted +https://bugzilla.gnome.org/show_bug.cgi?id=702706 + +Signed-off-by: Song.Li +Signed-off-by: Kai Kang + +--- + gtk/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gtk/Makefile.am b/gtk/Makefile.am +index 7bb5d0c..91826cb 100644 +--- a/gtk/Makefile.am ++++ b/gtk/Makefile.am +@@ -289,7 +289,7 @@ if HAVE_GIO_TYPES_DEFS + extra_codegen_args += --register $(PYGOBJECT_DEFSDIR)/gio-types.defs + endif + +-.defs.c: ++.defs.c: gdk-types.defs gtk-types.defs + ($(PYTHON) $(CODEGENDIR)/codegen.py \ + $(PYGTK_CODEGEN_DEFINES) \ + -I $(srcdir) \ +-- +1.7.9.5 + diff --git a/meta/recipes-devtools/python/python-pygtk_2.24.0.bb b/meta/recipes-devtools/python/python-pygtk_2.24.0.bb new file mode 100644 index 0000000000..ff84be2bbc --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk_2.24.0.bb @@ -0,0 +1,74 @@ +SUMMARY = "Python bindings for the GTK+ UI toolkit" +SECTION = "devel/python" +# needs gtk+ 2.17.x +DEPENDS = "gtk+ libglade python-pycairo python-pygobject" +RDEPENDS_${PN} = "python-shell python-pycairo python-pygobject" +PROVIDES = "python-pygtk2" +SRCNAME = "pygtk" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7" + +PR = "r1" + +SRC_URI = "ftp://ftp.gnome.org/pub/gnome/sources/pygtk/2.24/${SRCNAME}-${PV}.tar.bz2 \ + file://add-gtk-types.defs-into-gdk.c-dependence.patch \ + file://fix-gtkunixprint.patch \ + file://prevent_to_get_display_during_import.patch \ + file://nodocs.patch \ + file://fix-pygtk-2.0.pc.patch \ + file://acinclude.m4 \ + file://update-dependences-of-defs.c.patch" + +SRC_URI[md5sum] = "a1051d5794fd7696d3c1af6422d17a49" +SRC_URI[sha256sum] = "cd1c1ea265bd63ff669e92a2d3c2a88eb26bcd9e5363e0f82c896e649f206912" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +EXTRA_OECONF = "--disable-docs --with-python-includes=${STAGING_INCDIR}/../" + +inherit autotools pkgconfig distutils-base + +do_configure_prepend() { + install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/ + sed -i \ + -e s:'`$PKG_CONFIG --variable defsdir pygobject-2.0`':\"${STAGING_DATADIR}/pygobject/2.0/defs\":g \ + -e s:'`$PKG_CONFIG --variable=pygtkincludedir pygobject-2.0`':\"${STAGING_INCDIR}/pygtk-2.0\":g \ + -e s:'`$PKG_CONFIG --variable=datadir pygobject-2.0`':\"${STAGING_DATADIR}\":g \ + -e s:'`$PKG_CONFIG --variable codegendir pygobject-2.0`':\"${STAGING_DATADIR}/pygobject/2.0/codegen\":g \ + -e s:'`$PKG_CONFIG --variable=fixxref pygobject-2.0`':\"${STAGING_DATADIR}/pygobject/xsl/fixxref.py\":g \ + ${S}/configure.ac + sed -i 's:tests docs:tests:' ${S}/Makefile.am +} + +# dirty fix #2: fix build system paths leaking in +do_install_append() { + for i in `find ${D} -name "*.py"` ; do \ + sed -i -e s:${D}::g $i + done + + for i in `find ${D} -name "*.la"` ; do \ + sed -i -e s:${STAGING_LIBDIR}:${libdir}:g $i + done + + if test -e ${D}${bindir} ; then + for i in ${D}${bindir}/* ; do \ + sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i + done + fi + + if test -e ${D}${sbindir} ; then + for i in ${D}${sbindir}/* ; do \ + sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i + done + fi + + sed -i -e '1s|^#!.*python|#!/usr/bin/env python|' ${D}${bindir}/pygtk-demo +} + +PACKAGES =+ "${PN}-demo" +FILES_${PN}-demo = " ${bindir}/pygtk-demo ${libdir}/pygtk " +RDEPENDS_${PN}-demo = "python-pygtk python-stringold python-lang" + +# todo: revamp packaging, package demo seperatly +FILES_${PN}-dev += " ${libdir}/pygtk/2.0 ${bindir}/pygtk-* ${datadir}/pygtk/2.0" + diff --git a/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb b/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb new file mode 100644 index 0000000000..e8ef1aa12b --- /dev/null +++ b/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb @@ -0,0 +1,5 @@ +require python-pyrex_${PV}.bb +inherit native pythonnative +DEPENDS = "python-native" +RDEPENDS_${PN} = "" +PR = "r3" diff --git a/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch b/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch new file mode 100644 index 0000000000..c58c3280e2 --- /dev/null +++ b/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch @@ -0,0 +1,15 @@ +Upstream-Status: Pending + +Index: Pyrex-0.9.8.4/Pyrex/Distutils/extension.py +=================================================================== +--- Pyrex-0.9.8.4.orig/Pyrex/Distutils/extension.py ++++ Pyrex-0.9.8.4/Pyrex/Distutils/extension.py +@@ -15,7 +15,7 @@ except ImportError: + warnings = None + + class Extension(_Extension.Extension): +- _Extension.Extension.__doc__ + \ ++ _Extension.Extension.__doc__ or "" + \ + """pyrex_include_dirs : [string] + list of directories to search for Pyrex header files (.pxd) (in + Unix form for portability) diff --git a/meta/recipes-devtools/python/python-pyrex_0.9.9.bb b/meta/recipes-devtools/python/python-pyrex_0.9.9.bb new file mode 100644 index 0000000000..c4dd2e69b0 --- /dev/null +++ b/meta/recipes-devtools/python/python-pyrex_0.9.9.bb @@ -0,0 +1,22 @@ +SUMMARY = "Language for writing Python extension modules" +DESCRIPTION = "Pyrex is a language specially designed for writing Python extension modules. \ +It's designed to bridge the gap between the nice, high-level, easy-to-use world of Python \ +and the messy, low-level world of C." +SECTION = "devel/python" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=771d472f53f933033f57eeee7808e5bd" +SRCNAME = "Pyrex" +PR = "r4" + +SRC_URI = "\ + http://www.cosc.canterbury.ac.nz/greg.ewing/python/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \ + file://pyrex-fix-optimized-mode.patch \ +" + +SRC_URI[md5sum] = "515dee67d15d4393841e2d60e8341947" +SRC_URI[sha256sum] = "5f87df06831d0b3412eb4bc9d3fc2ee7bfae1b913d7da8c23ab2bf5699fb6b50" +S = "${WORKDIR}/${SRCNAME}-${PV}" + +inherit distutils + +FILES_${PN} += "${datadir}${base_libdir}/${PYTHON_DIR}/site-packages/Pyrex/Compiler/Lexicon.pickle" diff --git a/meta/recipes-devtools/python/python-scons-native_2.3.2.bb b/meta/recipes-devtools/python/python-scons-native_2.3.2.bb new file mode 100644 index 0000000000..dae89ab5d2 --- /dev/null +++ b/meta/recipes-devtools/python/python-scons-native_2.3.2.bb @@ -0,0 +1,8 @@ +require python-scons_${PV}.bb +inherit native pythonnative +DEPENDS = "python-native" +RDEPENDS_${PN} = "" + +do_install_append() { + create_wrapper ${D}${bindir}/scons SCONS_LIB_DIR='${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}' +} diff --git a/meta/recipes-devtools/python/python-scons_2.3.2.bb b/meta/recipes-devtools/python/python-scons_2.3.2.bb new file mode 100644 index 0000000000..fc5b302aae --- /dev/null +++ b/meta/recipes-devtools/python/python-scons_2.3.2.bb @@ -0,0 +1,14 @@ +SUMMARY = "Software Construction tool (make/autotools replacement)" +SECTION = "devel/python" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f0ad8a74a10870caa5e08a3e45d719e2" +SRCNAME = "scons" + +SRC_URI = "${SOURCEFORGE_MIRROR}/scons/scons-${PV}.tar.gz" + +SRC_URI[md5sum] = "bbd428da35ec176575a2b0be1f8d7162" +SRC_URI[sha256sum] = "f993320c5e9515e6567fcce73df0a7a8808414bf1223c69123d3dcf339a449d4" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +inherit distutils diff --git a/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch b/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch new file mode 100644 index 0000000000..e264de8a58 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch @@ -0,0 +1,54 @@ + +From a74a9a9eb9d75964a0e978950e8b191d7a18d763 Mon Sep 17 00:00:00 2001 +From: Paul Eggleton +Date: Fri, 5 Jun 2015 17:07:16 +0100 +Subject: [PATCH] smart: change "is already installed" message from warning to + info + +This doesn't need to be a warning. + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton +--- + smart/commands/install.py | 4 ++-- + smart/interfaces/text/interactive.py | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/smart/commands/install.py b/smart/commands/install.py +index 6ef9682..80d456b 100644 +--- a/smart/commands/install.py ++++ b/smart/commands/install.py +@@ -152,7 +152,7 @@ def main(ctrl, opts): + for obj in results: + for pkg in obj.packages: + if pkg.installed: +- iface.warning(_("%s (for %s) is already installed") ++ iface.info(_("%s (for %s) is already installed") + % (pkg, arg)) + installed = True + break +@@ -184,7 +184,7 @@ def main(ctrl, opts): + for name in names: + pkg = names[name][0] + if pkg.installed: +- iface.warning(_("%s is already installed") % pkg) ++ iface.info(_("%s is already installed") % pkg) + else: + trans.enqueue(pkg, INSTALL) + +diff --git a/smart/interfaces/text/interactive.py b/smart/interfaces/text/interactive.py +index 9865584..190867b 100644 +--- a/smart/interfaces/text/interactive.py ++++ b/smart/interfaces/text/interactive.py +@@ -278,7 +278,7 @@ class Interpreter(Cmd): + for name in names: + pkg = names[name][0] + if pkg.installed: +- iface.warning(_("%s is already installed") % pkg) ++ iface.info(_("%s is already installed") % pkg) + else: + found = True + transaction.enqueue(pkg, INSTALL) +-- +2.1.0 diff --git a/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch b/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch new file mode 100644 index 0000000000..82d2e6cf31 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch @@ -0,0 +1,223 @@ +From b105e7fe812da3ccaf7155c0fe14c8728b0d39a5 Mon Sep 17 00:00:00 2001 +From: Mark Hatle +Date: Mon, 20 Jan 2014 14:30:52 +0000 +Subject: [PATCH] Add mechanism to attempt install without failing + +In OpenEmbedded, for complementary and 'attemptonly' package processing, +we need a way to instruct smart to try to install, but ignore any +failures (usually conflicts). + +This option only works for the install operation. + +If a complementary install fails, an actual error occurred, one that +we can't ignore without losing the entire attempted transaction. Keep +this as an error so that we can catch these cases in the futre. + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle +Signed-off-by: Paul Eggleton +--- + smart.py | 5 +++- + smart/commands/install.py | 5 ++++ + smart/transaction.py | 65 +++++++++++++++++++++++++++++++++++------------ + 3 files changed, 58 insertions(+), 17 deletions(-) + +Index: smart-1.4.1/smart/commands/install.py +=================================================================== +--- smart-1.4.1.orig/smart/commands/install.py ++++ smart-1.4.1/smart/commands/install.py +@@ -50,6 +50,8 @@ def option_parser(): + parser = OptionParser(usage=USAGE, + description=DESCRIPTION, + examples=EXAMPLES) ++ parser.add_option("--attempt", action="store_true", ++ help=_("attempt to install packages, ignore failures")) + parser.add_option("--stepped", action="store_true", + help=_("split operation in steps")) + parser.add_option("--urls", action="store_true", +@@ -80,6 +82,9 @@ def main(ctrl, opts): + if not opts.args: + raise Error, _("no package(s) given") + ++ if opts.attempt: ++ sysconf.set("attempt-install", True, soft=True) ++ + if opts.explain: + sysconf.set("explain-changesets", True, soft=True) + +Index: smart-1.4.1/smart/transaction.py +=================================================================== +--- smart-1.4.1.orig/smart/transaction.py ++++ smart-1.4.1/smart/transaction.py +@@ -555,6 +555,8 @@ class Transaction(object): + changeset.set(pkg, INSTALL) + isinst = changeset.installed + ++ attempt = sysconf.has("attempt-install", soft=True) ++ + # Remove packages conflicted by this one. + for cnf in pkg.conflicts: + for prv in cnf.providedby: +@@ -564,11 +566,16 @@ class Transaction(object): + if not isinst(prvpkg): + locked[prvpkg] = (LOCKED_CONFLICT_BY, pkg) + continue +- if prvpkg in locked: +- raise Failed, _("Can't install %s: conflicted package " +- "%s is locked") % (pkg, prvpkg) +- self._remove(prvpkg, changeset, locked, pending, depth) +- pending.append((PENDING_UPDOWN, prvpkg)) ++ if attempt: ++ del changeset[pkg] ++ raise Failed, _("Can't install %s: it conflicts with package " ++ "%s") % (pkg, prvpkg) ++ else: ++ if prvpkg in locked: ++ raise Failed, _("Can't install %s: conflicted package " ++ "%s is locked") % (pkg, prvpkg) ++ self._remove(prvpkg, changeset, locked, pending, depth) ++ pending.append((PENDING_UPDOWN, prvpkg)) + + # Remove packages conflicting with this one. + for prv in pkg.provides: +@@ -579,12 +586,18 @@ class Transaction(object): + if not isinst(cnfpkg): + locked[cnfpkg] = (LOCKED_CONFLICT, pkg) + continue +- if cnfpkg in locked: ++ if attempt: ++ del changeset[pkg] + raise Failed, _("Can't install %s: it's conflicted by " +- "the locked package %s") \ +- % (pkg, cnfpkg) +- self._remove(cnfpkg, changeset, locked, pending, depth) +- pending.append((PENDING_UPDOWN, cnfpkg)) ++ "the package %s") \ ++ % (pkg, cnfpkg) ++ else: ++ if cnfpkg in locked: ++ raise Failed, _("Can't install %s: it's conflicted by " ++ "the locked package %s") \ ++ % (pkg, cnfpkg) ++ self._remove(cnfpkg, changeset, locked, pending, depth) ++ pending.append((PENDING_UPDOWN, cnfpkg)) + + # Remove packages with the same name that can't + # coexist with this one. +@@ -594,10 +607,15 @@ class Transaction(object): + if not isinst(namepkg): + locked[namepkg] = (LOCKED_NO_COEXIST, pkg) + continue +- if namepkg in locked: ++ if attempt: ++ del changeset[pkg] + raise Failed, _("Can't install %s: it can't coexist " + "with %s") % (pkg, namepkg) +- self._remove(namepkg, changeset, locked, pending, depth) ++ else: ++ if namepkg in locked: ++ raise Failed, _("Can't install %s: it can't coexist " ++ "with %s") % (pkg, namepkg) ++ self._remove(namepkg, changeset, locked, pending, depth) + + # Install packages required by this one. + for req in pkg.requires + pkg.recommends: +@@ -1176,6 +1194,8 @@ class Transaction(object): + + self._policy.runStarting() + ++ attempt = sysconf.has("attempt-install", soft=True) ++ + try: + changeset = self._changeset.copy() + isinst = changeset.installed +@@ -1190,7 +1210,11 @@ class Transaction(object): + locked[pkg] = (LOCKED_KEEP, None) + elif op is INSTALL: + if not isinst(pkg) and pkg in locked: +- raise Failed, _("Can't install %s: it's locked") % pkg ++ if attempt: ++ iface.warning(_("Can't install %s: it's locked") % pkg) ++ del changeset[pkg] ++ else: ++ raise Failed, _("Can't install %s: it's locked") % pkg + changeset.set(pkg, INSTALL) + locked[pkg] = (LOCKED_INSTALL, None) + elif op is REMOVE: +@@ -1216,9 +1240,18 @@ class Transaction(object): + else: + op = REMOVE + if op is INSTALL or op is REINSTALL: +- self._install(pkg, changeset, locked, pending) +- if pkg in changeset: +- changeset.setRequested(pkg, True) ++ try: ++ self._install(pkg, changeset, locked, pending) ++ if pkg in changeset: ++ changeset.setRequested(pkg, True) ++ except Failed, e: ++ if attempt: ++ iface.warning(_("Can't install %s: %s") % (pkg, e)) ++ if pkg in changeset: ++ del changeset[pkg] ++ continue ++ else: ++ raise Failed, e + elif op is REMOVE: + self._remove(pkg, changeset, locked, pending) + elif op is UPGRADE: +Index: smart-1.4.1/smart/backends/rpm/pm.py +=================================================================== +--- smart-1.4.1.orig/smart/backends/rpm/pm.py ++++ smart-1.4.1/smart/backends/rpm/pm.py +@@ -243,15 +253,48 @@ class RPMPackageManager(PackageManager): + cb = RPMCallback(prog, upgradednames) + cb.grabOutput(True) + probs = None ++ retry = 0 + try: + probs = ts.run(cb, None) + finally: + del getTS.ts + cb.grabOutput(False) ++ if probs and sysconf.has("attempt-install", soft=True): ++ def remove_conflict(pkgNEVR): ++ for key in changeset.keys(): ++ if pkgNEVR == str(key): ++ del changeset[key] ++ del pkgpaths[key] ++ iface.warning("Removing %s due to file %s conflicting with %s" % (pkgNEVR, fname, altNEVR)) ++ break ++ ++ retry = 1 ++ for prob in probs: ++ if prob[1][0] == rpm.RPMPROB_NEW_FILE_CONFLICT: ++ msg = prob[0].split() ++ fname = msg[1] ++ pkgNEVR = msg[7] ++ altNEVR = msg[9] ++ pkgNEVR = pkgNEVR.rsplit('.', 1)[0] + '@' + pkgNEVR.rsplit('.', 1)[1] ++ altNEVR = altNEVR.rsplit('.', 1)[0] + '@' + altNEVR.rsplit('.', 1)[1] ++ remove_conflict(pkgNEVR) ++ elif prob[1][0] == rpm.RPMPROB_FILE_CONFLICT: ++ msg = prob[0].split() ++ fname = msg[1] ++ pkgNEVR = msg[5] ++ altNEVR = msg[11] ++ pkgNEVR = pkgNEVR.rsplit('.', 1)[0] + '@' + pkgNEVR.rsplit('.', 1)[1] ++ altNEVR = altNEVR.rsplit('.', 1)[0] + '@' + altNEVR.rsplit('.', 1)[1] ++ remove_conflict(pkgNEVR) ++ else: ++ retry = 0 ++ + prog.setDone() +- if probs: ++ if probs and (not retry): + raise Error, "\n".join([x[0] for x in probs]) + prog.stop() ++ if retry and len(changeset): ++ self.commit(changeset, pkgpaths) + + class RPMCallback: + def __init__(self, prog, upgradednames): diff --git a/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch b/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch new file mode 100644 index 0000000000..e621b33875 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch @@ -0,0 +1,24 @@ +Make CHANNELSDIR in smart empty, since this causes host contamination issues +on some RPM-based hosts on which smart is already installed. + +[YOCTO #3881] + +Upstream-Status: Inappropriate [embedded specific] + +diff --git a/smart/plugins/channelsync.py b/smart/plugins/channelsync.py +index 3ba95ff..646d696 100644 +--- a/smart/plugins/channelsync.py ++++ b/smart/plugins/channelsync.py +@@ -23,7 +23,11 @@ from smart.channel import * + from smart import * + import os + +-CHANNELSDIR = "/etc/smart/channels/" ++# For now, we leave the definition of CHANNELSDIR empty. This prevents smart ++# from erroneously consider the build host's channels while setting up its ++# channels [YOCTO #3881]. If this feature will be used in the future, CHANNELSDIR ++# should be set to a proper value. ++CHANNELSDIR = "" + + def syncChannels(channelsdir, force=None): + diff --git a/meta/recipes-devtools/python/python-smartpm/smart-config-ignore-all-recommends.patch b/meta/recipes-devtools/python/python-smartpm/smart-config-ignore-all-recommends.patch new file mode 100644 index 0000000000..df9d7799e8 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-config-ignore-all-recommends.patch @@ -0,0 +1,24 @@ +Add a simple method to disable the install of recommended packages + +Upstream-Status: Pending + +Usage: + smart config --set ignore-all-recommends=1 + +Signed-off-by: Mark Hatle + +Index: smart-1.4.1/smart/transaction.py +=================================================================== +--- smart-1.4.1.orig/smart/transaction.py ++++ smart-1.4.1/smart/transaction.py +@@ -611,7 +611,9 @@ class Transaction(object): + for prv in req.providedby: + for prvpkg in prv.packages: + if not reqrequired: +- if pkgconf.testFlag("ignore-recommends", prvpkg): ++ if sysconf.get("ignore-all-recommends", 0) == 1: ++ continue ++ elif pkgconf.testFlag("ignore-recommends", prvpkg): + continue + if isinst(prvpkg): + found = True diff --git a/meta/recipes-devtools/python/python-smartpm/smart-conflict-provider.patch b/meta/recipes-devtools/python/python-smartpm/smart-conflict-provider.patch new file mode 100644 index 0000000000..10a7447cb4 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-conflict-provider.patch @@ -0,0 +1,196 @@ +Report a reason when a dependency could not be installed because it is locked + +If a requirement of a package is conflicted, depending on how the +solution is reached, the transaction code may eliminate all providers +of the requirement and then error out because nothing provides them. To +work around this, store a reason in the locked dict and report that back +if we need to, so for example instead of: + + error: Can't install packagegroup-core-ssh-dropbear-1.0-r1@all: no package provides dropbear + +we now get: + + error: Can't install packagegroup-core-ssh-dropbear-1.0-r1@all: unable to install provider for dropbear: + error: dropbear-2013.58-r1.0@armv5te is conflicted by openssh-sshd-6.2p2-r0@armv5te + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton +--- + smart/const.py | 7 +++++++ + smart/transaction.py | 58 +++++++++++++++++++++++++++++++++++++++++----------- + 2 files changed, 53 insertions(+), 12 deletions(-) + +diff --git a/smart/const.py b/smart/const.py +index 4d8e5cb..67c1ac5 100644 +--- a/smart/const.py ++++ b/smart/const.py +@@ -70,4 +70,11 @@ DATADIR = "/var/lib/smart/" + USERDATADIR = "~/.smart/" + CONFFILE = "config" + ++LOCKED_INSTALL = Enum('LOCKED_INSTALL') ++LOCKED_REMOVE = Enum('LOCKED_REMOVE') ++LOCKED_CONFLICT = Enum('LOCKED_CONFLICT') ++LOCKED_CONFLICT_BY = Enum('LOCKED_CONFLICT_BY') ++LOCKED_NO_COEXIST = Enum('LOCKED_NO_COEXIST') ++LOCKED_SYSCONF = Enum('LOCKED_SYSCONF') ++ + # vim:ts=4:sw=4:et +diff --git a/smart/transaction.py b/smart/transaction.py +index 300b9cc..dd9aa38 100644 +--- a/smart/transaction.py ++++ b/smart/transaction.py +@@ -19,10 +19,31 @@ + # along with Smart Package Manager; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # +-from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP ++from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP, LOCKED_INSTALL, LOCKED_CONFLICT, LOCKED_CONFLICT_BY, LOCKED_NO_COEXIST, LOCKED_SYSCONF, LOCKED_REMOVE + from smart.cache import PreRequires, Package + from smart import * + ++def lock_reason(pkg, lockvalue): ++ try: ++ (reason, otherpkg) = lockvalue ++ except TypeError: ++ reason = None ++ lockvalue = None ++ if reason == LOCKED_INSTALL: ++ return _("%s is to be installed") % pkg ++ elif reason == LOCKED_CONFLICT: ++ return _("%s conflicts with %s") % (pkg, otherpkg) ++ elif reason == LOCKED_CONFLICT_BY: ++ return _("%s is conflicted by %s") % (pkg, otherpkg) ++ elif reason == LOCKED_NO_COEXIST: ++ return _("%s cannot coexist with %s") % (pkg, otherpkg) ++ elif reason == LOCKED_SYSCONF: ++ return _("%s is locked in system configuration") % pkg ++ elif reason == LOCKED_REMOVE: ++ return _("%s is to be removed") % pkg ++ else: ++ return _("%s is locked (unknown reason)") % pkg ++ + class ChangeSet(dict): + + def __init__(self, cache, state=None, requested=None): +@@ -187,7 +208,7 @@ class Policy(object): + for pkg in pkgconf.filterByFlag("lock", cache.getPackages()): + if pkg not in self._locked: + self._sysconflocked.append(pkg) +- self._locked[pkg] = True ++ self._locked[pkg] = (LOCKED_SYSCONF, None) + + def runFinished(self): + self._priorities.clear() +@@ -524,7 +545,7 @@ class Transaction(object): + if ownpending: + pending = [] + +- locked[pkg] = True ++ locked[pkg] = (LOCKED_INSTALL, None) + changeset.set(pkg, INSTALL) + isinst = changeset.installed + +@@ -535,7 +556,7 @@ class Transaction(object): + if prvpkg is pkg: + continue + if not isinst(prvpkg): +- locked[prvpkg] = True ++ locked[prvpkg] = (LOCKED_CONFLICT_BY, pkg) + continue + if prvpkg in locked: + raise Failed, _("Can't install %s: conflicted package " +@@ -550,7 +571,7 @@ class Transaction(object): + if cnfpkg is pkg: + continue + if not isinst(cnfpkg): +- locked[cnfpkg] = True ++ locked[cnfpkg] = (LOCKED_CONFLICT, pkg) + continue + if cnfpkg in locked: + raise Failed, _("Can't install %s: it's conflicted by " +@@ -565,7 +586,7 @@ class Transaction(object): + for namepkg in namepkgs: + if namepkg is not pkg and not pkg.coexists(namepkg): + if not isinst(namepkg): +- locked[namepkg] = True ++ locked[namepkg] = (LOCKED_NO_COEXIST, pkg) + continue + if namepkg in locked: + raise Failed, _("Can't install %s: it can't coexist " +@@ -577,6 +598,7 @@ class Transaction(object): + + # Check if someone is already providing it. + prvpkgs = {} ++ lockedpkgs = {} + found = False + for prv in req.providedby: + for prvpkg in prv.packages: +@@ -585,6 +607,8 @@ class Transaction(object): + break + if prvpkg not in locked: + prvpkgs[prvpkg] = True ++ else: ++ lockedpkgs[prvpkg] = locked[prvpkg] + else: + continue + break +@@ -597,7 +621,17 @@ class Transaction(object): + if not prvpkgs: + # No packages provide it at all. Give up. + if req in pkg.requires: +- raise Failed, _("Can't install %s: no package provides %s") % \ ++ reasons = [] ++ for prv in req.providedby: ++ for prvpkg in prv.packages: ++ lockedres = lockedpkgs.get(prvpkg, None) ++ if lockedres: ++ reasons.append(lock_reason(prvpkg, lockedres)) ++ if reasons: ++ raise Failed, _("Can't install %s: unable to install provider for %s:\n %s") % \ ++ (pkg, req, '\n '.join(reasons)) ++ else: ++ raise Failed, _("Can't install %s: no package provides %s") % \ + (pkg, req) + else: + # It's only a recommend, skip +@@ -627,7 +661,7 @@ class Transaction(object): + if ownpending: + pending = [] + +- locked[pkg] = True ++ locked[pkg] = (LOCKED_REMOVE, None) + changeset.set(pkg, REMOVE) + isinst = changeset.installed + +@@ -1140,22 +1174,22 @@ class Transaction(object): + if op is KEEP: + if pkg in changeset: + del changeset[pkg] +- locked[pkg] = True ++ locked[pkg] = (LOCKED_KEEP, None) + elif op is INSTALL: + if not isinst(pkg) and pkg in locked: + raise Failed, _("Can't install %s: it's locked") % pkg + changeset.set(pkg, INSTALL) +- locked[pkg] = True ++ locked[pkg] = (LOCKED_INSTALL, None) + elif op is REMOVE: + if isinst(pkg) and pkg in locked: + raise Failed, _("Can't remove %s: it's locked") % pkg + changeset.set(pkg, REMOVE) +- locked[pkg] = True ++ locked[pkg] = (LOCKED_REMOVE, None) + elif op is REINSTALL: + if pkg in locked: + raise Failed, _("Can't reinstall %s: it's locked")%pkg + changeset.set(pkg, INSTALL, force=True) +- locked[pkg] = True ++ locked[pkg] = (LOCKED_INSTALL, None) + elif op is UPGRADE: + pass + +-- +1.8.1.2 + diff --git a/meta/recipes-devtools/python/python-smartpm/smart-dflags.patch b/meta/recipes-devtools/python/python-smartpm/smart-dflags.patch new file mode 100644 index 0000000000..531ea51cad --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-dflags.patch @@ -0,0 +1,45 @@ +backends/rpm: add support for setting dependency flags + +This is useful for OpenEmbedded so that we can do the equivalent of +the --nolinktos and --noparentdirs rpm command line options. + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton + +[sgw - Added try/catch for rpm4 since it does not have setDFlags() API] + +Signed-off-by: Saul Wold + + +Index: smart-1.4.1/smart/backends/rpm/pm.py +=================================================================== +--- smart-1.4.1.orig/smart/backends/rpm/pm.py ++++ smart-1.4.1/smart/backends/rpm/pm.py +@@ -106,6 +106,26 @@ class RPMPackageManager(PackageManager): + flags |= rpm.RPMTRANS_FLAG_TEST + ts.setFlags(flags) + ++ try: ++ dflags = ts.setDFlags(0) ++ if sysconf.get("rpm-noupgrade", False): ++ dflags |= rpm.RPMDEPS_FLAG_NOUPGRADE ++ if sysconf.get("rpm-norequires", False): ++ dflags |= rpm.RPMDEPS_FLAG_NOREQUIRES ++ if sysconf.get("rpm-noconflicts", False): ++ dflags |= rpm.RPMDEPS_FLAG_NOCONFLICTS ++ if sysconf.get("rpm-noobsoletes", False): ++ dflags |= rpm.RPMDEPS_FLAG_NOOBSOLETES ++ if sysconf.get("rpm-noparentdirs", False): ++ dflags |= rpm.RPMDEPS_FLAG_NOPARENTDIRS ++ if sysconf.get("rpm-nolinktos", False): ++ dflags |= rpm.RPMDEPS_FLAG_NOLINKTOS ++ if sysconf.get("rpm-nosuggest", False): ++ dflags |= rpm.RPMDEPS_FLAG_NOSUGGEST ++ ts.setDFlags(dflags) ++ except AttributeError, ae: ++ pass ++ + # Set rpm verbosity level. + levelname = sysconf.get('rpm-log-level') + level = { diff --git a/meta/recipes-devtools/python/python-smartpm/smart-filename-NAME_MAX.patch b/meta/recipes-devtools/python/python-smartpm/smart-filename-NAME_MAX.patch new file mode 100644 index 0000000000..22794a7388 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-filename-NAME_MAX.patch @@ -0,0 +1,35 @@ +From a17998b6be3319ae476a64f366737bc267a53a8a Mon Sep 17 00:00:00 2001 +From: Robert Yang +Date: Mon, 16 Sep 2013 05:54:13 -0400 +Subject: [PATCH] fetcher.py: truncate the filename to meet NAME_MAX + +The function getLocalPath() converts the filepath into the filename, +there would be a "File name too long" error when len(filename) > +NAME_MAX, truncate it to meet NAME_MAX will fix the problem. + +Signed-off-by: Robert Yang +--- + smart/fetcher.py | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/smart/fetcher.py b/smart/fetcher.py +--- a/smart/fetcher.py ++++ b/smart/fetcher.py +@@ -139,6 +139,14 @@ class Fetcher(object): + filename = os.path.basename(path) + if self._localpathprefix: + filename = self._localpathprefix+filename ++ # pathconf requires the path existed ++ if not os.path.exists(self._localdir): ++ os.makedirs(self._localdir) ++ name_max = os.pathconf(self._localdir, 'PC_NAME_MAX') ++ # The length of the filename should be less than NAME_MAX ++ if len(filename) > name_max: ++ iface.debug(_("Truncate %s to %s") % (filename, filename[-name_max:])) ++ filename = filename[-name_max:] + return os.path.join(self._localdir, filename) + + def setForceCopy(self, value): +-- +1.7.10.4 + diff --git a/meta/recipes-devtools/python/python-smartpm/smart-flag-exclude-packages.patch b/meta/recipes-devtools/python/python-smartpm/smart-flag-exclude-packages.patch new file mode 100644 index 0000000000..21a28746a1 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-flag-exclude-packages.patch @@ -0,0 +1,70 @@ +Add exclude-packages flag support + +Allow configuring specific packages to be excluded. This will allow +users to specify things NOT to install, and if they are attempted an +error will be generated. + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: smart-1.4.1/smart/const.py +=================================================================== +--- smart-1.4.1.orig/smart/const.py ++++ smart-1.4.1/smart/const.py +@@ -70,6 +70,7 @@ DATADIR = "/var/lib/smart/" + USERDATADIR = "~/.smart/" + CONFFILE = "config" + ++LOCKED_EXCLUDE = Enum('LOCKED_EXCLUDE') + LOCKED_INSTALL = Enum('LOCKED_INSTALL') + LOCKED_REMOVE = Enum('LOCKED_REMOVE') + LOCKED_CONFLICT = Enum('LOCKED_CONFLICT') +Index: smart-1.4.1/smart/transaction.py +=================================================================== +--- smart-1.4.1.orig/smart/transaction.py ++++ smart-1.4.1/smart/transaction.py +@@ -19,7 +19,7 @@ + # along with Smart Package Manager; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # +-from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP, LOCKED_INSTALL, LOCKED_CONFLICT, LOCKED_CONFLICT_BY, LOCKED_NO_COEXIST, LOCKED_SYSCONF, LOCKED_REMOVE ++from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP, LOCKED_EXCLUDE, LOCKED_INSTALL, LOCKED_CONFLICT, LOCKED_CONFLICT_BY, LOCKED_NO_COEXIST, LOCKED_SYSCONF, LOCKED_REMOVE + from smart.cache import PreRequires, Package + from smart import * + +@@ -29,7 +29,9 @@ def lock_reason(pkg, lockvalue): + except TypeError: + reason = None + lockvalue = None +- if reason == LOCKED_INSTALL: ++ if reason == LOCKED_EXCLUDE: ++ return _("%s is to be excluded") % pkg ++ elif reason == LOCKED_INSTALL: + return _("%s is to be installed") % pkg + elif reason == LOCKED_CONFLICT: + return _("%s conflicts with %s") % (pkg, otherpkg) +@@ -210,6 +212,10 @@ class Policy(object): + self._sysconflocked.append(pkg) + self._locked[pkg] = (LOCKED_SYSCONF, None) + ++ for pkg in pkgconf.filterByFlag("exclude-packages", cache.getPackages()): ++ if pkg not in self._locked: ++ self._locked[pkg] = (LOCKED_EXCLUDE, None) ++ + def runFinished(self): + self._priorities.clear() + for pkg in self._sysconflocked: +Index: smart-1.4.1/smart/commands/flag.py +=================================================================== +--- smart-1.4.1.orig/smart/commands/flag.py ++++ smart-1.4.1/smart/commands/flag.py +@@ -47,6 +47,8 @@ Currently known flags are: + multi-version - Flagged packages may have more than one version + installed in the system at the same time + (backend dependent). ++ exclude-packages - Flagged packages will be excluded, if they are ++ required, an error will be generated. + ignore-recommends - Flagged packages will not be installed, if + they are only recommended by a package to be + installed rather than required. diff --git a/meta/recipes-devtools/python/python-smartpm/smart-flag-ignore-recommends.patch b/meta/recipes-devtools/python/python-smartpm/smart-flag-ignore-recommends.patch new file mode 100644 index 0000000000..5d5c6f4346 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-flag-ignore-recommends.patch @@ -0,0 +1,60 @@ +Add ignore-recommends flag support + +Allow configuring recommends on specific packages to be ignored. + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton +--- + smart/commands/flag.py | 3 +++ + smart/transaction.py | 7 ++++++- + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/smart/commands/flag.py b/smart/commands/flag.py +index 8b90496..191bb11 100644 +--- a/smart/commands/flag.py ++++ b/smart/commands/flag.py +@@ -47,6 +47,9 @@ Currently known flags are: + multi-version - Flagged packages may have more than one version + installed in the system at the same time + (backend dependent). ++ ignore-recommends - Flagged packages will not be installed, if ++ they are only recommended by a package to be ++ installed rather than required. + + security - Flagged packages are updates for security errata. + bugfix - Flagged packages are updates for bugfix errata. +diff --git a/smart/transaction.py b/smart/transaction.py +index dd9aa38..38eabae 100644 +--- a/smart/transaction.py ++++ b/smart/transaction.py +@@ -596,12 +596,17 @@ class Transaction(object): + # Install packages required by this one. + for req in pkg.requires + pkg.recommends: + ++ reqrequired = req in pkg.requires ++ + # Check if someone is already providing it. + prvpkgs = {} + lockedpkgs = {} + found = False + for prv in req.providedby: + for prvpkg in prv.packages: ++ if not reqrequired: ++ if pkgconf.testFlag("ignore-recommends", prvpkg): ++ continue + if isinst(prvpkg): + found = True + break +@@ -620,7 +625,7 @@ class Transaction(object): + + if not prvpkgs: + # No packages provide it at all. Give up. +- if req in pkg.requires: ++ if reqrequired: + reasons = [] + for prv in req.providedby: + for prvpkg in prv.packages: +-- +1.8.1.2 + diff --git a/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch b/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch new file mode 100644 index 0000000000..2ca0f6d593 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch @@ -0,0 +1,253 @@ +Improve error reporting in smart + +Add code to check proper command line arguments for various +smart commands. Exit with error if erroneous/additional arguments +are given in the command line. + +Upstream-Status: Pending + +Signed-off-by: Bogdan Marinescu + +diff --git a/smart/commands/channel.py b/smart/commands/channel.py +index aa76f91..63fbb35 100644 +--- a/smart/commands/channel.py ++++ b/smart/commands/channel.py +@@ -157,7 +157,17 @@ def main(ctrl, opts): + opts.show is None and opts.yaml is None): + iface.warning(_("Can't edit channels information.")) + raise Error, _("Configuration is in readonly mode.") +- ++ ++ # Argument check ++ opts.check_args_of_option("set", -1) ++ opts.check_args_of_option("remove", -1) ++ opts.check_args_of_option("edit", 0) ++ opts.check_args_of_option("enable", -1) ++ opts.check_args_of_option("disable", -1) ++ opts.ensure_action("channel", ["add", "set", "remove", "remove_all", ++ "list", "show", "yaml", "enable", "disable"]) ++ opts.check_remaining_args() ++ + if opts.add is not None: + if not opts.add and opts.args == ["-"]: + newchannels = [] +diff --git a/smart/commands/check.py b/smart/commands/check.py +index b08608a..506e852 100644 +--- a/smart/commands/check.py ++++ b/smart/commands/check.py +@@ -72,6 +72,9 @@ def parse_options(argv): + + def main(ctrl, opts, reloadchannels=True): + ++ # Argument check ++ opts.check_args_of_option("channels", 1) ++ + if sysconf.get("auto-update"): + from smart.commands import update + updateopts = update.parse_options([]) +diff --git a/smart/commands/config.py b/smart/commands/config.py +index dd50dee..4fe4366 100644 +--- a/smart/commands/config.py ++++ b/smart/commands/config.py +@@ -80,6 +80,12 @@ def main(ctrl, opts): + globals["false"] = False + globals["no"] = False + ++ # Check arguments ++ opts.check_args_of_option("set", -1) ++ opts.check_args_of_option("remove", -1) ++ opts.ensure_action("config", ["set", "show", "yaml", "remove"]) ++ opts.check_remaining_args() ++ + if opts.set: + for opt in opts.set: + m = SETRE.match(opt) +diff --git a/smart/commands/download.py b/smart/commands/download.py +index 6837993..b853c61 100644 +--- a/smart/commands/download.py ++++ b/smart/commands/download.py +@@ -81,6 +81,14 @@ def parse_options(argv): + + def main(ctrl, opts): + ++ # Argument check ++ opts.check_args_of_option("target", 1) ++ opts.check_args_of_option("output", 1) ++ opts.check_args_of_option("from_urls", -1) ++ opts.check_args_of_option("from_metalink", -1) ++ if not opts.args and not opts.from_metalink and not opts.from_urls: ++ raise Error, _("no package(s) given") ++ + packages = [] + if opts.args: + if sysconf.get("auto-update"): +diff --git a/smart/commands/info.py b/smart/commands/info.py +index 12f74f0..59fbe98 100644 +--- a/smart/commands/info.py ++++ b/smart/commands/info.py +@@ -58,6 +58,10 @@ def parse_options(argv): + + def main(ctrl, opts, reloadchannels=True): + ++ # Argument check ++ if not opts.args: ++ raise Error, _("No package(s) given") ++ + if sysconf.get("auto-update"): + from smart.commands import update + updateopts = update.parse_options([]) +diff --git a/smart/commands/install.py b/smart/commands/install.py +index 8a45954..590222c 100644 +--- a/smart/commands/install.py ++++ b/smart/commands/install.py +@@ -76,6 +76,10 @@ def parse_options(argv): + + def main(ctrl, opts): + ++ # Argument check ++ if not opts.args: ++ raise Error, _("no package(s) given") ++ + if opts.explain: + sysconf.set("explain-changesets", True, soft=True) + +diff --git a/smart/commands/reinstall.py b/smart/commands/reinstall.py +index e59d896..32da3e6 100644 +--- a/smart/commands/reinstall.py ++++ b/smart/commands/reinstall.py +@@ -68,7 +68,11 @@ def parse_options(argv): + return opts + + def main(ctrl, opts): +- ++ ++ # Argument check ++ if not opts.args: ++ raise Error, _("no package(s) given") ++ + if opts.explain: + sysconf.set("explain-changesets", True, soft=True) + +diff --git a/smart/commands/remove.py b/smart/commands/remove.py +index b4823a6..acd3bbd 100644 +--- a/smart/commands/remove.py ++++ b/smart/commands/remove.py +@@ -74,6 +74,10 @@ def parse_options(argv): + + def main(ctrl, opts): + ++ # Argument check ++ if not opts.args: ++ raise Error, _("no package(s) given") ++ + if opts.explain: + sysconf.set("explain-changesets", True, soft=True) + +diff --git a/smart/commands/search.py b/smart/commands/search.py +index 0d0b573..44806b8 100644 +--- a/smart/commands/search.py ++++ b/smart/commands/search.py +@@ -44,6 +44,8 @@ def option_parser(): + def parse_options(argv): + opts = query.parse_options(argv, usage=USAGE, \ + description=DESCRIPTION, examples=EXAMPLES) ++ if not argv: ++ raise Error, _("Search expression not specified") + opts.name = opts.args + opts.summary = opts.args + opts.description = opts.args +diff --git a/smart/commands/upgrade.py b/smart/commands/upgrade.py +index ec86290..7e290d8 100644 +--- a/smart/commands/upgrade.py ++++ b/smart/commands/upgrade.py +@@ -91,6 +91,9 @@ def parse_options(argv): + + def main(ctrl, opts): + ++ # Argument check ++ opts.check_args_of_option("flag", 1) ++ + if opts.explain: + sysconf.set("explain-changesets", True, soft=True) + +diff --git a/smart/util/optparse.py b/smart/util/optparse.py +index 4a3d3a8..279b0bf 100644 +--- a/smart/util/optparse.py ++++ b/smart/util/optparse.py +@@ -70,6 +70,8 @@ import sys, os + import types + import textwrap + from gettext import gettext as _ ++from smart import Error ++import re + + def _repr(self): + return "<%s at 0x%x: %s>" % (self.__class__.__name__, id(self), self) +@@ -708,6 +710,12 @@ class Option: + self.action, self.dest, opt, value, values, parser) + + def take_action(self, action, dest, opt, value, values, parser): ++ # Keep all the options in the command line in the '_given_opts' array ++ # This will be used later to validate the command line ++ given_opts = getattr(parser.values, "_given_opts", []) ++ user_opt = re.sub(r"^\-*", "", opt).replace("-", "_") ++ given_opts.append(user_opt) ++ setattr(parser.values, "_given_opts", given_opts) + if action == "store": + setattr(values, dest, value) + elif action == "store_const": +@@ -819,6 +827,54 @@ class Values: + setattr(self, attr, value) + return getattr(self, attr) + ++ # Check if the given option has the specified number of arguments ++ # Raise an error if the option has an invalid number of arguments ++ # A negative number for 'nargs' means "at least |nargs| arguments are needed" ++ def check_args_of_option(self, opt, nargs, err=None): ++ given_opts = getattr(self, "_given_opts", []) ++ if not opt in given_opts: ++ return ++ values = getattr(self, opt, []) ++ if type(values) != type([]): ++ return ++ if nargs < 0: ++ nargs = -nargs ++ if len(values) >= nargs: ++ return ++ if not err: ++ if nargs == 1: ++ err = _("Option '%s' requires at least one argument") % opt ++ else: ++ err = _("Option '%s' requires at least %d arguments") % (opt, nargs) ++ raise Error, err ++ elif nargs == 0: ++ if len( values ) == 0: ++ return ++ raise Error, err ++ else: ++ if len(values) == nargs: ++ return ++ if not err: ++ if nargs == 1: ++ err = _("Option '%s' requires one argument") % opt ++ else: ++ err = _("Option '%s' requires %d arguments") % (opt, nargs) ++ raise Error, err ++ ++ # Check that at least one of the options in 'actlist' was given as an argument ++ # to the command 'cmdname' ++ def ensure_action(self, cmdname, actlist): ++ given_opts = getattr(self, "_given_opts", []) ++ for action in actlist: ++ if action in given_opts: ++ return ++ raise Error, _("No action specified for command '%s'") % cmdname ++ ++ # Check if there are any other arguments left after parsing the command line and ++ # raise an error if such arguments are found ++ def check_remaining_args(self): ++ if self.args: ++ raise Error, _("Invalid argument(s) '%s'" % str(self.args)) + + class OptionContainer: + diff --git a/meta/recipes-devtools/python/python-smartpm/smart-metadata-match.patch b/meta/recipes-devtools/python/python-smartpm/smart-metadata-match.patch new file mode 100644 index 0000000000..d06f416605 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-metadata-match.patch @@ -0,0 +1,28 @@ +smart - backends/rmp/metadata.py: Fix incorrect call to the match function + +The match function should take three parameters, name, comparison, version... +The original code was passing it a reference to the object holding the data +instead, which caused the comparison in match to always fail. + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +--- a/smart/backends/rpm/metadata.py ++++ b/smart/backends/rpm/metadata.py +@@ -332,13 +332,13 @@ + reqargs = [x for x in reqdict + if not ((x[2] is None or "=" in x[2]) and + (RPMProvides, x[1], x[3]) in prvdict or +- system_provides.match(*x[:3]))] ++ system_provides.match(x[1], x[2], x[3]))] + reqargs = collapse_libc_requires(reqargs) + + recargs = [x for x in recdict + if not ((x[2] is None or "=" in x[2]) and + (RPMProvides, x[1], x[3]) in prvdict or +- system_provides.match(*x[:3]))] ++ system_provides.match(x[1], x[2], x[3]))] + + prvargs = prvdict.keys() + cnfargs = cnfdict.keys() diff --git a/meta/recipes-devtools/python/python-smartpm/smart-multilib-fixes.patch b/meta/recipes-devtools/python/python-smartpm/smart-multilib-fixes.patch new file mode 100644 index 0000000000..56fef79a5f --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-multilib-fixes.patch @@ -0,0 +1,22 @@ +To fix some multilib issues, change the way the RPM backend decides +if two packages can coexist: if they have a different architecture, +automatically assume that they can coexist (which is fundamental for +multilib). + +Upstream-Status: Pending + +Signed-off-by: Bogdan Marinescu + +diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py +index 6e83d40..7140c1b 100644 +--- a/smart/backends/rpm/base.py ++++ b/smart/backends/rpm/base.py +@@ -228,6 +228,8 @@ class RPMPackage(Package): + return False + selfver, selfarch = splitarch(self.version) + otherver, otherarch = splitarch(other.version) ++ if selfarch != otherarch: ++ return True + selfcolor = getArchColor(selfarch) + othercolor = getArchColor(otherarch) + if (selfcolor and othercolor and selfcolor != othercolor and diff --git a/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch b/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch new file mode 100644 index 0000000000..a41b1beaa9 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch @@ -0,0 +1,1362 @@ +Handle recommended packages in core and rpm backends + +Identify and store recommended packages in the cache, add a query option +to read them and ignore them if they are not present when installing. + +Initial identification code from Mark Hatle . + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton + +diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py +index 0489e11..b9e9cb2 100644 +--- a/smart/backends/rpm/base.py ++++ b/smart/backends/rpm/base.py +@@ -198,6 +198,29 @@ class RPMPackage(Package): + break + else: + return False ++ srecs = fk(self.recommends) ++ orecs = fk(other.recommends) ++ if srecs != orecs: ++ for srec in srecs: ++ if srec.name[0] == "/" or srec in orecs: ++ continue ++ for orec in orecs: ++ if (srec.name == orec.name and ++ srec.relation == orec.relation and ++ checkver(srec.version, orec.version)): ++ break ++ else: ++ return False ++ for orec in orecs: ++ if orec.name[0] == "/" or orec in srecs: ++ continue ++ for srec in srecs: ++ if (srec.name == orec.name and ++ srec.relation == orec.relation and ++ checkver(srec.version, orec.version)): ++ break ++ else: ++ return False + return True + + def coexists(self, other): +diff --git a/smart/backends/rpm/header.py b/smart/backends/rpm/header.py +index 31786cc..4880f43 100644 +--- a/smart/backends/rpm/header.py ++++ b/smart/backends/rpm/header.py +@@ -292,6 +292,7 @@ class RPMHeaderLoader(Loader): + f = [0] + elif type(f) != list: + f = [f] ++ recdict = {} + reqdict = {} + for i in range(len(n)): + ni = n[i] +@@ -308,10 +309,16 @@ class RPMHeaderLoader(Loader): + # RPMSENSE_SCRIPT_PREUN | + # RPMSENSE_SCRIPT_POST | + # RPMSENSE_SCRIPT_POSTUN == 7744 +- reqdict[(f[i]&7744 and PreReq or Req, +- intern(ni), r, vi)] = True ++ if (f[i]&rpm.RPMSENSE_MISSINGOK): ++ recdict[(f[i]&7744 and PreReq or Req, ++ intern(ni), r, vi)] = True ++ else: ++ reqdict[(f[i]&7744 and PreReq or Req, ++ intern(ni), r, vi)] = True ++ recargs = collapse_libc_requires(recdict.keys()) + reqargs = collapse_libc_requires(reqdict.keys()) + else: ++ recargs = None + reqargs = None + + n = h[1054] # RPMTAG_CONFLICTNAME +@@ -365,7 +372,7 @@ class RPMHeaderLoader(Loader): + versionarch = "%s@%s" % (distversion, arch) + + pkg = self.buildPackage((Pkg, name, versionarch), +- prvargs, reqargs, upgargs, cnfargs) ++ prvargs, reqargs, upgargs, cnfargs, recargs) + pkg.loaders[self] = offset + self._offsets[offset] = pkg + self._groups[pkg] = intern(h[rpm.RPMTAG_GROUP]) +@@ -583,8 +590,8 @@ class URPMILoader(RPMHeaderListLoader): + def setErrataFlags(self, flagdict): + self._flagdict = flagdict + +- def buildPackage(self, pkgargs, prvargs, reqargs, upgargs, cnfargs): +- pkg = Loader.buildPackage(self, pkgargs, prvargs, reqargs, upgargs, cnfargs) ++ def buildPackage(self, pkgargs, prvargs, reqargs, upgargs, cnfargs, recargs): ++ pkg = Loader.buildPackage(self, pkgargs, prvargs, reqargs, upgargs, cnfargs, recargs) + name = pkgargs[1] + if hasattr(self, '_flagdict') and self._flagdict and name in self._flagdict: + if sysconf.getReadOnly(): +diff --git a/smart/backends/rpm/metadata.py b/smart/backends/rpm/metadata.py +index 2c54f39..568fe06 100644 +--- a/smart/backends/rpm/metadata.py ++++ b/smart/backends/rpm/metadata.py +@@ -165,6 +165,7 @@ class RPMMetaDataLoader(Loader): + distepoch = None + info = {} + reqdict = {} ++ recdict = {} + prvdict = {} + upgdict = {} + cnfdict = {} +@@ -287,12 +288,16 @@ class RPMMetaDataLoader(Loader): + + lasttag = queue[-1].tag + if lasttag == REQUIRES: +- if elem.get("pre") == "1": +- reqdict[(RPMPreRequires, +- ename, erelation, eversion)] = True ++ if elem.get("missingok") == "1": ++ recdict[(RPMRequires, ++ ename, erelation, eversion)] = True + else: +- reqdict[(RPMRequires, +- ename, erelation, eversion)] = True ++ if elem.get("pre") == "1": ++ reqdict[(RPMPreRequires, ++ ename, erelation, eversion)] = True ++ else: ++ reqdict[(RPMRequires, ++ ename, erelation, eversion)] = True + + elif lasttag == PROVIDES: + if ename[0] == "/": +@@ -328,6 +333,12 @@ class RPMMetaDataLoader(Loader): + (RPMProvides, x[1], x[3]) in prvdict or + system_provides.match(*x[:3]))] + reqargs = collapse_libc_requires(reqargs) ++ ++ recargs = [x for x in recdict ++ if not ((x[2] is None or "=" in x[2]) and ++ (RPMProvides, x[1], x[3]) in prvdict or ++ system_provides.match(*x[:3]))] ++ + prvargs = prvdict.keys() + cnfargs = cnfdict.keys() + upgargs = upgdict.keys() +@@ -339,7 +350,7 @@ class RPMMetaDataLoader(Loader): + versionarch = "%s@%s" % (distversion, arch) + + pkg = self.buildPackage((RPMPackage, name, versionarch), +- prvargs, reqargs, upgargs, cnfargs) ++ prvargs, reqargs, upgargs, cnfargs, recargs) + pkg.loaders[self] = info + + # Store the provided files for future usage. +@@ -362,6 +373,7 @@ class RPMMetaDataLoader(Loader): + distepoch = None + pkgid = None + reqdict.clear() ++ recdict.clear() + prvdict.clear() + upgdict.clear() + cnfdict.clear() +diff --git a/smart/cache.py b/smart/cache.py +index b829825..cec8bb3 100644 +--- a/smart/cache.py ++++ b/smart/cache.py +@@ -32,7 +32,8 @@ class Package(object): + self.name = name + self.version = version + self.provides = () +- self.requires = () ++ self.requires = [] ++ self.recommends = [] + self.upgrades = () + self.conflicts = () + self.installed = False +@@ -55,7 +56,9 @@ class Package(object): + fk([x for x in self.provides if x.name[0] != "/"]) != + fk([x for x in other.provides if x.name[0] != "/"]) or + fk([x for x in self.requires if x.name[0] != "/"]) != +- fk([x for x in other.requires if x.name[0] != "/"])): ++ fk([x for x in other.requires if x.name[0] != "/"]) or ++ fk([x for x in self.recommends if x.name[0] != "/"]) != ++ fk([x for x in other.recommends if x.name[0] != "/"])): + return False + return True + +@@ -110,6 +113,7 @@ class Package(object): + self.version, + self.provides, + self.requires, ++ self.recommends, + self.upgrades, + self.conflicts, + self.installed, +@@ -122,6 +126,7 @@ class Package(object): + self.version, + self.provides, + self.requires, ++ self.recommends, + self.upgrades, + self.conflicts, + self.installed, +@@ -274,6 +279,7 @@ class Provides(object): + self.version = version + self.packages = [] + self.requiredby = () ++ self.recommendedby = () + self.upgradedby = () + self.conflictedby = () + +@@ -401,7 +407,7 @@ class Loader(object): + def loadFileProvides(self, fndict): + pass + +- def buildPackage(self, pkgargs, prvargs, reqargs, upgargs, cnfargs): ++ def buildPackage(self, pkgargs, prvargs, reqargs, upgargs, cnfargs, recargs = None): + cache = self._cache + pkg = pkgargs[0](*pkgargs[1:]) + relpkgs = [] +@@ -427,6 +433,17 @@ class Loader(object): + relpkgs.append(req.packages) + pkg.requires.append(req) + ++ if recargs: ++ pkg.recommends = [] ++ for args in recargs: ++ rec = cache._objmap.get(args) ++ if not rec: ++ rec = args[0](*args[1:]) ++ cache._objmap[args] = rec ++ cache._recommends.append(rec) ++ relpkgs.append(rec.packages) ++ pkg.recommends.append(rec) ++ + if upgargs: + pkg.upgrades = [] + for args in upgargs: +@@ -572,6 +589,7 @@ class Cache(object): + self._packages = [] + self._provides = [] + self._requires = [] ++ self._recommends = [] + self._upgrades = [] + self._conflicts = [] + self._objmap = {} +@@ -581,6 +599,8 @@ class Cache(object): + del prv.packages[:] + if prv.requiredby: + del prv.requiredby[:] ++ if prv.recommendedby: ++ del prv.recommendedby[:] + if prv.upgradedby: + del prv.upgradedby[:] + if prv.conflictedby: +@@ -589,6 +609,10 @@ class Cache(object): + del req.packages[:] + if req.providedby: + del req.providedby[:] ++ for rec in self._recommends: ++ del rec.packages[:] ++ if rec.providedby: ++ del rec.providedby[:] + for upg in self._upgrades: + del upg.packages[:] + if upg.providedby: +@@ -600,6 +624,7 @@ class Cache(object): + del self._packages[:] + del self._provides[:] + del self._requires[:] ++ del self._recommends[:] + del self._upgrades[:] + del self._conflicts[:] + self._objmap.clear() +@@ -621,6 +646,7 @@ class Cache(object): + packages = {} + provides = {} + requires = {} ++ recommends = {} + upgrades = {} + conflicts = {} + objmap = self._objmap +@@ -646,6 +672,11 @@ class Cache(object): + if req not in requires: + objmap[req.getInitArgs()] = req + requires[req] = True ++ for rec in pkg.recommends[:]: ++ rec.packages.append(pkg) ++ if rec not in recommends: ++ objmap[rec.getInitArgs()] = rec ++ recommends[rec] = True + for upg in pkg.upgrades: + upg.packages.append(pkg) + if upg not in upgrades: +@@ -659,6 +690,7 @@ class Cache(object): + self._packages[:] = packages.keys() + self._provides[:] = provides.keys() + self._requires[:] = requires.keys() ++ self._recommends[:] = recommends.keys() + self._upgrades[:] = upgrades.keys() + self._conflicts[:] = conflicts.keys() + +@@ -710,6 +742,14 @@ class Cache(object): + lst.append(req) + else: + reqnames[name] = [req] ++ recnames = {} ++ for rec in self._recommends: ++ for name in rec.getMatchNames(): ++ lst = recnames.get(name) ++ if lst: ++ lst.append(rec) ++ else: ++ recnames[name] = [rec] + upgnames = {} + for upg in self._upgrades: + for name in upg.getMatchNames(): +@@ -739,6 +779,18 @@ class Cache(object): + prv.requiredby.append(req) + else: + prv.requiredby = [req] ++ lst = recnames.get(prv.name) ++ if lst: ++ for rec in lst: ++ if rec.matches(prv): ++ if rec.providedby: ++ rec.providedby.append(prv) ++ else: ++ rec.providedby = [prv] ++ if prv.recommendedby: ++ prv.recommendedby.append(rec) ++ else: ++ prv.recommendedby = [rec] + lst = upgnames.get(prv.name) + if lst: + for upg in lst: +@@ -782,6 +834,12 @@ class Cache(object): + else: + return [x for x in self._requires if x.name == name] + ++ def getRecommends(self, name=None): ++ if not name: ++ return self._recommends ++ else: ++ return [x for x in self._recommends if x.name == name] ++ + def getUpgrades(self, name=None): + if not name: + return self._upgrades +@@ -807,6 +865,12 @@ class Cache(object): + for req in self._requires: + if prvname in req.getMatchNames() and req.matches(prv): + searcher.addResult(req) ++ if searcher.recommends: ++ for prv in searcher.recommends: ++ prvname = prv.name ++ for req in self._recommends: ++ if prvname in req.getMatchNames() and req.matches(prv): ++ searcher.addResult(req) + if searcher.upgrades: + for prv in searcher.upgrades: + prvname = prv.name +@@ -839,6 +903,7 @@ class Cache(object): + self._packages = state["_packages"] + provides = {} + requires = {} ++ recommends = {} + upgrades = {} + conflicts = {} + for pkg in self._packages: +@@ -848,6 +913,9 @@ class Cache(object): + for req in pkg.requires: + req.packages.append(pkg) + requires[req] = True ++ for rec in pkg.recommends: ++ rec.packages.append(pkg) ++ recommends[rec] = True + for upg in pkg.upgrades: + upg.packages.append(pkg) + upgrades[upg] = True +@@ -856,6 +924,7 @@ class Cache(object): + conflicts[cnf] = True + self._provides = provides.keys() + self._requires = requires.keys() ++ self._recommends = recommends.keys() + self._upgrades = upgrades.keys() + self._conflicts = conflicts.keys() + self._objmap = {} +diff --git a/smart/ccache.c b/smart/ccache.c +index 7541e26..7193185 100644 +--- a/smart/ccache.c ++++ b/smart/ccache.c +@@ -82,6 +82,7 @@ typedef struct { + PyObject *version; + PyObject *provides; + PyObject *requires; ++ PyObject *recommends; + PyObject *upgrades; + PyObject *conflicts; + PyObject *installed; +@@ -96,6 +97,7 @@ typedef struct { + PyObject *version; + PyObject *packages; + PyObject *requiredby; ++ PyObject *recommendedby; + PyObject *upgradedby; + PyObject *conflictedby; + } ProvidesObject; +@@ -123,6 +125,7 @@ typedef struct { + PyObject *_packages; + PyObject *_provides; + PyObject *_requires; ++ PyObject *_recommends; + PyObject *_upgrades; + PyObject *_conflicts; + PyObject *_objmap; +@@ -211,7 +214,8 @@ Package_init(PackageObject *self, PyObject *args) + Py_INCREF(self->name); + Py_INCREF(self->version); + self->provides = PyTuple_New(0); +- self->requires = PyTuple_New(0); ++ self->requires = PyList_New(0); ++ self->recommends = PyList_New(0); + self->upgrades = PyTuple_New(0); + self->conflicts = PyTuple_New(0); + Py_INCREF(Py_False); +@@ -228,6 +232,7 @@ Package_traverse(PackageObject *self, visitproc visit, void *arg) + { + Py_VISIT(self->provides); + Py_VISIT(self->requires); ++ Py_VISIT(self->recommends); + Py_VISIT(self->upgrades); + Py_VISIT(self->conflicts); + Py_VISIT(self->loaders); +@@ -239,6 +244,7 @@ Package_clear(PackageObject *self) + { + Py_CLEAR(self->provides); + Py_CLEAR(self->requires); ++ Py_CLEAR(self->recommends); + Py_CLEAR(self->upgrades); + Py_CLEAR(self->conflicts); + Py_CLEAR(self->loaders); +@@ -252,6 +258,7 @@ Package_dealloc(PackageObject *self) + Py_XDECREF(self->version); + Py_XDECREF(self->provides); + Py_XDECREF(self->requires); ++ Py_XDECREF(self->recommends); + Py_XDECREF(self->upgrades); + Py_XDECREF(self->conflicts); + Py_XDECREF(self->installed); +@@ -453,6 +460,46 @@ Package_equals(PackageObject *self, PackageObject *other) + } + } + ++ ilen = 0; ++ jlen = 0; ++ for (i = 0; i != PyList_GET_SIZE(self->recommends); i++) { ++ PyObject *item = PyList_GET_ITEM(self->recommends, i); ++ if (!PyObject_IsInstance(item, (PyObject *)&Depends_Type)) { ++ PyErr_SetString(PyExc_TypeError, "Depends instance expected"); ++ return NULL; ++ } ++ if (STR(((DependsObject *)item)->name)[0] != '/') ++ ilen += 1; ++ } ++ for (j = 0; j != PyList_GET_SIZE(other->recommends); j++) { ++ PyObject *item = PyList_GET_ITEM(other->recommends, j); ++ if (!PyObject_IsInstance(item, (PyObject *)&Depends_Type)) { ++ PyErr_SetString(PyExc_TypeError, "Depends instance expected"); ++ return NULL; ++ } ++ if (STR(((DependsObject *)item)->name)[0] != '/') ++ jlen += 1; ++ } ++ if (ilen != jlen) { ++ ret = Py_False; ++ goto exit; ++ } ++ ++ ilen = PyList_GET_SIZE(self->recommends); ++ jlen = PyList_GET_SIZE(other->recommends); ++ for (i = 0; i != ilen; i++) { ++ PyObject *item = PyList_GET_ITEM(self->recommends, i); ++ if (STR(((DependsObject *)item)->name)[0] != '/') { ++ for (j = 0; j != jlen; j++) ++ if (item == PyList_GET_ITEM(other->recommends, j)) ++ break; ++ if (j == jlen) { ++ ret = Py_False; ++ goto exit; ++ } ++ } ++ } ++ + exit: + Py_INCREF(ret); + return ret; +@@ -606,13 +653,14 @@ Package_getPriority(PackageObject *self, PyObject *args) + static PyObject * + Package__getstate__(PackageObject *self, PyObject *args) + { +- PyObject *state = PyTuple_New(10); ++ PyObject *state = PyTuple_New(11); + if (!state) return NULL; + + Py_INCREF(self->name); + Py_INCREF(self->version); + Py_INCREF(self->provides); + Py_INCREF(self->requires); ++ Py_INCREF(self->recommends); + Py_INCREF(self->upgrades); + Py_INCREF(self->conflicts); + Py_INCREF(self->installed); +@@ -620,16 +668,17 @@ Package__getstate__(PackageObject *self, PyObject *args) + Py_INCREF(self->priority); + Py_INCREF(self->loaders); + +- PyTuple_SET_ITEM(state, 0, self->name); +- PyTuple_SET_ITEM(state, 1, self->version); +- PyTuple_SET_ITEM(state, 2, self->provides); +- PyTuple_SET_ITEM(state, 3, self->requires); +- PyTuple_SET_ITEM(state, 4, self->upgrades); +- PyTuple_SET_ITEM(state, 5, self->conflicts); +- PyTuple_SET_ITEM(state, 6, self->installed); +- PyTuple_SET_ITEM(state, 7, self->essential); +- PyTuple_SET_ITEM(state, 8, self->priority); +- PyTuple_SET_ITEM(state, 9, self->loaders); ++ PyTuple_SET_ITEM(state, 0, self->name); ++ PyTuple_SET_ITEM(state, 1, self->version); ++ PyTuple_SET_ITEM(state, 2, self->provides); ++ PyTuple_SET_ITEM(state, 3, self->requires); ++ PyTuple_SET_ITEM(state, 4, self->recommends); ++ PyTuple_SET_ITEM(state, 5, self->upgrades); ++ PyTuple_SET_ITEM(state, 6, self->conflicts); ++ PyTuple_SET_ITEM(state, 7, self->installed); ++ PyTuple_SET_ITEM(state, 8, self->essential); ++ PyTuple_SET_ITEM(state, 9, self->priority); ++ PyTuple_SET_ITEM(state, 10, self->loaders); + + return state; + } +@@ -637,7 +686,7 @@ Package__getstate__(PackageObject *self, PyObject *args) + static PyObject * + Package__setstate__(PackageObject *self, PyObject *state) + { +- if (!PyTuple_Check(state) || PyTuple_GET_SIZE(state) != 10) { ++ if (!PyTuple_Check(state) || PyTuple_GET_SIZE(state) != 11) { + PyErr_SetString(StateVersionError, ""); + return NULL; + } +@@ -645,18 +694,20 @@ Package__setstate__(PackageObject *self, PyObject *state) + self->version = PyTuple_GET_ITEM(state, 1); + self->provides = PyTuple_GET_ITEM(state, 2); + self->requires = PyTuple_GET_ITEM(state, 3); +- self->upgrades = PyTuple_GET_ITEM(state, 4); +- self->conflicts = PyTuple_GET_ITEM(state, 5); +- self->installed = PyTuple_GET_ITEM(state, 6); +- self->essential = PyTuple_GET_ITEM(state, 7); +- self->priority = PyTuple_GET_ITEM(state, 8); +- self->loaders = PyTuple_GET_ITEM(state, 9); ++ self->recommends = PyTuple_GET_ITEM(state, 4); ++ self->upgrades = PyTuple_GET_ITEM(state, 5); ++ self->conflicts = PyTuple_GET_ITEM(state, 6); ++ self->installed = PyTuple_GET_ITEM(state, 7); ++ self->essential = PyTuple_GET_ITEM(state, 8); ++ self->priority = PyTuple_GET_ITEM(state, 9); ++ self->loaders = PyTuple_GET_ITEM(state, 10); + + + Py_INCREF(self->name); + Py_INCREF(self->version); + Py_INCREF(self->provides); + Py_INCREF(self->requires); ++ Py_INCREF(self->recommends); + Py_INCREF(self->upgrades); + Py_INCREF(self->conflicts); + Py_INCREF(self->installed); +@@ -686,6 +737,7 @@ static PyMemberDef Package_members[] = { + {"version", T_OBJECT, OFF(version), 0, 0}, + {"provides", T_OBJECT, OFF(provides), 0, 0}, + {"requires", T_OBJECT, OFF(requires), 0, 0}, ++ {"recommends", T_OBJECT, OFF(recommends), 0, 0}, + {"upgrades", T_OBJECT, OFF(upgrades), 0, 0}, + {"conflicts", T_OBJECT, OFF(conflicts), 0, 0}, + {"installed", T_OBJECT, OFF(installed), 0, 0}, +@@ -750,6 +802,7 @@ Provides_init(ProvidesObject *self, PyObject *args) + Py_INCREF(self->version); + self->packages = PyList_New(0); + self->requiredby = PyTuple_New(0); ++ self->recommendedby = PyTuple_New(0); + self->upgradedby = PyTuple_New(0); + self->conflictedby = PyTuple_New(0); + return 0; +@@ -760,6 +813,7 @@ Provides_traverse(ProvidesObject *self, visitproc visit, void *arg) + { + Py_VISIT(self->packages); + Py_VISIT(self->requiredby); ++ Py_VISIT(self->recommendedby); + Py_VISIT(self->upgradedby); + Py_VISIT(self->conflictedby); + return 0; +@@ -770,6 +824,7 @@ Provides_clear(ProvidesObject *self) + { + Py_CLEAR(self->packages); + Py_CLEAR(self->requiredby); ++ Py_CLEAR(self->recommendedby); + Py_CLEAR(self->upgradedby); + Py_CLEAR(self->conflictedby); + return 0; +@@ -782,6 +837,7 @@ Provides_dealloc(ProvidesObject *self) + Py_XDECREF(self->version); + Py_XDECREF(self->packages); + Py_XDECREF(self->requiredby); ++ Py_XDECREF(self->recommendedby); + Py_XDECREF(self->upgradedby); + Py_XDECREF(self->conflictedby); + self->ob_type->tp_free((PyObject *)self); +@@ -960,6 +1016,7 @@ static PyMemberDef Provides_members[] = { + {"version", T_OBJECT, OFF(version), 0, 0}, + {"packages", T_OBJECT, OFF(packages), 0, 0}, + {"requiredby", T_OBJECT, OFF(requiredby), 0, 0}, ++ {"recommendedby", T_OBJECT, OFF(recommendedby), 0, 0}, + {"upgradedby", T_OBJECT, OFF(upgradedby), 0, 0}, + {"conflictedby", T_OBJECT, OFF(conflictedby), 0, 0}, + {NULL} +@@ -1555,6 +1612,7 @@ Loader_buildPackage(LoaderObject *self, PyObject *args) + PyObject *reqargs; + PyObject *upgargs; + PyObject *cnfargs; ++ PyObject *recargs = NULL; + PyObject *callargs; + + PyObject *pkg; +@@ -1574,9 +1632,10 @@ Loader_buildPackage(LoaderObject *self, PyObject *args) + + cache = (CacheObject *)self->_cache; + +- if (!PyArg_ParseTuple(args, "O!O&O&O&O&", &PyTuple_Type, &pkgargs, ++ if (!PyArg_ParseTuple(args, "O!O&O&O&O&|O&", &PyTuple_Type, &pkgargs, + mylist, &prvargs, mylist, &reqargs, +- mylist, &upgargs, mylist, &cnfargs)) ++ mylist, &upgargs, mylist, &cnfargs, ++ mylist, &recargs)) + return NULL; + + if (PyTuple_GET_SIZE(pkgargs) < 2) { +@@ -1701,6 +1760,59 @@ Loader_buildPackage(LoaderObject *self, PyObject *args) + } + } + ++ /* if recargs: */ ++ if (recargs) { ++ int i = 0; ++ int len = PyList_GET_SIZE(recargs); ++ /* pkg.recommends = [] */ ++ Py_DECREF(pkgobj->recommends); ++ pkgobj->recommends = PyList_New(len); ++ /* for args in recargs: */ ++ for (; i != len; i++) { ++ PyObject *args = PyList_GET_ITEM(recargs, i); ++ DependsObject *recobj; ++ PyObject *rec; ++ ++ if (!PyTuple_Check(args)) { ++ PyErr_SetString(PyExc_TypeError, ++ "Item in recargs is not a tuple"); ++ return NULL; ++ } ++ ++ /* rec = cache._objmap.get(args) */ ++ rec = PyDict_GetItem(cache->_objmap, args); ++ recobj = (DependsObject *)rec; ++ ++ /* if not rec: */ ++ if (!rec) { ++ if (!PyTuple_Check(args) || PyTuple_GET_SIZE(args) < 2) { ++ PyErr_SetString(PyExc_ValueError, "Invalid recargs tuple"); ++ return NULL; ++ } ++ /* rec = args[0](*args[1:]) */ ++ callargs = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args)); ++ rec = PyObject_CallObject(PyTuple_GET_ITEM(args, 0), callargs); ++ Py_DECREF(callargs); ++ if (!rec) return NULL; ++ recobj = (DependsObject *)rec; ++ ++ /* cache._objmap[args] = rec */ ++ PyDict_SetItem(cache->_objmap, args, rec); ++ Py_DECREF(rec); ++ ++ /* cache._recommends.append(rec) */ ++ PyList_Append(cache->_recommends, rec); ++ } ++ ++ /* relpkgs.append(rec.packages) */ ++ PyList_Append(relpkgs, recobj->packages); ++ ++ /* pkg.recommends.append(rec) */ ++ Py_INCREF(rec); ++ PyList_SET_ITEM(pkgobj->recommends, i, rec); ++ } ++ } ++ + /* if upgargs: */ + if (upgargs) { + int i = 0; +@@ -2391,6 +2503,7 @@ Cache_init(CacheObject *self, PyObject *args) + self->_packages = PyList_New(0); + self->_provides = PyList_New(0); + self->_requires = PyList_New(0); ++ self->_recommends = PyList_New(0); + self->_upgrades = PyList_New(0); + self->_conflicts = PyList_New(0); + self->_objmap = PyDict_New(); +@@ -2404,6 +2517,7 @@ Cache_traverse(CacheObject *self, visitproc visit, void *arg) + Py_VISIT(self->_packages); + Py_VISIT(self->_provides); + Py_VISIT(self->_requires); ++ Py_VISIT(self->_recommends); + Py_VISIT(self->_upgrades); + Py_VISIT(self->_conflicts); + Py_VISIT(self->_objmap); +@@ -2417,6 +2531,7 @@ Cache_clear(CacheObject *self) + Py_CLEAR(self->_packages); + Py_CLEAR(self->_provides); + Py_CLEAR(self->_requires); ++ Py_CLEAR(self->_recommends); + Py_CLEAR(self->_upgrades); + Py_CLEAR(self->_conflicts); + Py_CLEAR(self->_objmap); +@@ -2430,6 +2545,7 @@ Cache_dealloc(CacheObject *self) + Py_XDECREF(self->_packages); + Py_XDECREF(self->_provides); + Py_XDECREF(self->_requires); ++ Py_XDECREF(self->_recommends); + Py_XDECREF(self->_upgrades); + Py_XDECREF(self->_conflicts); + Py_XDECREF(self->_objmap); +@@ -2449,6 +2565,8 @@ Cache_reset(CacheObject *self, PyObject *args) + LIST_CLEAR(prvobj->packages); + if (PyList_Check(prvobj->requiredby)) + LIST_CLEAR(prvobj->requiredby); ++ if (PyList_Check(prvobj->recommendedby)) ++ LIST_CLEAR(prvobj->recommendedby); + if (PyList_Check(prvobj->upgradedby)) + LIST_CLEAR(prvobj->upgradedby); + if (PyList_Check(prvobj->conflictedby)) +@@ -2464,6 +2582,16 @@ Cache_reset(CacheObject *self, PyObject *args) + if (PyList_Check(reqobj->providedby)) + LIST_CLEAR(reqobj->providedby); + } ++ len = PyList_GET_SIZE(self->_recommends); ++ for (i = 0; i != len; i++) { ++ DependsObject *reqobj; ++ PyObject *req; ++ req = PyList_GET_ITEM(self->_recommends, i); ++ reqobj = (DependsObject *)req; ++ LIST_CLEAR(reqobj->packages); ++ if (PyList_Check(reqobj->providedby)) ++ LIST_CLEAR(reqobj->providedby); ++ } + len = PyList_GET_SIZE(self->_upgrades); + for (i = 0; i != len; i++) { + DependsObject *upgobj; +@@ -2487,6 +2615,7 @@ Cache_reset(CacheObject *self, PyObject *args) + LIST_CLEAR(self->_packages); + LIST_CLEAR(self->_provides); + LIST_CLEAR(self->_requires); ++ LIST_CLEAR(self->_recommends); + LIST_CLEAR(self->_upgrades); + LIST_CLEAR(self->_conflicts); + PyDict_Clear(self->_objmap); +@@ -2534,6 +2663,7 @@ Cache__reload(CacheObject *self, PyObject *args) + packages = {} + provides = {} + requires = {} ++ recommends = {} + upgrades = {} + conflicts = {} + objmap = self._objmap +@@ -2541,11 +2671,12 @@ Cache__reload(CacheObject *self, PyObject *args) + PyObject *packages = PyDict_New(); + PyObject *provides = PyDict_New(); + PyObject *requires = PyDict_New(); ++ PyObject *recommends = PyDict_New(); + PyObject *upgrades = PyDict_New(); + PyObject *conflicts = PyDict_New(); + PyObject *objmap = self->_objmap; + int i, ilen; +- if (!packages || !provides || !requires || !conflicts) ++ if (!packages || !provides || !requires || !recommends || !conflicts ) + return NULL; + + /* for loader in loaders: */ +@@ -2679,6 +2810,30 @@ Cache__reload(CacheObject *self, PyObject *args) + } + + /* ++ for rec in pkg.recommends: ++ rec.packages.append(pkg) ++ if rec not in recommends: ++ recommends[rec] = True ++ objmap[rec.getInitArgs()] = rec ++ */ ++ if (PyList_Check(pkg->recommends)) { ++ klen = PyList_GET_SIZE(pkg->recommends); ++ for (k = 0; k != klen; k++) { ++ PyObject *rec = PyList_GET_ITEM(pkg->recommends, k); ++ PyList_Append(((DependsObject *)rec)->packages, ++ (PyObject *)pkg); ++ if (!PyDict_GetItem(recommends, rec)) { ++ PyDict_SetItem(recommends, rec, Py_True); ++ args = PyObject_CallMethod(rec, "getInitArgs", ++ NULL); ++ if (!args) return NULL; ++ PyDict_SetItem(objmap, args, rec); ++ Py_DECREF(args); ++ } ++ } ++ } ++ ++ /* + for upg in pkg.upgrades: + upg.packages.append(pkg) + if upg not in upgrades: +@@ -2747,6 +2902,11 @@ Cache__reload(CacheObject *self, PyObject *args) + self->_requires = PyDict_Keys(requires); + Py_DECREF(requires); + ++ /* self._recommends[:] = recommends.keys() */ ++ Py_DECREF(self->_recommends); ++ self->_recommends = PyDict_Keys(recommends); ++ Py_DECREF(recommends); ++ + /* self._upgrades[:] = upgrades.keys() */ + Py_DECREF(self->_upgrades); + self->_upgrades = PyDict_Keys(upgrades); +@@ -2852,7 +3012,7 @@ PyObject * + Cache_linkDeps(CacheObject *self, PyObject *args) + { + int i, j, len; +- PyObject *reqnames, *upgnames, *cnfnames; ++ PyObject *reqnames, *recnames, *upgnames, *cnfnames; + PyObject *lst; + + /* reqnames = {} */ +@@ -2896,6 +3056,47 @@ Cache_linkDeps(CacheObject *self, PyObject *args) + Py_DECREF(seq); + } + ++ /* recnames = {} */ ++ recnames = PyDict_New(); ++ /* for rec in self._recommends: */ ++ len = PyList_GET_SIZE(self->_recommends); ++ for (i = 0; i != len; i++) { ++ PyObject *rec = PyList_GET_ITEM(self->_recommends, i); ++ ++ /* for name in rec.getMatchNames(): */ ++ PyObject *names = PyObject_CallMethod(rec, "getMatchNames", NULL); ++ PyObject *seq = PySequence_Fast(names, "getMatchNames() returned " ++ "non-sequence object"); ++ int nameslen; ++ if (!seq) return NULL; ++ nameslen = PySequence_Fast_GET_SIZE(seq); ++ for (j = 0; j != nameslen; j++) { ++ PyObject *name = PySequence_Fast_GET_ITEM(seq, j); ++ ++ /* lst = recnames.get(name) */ ++ lst = PyDict_GetItem(recnames, name); ++ ++ /* ++ if lst: ++ lst.append(rec) ++ else: ++ recnames[name] = [rec] ++ */ ++ if (lst) { ++ PyList_Append(lst, rec); ++ } else { ++ lst = PyList_New(1); ++ Py_INCREF(rec); ++ PyList_SET_ITEM(lst, 0, rec); ++ PyDict_SetItem(recnames, name, lst); ++ Py_DECREF(lst); ++ } ++ } ++ ++ Py_DECREF(names); ++ Py_DECREF(seq); ++ } ++ + /* upgnames = {} */ + upgnames = PyDict_New(); + /* for upg in self._upgrades: */ +@@ -3035,6 +3236,56 @@ Cache_linkDeps(CacheObject *self, PyObject *args) + } + } + ++ /* lst = recnames.get(prv.name) */ ++ lst = PyDict_GetItem(recnames, prv->name); ++ ++ /* if lst: */ ++ if (lst) { ++ /* for rec in lst: */ ++ int reclen = PyList_GET_SIZE(lst); ++ for (j = 0; j != reclen; j++) { ++ DependsObject *rec = (DependsObject *)PyList_GET_ITEM(lst, j); ++ /* if rec.matches(prv): */ ++ PyObject *ret = PyObject_CallMethod((PyObject *)rec, "matches", ++ "O", (PyObject *)prv); ++ if (!ret) return NULL; ++ if (PyObject_IsTrue(ret)) { ++ /* ++ if rec.providedby: ++ rec.providedby.append(prv) ++ else: ++ rec.providedby = [prv] ++ */ ++ if (PyList_Check(rec->providedby)) { ++ PyList_Append(rec->providedby, (PyObject *)prv); ++ } else { ++ PyObject *_lst = PyList_New(1); ++ Py_INCREF(prv); ++ PyList_SET_ITEM(_lst, 0, (PyObject *)prv); ++ Py_DECREF(rec->providedby); ++ rec->providedby = _lst; ++ } ++ ++ /* ++ if prv.recommendedby: ++ prv.recommendedby.append(prv) ++ else: ++ prv.recommendedby = [prv] ++ */ ++ if (PyList_Check(prv->recommendedby)) { ++ PyList_Append(prv->recommendedby, (PyObject *)rec); ++ } else { ++ PyObject *_lst = PyList_New(1); ++ Py_INCREF(rec); ++ PyList_SET_ITEM(_lst, 0, (PyObject *)rec); ++ Py_DECREF(prv->recommendedby); ++ prv->recommendedby = _lst; ++ } ++ } ++ Py_DECREF(ret); ++ } ++ } ++ + /* lst = upgnames.get(prv.name) */ + lst = PyDict_GetItem(upgnames, prv->name); + +@@ -3139,6 +3390,7 @@ Cache_linkDeps(CacheObject *self, PyObject *args) + } + + Py_DECREF(reqnames); ++ Py_DECREF(recnames); + Py_DECREF(upgnames); + Py_DECREF(cnfnames); + +@@ -3215,6 +3467,29 @@ Cache_getRequires(CacheObject *self, PyObject *args) + } + + PyObject * ++Cache_getRecommends(CacheObject *self, PyObject *args) ++{ ++ const char *name = NULL; ++ PyObject *lst; ++ int i, len; ++ if (!PyArg_ParseTuple(args, "|s", &name)) ++ return NULL; ++ if (!name) { ++ Py_INCREF(self->_recommends); ++ return self->_recommends; ++ } ++ lst = PyList_New(0); ++ len = PyList_GET_SIZE(self->_recommends); ++ for (i = 0; i != len; i++) { ++ DependsObject *rec = ++ (DependsObject*)PyList_GET_ITEM(self->_recommends, i); ++ if (strcmp(STR(rec->name), name) == 0) ++ PyList_Append(lst, (PyObject *)rec); ++ } ++ return lst; ++} ++ ++PyObject * + Cache_getUpgrades(CacheObject *self, PyObject *args) + { + const char *name = NULL; +@@ -3324,6 +3599,38 @@ Cache_search(CacheObject *self, PyObject *searcher) + } + Py_DECREF(lst); + ++ lst = PyObject_GetAttrString(searcher, "recommends"); ++ if (lst == NULL || !PyList_Check(lst)) { ++ PyErr_SetString(PyExc_TypeError, "Invalid recommends attribute"); ++ return NULL; ++ } ++ for (i = 0; i != PyList_GET_SIZE(lst); i++) { ++ ProvidesObject *prv = (ProvidesObject *)PyList_GET_ITEM(lst, i); ++ for (j = 0; j != PyList_GET_SIZE(self->_recommends); j++) { ++ PyObject *rec = PyList_GET_ITEM(self->_recommends, j); ++ PyObject *names = PyObject_CallMethod(rec, "getMatchNames", NULL); ++ PyObject *seq = PySequence_Fast(names, "getMatchNames() returned " ++ "non-sequence object"); ++ if (seq == NULL) return NULL; ++ for (k = 0; k != PySequence_Fast_GET_SIZE(seq); k++) { ++ if (strcmp(PyString_AS_STRING(PySequence_Fast_GET_ITEM(seq, k)), ++ PyString_AS_STRING(prv->name)) == 0) { ++ res = PyObject_CallMethod(rec, "matches", "O", prv); ++ if (res == NULL) ++ return NULL; ++ if (PyObject_IsTrue(res)) ++ CALLMETHOD(searcher, "addResult", "O", rec); ++ Py_DECREF(res); ++ break; ++ } ++ } ++ ++ Py_DECREF(names); ++ Py_DECREF(seq); ++ } ++ } ++ Py_DECREF(lst); ++ + lst = PyObject_GetAttrString(searcher, "upgrades"); + if (lst == NULL || !PyList_Check(lst)) { + PyErr_SetString(PyExc_TypeError, "Invalid upgrades attribute"); +@@ -3420,7 +3727,7 @@ Cache__getstate__(CacheObject *self, PyObject *args) + static PyObject * + Cache__setstate__(CacheObject *self, PyObject *state) + { +- PyObject *provides, *requires, *upgrades, *conflicts; ++ PyObject *provides, *requires, *recommends, *upgrades, *conflicts; + int i, ilen; + int j, jlen; + +@@ -3452,11 +3759,13 @@ Cache__setstate__(CacheObject *self, PyObject *state) + /* + provides = {} + requires = {} ++ recommends = {} + upgrades = {} + conflicts = {} + */ + provides = PyDict_New(); + requires = PyDict_New(); ++ recommends = PyDict_New(); + upgrades = PyDict_New(); + conflicts = PyDict_New(); + +@@ -3497,6 +3806,21 @@ Cache__setstate__(CacheObject *self, PyObject *state) + } + + /* ++ for rec in pkg.recommends: ++ rec.packages.append(pkg) ++ recommends[rec] = True ++ */ ++ if (PyList_Check(pkgobj->recommends)) { ++ jlen = PyList_GET_SIZE(pkgobj->recommends); ++ for (j = 0; j != jlen; j++) { ++ PyObject *rec = PyList_GET_ITEM(pkgobj->recommends, j); ++ DependsObject *recobj = (DependsObject *)rec; ++ PyList_Append(recobj->packages, pkg); ++ PyDict_SetItem(recommends, rec, Py_True); ++ } ++ } ++ ++ /* + for upg in pkg.upgrades: + upg.packages.append(pkg) + upgrades[upg] = True +@@ -3525,6 +3849,7 @@ Cache__setstate__(CacheObject *self, PyObject *state) + PyDict_SetItem(conflicts, cnf, Py_True); + } + } ++ + } + + /* self._provides = provides.keys() */ +@@ -3535,6 +3860,10 @@ Cache__setstate__(CacheObject *self, PyObject *state) + self->_requires = PyDict_Keys(requires); + Py_DECREF(requires); + ++ /* self._recommends = recommends.keys() */ ++ self->_recommends = PyDict_Keys(recommends); ++ Py_DECREF(recommends); ++ + /* self._upgrades = upgrades.keys() */ + self->_upgrades = PyDict_Keys(upgrades); + Py_DECREF(upgrades); +@@ -3562,6 +3891,7 @@ static PyMethodDef Cache_methods[] = { + {"getPackages", (PyCFunction)Cache_getPackages, METH_VARARGS, NULL}, + {"getProvides", (PyCFunction)Cache_getProvides, METH_VARARGS, NULL}, + {"getRequires", (PyCFunction)Cache_getRequires, METH_VARARGS, NULL}, ++ {"getRecommends", (PyCFunction)Cache_getRecommends, METH_VARARGS, NULL}, + {"getUpgrades", (PyCFunction)Cache_getUpgrades, METH_VARARGS, NULL}, + {"getConflicts", (PyCFunction)Cache_getConflicts, METH_VARARGS, NULL}, + {"search", (PyCFunction)Cache_search, METH_O, NULL}, +@@ -3576,6 +3906,7 @@ static PyMemberDef Cache_members[] = { + {"_packages", T_OBJECT, OFF(_packages), RO, 0}, + {"_provides", T_OBJECT, OFF(_provides), RO, 0}, + {"_requires", T_OBJECT, OFF(_requires), RO, 0}, ++ {"_recommends", T_OBJECT, OFF(_recommends), RO, 0}, + {"_upgrades", T_OBJECT, OFF(_upgrades), RO, 0}, + {"_conflicts", T_OBJECT, OFF(_conflicts), RO, 0}, + {"_objmap", T_OBJECT, OFF(_objmap), RO, 0}, +diff --git a/smart/commands/query.py b/smart/commands/query.py +index 808e53a..9265cd9 100644 +--- a/smart/commands/query.py ++++ b/smart/commands/query.py +@@ -107,6 +107,8 @@ def option_parser(**kwargs): + help=_("show requires for the given packages")) + parser.add_option("--show-prerequires", action="store_true", + help=_("show requires selecting only pre-dependencies")) ++ parser.add_option("--show-recommends", action="store_true", ++ help=_("show recommends for the given packages")) + parser.add_option("--show-upgrades", action="store_true", + help=_("show upgrades for the given packages")) + parser.add_option("--show-conflicts", action="store_true", +@@ -488,6 +490,19 @@ def main(ctrl, opts, reloadchannels=True): + continue + output.showRequiresProvidedBy(pkg, req, + prv, prvpkg) ++ if pkg.recommends and (opts.show_recommends): ++ pkg.recommends.sort() ++ first = True ++ for req in pkg.recommends: ++ output.showRecommends(pkg, req) ++ if opts.show_providedby and req.providedby: ++ for prv in req.providedby: ++ prv.packages.sort() ++ for prvpkg in prv.packages: ++ if opts.installed and not prvpkg.installed: ++ continue ++ output.showRecommendsProvidedBy(pkg, req, ++ prv, prvpkg) + if pkg.upgrades and (opts.show_upgrades or whoupgrades): + pkg.upgrades.sort() + first = True +@@ -594,6 +609,12 @@ class NullOutput(object): + def showRequiresProvidedBy(self, pkg, req, prv, prvpkg): + pass + ++ def showRecommends(self, pkg, req): ++ pass ++ ++ def showRecommendsProvidedBy(self, pkg, req, prv, prvpkg): ++ pass ++ + def showUpgrades(self, pkg, upg): + pass + +@@ -619,6 +640,8 @@ class TextOutput(NullOutput): + self._firstconflictedby = True + self._firstrequires = True + self._firstrequiresprovidedby = True ++ self._firstrecommends = True ++ self._firstrecommendsprovidedby = True + self._firstupgrades = True + self._firstupgradesprovidedby = True + self._firstconflicts = True +@@ -711,6 +734,22 @@ class TextOutput(NullOutput): + name = str(prvpkg) + print " ", "%s (%s)" % (name, prv) + ++ def showRecommends(self, pkg, rec): ++ if self._firstrecommends: ++ self._firstrecommends = False ++ print " ", _("Recommends:") ++ print " ", rec ++ ++ def showRecommendsProvidedBy(self, pkg, req, prv, prvpkg): ++ if self._firstrecommendsprovidedby: ++ self._firstrecommendsprovidedby = False ++ print " ", _("Provided By:") ++ if self.opts.hide_version: ++ name = prvpkg.name ++ else: ++ name = str(prvpkg) ++ print " ", "%s (%s)" % (name, prv) ++ + def showUpgrades(self, pkg, upg): + if self._firstupgrades: + self._firstupgrades = False +@@ -797,6 +836,18 @@ class GraphVizOutput(NullOutput): + self._shown[req, prv] = True + print ' "Requires: %s" -> "Provides: %s";' % (req, prv) + ++ def showRecommends(self, pkg, req): ++ if (pkg, req) not in self._shown: ++ self._shown[pkg, req] = True ++ print ' "%s" -> "Recommends: %s";' % (pkg, req) ++ ++ def showRecommendsProvidedBy(self, pkg, req, prv, prvpkg): ++ self.showPackage(prvpkg) ++ self.showProvides(prvpkg, prv) ++ if (req, prv) not in self._shown: ++ self._shown[req, prv] = True ++ print ' "Recommends: %s" -> "Provides: %s";' % (req, prv) ++ + def showUpgrades(self, pkg, upg): + if (pkg, upg) not in self._shown: + self._shown[pkg, upg] = True +diff --git a/smart/control.py b/smart/control.py +index fd7083a..d44abe7 100644 +--- a/smart/control.py ++++ b/smart/control.py +@@ -447,7 +447,7 @@ class Control(object): + queue = marked.keys() + while queue: + pkg = queue.pop(0) +- for req in pkg.requires: ++ for req in pkg.requires + pkg.recommends: + for prv in req.providedby: + for prvpkg in prv.packages: + if (prvpkg.installed and +@@ -794,7 +794,7 @@ class Control(object): + pkglst = [] + for pkg in changeset: + n = 0 +- for req in pkg.requires: ++ for req in pkg.requires + pkg.recommends: + for prv in req.providedby: + for prvpkg in prv.packages: + if changeset.get(prvpkg) is INSTALL: +diff --git a/smart/searcher.py b/smart/searcher.py +index 216f4ce..32eb825 100644 +--- a/smart/searcher.py ++++ b/smart/searcher.py +@@ -45,9 +45,9 @@ class Searcher(object): + + - provides is matched in Provides.search(), for the same reason. + +- - requires, upgrades, and conflicts don't have special searching +- methods. Instead, their usual match() method is given an instance +- of the Provides type. ++ - requires, recommends, upgrades, and conflicts don't have special ++ searching methods. Instead, their usual match() method is given ++ an instance of the Provides type. + + - group, path, url, and other information which is found by + PackageInfo, is searched by the Loader.search() method and +@@ -62,6 +62,7 @@ class Searcher(object): + self.nameversion = [] + self.provides = [] + self.requires = [] ++ self.recommends = [] + self.upgrades = [] + self.conflicts = [] + self.path = [] +@@ -76,6 +77,7 @@ class Searcher(object): + del self.nameversion[:] + del self.provides[:] + del self.requires[:] ++ del self.recommends[:] + del self.upgrades[:] + del self.conflicts[:] + del self.path[:] +@@ -122,6 +124,8 @@ class Searcher(object): + self.addProvides(s[9:], cutoff) + elif s.startswith("requires:"): + self.addRequires(s[9:]) ++ elif s.startswith("recommends:"): ++ self.addRecommends(s[11:]) + elif s.startswith("upgrades:"): + self.addUpgrades(s[9:]) + elif s.startswith("conflicts:"): +@@ -151,6 +155,7 @@ class Searcher(object): + return s and ( + s.startswith("provides:") or + s.startswith("requires:") or ++ s.startswith("recommends:") or + s.startswith("upgrades:") or + s.startswith("conflicts:") or + s.startswith("url:") or +@@ -182,6 +187,9 @@ class Searcher(object): + def addRequires(self, s): + self.requires.append(self._buildProvides(s)) + ++ def addRecommends(self, s): ++ self.recommends.append(self._buildProvides(s)) ++ + def addUpgrades(self, s): + self.upgrades.append(self._buildProvides(s)) + +diff --git a/smart/transaction.py b/smart/transaction.py +index eb320d2..300b9cc 100644 +--- a/smart/transaction.py ++++ b/smart/transaction.py +@@ -573,7 +573,7 @@ class Transaction(object): + self._remove(namepkg, changeset, locked, pending, depth) + + # Install packages required by this one. +- for req in pkg.requires: ++ for req in pkg.requires + pkg.recommends: + + # Check if someone is already providing it. + prvpkgs = {} +@@ -596,8 +596,12 @@ class Transaction(object): + + if not prvpkgs: + # No packages provide it at all. Give up. +- raise Failed, _("Can't install %s: no package provides %s") % \ +- (pkg, req) ++ if req in pkg.requires: ++ raise Failed, _("Can't install %s: no package provides %s") % \ ++ (pkg, req) ++ else: ++ # It's only a recommend, skip ++ continue + + if len(prvpkgs) == 1: + # Don't check locked here. prvpkgs was +@@ -1359,7 +1363,7 @@ class ChangeSetSplitter(object): + set = self._changeset + + # Check all dependencies needed by this package. +- for req in pkg.requires: ++ for req in pkg.requires + pkg.recommends: + + # Check if any already installed or to be installed + # package will solve the problem. +@@ -1424,8 +1428,9 @@ class ChangeSetSplitter(object): + + # There are no solutions for the problem. + # Should we really care about it? +- if (self._forcerequires or +- isinstance(req, PreRequires)): ++ if ((self._forcerequires or ++ isinstance(req, PreRequires)) ++ and req in pkg.requires): + raise Error, _("No providers for '%s', " + "required by '%s'") % (req, pkg) + +@@ -1625,7 +1630,7 @@ def recursiveInternalRequires(pkgmap, pkg, numrel, done=None): + return n + + def forwardRequires(pkg, map): +- for req in pkg.requires: ++ for req in pkg.requires + pkg.recommends: + if req not in map: + map[req] = True + for prv in req.providedby: +@@ -1794,6 +1799,15 @@ def checkPackages(cache, checkset, relateset, report=False): + iface.info(_("Unsatisfied dependency: %s requires %s") % + (pkg, req)) + ++ for req in pkg.recommends: ++ for prv in req.providedby: ++ for prvpkg in prv.packages: ++ if prvpkg in relateset: ++ break ++ else: ++ continue ++ break ++ + if not pkg.installed: + continue + +-- +1.7.9.5 + diff --git a/meta/recipes-devtools/python/python-smartpm/smart-rpm-extra-macros.patch b/meta/recipes-devtools/python/python-smartpm/smart-rpm-extra-macros.patch new file mode 100644 index 0000000000..30cb1767dd --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-rpm-extra-macros.patch @@ -0,0 +1,27 @@ +backends/rpm: implement rpm-extra-macros option + +Allow defining extra macros in the smart configuration to be passed +to rpm before opening the database. + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton + +diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py +index b9e9cb2..234c844 100644 +--- a/smart/backends/rpm/base.py ++++ b/smart/backends/rpm/base.py +@@ -53,6 +53,10 @@ def rpm_join_dbpath(root, dbpath): + return os.path.join(root, dbpath) + + def getTS(new=False): ++ if sysconf.get("rpm-extra-macros"): ++ for key, value in sysconf.get("rpm-extra-macros").items(): ++ rpm.addMacro(key, str(value)) ++ + rpm_root = os.path.abspath(sysconf.get("rpm-root", "/")) + if not hasattr(getTS, "ts") or getTS.root != rpm_root: + getTS.root = rpm_root +-- +1.7.9.5 + diff --git a/meta/recipes-devtools/python/python-smartpm/smart-rpm-md-parse.patch b/meta/recipes-devtools/python/python-smartpm/smart-rpm-md-parse.patch new file mode 100644 index 0000000000..97cecc124d --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-rpm-md-parse.patch @@ -0,0 +1,26 @@ +backends/rpm: fix parsing of rpm-md metadata + +If assertions are disabled then the queue.pop() wasn't being executed, +leading to requires, recommends etc. not being read properly. + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton + +diff --git a/smart/backends/rpm/metadata.py b/smart/backends/rpm/metadata.py +index 2c54f39..dc9df22 100644 +--- a/smart/backends/rpm/metadata.py ++++ b/smart/backends/rpm/metadata.py +@@ -188,7 +188,8 @@ class RPMMetaDataLoader(Loader): + + elif event == "end": + +- assert queue.pop() is elem ++ popped = queue.pop() ++ assert popped is elem + + if skip: + if tag == skip: +-- +1.7.9.5 + diff --git a/meta/recipes-devtools/python/python-smartpm/smart-rpm-root.patch b/meta/recipes-devtools/python/python-smartpm/smart-rpm-root.patch new file mode 100644 index 0000000000..b2629ef051 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-rpm-root.patch @@ -0,0 +1,80 @@ +Fix smart RPM backend to handle rpm-dbpath/rpm-root properly + +Don't assume that if the dbpath starts with / that it is an absolute +path. This matches the behaviour of rpm itself. (If the root path is +specified and does not start with /, rpm will prepend the root path +twice and fail). + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton + +diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py +index 7092332..0489e11 100644 +--- a/smart/backends/rpm/base.py ++++ b/smart/backends/rpm/base.py +@@ -46,6 +46,12 @@ __all__ = ["RPMPackage", "RPMProvides", "RPMNameProvides", "RPMPreRequires", + "rpm", "getTS", "getArchScore", "getArchColor", "system_provides", + "collapse_libc_requires"] + ++def rpm_join_dbpath(root, dbpath): ++ if dbpath.startswith('/') and root: ++ return os.path.join(root, dbpath[1:]) ++ else: ++ return os.path.join(root, dbpath) ++ + def getTS(new=False): + rpm_root = os.path.abspath(sysconf.get("rpm-root", "/")) + if not hasattr(getTS, "ts") or getTS.root != rpm_root: +@@ -56,7 +62,7 @@ def getTS(new=False): + #if not sysconf.get("rpm-check-signatures", False): + # getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) + rpm_dbpath = sysconf.get("rpm-dbpath", "var/lib/rpm") +- dbdir = os.path.join(getTS.root, rpm_dbpath) ++ dbdir = rpm_join_dbpath(getTS.root, rpm_dbpath) + if not os.path.isdir(dbdir): + try: + os.makedirs(dbdir) +diff --git a/smart/channels/rpm_sys.py b/smart/channels/rpm_sys.py +index efcb10e..b9fda27 100644 +--- a/smart/channels/rpm_sys.py ++++ b/smart/channels/rpm_sys.py +@@ -20,7 +20,7 @@ + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # + from smart.backends.rpm.header import RPMDBLoader +-from smart.backends.rpm.base import getTS ++from smart.backends.rpm.base import getTS, rpm_join_dbpath + from smart.channel import PackageChannel + from smart import * + import os +@@ -32,9 +32,9 @@ class RPMSysChannel(PackageChannel): + + def fetch(self, fetcher, progress): + getTS() # Make sure the db exists. +- path = os.path.join(sysconf.get("rpm-root", "/"), +- sysconf.get("rpm-dbpath", "var/lib/rpm"), +- "Packages") ++ dbdir = rpm_join_dbpath(sysconf.get("rpm-root", "/"), ++ sysconf.get("rpm-dbpath", "var/lib/rpm")) ++ path = os.path.join(dbdir, "Packages") + digest = os.path.getmtime(path) + if digest == self._digest: + return True +diff --git a/smart/plugins/detectsys.py b/smart/plugins/detectsys.py +index 2cd49ad..3959d07 100644 +--- a/smart/plugins/detectsys.py ++++ b/smart/plugins/detectsys.py +@@ -20,10 +20,11 @@ + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # + from smart import * ++from smart.backends.rpm.base import rpm_join_dbpath + import os + + def detectRPMSystem(): +- dir = os.path.join(sysconf.get("rpm-root", "/"), ++ dir = rpm_join_dbpath(sysconf.get("rpm-root", "/"), + sysconf.get("rpm-dbpath", "var/lib/rpm")) + file = os.path.join(dir, "Packages") + if os.path.exists(file): diff --git a/meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch b/meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch new file mode 100644 index 0000000000..708ffe67d3 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch @@ -0,0 +1,49 @@ + +This patch checks for rpm5 related functions in order to allow rpm4 +to work correctly. Currently the rpm4 archscore and filter work +differently enough that they need to be changed. + +Upstream-Status: Inappropriate [OE-Core Specific] + +Signed-off-by: Saul Wold + +Index: smart-1.4.1/smart/backends/rpm/base.py +=================================================================== +--- smart-1.4.1.orig/smart/backends/rpm/base.py ++++ smart-1.4.1/smart/backends/rpm/base.py +@@ -338,10 +338,14 @@ class RPMObsoletes(Depends): + + _SCOREMAP = {} + def getArchScore(arch, _sm=_SCOREMAP): +- if arch not in _sm: +- score = rpm.archscore(arch) +- _sm[arch] = score +- return _sm.get(arch, 0) ++ try: ++ rpm.platformscore(arch) ++ if arch not in _sm: ++ score = rpm.archscore(arch) ++ _sm[arch] = score ++ return _sm.get(arch, 0) ++ except AttributeError: ++ return 1 + + # TODO: Embed color into nameprovides and obsoletes relations. + _COLORMAP = {"noarch": 0, "x86_64": 2, "ppc64": 2, "s390x": 2, "sparc64": 2} +Index: smart-1.4.1/smart/backends/rpm/pm.py +=================================================================== +--- smart-1.4.1.orig/smart/backends/rpm/pm.py ++++ smart-1.4.1/smart/backends/rpm/pm.py +@@ -235,6 +235,12 @@ class RPMPackageManager(PackageManager): + if sysconf.get("rpm-order"): + ts.order() + probfilter = rpm.RPMPROB_FILTER_OLDPACKAGE ++ try: ++ # Test for RPM5 function ++ rpm.platformscore("") ++ except AttributeError: ++ probfilter |= rpm.RPMPROB_FILTER_IGNOREARCH ++ + if force or reinstall: + probfilter |= rpm.RPMPROB_FILTER_REPLACEPKG + probfilter |= rpm.RPMPROB_FILTER_REPLACEOLDFILES diff --git a/meta/recipes-devtools/python/python-smartpm/smart-tmpdir.patch b/meta/recipes-devtools/python/python-smartpm/smart-tmpdir.patch new file mode 100644 index 0000000000..2f09ce9248 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-tmpdir.patch @@ -0,0 +1,30 @@ +backends/rpm: remove creation of /var/tmp + +This doesn't appear to be needed, and breaks installation of base-files +in OpenEmbedded (since that is a symlink installed as part of the +package). + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton + +diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py +index 234c844..127354d 100644 +--- a/smart/backends/rpm/base.py ++++ b/smart/backends/rpm/base.py +@@ -82,12 +82,6 @@ def getTS(new=False): + else: + iface.warning(_("Initialized new rpm database at %s") + % getTS.root) +- tmpdir = os.path.join(getTS.root, "var/tmp") +- if not os.path.isdir(tmpdir): +- try: +- os.makedirs(tmpdir) +- except OSError: +- pass + if new: + if sysconf.get("rpm-dbpath"): + rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath")) +-- +1.7.9.5 + diff --git a/meta/recipes-devtools/python/python-smartpm/smart-yaml-error.patch b/meta/recipes-devtools/python/python-smartpm/smart-yaml-error.patch new file mode 100644 index 0000000000..e16c5c12aa --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-yaml-error.patch @@ -0,0 +1,86 @@ +Print a more friendly error if YAML output is requested without PyYAML + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton + +diff --git a/smart/commands/channel.py b/smart/commands/channel.py +index 63fbb35..108f3f1 100644 +--- a/smart/commands/channel.py ++++ b/smart/commands/channel.py +@@ -339,7 +339,10 @@ def main(ctrl, opts): + print + + if opts.yaml is not None: +- import yaml ++ try: ++ import yaml ++ except ImportError: ++ raise Error, _("Please install PyYAML in order to use this function") + yamlchannels = {} + for alias in (opts.yaml or sysconf.get("channels", ())): + channel = sysconf.get(("channels", alias)) +diff --git a/smart/commands/config.py b/smart/commands/config.py +index 4fe4366..aa1db78 100644 +--- a/smart/commands/config.py ++++ b/smart/commands/config.py +@@ -137,7 +137,10 @@ def main(ctrl, opts): + pprint.pprint(sysconf.get((), hard=True)) + + if opts.yaml is not None: +- import yaml ++ try: ++ import yaml ++ except ImportError: ++ raise Error, _("Please install PyYAML in order to use this function") + if opts.yaml: + marker = object() + for opt in opts.yaml: +diff --git a/smart/commands/flag.py b/smart/commands/flag.py +index ed18999..8b90496 100644 +--- a/smart/commands/flag.py ++++ b/smart/commands/flag.py +@@ -138,7 +138,10 @@ def main(ctrl, opts): + print + + if opts.yaml is not None: +- import yaml ++ try: ++ import yaml ++ except ImportError: ++ raise Error, _("Please install PyYAML in order to use this function") + yamlflags = {} + for flag in opts.yaml or pkgconf.getFlagNames(): + flag = flag.strip() +diff --git a/smart/commands/mirror.py b/smart/commands/mirror.py +index ca50a95..f7b019d 100644 +--- a/smart/commands/mirror.py ++++ b/smart/commands/mirror.py +@@ -218,7 +218,10 @@ def main(ctrl, opts): + print + + if opts.yaml: +- import yaml ++ try: ++ import yaml ++ except ImportError: ++ raise Error, _("Please install PyYAML in order to use this function") + yamlmirrors = {} + mirrors = sysconf.get("mirrors", ()) + for origin in mirrors: +diff --git a/smart/commands/priority.py b/smart/commands/priority.py +index d850d29..441ea32 100644 +--- a/smart/commands/priority.py ++++ b/smart/commands/priority.py +@@ -117,7 +117,10 @@ def main(ctrl, opts): + print + + elif opts.yaml: +- import yaml ++ try: ++ import yaml ++ except ImportError: ++ raise Error, _("Please install PyYAML in order to use this function") + yamlpriorities = {} + priorities = sysconf.get("package-priorities", {}) + for name in opts.args or priorities: diff --git a/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch b/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch new file mode 100644 index 0000000000..9919a941bc --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch @@ -0,0 +1,46 @@ +RPM5 has removed support for RPMVSF_NOSIGNATURES + +Patch smart to no longer use this flag + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +diff -ur smart-1.4.1.orig/smart/backends/rpm/base.py smart-1.4.1/smart/backends/rpm/base.py +--- smart-1.4.1.orig/smart/backends/rpm/base.py 2012-10-04 11:22:11.229351164 -0500 ++++ smart-1.4.1/smart/backends/rpm/base.py 2012-10-04 11:22:44.820170786 -0500 +@@ -53,8 +53,8 @@ + if sysconf.get("rpm-dbpath"): + rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath")) + getTS.ts = rpm.ts(getTS.root) +- if not sysconf.get("rpm-check-signatures", False): +- getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) ++ #if not sysconf.get("rpm-check-signatures", False): ++ # getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) + rpm_dbpath = sysconf.get("rpm-dbpath", "var/lib/rpm") + dbdir = os.path.join(getTS.root, rpm_dbpath) + if not os.path.isdir(dbdir): +@@ -82,8 +82,8 @@ + if sysconf.get("rpm-dbpath"): + rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath")) + ts = rpm.ts(getTS.root) +- if not sysconf.get("rpm-check-signatures", False): +- ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) ++ #if not sysconf.get("rpm-check-signatures", False): ++ # ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) + return ts + else: + return getTS.ts +diff -ur smart-1.4.1.orig/smart/plugins/yumchannelsync.py smart-1.4.1/smart/plugins/yumchannelsync.py +--- smart-1.4.1.orig/smart/plugins/yumchannelsync.py 2010-12-06 03:11:05.000000000 -0600 ++++ smart-1.4.1/smart/plugins/yumchannelsync.py 2012-10-04 11:23:09.799350924 -0500 +@@ -56,7 +56,8 @@ + + rpmroot = sysconf.get("rpm-root", "/") + ts = rpmUtils.transaction.initReadOnlyTransaction(root=rpmroot) +- ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS)) ++ #ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS)) ++ ts.pushVSFlags(~(rpm._RPMVSF_NODIGESTS)) + releasever = None + # HACK: we're hard-coding the most used distros, will add more if needed + idx = ts.dbMatch('provides', 'fedora-release') diff --git a/meta/recipes-devtools/python/python-smartpm_1.4.1.bb b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb new file mode 100644 index 0000000000..ee594ba166 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb @@ -0,0 +1,148 @@ +SUMMARY = "The Smart Package Manager" +DESCRIPTION = "The Smart Package Manager project has the ambitious objective of creating \ +smart and portable algorithms for solving adequately the problem of managing software \ +upgrades and installation." + +HOMEPAGE = "http://labix.org/smart/" +SECTION = "devel/python" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833" + +DEPENDS = "python rpm gettext-native python-rpm" +PR = "r9" +SRCNAME = "smart" + +SRC_URI = "\ + http://launchpad.net/smart/trunk/${PV}/+download/${SRCNAME}-${PV}.tar.bz2 \ + file://smartpm-rpm5-nodig.patch \ + file://smart-rpm-root.patch \ + file://smart-recommends.patch \ + file://smart-rpm-extra-macros.patch \ + file://smart-dflags.patch \ + file://smart-rpm-md-parse.patch \ + file://smart-tmpdir.patch \ + file://smart-metadata-match.patch \ + file://smart-improve-error-reporting.patch \ + file://smart-multilib-fixes.patch \ + file://smart-yaml-error.patch \ + file://smart-channelsdir.patch \ + file://smart-conflict-provider.patch \ + file://smart-flag-ignore-recommends.patch \ + file://smart-flag-exclude-packages.patch \ + file://smart-config-ignore-all-recommends.patch \ + file://smart-attempt.patch \ + file://smart-filename-NAME_MAX.patch \ + file://smart-rpm4-fixes.patch \ + file://smart-already-installed-message.patch \ + " + +SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6" +SRC_URI[sha256sum] = "b1d519ddb43d60f293b065c28870a5d9e8b591cd49e8c68caea48ace91085eba" +S = "${WORKDIR}/${SRCNAME}-${PV}" + +# Options - rpm, qt4, gtk +PACKAGECONFIG ??= "rpm" + +RPM_RDEP = "${PN}-backend-rpm" +QT_RDEP = "${PN}-interface-qt4" +GTK_RDEP = "${PN}-interface-gtk" + +RPM_RDEP_class-native = "" +QT_RDEP_class-native = "" +GTK_RDEP_class-native = "" + +RPM_RDEP_class-nativesdk = "" +QT_RDEP_class-nativesdk = "" +GTK_RDEP_class-nativesdk = "" + +PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}" +PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}" +PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}" + +inherit distutils + +do_install_append() { + # We don't support the following items + rm -rf ${D}${libdir}/python*/site-packages/smart/backends/slack + rm -rf ${D}${libdir}/python*/site-packages/smart/backends/arch + rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt + + # Temporary, debian support in OE is missing the python module + rm -f ${D}${libdir}/python*/site-packages/smart/plugins/aptchannelsync.py* + rm -f ${D}${libdir}/python*/site-packages/smart/plugins/debdir.py* + rm -rf ${D}${libdir}/python*/site-packages/smart/backends/deb + + # Disable automatic channel detection + rm -f ${D}${libdir}/python*/site-packages/smart/plugins/detectsys.py* + + # Disable landscape support + rm -f ${D}${libdir}/python*/site-packages/smart/plugins/landscape.py* + + # Disable urpmi channel support + rm -f ${D}${libdir}/python*/site-packages/smart/plugins/urpmichannelsync.py* + + # Disable yum channel support + rm -f ${D}${libdir}/python*/site-packages/smart/plugins/yumchannelsync.py* + + # Disable zypper channel support + rm -f ${D}${libdir}/python*/site-packages/smart/plugins/zyppchannelsync.py* + + if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then + rm -f ${D}${libdir}/python*/site-packages/smart/plugins/rpmdir.py* + rm -rf ${D}${libdir}/python*/site-packages/smart/backends/rpm + fi + + if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then + rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt4 + fi + + if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then + rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/gtk + fi +} + +add_native_wrapper() { + create_wrapper ${D}/${bindir}/smart \ + RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ + RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ + RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale +} + +do_install_append_class-native() { + add_native_wrapper +} + +do_install_append_class-nativesdk() { + add_native_wrapper +} + +PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \ + ${@bb.utils.contains('PACKAGECONFIG', 'rpm', '${PN}-backend-rpm', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'qt4', '${PN}-interface-qt4', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'gtk', '${PN}-interface-gtk', '', d)} \ + ${PN}-interface-images ${PN}" + +RDEPENDS_smartpm = "${PN}" + +RDEPENDS_${PN} += "${PN}-backend-rpm python-codecs python-textutils python-xml python-fcntl \ + python-pickle python-crypt python-compression python-shell \ + python-resource python-netclient python-threading python-unixadmin python-pprint" +RDEPENDS_${PN}_class-native = "" + +RDEPENDS_${PN}-backend-rpm = "python-rpm" + +RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images" +RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images" + +FILES_smartpm = "${bindir}/smart" + +FILES_${PN}-dbg += "${libdir}/python*/site-packages/smart/backends/rpm/.debug" + +FILES_${PN}-backend-rpm = "${libdir}/python*/site-packages/smart/backends/rpm" + +FILES_${PN}-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4" +FILES_${PN}-interface-gtk = "${libdir}/python*/site-packages/smart/interfaces/gtk" +FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images" + +BBCLASSEXTEND = "native nativesdk" + diff --git a/meta/recipes-devtools/python/python-smmap_0.8.2.bb b/meta/recipes-devtools/python/python-smmap_0.8.2.bb new file mode 100644 index 0000000000..64f812de00 --- /dev/null +++ b/meta/recipes-devtools/python/python-smmap_0.8.2.bb @@ -0,0 +1,20 @@ +SUMMARY = "Python implementation of a sliding window memory map manager" +DESCRIPTION = "A pure Python implementation of a sliding memory map to \ +help unifying memory mapped access on 32 and 64 bit systems and to help \ +managing resources more efficiently." +HOMEPAGE = "http://github.com/gitpython-developers/GitPython" +SECTION = "devel/python" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709" + +SRC_URI = "http://pypi.python.org/packages/source/s/smmap/smmap-${PV}.tar.gz" +SRC_URI[md5sum] = "f5426b7626ddcf5e447253fae0396b0c" +SRC_URI[sha256sum] = "dea2955cc045ec5527da6b762f7e95a5be7f645c683b54ccce52d56b4d7e2d6f" + +S = "${WORKDIR}/smmap-${PV}" + +inherit setuptools + +RDEPENDS_${PN} += "python-codecs python-mmap python-lang" + +BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-devtools/python/python.inc b/meta/recipes-devtools/python/python.inc new file mode 100644 index 0000000000..19942baeb0 --- /dev/null +++ b/meta/recipes-devtools/python/python.inc @@ -0,0 +1,31 @@ +SUMMARY = "The Python Programming Language" +HOMEPAGE = "http://www.python.org" +LICENSE = "PSFv2" +SECTION = "devel/python" +# bump this on every change in contrib/python/generate-manifest-2.7.py +INC_PR = "r0" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=ed3abfd1059e2d3a36a8cff3986f9bb6" + +SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2" + +SRC_URI[md5sum] = "c57477edd6d18bd9eeca2f21add73919" +SRC_URI[sha256sum] = "726457e11cb153adc3f428aaf1901fc561a374c30e5e7da6742c0742a338663c" + +PYTHON_MAJMIN = "2.7" + +inherit autotools-brokensep + +PYTHONLSBOPTS = "--with-wctype-functions" +PYTHONLSBOPTS_linuxstdbase = "ac_cv_sizeof_off_t=8" + +EXTRA_OECONF = "\ + --with-threads \ + --with-pymalloc \ + --without-cxx-main \ + --with-signal-module \ + --enable-shared \ + --enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)} \ + ac_cv_header_bluetooth_bluetooth_h=no ac_cv_header_bluetooth_h=no \ + ${PYTHONLSBOPTS} \ +" diff --git a/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch b/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch new file mode 100644 index 0000000000..691beada03 --- /dev/null +++ b/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch @@ -0,0 +1,138 @@ +Upstream-Status: Inappropriate [embedded specific] + +# We need to ensure our host tools get run during build, not the freshly +# built cross-tools (this will not work), so we introduce HOSTPYTHON and HOSTPGEN. +# Signed-Off: Michael 'Mickey' Lauer + +Index: Python-2.7.2/Makefile.pre.in +=================================================================== +--- Python-2.7.2.orig/Makefile.pre.in ++++ Python-2.7.2/Makefile.pre.in +@@ -182,6 +182,7 @@ UNICODE_OBJS= @UNICODE_OBJS@ + + PYTHON= python$(EXE) + BUILDPYTHON= python$(BUILDEXE) ++HOSTPYTHON= $(BUILDPYTHON) + + # The task to run while instrument when building the profile-opt target + PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck +@@ -214,7 +215,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ + ########################################################################## + # Parser + PGEN= Parser/pgen$(EXE) +- ++HOSTPGEN= $(PGEN)$(EXE) + POBJS= \ + Parser/acceler.o \ + Parser/grammar1.o \ +@@ -401,14 +402,14 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA + $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + + platform: $(BUILDPYTHON) +- $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform ++ $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform + + + # Build the shared modules + sharedmods: $(BUILDPYTHON) + @case $$MAKEFLAGS in \ +- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ +- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ ++ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \ ++ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ + esac + + # Build static library +@@ -542,7 +543,7 @@ Modules/python.o: $(srcdir)/Modules/pyth + $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp + Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT) + -@$(INSTALL) -d Include +- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) ++ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) + -touch Parser/pgen.stamp + + $(PGEN): $(PGENOBJS) +@@ -926,25 +927,25 @@ libinstall: build_all $(srcdir)/Lib/$(PL + done + $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt + PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ ++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ + $(DESTDIR)$(LIBDEST) + PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ ++ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ + $(DESTDIR)$(LIBDEST) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ ++ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ ++ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" ++ $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" + + # Create the PLATDIR source directory, if one wasn't distributed.. + $(srcdir)/Lib/$(PLATDIR): +@@ -1049,7 +1050,7 @@ libainstall: all python-config + # Install the dynamically loadable modules + # This goes into $(exec_prefix) + sharedinstall: sharedmods +- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ ++ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \ + --prefix=$(prefix) \ + --install-scripts=$(BINDIR) \ + --install-platlib=$(DESTSHARED) \ +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py ++++ Python-2.7.2/setup.py +@@ -313,6 +313,7 @@ class PyBuildExt(build_ext): + self.failed.append(ext.name) + self.announce('*** WARNING: renaming "%s" since importing it' + ' failed: %s' % (ext.name, why), level=3) ++ return + assert not self.inplace + basename, tail = os.path.splitext(ext_filename) + newname = basename + "_failed" + tail +@@ -369,8 +370,8 @@ class PyBuildExt(build_ext): + + def detect_modules(self): + # Ensure that /usr/local is always used +- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') +- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') ++ #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') ++ #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') + self.add_multiarch_paths() + + # Add paths specified in the environment variables LDFLAGS and +@@ -475,6 +476,9 @@ class PyBuildExt(build_ext): + + # XXX Omitted modules: gl, pure, dl, SGI-specific modules + ++ lib_dirs = [ os.getenv("STAGING_LIBDIR"), os.getenv("STAGING_BASELIBDIR") ] ++ inc_dirs = [ os.getenv("STAGING_INCDIR") ] ++ + # + # The following modules are all pretty straightforward, and compile + # on pretty much any POSIXish platform. +@@ -677,8 +681,8 @@ class PyBuildExt(build_ext): + elif curses_library: + readline_libs.append(curses_library) + elif self.compiler.find_library_file(lib_dirs + +- ['/usr/lib/termcap'], +- 'termcap'): ++ ['/usr/lib/termcap'], ++ 'termcap'): + readline_libs.append('termcap') + exts.append( Extension('readline', ['readline.c'], + library_dirs=['/usr/lib/termcap'], diff --git a/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch b/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch new file mode 100644 index 0000000000..d74e4b1776 --- /dev/null +++ b/meta/recipes-devtools/python/python/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 + +Index: Python-2.6.1/setup.py +=================================================================== +--- Python-2.6.1.orig/setup.py ++++ Python-2.6.1/setup.py +@@ -1543,7 +1543,7 @@ class PyBuildExt(build_ext): + 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 +@@ -1562,22 +1562,6 @@ class PyBuildExt(build_ext): + if dir not in include_dirs: + include_dirs.append(dir) + +- # Check for various platform-specific directories +- if 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 platform == 'cygwin': + x11_inc = find_file('X11/Xlib.h', [], include_dirs) diff --git a/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch b/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch new file mode 100644 index 0000000000..a68a20620a --- /dev/null +++ b/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch @@ -0,0 +1,30 @@ +Upstream-Status: Inappropriate [embedded specific] + +# CTypes need to know the actual host we are building on. +# Signed-Off: Michael Dietrich + +Index: Python-2.6.1/setup.py +=================================================================== +--- Python-2.6.1.orig/setup.py ++++ Python-2.6.1/setup.py +@@ -1656,16 +1656,16 @@ class PyBuildExt(build_ext): + ffi_configfile): + from distutils.dir_util import mkpath + mkpath(ffi_builddir) +- config_args = [] ++ config_args = ['--host=%s' % os.environ["HOST_SYS"], ] + + # Pass empty CFLAGS because we'll just append the resulting + # CFLAGS to Python's; -g or -O2 is to be avoided. +- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ +- % (ffi_builddir, ffi_srcdir, " ".join(config_args)) ++ cmd = "(cd %s && autoconf -W cross) && (cd %s && env CFLAGS='' '%s/configure' %s)" \ ++ % (ffi_srcdir, ffi_builddir, ffi_srcdir, " ".join(config_args)) + + res = os.system(cmd) + if res or not os.path.exists(ffi_configfile): +- print "Failed to configure _ctypes module" ++ print "Failed to configure _ctypes module (res=%d) or missing conffile=%s" % ( res, ffi_configfile ) + return False + + fficonfig = {} diff --git a/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch b/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch new file mode 100644 index 0000000000..f8ab0e71e9 --- /dev/null +++ b/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch @@ -0,0 +1,33 @@ +Upstream-Status: Pending + +The poison directories patch has detected library path issue while +compiling the python in cross environment, as seen bellow. + +warning: library search path "/usr/lib/termcap" is unsafe for cross-compilation + +This Patch fixes this issue in the python build environment. +11 Oct 2010 +Nitin A Kamble + +2011/09/29 +Rebased for python 2.7.2 +Signed-Off-By: Nitin A Kamble + +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py ++++ Python-2.7.2/setup.py +@@ -680,12 +680,10 @@ class PyBuildExt(build_ext): + pass # Issue 7384: Already linked against curses or tinfo. + elif curses_library: + readline_libs.append(curses_library) +- elif self.compiler.find_library_file(lib_dirs + +- ['/usr/lib/termcap'], ++ elif self.compiler.find_library_file(lib_dirs, + 'termcap'): + readline_libs.append('termcap') + exts.append( Extension('readline', ['readline.c'], +- library_dirs=['/usr/lib/termcap'], + extra_link_args=readline_extra_link_args, + libraries=readline_libs) ) + else: diff --git a/meta/recipes-devtools/python/python/06-ctypes-libffi-fix-configure.patch b/meta/recipes-devtools/python/python/06-ctypes-libffi-fix-configure.patch new file mode 100644 index 0000000000..abd63d2a96 --- /dev/null +++ b/meta/recipes-devtools/python/python/06-ctypes-libffi-fix-configure.patch @@ -0,0 +1,44 @@ +This fixes configure issues with recent autoconf, e.g: + autoreconf: Entering directory `Modules/_ctypes/libffi' + autoreconf: configure.ac: not using Gettext + autoreconf: running: aclocal --force + configure.ac:26: error: m4_copy: won't overwrite defined macro: _AC_ARG_VAR_PRECIOUS + configure.ac:26: the top level + +The problem is still present in python-2.6.5 but fixed in python-svn. + +Upstream-Status: Accepted [python-svn] + +Signed-off-by: Antonio Ospite +Acked-by: Martin Jansa +Signed-off-by: Martin Jansa +Signed-off-by: Saul Wold + + +2011/09/29 +Rebased for python 2.7.2 +Signed-Off-By: Nitin A Kamble + + +Index: Python-2.7.2/Modules/_ctypes/libffi/Makefile.am +=================================================================== +--- Python-2.7.2.orig/Modules/_ctypes/libffi/Makefile.am ++++ Python-2.7.2/Modules/_ctypes/libffi/Makefile.am +@@ -2,7 +2,7 @@ + + AUTOMAKE_OPTIONS = foreign subdir-objects + +-SUBDIRS = include testsuite man ++SUBDIRS = include + + EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \ + src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \ +@@ -34,8 +34,6 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change + libtool-version ChangeLog.libffi m4/libtool.m4 \ + m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 + +-info_TEXINFOS = doc/libffi.texi +- + ## ################################################################ + + ## diff --git a/meta/recipes-devtools/python/python/CVE-2013-4073_py27.patch b/meta/recipes-devtools/python/python/CVE-2013-4073_py27.patch new file mode 100644 index 0000000000..0d17463052 --- /dev/null +++ b/meta/recipes-devtools/python/python/CVE-2013-4073_py27.patch @@ -0,0 +1,251 @@ +Upstream-Status: Backport + +Signed-off-by: Saul Wold + +diff -r 9ddc63c039ba Lib/test/nullbytecert.pem +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/Lib/test/nullbytecert.pem Sun Aug 11 18:13:17 2013 +0200 +@@ -0,0 +1,90 @@ ++Certificate: ++ Data: ++ Version: 3 (0x2) ++ Serial Number: 0 (0x0) ++ Signature Algorithm: sha1WithRSAEncryption ++ Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python Core Development, CN=null.python.org\x00example.org/emailAddress=python-dev@python.org ++ Validity ++ Not Before: Aug 7 13:11:52 2013 GMT ++ Not After : Aug 7 13:12:52 2013 GMT ++ Subject: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python Core Development, CN=null.python.org\x00example.org/emailAddress=python-dev@python.org ++ Subject Public Key Info: ++ Public Key Algorithm: rsaEncryption ++ Public-Key: (2048 bit) ++ Modulus: ++ 00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3: ++ 03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97: ++ 16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2: ++ 88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1: ++ 32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4: ++ 56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8: ++ a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02: ++ 45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75: ++ ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91: ++ 90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d: ++ 7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30: ++ 68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7: ++ f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12: ++ f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5: ++ ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb: ++ d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f: ++ 9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da: ++ 2f:85 ++ Exponent: 65537 (0x10001) ++ X509v3 extensions: ++ X509v3 Basic Constraints: critical ++ CA:FALSE ++ X509v3 Subject Key Identifier: ++ 88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C ++ X509v3 Key Usage: ++ Digital Signature, Non Repudiation, Key Encipherment ++ X509v3 Subject Alternative Name: ++ ************************************************************* ++ WARNING: The values for DNS, email and URI are WRONG. OpenSSL ++ doesn't print the text after a NULL byte. ++ ************************************************************* ++ DNS:altnull.python.org, email:null@python.org, URI:http://null.python.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1 ++ Signature Algorithm: sha1WithRSAEncryption ++ ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5: ++ a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44: ++ 3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37: ++ 86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3: ++ 56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86: ++ de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac: ++ 3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4: ++ 60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60: ++ d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5: ++ 25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60: ++ 1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6: ++ 4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d: ++ 0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e: ++ 5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6: ++ c1:ca:a9:94 ++-----BEGIN CERTIFICATE----- ++MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx ++DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ ++eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg ++RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y ++ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw ++NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI ++DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv ++ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt ++ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq ++hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB ++BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j ++pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P ++vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv ++KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA ++oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL ++08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV ++HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E ++BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu ++Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251 ++bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA ++AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9 ++i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j ++HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk ++kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx ++VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW ++RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ= ++-----END CERTIFICATE----- +diff -r 9ddc63c039ba Lib/test/test_ssl.py +--- a/Lib/test/test_ssl.py Sun Aug 11 13:04:50 2013 +0300 ++++ b/Lib/test/test_ssl.py Sun Aug 11 18:13:17 2013 +0200 +@@ -25,6 +25,7 @@ + HOST = test_support.HOST + CERTFILE = None + SVN_PYTHON_ORG_ROOT_CERT = None ++NULLBYTECERT = None + + def handle_error(prefix): + exc_format = ' '.join(traceback.format_exception(*sys.exc_info())) +@@ -123,6 +124,27 @@ + ('DNS', 'projects.forum.nokia.com')) + ) + ++ def test_parse_cert_CVE_2013_4073(self): ++ p = ssl._ssl._test_decode_cert(NULLBYTECERT) ++ if test_support.verbose: ++ sys.stdout.write("\n" + pprint.pformat(p) + "\n") ++ subject = ((('countryName', 'US'),), ++ (('stateOrProvinceName', 'Oregon'),), ++ (('localityName', 'Beaverton'),), ++ (('organizationName', 'Python Software Foundation'),), ++ (('organizationalUnitName', 'Python Core Development'),), ++ (('commonName', 'null.python.org\x00example.org'),), ++ (('emailAddress', 'python-dev@python.org'),)) ++ self.assertEqual(p['subject'], subject) ++ self.assertEqual(p['issuer'], subject) ++ self.assertEqual(p['subjectAltName'], ++ (('DNS', 'altnull.python.org\x00example.com'), ++ ('email', 'null@python.org\x00user@example.org'), ++ ('URI', 'http://null.python.org\x00http://example.org'), ++ ('IP Address', '192.0.2.1'), ++ ('IP Address', '2001:DB8:0:0:0:0:0:1\n')) ++ ) ++ + def test_DER_to_PEM(self): + with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f: + pem = f.read() +@@ -1360,7 +1382,7 @@ + + + def test_main(verbose=False): +- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT ++ global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT + CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, + "keycert.pem") + SVN_PYTHON_ORG_ROOT_CERT = os.path.join( +@@ -1368,10 +1390,13 @@ + "https_svn_python_org_root.pem") + NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir, + "nokia.pem") ++ NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir, ++ "nullbytecert.pem") + + if (not os.path.exists(CERTFILE) or + not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or +- not os.path.exists(NOKIACERT)): ++ not os.path.exists(NOKIACERT) or ++ not os.path.exists(NULLBYTECERT)): + raise test_support.TestFailed("Can't read certificate files!") + + tests = [BasicTests, BasicSocketTests] +diff -r 9ddc63c039ba Modules/_ssl.c +--- a/Modules/_ssl.c Sun Aug 11 13:04:50 2013 +0300 ++++ b/Modules/_ssl.c Sun Aug 11 18:13:17 2013 +0200 +@@ -741,8 +741,13 @@ + + /* get a rendering of each name in the set of names */ + ++ int gntype; ++ ASN1_STRING *as = NULL; ++ + name = sk_GENERAL_NAME_value(names, j); +- if (name->type == GEN_DIRNAME) { ++ gntype = name-> type; ++ switch (gntype) { ++ case GEN_DIRNAME: + + /* we special-case DirName as a tuple of tuples of attributes */ + +@@ -764,11 +769,61 @@ + goto fail; + } + PyTuple_SET_ITEM(t, 1, v); ++ break; + +- } else { ++ case GEN_EMAIL: ++ case GEN_DNS: ++ case GEN_URI: ++ /* GENERAL_NAME_print() doesn't handle NUL bytes in ASN1_string ++ correctly. */ ++ t = PyTuple_New(2); ++ if (t == NULL) ++ goto fail; ++ switch (gntype) { ++ case GEN_EMAIL: ++ v = PyUnicode_FromString("email"); ++ as = name->d.rfc822Name; ++ break; ++ case GEN_DNS: ++ v = PyUnicode_FromString("DNS"); ++ as = name->d.dNSName; ++ break; ++ case GEN_URI: ++ v = PyUnicode_FromString("URI"); ++ as = name->d.uniformResourceIdentifier; ++ break; ++ } ++ if (v == NULL) { ++ Py_DECREF(t); ++ goto fail; ++ } ++ PyTuple_SET_ITEM(t, 0, v); ++ v = PyString_FromStringAndSize((char *)ASN1_STRING_data(as), ++ ASN1_STRING_length(as)); ++ if (v == NULL) { ++ Py_DECREF(t); ++ goto fail; ++ } ++ PyTuple_SET_ITEM(t, 1, v); ++ break; + ++ default: + /* for everything else, we use the OpenSSL print form */ +- ++ switch (gntype) { ++ /* check for new general name type */ ++ case GEN_OTHERNAME: ++ case GEN_X400: ++ case GEN_EDIPARTY: ++ case GEN_IPADD: ++ case GEN_RID: ++ break; ++ default: ++ if (PyErr_Warn(PyExc_RuntimeWarning, ++ "Unknown general name type") == -1) { ++ goto fail; ++ } ++ break; ++ } + (void) BIO_reset(biobuf); + GENERAL_NAME_print(biobuf, name); + len = BIO_gets(biobuf, buf, sizeof(buf)-1); +@@ -794,6 +849,7 @@ + goto fail; + } + PyTuple_SET_ITEM(t, 1, v); ++ break; + } + + /* and add that rendering to the list */ diff --git a/meta/recipes-devtools/python/python/add-md5module-support.patch b/meta/recipes-devtools/python/python/add-md5module-support.patch new file mode 100644 index 0000000000..33fea77554 --- /dev/null +++ b/meta/recipes-devtools/python/python/add-md5module-support.patch @@ -0,0 +1,18 @@ + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Saul Wold + +Index: Python-2.7.2/Modules/Setup.dist +=================================================================== +--- Python-2.7.2.orig/Modules/Setup.dist 2011-06-11 08:46:26.000000000 -0700 ++++ Python-2.7.2/Modules/Setup.dist 2011-12-27 15:51:41.244623219 -0800 +@@ -248,7 +248,7 @@ + # Message-Digest Algorithm, described in RFC 1321. The necessary files + # md5.c and md5.h are included here. + +-#_md5 md5module.c md5.c ++_md5 md5module.c md5.c + + + # The _sha module implements the SHA checksum algorithms. diff --git a/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch b/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch new file mode 100644 index 0000000000..bedc3909d8 --- /dev/null +++ b/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch @@ -0,0 +1,30 @@ +_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. + +Also simply disable the tk module since its not in DEPENDS. + +Upstream-Status: Inappropriate [distribution] + +Signed-off-by: Andrei Gherzan + +Index: Python-2.7.3/setup.py +=================================================================== +--- Python-2.7.3.orig/setup.py 2014-07-07 13:45:15.056233820 +0000 ++++ Python-2.7.3/setup.py 2014-07-16 16:06:37.145656284 +0000 +@@ -1639,10 +1639,12 @@ + 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') + + return missing + diff --git a/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch b/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch new file mode 100644 index 0000000000..337e0e3e29 --- /dev/null +++ b/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch @@ -0,0 +1,23 @@ +sunaudiodev module is sunos specific so we avoid a warning by not +adding this module to missing variable. + +Upstream-Status: Inappropriate [distribution] + +Signed-off-by: Andrei Gherzan + +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py 2012-04-05 22:29:18.049196608 +0300 ++++ Python-2.7.2/setup.py 2012-04-05 22:29:57.505195453 +0300 +@@ -1522,8 +1522,9 @@ + if platform == 'sunos5': + # SunOS specific modules + exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) ) +- else: +- missing.append('sunaudiodev') ++ # If platform is not sunos warning is useless ++ #else: ++ # missing.append('sunaudiodev') + + if platform == 'darwin': + # _scproxy diff --git a/meta/recipes-devtools/python/python/builddir.patch b/meta/recipes-devtools/python/python/builddir.patch new file mode 100644 index 0000000000..930170b95a --- /dev/null +++ b/meta/recipes-devtools/python/python/builddir.patch @@ -0,0 +1,55 @@ +When cross compiling python, we used to need to install the Makefile, pyconfig.h +and the python library to their final location before being able to compile the +rest of python. This change allows us to point python at its own source when +building, avoiding a variety of sysroot staging issues and simplifying the main +python recipe. + +Upstream-Status: Inappropriate +RP 2012/11/13 + +Index: Python-2.7.3/Lib/sysconfig.py +=================================================================== +--- Python-2.7.3.orig/Lib/sysconfig.py 2012-11-13 14:36:08.429167199 +0000 ++++ Python-2.7.3/Lib/sysconfig.py 2012-11-13 21:58:31.788551800 +0000 +@@ -93,6 +93,7 @@ + _EXEC_PREFIX = os.path.normpath(sys.exec_prefix) + _CONFIG_VARS = None + _USER_BASE = None ++_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None) + + def _safe_realpath(path): + try: +@@ -100,7 +102,9 @@ + except OSError: + return path + +-if sys.executable: ++if _PYTHONBUILDDIR: ++ _PROJECT_BASE = _PYTHONBUILDDIR ++elif sys.executable: + _PROJECT_BASE = os.path.dirname(_safe_realpath(sys.executable)) + else: + # sys.executable can be empty if argv[0] has been changed and Python is +Index: Python-2.7.3/Lib/distutils/sysconfig.py +=================================================================== +--- Python-2.7.3.orig/Lib/distutils/sysconfig.py 2012-11-13 14:36:08.005167209 +0000 ++++ Python-2.7.3/Lib/distutils/sysconfig.py 2012-11-13 22:07:05.644540695 +0000 +@@ -26,6 +26,9 @@ + # live in project/PCBuild9. If we're dealing with an x64 Windows build, + # it'll live in project/PCbuild/amd64. + project_base = os.path.dirname(os.path.abspath(sys.executable)) ++_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None) ++if _PYTHONBUILDDIR: ++ project_base = _PYTHONBUILDDIR + if os.name == "nt" and "pcbuild" in project_base[-8:].lower(): + project_base = os.path.abspath(os.path.join(project_base, os.path.pardir)) + # PC/VS7.1 +@@ -247,7 +250,7 @@ + def get_makefile_filename(): + """Return full pathname of installed Makefile from the Python build.""" + if python_build: +- return os.path.join(os.path.dirname(sys.executable), "Makefile") ++ return os.path.join(project_base, "Makefile") + lib_dir = get_python_lib(plat_specific=1, standard_lib=1) + return os.path.join(lib_dir, "config", "Makefile") + diff --git a/meta/recipes-devtools/python/python/cgi_py.patch b/meta/recipes-devtools/python/python/cgi_py.patch new file mode 100644 index 0000000000..de504f9dcf --- /dev/null +++ b/meta/recipes-devtools/python/python/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 + +--- 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/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch b/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch new file mode 100644 index 0000000000..2b62db3826 --- /dev/null +++ b/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch @@ -0,0 +1,57 @@ +Author: Andrei Gherzan +Date: Sun Mar 25 02:02:27 2012 +0200 + +This patch was added for 64bit host machines. In the compile process python +is checking if platform is a 64bit platform using sys.maxint which is the host's +value. The patch fixes this issue so that python would check if TARGET machine +is 64bit not the HOST machine. In this way will have "dl" and "imageop" modules +built if HOST machine is 64bit but the target machine is 32bit. + +Signed-off-by: Andrei Gherzan + +Upstream-Status: Pending + +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py 2012-03-25 01:10:41.540163187 +0200 ++++ Python-2.7.2/setup.py 2012-03-25 01:26:06.092539990 +0200 +@@ -23,6 +23,21 @@ + # This global variable is used to hold the list of modules to be disabled. + disabled_module_list = [] + ++def target_is_64bit_platform (): ++ """ ++ In case of cross-compile, some modules are not build as setup checks if HOST ++ is 64bit and not TARGET. ++ As python was built for TARGET we can check this in pyconfig.h in this way: ++ Sizeof LONG on a 32 bit platform is 4 bytes ++ Sizeof LONG on a 64 bit platform is 8 bytes ++ """ ++ pyconf = open("pyconfig.h").read() ++ aux = re.search(r"#s*define\s+SIZEOF_LONG\s+8\s*", pyconf) ++ if aux is not None: ++ return True ++ else: ++ return False ++ + def add_dir_to_list(dirlist, dir): + """Add the directory 'dir' to the list 'dirlist' (at the front) if + 1) 'dir' is not already in 'dirlist' +@@ -628,7 +643,7 @@ + exts.append( Extension('audioop', ['audioop.c']) ) + + # Disabled on 64-bit platforms +- if sys.maxint != 9223372036854775807L: ++ if not target_is_64bit_platform(): + # Operations on images + exts.append( Extension('imageop', ['imageop.c']) ) + else: +@@ -1418,7 +1433,7 @@ + missing.append('_codecs_%s' % loc) + + # Dynamic loading module +- if sys.maxint == 0x7fffffff: ++ if not target_is_64bit_platform(): + # This requires sizeof(int) == sizeof(long) == sizeof(char*) + dl_inc = find_file('dlfcn.h', [], inc_dirs) + if (dl_inc is not None) and (platform not in ['atheos']): diff --git a/meta/recipes-devtools/python/python/ctypes-libffi-aarch64.patch b/meta/recipes-devtools/python/python/ctypes-libffi-aarch64.patch new file mode 100644 index 0000000000..7349c7bfe3 --- /dev/null +++ b/meta/recipes-devtools/python/python/ctypes-libffi-aarch64.patch @@ -0,0 +1,22 @@ +Add missing fficonfig.py bits for aarch64 + +# HG changeset patch +# User Andreas Schwab +# Date 1367276434 -7200 +# Node ID 05e8999a3901b4853e60d6701510e9b3dd54a7f3 +# Parent 84cef4f1999ad9e362694cdac2f65f0981e3d5d0 + +Upstream-Status: Backport +Signed-off-by: Tudor Florea + +diff -r 84cef4f1999a -r 05e8999a3901 Modules/_ctypes/libffi/fficonfig.py.in +--- a/Modules/_ctypes/libffi/fficonfig.py.in Mon Apr 29 16:09:39 2013 -0400 ++++ b/Modules/_ctypes/libffi/fficonfig.py.in Tue Apr 30 01:00:34 2013 +0200 +@@ -28,6 +28,7 @@ + 'PA': ['src/pa/linux.S', 'src/pa/ffi.c'], + 'PA_LINUX': ['src/pa/linux.S', 'src/pa/ffi.c'], + 'PA_HPUX': ['src/pa/hpux32.S', 'src/pa/ffi.c'], ++ 'AARCH64' : ['src/aarch64/ffi.c', 'src/aarch64/sysv.S'], + } + + ffi_sources += ffi_platforms['@TARGET@'] diff --git a/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch b/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch new file mode 100644 index 0000000000..669112dab0 --- /dev/null +++ b/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch @@ -0,0 +1,33 @@ +Add 'build-test' and 'runtest-TESTS' targets to Makefile, to build and run tests +cross-compiled. + +Signed-off-by: Tudor Florea +Upstream-Status: Pending +--- +diff -ruN a/Makefile.pre.in b/Makefile.pre.in +--- a/Makefile.pre.in 2013-06-27 10:44:11.033840532 +0200 ++++ b/Makefile.pre.in 2013-06-27 10:44:39.572635273 +0200 +@@ -709,14 +709,19 @@ + # generated bytecode. This is sometimes a very shy bug needing a lot of + # sample data. + +-TESTOPTS= -l $(EXTRATESTOPTS) ++TESTOPTS= -l -v $(EXTRATESTOPTS) + TESTPROG= $(srcdir)/Lib/test/regrtest.py +-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS) +-test: all platform +- -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f ++TESTPYTHON= $(RUNSHARED) $(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS) ++test: build-test ++ $(MAKE) runtest-TESTS ++ ++runtest-TESTS: ++ -find $(srcdir) -name '*.py[co]' -print | xargs rm -f + -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) + $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) + ++build-test: all platform ++ + testall: all platform + -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f + $(TESTPYTHON) $(srcdir)/Lib/compileall.py diff --git a/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch b/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch new file mode 100644 index 0000000000..50d3915425 --- /dev/null +++ b/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch @@ -0,0 +1,82 @@ +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 +Date: 2012/03/14 + +Updated for python 2.7.3 +Signed-Off-By: Nitin A Kamble +Date: 2012/05/01 + +Index: Python-2.7.3/Lib/sysconfig.py +=================================================================== +--- Python-2.7.3.orig/Lib/sysconfig.py ++++ Python-2.7.3/Lib/sysconfig.py +@@ -7,10 +7,10 @@ from os.path import pardir, realpath + + _INSTALL_SCHEMES = { + 'posix_prefix': { +- 'stdlib': '{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': '{base}/'+sys.lib+'/python{py_version_short}', ++ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}', ++ 'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages', ++ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages', + 'include': '{base}/include/python{py_version_short}', + 'platinclude': '{platbase}/include/python{py_version_short}', + 'scripts': '{base}/bin', +@@ -65,10 +65,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-2.7.3/Makefile.pre.in +=================================================================== +--- Python-2.7.3.orig/Makefile.pre.in ++++ Python-2.7.3/Makefile.pre.in +@@ -941,25 +941,25 @@ libinstall: build_all $(srcdir)/Lib/$(PL + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ + $(DESTDIR)$(LIBDEST) +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ + $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ + $(DESTDIR)$(LIBDEST) +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ + $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ + $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ + $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" + + # Create the PLATDIR source directory, if one wasn't distributed.. diff --git a/meta/recipes-devtools/python/python/gcc-4.8-fix-configure-Wformat.patch b/meta/recipes-devtools/python/python/gcc-4.8-fix-configure-Wformat.patch new file mode 100644 index 0000000000..b5d9d5d424 --- /dev/null +++ b/meta/recipes-devtools/python/python/gcc-4.8-fix-configure-Wformat.patch @@ -0,0 +1,20 @@ +backport bug 17547 from http://hg.python.org/cpython/rev/9d50af4c482f/ + +-Wformat is needed by gcc 4.8 + +Signed-off-by: Khem Raj + +Upstream-Status: Backport +Index: Python-2.7.3/configure.in +=================================================================== +--- Python-2.7.3.orig/configure.in 2013-06-11 02:22:04.186529212 -0700 ++++ Python-2.7.3/configure.in 2013-06-13 02:17:06.324403327 -0700 +@@ -1196,7 +1196,7 @@ + then + AC_MSG_CHECKING(whether gcc supports ParseTuple __format__) + save_CFLAGS=$CFLAGS +- CFLAGS="$CFLAGS -Werror" ++ CFLAGS="$CFLAGS -Werror -Wformat" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]]) + ],[ diff --git a/meta/recipes-devtools/python/python/host_include_contamination.patch b/meta/recipes-devtools/python/python/host_include_contamination.patch new file mode 100644 index 0000000000..62cb8b16da --- /dev/null +++ b/meta/recipes-devtools/python/python/host_include_contamination.patch @@ -0,0 +1,27 @@ +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 +Upstream-Status: Pending + +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py 2012-02-03 12:10:42.307057756 -0800 ++++ Python-2.7.2/setup.py 2012-02-03 12:11:12.363059210 -0800 +@@ -360,6 +360,8 @@ + # https://wiki.ubuntu.com/MultiarchSpec + if not find_executable('dpkg-architecture'): + return ++ if os.environ.get('CROSS_COMPILE') is not None: ++ return + tmpfile = os.path.join(self.build_temp, 'multiarch') + if not os.path.exists(self.build_temp): + os.makedirs(self.build_temp) diff --git a/meta/recipes-devtools/python/python/json-flaw-fix.patch b/meta/recipes-devtools/python/python/json-flaw-fix.patch new file mode 100644 index 0000000000..e9a6cca017 --- /dev/null +++ b/meta/recipes-devtools/python/python/json-flaw-fix.patch @@ -0,0 +1,27 @@ + +python: fix _json module arbitrary process memory read vulnerability + +Upstream-Status: submitted + +Signed-off-by: Daniel BORNAZ + +--- a/Modules/_json.c 2014-07-15 15:37:17.151046356 +0200 ++++ b/Modules/_json.c 2014-07-15 15:38:37.335605042 +0200 +@@ -1491,7 +1491,7 @@ scan_once_str(PyScannerObject *s, PyObje + PyObject *res; + char *str = PyString_AS_STRING(pystr); + Py_ssize_t length = PyString_GET_SIZE(pystr); +- if (idx >= length) { ++ if ( idx < 0 || idx >= length) { + PyErr_SetNone(PyExc_StopIteration); + return NULL; + } +@@ -1578,7 +1578,7 @@ scan_once_unicode(PyScannerObject *s, Py + PyObject *res; + Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); + Py_ssize_t length = PyUnicode_GET_SIZE(pystr); +- if (idx >= length) { ++ if ( idx < 0 || idx >= length) { + PyErr_SetNone(PyExc_StopIteration); + return NULL; + } diff --git a/meta/recipes-devtools/python/python/libffi-aarch64.patch b/meta/recipes-devtools/python/python/libffi-aarch64.patch new file mode 100644 index 0000000000..5581922354 --- /dev/null +++ b/meta/recipes-devtools/python/python/libffi-aarch64.patch @@ -0,0 +1,1608 @@ +Add support for aarch64 for ctypes module + +Python have its own version of libffi used for ctypes module. +libffi 3.0.10 contained in original source of Python-2.7.3 does not have +support for aarch64 architecture. +This is patch is backport support for aarch64 from libffi 3.1 + +Upstream-Status: Backport +Signed-off-by: Tudor Florea + +diff -ruN Python-2.7.3.orig/Modules/_ctypes/libffi/configure.ac Python-2.7.3/Modules/_ctypes/libffi/configure.ac +--- Python-2.7.3.orig/Modules/_ctypes/libffi/configure.ac 2015-02-27 23:15:16.118393178 +0100 ++++ Python-2.7.3/Modules/_ctypes/libffi/configure.ac 2015-02-27 23:51:03.351556903 +0100 +@@ -44,6 +44,10 @@ + + TARGETDIR="unknown" + case "$host" in ++ aarch64*-*-*) ++ TARGET=AARCH64; TARGETDIR=aarch64 ++ ;; ++ + alpha*-*-*) + TARGET=ALPHA; TARGETDIR=alpha; + # Support 128-bit long double, changeable via command-line switch. +@@ -195,6 +199,7 @@ + AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX) + AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN) + AM_CONDITIONAL(POWERPC_FREEBSD, test x$TARGET = xPOWERPC_FREEBSD) ++AM_CONDITIONAL(AARCH64, test x$TARGET = xAARCH64) + AM_CONDITIONAL(ARM, test x$TARGET = xARM) + AM_CONDITIONAL(AVR32, test x$TARGET = xAVR32) + AM_CONDITIONAL(LIBFFI_CRIS, test x$TARGET = xLIBFFI_CRIS) +diff -ruN Python-2.7.3.orig/Modules/_ctypes/libffi/src/aarch64/ffi.c Python-2.7.3/Modules/_ctypes/libffi/src/aarch64/ffi.c +--- Python-2.7.3.orig/Modules/_ctypes/libffi/src/aarch64/ffi.c 1970-01-01 01:00:00.000000000 +0100 ++++ Python-2.7.3/Modules/_ctypes/libffi/src/aarch64/ffi.c 2014-04-25 19:45:13.000000000 +0200 +@@ -0,0 +1,1168 @@ ++/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++``Software''), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include ++ ++#include ++#include ++ ++#include ++ ++/* Stack alignment requirement in bytes */ ++#if defined (__APPLE__) ++#define AARCH64_STACK_ALIGN 1 ++#else ++#define AARCH64_STACK_ALIGN 16 ++#endif ++ ++#define N_X_ARG_REG 8 ++#define N_V_ARG_REG 8 ++ ++#define AARCH64_FFI_WITH_V (1 << AARCH64_FFI_WITH_V_BIT) ++ ++union _d ++{ ++ UINT64 d; ++ UINT32 s[2]; ++}; ++ ++struct call_context ++{ ++ UINT64 x [AARCH64_N_XREG]; ++ struct ++ { ++ union _d d[2]; ++ } v [AARCH64_N_VREG]; ++}; ++ ++#if defined (__clang__) && defined (__APPLE__) ++extern void ++sys_icache_invalidate (void *start, size_t len); ++#endif ++ ++static inline void ++ffi_clear_cache (void *start, void *end) ++{ ++#if defined (__clang__) && defined (__APPLE__) ++ sys_icache_invalidate (start, (char *)end - (char *)start); ++#elif defined (__GNUC__) ++ __builtin___clear_cache (start, end); ++#else ++#error "Missing builtin to flush instruction cache" ++#endif ++} ++ ++static void * ++get_x_addr (struct call_context *context, unsigned n) ++{ ++ return &context->x[n]; ++} ++ ++static void * ++get_s_addr (struct call_context *context, unsigned n) ++{ ++#if defined __AARCH64EB__ ++ return &context->v[n].d[1].s[1]; ++#else ++ return &context->v[n].d[0].s[0]; ++#endif ++} ++ ++static void * ++get_d_addr (struct call_context *context, unsigned n) ++{ ++#if defined __AARCH64EB__ ++ return &context->v[n].d[1]; ++#else ++ return &context->v[n].d[0]; ++#endif ++} ++ ++static void * ++get_v_addr (struct call_context *context, unsigned n) ++{ ++ return &context->v[n]; ++} ++ ++/* Return the memory location at which a basic type would reside ++ were it to have been stored in register n. */ ++ ++static void * ++get_basic_type_addr (unsigned short type, struct call_context *context, ++ unsigned n) ++{ ++ switch (type) ++ { ++ case FFI_TYPE_FLOAT: ++ return get_s_addr (context, n); ++ case FFI_TYPE_DOUBLE: ++ return get_d_addr (context, n); ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ return get_v_addr (context, n); ++#endif ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ return get_x_addr (context, n); ++ case FFI_TYPE_VOID: ++ return NULL; ++ default: ++ FFI_ASSERT (0); ++ return NULL; ++ } ++} ++ ++/* Return the alignment width for each of the basic types. */ ++ ++static size_t ++get_basic_type_alignment (unsigned short type) ++{ ++ switch (type) ++ { ++ case FFI_TYPE_FLOAT: ++ case FFI_TYPE_DOUBLE: ++ return sizeof (UINT64); ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ return sizeof (long double); ++#endif ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++#if defined (__APPLE__) ++ return sizeof (UINT8); ++#endif ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++#if defined (__APPLE__) ++ return sizeof (UINT16); ++#endif ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_SINT32: ++#if defined (__APPLE__) ++ return sizeof (UINT32); ++#endif ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ return sizeof (UINT64); ++ ++ default: ++ FFI_ASSERT (0); ++ return 0; ++ } ++} ++ ++/* Return the size in bytes for each of the basic types. */ ++ ++static size_t ++get_basic_type_size (unsigned short type) ++{ ++ switch (type) ++ { ++ case FFI_TYPE_FLOAT: ++ return sizeof (UINT32); ++ case FFI_TYPE_DOUBLE: ++ return sizeof (UINT64); ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ return sizeof (long double); ++#endif ++ case FFI_TYPE_UINT8: ++ return sizeof (UINT8); ++ case FFI_TYPE_SINT8: ++ return sizeof (SINT8); ++ case FFI_TYPE_UINT16: ++ return sizeof (UINT16); ++ case FFI_TYPE_SINT16: ++ return sizeof (SINT16); ++ case FFI_TYPE_UINT32: ++ return sizeof (UINT32); ++ case FFI_TYPE_INT: ++ case FFI_TYPE_SINT32: ++ return sizeof (SINT32); ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_UINT64: ++ return sizeof (UINT64); ++ case FFI_TYPE_SINT64: ++ return sizeof (SINT64); ++ ++ default: ++ FFI_ASSERT (0); ++ return 0; ++ } ++} ++ ++extern void ++ffi_call_SYSV (unsigned (*)(struct call_context *context, unsigned char *, ++ extended_cif *), ++ struct call_context *context, ++ extended_cif *, ++ size_t, ++ void (*fn)(void)); ++ ++extern void ++ffi_closure_SYSV (ffi_closure *); ++ ++/* Test for an FFI floating point representation. */ ++ ++static unsigned ++is_floating_type (unsigned short type) ++{ ++ return (type == FFI_TYPE_FLOAT || type == FFI_TYPE_DOUBLE ++ || type == FFI_TYPE_LONGDOUBLE); ++} ++ ++/* Test for a homogeneous structure. */ ++ ++static unsigned short ++get_homogeneous_type (ffi_type *ty) ++{ ++ if (ty->type == FFI_TYPE_STRUCT && ty->elements) ++ { ++ unsigned i; ++ unsigned short candidate_type ++ = get_homogeneous_type (ty->elements[0]); ++ for (i =1; ty->elements[i]; i++) ++ { ++ unsigned short iteration_type = 0; ++ /* If we have a nested struct, we must find its homogeneous type. ++ If that fits with our candidate type, we are still ++ homogeneous. */ ++ if (ty->elements[i]->type == FFI_TYPE_STRUCT ++ && ty->elements[i]->elements) ++ { ++ iteration_type = get_homogeneous_type (ty->elements[i]); ++ } ++ else ++ { ++ iteration_type = ty->elements[i]->type; ++ } ++ ++ /* If we are not homogeneous, return FFI_TYPE_STRUCT. */ ++ if (candidate_type != iteration_type) ++ return FFI_TYPE_STRUCT; ++ } ++ return candidate_type; ++ } ++ ++ /* Base case, we have no more levels of nesting, so we ++ are a basic type, and so, trivially homogeneous in that type. */ ++ return ty->type; ++} ++ ++/* Determine the number of elements within a STRUCT. ++ ++ Note, we must handle nested structs. ++ ++ If ty is not a STRUCT this function will return 0. */ ++ ++static unsigned ++element_count (ffi_type *ty) ++{ ++ if (ty->type == FFI_TYPE_STRUCT && ty->elements) ++ { ++ unsigned n; ++ unsigned elems = 0; ++ for (n = 0; ty->elements[n]; n++) ++ { ++ if (ty->elements[n]->type == FFI_TYPE_STRUCT ++ && ty->elements[n]->elements) ++ elems += element_count (ty->elements[n]); ++ else ++ elems++; ++ } ++ return elems; ++ } ++ return 0; ++} ++ ++/* Test for a homogeneous floating point aggregate. ++ ++ A homogeneous floating point aggregate is a homogeneous aggregate of ++ a half- single- or double- precision floating point type with one ++ to four elements. Note that this includes nested structs of the ++ basic type. */ ++ ++static int ++is_hfa (ffi_type *ty) ++{ ++ if (ty->type == FFI_TYPE_STRUCT ++ && ty->elements[0] ++ && is_floating_type (get_homogeneous_type (ty))) ++ { ++ unsigned n = element_count (ty); ++ return n >= 1 && n <= 4; ++ } ++ return 0; ++} ++ ++/* Test if an ffi_type is a candidate for passing in a register. ++ ++ This test does not check that sufficient registers of the ++ appropriate class are actually available, merely that IFF ++ sufficient registers are available then the argument will be passed ++ in register(s). ++ ++ Note that an ffi_type that is deemed to be a register candidate ++ will always be returned in registers. ++ ++ Returns 1 if a register candidate else 0. */ ++ ++static int ++is_register_candidate (ffi_type *ty) ++{ ++ switch (ty->type) ++ { ++ case FFI_TYPE_VOID: ++ case FFI_TYPE_FLOAT: ++ case FFI_TYPE_DOUBLE: ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++#endif ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_SINT64: ++ return 1; ++ ++ case FFI_TYPE_STRUCT: ++ if (is_hfa (ty)) ++ { ++ return 1; ++ } ++ else if (ty->size > 16) ++ { ++ /* Too large. Will be replaced with a pointer to memory. The ++ pointer MAY be passed in a register, but the value will ++ not. This test specifically fails since the argument will ++ never be passed by value in registers. */ ++ return 0; ++ } ++ else ++ { ++ /* Might be passed in registers depending on the number of ++ registers required. */ ++ return (ty->size + 7) / 8 < N_X_ARG_REG; ++ } ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++ ++ return 0; ++} ++ ++/* Test if an ffi_type argument or result is a candidate for a vector ++ register. */ ++ ++static int ++is_v_register_candidate (ffi_type *ty) ++{ ++ return is_floating_type (ty->type) ++ || (ty->type == FFI_TYPE_STRUCT && is_hfa (ty)); ++} ++ ++/* Representation of the procedure call argument marshalling ++ state. ++ ++ The terse state variable names match the names used in the AARCH64 ++ PCS. */ ++ ++struct arg_state ++{ ++ unsigned ngrn; /* Next general-purpose register number. */ ++ unsigned nsrn; /* Next vector register number. */ ++ size_t nsaa; /* Next stack offset. */ ++ ++#if defined (__APPLE__) ++ unsigned allocating_variadic; ++#endif ++}; ++ ++/* Initialize a procedure call argument marshalling state. */ ++static void ++arg_init (struct arg_state *state, size_t call_frame_size) ++{ ++ state->ngrn = 0; ++ state->nsrn = 0; ++ state->nsaa = 0; ++ ++#if defined (__APPLE__) ++ state->allocating_variadic = 0; ++#endif ++} ++ ++/* Return the number of available consecutive core argument ++ registers. */ ++ ++static unsigned ++available_x (struct arg_state *state) ++{ ++ return N_X_ARG_REG - state->ngrn; ++} ++ ++/* Return the number of available consecutive vector argument ++ registers. */ ++ ++static unsigned ++available_v (struct arg_state *state) ++{ ++ return N_V_ARG_REG - state->nsrn; ++} ++ ++static void * ++allocate_to_x (struct call_context *context, struct arg_state *state) ++{ ++ FFI_ASSERT (state->ngrn < N_X_ARG_REG); ++ return get_x_addr (context, (state->ngrn)++); ++} ++ ++static void * ++allocate_to_s (struct call_context *context, struct arg_state *state) ++{ ++ FFI_ASSERT (state->nsrn < N_V_ARG_REG); ++ return get_s_addr (context, (state->nsrn)++); ++} ++ ++static void * ++allocate_to_d (struct call_context *context, struct arg_state *state) ++{ ++ FFI_ASSERT (state->nsrn < N_V_ARG_REG); ++ return get_d_addr (context, (state->nsrn)++); ++} ++ ++static void * ++allocate_to_v (struct call_context *context, struct arg_state *state) ++{ ++ FFI_ASSERT (state->nsrn < N_V_ARG_REG); ++ return get_v_addr (context, (state->nsrn)++); ++} ++ ++/* Allocate an aligned slot on the stack and return a pointer to it. */ ++static void * ++allocate_to_stack (struct arg_state *state, void *stack, size_t alignment, ++ size_t size) ++{ ++ void *allocation; ++ ++ /* Round up the NSAA to the larger of 8 or the natural ++ alignment of the argument's type. */ ++ state->nsaa = ALIGN (state->nsaa, alignment); ++ state->nsaa = ALIGN (state->nsaa, alignment); ++#if defined (__APPLE__) ++ if (state->allocating_variadic) ++ state->nsaa = ALIGN (state->nsaa, 8); ++#else ++ state->nsaa = ALIGN (state->nsaa, 8); ++#endif ++ ++ allocation = stack + state->nsaa; ++ ++ state->nsaa += size; ++ return allocation; ++} ++ ++static void ++copy_basic_type (void *dest, void *source, unsigned short type) ++{ ++ /* This is necessary to ensure that basic types are copied ++ sign extended to 64-bits as libffi expects. */ ++ switch (type) ++ { ++ case FFI_TYPE_FLOAT: ++ *(float *) dest = *(float *) source; ++ break; ++ case FFI_TYPE_DOUBLE: ++ *(double *) dest = *(double *) source; ++ break; ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ *(long double *) dest = *(long double *) source; ++ break; ++#endif ++ case FFI_TYPE_UINT8: ++ *(ffi_arg *) dest = *(UINT8 *) source; ++ break; ++ case FFI_TYPE_SINT8: ++ *(ffi_sarg *) dest = *(SINT8 *) source; ++ break; ++ case FFI_TYPE_UINT16: ++ *(ffi_arg *) dest = *(UINT16 *) source; ++ break; ++ case FFI_TYPE_SINT16: ++ *(ffi_sarg *) dest = *(SINT16 *) source; ++ break; ++ case FFI_TYPE_UINT32: ++ *(ffi_arg *) dest = *(UINT32 *) source; ++ break; ++ case FFI_TYPE_INT: ++ case FFI_TYPE_SINT32: ++ *(ffi_sarg *) dest = *(SINT32 *) source; ++ break; ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_UINT64: ++ *(ffi_arg *) dest = *(UINT64 *) source; ++ break; ++ case FFI_TYPE_SINT64: ++ *(ffi_sarg *) dest = *(SINT64 *) source; ++ break; ++ case FFI_TYPE_VOID: ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ } ++} ++ ++static void ++copy_hfa_to_reg_or_stack (void *memory, ++ ffi_type *ty, ++ struct call_context *context, ++ unsigned char *stack, ++ struct arg_state *state) ++{ ++ unsigned elems = element_count (ty); ++ if (available_v (state) < elems) ++ { ++ /* There are insufficient V registers. Further V register allocations ++ are prevented, the NSAA is adjusted (by allocate_to_stack ()) ++ and the argument is copied to memory at the adjusted NSAA. */ ++ state->nsrn = N_V_ARG_REG; ++ memcpy (allocate_to_stack (state, stack, ty->alignment, ty->size), ++ memory, ++ ty->size); ++ } ++ else ++ { ++ int i; ++ unsigned short type = get_homogeneous_type (ty); ++ for (i = 0; i < elems; i++) ++ { ++ void *reg = allocate_to_v (context, state); ++ copy_basic_type (reg, memory, type); ++ memory += get_basic_type_size (type); ++ } ++ } ++} ++ ++/* Either allocate an appropriate register for the argument type, or if ++ none are available, allocate a stack slot and return a pointer ++ to the allocated space. */ ++ ++static void * ++allocate_to_register_or_stack (struct call_context *context, ++ unsigned char *stack, ++ struct arg_state *state, ++ unsigned short type) ++{ ++ size_t alignment = get_basic_type_alignment (type); ++ size_t size = alignment; ++ switch (type) ++ { ++ case FFI_TYPE_FLOAT: ++ /* This is the only case for which the allocated stack size ++ should not match the alignment of the type. */ ++ size = sizeof (UINT32); ++ /* Fall through. */ ++ case FFI_TYPE_DOUBLE: ++ if (state->nsrn < N_V_ARG_REG) ++ return allocate_to_d (context, state); ++ state->nsrn = N_V_ARG_REG; ++ break; ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ if (state->nsrn < N_V_ARG_REG) ++ return allocate_to_v (context, state); ++ state->nsrn = N_V_ARG_REG; ++ break; ++#endif ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ if (state->ngrn < N_X_ARG_REG) ++ return allocate_to_x (context, state); ++ state->ngrn = N_X_ARG_REG; ++ break; ++ default: ++ FFI_ASSERT (0); ++ } ++ ++ return allocate_to_stack (state, stack, alignment, size); ++} ++ ++/* Copy a value to an appropriate register, or if none are ++ available, to the stack. */ ++ ++static void ++copy_to_register_or_stack (struct call_context *context, ++ unsigned char *stack, ++ struct arg_state *state, ++ void *value, ++ unsigned short type) ++{ ++ copy_basic_type ( ++ allocate_to_register_or_stack (context, stack, state, type), ++ value, ++ type); ++} ++ ++/* Marshall the arguments from FFI representation to procedure call ++ context and stack. */ ++ ++static unsigned ++aarch64_prep_args (struct call_context *context, unsigned char *stack, ++ extended_cif *ecif) ++{ ++ int i; ++ struct arg_state state; ++ ++ arg_init (&state, ALIGN(ecif->cif->bytes, 16)); ++ ++ for (i = 0; i < ecif->cif->nargs; i++) ++ { ++ ffi_type *ty = ecif->cif->arg_types[i]; ++ switch (ty->type) ++ { ++ case FFI_TYPE_VOID: ++ FFI_ASSERT (0); ++ break; ++ ++ /* If the argument is a basic type the argument is allocated to an ++ appropriate register, or if none are available, to the stack. */ ++ case FFI_TYPE_FLOAT: ++ case FFI_TYPE_DOUBLE: ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++#endif ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ copy_to_register_or_stack (context, stack, &state, ++ ecif->avalue[i], ty->type); ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ if (is_hfa (ty)) ++ { ++ copy_hfa_to_reg_or_stack (ecif->avalue[i], ty, context, ++ stack, &state); ++ } ++ else if (ty->size > 16) ++ { ++ /* If the argument is a composite type that is larger than 16 ++ bytes, then the argument has been copied to memory, and ++ the argument is replaced by a pointer to the copy. */ ++ ++ copy_to_register_or_stack (context, stack, &state, ++ &(ecif->avalue[i]), FFI_TYPE_POINTER); ++ } ++ else if (available_x (&state) >= (ty->size + 7) / 8) ++ { ++ /* If the argument is a composite type and the size in ++ double-words is not more than the number of available ++ X registers, then the argument is copied into consecutive ++ X registers. */ ++ int j; ++ for (j = 0; j < (ty->size + 7) / 8; j++) ++ { ++ memcpy (allocate_to_x (context, &state), ++ &(((UINT64 *) ecif->avalue[i])[j]), ++ sizeof (UINT64)); ++ } ++ } ++ else ++ { ++ /* Otherwise, there are insufficient X registers. Further X ++ register allocations are prevented, the NSAA is adjusted ++ (by allocate_to_stack ()) and the argument is copied to ++ memory at the adjusted NSAA. */ ++ state.ngrn = N_X_ARG_REG; ++ ++ memcpy (allocate_to_stack (&state, stack, ty->alignment, ++ ty->size), ecif->avalue + i, ty->size); ++ } ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++ ++#if defined (__APPLE__) ++ if (i + 1 == ecif->cif->aarch64_nfixedargs) ++ { ++ state.ngrn = N_X_ARG_REG; ++ state.nsrn = N_V_ARG_REG; ++ ++ state.allocating_variadic = 1; ++ } ++#endif ++ } ++ ++ return ecif->cif->aarch64_flags; ++} ++ ++ffi_status ++ffi_prep_cif_machdep (ffi_cif *cif) ++{ ++ /* Round the stack up to a multiple of the stack alignment requirement. */ ++ cif->bytes = ++ (cif->bytes + (AARCH64_STACK_ALIGN - 1)) & ~ (AARCH64_STACK_ALIGN - 1); ++ ++ /* Initialize our flags. We are interested if this CIF will touch a ++ vector register, if so we will enable context save and load to ++ those registers, otherwise not. This is intended to be friendly ++ to lazy float context switching in the kernel. */ ++ cif->aarch64_flags = 0; ++ ++ if (is_v_register_candidate (cif->rtype)) ++ { ++ cif->aarch64_flags |= AARCH64_FFI_WITH_V; ++ } ++ else ++ { ++ int i; ++ for (i = 0; i < cif->nargs; i++) ++ if (is_v_register_candidate (cif->arg_types[i])) ++ { ++ cif->aarch64_flags |= AARCH64_FFI_WITH_V; ++ break; ++ } ++ } ++ ++ return FFI_OK; ++} ++ ++#if defined (__APPLE__) ++ ++/* Perform Apple-specific cif processing for variadic calls */ ++ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, ++ unsigned int nfixedargs, ++ unsigned int ntotalargs) ++{ ++ cif->aarch64_nfixedargs = nfixedargs; ++ ++ return ffi_prep_cif_machdep(cif); ++} ++ ++#endif ++ ++/* Call a function with the provided arguments and capture the return ++ value. */ ++void ++ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) ++{ ++ extended_cif ecif; ++ ++ ecif.cif = cif; ++ ecif.avalue = avalue; ++ ecif.rvalue = rvalue; ++ ++ switch (cif->abi) ++ { ++ case FFI_SYSV: ++ { ++ struct call_context context; ++ size_t stack_bytes; ++ ++ /* Figure out the total amount of stack space we need, the ++ above call frame space needs to be 16 bytes aligned to ++ ensure correct alignment of the first object inserted in ++ that space hence the ALIGN applied to cif->bytes.*/ ++ stack_bytes = ALIGN(cif->bytes, 16); ++ ++ memset (&context, 0, sizeof (context)); ++ if (is_register_candidate (cif->rtype)) ++ { ++ ffi_call_SYSV (aarch64_prep_args, &context, &ecif, stack_bytes, fn); ++ switch (cif->rtype->type) ++ { ++ case FFI_TYPE_VOID: ++ case FFI_TYPE_FLOAT: ++ case FFI_TYPE_DOUBLE: ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++#endif ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_SINT64: ++ { ++ void *addr = get_basic_type_addr (cif->rtype->type, ++ &context, 0); ++ copy_basic_type (rvalue, addr, cif->rtype->type); ++ break; ++ } ++ ++ case FFI_TYPE_STRUCT: ++ if (is_hfa (cif->rtype)) ++ { ++ int j; ++ unsigned short type = get_homogeneous_type (cif->rtype); ++ unsigned elems = element_count (cif->rtype); ++ for (j = 0; j < elems; j++) ++ { ++ void *reg = get_basic_type_addr (type, &context, j); ++ copy_basic_type (rvalue, reg, type); ++ rvalue += get_basic_type_size (type); ++ } ++ } ++ else if ((cif->rtype->size + 7) / 8 < N_X_ARG_REG) ++ { ++ size_t size = ALIGN (cif->rtype->size, sizeof (UINT64)); ++ memcpy (rvalue, get_x_addr (&context, 0), size); ++ } ++ else ++ { ++ FFI_ASSERT (0); ++ } ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++ } ++ else ++ { ++ memcpy (get_x_addr (&context, 8), &rvalue, sizeof (UINT64)); ++ ffi_call_SYSV (aarch64_prep_args, &context, &ecif, ++ stack_bytes, fn); ++ } ++ break; ++ } ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++} ++ ++static unsigned char trampoline [] = ++{ 0x70, 0x00, 0x00, 0x58, /* ldr x16, 1f */ ++ 0x91, 0x00, 0x00, 0x10, /* adr x17, 2f */ ++ 0x00, 0x02, 0x1f, 0xd6 /* br x16 */ ++}; ++ ++/* Build a trampoline. */ ++ ++#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX,FLAGS) \ ++ ({unsigned char *__tramp = (unsigned char*)(TRAMP); \ ++ UINT64 __fun = (UINT64)(FUN); \ ++ UINT64 __ctx = (UINT64)(CTX); \ ++ UINT64 __flags = (UINT64)(FLAGS); \ ++ memcpy (__tramp, trampoline, sizeof (trampoline)); \ ++ memcpy (__tramp + 12, &__fun, sizeof (__fun)); \ ++ memcpy (__tramp + 20, &__ctx, sizeof (__ctx)); \ ++ memcpy (__tramp + 28, &__flags, sizeof (__flags)); \ ++ ffi_clear_cache(__tramp, __tramp + FFI_TRAMPOLINE_SIZE); \ ++ }) ++ ++ffi_status ++ffi_prep_closure_loc (ffi_closure* closure, ++ ffi_cif* cif, ++ void (*fun)(ffi_cif*,void*,void**,void*), ++ void *user_data, ++ void *codeloc) ++{ ++ if (cif->abi != FFI_SYSV) ++ return FFI_BAD_ABI; ++ ++ FFI_INIT_TRAMPOLINE (&closure->tramp[0], &ffi_closure_SYSV, codeloc, ++ cif->aarch64_flags); ++ ++ closure->cif = cif; ++ closure->user_data = user_data; ++ closure->fun = fun; ++ ++ return FFI_OK; ++} ++ ++/* Primary handler to setup and invoke a function within a closure. ++ ++ A closure when invoked enters via the assembler wrapper ++ ffi_closure_SYSV(). The wrapper allocates a call context on the ++ stack, saves the interesting registers (from the perspective of ++ the calling convention) into the context then passes control to ++ ffi_closure_SYSV_inner() passing the saved context and a pointer to ++ the stack at the point ffi_closure_SYSV() was invoked. ++ ++ On the return path the assembler wrapper will reload call context ++ registers. ++ ++ ffi_closure_SYSV_inner() marshalls the call context into ffi value ++ descriptors, invokes the wrapped function, then marshalls the return ++ value back into the call context. */ ++ ++void FFI_HIDDEN ++ffi_closure_SYSV_inner (ffi_closure *closure, struct call_context *context, ++ void *stack) ++{ ++ ffi_cif *cif = closure->cif; ++ void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); ++ void *rvalue = NULL; ++ int i; ++ struct arg_state state; ++ ++ arg_init (&state, ALIGN(cif->bytes, 16)); ++ ++ for (i = 0; i < cif->nargs; i++) ++ { ++ ffi_type *ty = cif->arg_types[i]; ++ ++ switch (ty->type) ++ { ++ case FFI_TYPE_VOID: ++ FFI_ASSERT (0); ++ break; ++ ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_FLOAT: ++ case FFI_TYPE_DOUBLE: ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ avalue[i] = allocate_to_register_or_stack (context, stack, ++ &state, ty->type); ++ break; ++#endif ++ ++ case FFI_TYPE_STRUCT: ++ if (is_hfa (ty)) ++ { ++ unsigned n = element_count (ty); ++ if (available_v (&state) < n) ++ { ++ state.nsrn = N_V_ARG_REG; ++ avalue[i] = allocate_to_stack (&state, stack, ty->alignment, ++ ty->size); ++ } ++ else ++ { ++ switch (get_homogeneous_type (ty)) ++ { ++ case FFI_TYPE_FLOAT: ++ { ++ /* Eeek! We need a pointer to the structure, ++ however the homogeneous float elements are ++ being passed in individual S registers, ++ therefore the structure is not represented as ++ a contiguous sequence of bytes in our saved ++ register context. We need to fake up a copy ++ of the structure laid out in memory ++ correctly. The fake can be tossed once the ++ closure function has returned hence alloca() ++ is sufficient. */ ++ int j; ++ UINT32 *p = avalue[i] = alloca (ty->size); ++ for (j = 0; j < element_count (ty); j++) ++ memcpy (&p[j], ++ allocate_to_s (context, &state), ++ sizeof (*p)); ++ break; ++ } ++ ++ case FFI_TYPE_DOUBLE: ++ { ++ /* Eeek! We need a pointer to the structure, ++ however the homogeneous float elements are ++ being passed in individual S registers, ++ therefore the structure is not represented as ++ a contiguous sequence of bytes in our saved ++ register context. We need to fake up a copy ++ of the structure laid out in memory ++ correctly. The fake can be tossed once the ++ closure function has returned hence alloca() ++ is sufficient. */ ++ int j; ++ UINT64 *p = avalue[i] = alloca (ty->size); ++ for (j = 0; j < element_count (ty); j++) ++ memcpy (&p[j], ++ allocate_to_d (context, &state), ++ sizeof (*p)); ++ break; ++ } ++ ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ memcpy (&avalue[i], ++ allocate_to_v (context, &state), ++ sizeof (*avalue)); ++ break; ++#endif ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++ } ++ } ++ else if (ty->size > 16) ++ { ++ /* Replace Composite type of size greater than 16 with a ++ pointer. */ ++ memcpy (&avalue[i], ++ allocate_to_register_or_stack (context, stack, ++ &state, FFI_TYPE_POINTER), ++ sizeof (avalue[i])); ++ } ++ else if (available_x (&state) >= (ty->size + 7) / 8) ++ { ++ avalue[i] = get_x_addr (context, state.ngrn); ++ state.ngrn += (ty->size + 7) / 8; ++ } ++ else ++ { ++ state.ngrn = N_X_ARG_REG; ++ ++ avalue[i] = allocate_to_stack (&state, stack, ty->alignment, ++ ty->size); ++ } ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++ } ++ ++ /* Figure out where the return value will be passed, either in ++ registers or in a memory block allocated by the caller and passed ++ in x8. */ ++ ++ if (is_register_candidate (cif->rtype)) ++ { ++ /* Register candidates are *always* returned in registers. */ ++ ++ /* Allocate a scratchpad for the return value, we will let the ++ callee scrible the result into the scratch pad then move the ++ contents into the appropriate return value location for the ++ call convention. */ ++ rvalue = alloca (cif->rtype->size); ++ (closure->fun) (cif, rvalue, avalue, closure->user_data); ++ ++ /* Copy the return value into the call context so that it is returned ++ as expected to our caller. */ ++ switch (cif->rtype->type) ++ { ++ case FFI_TYPE_VOID: ++ break; ++ ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_FLOAT: ++ case FFI_TYPE_DOUBLE: ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++#endif ++ { ++ void *addr = get_basic_type_addr (cif->rtype->type, context, 0); ++ copy_basic_type (addr, rvalue, cif->rtype->type); ++ break; ++ } ++ case FFI_TYPE_STRUCT: ++ if (is_hfa (cif->rtype)) ++ { ++ int j; ++ unsigned short type = get_homogeneous_type (cif->rtype); ++ unsigned elems = element_count (cif->rtype); ++ for (j = 0; j < elems; j++) ++ { ++ void *reg = get_basic_type_addr (type, context, j); ++ copy_basic_type (reg, rvalue, type); ++ rvalue += get_basic_type_size (type); ++ } ++ } ++ else if ((cif->rtype->size + 7) / 8 < N_X_ARG_REG) ++ { ++ size_t size = ALIGN (cif->rtype->size, sizeof (UINT64)) ; ++ memcpy (get_x_addr (context, 0), rvalue, size); ++ } ++ else ++ { ++ FFI_ASSERT (0); ++ } ++ break; ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++ } ++ else ++ { ++ memcpy (&rvalue, get_x_addr (context, 8), sizeof (UINT64)); ++ (closure->fun) (cif, rvalue, avalue, closure->user_data); ++ } ++} ++ +diff -ruN Python-2.7.3.orig/Modules/_ctypes/libffi/src/aarch64/ffitarget.h Python-2.7.3/Modules/_ctypes/libffi/src/aarch64/ffitarget.h +--- Python-2.7.3.orig/Modules/_ctypes/libffi/src/aarch64/ffitarget.h 1970-01-01 01:00:00.000000000 +0100 ++++ Python-2.7.3/Modules/_ctypes/libffi/src/aarch64/ffitarget.h 2014-04-25 19:45:13.000000000 +0200 +@@ -0,0 +1,63 @@ ++/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++``Software''), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#ifndef LIBFFI_TARGET_H ++#define LIBFFI_TARGET_H ++ ++#ifndef LIBFFI_H ++#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." ++#endif ++ ++#ifndef LIBFFI_ASM ++typedef unsigned long ffi_arg; ++typedef signed long ffi_sarg; ++ ++typedef enum ffi_abi ++ { ++ FFI_FIRST_ABI = 0, ++ FFI_SYSV, ++ FFI_LAST_ABI, ++ FFI_DEFAULT_ABI = FFI_SYSV ++ } ffi_abi; ++#endif ++ ++/* ---- Definitions for closures ----------------------------------------- */ ++ ++#define FFI_CLOSURES 1 ++#define FFI_TRAMPOLINE_SIZE 36 ++#define FFI_NATIVE_RAW_API 0 ++ ++/* ---- Internal ---- */ ++ ++#if defined (__APPLE__) ++#define FFI_TARGET_SPECIFIC_VARIADIC ++#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_flags; unsigned aarch64_nfixedargs ++#else ++#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_flags ++#endif ++ ++#define AARCH64_FFI_WITH_V_BIT 0 ++ ++#define AARCH64_N_XREG 32 ++#define AARCH64_N_VREG 32 ++#define AARCH64_CALL_CONTEXT_SIZE (AARCH64_N_XREG * 8 + AARCH64_N_VREG * 16) ++ ++#endif +diff -ruN Python-2.7.3.orig/Modules/_ctypes/libffi/src/aarch64/sysv.S Python-2.7.3/Modules/_ctypes/libffi/src/aarch64/sysv.S +--- Python-2.7.3.orig/Modules/_ctypes/libffi/src/aarch64/sysv.S 1970-01-01 01:00:00.000000000 +0100 ++++ Python-2.7.3/Modules/_ctypes/libffi/src/aarch64/sysv.S 2014-04-25 19:45:13.000000000 +0200 +@@ -0,0 +1,333 @@ ++/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++``Software''), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#define LIBFFI_ASM ++#include ++#include ++ ++#ifdef HAVE_MACHINE_ASM_H ++#include ++#else ++#ifdef __USER_LABEL_PREFIX__ ++#define CONCAT1(a, b) CONCAT2(a, b) ++#define CONCAT2(a, b) a ## b ++ ++/* Use the right prefix for global labels. */ ++#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) ++#else ++#define CNAME(x) x ++#endif ++#endif ++ ++#define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off ++#define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off ++#define cfi_restore(reg) .cfi_restore reg ++#define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg ++ ++ .text ++ .globl CNAME(ffi_call_SYSV) ++#ifdef __ELF__ ++ .type CNAME(ffi_call_SYSV), #function ++#endif ++#ifdef __APPLE__ ++ .align 2 ++#endif ++ ++/* ffi_call_SYSV() ++ ++ Create a stack frame, setup an argument context, call the callee ++ and extract the result. ++ ++ The maximum required argument stack size is provided, ++ ffi_call_SYSV() allocates that stack space then calls the ++ prepare_fn to populate register context and stack. The ++ argument passing registers are loaded from the register ++ context and the callee called, on return the register passing ++ register are saved back to the context. Our caller will ++ extract the return value from the final state of the saved ++ register context. ++ ++ Prototype: ++ ++ extern unsigned ++ ffi_call_SYSV (void (*)(struct call_context *context, unsigned char *, ++ extended_cif *), ++ struct call_context *context, ++ extended_cif *, ++ size_t required_stack_size, ++ void (*fn)(void)); ++ ++ Therefore on entry we have: ++ ++ x0 prepare_fn ++ x1 &context ++ x2 &ecif ++ x3 bytes ++ x4 fn ++ ++ This function uses the following stack frame layout: ++ ++ == ++ saved x30(lr) ++ x29(fp)-> saved x29(fp) ++ saved x24 ++ saved x23 ++ saved x22 ++ sp' -> saved x21 ++ ... ++ sp -> (constructed callee stack arguments) ++ == ++ ++ Voila! */ ++ ++#define ffi_call_SYSV_FS (8 * 4) ++ ++ .cfi_startproc ++CNAME(ffi_call_SYSV): ++ stp x29, x30, [sp, #-16]! ++ cfi_adjust_cfa_offset (16) ++ cfi_rel_offset (x29, 0) ++ cfi_rel_offset (x30, 8) ++ ++ mov x29, sp ++ cfi_def_cfa_register (x29) ++ sub sp, sp, #ffi_call_SYSV_FS ++ ++ stp x21, x22, [sp, #0] ++ cfi_rel_offset (x21, 0 - ffi_call_SYSV_FS) ++ cfi_rel_offset (x22, 8 - ffi_call_SYSV_FS) ++ ++ stp x23, x24, [sp, #16] ++ cfi_rel_offset (x23, 16 - ffi_call_SYSV_FS) ++ cfi_rel_offset (x24, 24 - ffi_call_SYSV_FS) ++ ++ mov x21, x1 ++ mov x22, x2 ++ mov x24, x4 ++ ++ /* Allocate the stack space for the actual arguments, many ++ arguments will be passed in registers, but we assume ++ worst case and allocate sufficient stack for ALL of ++ the arguments. */ ++ sub sp, sp, x3 ++ ++ /* unsigned (*prepare_fn) (struct call_context *context, ++ unsigned char *stack, extended_cif *ecif); ++ */ ++ mov x23, x0 ++ mov x0, x1 ++ mov x1, sp ++ /* x2 already in place */ ++ blr x23 ++ ++ /* Preserve the flags returned. */ ++ mov x23, x0 ++ ++ /* Figure out if we should touch the vector registers. */ ++ tbz x23, #AARCH64_FFI_WITH_V_BIT, 1f ++ ++ /* Load the vector argument passing registers. */ ++ ldp q0, q1, [x21, #8*32 + 0] ++ ldp q2, q3, [x21, #8*32 + 32] ++ ldp q4, q5, [x21, #8*32 + 64] ++ ldp q6, q7, [x21, #8*32 + 96] ++1: ++ /* Load the core argument passing registers. */ ++ ldp x0, x1, [x21, #0] ++ ldp x2, x3, [x21, #16] ++ ldp x4, x5, [x21, #32] ++ ldp x6, x7, [x21, #48] ++ ++ /* Don't forget x8 which may be holding the address of a return buffer. ++ */ ++ ldr x8, [x21, #8*8] ++ ++ blr x24 ++ ++ /* Save the core argument passing registers. */ ++ stp x0, x1, [x21, #0] ++ stp x2, x3, [x21, #16] ++ stp x4, x5, [x21, #32] ++ stp x6, x7, [x21, #48] ++ ++ /* Note nothing useful ever comes back in x8! */ ++ ++ /* Figure out if we should touch the vector registers. */ ++ tbz x23, #AARCH64_FFI_WITH_V_BIT, 1f ++ ++ /* Save the vector argument passing registers. */ ++ stp q0, q1, [x21, #8*32 + 0] ++ stp q2, q3, [x21, #8*32 + 32] ++ stp q4, q5, [x21, #8*32 + 64] ++ stp q6, q7, [x21, #8*32 + 96] ++1: ++ /* All done, unwind our stack frame. */ ++ ldp x21, x22, [x29, # - ffi_call_SYSV_FS] ++ cfi_restore (x21) ++ cfi_restore (x22) ++ ++ ldp x23, x24, [x29, # - ffi_call_SYSV_FS + 16] ++ cfi_restore (x23) ++ cfi_restore (x24) ++ ++ mov sp, x29 ++ cfi_def_cfa_register (sp) ++ ++ ldp x29, x30, [sp], #16 ++ cfi_adjust_cfa_offset (-16) ++ cfi_restore (x29) ++ cfi_restore (x30) ++ ++ ret ++ ++ .cfi_endproc ++#ifdef __ELF__ ++ .size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV) ++#endif ++ ++#define ffi_closure_SYSV_FS (8 * 2 + AARCH64_CALL_CONTEXT_SIZE) ++ ++/* ffi_closure_SYSV ++ ++ Closure invocation glue. This is the low level code invoked directly by ++ the closure trampoline to setup and call a closure. ++ ++ On entry x17 points to a struct trampoline_data, x16 has been clobbered ++ all other registers are preserved. ++ ++ We allocate a call context and save the argument passing registers, ++ then invoked the generic C ffi_closure_SYSV_inner() function to do all ++ the real work, on return we load the result passing registers back from ++ the call context. ++ ++ On entry ++ ++ extern void ++ ffi_closure_SYSV (struct trampoline_data *); ++ ++ struct trampoline_data ++ { ++ UINT64 *ffi_closure; ++ UINT64 flags; ++ }; ++ ++ This function uses the following stack frame layout: ++ ++ == ++ saved x30(lr) ++ x29(fp)-> saved x29(fp) ++ saved x22 ++ saved x21 ++ ... ++ sp -> call_context ++ == ++ ++ Voila! */ ++ ++ .text ++ .globl CNAME(ffi_closure_SYSV) ++#ifdef __APPLE__ ++ .align 2 ++#endif ++ .cfi_startproc ++CNAME(ffi_closure_SYSV): ++ stp x29, x30, [sp, #-16]! ++ cfi_adjust_cfa_offset (16) ++ cfi_rel_offset (x29, 0) ++ cfi_rel_offset (x30, 8) ++ ++ mov x29, sp ++ cfi_def_cfa_register (x29) ++ ++ sub sp, sp, #ffi_closure_SYSV_FS ++ ++ stp x21, x22, [x29, #-16] ++ cfi_rel_offset (x21, -16) ++ cfi_rel_offset (x22, -8) ++ ++ /* Load x21 with &call_context. */ ++ mov x21, sp ++ /* Preserve our struct trampoline_data * */ ++ mov x22, x17 ++ ++ /* Save the rest of the argument passing registers. */ ++ stp x0, x1, [x21, #0] ++ stp x2, x3, [x21, #16] ++ stp x4, x5, [x21, #32] ++ stp x6, x7, [x21, #48] ++ /* Don't forget we may have been given a result scratch pad address. ++ */ ++ str x8, [x21, #64] ++ ++ /* Figure out if we should touch the vector registers. */ ++ ldr x0, [x22, #8] ++ tbz x0, #AARCH64_FFI_WITH_V_BIT, 1f ++ ++ /* Save the argument passing vector registers. */ ++ stp q0, q1, [x21, #8*32 + 0] ++ stp q2, q3, [x21, #8*32 + 32] ++ stp q4, q5, [x21, #8*32 + 64] ++ stp q6, q7, [x21, #8*32 + 96] ++1: ++ /* Load &ffi_closure.. */ ++ ldr x0, [x22, #0] ++ mov x1, x21 ++ /* Compute the location of the stack at the point that the ++ trampoline was called. */ ++ add x2, x29, #16 ++ ++ bl CNAME(ffi_closure_SYSV_inner) ++ ++ /* Figure out if we should touch the vector registers. */ ++ ldr x0, [x22, #8] ++ tbz x0, #AARCH64_FFI_WITH_V_BIT, 1f ++ ++ /* Load the result passing vector registers. */ ++ ldp q0, q1, [x21, #8*32 + 0] ++ ldp q2, q3, [x21, #8*32 + 32] ++ ldp q4, q5, [x21, #8*32 + 64] ++ ldp q6, q7, [x21, #8*32 + 96] ++1: ++ /* Load the result passing core registers. */ ++ ldp x0, x1, [x21, #0] ++ ldp x2, x3, [x21, #16] ++ ldp x4, x5, [x21, #32] ++ ldp x6, x7, [x21, #48] ++ /* Note nothing useful is returned in x8. */ ++ ++ /* We are done, unwind our frame. */ ++ ldp x21, x22, [x29, #-16] ++ cfi_restore (x21) ++ cfi_restore (x22) ++ ++ mov sp, x29 ++ cfi_def_cfa_register (sp) ++ ++ ldp x29, x30, [sp], #16 ++ cfi_adjust_cfa_offset (-16) ++ cfi_restore (x29) ++ cfi_restore (x30) ++ ++ ret ++ .cfi_endproc ++#ifdef __ELF__ ++ .size CNAME(ffi_closure_SYSV), .-CNAME(ffi_closure_SYSV) ++#endif diff --git a/meta/recipes-devtools/python/python/multilib.patch b/meta/recipes-devtools/python/python/multilib.patch new file mode 100644 index 0000000000..df470f7c09 --- /dev/null +++ b/meta/recipes-devtools/python/python/multilib.patch @@ -0,0 +1,257 @@ +commit 248279e54467a8cd5cde98fc124d1d1384703513 +Author: Yu Ke +Date: Tue Jun 28 21:21:29 2011 +0800 + + SUSE patch for the lib64 issue + + see detail in http://bugs.python.org/issue1294959 + + also rebased a bit for Yocto python 2.6.6 + + Picked-by: Yu Ke + +2011/09/29 +Rebased for python 2.7.2 + +Upstream-Status: Inappropriate [configuration] + +Signed-Off-By: Nitin A Kamble + +Index: Python-2.7.2/Include/pythonrun.h +=================================================================== +--- Python-2.7.2.orig/Include/pythonrun.h ++++ Python-2.7.2/Include/pythonrun.h +@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void); + /* In their own files */ + PyAPI_FUNC(const char *) Py_GetVersion(void); + PyAPI_FUNC(const char *) Py_GetPlatform(void); ++PyAPI_FUNC(const char *) Py_GetLib(void); + PyAPI_FUNC(const char *) Py_GetCopyright(void); + PyAPI_FUNC(const char *) Py_GetCompiler(void); + PyAPI_FUNC(const char *) Py_GetBuildInfo(void); +Index: Python-2.7.2/Lib/distutils/command/install.py +=================================================================== +--- Python-2.7.2.orig/Lib/distutils/command/install.py ++++ Python-2.7.2/Lib/distutils/command/install.py +@@ -22,6 +22,8 @@ from site import USER_BASE + from site import USER_SITE + + ++libname = sys.lib ++ + if sys.version < "2.2": + WINDOWS_SCHEME = { + 'purelib': '$base', +@@ -42,7 +44,7 @@ else: + 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/$dist_name', + 'scripts': '$base/bin', + 'data' : '$base', +Index: Python-2.7.2/Lib/distutils/sysconfig.py +=================================================================== +--- Python-2.7.2.orig/Lib/distutils/sysconfig.py ++++ Python-2.7.2/Lib/distutils/sysconfig.py +@@ -114,8 +114,11 @@ def get_python_lib(plat_specific=0, stan + prefix = plat_specific and EXEC_PREFIX or PREFIX + + if os.name == "posix": +- libpython = os.path.join(prefix, +- "lib", "python" + get_python_version()) ++ if plat_specific or standard_lib: ++ lib = sys.lib ++ else: ++ lib = "lib" ++ libpython = os.path.join(prefix, lib, "python" + get_python_version()) + if standard_lib: + return libpython + else: +Index: Python-2.7.2/Lib/pydoc.py +=================================================================== +--- Python-2.7.2.orig/Lib/pydoc.py ++++ Python-2.7.2/Lib/pydoc.py +@@ -352,7 +352,7 @@ class Doc: + + docloc = os.environ.get("PYTHONDOCS", + "http://docs.python.org/library") +- basedir = os.path.join(sys.exec_prefix, "lib", ++ basedir = os.path.join(sys.exec_prefix, sys.lib, + "python"+sys.version[0:3]) + if (isinstance(object, type(os)) and + (object.__name__ in ('errno', 'exceptions', 'gc', 'imp', +Index: Python-2.7.2/Lib/site.py +=================================================================== +--- Python-2.7.2.orig/Lib/site.py ++++ Python-2.7.2/Lib/site.py +@@ -300,13 +300,19 @@ def getsitepackages(): + if sys.platform in ('os2emx', 'riscos'): + sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) + elif os.sep == '/': +- sitepackages.append(os.path.join(prefix, "lib", ++ sitepackages.append(os.path.join(prefix, sys.lib, + "python" + sys.version[:3], + "site-packages")) +- sitepackages.append(os.path.join(prefix, "lib", "site-python")) ++ if sys.lib != "lib": ++ sitepackages.append(os.path.join(prefix, "lib", ++ "python" + sys.version[:3], ++ "site-packages")) ++ sitepackages.append(os.path.join(prefix, sys.lib, "site-python")) ++ if sys.lib != "lib": ++ sitepackages.append(os.path.join(prefix, "lib", "site-python")) + 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-2.7.2/Lib/test/test_dl.py +=================================================================== +--- Python-2.7.2.orig/Lib/test/test_dl.py ++++ Python-2.7.2/Lib/test/test_dl.py +@@ -5,10 +5,11 @@ + import unittest + from test.test_support import verbose, import_module + dl = import_module('dl', deprecated=True) ++import sys + + sharedlibs = [ +- ('/usr/lib/libc.so', 'getpid'), +- ('/lib/libc.so.6', 'getpid'), ++ ('/usr/'+sys.lib+'/libc.so', 'getpid'), ++ ('/'+sys.lib+'/libc.so.6', 'getpid'), + ('/usr/bin/cygwin1.dll', 'getpid'), + ('/usr/lib/libc.dylib', 'getpid'), + ] +Index: Python-2.7.2/Lib/trace.py +=================================================================== +--- Python-2.7.2.orig/Lib/trace.py ++++ Python-2.7.2/Lib/trace.py +@@ -762,10 +762,10 @@ def main(argv=None): + # should I also call expanduser? (after all, could use $HOME) + + s = s.replace("$prefix", +- os.path.join(sys.prefix, "lib", ++ os.path.join(sys.prefix, sys.lib, + "python" + sys.version[:3])) + s = s.replace("$exec_prefix", +- os.path.join(sys.exec_prefix, "lib", ++ os.path.join(sys.exec_prefix, sys.lib, + "python" + sys.version[:3])) + s = os.path.normpath(s) + ignore_dirs.append(s) +Index: Python-2.7.2/Makefile.pre.in +=================================================================== +--- Python-2.7.2.orig/Makefile.pre.in ++++ Python-2.7.2/Makefile.pre.in +@@ -81,6 +81,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG + + # Machine-dependent subdirectories + MACHDEP= @MACHDEP@ ++LIB= @LIB@ + + # Install prefix for architecture-independent files + prefix= @prefix@ +@@ -97,7 +98,7 @@ LIBDIR= @libdir@ + MANDIR= @mandir@ + INCLUDEDIR= @includedir@ + CONFINCLUDEDIR= $(exec_prefix)/include +-SCRIPTDIR= $(prefix)/lib ++SCRIPTDIR= $(prefix)/@LIB@ + + # Detailed destination directories + BINLIBDEST= $(LIBDIR)/python$(VERSION) +@@ -533,6 +534,7 @@ Modules/getpath.o: $(srcdir)/Modules/get + -DEXEC_PREFIX='"$(exec_prefix)"' \ + -DVERSION='"$(VERSION)"' \ + -DVPATH='"$(VPATH)"' \ ++ -DLIB='"$(LIB)"' \ + -o $@ $(srcdir)/Modules/getpath.c + + Modules/python.o: $(srcdir)/Modules/python.c +@@ -567,7 +569,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES) + Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) + + Python/getplatform.o: $(srcdir)/Python/getplatform.c +- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c ++ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c + + Python/importdl.o: $(srcdir)/Python/importdl.c + $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c +Index: Python-2.7.2/Modules/getpath.c +=================================================================== +--- Python-2.7.2.orig/Modules/getpath.c ++++ Python-2.7.2/Modules/getpath.c +@@ -116,9 +116,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 +@@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1]; + static char exec_prefix[MAXPATHLEN+1]; + static char progpath[MAXPATHLEN+1]; + static char *module_search_path = NULL; +-static char lib_python[] = "lib/python" VERSION; ++static char lib_python[] = LIB_PYTHON; + + static void + reduce(char *dir) +Index: Python-2.7.2/Python/getplatform.c +=================================================================== +--- Python-2.7.2.orig/Python/getplatform.c ++++ Python-2.7.2/Python/getplatform.c +@@ -10,3 +10,13 @@ Py_GetPlatform(void) + { + return PLATFORM; + } ++ ++#ifndef LIB ++#define LIB "lib" ++#endif ++ ++const char * ++Py_GetLib(void) ++{ ++ return LIB; ++} +Index: Python-2.7.2/Python/sysmodule.c +=================================================================== +--- Python-2.7.2.orig/Python/sysmodule.c ++++ Python-2.7.2/Python/sysmodule.c +@@ -1416,6 +1416,8 @@ _PySys_Init(void) + PyString_FromString(Py_GetCopyright())); + SET_SYS_FROM_STRING("platform", + PyString_FromString(Py_GetPlatform())); ++ SET_SYS_FROM_STRING("lib", ++ PyString_FromString(Py_GetLib())); + SET_SYS_FROM_STRING("executable", + PyString_FromString(Py_GetProgramFullPath())); + SET_SYS_FROM_STRING("prefix", +Index: Python-2.7.2/configure.in +=================================================================== +--- Python-2.7.2.orig/configure.in ++++ Python-2.7.2/configure.in +@@ -629,6 +629,10 @@ SunOS*) + ;; + esac + ++AC_SUBST(LIB) ++AC_MSG_CHECKING(LIB) ++LIB=`basename ${libdir}` ++AC_MSG_RESULT($LIB) + + AC_SUBST(LIBRARY) + AC_MSG_CHECKING(LIBRARY) diff --git a/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch b/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch new file mode 100644 index 0000000000..951cb466ff --- /dev/null +++ b/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch @@ -0,0 +1,19 @@ +When using make -j with the 'install' target, it's possible for altbininstall +(which normally creates BINDIR) and libainstall (which doesn't, though it +installs python-config there) to race, resulting in a failure due to +attempting to install python-config into a nonexistent BINDIR. Ensure it also +exists in the libainstall target. + +Upstream-Status: Pending + +--- Python-2.7.3.orig/Makefile.pre.in ++++ Python-2.7.3/Makefile.pre.in +@@ -1008,7 +1008,7 @@ LIBPL= $(LIBP)/config + LIBPC= $(LIBDIR)/pkgconfig + + libainstall: all python-config +- @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \ ++ @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC) $(BINDIR); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ + echo "Creating directory $$i"; \ diff --git a/meta/recipes-devtools/python/python/posix_close.patch b/meta/recipes-devtools/python/python/posix_close.patch new file mode 100644 index 0000000000..725531a240 --- /dev/null +++ b/meta/recipes-devtools/python/python/posix_close.patch @@ -0,0 +1,43 @@ +backport from http://bugs.python.org/issue20594 + +- Issue #20594: Avoid name clash with the libc function posix_close. + +Upstream-Status: Backport +Signed-off-by: Khem Raj + + +# HG changeset patch +# User Benjamin Peterson +# Date 1392131776 18000 +# Node ID 1d253360d5a6d8d987fb2480e26f4fcc2d730932 +# Parent 41e49f1c5bd8ff48a6c18804c958e82c659daab3 +avoid name clash with posix_close (closes #20594) + +diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -6581,8 +6581,12 @@ PyDoc_STRVAR(posix_close__doc__, + "close(fd)\n\n\ + Close a file descriptor (for low level IO)."); + +-static PyObject * +-posix_close(PyObject *self, PyObject *args) ++/* ++The underscore at end of function name avoids a name clash with the libc ++function posix_close. ++*/ ++static PyObject * ++posix_close_(PyObject *self, PyObject *args) + { + int fd, res; + if (!PyArg_ParseTuple(args, "i:close", &fd)) +@@ -8960,7 +8964,7 @@ static PyMethodDef posix_methods[] = { + {"tcsetpgrp", posix_tcsetpgrp, METH_VARARGS, posix_tcsetpgrp__doc__}, + #endif /* HAVE_TCSETPGRP */ + {"open", posix_open, METH_VARARGS, posix_open__doc__}, +- {"close", posix_close, METH_VARARGS, posix_close__doc__}, ++ {"close", posix_close_, METH_VARARGS, posix_close__doc__}, + {"closerange", posix_closerange, METH_VARARGS, posix_closerange__doc__}, + {"dup", posix_dup, METH_VARARGS, posix_dup__doc__}, + {"dup2", posix_dup2, METH_VARARGS, posix_dup2__doc__}, + diff --git a/meta/recipes-devtools/python/python/pypirc-secure.patch b/meta/recipes-devtools/python/python/pypirc-secure.patch new file mode 100644 index 0000000000..8e2df677b6 --- /dev/null +++ b/meta/recipes-devtools/python/python/pypirc-secure.patch @@ -0,0 +1,35 @@ +# HG changeset patch +# User Philip Jenvey +# Date 1322701507 28800 +# Branch 2.7 +# Node ID e7c20a8476a0e2ca18f8040864cbc400818d8f24 +# Parent 3ecddf168f1f554a17a047384fe0b02f2d688277 +create the .pypirc securely + +Upstream-Status: Backport + +Signed-off-by: Saul Wold + + +diff -r 3ecddf168f1f -r e7c20a8476a0 Lib/distutils/config.py +--- a/Lib/distutils/config.py Tue Nov 29 00:53:09 2011 +0100 ++++ b/Lib/distutils/config.py Wed Nov 30 17:05:07 2011 -0800 +@@ -42,16 +42,8 @@ + def _store_pypirc(self, username, password): + """Creates a default .pypirc file.""" + rc = self._get_rc_file() +- f = open(rc, 'w') +- try: +- f.write(DEFAULT_PYPIRC % (username, password)) +- finally: +- f.close() +- try: +- os.chmod(rc, 0600) +- except OSError: +- # should do something better here +- pass ++ with os.fdopen(os.open(rc, os.O_CREAT | os.O_WRONLY, 0600), 'w') as fp: ++ fp.write(DEFAULT_PYPIRC % (username, password)) + + def _read_pypirc(self): + """Reads the .pypirc file.""" diff --git a/meta/recipes-devtools/python/python/python-2.7.3-CVE-2012-2135.patch b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2012-2135.patch new file mode 100644 index 0000000000..3afdbc0f6e --- /dev/null +++ b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2012-2135.patch @@ -0,0 +1,73 @@ +Upstream-Status: Backport + +Reference:http://bugs.python.org/issue14579 + +The utf-16 decoder in Python 3.1 through 3.3 does not update the +aligned_end variable after calling the unicode_decode_call_errorhandler +function, which allows remote attackers to obtain sensitive information +(process memory) or cause a denial of service (memory corruption and crash) +via unspecified vectors. + +http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-2135 + +diff -urpN a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py +--- a/Lib/test/test_codecs.py ++++ b/Lib/test/test_codecs.py +@@ -495,8 +495,21 @@ class UTF16LETest(ReadTest): + ) + + def test_errors(self): +- self.assertRaises(UnicodeDecodeError, codecs.utf_16_le_decode, "\xff", "strict", True) +- ++ tests = [ ++ (b'\xff', u'\ufffd'), ++ (b'A\x00Z', u'A\ufffd'), ++ (b'A\x00B\x00C\x00D\x00Z', u'ABCD\ufffd'), ++ (b'\x00\xd8', u'\ufffd'), ++ (b'\x00\xd8A', u'\ufffd'), ++ (b'\x00\xd8A\x00', u'\ufffdA'), ++ (b'\x00\xdcA\x00', u'\ufffdA'), ++ ] ++ for raw, expected in tests: ++ print('*****', raw, expected) ++ self.assertRaises(UnicodeDecodeError, codecs.utf_16_le_decode, ++ raw, 'strict', True) ++ self.assertEqual(raw.decode('utf-16le', 'replace'), expected) ++ + class UTF16BETest(ReadTest): + encoding = "utf-16-be" + +@@ -516,7 +529,20 @@ class UTF16BETest(ReadTest): + ) + + def test_errors(self): +- self.assertRaises(UnicodeDecodeError, codecs.utf_16_be_decode, "\xff", "strict", True) ++ tests = [ ++ (b'\xff', u'\ufffd'), ++ (b'\x00A\xff', u'A\ufffd'), ++ (b'\x00A\x00B\x00C\x00DZ', u'ABCD\ufffd'), ++ (b'\xd8\x00', u'\ufffd'), ++ (b'\xd8\x00\xdc', u'\ufffd'), ++ (b'\xd8\x00\x00A', u'\ufffdA'), ++ (b'\xdc\x00\x00A', u'\ufffdA'), ++ ] ++ for raw, expected in tests: ++ print('*****', raw, expected) ++ self.assertRaises(UnicodeDecodeError, codecs.utf_16_be_decode, ++ raw, 'strict', True) ++ self.assertEqual(raw.decode('utf-16be', 'replace'), expected) + + class UTF8Test(ReadTest): + encoding = "utf-8" +diff -urpN a/Objects/unicodeobject.c b/Objects/unicodeobject.c +--- a/Objects/unicodeobject.c 2013-03-04 11:34:34.000000000 +0800 ++++ b/Objects/unicodeobject.c 2013-03-04 11:36:01.000000000 +0800 +@@ -2564,7 +2564,7 @@ PyUnicode_DecodeUTF16Stateful(const char + } + + /* UTF-16 code pair: */ +- if (q >= e) { ++ if (e - q < 2) { + errmsg = "unexpected end of data"; + startinpos = (((const char *)q)-2)-starts; + endinpos = ((const char *)e)-starts; diff --git a/meta/recipes-devtools/python/python/python-2.7.3-CVE-2013-1752-smtplib-fix.patch b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2013-1752-smtplib-fix.patch new file mode 100644 index 0000000000..f34ff40ea5 --- /dev/null +++ b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2013-1752-smtplib-fix.patch @@ -0,0 +1,101 @@ +Upstream-Status: Backport + +Reference: http://bugs.python.org/issue16042 + +CVE-2013-1752: smtplib: Limit amount of data read by limiting the +call to readline(). Original patch by Christian Heimes + +Signed-off-by: Maxin B. John +--- +diff -Naur Python-2.7.3-orig/Lib/smtplib.py Python-2.7.3/Lib/smtplib.py +--- Python-2.7.3-orig/Lib/smtplib.py 2012-04-10 01:07:31.000000000 +0200 ++++ Python-2.7.3/Lib/smtplib.py 2014-02-27 14:15:24.444198465 +0100 +@@ -57,6 +57,7 @@ + SMTP_PORT = 25 + SMTP_SSL_PORT = 465 + CRLF = "\r\n" ++_MAXLINE = 8192 # more than 8 times larger than RFC 821, 4.5.3 + + OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I) + +@@ -179,10 +180,14 @@ + def __init__(self, sslobj): + self.sslobj = sslobj + +- def readline(self): ++ def readline(self, size=-1): ++ if size < 0: ++ size = None + str = "" + chr = None + while chr != "\n": ++ if size is not None and len(str) >= size: ++ break + chr = self.sslobj.read(1) + if not chr: + break +@@ -351,7 +356,7 @@ + self.file = self.sock.makefile('rb') + while 1: + try: +- line = self.file.readline() ++ line = self.file.readline(_MAXLINE + 1) + except socket.error as e: + self.close() + raise SMTPServerDisconnected("Connection unexpectedly closed: " +@@ -361,6 +366,8 @@ + raise SMTPServerDisconnected("Connection unexpectedly closed") + if self.debuglevel > 0: + print>>stderr, 'reply:', repr(line) ++ if len(line) > _MAXLINE: ++ raise SMTPResponseException(500, "Line too long.") + resp.append(line[4:].strip()) + code = line[:3] + # Check that the error code is syntactically correct. +diff -Naur Python-2.7.3-orig/Lib/test/test_smtplib.py Python-2.7.3/Lib/test/test_smtplib.py +--- Python-2.7.3-orig/Lib/test/test_smtplib.py 2012-04-10 01:07:32.000000000 +0200 ++++ Python-2.7.3/Lib/test/test_smtplib.py 2014-02-27 14:15:24.448198293 +0100 +@@ -292,6 +292,33 @@ + HOST, self.port, 'localhost', 3) + + ++@unittest.skipUnless(threading, 'Threading required for this test.') ++class TooLongLineTests(unittest.TestCase): ++ respdata = '250 OK' + ('.' * smtplib._MAXLINE * 2) + '\n' ++ ++ def setUp(self): ++ self.old_stdout = sys.stdout ++ self.output = StringIO.StringIO() ++ sys.stdout = self.output ++ ++ self.evt = threading.Event() ++ self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ++ self.sock.settimeout(15) ++ self.port = test_support.bind_port(self.sock) ++ servargs = (self.evt, self.respdata, self.sock) ++ threading.Thread(target=server, args=servargs).start() ++ self.evt.wait() ++ self.evt.clear() ++ ++ def tearDown(self): ++ self.evt.wait() ++ sys.stdout = self.old_stdout ++ ++ def testLineTooLong(self): ++ self.assertRaises(smtplib.SMTPResponseException, smtplib.SMTP, ++ HOST, self.port, 'localhost', 3) ++ ++ + sim_users = {'Mr.A@somewhere.com':'John A', + 'Ms.B@somewhere.com':'Sally B', + 'Mrs.C@somewhereesle.com':'Ruth C', +@@ -511,7 +538,8 @@ + def test_main(verbose=None): + test_support.run_unittest(GeneralTests, DebuggingServerTests, + NonConnectingTests, +- BadHELOServerTests, SMTPSimTests) ++ BadHELOServerTests, SMTPSimTests, ++ TooLongLineTests) + + if __name__ == '__main__': + test_main() diff --git a/meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-1912.patch b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-1912.patch new file mode 100644 index 0000000000..02cc83d314 --- /dev/null +++ b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-1912.patch @@ -0,0 +1,26 @@ +Upstream-Status: Backport + +Reference: http://bugs.python.org/issue20246 + +CVE-2014-1912: Python buffer overflow in socket.recvfrom_into() +lets remote users execute arbitrary code.Original patch by Benjamin Peterson + +Signed-off-by: Maxin B. John +--- +diff -r 40fb60df4755 Modules/socketmodule.c +--- a/Modules/socketmodule.c Sun Jan 12 12:11:47 2014 +0200 ++++ b/Modules/socketmodule.c Mon Jan 13 16:36:35 2014 -0800 +@@ -2744,6 +2744,13 @@ + recvlen = buflen; + } + ++ /* Check if the buffer is large enough */ ++ if (buflen < recvlen) { ++ PyErr_SetString(PyExc_ValueError, ++ "buffer too small for requested bytes"); ++ goto error; ++ } ++ + readlen = sock_recvfrom_guts(s, buf.buf, recvlen, flags, &addr); + if (readlen < 0) { + /* Return an error */ diff --git a/meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-7185.patch b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-7185.patch new file mode 100644 index 0000000000..60ef145c7c --- /dev/null +++ b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-7185.patch @@ -0,0 +1,75 @@ +From 104eb318283dde5203aa6cf7384287bef181e308 Mon Sep 17 00:00:00 2001 +From: Wenzong Fan +Date: Wed, 12 Nov 2014 01:58:02 -0500 +Subject: [PATCH] python: fix CVE-2014-7185 + +Reference: http://bugs.python.org/issue21831 + +CVE-2014-7185: Integer overflow in bufferobject.c in Python before +2.7.8 allows context-dependent attackers to obtain sensitive +information from process memory via a large size and offset in a +"buffer" function. + +Upstream-Status: Backport + +Signed-off-by: Wenzong Fan +--- + Lib/test/test_buffer.py | 6 ++++++ + Misc/NEWS | 3 +++ + Objects/bufferobject.c | 2 +- + 3 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py +index 6bdc34d..3ac1f8c 100644 +--- a/Lib/test/test_buffer.py ++++ b/Lib/test/test_buffer.py +@@ -4,6 +4,7 @@ For now, tests just new or changed functionality. + + """ + ++import sys + import unittest + from test import test_support + +@@ -21,6 +22,11 @@ class BufferTests(unittest.TestCase): + self.assertEqual(b[start:stop:step], + s[start:stop:step]) + ++ def test_large_buffer_size_and_offset(self): ++ data = bytearray('hola mundo') ++ buf = buffer(data, sys.maxsize, sys.maxsize) ++ self.assertEqual(buf[:4096], "") ++ + + def test_main(): + with test_support.check_py3k_warnings(("buffer.. not supported", +diff --git a/Misc/NEWS b/Misc/NEWS +index e8778ad..77396c5 100644 +--- a/Misc/NEWS ++++ b/Misc/NEWS +@@ -1896,6 +1896,9 @@ What's New in Python 2.7 Release Candidate 1? + Core and Builtins + ----------------- + ++- Issue #21831: Avoid integer overflow when large sizes and offsets are given to ++ the buffer type. CVE-2014-7185. ++ + - Issue #8271: during the decoding of an invalid UTF-8 byte sequence, only the + start byte and the continuation byte(s) are now considered invalid, instead + of the number of bytes specified by the start byte. +diff --git a/Objects/bufferobject.c b/Objects/bufferobject.c +index c52f0bc..c542506 100644 +--- a/Objects/bufferobject.c ++++ b/Objects/bufferobject.c +@@ -88,7 +88,7 @@ get_buf(PyBufferObject *self, void **ptr, Py_ssize_t *size, + *size = count; + else + *size = self->b_size; +- if (offset + *size > count) ++ if (*size > count - offset) + *size = count - offset; + } + return 1; +-- +1.7.9.5 + diff --git a/meta/recipes-devtools/python/python/python-2.7.3-berkeley-db-5.3.patch b/meta/recipes-devtools/python/python/python-2.7.3-berkeley-db-5.3.patch new file mode 100644 index 0000000000..3df33368ec --- /dev/null +++ b/meta/recipes-devtools/python/python/python-2.7.3-berkeley-db-5.3.patch @@ -0,0 +1,1572 @@ +Upstream-Status: Inappropriate [not author] + +Fix to support db 5.3 for bsddb module in python 2.7.2 + +This patch is made from the db5.1.diff in +http://archive.ubuntu.com/ubuntu/pool/main/p/python2.7/python2.7_2.7.3-0ubuntu3.diff.gz + +Signed-off-by: Jackie Huang +--- + Lib/bsddb/__init__.py | 2 +- + Lib/bsddb/test/test_all.py | 5 +- + Lib/bsddb/test/test_dbenv.py | 29 +++- + Modules/_bsddb.c | 439 +++++++++++++++++++++++------------------- + Modules/bsddb.h | 20 +- + setup.py | 25 +++- + 6 files changed, 307 insertions(+), 213 deletions(-) + +diff --git a/Lib/bsddb/__init__.py b/Lib/bsddb/__init__.py +index ed4deea..1b1c388 100644 +--- a/Lib/bsddb/__init__.py ++++ b/Lib/bsddb/__init__.py +@@ -33,7 +33,7 @@ + #---------------------------------------------------------------------- + + +-"""Support for Berkeley DB 4.1 through 4.8 with a simple interface. ++"""Support for Berkeley DB 4.2 through 5.3 with a simple interface. + + For the full featured object oriented interface use the bsddb.db module + instead. It mirrors the Oracle Berkeley DB C API. +diff --git a/Lib/bsddb/test/test_all.py b/Lib/bsddb/test/test_all.py +index e9fe618..6a25f4a 100644 +--- a/Lib/bsddb/test/test_all.py ++++ b/Lib/bsddb/test/test_all.py +@@ -484,6 +484,8 @@ def print_versions(): + print '-=' * 38 + print db.DB_VERSION_STRING + print 'bsddb.db.version(): %s' % (db.version(), ) ++ if db.version() >= (5, 0) : ++ print 'bsddb.db.full_version(): %s' %repr(db.full_version()) + print 'bsddb.db.__version__: %s' % db.__version__ + print 'bsddb.db.cvsid: %s' % db.cvsid + +@@ -528,7 +530,8 @@ def get_new_database_path() : + + # This path can be overriden via "set_test_path_prefix()". + import os, os.path +-get_new_path.prefix=os.path.join(os.sep,"tmp","z-Berkeley_DB") ++get_new_path.prefix=os.path.join(os.environ.get("TMPDIR", ++ os.path.join(os.sep,"tmp")), "z-Berkeley_DB") + get_new_path.num=0 + + def get_test_path_prefix() : +diff --git a/Lib/bsddb/test/test_dbenv.py b/Lib/bsddb/test/test_dbenv.py +index 37281df..6ac1e54 100644 +--- a/Lib/bsddb/test/test_dbenv.py ++++ b/Lib/bsddb/test/test_dbenv.py +@@ -25,12 +25,31 @@ class DBEnv(unittest.TestCase): + test_support.rmtree(self.homeDir) + + class DBEnv_general(DBEnv) : ++ def test_get_open_flags(self) : ++ flags = db.DB_CREATE | db.DB_INIT_MPOOL ++ self.env.open(self.homeDir, flags) ++ self.assertEqual(flags, self.env.get_open_flags()) ++ ++ def test_get_open_flags2(self) : ++ flags = db.DB_CREATE | db.DB_INIT_MPOOL | \ ++ db.DB_INIT_LOCK | db.DB_THREAD ++ self.env.open(self.homeDir, flags) ++ self.assertEqual(flags, self.env.get_open_flags()) ++ + if db.version() >= (4, 7) : + def test_lk_partitions(self) : + for i in [10, 20, 40] : + self.env.set_lk_partitions(i) + self.assertEqual(i, self.env.get_lk_partitions()) + ++ def test_getset_intermediate_dir_mode(self) : ++ self.assertEqual(None, self.env.get_intermediate_dir_mode()) ++ for mode in ["rwx------", "rw-rw-rw-", "rw-r--r--"] : ++ self.env.set_intermediate_dir_mode(mode) ++ self.assertEqual(mode, self.env.get_intermediate_dir_mode()) ++ self.assertRaises(db.DBInvalidArgError, ++ self.env.set_intermediate_dir_mode, "abcde") ++ + if db.version() >= (4, 6) : + def test_thread(self) : + for i in [16, 100, 1000] : +@@ -115,7 +134,7 @@ class DBEnv_general(DBEnv) : + self.assertEqual(i, self.env.get_lk_max_lockers()) + + def test_lg_regionmax(self) : +- for i in [128, 256, 1024] : ++ for i in [128, 256, 1000] : + i = i*1024*1024 + self.env.set_lg_regionmax(i) + j = self.env.get_lg_regionmax() +@@ -172,8 +191,12 @@ class DBEnv_general(DBEnv) : + self.env.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL) + cachesize = (0, 2*1024*1024, 1) + self.assertRaises(db.DBInvalidArgError, +- self.env.set_cachesize, *cachesize) +- self.assertEqual(cachesize2, self.env.get_cachesize()) ++ self.env.set_cachesize, *cachesize) ++ cachesize3 = self.env.get_cachesize() ++ self.assertEqual(cachesize2[0], cachesize3[0]) ++ self.assertEqual(cachesize2[2], cachesize3[2]) ++ # In Berkeley DB 5.3, the cachesize can change when opening the Env ++ self.assertTrue(cachesize2[1] <= cachesize3[1]) + + def test_set_cachesize_dbenv_db(self) : + # You can not configure the cachesize using +diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c +index d2d12ff..e98e4bc 100644 +--- a/Modules/_bsddb.c ++++ b/Modules/_bsddb.c +@@ -187,8 +187,10 @@ static PyObject* DBOldVersionError; /* DB_OLD_VERSION */ + static PyObject* DBRunRecoveryError; /* DB_RUNRECOVERY */ + static PyObject* DBVerifyBadError; /* DB_VERIFY_BAD */ + static PyObject* DBNoServerError; /* DB_NOSERVER */ ++#if (DBVER < 52) + static PyObject* DBNoServerHomeError; /* DB_NOSERVER_HOME */ + static PyObject* DBNoServerIDError; /* DB_NOSERVER_ID */ ++#endif + static PyObject* DBPageNotFoundError; /* DB_PAGE_NOTFOUND */ + static PyObject* DBSecondaryBadError; /* DB_SECONDARY_BAD */ + +@@ -202,9 +204,7 @@ static PyObject* DBFileExistsError; /* EEXIST */ + static PyObject* DBNoSuchFileError; /* ENOENT */ + static PyObject* DBPermissionsError; /* EPERM */ + +-#if (DBVER >= 42) + static PyObject* DBRepHandleDeadError; /* DB_REP_HANDLE_DEAD */ +-#endif + #if (DBVER >= 44) + static PyObject* DBRepLockoutError; /* DB_REP_LOCKOUT */ + #endif +@@ -696,8 +696,10 @@ static int makeDBError(int err) + case DB_RUNRECOVERY: errObj = DBRunRecoveryError; break; + case DB_VERIFY_BAD: errObj = DBVerifyBadError; break; + case DB_NOSERVER: errObj = DBNoServerError; break; ++#if (DBVER < 52) + case DB_NOSERVER_HOME: errObj = DBNoServerHomeError; break; + case DB_NOSERVER_ID: errObj = DBNoServerIDError; break; ++#endif + case DB_PAGE_NOTFOUND: errObj = DBPageNotFoundError; break; + case DB_SECONDARY_BAD: errObj = DBSecondaryBadError; break; + case DB_BUFFER_SMALL: errObj = DBNoMemoryError; break; +@@ -715,9 +717,7 @@ static int makeDBError(int err) + case ENOENT: errObj = DBNoSuchFileError; break; + case EPERM : errObj = DBPermissionsError; break; + +-#if (DBVER >= 42) + case DB_REP_HANDLE_DEAD : errObj = DBRepHandleDeadError; break; +-#endif + #if (DBVER >= 44) + case DB_REP_LOCKOUT : errObj = DBRepLockoutError; break; + #endif +@@ -2132,7 +2132,7 @@ DB_get_size(DBObject* self, PyObject* args, PyObject* kwargs) + MYDB_BEGIN_ALLOW_THREADS; + err = self->db->get(self->db, txn, &key, &data, flags); + MYDB_END_ALLOW_THREADS; +- if (err == DB_BUFFER_SMALL) { ++ if ((err == DB_BUFFER_SMALL) || (err == 0)) { + retval = NUMBER_FromLong((long)data.size); + err = 0; + } +@@ -2385,9 +2385,7 @@ DB_open(DBObject* self, PyObject* args, PyObject* kwargs) + return NULL; + } + +-#if (DBVER >= 42) + self->db->get_flags(self->db, &self->setflags); +-#endif + + self->flags = flags; + +@@ -2539,6 +2537,37 @@ DB_get_priority(DBObject* self) + #endif + + static PyObject* ++DB_get_dbname(DBObject* self) ++{ ++ int err; ++ const char *filename, *dbname; ++ ++ CHECK_DB_NOT_CLOSED(self); ++ ++ MYDB_BEGIN_ALLOW_THREADS; ++ err = self->db->get_dbname(self->db, &filename, &dbname); ++ MYDB_END_ALLOW_THREADS; ++ RETURN_IF_ERR(); ++ /* If "dbname==NULL", it is correctly converted to "None" */ ++ return Py_BuildValue("(ss)", filename, dbname); ++} ++ ++static PyObject* ++DB_get_open_flags(DBObject* self) ++{ ++ int err; ++ unsigned int flags; ++ ++ CHECK_DB_NOT_CLOSED(self); ++ ++ MYDB_BEGIN_ALLOW_THREADS; ++ err = self->db->get_open_flags(self->db, &flags); ++ MYDB_END_ALLOW_THREADS; ++ RETURN_IF_ERR(); ++ return NUMBER_FromLong(flags); ++} ++ ++static PyObject* + DB_set_q_extentsize(DBObject* self, PyObject* args) + { + int err; +@@ -2555,7 +2584,6 @@ DB_set_q_extentsize(DBObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DB_get_q_extentsize(DBObject* self) + { +@@ -2570,7 +2598,6 @@ DB_get_q_extentsize(DBObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(extentsize); + } +-#endif + + static PyObject* + DB_set_bt_minkey(DBObject* self, PyObject* args) +@@ -2588,7 +2615,6 @@ DB_set_bt_minkey(DBObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DB_get_bt_minkey(DBObject* self) + { +@@ -2603,7 +2629,6 @@ DB_get_bt_minkey(DBObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(bt_minkey); + } +-#endif + + static int + _default_cmp(const DBT *leftKey, +@@ -2759,7 +2784,6 @@ DB_set_cachesize(DBObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DB_get_cachesize(DBObject* self) + { +@@ -2777,7 +2801,6 @@ DB_get_cachesize(DBObject* self) + + return Py_BuildValue("(iii)", gbytes, bytes, ncache); + } +-#endif + + static PyObject* + DB_set_flags(DBObject* self, PyObject* args) +@@ -2797,7 +2820,6 @@ DB_set_flags(DBObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DB_get_flags(DBObject* self) + { +@@ -2812,6 +2834,35 @@ DB_get_flags(DBObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(flags); + } ++ ++#if (DBVER >= 43) ++static PyObject* ++DB_get_transactional(DBObject* self) ++{ ++ int err; ++ ++ CHECK_DB_NOT_CLOSED(self); ++ ++ MYDB_BEGIN_ALLOW_THREADS; ++ err = self->db->get_transactional(self->db); ++ MYDB_END_ALLOW_THREADS; ++ ++ if(err == 0) { ++ Py_INCREF(Py_False); ++ return Py_False; ++ } else if(err == 1) { ++ Py_INCREF(Py_True); ++ return Py_True; ++ } ++ ++ /* ++ ** If we reach there, there was an error. The ++ ** "return" should be unreachable. ++ */ ++ RETURN_IF_ERR(); ++ assert(0); /* This coude SHOULD be unreachable */ ++ return NULL; ++} + #endif + + static PyObject* +@@ -2830,7 +2881,6 @@ DB_set_h_ffactor(DBObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DB_get_h_ffactor(DBObject* self) + { +@@ -2845,7 +2895,6 @@ DB_get_h_ffactor(DBObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(ffactor); + } +-#endif + + static PyObject* + DB_set_h_nelem(DBObject* self, PyObject* args) +@@ -2863,7 +2912,6 @@ DB_set_h_nelem(DBObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DB_get_h_nelem(DBObject* self) + { +@@ -2878,7 +2926,6 @@ DB_get_h_nelem(DBObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(nelem); + } +-#endif + + static PyObject* + DB_set_lorder(DBObject* self, PyObject* args) +@@ -2896,7 +2943,6 @@ DB_set_lorder(DBObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DB_get_lorder(DBObject* self) + { +@@ -2911,7 +2957,6 @@ DB_get_lorder(DBObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(lorder); + } +-#endif + + static PyObject* + DB_set_pagesize(DBObject* self, PyObject* args) +@@ -2929,7 +2974,6 @@ DB_set_pagesize(DBObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DB_get_pagesize(DBObject* self) + { +@@ -2944,7 +2988,6 @@ DB_get_pagesize(DBObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(pagesize); + } +-#endif + + static PyObject* + DB_set_re_delim(DBObject* self, PyObject* args) +@@ -2967,7 +3010,6 @@ DB_set_re_delim(DBObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DB_get_re_delim(DBObject* self) + { +@@ -2981,7 +3023,6 @@ DB_get_re_delim(DBObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(re_delim); + } +-#endif + + static PyObject* + DB_set_re_len(DBObject* self, PyObject* args) +@@ -2999,7 +3040,6 @@ DB_set_re_len(DBObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DB_get_re_len(DBObject* self) + { +@@ -3014,7 +3054,6 @@ DB_get_re_len(DBObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(re_len); + } +-#endif + + static PyObject* + DB_set_re_pad(DBObject* self, PyObject* args) +@@ -3036,7 +3075,6 @@ DB_set_re_pad(DBObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DB_get_re_pad(DBObject* self) + { +@@ -3050,7 +3088,6 @@ DB_get_re_pad(DBObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(re_pad); + } +-#endif + + static PyObject* + DB_set_re_source(DBObject* self, PyObject* args) +@@ -3069,7 +3106,6 @@ DB_set_re_source(DBObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DB_get_re_source(DBObject* self) + { +@@ -3084,7 +3120,6 @@ DB_get_re_source(DBObject* self) + RETURN_IF_ERR(); + return PyBytes_FromString(source); + } +-#endif + + static PyObject* + DB_stat(DBObject* self, PyObject* args, PyObject* kwargs) +@@ -3381,7 +3416,6 @@ DB_set_encrypt(DBObject* self, PyObject* args, PyObject* kwargs) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DB_get_encrypt_flags(DBObject* self) + { +@@ -3396,7 +3430,6 @@ DB_get_encrypt_flags(DBObject* self) + + return NUMBER_FromLong(flags); + } +-#endif + + + +@@ -4987,7 +5020,6 @@ DBEnv_set_encrypt(DBEnvObject* self, PyObject* args, PyObject* kwargs) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_encrypt_flags(DBEnvObject* self) + { +@@ -5025,7 +5057,6 @@ DBEnv_get_timeout(DBEnvObject* self, PyObject* args, PyObject* kwargs) + RETURN_IF_ERR(); + return NUMBER_FromLong(timeout); + } +-#endif + + + static PyObject* +@@ -5064,7 +5095,6 @@ DBEnv_set_shm_key(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_shm_key(DBEnvObject* self) + { +@@ -5081,7 +5111,6 @@ DBEnv_get_shm_key(DBEnvObject* self) + + return NUMBER_FromLong(shm_key); + } +-#endif + + #if (DBVER >= 46) + static PyObject* +@@ -5170,7 +5199,6 @@ DBEnv_set_cachesize(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_cachesize(DBEnvObject* self) + { +@@ -5188,7 +5216,6 @@ DBEnv_get_cachesize(DBEnvObject* self) + + return Py_BuildValue("(iii)", gbytes, bytes, ncache); + } +-#endif + + + static PyObject* +@@ -5208,7 +5235,6 @@ DBEnv_set_flags(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_flags(DBEnvObject* self) + { +@@ -5223,7 +5249,6 @@ DBEnv_get_flags(DBEnvObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(flags); + } +-#endif + + #if (DBVER >= 47) + static PyObject* +@@ -5423,7 +5448,6 @@ DBEnv_set_data_dir(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_data_dirs(DBEnvObject* self) + { +@@ -5463,7 +5487,6 @@ DBEnv_get_data_dirs(DBEnvObject* self) + } + return tuple; + } +-#endif + + #if (DBVER >= 44) + static PyObject* +@@ -5513,7 +5536,6 @@ DBEnv_set_lg_bsize(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_lg_bsize(DBEnvObject* self) + { +@@ -5528,7 +5550,6 @@ DBEnv_get_lg_bsize(DBEnvObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(lg_bsize); + } +-#endif + + static PyObject* + DBEnv_set_lg_dir(DBEnvObject* self, PyObject* args) +@@ -5547,7 +5568,6 @@ DBEnv_set_lg_dir(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_lg_dir(DBEnvObject* self) + { +@@ -5562,7 +5582,6 @@ DBEnv_get_lg_dir(DBEnvObject* self) + RETURN_IF_ERR(); + return PyBytes_FromString(dirp); + } +-#endif + + static PyObject* + DBEnv_set_lg_max(DBEnvObject* self, PyObject* args) +@@ -5580,7 +5599,6 @@ DBEnv_set_lg_max(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_lg_max(DBEnvObject* self) + { +@@ -5595,8 +5613,6 @@ DBEnv_get_lg_max(DBEnvObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(lg_max); + } +-#endif +- + + static PyObject* + DBEnv_set_lg_regionmax(DBEnvObject* self, PyObject* args) +@@ -5614,7 +5630,6 @@ DBEnv_set_lg_regionmax(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_lg_regionmax(DBEnvObject* self) + { +@@ -5629,7 +5644,6 @@ DBEnv_get_lg_regionmax(DBEnvObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(lg_regionmax); + } +-#endif + + #if (DBVER >= 47) + static PyObject* +@@ -5680,7 +5694,6 @@ DBEnv_set_lk_detect(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_lk_detect(DBEnvObject* self) + { +@@ -5695,8 +5708,6 @@ DBEnv_get_lk_detect(DBEnvObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(lk_detect); + } +-#endif +- + + #if (DBVER < 45) + static PyObject* +@@ -5734,7 +5745,6 @@ DBEnv_set_lk_max_locks(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_lk_max_locks(DBEnvObject* self) + { +@@ -5749,7 +5759,6 @@ DBEnv_get_lk_max_locks(DBEnvObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(lk_max); + } +-#endif + + static PyObject* + DBEnv_set_lk_max_lockers(DBEnvObject* self, PyObject* args) +@@ -5767,7 +5776,6 @@ DBEnv_set_lk_max_lockers(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_lk_max_lockers(DBEnvObject* self) + { +@@ -5782,7 +5790,6 @@ DBEnv_get_lk_max_lockers(DBEnvObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(lk_max); + } +-#endif + + static PyObject* + DBEnv_set_lk_max_objects(DBEnvObject* self, PyObject* args) +@@ -5800,7 +5807,6 @@ DBEnv_set_lk_max_objects(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_lk_max_objects(DBEnvObject* self) + { +@@ -5815,9 +5821,7 @@ DBEnv_get_lk_max_objects(DBEnvObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(lk_max); + } +-#endif + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_mp_mmapsize(DBEnvObject* self) + { +@@ -5832,8 +5836,6 @@ DBEnv_get_mp_mmapsize(DBEnvObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(mmapsize); + } +-#endif +- + + static PyObject* + DBEnv_set_mp_mmapsize(DBEnvObject* self, PyObject* args) +@@ -5869,8 +5871,6 @@ DBEnv_set_tmp_dir(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +- +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_tmp_dir(DBEnvObject* self) + { +@@ -5887,8 +5887,6 @@ DBEnv_get_tmp_dir(DBEnvObject* self) + + return PyBytes_FromString(dirpp); + } +-#endif +- + + static PyObject* + DBEnv_txn_recover(DBEnvObject* self) +@@ -5899,7 +5897,7 @@ DBEnv_txn_recover(DBEnvObject* self) + DBTxnObject *txn; + #define PREPLIST_LEN 16 + DB_PREPLIST preplist[PREPLIST_LEN]; +-#if (DBVER < 48) ++#if (DBVER < 48 || DBVER > 51) + long retp; + #else + u_int32_t retp; +@@ -6003,8 +6001,6 @@ DBEnv_txn_checkpoint(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +- +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_tx_max(DBEnvObject* self) + { +@@ -6019,8 +6015,6 @@ DBEnv_get_tx_max(DBEnvObject* self) + RETURN_IF_ERR(); + return PyLong_FromUnsignedLong(max); + } +-#endif +- + + static PyObject* + DBEnv_set_tx_max(DBEnvObject* self, PyObject* args) +@@ -6038,8 +6032,6 @@ DBEnv_set_tx_max(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +- +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_tx_timestamp(DBEnvObject* self) + { +@@ -6054,7 +6046,6 @@ DBEnv_get_tx_timestamp(DBEnvObject* self) + RETURN_IF_ERR(); + return NUMBER_FromLong(timestamp); + } +-#endif + + static PyObject* + DBEnv_set_tx_timestamp(DBEnvObject* self, PyObject* args) +@@ -6756,6 +6747,55 @@ DBEnv_set_private(DBEnvObject* self, PyObject* private_obj) + RETURN_NONE(); + } + ++#if (DBVER >= 47) ++static PyObject* ++DBEnv_set_intermediate_dir_mode(DBEnvObject* self, PyObject* args) ++{ ++ int err; ++ const char *mode; ++ ++ if (!PyArg_ParseTuple(args,"s:set_intermediate_dir_mode", &mode)) ++ return NULL; ++ ++ CHECK_ENV_NOT_CLOSED(self); ++ ++ MYDB_BEGIN_ALLOW_THREADS; ++ err = self->db_env->set_intermediate_dir_mode(self->db_env, mode); ++ MYDB_END_ALLOW_THREADS; ++ RETURN_IF_ERR(); ++ RETURN_NONE(); ++} ++ ++static PyObject* ++DBEnv_get_intermediate_dir_mode(DBEnvObject* self) ++{ ++ int err; ++ const char *mode; ++ ++ CHECK_ENV_NOT_CLOSED(self); ++ ++ MYDB_BEGIN_ALLOW_THREADS; ++ err = self->db_env->get_intermediate_dir_mode(self->db_env, &mode); ++ MYDB_END_ALLOW_THREADS; ++ RETURN_IF_ERR(); ++ return Py_BuildValue("s", mode); ++} ++#endif ++ ++static PyObject* ++DBEnv_get_open_flags(DBEnvObject* self) ++{ ++ int err; ++ unsigned int flags; ++ ++ CHECK_ENV_NOT_CLOSED(self); ++ ++ MYDB_BEGIN_ALLOW_THREADS; ++ err = self->db_env->get_open_flags(self->db_env, &flags); ++ MYDB_END_ALLOW_THREADS; ++ RETURN_IF_ERR(); ++ return NUMBER_FromLong(flags); ++} + + #if (DBVER < 48) + static PyObject* +@@ -6875,7 +6915,6 @@ DBEnv_set_verbose(DBEnvObject* self, PyObject* args) + RETURN_NONE(); + } + +-#if (DBVER >= 42) + static PyObject* + DBEnv_get_verbose(DBEnvObject* self, PyObject* args) + { +@@ -6893,7 +6932,6 @@ DBEnv_get_verbose(DBEnvObject* self, PyObject* args) + RETURN_IF_ERR(); + return PyBool_FromLong(verbose); + } +-#endif + + #if (DBVER >= 45) + static void +@@ -6975,9 +7013,7 @@ DBEnv_rep_process_message(DBEnvObject* self, PyObject* args) + PyObject *control_py, *rec_py; + DBT control, rec; + int envid; +-#if (DBVER >= 42) + DB_LSN lsn; +-#endif + + if (!PyArg_ParseTuple(args, "OOi:rep_process_message", &control_py, + &rec_py, &envid)) +@@ -6994,13 +7030,8 @@ DBEnv_rep_process_message(DBEnvObject* self, PyObject* args) + err = self->db_env->rep_process_message(self->db_env, &control, &rec, + envid, &lsn); + #else +-#if (DBVER >= 42) + err = self->db_env->rep_process_message(self->db_env, &control, &rec, + &envid, &lsn); +-#else +- err = self->db_env->rep_process_message(self->db_env, &control, &rec, +- &envid); +-#endif + #endif + MYDB_END_ALLOW_THREADS; + switch (err) { +@@ -7029,12 +7060,10 @@ DBEnv_rep_process_message(DBEnvObject* self, PyObject* args) + return r; + break; + } +-#if (DBVER >= 42) + case DB_REP_NOTPERM : + case DB_REP_ISPERM : + return Py_BuildValue("(i(ll))", err, lsn.file, lsn.offset); + break; +-#endif + } + RETURN_IF_ERR(); + return Py_BuildValue("(OO)", Py_None, Py_None); +@@ -7086,20 +7115,6 @@ _DBEnv_rep_transportCallback(DB_ENV* db_env, const DBT* control, const DBT* rec, + return ret; + } + +-#if (DBVER <= 41) +-static int +-_DBEnv_rep_transportCallbackOLD(DB_ENV* db_env, const DBT* control, const DBT* rec, +- int envid, u_int32_t flags) +-{ +- DB_LSN lsn; +- +- lsn.file = -1; /* Dummy values */ +- lsn.offset = -1; +- return _DBEnv_rep_transportCallback(db_env, control, rec, &lsn, envid, +- flags); +-} +-#endif +- + static PyObject* + DBEnv_rep_set_transport(DBEnvObject* self, PyObject* args) + { +@@ -7120,13 +7135,8 @@ DBEnv_rep_set_transport(DBEnvObject* self, PyObject* args) + err = self->db_env->rep_set_transport(self->db_env, envid, + &_DBEnv_rep_transportCallback); + #else +-#if (DBVER >= 42) + err = self->db_env->set_rep_transport(self->db_env, envid, + &_DBEnv_rep_transportCallback); +-#else +- err = self->db_env->set_rep_transport(self->db_env, envid, +- &_DBEnv_rep_transportCallbackOLD); +-#endif + #endif + MYDB_END_ALLOW_THREADS; + RETURN_IF_ERR(); +@@ -7608,6 +7618,7 @@ DBEnv_repmgr_start(DBEnvObject* self, PyObject* args, PyObject* + RETURN_NONE(); + } + ++#if (DBVER < 52) + static PyObject* + DBEnv_repmgr_set_local_site(DBEnvObject* self, PyObject* args, PyObject* + kwargs) +@@ -7654,6 +7665,7 @@ DBEnv_repmgr_add_remote_site(DBEnvObject* self, PyObject* args, PyObject* + RETURN_IF_ERR(); + return NUMBER_FromLong(eidp); + } ++#endif + + static PyObject* + DBEnv_repmgr_set_ack_policy(DBEnvObject* self, PyObject* args) +@@ -8482,65 +8494,43 @@ static PyMethodDef DB_methods[] = { + {"remove", (PyCFunction)DB_remove, METH_VARARGS|METH_KEYWORDS}, + {"rename", (PyCFunction)DB_rename, METH_VARARGS}, + {"set_bt_minkey", (PyCFunction)DB_set_bt_minkey, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_bt_minkey", (PyCFunction)DB_get_bt_minkey, METH_NOARGS}, +-#endif + {"set_bt_compare", (PyCFunction)DB_set_bt_compare, METH_O}, + {"set_cachesize", (PyCFunction)DB_set_cachesize, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_cachesize", (PyCFunction)DB_get_cachesize, METH_NOARGS}, +-#endif + {"set_encrypt", (PyCFunction)DB_set_encrypt, METH_VARARGS|METH_KEYWORDS}, +-#if (DBVER >= 42) + {"get_encrypt_flags", (PyCFunction)DB_get_encrypt_flags, METH_NOARGS}, +-#endif +- + {"set_flags", (PyCFunction)DB_set_flags, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_flags", (PyCFunction)DB_get_flags, METH_NOARGS}, ++#if (DBVER >= 43) ++ {"get_transactional", (PyCFunction)DB_get_transactional, METH_NOARGS}, + #endif + {"set_h_ffactor", (PyCFunction)DB_set_h_ffactor, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_h_ffactor", (PyCFunction)DB_get_h_ffactor, METH_NOARGS}, +-#endif + {"set_h_nelem", (PyCFunction)DB_set_h_nelem, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_h_nelem", (PyCFunction)DB_get_h_nelem, METH_NOARGS}, +-#endif + {"set_lorder", (PyCFunction)DB_set_lorder, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_lorder", (PyCFunction)DB_get_lorder, METH_NOARGS}, +-#endif + {"set_pagesize", (PyCFunction)DB_set_pagesize, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_pagesize", (PyCFunction)DB_get_pagesize, METH_NOARGS}, +-#endif + {"set_re_delim", (PyCFunction)DB_set_re_delim, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_re_delim", (PyCFunction)DB_get_re_delim, METH_NOARGS}, +-#endif + {"set_re_len", (PyCFunction)DB_set_re_len, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_re_len", (PyCFunction)DB_get_re_len, METH_NOARGS}, +-#endif + {"set_re_pad", (PyCFunction)DB_set_re_pad, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_re_pad", (PyCFunction)DB_get_re_pad, METH_NOARGS}, +-#endif + {"set_re_source", (PyCFunction)DB_set_re_source, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_re_source", (PyCFunction)DB_get_re_source, METH_NOARGS}, +-#endif + {"set_q_extentsize",(PyCFunction)DB_set_q_extentsize, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_q_extentsize",(PyCFunction)DB_get_q_extentsize, METH_NOARGS}, +-#endif + {"set_private", (PyCFunction)DB_set_private, METH_O}, + {"get_private", (PyCFunction)DB_get_private, METH_NOARGS}, + #if (DBVER >= 46) + {"set_priority", (PyCFunction)DB_set_priority, METH_VARARGS}, + {"get_priority", (PyCFunction)DB_get_priority, METH_NOARGS}, + #endif ++ {"get_dbname", (PyCFunction)DB_get_dbname, METH_NOARGS}, ++ {"get_open_flags", (PyCFunction)DB_get_open_flags, METH_NOARGS}, + {"stat", (PyCFunction)DB_stat, METH_VARARGS|METH_KEYWORDS}, + #if (DBVER >= 43) + {"stat_print", (PyCFunction)DB_stat_print, +@@ -8639,24 +8629,18 @@ static PyMethodDef DBEnv_methods[] = { + {"get_thread_count", (PyCFunction)DBEnv_get_thread_count, METH_NOARGS}, + #endif + {"set_encrypt", (PyCFunction)DBEnv_set_encrypt, METH_VARARGS|METH_KEYWORDS}, +-#if (DBVER >= 42) + {"get_encrypt_flags", (PyCFunction)DBEnv_get_encrypt_flags, METH_NOARGS}, + {"get_timeout", (PyCFunction)DBEnv_get_timeout, + METH_VARARGS|METH_KEYWORDS}, +-#endif + {"set_timeout", (PyCFunction)DBEnv_set_timeout, METH_VARARGS|METH_KEYWORDS}, + {"set_shm_key", (PyCFunction)DBEnv_set_shm_key, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_shm_key", (PyCFunction)DBEnv_get_shm_key, METH_NOARGS}, +-#endif + #if (DBVER >= 46) + {"set_cache_max", (PyCFunction)DBEnv_set_cache_max, METH_VARARGS}, + {"get_cache_max", (PyCFunction)DBEnv_get_cache_max, METH_NOARGS}, + #endif + {"set_cachesize", (PyCFunction)DBEnv_set_cachesize, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_cachesize", (PyCFunction)DBEnv_get_cachesize, METH_NOARGS}, +-#endif + {"memp_trickle", (PyCFunction)DBEnv_memp_trickle, METH_VARARGS}, + {"memp_sync", (PyCFunction)DBEnv_memp_sync, METH_VARARGS}, + {"memp_stat", (PyCFunction)DBEnv_memp_stat, +@@ -8685,33 +8669,21 @@ static PyMethodDef DBEnv_methods[] = { + #endif + #endif + {"set_data_dir", (PyCFunction)DBEnv_set_data_dir, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_data_dirs", (PyCFunction)DBEnv_get_data_dirs, METH_NOARGS}, +-#endif +-#if (DBVER >= 42) + {"get_flags", (PyCFunction)DBEnv_get_flags, METH_NOARGS}, +-#endif + {"set_flags", (PyCFunction)DBEnv_set_flags, METH_VARARGS}, + #if (DBVER >= 47) + {"log_set_config", (PyCFunction)DBEnv_log_set_config, METH_VARARGS}, + {"log_get_config", (PyCFunction)DBEnv_log_get_config, METH_VARARGS}, + #endif + {"set_lg_bsize", (PyCFunction)DBEnv_set_lg_bsize, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_lg_bsize", (PyCFunction)DBEnv_get_lg_bsize, METH_NOARGS}, +-#endif + {"set_lg_dir", (PyCFunction)DBEnv_set_lg_dir, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_lg_dir", (PyCFunction)DBEnv_get_lg_dir, METH_NOARGS}, +-#endif + {"set_lg_max", (PyCFunction)DBEnv_set_lg_max, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_lg_max", (PyCFunction)DBEnv_get_lg_max, METH_NOARGS}, +-#endif + {"set_lg_regionmax",(PyCFunction)DBEnv_set_lg_regionmax, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_lg_regionmax",(PyCFunction)DBEnv_get_lg_regionmax, METH_NOARGS}, +-#endif + #if (DBVER >= 44) + {"set_lg_filemode", (PyCFunction)DBEnv_set_lg_filemode, METH_VARARGS}, + {"get_lg_filemode", (PyCFunction)DBEnv_get_lg_filemode, METH_NOARGS}, +@@ -8721,36 +8693,24 @@ static PyMethodDef DBEnv_methods[] = { + {"get_lk_partitions", (PyCFunction)DBEnv_get_lk_partitions, METH_NOARGS}, + #endif + {"set_lk_detect", (PyCFunction)DBEnv_set_lk_detect, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_lk_detect", (PyCFunction)DBEnv_get_lk_detect, METH_NOARGS}, +-#endif + #if (DBVER < 45) + {"set_lk_max", (PyCFunction)DBEnv_set_lk_max, METH_VARARGS}, + #endif + {"set_lk_max_locks", (PyCFunction)DBEnv_set_lk_max_locks, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_lk_max_locks", (PyCFunction)DBEnv_get_lk_max_locks, METH_NOARGS}, +-#endif + {"set_lk_max_lockers", (PyCFunction)DBEnv_set_lk_max_lockers, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_lk_max_lockers", (PyCFunction)DBEnv_get_lk_max_lockers, METH_NOARGS}, +-#endif + {"set_lk_max_objects", (PyCFunction)DBEnv_set_lk_max_objects, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_lk_max_objects", (PyCFunction)DBEnv_get_lk_max_objects, METH_NOARGS}, +-#endif + #if (DBVER >= 43) + {"stat_print", (PyCFunction)DBEnv_stat_print, + METH_VARARGS|METH_KEYWORDS}, + #endif + {"set_mp_mmapsize", (PyCFunction)DBEnv_set_mp_mmapsize, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_mp_mmapsize", (PyCFunction)DBEnv_get_mp_mmapsize, METH_NOARGS}, +-#endif + {"set_tmp_dir", (PyCFunction)DBEnv_set_tmp_dir, METH_VARARGS}, +-#if (DBVER >= 42) + {"get_tmp_dir", (PyCFunction)DBEnv_get_tmp_dir, METH_NOARGS}, +-#endif + {"txn_begin", (PyCFunction)DBEnv_txn_begin, METH_VARARGS|METH_KEYWORDS}, + {"txn_checkpoint", (PyCFunction)DBEnv_txn_checkpoint, METH_VARARGS}, + {"txn_stat", (PyCFunction)DBEnv_txn_stat, METH_VARARGS}, +@@ -8758,10 +8718,8 @@ static PyMethodDef DBEnv_methods[] = { + {"txn_stat_print", (PyCFunction)DBEnv_txn_stat_print, + METH_VARARGS|METH_KEYWORDS}, + #endif +-#if (DBVER >= 42) + {"get_tx_max", (PyCFunction)DBEnv_get_tx_max, METH_NOARGS}, + {"get_tx_timestamp", (PyCFunction)DBEnv_get_tx_timestamp, METH_NOARGS}, +-#endif + {"set_tx_max", (PyCFunction)DBEnv_set_tx_max, METH_VARARGS}, + {"set_tx_timestamp", (PyCFunction)DBEnv_set_tx_timestamp, METH_VARARGS}, + {"lock_detect", (PyCFunction)DBEnv_lock_detect, METH_VARARGS}, +@@ -8804,11 +8762,16 @@ static PyMethodDef DBEnv_methods[] = { + {"get_mp_max_write", (PyCFunction)DBEnv_get_mp_max_write, METH_NOARGS}, + #endif + {"set_verbose", (PyCFunction)DBEnv_set_verbose, METH_VARARGS}, +-#if (DBVER >= 42) +- {"get_verbose", (PyCFunction)DBEnv_get_verbose, METH_VARARGS}, ++ {"get_verbose", (PyCFunction)DBEnv_get_verbose, METH_VARARGS}, ++ {"set_private", (PyCFunction)DBEnv_set_private, METH_O}, ++ {"get_private", (PyCFunction)DBEnv_get_private, METH_NOARGS}, ++ {"get_open_flags", (PyCFunction)DBEnv_get_open_flags, METH_NOARGS}, ++#if (DBVER >= 47) ++ {"set_intermediate_dir_mode", (PyCFunction)DBEnv_set_intermediate_dir_mode, ++ METH_VARARGS}, ++ {"get_intermediate_dir_mode", (PyCFunction)DBEnv_get_intermediate_dir_mode, ++ METH_NOARGS}, + #endif +- {"set_private", (PyCFunction)DBEnv_set_private, METH_O}, +- {"get_private", (PyCFunction)DBEnv_get_private, METH_NOARGS}, + {"rep_start", (PyCFunction)DBEnv_rep_start, + METH_VARARGS|METH_KEYWORDS}, + {"rep_set_transport", (PyCFunction)DBEnv_rep_set_transport, METH_VARARGS}, +@@ -8855,10 +8818,12 @@ static PyMethodDef DBEnv_methods[] = { + #if (DBVER >= 45) + {"repmgr_start", (PyCFunction)DBEnv_repmgr_start, + METH_VARARGS|METH_KEYWORDS}, ++#if (DBVER < 52) + {"repmgr_set_local_site", (PyCFunction)DBEnv_repmgr_set_local_site, + METH_VARARGS|METH_KEYWORDS}, + {"repmgr_add_remote_site", (PyCFunction)DBEnv_repmgr_add_remote_site, + METH_VARARGS|METH_KEYWORDS}, ++#endif + {"repmgr_set_ack_policy", (PyCFunction)DBEnv_repmgr_set_ack_policy, + METH_VARARGS}, + {"repmgr_get_ack_policy", (PyCFunction)DBEnv_repmgr_get_ack_policy, +@@ -8922,13 +8887,9 @@ DBEnv_db_home_get(DBEnvObject* self) + + CHECK_ENV_NOT_CLOSED(self); + +-#if (DBVER >= 42) + MYDB_BEGIN_ALLOW_THREADS; + self->db_env->get_home(self->db_env, &home); + MYDB_END_ALLOW_THREADS; +-#else +- home=self->db_env->db_home; +-#endif + + if (home == NULL) { + RETURN_NONE(); +@@ -9298,10 +9259,25 @@ bsddb_version(PyObject* self) + { + int major, minor, patch; + ++ /* This should be instantaneous, no need to release the GIL */ + db_version(&major, &minor, &patch); + return Py_BuildValue("(iii)", major, minor, patch); + } + ++#if (DBVER >= 50) ++static PyObject* ++bsddb_version_full(PyObject* self) ++{ ++ char *version_string; ++ int family, release, major, minor, patch; ++ ++ /* This should be instantaneous, no need to release the GIL */ ++ version_string = db_full_version(&family, &release, &major, &minor, &patch); ++ return Py_BuildValue("(siiiii)", ++ version_string, family, release, major, minor, patch); ++} ++#endif ++ + + /* List of functions defined in the module */ + static PyMethodDef bsddb_methods[] = { +@@ -9311,6 +9287,9 @@ static PyMethodDef bsddb_methods[] = { + {"DBSequence", (PyCFunction)DBSequence_construct, METH_VARARGS | METH_KEYWORDS }, + #endif + {"version", (PyCFunction)bsddb_version, METH_NOARGS, bsddb_version_doc}, ++#if (DBVER >= 50) ++ {"full_version", (PyCFunction)bsddb_version_full, METH_NOARGS}, ++#endif + {NULL, NULL} /* sentinel */ + }; + +@@ -9328,6 +9307,11 @@ static BSDDB_api bsddb_api; + */ + #define ADD_INT(dict, NAME) _addIntToDict(dict, #NAME, NAME) + ++/* ++** We can rename the module at import time, so the string allocated ++** must be big enough, and any use of the name must use this particular ++** string. ++*/ + #define MODULE_NAME_MAX_LEN 11 + static char _bsddbModuleName[MODULE_NAME_MAX_LEN+1] = "_bsddb"; + +@@ -9428,16 +9412,10 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + ADD_INT(d, DB_MAX_RECORDS); + + #if (DBVER < 48) +-#if (DBVER >= 42) + ADD_INT(d, DB_RPCCLIENT); +-#else +- ADD_INT(d, DB_CLIENT); +- /* allow apps to be written using DB_RPCCLIENT on older Berkeley DB */ +- _addIntToDict(d, "DB_RPCCLIENT", DB_CLIENT); +-#endif + #endif + +-#if (DBVER < 48) ++#if (DBVER < 48 || DBVER > 51) + ADD_INT(d, DB_XA_CREATE); + #endif + +@@ -9477,6 +9455,14 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + ADD_INT(d, DB_TXN_SYNC); + ADD_INT(d, DB_TXN_NOWAIT); + ++#if (DBVER >= 51) ++ ADD_INT(d, DB_TXN_BULK); ++#endif ++ ++#if (DBVER >= 48) ++ ADD_INT(d, DB_CURSOR_BULK); ++#endif ++ + #if (DBVER >= 46) + ADD_INT(d, DB_TXN_WAIT); + #endif +@@ -9561,9 +9547,7 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + ADD_INT(d, DB_ARCH_ABS); + ADD_INT(d, DB_ARCH_DATA); + ADD_INT(d, DB_ARCH_LOG); +-#if (DBVER >= 42) + ADD_INT(d, DB_ARCH_REMOVE); +-#endif + + ADD_INT(d, DB_BTREE); + ADD_INT(d, DB_HASH); +@@ -9591,9 +9575,6 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + ADD_INT(d, DB_CACHED_COUNTS); + #endif + +-#if (DBVER <= 41) +- ADD_INT(d, DB_COMMIT); +-#endif + ADD_INT(d, DB_CONSUME); + ADD_INT(d, DB_CONSUME_WAIT); + ADD_INT(d, DB_CURRENT); +@@ -9651,8 +9632,10 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + ADD_INT(d, DB_LOCK_DEADLOCK); + ADD_INT(d, DB_LOCK_NOTGRANTED); + ADD_INT(d, DB_NOSERVER); ++#if (DBVER < 52) + ADD_INT(d, DB_NOSERVER_HOME); + ADD_INT(d, DB_NOSERVER_ID); ++#endif + ADD_INT(d, DB_NOTFOUND); + ADD_INT(d, DB_OLD_VERSION); + ADD_INT(d, DB_RUNRECOVERY); +@@ -9671,6 +9654,10 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + #if (DBVER >= 43) + ADD_INT(d, DB_STAT_SUBSYSTEM); + ADD_INT(d, DB_STAT_MEMP_HASH); ++ ADD_INT(d, DB_STAT_LOCK_CONF); ++ ADD_INT(d, DB_STAT_LOCK_LOCKERS); ++ ADD_INT(d, DB_STAT_LOCK_OBJECTS); ++ ADD_INT(d, DB_STAT_LOCK_PARAMS); + #endif + + #if (DBVER >= 48) +@@ -9690,7 +9677,6 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + ADD_INT(d, DB_EID_INVALID); + ADD_INT(d, DB_EID_BROADCAST); + +-#if (DBVER >= 42) + ADD_INT(d, DB_TIME_NOTGRANTED); + ADD_INT(d, DB_TXN_NOT_DURABLE); + ADD_INT(d, DB_TXN_WRITE_NOSYNC); +@@ -9698,9 +9684,8 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + ADD_INT(d, DB_INIT_REP); + ADD_INT(d, DB_ENCRYPT); + ADD_INT(d, DB_CHKSUM); +-#endif + +-#if (DBVER >= 42) && (DBVER < 47) ++#if (DBVER < 47) + ADD_INT(d, DB_LOG_AUTOREMOVE); + ADD_INT(d, DB_DIRECT_LOG); + #endif +@@ -9733,6 +9718,20 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + ADD_INT(d, DB_VERB_REPLICATION); + ADD_INT(d, DB_VERB_WAITSFOR); + ++#if (DBVER >= 50) ++ ADD_INT(d, DB_VERB_REP_SYSTEM); ++#endif ++ ++#if (DBVER >= 47) ++ ADD_INT(d, DB_VERB_REP_ELECT); ++ ADD_INT(d, DB_VERB_REP_LEASE); ++ ADD_INT(d, DB_VERB_REP_MISC); ++ ADD_INT(d, DB_VERB_REP_MSGS); ++ ADD_INT(d, DB_VERB_REP_SYNC); ++ ADD_INT(d, DB_VERB_REPMGR_CONNFAIL); ++ ADD_INT(d, DB_VERB_REPMGR_MISC); ++#endif ++ + #if (DBVER >= 45) + ADD_INT(d, DB_EVENT_PANIC); + ADD_INT(d, DB_EVENT_REP_CLIENT); +@@ -9748,16 +9747,25 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + ADD_INT(d, DB_EVENT_WRITE_FAILED); + #endif + ++#if (DBVER >= 50) ++ ADD_INT(d, DB_REPMGR_CONF_ELECTIONS); ++ ADD_INT(d, DB_EVENT_REP_MASTER_FAILURE); ++ ADD_INT(d, DB_EVENT_REP_DUPMASTER); ++ ADD_INT(d, DB_EVENT_REP_ELECTION_FAILED); ++#endif ++#if (DBVER >= 48) ++ ADD_INT(d, DB_EVENT_REG_ALIVE); ++ ADD_INT(d, DB_EVENT_REG_PANIC); ++#endif ++ + ADD_INT(d, DB_REP_DUPMASTER); + ADD_INT(d, DB_REP_HOLDELECTION); + #if (DBVER >= 44) + ADD_INT(d, DB_REP_IGNORE); + ADD_INT(d, DB_REP_JOIN_FAILURE); + #endif +-#if (DBVER >= 42) + ADD_INT(d, DB_REP_ISPERM); + ADD_INT(d, DB_REP_NOTPERM); +-#endif + ADD_INT(d, DB_REP_NEWSITE); + + ADD_INT(d, DB_REP_MASTER); +@@ -9766,7 +9774,13 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + ADD_INT(d, DB_REP_PERMANENT); + + #if (DBVER >= 44) ++#if (DBVER >= 50) ++ ADD_INT(d, DB_REP_CONF_AUTOINIT); ++#else + ADD_INT(d, DB_REP_CONF_NOAUTOINIT); ++#endif /* 5.0 */ ++#endif /* 4.4 */ ++#if (DBVER >= 44) + ADD_INT(d, DB_REP_CONF_DELAYCLIENT); + ADD_INT(d, DB_REP_CONF_BULK); + ADD_INT(d, DB_REP_CONF_NOWAIT); +@@ -9774,9 +9788,7 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + ADD_INT(d, DB_REP_REREQUEST); + #endif + +-#if (DBVER >= 42) + ADD_INT(d, DB_REP_NOBUFFER); +-#endif + + #if (DBVER >= 46) + ADD_INT(d, DB_REP_LEASE_EXPIRED); +@@ -9819,6 +9831,28 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + ADD_INT(d, DB_STAT_ALL); + #endif + ++#if (DBVER >= 51) ++ ADD_INT(d, DB_REPMGR_ACKS_ALL_AVAILABLE); ++#endif ++ ++#if (DBVER >= 48) ++ ADD_INT(d, DB_REP_CONF_INMEM); ++#endif ++ ++ ADD_INT(d, DB_TIMEOUT); ++ ++#if (DBVER >= 50) ++ ADD_INT(d, DB_FORCESYNC); ++#endif ++ ++#if (DBVER >= 48) ++ ADD_INT(d, DB_FAILCHK); ++#endif ++ ++#if (DBVER >= 51) ++ ADD_INT(d, DB_HOTBACKUP_IN_PROGRESS); ++#endif ++ + #if (DBVER >= 43) + ADD_INT(d, DB_BUFFER_SMALL); + ADD_INT(d, DB_SEQ_DEC); +@@ -9856,6 +9890,10 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + ADD_INT(d, DB_SET_LOCK_TIMEOUT); + ADD_INT(d, DB_SET_TXN_TIMEOUT); + ++#if (DBVER >= 48) ++ ADD_INT(d, DB_SET_REG_TIMEOUT); ++#endif ++ + /* The exception name must be correct for pickled exception * + * objects to unpickle properly. */ + #ifdef PYBSDDB_STANDALONE /* different value needed for standalone pybsddb */ +@@ -9912,8 +9950,10 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + MAKE_EX(DBRunRecoveryError); + MAKE_EX(DBVerifyBadError); + MAKE_EX(DBNoServerError); ++#if (DBVER >= 44 && DBVER < 52) + MAKE_EX(DBNoServerHomeError); + MAKE_EX(DBNoServerIDError); ++#endif + MAKE_EX(DBPageNotFoundError); + MAKE_EX(DBSecondaryBadError); + +@@ -9927,9 +9967,7 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + MAKE_EX(DBNoSuchFileError); + MAKE_EX(DBPermissionsError); + +-#if (DBVER >= 42) + MAKE_EX(DBRepHandleDeadError); +-#endif + #if (DBVER >= 44) + MAKE_EX(DBRepLockoutError); + #endif +@@ -9947,6 +9985,7 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + #undef MAKE_EX + + /* Initialise the C API structure and add it to the module */ ++ bsddb_api.api_version = PYBSDDB_API_VERSION; + bsddb_api.db_type = &DB_Type; + bsddb_api.dbcursor_type = &DBCursor_Type; + bsddb_api.dblogcursor_type = &DBLogCursor_Type; +@@ -9955,19 +9994,25 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */ + bsddb_api.dblock_type = &DBLock_Type; + #if (DBVER >= 43) + bsddb_api.dbsequence_type = &DBSequence_Type; ++#else ++ bsddb_api.dbsequence_type = NULL; + #endif + bsddb_api.makeDBError = makeDBError; + + /* +- ** Capsules exist from Python 3.1, but I +- ** don't want to break the API compatibility +- ** for already published Python versions. ++ ** Capsules exist from Python 2.7 and 3.1. ++ ** We don't support Python 3.0 anymore, so... ++ ** #if (PY_VERSION_HEX < ((PY_MAJOR_VERSION < 3) ? 0x02070000 : 0x03020000)) + */ +-#if (PY_VERSION_HEX < 0x03020000) ++#if (PY_VERSION_HEX < 0x02070000) + py_api = PyCObject_FromVoidPtr((void*)&bsddb_api, NULL); + #else + { +- char py_api_name[250]; ++ /* ++ ** The data must outlive the call!!. So, the static definition. ++ ** The buffer must be big enough... ++ */ ++ static char py_api_name[MODULE_NAME_MAX_LEN+10]; + + strcpy(py_api_name, _bsddbModuleName); + strcat(py_api_name, ".api"); +diff --git a/Modules/bsddb.h b/Modules/bsddb.h +index a3a687b..c1d862a 100644 +--- a/Modules/bsddb.h ++++ b/Modules/bsddb.h +@@ -109,7 +109,7 @@ + #error "eek! DBVER can't handle minor versions > 9" + #endif + +-#define PY_BSDDB_VERSION "4.8.4.2" ++#define PY_BSDDB_VERSION "5.3.15" + + /* Python object definitions */ + +@@ -236,7 +236,7 @@ typedef struct DBSequenceObject { + /* To access the structure from an external module, use code like the + following (error checking missed out for clarity): + +- // If you are using Python before 3.2: ++ // If you are using Python before 2.7: + BSDDB_api* bsddb_api; + PyObject* mod; + PyObject* cobj; +@@ -249,7 +249,7 @@ typedef struct DBSequenceObject { + Py_DECREF(mod); + + +- // If you are using Python 3.2 or up: ++ // If you are using Python 2.7 or up: (except Python 3.0, unsupported) + BSDDB_api* bsddb_api; + + // Use "bsddb3._pybsddb.api" if you're using +@@ -257,10 +257,14 @@ typedef struct DBSequenceObject { + bsddb_api = (void **)PyCapsule_Import("bsddb._bsddb.api", 1); + + ++ Check "api_version" number before trying to use the API. ++ + The structure's members must not be changed. + */ + ++#define PYBSDDB_API_VERSION 1 + typedef struct { ++ unsigned int api_version; + /* Type objects */ + PyTypeObject* db_type; + PyTypeObject* dbcursor_type; +@@ -268,9 +272,7 @@ typedef struct { + PyTypeObject* dbenv_type; + PyTypeObject* dbtxn_type; + PyTypeObject* dblock_type; +-#if (DBVER >= 43) +- PyTypeObject* dbsequence_type; +-#endif ++ PyTypeObject* dbsequence_type; /* If DBVER < 43 -> NULL */ + + /* Functions */ + int (*makeDBError)(int err); +@@ -289,9 +291,9 @@ typedef struct { + #define DBEnvObject_Check(v) ((v)->ob_type == bsddb_api->dbenv_type) + #define DBTxnObject_Check(v) ((v)->ob_type == bsddb_api->dbtxn_type) + #define DBLockObject_Check(v) ((v)->ob_type == bsddb_api->dblock_type) +-#if (DBVER >= 43) +-#define DBSequenceObject_Check(v) ((v)->ob_type == bsddb_api->dbsequence_type) +-#endif ++#define DBSequenceObject_Check(v) \ ++ ((bsddb_api->dbsequence_type) && \ ++ ((v)->ob_type == bsddb_api->dbsequence_type)) + + #endif /* COMPILING_BSDDB_C */ + +diff --git a/setup.py b/setup.py +index 6b47451..e8ac96c 100644 +--- a/setup.py ++++ b/setup.py +@@ -799,7 +799,7 @@ class PyBuildExt(build_ext): + # a release. Most open source OSes come with one or more + # versions of BerkeleyDB already installed. + +- max_db_ver = (4, 8) ++ max_db_ver = (5, 3) + min_db_ver = (4, 1) + db_setup_debug = False # verbose debug prints from this script? + +@@ -821,7 +821,11 @@ class PyBuildExt(build_ext): + return True + + def gen_db_minor_ver_nums(major): +- if major == 4: ++ if major == 5: ++ for x in range(max_db_ver[1]+1): ++ if allow_db_ver((5, x)): ++ yield x ++ elif major == 4: + for x in range(max_db_ver[1]+1): + if allow_db_ver((4, x)): + yield x +@@ -835,6 +839,9 @@ class PyBuildExt(build_ext): + # construct a list of paths to look for the header file in on + # top of the normal inc_dirs. + db_inc_paths = [ ++ '/usr/include/db5', ++ '/usr/local/include/db5', ++ '/opt/sfw/include/db5', + '/usr/include/db4', + '/usr/local/include/db4', + '/opt/sfw/include/db4', +@@ -845,6 +852,16 @@ class PyBuildExt(build_ext): + '/sw/include/db4', + '/sw/include/db3', + ] ++ # 5.x minor number specific paths ++ for x in gen_db_minor_ver_nums(5): ++ db_inc_paths.append('/usr/include/db5%d' % x) ++ db_inc_paths.append('/usr/include/db5.%d' % x) ++ db_inc_paths.append('/usr/local/BerkeleyDB.5.%d/include' % x) ++ db_inc_paths.append('/usr/local/include/db5%d' % x) ++ db_inc_paths.append('/pkg/db-5.%d/include' % x) ++ db_inc_paths.append('/opt/db-5.%d/include' % x) ++ # MacPorts default (http://www.macports.org/) ++ db_inc_paths.append('/opt/local/include/db5%d' % x) + # 4.x minor number specific paths + for x in gen_db_minor_ver_nums(4): + db_inc_paths.append('/usr/include/db4%d' % x) +@@ -871,6 +888,10 @@ class PyBuildExt(build_ext): + for dn in inc_dirs: + std_variants.append(os.path.join(dn, 'db3')) + std_variants.append(os.path.join(dn, 'db4')) ++ std_variants.append(os.path.join(dn, 'db5')) ++ for x in gen_db_minor_ver_nums(5): ++ std_variants.append(os.path.join(dn, "db5%d"%x)) ++ std_variants.append(os.path.join(dn, "db5.%d"%x)) + for x in gen_db_minor_ver_nums(4): + std_variants.append(os.path.join(dn, "db4%d"%x)) + std_variants.append(os.path.join(dn, "db4.%d"%x)) +-- +1.7.7 + diff --git a/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch b/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch new file mode 100644 index 0000000000..216be0a448 --- /dev/null +++ b/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch @@ -0,0 +1,28 @@ +Upstream-Status: Inappropriate [embedded specific] + +Remove the RPATH to avoid QA issue warning. + +RP: Added secondary unnecessary rpath to the list 2012/8/7 +Signed-off-by: Jackie Huang + + +Index: Python-2.7.3/setup.py +=================================================================== +--- Python-2.7.3.orig/setup.py 2012-08-07 10:41:58.560132529 +0000 ++++ Python-2.7.3/setup.py 2012-08-07 11:09:47.852094515 +0000 +@@ -1042,7 +1042,6 @@ + exts.append(Extension('_bsddb', ['_bsddb.c'], + depends = ['bsddb.h'], + library_dirs=dblib_dir, +- runtime_library_dirs=dblib_dir, + include_dirs=db_incs, + libraries=dblibs)) + else: +@@ -1252,7 +1251,6 @@ + print "building dbm using bdb" + dbmext = Extension('dbm', ['dbmmodule.c'], + library_dirs=dblib_dir, +- runtime_library_dirs=dblib_dir, + include_dirs=db_incs, + define_macros=[ + ('HAVE_BERKDB_H', None), diff --git a/meta/recipes-devtools/python/python/python-fix-build-error-with-Readline-6.3.patch b/meta/recipes-devtools/python/python/python-fix-build-error-with-Readline-6.3.patch new file mode 100644 index 0000000000..b84f8c3461 --- /dev/null +++ b/meta/recipes-devtools/python/python/python-fix-build-error-with-Readline-6.3.patch @@ -0,0 +1,62 @@ +python: fix build error with Readline 6.3 + +Backport two patches from upstream: + +use new readline function types (closes #20374) +Issue #20374: Avoid compiler warnings when compiling readline with libedit. + +Upstream-Status: Backport + +Signed-off-by: Chong Lu +--- + Modules/readline.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/Modules/readline.c b/Modules/readline.c +index b5e258d..d3f52aa 100644 +--- a/Modules/readline.c ++++ b/Modules/readline.c +@@ -735,15 +735,24 @@ on_hook(PyObject *func) + return result; + } + ++ + static int ++#if defined(_RL_FUNCTION_TYPEDEF) + on_startup_hook(void) ++#else ++on_startup_hook() ++#endif + { + return on_hook(startup_hook); + } + + #ifdef HAVE_RL_PRE_INPUT_HOOK + static int ++#if defined(_RL_FUNCTION_TYPEDEF) + on_pre_input_hook(void) ++#else ++on_pre_input_hook() ++#endif + { + return on_hook(pre_input_hook); + } +@@ -886,12 +895,12 @@ setup_readline(void) + rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap); + rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap); + /* Set our hook functions */ +- rl_startup_hook = (Function *)on_startup_hook; ++ rl_startup_hook = (rl_hook_func_t *)on_startup_hook; + #ifdef HAVE_RL_PRE_INPUT_HOOK +- rl_pre_input_hook = (Function *)on_pre_input_hook; ++ rl_pre_input_hook = (rl_hook_func_t *)on_pre_input_hook; + #endif + /* Set our completion function */ +- rl_attempted_completion_function = (CPPFunction *)flex_complete; ++ rl_attempted_completion_function = (rl_completion_func_t *)flex_complete; + /* Set Python word break characters */ + rl_completer_word_break_characters = + strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?"); +-- +1.7.9.5 + diff --git a/meta/recipes-devtools/python/python/python2.7.3-nossl3.patch b/meta/recipes-devtools/python/python/python2.7.3-nossl3.patch new file mode 100644 index 0000000000..2d35520a6d --- /dev/null +++ b/meta/recipes-devtools/python/python/python2.7.3-nossl3.patch @@ -0,0 +1,37 @@ +python: Building without SSLv3 support + +Building without SSLv3 support when openssl is built +without any support for SSLv3 + +Upstream-Status: Backport + +Reference: +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=76A8611#22 + +Signed-off-by: Sona Sarmadi +--- +diff -ruN a/Modules/_ssl.c b/Modules/_ssl.c +--- a/Modules/_ssl.c 2014-11-26 07:43:58.755679939 +0100 ++++ b/Modules/_ssl.c 2014-11-26 07:49:10.454182400 +0100 +@@ -302,8 +302,10 @@ + PySSL_BEGIN_ALLOW_THREADS + if (proto_version == PY_SSL_VERSION_TLS1) + self->ctx = SSL_CTX_new(TLSv1_method()); /* Set up context */ ++#ifndef OPENSSL_NO_SSL3 + else if (proto_version == PY_SSL_VERSION_SSL3) + self->ctx = SSL_CTX_new(SSLv3_method()); /* Set up context */ ++#endif + #ifndef OPENSSL_NO_SSL2 + else if (proto_version == PY_SSL_VERSION_SSL2) + self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */ +@@ -1777,8 +1779,10 @@ + PyModule_AddIntConstant(m, "PROTOCOL_SSLv2", + PY_SSL_VERSION_SSL2); + #endif ++#ifndef OPENSSL_NO_SSL3 + PyModule_AddIntConstant(m, "PROTOCOL_SSLv3", + PY_SSL_VERSION_SSL3); ++#endif + PyModule_AddIntConstant(m, "PROTOCOL_SSLv23", + PY_SSL_VERSION_SSL23); + PyModule_AddIntConstant(m, "PROTOCOL_TLSv1", diff --git a/meta/recipes-devtools/python/python/remove_sqlite_rpath.patch b/meta/recipes-devtools/python/python/remove_sqlite_rpath.patch new file mode 100644 index 0000000000..4ec627ea51 --- /dev/null +++ b/meta/recipes-devtools/python/python/remove_sqlite_rpath.patch @@ -0,0 +1,19 @@ +This patch removes the RPATH setting which contains a pointer to +the target relocated sysroot, which is incorrect. + +Upstream-Status: Inappropriate [Embedded Specific] + +Signed-off-by: Saul Wold + +Index: Python-2.6.6/setup.py +=================================================================== +--- Python-2.6.6.orig/setup.py 2011-09-28 14:22:57.000000000 -0700 ++++ Python-2.6.6/setup.py 2011-09-28 16:11:25.147279633 -0700 +@@ -1079,7 +1079,6 @@ + include_dirs=["Modules/_sqlite", + sqlite_incdir], + library_dirs=sqlite_libdir, +- runtime_library_dirs=sqlite_libdir, + extra_link_args=sqlite_extra_link_args, + libraries=["sqlite3",])) + else: diff --git a/meta/recipes-devtools/python/python/run-ptest b/meta/recipes-devtools/python/python/run-ptest new file mode 100644 index 0000000000..89a769f743 --- /dev/null +++ b/meta/recipes-devtools/python/python/run-ptest @@ -0,0 +1,5 @@ +#!/bin/sh +# +#This script is used to run python test suites + +make -f /usr/lib/python/ptest/Makefile -k runtest-TESTS srcdir=/usr/lib/python2.7 TESTPROG=/usr/lib/python2.7/test/regrtest.py | sed -e '/\.\.\. ok/ s/^/PASS: /g' -e '/\.\.\. [ERROR|FAIL]/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g' diff --git a/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch b/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch new file mode 100644 index 0000000000..0c1f1741cb --- /dev/null +++ b/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch @@ -0,0 +1,40 @@ +python should search for db.h in inc_dirs and not in a hardcoded path. +If db.h is found but HASHVERSION is not 2 we avoid a warning by not +adding this module to missing variable. + +Upstream-Status: Inappropriate [distribution] + +Signed-off-by: Andrei Gherzan + +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py 2012-04-05 22:27:22.437199989 +0300 ++++ Python-2.7.2/setup.py 2012-04-05 22:26:38.000000000 +0300 +@@ -1141,12 +1141,12 @@ + # the more recent berkeleydb's db.h file first in the include path + # when attempting to compile and it will fail. + f = "/usr/include/db.h" +- ++ if len(inc_dirs) != 0: ++ f = os.path.join(inc_dirs[0], "db.h") + if sys.platform == 'darwin': + if is_macosx_sdk_path(f): + sysroot = macosx_sdk_root() + f = os.path.join(sysroot, f[1:]) +- + if os.path.exists(f) and not db_incs: + data = open(f).read() + m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) +@@ -1161,8 +1161,10 @@ + libraries=libraries)) + else: + exts.append(Extension('bsddb185', ['bsddbmodule.c'])) +- else: +- missing.append('bsddb185') ++ # If a newer version is detected don't report an useless ++ # warning ++ #else: ++ # missing.append('bsddb185') + else: + missing.append('bsddb185') + diff --git a/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch b/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch new file mode 100644 index 0000000000..6ccdb948b9 --- /dev/null +++ b/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch @@ -0,0 +1,27 @@ +This patch skips over the 'import check' setup.py does when building +extensions. This generally won't work when cross-compiling. + +Upstream-Status: Inappropriate [embedded-specific] + +Signed-off-by: Tom Zanussi + +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py 2011-11-04 16:46:34.553796410 -0500 ++++ Python-2.7.2/setup.py 2011-11-04 16:59:49.692802313 -0500 +@@ -287,6 +287,15 @@ + (ext.name, sys.exc_info()[1])) + self.failed.append(ext.name) + return ++ ++ # If we're cross-compiling, we want to skip the import check ++ # i.e. we shouldn't be dynamically loading target shared libs ++ if os.environ.get('CROSS_COMPILE') is not None: ++ self.announce( ++ 'WARNING: skipping import check for cross-compiled "%s"' % ++ ext.name) ++ return ++ + # Workaround for Mac OS X: The Carbon-based modules cannot be + # reliably imported into a command-line Python + if 'Carbon' in ext.extra_link_args: diff --git a/meta/recipes-devtools/python/python/setuptweaks.patch b/meta/recipes-devtools/python/python/setuptweaks.patch new file mode 100644 index 0000000000..c34ef160d3 --- /dev/null +++ b/meta/recipes-devtools/python/python/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: Configuration [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/meta/recipes-devtools/python/python/sitecustomize.py b/meta/recipes-devtools/python/python/sitecustomize.py new file mode 100644 index 0000000000..273901898a --- /dev/null +++ b/meta/recipes-devtools/python/python/sitecustomize.py @@ -0,0 +1,45 @@ +# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer +# 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 + +def __enableDefaultEncoding(): + import sys + try: + sys.setdefaultencoding( "utf8" ) + except LookupError: + pass + +import sys +try: + import rlcompleter, readline +except ImportError: + pass +else: + __enableDefaultEncoding() + __registerExitHandler() + __enableReadlineSupport() diff --git a/meta/recipes-devtools/python/python3-distribute_0.6.32.bb b/meta/recipes-devtools/python/python3-distribute_0.6.32.bb new file mode 100644 index 0000000000..0ef3a8762f --- /dev/null +++ b/meta/recipes-devtools/python/python3-distribute_0.6.32.bb @@ -0,0 +1,51 @@ +SUMMARY = "Download, build, install, upgrade, and uninstall Python packages" +HOMEPAGE = "http://packages.python.org/distribute" +SECTION = "devel/python" +LICENSE = "PSF" +LIC_FILES_CHKSUM = "file://setup.py;beginline=234;endline=234;md5=26f6b02022b737126d3c88838782dddb" + +SRCNAME = "distribute" +PR = "ml5" +DEPENDS += "python3" +DEPENDS_class-native += "python3-native" + +SRC_URI = " \ + http://pypi.python.org/packages/source/d/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \ +" +SRC_URI[md5sum] = "acb7a2da81e3612bfb1608abe4f0e568" +SRC_URI[sha256sum] = "8970cd1e148b5d1fea9430584aea66c45ea22d80e0933393ec49ebc388f718df" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +# http://python-distribute.org/distribute_setup.py + +# force the selection of python3 +#PYTHON_BASEVERSION = "3.3" +#PYTHON_MAJMIN = "3.3" + +inherit distutils3 + +DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages" + +do_install_prepend() { + install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages +} +# +# The installer puts the wrong path in the setuptools.pth file. Correct it. +# +do_install_append() { + rm ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth + mv ${D}${bindir}/easy_install ${D}${bindir}/easy3_install + echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth + sed -i -e '1s|^#!.*python|#!/usr/bin/env python3|' \ + ${D}${PYTHON_SITEPACKAGES_DIR}/distribute-${PV}-py${PYTHON_BASEVERSION}.egg/setuptools/tests/test_resources.py +} + +RDEPENDS_${PN} = "\ + python3-distutils \ + python3-compression \ +" + +RPROVIDES_${PN} += "python3-setuptools" + +BBCLASSEXTEND = "native" diff --git a/meta/recipes-devtools/python/python3-native_3.3.3.bb b/meta/recipes-devtools/python/python3-native_3.3.3.bb new file mode 100644 index 0000000000..9ae2a0b373 --- /dev/null +++ b/meta/recipes-devtools/python/python3-native_3.3.3.bb @@ -0,0 +1,77 @@ +require recipes-devtools/python/python.inc + +PR = "${INC_PR}.0" +PYTHON_MAJMIN = "3.3" +DISTRO_SRC_URI ?= "file://sitecustomize.py" +DISTRO_SRC_URI_linuxstdbase = "" +SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \ +file://12-distutils-prefix-is-inside-staging-area.patch \ +file://python-config.patch \ +file://000-cross-compile.patch \ +file://020-dont-compile-python-files.patch \ +file://030-fixup-include-dirs.patch \ +file://070-dont-clean-ipkg-install.patch \ +file://080-distutils-dont_adjust_files.patch \ +file://110-enable-zlib.patch \ +file://130-readline-setup.patch \ +file://150-fix-setupterm.patch \ +file://python-3.3-multilib.patch \ +file://03-fix-tkinter-detection.patch \ +file://avoid_warning_about_tkinter.patch \ +file://06-ctypes-libffi-fix-configure.patch \ +file://shutil-follow-symlink-fix.patch \ +file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \ +file://sysroot-include-headers.patch \ +file://unixccompiler.patch \ +file://fix-ast.h-dependency.patch \ +file://makerace.patch \ +${DISTRO_SRC_URI} \ +file://python3-fix-build-error-with-Readline-6.3.patch \ +" +SRC_URI[md5sum] = "f3ebe34d4d8695bf889279b54673e10c" +SRC_URI[sha256sum] = "e526e9b612f623888364d30cc9f3dfc34dcef39065c713bdbcddf47df84d8dcb" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=4eaea08eaaf6875189b0c49f26fa2005" + +S = "${WORKDIR}/Python-${PV}" + +EXTRANATIVEPATH += "bzip2-native" +DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native" + +inherit native + +RPROVIDES += "python3-distutils-native python3-compression-native python3-textutils-native python3-core-native" + +EXTRA_OECONF_append = " --bindir=${bindir}/${PN}" + +EXTRA_OEMAKE = '\ + BUILD_SYS="" \ + HOST_SYS="" \ + LIBC="" \ + STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \ + STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \ + LIB=${baselib} \ + ARCH=${TARGET_ARCH} \ +' + +# No ctypes option for python 3 +PYTHONLSBOPTS = "" + +do_configure_prepend() { + autoreconf --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" +} + +do_install() { + install -d ${D}${libdir}/pkgconfig + oe_runmake 'DESTDIR=${D}' install + if [ -e ${WORKDIR}/sitecustomize.py ]; then + install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} + fi + install -d ${D}${bindir}/${PN} + install -m 0755 Parser/pgen ${D}${bindir}/${PN} + + # Make sure we use /usr/bin/env python + for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do + sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT + done +} diff --git a/meta/recipes-devtools/python/python3/000-cross-compile.patch b/meta/recipes-devtools/python/python3/000-cross-compile.patch new file mode 100644 index 0000000000..2506a590c0 --- /dev/null +++ b/meta/recipes-devtools/python/python3/000-cross-compile.patch @@ -0,0 +1,83 @@ +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(-) + +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -193,6 +193,7 @@ LIBOBJS= @LIBOBJS@ + + PYTHON= python$(EXE) + BUILDPYTHON= python$(BUILDEXE) ++HOSTPYTHON= $(BUILDPYTHON) + + PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@ + _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@ +@@ -239,6 +240,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ + ########################################################################## + # Parser + PGEN= Parser/pgen$(EXE) ++HOSTPGEN= $(PGEN)$(EXE) + + PSRCS= \ + Parser/acceler.c \ +@@ -451,7 +453,7 @@ build_all_generate_profile: + + run_profile_task: + : # FIXME: can't run for a cross build +- $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) ++ $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK) + + build_all_use_profile: + $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use -fprofile-correction" +@@ -640,7 +642,7 @@ $(IO_OBJS): $(IO_H) + $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) + @$(MKDIR_P) Include + $(MAKE) $(PGEN) +- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) ++ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) + $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS) + $(MAKE) $(GRAMMAR_H) + touch $(GRAMMAR_C) +@@ -820,7 +822,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho + ###################################################################### + + TESTOPTS= $(EXTRATESTOPTS) +-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS) ++TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS) + TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py + TESTTIMEOUT= 3600 + +@@ -1229,7 +1231,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 +@@ -1288,7 +1290,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 +@@ -1414,7 +1416,7 @@ funny: + + # Perform some verification checks on any modified files. + patchcheck: +- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py ++ $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py + + # Dependencies + diff --git a/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch b/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/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 +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 + +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/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch b/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch new file mode 100644 index 0000000000..03ef286941 --- /dev/null +++ b/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch @@ -0,0 +1,37 @@ +Dont cross compile site packages + +-Khem + +Upstream-Status: Inappropriate[Embedded-Specific] + +--- + Makefile.pre.in | 16 ---------------- + 1 file changed, 16 deletions(-) + +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1078,24 +1078,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 $(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) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ diff --git a/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch b/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch new file mode 100644 index 0000000000..fddfd2b2f6 --- /dev/null +++ b/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 + +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/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch b/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch new file mode 100644 index 0000000000..6beac7b805 --- /dev/null +++ b/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/meta/recipes-devtools/python/python3/04-default-is-optimized.patch b/meta/recipes-devtools/python/python3/04-default-is-optimized.patch new file mode 100644 index 0000000000..d5afd40025 --- /dev/null +++ b/meta/recipes-devtools/python/python3/04-default-is-optimized.patch @@ -0,0 +1,58 @@ +Upstream-Status: Inappropriate [embedded specific] + +Updated original patch for python 2.7.3 + +Signed-Off-By: Nitin A Kamble +2012/05/01 + + +# when compiling for an embedded system, we need every bit of +# performance we can get. default to optimized with the option +# of opt-out. +# Signed-Off: Michael 'Mickey' Lauer + +Index: Python-3.2.3/Python/compile.c +=================================================================== +--- Python-3.2.3.orig/Python/compile.c 2012-04-10 23:54:08.000000000 -0700 ++++ Python-3.2.3/Python/compile.c 2012-09-19 15:58:46.649123998 -0700 +@@ -30,7 +30,7 @@ + #include "symtable.h" + #include "opcode.h" + +-int Py_OptimizeFlag = 0; ++int Py_OptimizeFlag = 1; + + #define DEFAULT_BLOCK_SIZE 16 + #define DEFAULT_BLOCKS 8 +Index: Python-3.2.3/Modules/main.c +=================================================================== +--- Python-3.2.3.orig/Modules/main.c 2012-04-10 23:54:07.000000000 -0700 ++++ Python-3.2.3/Modules/main.c 2012-09-19 16:00:32.153124053 -0700 +@@ -46,7 +46,7 @@ + static int orig_argc; + + /* command line options */ +-#define BASE_OPTS L"bBc:dEhiJm:OqRsStuvVW:xX:?" ++#define BASE_OPTS L"bBc:dEhiJm:NOqRsStuvVW:xX:?" + + #define PROGRAM_OPTS BASE_OPTS + +@@ -71,6 +71,7 @@ + -m mod : run library module as a script (terminates option list)\n\ + -O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\ + -OO : remove doc-strings in addition to the -O optimizations\n\ ++-N : do NOT optimize generated bytecode\n\ + -q : don't print version and copyright messages on interactive startup\n\ + -R : use a pseudo-random salt to make hash() values of various types be\n\ + unpredictable between separate invocations of the interpreter, as\n\ +@@ -407,8 +408,8 @@ + + /* case 'J': reserved for Jython */ + +- case 'O': +- Py_OptimizeFlag++; ++ case 'N': ++ Py_OptimizeFlag=0; + break; + + case 'B': diff --git a/meta/recipes-devtools/python/python3/06-ctypes-libffi-fix-configure.patch b/meta/recipes-devtools/python/python3/06-ctypes-libffi-fix-configure.patch new file mode 100644 index 0000000000..abd63d2a96 --- /dev/null +++ b/meta/recipes-devtools/python/python3/06-ctypes-libffi-fix-configure.patch @@ -0,0 +1,44 @@ +This fixes configure issues with recent autoconf, e.g: + autoreconf: Entering directory `Modules/_ctypes/libffi' + autoreconf: configure.ac: not using Gettext + autoreconf: running: aclocal --force + configure.ac:26: error: m4_copy: won't overwrite defined macro: _AC_ARG_VAR_PRECIOUS + configure.ac:26: the top level + +The problem is still present in python-2.6.5 but fixed in python-svn. + +Upstream-Status: Accepted [python-svn] + +Signed-off-by: Antonio Ospite +Acked-by: Martin Jansa +Signed-off-by: Martin Jansa +Signed-off-by: Saul Wold + + +2011/09/29 +Rebased for python 2.7.2 +Signed-Off-By: Nitin A Kamble + + +Index: Python-2.7.2/Modules/_ctypes/libffi/Makefile.am +=================================================================== +--- Python-2.7.2.orig/Modules/_ctypes/libffi/Makefile.am ++++ Python-2.7.2/Modules/_ctypes/libffi/Makefile.am +@@ -2,7 +2,7 @@ + + AUTOMAKE_OPTIONS = foreign subdir-objects + +-SUBDIRS = include testsuite man ++SUBDIRS = include + + EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \ + src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \ +@@ -34,8 +34,6 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change + libtool-version ChangeLog.libffi m4/libtool.m4 \ + m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 + +-info_TEXINFOS = doc/libffi.texi +- + ## ################################################################ + + ## diff --git a/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch b/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch new file mode 100644 index 0000000000..789929b715 --- /dev/null +++ b/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/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch b/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch new file mode 100644 index 0000000000..b96419a638 --- /dev/null +++ b/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/meta/recipes-devtools/python/python3/110-enable-zlib.patch b/meta/recipes-devtools/python/python3/110-enable-zlib.patch new file mode 100644 index 0000000000..fb92a19163 --- /dev/null +++ b/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/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch new file mode 100644 index 0000000000..c5846a5af8 --- /dev/null +++ b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch @@ -0,0 +1,78 @@ +Upstream-Status: Inappropriate [embedded specific] + +# The proper prefix is inside our staging area. +# Signed-Off: Michael 'Mickey' Lauer +# Signed-off-by: Phil Blundell +# Signed-off-by: Khem Raj + +Index: Python-3.3.2/Lib/distutils/sysconfig.py +=================================================================== +--- Python-3.3.2.orig/Lib/distutils/sysconfig.py 2013-07-30 00:00:52.769749805 -0700 ++++ Python-3.3.2/Lib/distutils/sysconfig.py 2013-07-30 00:16:22.545767248 -0700 +@@ -16,10 +16,11 @@ + 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/PCBuild9. If we're dealing with an x64 Windows build, +@@ -93,7 +94,9 @@ + 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: +@@ -136,6 +139,12 @@ + 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 and os.environ['STAGING_LIBDIR'] != "": ++ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1] ++ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename) ++ else: ++ lib_basename = sys.lib ++ + if prefix is None: + if standard_lib: + prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX +@@ -144,7 +153,7 @@ + + 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: +@@ -249,7 +258,7 @@ + else: + # The name of the config.h file changed in 2.2 + config_h = 'pyconfig.h' +- return os.path.join(inc_dir, config_h) ++ return os.path.join(inc_dir, config_h).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) + + + def get_makefile_filename(): +@@ -258,7 +267,7 @@ + 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): diff --git a/meta/recipes-devtools/python/python3/130-readline-setup.patch b/meta/recipes-devtools/python/python3/130-readline-setup.patch new file mode 100644 index 0000000000..c805652d69 --- /dev/null +++ b/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/meta/recipes-devtools/python/python3/150-fix-setupterm.patch b/meta/recipes-devtools/python/python3/150-fix-setupterm.patch new file mode 100644 index 0000000000..78d7c78670 --- /dev/null +++ b/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 + #endif diff --git a/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch b/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch new file mode 100644 index 0000000000..054a13124c --- /dev/null +++ b/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch @@ -0,0 +1,29 @@ +We should make sure that sysroot is used by gcc instead of assuming +hardcoded locations for include paths + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +: +Index: Python-3.3.3/configure.ac +=================================================================== +--- Python-3.3.3.orig/configure.ac 2014-01-29 19:00:15.245312752 -0800 ++++ Python-3.3.3/configure.ac 2014-01-29 23:27:22.938526262 -0800 +@@ -1548,7 +1548,7 @@ + # checks for header files + AC_HEADER_STDC + ac_save_cppflags="$CPPFLAGS" +-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" ++CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw" + AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \ + fcntl.h grp.h \ + ieeefp.h io.h langinfo.h libintl.h ncurses.h process.h pthread.h \ +@@ -4308,7 +4308,7 @@ + fi + + ac_save_cppflags="$CPPFLAGS" +-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" ++CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw" + # On HP/UX 11.0, mvwdelch is a block with a return statement + AC_MSG_CHECKING(whether mvwdelch is an expression) + AC_CACHE_VAL(ac_cv_mvwdelch_is_expression, diff --git a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch new file mode 100644 index 0000000000..208c57c822 --- /dev/null +++ b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch @@ -0,0 +1,25 @@ +_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] + +Signed-off-by: Andrei Gherzan + +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 a/meta/recipes-devtools/python/python3/cgi_py.patch b/meta/recipes-devtools/python/python3/cgi_py.patch new file mode 100644 index 0000000000..de504f9dcf --- /dev/null +++ b/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 + +--- 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/meta/recipes-devtools/python/python3/fix-ast.h-dependency.patch b/meta/recipes-devtools/python/python3/fix-ast.h-dependency.patch new file mode 100644 index 0000000000..77c220aa82 --- /dev/null +++ b/meta/recipes-devtools/python/python3/fix-ast.h-dependency.patch @@ -0,0 +1,26 @@ +Fix a missed dependency on ast.h which can result in race condition +at high parallel build + +It fixed here + +http://hg.python.org/cpython/rev/cfe0a293551f + +[YOCTO #5884] + +Upstream-Status: Backport +Signed-off-by: Khem Raj + +Index: Python-3.3.3/Makefile.pre.in +=================================================================== +--- Python-3.3.3.orig/Makefile.pre.in 2014-02-26 09:33:13.868288863 -0800 ++++ Python-3.3.3/Makefile.pre.in 2014-02-26 09:36:27.348292492 -0800 +@@ -853,7 +853,8 @@ + $(srcdir)/Include/warnings.h \ + $(srcdir)/Include/weakrefobject.h \ + pyconfig.h \ +- $(PARSER_HEADERS) ++ $(PARSER_HEADERS) \ ++ $(AST_H) + + $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS) + diff --git a/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch b/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch new file mode 100644 index 0000000000..cd1a978eb3 --- /dev/null +++ b/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 +Date: 2012/03/14 + +Updated for python 2.7.3 +Signed-Off-By: Nitin A Kamble +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/meta/recipes-devtools/python/python3/host_include_contamination.patch b/meta/recipes-devtools/python/python3/host_include_contamination.patch new file mode 100644 index 0000000000..ef2054d9a9 --- /dev/null +++ b/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 +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/meta/recipes-devtools/python/python3/makerace.patch b/meta/recipes-devtools/python/python3/makerace.patch new file mode 100644 index 0000000000..d8a68923a8 --- /dev/null +++ b/meta/recipes-devtools/python/python3/makerace.patch @@ -0,0 +1,28 @@ +There is a race due to the execution of make inside the makefile: + +| gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c +| gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Parser/pgen.o Parser/pgen.c| gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c +| gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c +| Objects/obmalloc.o: file not recognized: File truncated +| collect2: error: ld returned 1 exit status +| make[1]: *** [Parser/pgen] Error 1 + +The easiest way to avoid this is to list the dependencies explictly. + +RP 28/2/2014 + +Upstream-Status: Pending + +Index: Python-3.3.3/Makefile.pre.in +=================================================================== +--- Python-3.3.3.orig/Makefile.pre.in 2014-02-27 14:04:38.268339533 +0000 ++++ Python-3.3.3/Makefile.pre.in 2014-02-28 10:40:59.166361125 +0000 +@@ -676,7 +676,7 @@ + + $(IO_OBJS): $(IO_H) + +-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) ++$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) $(PGEN) + @$(MKDIR_P) Include + $(MAKE) $(PGEN) + $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) diff --git a/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/meta/recipes-devtools/python/python3/python-3.3-multilib.patch new file mode 100644 index 0000000000..7d66a0e00d --- /dev/null +++ b/meta/recipes-devtools/python/python3/python-3.3-multilib.patch @@ -0,0 +1,336 @@ +get the sys.lib from python itself and do not use hardcoded value of 'lib' + +-Khem + +Upstream-Status: Pending + +Index: Python-3.3.2/Include/pythonrun.h +=================================================================== +--- Python-3.3.2.orig/Include/pythonrun.h 2013-05-15 09:32:54.000000000 -0700 ++++ Python-3.3.2/Include/pythonrun.h 2013-07-27 16:19:54.099877246 -0700 +@@ -181,6 +181,8 @@ + /* In their own files */ + PyAPI_FUNC(const char *) Py_GetVersion(void); + PyAPI_FUNC(const char *) Py_GetPlatform(void); ++PyAPI_FUNC(const char *) Py_GetArch(void); ++PyAPI_FUNC(const char *) Py_GetLib(void); + PyAPI_FUNC(const char *) Py_GetCopyright(void); + PyAPI_FUNC(const char *) Py_GetCompiler(void); + PyAPI_FUNC(const char *) Py_GetBuildInfo(void); +Index: Python-3.3.2/Lib/distutils/command/install.py +=================================================================== +--- Python-3.3.2.orig/Lib/distutils/command/install.py 2013-05-15 09:32:54.000000000 -0700 ++++ Python-3.3.2/Lib/distutils/command/install.py 2013-07-27 16:19:54.099877246 -0700 +@@ -25,6 +25,8 @@ + from site import USER_SITE + HAS_USER_SITE = True + ++libname = sys.lib ++ + if sys.version < "2.2": + WINDOWS_SCHEME = { + 'purelib': '$base', +@@ -45,7 +47,7 @@ + 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.3.2/Lib/pydoc.py +=================================================================== +--- Python-3.3.2.orig/Lib/pydoc.py 2013-05-15 09:32:55.000000000 -0700 ++++ Python-3.3.2/Lib/pydoc.py 2013-07-27 16:19:54.103877246 -0700 +@@ -372,7 +372,7 @@ + + 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.3.2/Lib/site.py +=================================================================== +--- Python-3.3.2.orig/Lib/site.py 2013-05-15 09:32:55.000000000 -0700 ++++ Python-3.3.2/Lib/site.py 2013-07-27 16:19:54.103877246 -0700 +@@ -303,13 +303,19 @@ + if sys.platform in ('os2emx', 'riscos'): + sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) + elif os.sep == '/': +- sitepackages.append(os.path.join(prefix, "lib", ++ sitepackages.append(os.path.join(prefix, sys.lib, + "python" + sys.version[:3], + "site-packages")) +- sitepackages.append(os.path.join(prefix, "lib", "site-python")) ++ if sys.lib != "lib": ++ sitepackages.append(os.path.join(prefix, "lib", ++ "python" + sys.version[:3], ++ "site-packages")) ++ sitepackages.append(os.path.join(prefix, sys.lib, "site-python")) ++ if sys.lib != "lib": ++ sitepackages.append(os.path.join(prefix, "lib", "site-python")) + 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.3.2/Lib/trace.py +=================================================================== +--- Python-3.3.2.orig/Lib/trace.py 2013-05-15 09:32:56.000000000 -0700 ++++ Python-3.3.2/Lib/trace.py 2013-07-27 16:19:54.103877246 -0700 +@@ -751,10 +751,10 @@ + # 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.3.2/Makefile.pre.in +=================================================================== +--- Python-3.3.2.orig/Makefile.pre.in 2013-07-27 16:19:16.000000000 -0700 ++++ Python-3.3.2/Makefile.pre.in 2013-07-27 16:19:54.103877246 -0700 +@@ -96,6 +96,8 @@ + + # Machine-dependent subdirectories + MACHDEP= @MACHDEP@ ++LIB= @LIB@ ++ARCH= @ARCH@ + + # Multiarch directory (may be empty) + MULTIARCH= @MULTIARCH@ +@@ -115,7 +117,7 @@ + MANDIR= @mandir@ + INCLUDEDIR= @includedir@ + CONFINCLUDEDIR= $(exec_prefix)/include +-SCRIPTDIR= $(prefix)/lib ++SCRIPTDIR= @libdir@ + ABIFLAGS= @ABIFLAGS@ + + # Detailed destination directories +@@ -635,6 +637,7 @@ + -DEXEC_PREFIX='"$(exec_prefix)"' \ + -DVERSION='"$(VERSION)"' \ + -DVPATH='"$(VPATH)"' \ ++ -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \ + -o $@ $(srcdir)/Modules/getpath.c + + Modules/python.o: $(srcdir)/Modules/python.c +@@ -701,7 +704,7 @@ + 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.3.2/Modules/getpath.c +=================================================================== +--- Python-3.3.2.orig/Modules/getpath.c 2013-05-15 09:32:59.000000000 -0700 ++++ Python-3.3.2/Modules/getpath.c 2013-07-27 16:19:54.107877246 -0700 +@@ -121,9 +121,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 +@@ -135,7 +137,7 @@ + static wchar_t progpath[MAXPATHLEN+1]; + static wchar_t *module_search_path = NULL; + static int module_search_path_malloced = 0; +-static wchar_t *lib_python = L"lib/python" VERSION; ++static wchar_t *lib_python = L"" LIB_PYTHON; + + static void + reduce(wchar_t *dir) +Index: Python-3.3.2/Python/getplatform.c +=================================================================== +--- Python-3.3.2.orig/Python/getplatform.c 2013-05-15 09:33:00.000000000 -0700 ++++ Python-3.3.2/Python/getplatform.c 2013-07-27 16:19:54.107877246 -0700 +@@ -10,3 +10,23 @@ + { + 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.3.2/Python/sysmodule.c +=================================================================== +--- Python-3.3.2.orig/Python/sysmodule.c 2013-05-15 09:33:00.000000000 -0700 ++++ Python-3.3.2/Python/sysmodule.c 2013-07-27 16:19:54.107877246 -0700 +@@ -1612,6 +1612,10 @@ + 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.3.2/setup.py +=================================================================== +--- Python-3.3.2.orig/setup.py 2013-07-27 16:19:17.000000000 -0700 ++++ Python-3.3.2/setup.py 2013-07-27 16:19:54.107877246 -0700 +@@ -439,7 +439,7 @@ + # 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: +@@ -497,8 +497,7 @@ + # 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: +@@ -675,11 +674,11 @@ + 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.3.2/Lib/sysconfig.py +=================================================================== +--- Python-3.3.2.orig/Lib/sysconfig.py 2013-05-15 09:32:55.000000000 -0700 ++++ Python-3.3.2/Lib/sysconfig.py 2013-07-27 16:19:54.111877246 -0700 +@@ -21,10 +21,10 @@ + + _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': +@@ -33,10 +33,10 @@ + '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', +@@ -81,10 +81,10 @@ + '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.3.2/configure.ac +=================================================================== +--- Python-3.3.2.orig/configure.ac 2013-05-15 09:33:00.000000000 -0700 ++++ Python-3.3.2/configure.ac 2013-07-27 16:19:54.111877246 -0700 +@@ -769,6 +769,41 @@ + MULTIARCH=$($CC --print-multiarch 2>/dev/null) + AC_SUBST(MULTIARCH) + ++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_SUBST(LIBRARY) + AC_MSG_CHECKING(LIBRARY) diff --git a/meta/recipes-devtools/python/python3/python-config.patch b/meta/recipes-devtools/python/python3/python-config.patch new file mode 100644 index 0000000000..f23b8b7df0 --- /dev/null +++ b/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 +: +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/meta/recipes-devtools/python/python3/python3-fix-build-error-with-Readline-6.3.patch b/meta/recipes-devtools/python/python3/python3-fix-build-error-with-Readline-6.3.patch new file mode 100644 index 0000000000..44e2b7e5f1 --- /dev/null +++ b/meta/recipes-devtools/python/python3/python3-fix-build-error-with-Readline-6.3.patch @@ -0,0 +1,62 @@ +python3: fix build error with Readline 6.3 + +Backport two patches from upstream: + +use new readline function types (closes #20374) +Issue #20374: Avoid compiler warnings when compiling readline with libedit. + +Upstream-Status: Backport + +Signed-off-by: Chong Lu +--- + Modules/readline.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/Modules/readline.c b/Modules/readline.c +index 096c6d1..1646ef8 100644 +--- a/Modules/readline.c ++++ b/Modules/readline.c +@@ -773,15 +773,24 @@ on_hook(PyObject *func) + return result; + } + ++ + static int ++#if defined(_RL_FUNCTION_TYPEDEF) + on_startup_hook(void) ++#else ++on_startup_hook() ++#endif + { + return on_hook(startup_hook); + } + + #ifdef HAVE_RL_PRE_INPUT_HOOK + static int ++#if defined(_RL_FUNCTION_TYPEDEF) + on_pre_input_hook(void) ++#else ++on_pre_input_hook() ++#endif + { + return on_hook(pre_input_hook); + } +@@ -936,12 +945,12 @@ setup_readline(void) + rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap); + rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap); + /* Set our hook functions */ +- rl_startup_hook = (Function *)on_startup_hook; ++ rl_startup_hook = (rl_hook_func_t *)on_startup_hook; + #ifdef HAVE_RL_PRE_INPUT_HOOK +- rl_pre_input_hook = (Function *)on_pre_input_hook; ++ rl_pre_input_hook = (rl_hook_func_t *)on_pre_input_hook; + #endif + /* Set our completion function */ +- rl_attempted_completion_function = (CPPFunction *)flex_complete; ++ rl_attempted_completion_function = (rl_completion_func_t *)flex_complete; + /* Set Python word break characters */ + completer_word_break_characters = + rl_completer_word_break_characters = +-- +1.7.9.5 + diff --git a/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch b/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch new file mode 100644 index 0000000000..8b6476037f --- /dev/null +++ b/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch @@ -0,0 +1,32 @@ +From 43238e1ac13e32984d015c92a5841f3de1fe1d15 Mon Sep 17 00:00:00 2001 +From: Jackie Huang +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 +--- + 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/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch new file mode 100644 index 0000000000..bf0a56f220 --- /dev/null +++ b/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch @@ -0,0 +1,27 @@ +From 53ed216d7bf70dd2a925432b6805a701e5fc3e0e Mon Sep 17 00:00:00 2001 +From: Jackie Huang +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 +--- + 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/meta/recipes-devtools/python/python3/remove_sqlite_rpath.patch b/meta/recipes-devtools/python/python3/remove_sqlite_rpath.patch new file mode 100644 index 0000000000..4ec627ea51 --- /dev/null +++ b/meta/recipes-devtools/python/python3/remove_sqlite_rpath.patch @@ -0,0 +1,19 @@ +This patch removes the RPATH setting which contains a pointer to +the target relocated sysroot, which is incorrect. + +Upstream-Status: Inappropriate [Embedded Specific] + +Signed-off-by: Saul Wold + +Index: Python-2.6.6/setup.py +=================================================================== +--- Python-2.6.6.orig/setup.py 2011-09-28 14:22:57.000000000 -0700 ++++ Python-2.6.6/setup.py 2011-09-28 16:11:25.147279633 -0700 +@@ -1079,7 +1079,6 @@ + include_dirs=["Modules/_sqlite", + sqlite_incdir], + library_dirs=sqlite_libdir, +- runtime_library_dirs=sqlite_libdir, + extra_link_args=sqlite_extra_link_args, + libraries=["sqlite3",])) + else: diff --git a/meta/recipes-devtools/python/python3/setuptweaks.patch b/meta/recipes-devtools/python/python3/setuptweaks.patch new file mode 100644 index 0000000000..c34ef160d3 --- /dev/null +++ b/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: Configuration [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/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch b/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch new file mode 100644 index 0000000000..802b1c7203 --- /dev/null +++ b/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/meta/recipes-devtools/python/python3/sitecustomize.py b/meta/recipes-devtools/python/python3/sitecustomize.py new file mode 100644 index 0000000000..4c8b5e2ba3 --- /dev/null +++ b/meta/recipes-devtools/python/python3/sitecustomize.py @@ -0,0 +1,37 @@ +# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer +# 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/meta/recipes-devtools/python/python3/sys_platform_is_now_always_linux2.patch b/meta/recipes-devtools/python/python3/sys_platform_is_now_always_linux2.patch new file mode 100644 index 0000000000..506210fa17 --- /dev/null +++ b/meta/recipes-devtools/python/python3/sys_platform_is_now_always_linux2.patch @@ -0,0 +1,29 @@ +Upstream-Status: Accepted [http://hg.python.org/cpython/rev/c816479f6aaf/] +Bugtracker: http://bugs.python.org/issue12326 + +[Removed "Misc/NEWS" hunk] + +Signed-off-by: Andreas Oberritter + +# HG changeset patch +# User Victor Stinner +# Date 1313841758 -7200 +# Node ID c816479f6aaf71dbd3f3fe4b239186d60c55ce48 +# Parent 3e093590ac57fdda428c7da3f72ddf0c475ecf2b +Issue #12326: sys.platform is now always 'linux2' on Linux + +Even if Python is compiled on Linux 3. + +Index: Python-3.3.0rc2/configure.ac +=================================================================== +--- Python-3.3.0rc2.orig/configure.ac 2012-09-09 02:11:14.000000000 -0700 ++++ Python-3.3.0rc2/configure.ac 2012-09-20 00:44:03.317124001 -0700 +@@ -366,7 +366,7 @@ + MACHDEP="$ac_md_system$ac_md_release" + + case $MACHDEP in +- linux*) MACHDEP="linux";; ++ linux*) MACHDEP="linux2";; + cygwin*) MACHDEP="cygwin";; + darwin*) MACHDEP="darwin";; + irix646) MACHDEP="irix6";; diff --git a/meta/recipes-devtools/python/python3/sysroot-include-headers.patch b/meta/recipes-devtools/python/python3/sysroot-include-headers.patch new file mode 100644 index 0000000000..785b5567f2 --- /dev/null +++ b/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/meta/recipes-devtools/python/python3/unixccompiler.patch b/meta/recipes-devtools/python/python3/unixccompiler.patch new file mode 100644 index 0000000000..7b90f13883 --- /dev/null +++ b/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= 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 +Signed-off-by: Khem Raj +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/meta/recipes-devtools/python/python3_3.3.3.bb b/meta/recipes-devtools/python/python3_3.3.3.bb new file mode 100644 index 0000000000..2c1f63f5b8 --- /dev/null +++ b/meta/recipes-devtools/python/python3_3.3.3.bb @@ -0,0 +1,219 @@ +require recipes-devtools/python/python.inc + +DEPENDS = "python3-native libffi bzip2 db gdbm openssl readline sqlite3 zlib virtual/libintl xz" +PR = "${INC_PR}.0" +PYTHON_MAJMIN = "3.3" +PYTHON_BINABI= "${PYTHON_MAJMIN}m" +DISTRO_SRC_URI ?= "file://sitecustomize.py" +DISTRO_SRC_URI_linuxstdbase = "" +SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \ +file://12-distutils-prefix-is-inside-staging-area.patch \ +file://python-config.patch \ +file://000-cross-compile.patch \ +file://020-dont-compile-python-files.patch \ +file://030-fixup-include-dirs.patch \ +file://070-dont-clean-ipkg-install.patch \ +file://080-distutils-dont_adjust_files.patch \ +file://110-enable-zlib.patch \ +file://130-readline-setup.patch \ +file://150-fix-setupterm.patch \ +file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \ +file://fix-ast.h-dependency.patch \ +file://makerace.patch \ +${DISTRO_SRC_URI} \ +file://python3-fix-build-error-with-Readline-6.3.patch \ +" + +SRC_URI += "\ + file://03-fix-tkinter-detection.patch \ + file://04-default-is-optimized.patch \ + file://avoid_warning_about_tkinter.patch \ + file://06-ctypes-libffi-fix-configure.patch \ + file://remove_sqlite_rpath.patch \ + file://cgi_py.patch \ + file://host_include_contamination.patch \ + file://python-3.3-multilib.patch \ + file://shutil-follow-symlink-fix.patch \ + file://sysroot-include-headers.patch \ + file://unixccompiler.patch \ + file://avoid-ncursesw-include-path.patch \ + file://python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \ + file://python3-setup.py-no-host-headers-libs.patch \ + " +SRC_URI[md5sum] = "f3ebe34d4d8695bf889279b54673e10c" +SRC_URI[sha256sum] = "e526e9b612f623888364d30cc9f3dfc34dcef39065c713bdbcddf47df84d8dcb" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=4eaea08eaaf6875189b0c49f26fa2005" + +S = "${WORKDIR}/Python-${PV}" + +inherit autotools multilib_header python3native pkgconfig + +CONFIGUREOPTS += " --with-system-ffi " + +CACHED_CONFIGUREVARS = "ac_cv_have_chflags=no \ + ac_cv_have_lchflags=no \ + ac_cv_have_long_long_format=yes \ + ac_cv_buggy_getaddrinfo=no \ + ac_cv_file__dev_ptmx=yes \ + ac_cv_file__dev_ptc=no \ +" +# The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources +#Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :( +TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__" +TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__" +TARGET_CC_ARCH += "-DNDEBUG -fno-inline" +EXTRA_OEMAKE += "CROSS_COMPILE=yes" +EXTRA_OECONF += "CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/" + +# No ctypes option for python 3 +PYTHONLSBOPTS = "" + +do_configure_prepend() { + rm -f ${S}/Makefile.orig + autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" +} + +do_compile() { + # regenerate platform specific files, because they depend on system headers + cd Lib/plat-linux* + include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python3-native/python3 \ + ${S}/Tools/scripts/h2py.py -i '(u_long)' \ + ${STAGING_INCDIR}/dlfcn.h \ + ${STAGING_INCDIR}/linux/cdrom.h \ + ${STAGING_INCDIR}/netinet/in.h \ + ${STAGING_INCDIR}/sys/types.h + sed -e 's,${STAGING_DIR_HOST},,g' -i *.py + cd - + + # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144 + sed -i -e s,ccache\ ,'$(CCACHE) ', Makefile + + # remove any bogus LD_LIBRARY_PATH + sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile + + if [ ! -f Makefile.orig ]; then + install -m 0644 Makefile Makefile.orig + fi + sed -i -e 's,^CONFIGURE_LDFLAGS=.*,CONFIGURE_LDFLAGS=-L. -L${STAGING_LIBDIR},g' \ + -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \ + -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \ + -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \ + -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \ + -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \ + -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \ + Makefile + # save copy of it now, because if we do it in do_install and + # then call do_install twice we get Makefile.orig == Makefile.sysroot + install -m 0644 Makefile Makefile.sysroot + + export CROSS_COMPILE="${TARGET_PREFIX}" + export PYTHONBUILDDIR="${S}" + oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ + HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \ + STAGING_LIBDIR=${STAGING_LIBDIR} \ + STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ + STAGING_INCDIR=${STAGING_INCDIR} \ + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + LIB=${baselib} \ + ARCH=${TARGET_ARCH} \ + OPT="${CFLAGS}" libpython3.so + + oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ + HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \ + STAGING_LIBDIR=${STAGING_LIBDIR} \ + STAGING_INCDIR=${STAGING_INCDIR} \ + STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + LIB=${baselib} \ + ARCH=${TARGET_ARCH} \ + OPT="${CFLAGS}" +} + +do_install() { + # make install needs the original Makefile, or otherwise the inclues would + # go to ${D}${STAGING...}/... + install -m 0644 Makefile.orig Makefile + + export CROSS_COMPILE="${TARGET_PREFIX}" + export PYTHONBUILDDIR="${S}" + install -d ${D}${libdir}/pkgconfig + install -d ${D}${libdir}/python${PYTHON_MAJMIN}/config + + # rerun the build once again with original makefile this time + # run install in a separate step to avoid compile/install race + oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ + HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \ + STAGING_LIBDIR=${STAGING_LIBDIR} \ + STAGING_INCDIR=${STAGING_INCDIR} \ + STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + LIB=${baselib} \ + ARCH=${TARGET_ARCH} \ + DESTDIR=${D} LIBDIR=${libdir} + + oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ + HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \ + STAGING_LIBDIR=${STAGING_LIBDIR} \ + STAGING_INCDIR=${STAGING_INCDIR} \ + STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + LIB=${baselib} \ + ARCH=${TARGET_ARCH} \ + DESTDIR=${D} LIBDIR=${libdir} install + + install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile + + if [ -e ${WORKDIR}/sitecustomize.py ]; then + install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} + fi + + oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h +} + +do_install_append_class-nativesdk () { + create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' +} + +SSTATE_SCAN_FILES += "Makefile" +PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" + +py_package_preprocess () { + # copy back the old Makefile to fix target package + install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile + # Remove references to buildmachine paths in target Makefile + sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile +} + +require python-${PYTHON_MAJMIN}-manifest.inc + +# manual dependency additions +RPROVIDES_${PN}-core = "${PN}" +RRECOMMENDS_${PN}-core = "${PN}-readline" +RRECOMMENDS_${PN}-crypt = "openssl" +RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl" + +FILES_${PN}-2to3 += "${bindir}/2to3-${PYTHON_MAJMIN}" +FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3" +FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}" + +PACKAGES =+ "${PN}-pyvenv" +FILES_${PN}-pyvenv += "${bindir}/pyvenv-${PYTHON_MAJMIN} ${bindir}/pyvenv" + +# package libpython3 +PACKAGES =+ "libpython3 libpython3-staticdev" +FILES_libpython3 = "${libdir}/libpython*.so.*" +FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/libpython${PYTHON_BINABI}.a" + +# catch debug extensions (isn't that already in python-core-dbg?) +FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug" + +# catch all the rest (unsorted) +PACKAGES += "${PN}-misc" +FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" + +# catch manpage +PACKAGES += "${PN}-man" +FILES_${PN}-man = "${datadir}/man" + +BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-devtools/python/python_2.7.3.bb b/meta/recipes-devtools/python/python_2.7.3.bb new file mode 100644 index 0000000000..de1f57ffc2 --- /dev/null +++ b/meta/recipes-devtools/python/python_2.7.3.bb @@ -0,0 +1,195 @@ +require python.inc +DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib" +PR = "${INC_PR}.3" + +DISTRO_SRC_URI ?= "file://sitecustomize.py" +DISTRO_SRC_URI_linuxstdbase = "" +SRC_URI += "\ + file://01-use-proper-tools-for-cross-build.patch \ + file://03-fix-tkinter-detection.patch \ + file://05-enable-ctypes-cross-build.patch \ + file://06-ctypes-libffi-fix-configure.patch \ + file://06-avoid_usr_lib_termcap_path_in_linking.patch \ + ${DISTRO_SRC_URI} \ + file://multilib.patch \ + file://cgi_py.patch \ + file://remove_sqlite_rpath.patch \ + file://setup_py_skip_cross_import_check.patch \ + file://add-md5module-support.patch \ + file://host_include_contamination.patch \ + file://fix_for_using_different_libdir.patch \ + file://setuptweaks.patch \ + file://check-if-target-is-64b-not-host.patch \ + file://search_db_h_in_inc_dirs_and_avoid_warning.patch \ + file://avoid_warning_about_tkinter.patch \ + file://avoid_warning_for_sunos_specific_module.patch \ + file://python-2.7.3-berkeley-db-5.3.patch \ + file://python-2.7.3-remove-bsdb-rpath.patch \ + file://builddir.patch \ + file://python-2.7.3-CVE-2012-2135.patch \ + file://gcc-4.8-fix-configure-Wformat.patch \ + file://fix-makefile-for-ptest.patch \ + file://run-ptest \ + file://CVE-2013-4073_py27.patch \ + file://pypirc-secure.patch \ + file://parallel-makeinst-create-bindir.patch \ + file://python-2.7.3-CVE-2013-1752-smtplib-fix.patch \ + file://python-fix-build-error-with-Readline-6.3.patch \ + file://python-2.7.3-CVE-2014-1912.patch \ + file://json-flaw-fix.patch \ + file://posix_close.patch \ + file://python-2.7.3-CVE-2014-7185.patch \ + file://python2.7.3-nossl3.patch \ + file://ctypes-libffi-aarch64.patch \ + file://libffi-aarch64.patch \ +" + +S = "${WORKDIR}/Python-${PV}" + +inherit autotools multilib_header python-dir pythonnative + +# The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources +#Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :( +TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__" +TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__" + +# The following is a hack until we drop ac_cv_sizeof_off_t from site files +EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'ac_cv_sizeof_off_t=8', '', d)}" + +do_configure_prepend() { + rm -f ${S}/Makefile.orig + autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" +} + +do_compile() { + # regenerate platform specific files, because they depend on system headers + cd Lib/plat-linux2 + include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \ + ${S}/Tools/scripts/h2py.py -i '(u_long)' \ + ${STAGING_INCDIR}/dlfcn.h \ + ${STAGING_INCDIR}/linux/cdrom.h \ + ${STAGING_INCDIR}/netinet/in.h \ + ${STAGING_INCDIR}/sys/types.h + sed -e 's,${STAGING_DIR_HOST},,g' -i *.py + cd - + + # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144 + sed -i -e s,ccache\ ,'$(CCACHE) ', Makefile + + # remove any bogus LD_LIBRARY_PATH + sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile + + if [ ! -f Makefile.orig ]; then + install -m 0644 Makefile Makefile.orig + fi + sed -i -e 's#^LDFLAGS=.*#LDFLAGS=${LDFLAGS} -L. -L${STAGING_LIBDIR}#g' \ + -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \ + -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \ + -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \ + -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \ + -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \ + -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \ + Makefile + # save copy of it now, because if we do it in do_install and + # then call do_install twice we get Makefile.orig == Makefile.sysroot + install -m 0644 Makefile Makefile.sysroot + + export CROSS_COMPILE="${TARGET_PREFIX}" + export PYTHONBUILDDIR="${S}" + + oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ + HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ + STAGING_LIBDIR=${STAGING_LIBDIR} \ + STAGING_INCDIR=${STAGING_INCDIR} \ + STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + OPT="${CFLAGS}" +} + +do_install() { + # make install needs the original Makefile, or otherwise the inclues would + # go to ${D}${STAGING...}/... + install -m 0644 Makefile.orig Makefile + + export CROSS_COMPILE="${TARGET_PREFIX}" + export PYTHONBUILDDIR="${S}" + + # After swizzling the makefile, we need to run the build again. + # install can race with the build so we have to run this first, then install + oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ + HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ + CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \ + STAGING_LIBDIR=${STAGING_LIBDIR} \ + STAGING_INCDIR=${STAGING_INCDIR} \ + STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + DESTDIR=${D} LIBDIR=${libdir} + + oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ + HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ + CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \ + STAGING_LIBDIR=${STAGING_LIBDIR} \ + STAGING_INCDIR=${STAGING_INCDIR} \ + STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + DESTDIR=${D} LIBDIR=${libdir} install + + install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile + + if [ -e ${WORKDIR}/sitecustomize.py ]; then + install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} + fi + + oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h +} + +do_install_append_class-nativesdk () { + create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' +} + +SSTATE_SCAN_FILES += "Makefile" +PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" + +py_package_preprocess () { + # copy back the old Makefile to fix target package + install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile + + # Remove references to buildmachine paths in target Makefile + sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile +} + +require python-${PYTHON_MAJMIN}-manifest.inc + +# manual dependency additions +RPROVIDES_${PN}-core = "${PN}" +RRECOMMENDS_${PN}-core = "${PN}-readline" +RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules" +RRECOMMENDS_${PN}-crypt = "openssl" + +# package libpython2 +PACKAGES =+ "lib${BPN}2" +FILES_lib${BPN}2 = "${libdir}/libpython*.so.*" + +# catch debug extensions (isn't that already in python-core-dbg?) +FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug" + +# catch all the rest (unsorted) +PACKAGES += "${PN}-misc" +FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" +RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-misc" +#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten +inherit ptest + +# This must come after inherit ptest for the override to take effect +do_install_ptest() { + cp ${B}/Makefile ${D}${PTEST_PATH} + sed -e s:LIBDIR/python/ptest:${PTEST_PATH}:g \ + -e s:LIBDIR:${libdir}:g \ + -i ${D}${PTEST_PATH}/run-ptest +} + +# catch manpage +PACKAGES += "${PN}-man" +FILES_${PN}-man = "${datadir}/man" + +BBCLASSEXTEND = "nativesdk" -- cgit v1.2.3-54-g00ecf