summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r--meta/recipes-devtools/python/fix-path.inc22
-rw-r--r--meta/recipes-devtools/python/python-2.7-manifest.inc277
-rw-r--r--meta/recipes-devtools/python/python-3.3-manifest.inc260
-rw-r--r--meta/recipes-devtools/python/python-argparse_1.2.1.bb17
-rw-r--r--meta/recipes-devtools/python/python-async_0.6.1.bb17
-rw-r--r--meta/recipes-devtools/python/python-dbus_1.2.0.bb25
-rw-r--r--meta/recipes-devtools/python/python-distribute_0.6.32.bb49
-rw-r--r--meta/recipes-devtools/python/python-docutils_0.11.bb18
-rw-r--r--meta/recipes-devtools/python/python-git_0.3.2.RC1.bb22
-rw-r--r--meta/recipes-devtools/python/python-gitdb_0.5.4.bb18
-rw-r--r--meta/recipes-devtools/python/python-gst/python-path.patch28
-rw-r--r--meta/recipes-devtools/python/python-gst_0.10.22.bb23
-rw-r--r--meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch55
-rw-r--r--meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch65
-rw-r--r--meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch30
-rw-r--r--meta/recipes-devtools/python/python-imaging_1.1.7.bb45
-rw-r--r--meta/recipes-devtools/python/python-mako_0.9.1.bb20
-rw-r--r--meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch18
-rw-r--r--meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch20
-rw-r--r--meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch65
-rw-r--r--meta/recipes-devtools/python/python-native/debug.patch29
-rw-r--r--meta/recipes-devtools/python/python-native/multilib.patch243
-rw-r--r--meta/recipes-devtools/python/python-native/nohostlibs.patch67
-rw-r--r--meta/recipes-devtools/python/python-native/unixccompiler.patch20
-rw-r--r--meta/recipes-devtools/python/python-native_2.7.3.bb59
-rw-r--r--meta/recipes-devtools/python/python-nose_1.2.1.bb16
-rw-r--r--meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h30
-rw-r--r--meta/recipes-devtools/python/python-numpy/aarch64/config.h139
-rw-r--r--meta/recipes-devtools/python/python-numpy/arm/config.h21
-rw-r--r--meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h17
-rw-r--r--meta/recipes-devtools/python/python-numpy/armeb/config.h21
-rw-r--r--meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h17
-rw-r--r--meta/recipes-devtools/python/python-numpy/i586/config.h108
-rw-r--r--meta/recipes-devtools/python/python-numpy/i586/numpyconfig.h24
-rw-r--r--meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h30
-rw-r--r--meta/recipes-devtools/python/python-numpy/mips/config.h139
-rw-r--r--meta/recipes-devtools/python/python-numpy/mipsel/config.h21
-rw-r--r--meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h17
-rw-r--r--meta/recipes-devtools/python/python-numpy/no-host-paths.patch57
-rw-r--r--meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h30
-rw-r--r--meta/recipes-devtools/python/python-numpy/powerpc/config.h139
-rw-r--r--meta/recipes-devtools/python/python-numpy/trycompile.diff33
-rw-r--r--meta/recipes-devtools/python/python-numpy/unbreak-assumptions.diff16
-rw-r--r--meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h30
-rw-r--r--meta/recipes-devtools/python/python-numpy/x86-64/config.h139
-rw-r--r--meta/recipes-devtools/python/python-numpy_1.7.0.bb87
-rw-r--r--meta/recipes-devtools/python/python-pycairo_1.10.0.bb39
-rw-r--r--meta/recipes-devtools/python/python-pycurl/no-static-link.patch17
-rw-r--r--meta/recipes-devtools/python/python-pycurl_7.19.3.bb34
-rw-r--r--meta/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch23
-rw-r--r--meta/recipes-devtools/python/python-pygobject_2.27.91.bb41
-rw-r--r--meta/recipes-devtools/python/python-pygtk/acinclude.m490
-rw-r--r--meta/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch32
-rw-r--r--meta/recipes-devtools/python/python-pygtk/fix-gtkunixprint.patch20
-rw-r--r--meta/recipes-devtools/python/python-pygtk/nodocs.patch15
-rw-r--r--meta/recipes-devtools/python/python-pygtk/prevent_to_get_display_during_import.patch16
-rw-r--r--meta/recipes-devtools/python/python-pygtk/python-pygtk2/acinclude.m490
-rw-r--r--meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch38
-rw-r--r--meta/recipes-devtools/python/python-pygtk_2.24.0.bb58
-rw-r--r--meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb5
-rw-r--r--meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch15
-rw-r--r--meta/recipes-devtools/python/python-pyrex_0.9.9.bb22
-rw-r--r--meta/recipes-devtools/python/python-scons-native_2.3.0.bb8
-rw-r--r--meta/recipes-devtools/python/python-scons_2.3.0.bb14
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-attempt.patch167
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch24
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-config-ignore-all-recommends.patch24
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-conflict-provider.patch196
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-dflags.patch40
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-filename-NAME_MAX.patch35
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-flag-exclude-packages.patch70
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-flag-ignore-recommends.patch60
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch253
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-metadata-match.patch28
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-multilib-fixes.patch22
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-recommends.patch1362
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-rpm-extra-macros.patch27
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-rpm-md-parse.patch26
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-rpm-root.patch80
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-tmpdir.patch30
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-yaml-error.patch86
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch46
-rw-r--r--meta/recipes-devtools/python/python-smartpm_1.4.1.bb146
-rw-r--r--meta/recipes-devtools/python/python-smmap_0.8.2.bb20
-rw-r--r--meta/recipes-devtools/python/python.inc31
-rw-r--r--meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch138
-rw-r--r--meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch42
-rw-r--r--meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch30
-rw-r--r--meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch33
-rw-r--r--meta/recipes-devtools/python/python/06-ctypes-libffi-fix-configure.patch44
-rw-r--r--meta/recipes-devtools/python/python/CVE-2013-4073_py27.patch251
-rw-r--r--meta/recipes-devtools/python/python/add-md5module-support.patch18
-rw-r--r--meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch25
-rw-r--r--meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch23
-rw-r--r--meta/recipes-devtools/python/python/builddir.patch55
-rw-r--r--meta/recipes-devtools/python/python/cgi_py.patch23
-rw-r--r--meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch57
-rw-r--r--meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch33
-rw-r--r--meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch82
-rw-r--r--meta/recipes-devtools/python/python/gcc-4.8-fix-configure-Wformat.patch20
-rw-r--r--meta/recipes-devtools/python/python/host_include_contamination.patch27
-rw-r--r--meta/recipes-devtools/python/python/multilib.patch257
-rw-r--r--meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch19
-rw-r--r--meta/recipes-devtools/python/python/pypirc-secure.patch35
-rw-r--r--meta/recipes-devtools/python/python/python-2.7.3-CVE-2012-2135.patch73
-rw-r--r--meta/recipes-devtools/python/python/python-2.7.3-CVE-2013-1752-smtplib-fix.patch101
-rw-r--r--meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-1912.patch26
-rw-r--r--meta/recipes-devtools/python/python/python-2.7.3-berkeley-db-5.3.patch1572
-rw-r--r--meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch28
-rw-r--r--meta/recipes-devtools/python/python/python-fix-build-error-with-Readline-6.3.patch62
-rw-r--r--meta/recipes-devtools/python/python/remove_sqlite_rpath.patch19
-rw-r--r--meta/recipes-devtools/python/python/run-ptest5
-rw-r--r--meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch40
-rw-r--r--meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch27
-rw-r--r--meta/recipes-devtools/python/python/setuptweaks.patch57
-rw-r--r--meta/recipes-devtools/python/python/sitecustomize.py45
-rw-r--r--meta/recipes-devtools/python/python3-distribute_0.6.32.bb49
-rw-r--r--meta/recipes-devtools/python/python3-native_3.3.3.bb76
-rw-r--r--meta/recipes-devtools/python/python3/000-cross-compile.patch83
-rw-r--r--meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch37
-rw-r--r--meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch37
-rw-r--r--meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch42
-rw-r--r--meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch33
-rw-r--r--meta/recipes-devtools/python/python3/04-default-is-optimized.patch58
-rw-r--r--meta/recipes-devtools/python/python3/06-ctypes-libffi-fix-configure.patch44
-rw-r--r--meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch36
-rw-r--r--meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch92
-rw-r--r--meta/recipes-devtools/python/python3/110-enable-zlib.patch21
-rw-r--r--meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch78
-rw-r--r--meta/recipes-devtools/python/python3/130-readline-setup.patch55
-rw-r--r--meta/recipes-devtools/python/python3/150-fix-setupterm.patch17
-rw-r--r--meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch29
-rw-r--r--meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch25
-rw-r--r--meta/recipes-devtools/python/python3/cgi_py.patch23
-rw-r--r--meta/recipes-devtools/python/python3/fix-ast.h-dependency.patch26
-rw-r--r--meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch54
-rw-r--r--meta/recipes-devtools/python/python3/host_include_contamination.patch28
-rw-r--r--meta/recipes-devtools/python/python3/makerace.patch26
-rw-r--r--meta/recipes-devtools/python/python3/python-3.3-multilib.patch336
-rw-r--r--meta/recipes-devtools/python/python3/python3-fix-build-error-with-Readline-6.3.patch62
-rw-r--r--meta/recipes-devtools/python/python3/remove_sqlite_rpath.patch19
-rw-r--r--meta/recipes-devtools/python/python3/setuptweaks.patch57
-rw-r--r--meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch17
-rw-r--r--meta/recipes-devtools/python/python3/sitecustomize.py37
-rw-r--r--meta/recipes-devtools/python/python3/sys_platform_is_now_always_linux2.patch29
-rw-r--r--meta/recipes-devtools/python/python3/sysroot-include-headers.patch35
-rw-r--r--meta/recipes-devtools/python/python3/unixccompiler.patch33
-rw-r--r--meta/recipes-devtools/python/python3_3.3.3.bb217
-rw-r--r--meta/recipes-devtools/python/python_2.7.3.bb186
149 files changed, 11257 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/fix-path.inc b/meta/recipes-devtools/python/fix-path.inc
new file mode 100644
index 0000000000..0738c59ada
--- /dev/null
+++ b/meta/recipes-devtools/python/fix-path.inc
@@ -0,0 +1,22 @@
1do_install_append() {
2 for i in `find ${D} -name "*.py"` ; do \
3 sed -i -e s:${D}::g $i
4 done
5
6 for i in `find ${D} -name "*.la"` ; do \
7 sed -i -e s:${STAGING_LIBDIR}:${libdir}:g $i
8 done
9
10 if test -e ${D}${bindir} ; then
11 for i in ${D}${bindir}/* ; do \
12 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
13 done
14 fi
15
16 if test -e ${D}${sbindir} ; then
17 for i in ${D}${sbindir}/* ; do \
18 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
19 done
20 fi
21}
22
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..a557cdca21
--- /dev/null
+++ b/meta/recipes-devtools/python/python-2.7-manifest.inc
@@ -0,0 +1,277 @@
1
2# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
3# Generator: 'scripts/contrib/python/generate-manifest-2.7.py' Version 20110222.2 (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
4# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
5
6
7
8PROVIDES+="${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}-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 "
9
10PACKAGES="${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}-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"
11
12SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator"
13RDEPENDS_${PN}-2to3="${PN}-core"
14FILES_${PN}-2to3="${bindir}/2to3 ${libdir}/python2.7/lib2to3 "
15
16SUMMARY_${PN}-audio="Python Audio Handling"
17RDEPENDS_${PN}-audio="${PN}-core"
18FILES_${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.* "
19
20SUMMARY_${PN}-bsddb="Python bindings for the Berkeley Database"
21RDEPENDS_${PN}-bsddb="${PN}-core"
22FILES_${PN}-bsddb="${libdir}/python2.7/bsddb ${libdir}/python2.7/lib-dynload/_bsddb.so "
23
24SUMMARY_${PN}-codecs="Python codecs, encodings & i18n support"
25RDEPENDS_${PN}-codecs="${PN}-core ${PN}-lang"
26FILES_${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.* "
27
28SUMMARY_${PN}-compile="Python bytecode compilation support"
29RDEPENDS_${PN}-compile="${PN}-core"
30FILES_${PN}-compile="${libdir}/python2.7/py_compile.* ${libdir}/python2.7/compileall.* "
31
32SUMMARY_${PN}-compiler="Python compiler support"
33RDEPENDS_${PN}-compiler="${PN}-core"
34FILES_${PN}-compiler="${libdir}/python2.7/compiler "
35
36SUMMARY_${PN}-compression="Python high-level compression support"
37RDEPENDS_${PN}-compression="${PN}-core ${PN}-zlib"
38FILES_${PN}-compression="${libdir}/python2.7/gzip.* ${libdir}/python2.7/zipfile.* ${libdir}/python2.7/tarfile.* ${libdir}/python2.7/lib-dynload/bz2.so "
39
40SUMMARY_${PN}-core="Python interpreter and core modules"
41RDEPENDS_${PN}-core="${PN}-lang ${PN}-re"
42FILES_${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 \
43${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 "
44
45SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support"
46RDEPENDS_${PN}-crypt="${PN}-core"
47FILES_${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 "
48
49SUMMARY_${PN}-ctypes="Python C types support"
50RDEPENDS_${PN}-ctypes="${PN}-core"
51FILES_${PN}-ctypes="${libdir}/python2.7/ctypes ${libdir}/python2.7/lib-dynload/_ctypes.so ${libdir}/python2.7/lib-dynload/_ctypes_test.so "
52
53SUMMARY_${PN}-curses="Python curses support"
54RDEPENDS_${PN}-curses="${PN}-core"
55FILES_${PN}-curses="${libdir}/python2.7/curses ${libdir}/python2.7/lib-dynload/_curses.so ${libdir}/python2.7/lib-dynload/_curses_panel.so "
56
57SUMMARY_${PN}-datetime="Python calendar and time support"
58RDEPENDS_${PN}-datetime="${PN}-core ${PN}-codecs"
59FILES_${PN}-datetime="${libdir}/python2.7/_strptime.* ${libdir}/python2.7/calendar.* ${libdir}/python2.7/lib-dynload/datetime.so "
60
61SUMMARY_${PN}-db="Python file-based database support"
62RDEPENDS_${PN}-db="${PN}-core"
63FILES_${PN}-db="${libdir}/python2.7/anydbm.* ${libdir}/python2.7/dumbdbm.* ${libdir}/python2.7/whichdb.* "
64
65SUMMARY_${PN}-debugger="Python debugger"
66RDEPENDS_${PN}-debugger="${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint"
67FILES_${PN}-debugger="${libdir}/python2.7/bdb.* ${libdir}/python2.7/pdb.* "
68
69SUMMARY_${PN}-dev="Python development package"
70RDEPENDS_${PN}-dev="${PN}-core"
71FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig "
72
73SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects"
74RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re"
75FILES_${PN}-difflib="${libdir}/python2.7/difflib.* "
76
77SUMMARY_${PN}-distutils="Python Distribution Utilities"
78RDEPENDS_${PN}-distutils="${PN}-core"
79FILES_${PN}-distutils="${libdir}/python2.7/config ${libdir}/python2.7/distutils "
80
81SUMMARY_${PN}-distutils-staticdev="Python distribution utilities (static libraries)"
82RDEPENDS_${PN}-distutils-staticdev="${PN}-distutils"
83FILES_${PN}-distutils-staticdev="${libdir}/python2.7/config/lib*.a "
84
85SUMMARY_${PN}-doctest="Python framework for running examples in docstrings"
86RDEPENDS_${PN}-doctest="${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib"
87FILES_${PN}-doctest="${libdir}/python2.7/doctest.* "
88
89SUMMARY_${PN}-elementtree="Python elementree"
90RDEPENDS_${PN}-elementtree="${PN}-core"
91FILES_${PN}-elementtree="${libdir}/python2.7/lib-dynload/_elementtree.so "
92
93SUMMARY_${PN}-email="Python email support"
94RDEPENDS_${PN}-email="${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient"
95FILES_${PN}-email="${libdir}/python2.7/imaplib.* ${libdir}/python2.7/email "
96
97SUMMARY_${PN}-fcntl="Python's fcntl interface"
98RDEPENDS_${PN}-fcntl="${PN}-core"
99FILES_${PN}-fcntl="${libdir}/python2.7/lib-dynload/fcntl.so "
100
101SUMMARY_${PN}-gdbm="Python GNU database support"
102RDEPENDS_${PN}-gdbm="${PN}-core"
103FILES_${PN}-gdbm="${libdir}/python2.7/lib-dynload/gdbm.so "
104
105SUMMARY_${PN}-hotshot="Python hotshot performance profiler"
106RDEPENDS_${PN}-hotshot="${PN}-core"
107FILES_${PN}-hotshot="${libdir}/python2.7/hotshot ${libdir}/python2.7/lib-dynload/_hotshot.so "
108
109SUMMARY_${PN}-html="Python HTML processing support"
110RDEPENDS_${PN}-html="${PN}-core"
111FILES_${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.* "
112
113SUMMARY_${PN}-idle="Python Integrated Development Environment"
114RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter"
115FILES_${PN}-idle="${bindir}/idle ${libdir}/python2.7/idlelib "
116
117SUMMARY_${PN}-image="Python graphical image handling"
118RDEPENDS_${PN}-image="${PN}-core"
119FILES_${PN}-image="${libdir}/python2.7/colorsys.* ${libdir}/python2.7/imghdr.* ${libdir}/python2.7/lib-dynload/imageop.so ${libdir}/python2.7/lib-dynload/rgbimg.so "
120
121SUMMARY_${PN}-io="Python low-level I/O"
122RDEPENDS_${PN}-io="${PN}-core ${PN}-math ${PN}-textutils"
123FILES_${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.* "
124
125SUMMARY_${PN}-json="Python JSON support"
126RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re"
127FILES_${PN}-json="${libdir}/python2.7/json ${libdir}/python2.7/lib-dynload/_json.so "
128
129SUMMARY_${PN}-lang="Python low-level language support"
130RDEPENDS_${PN}-lang="${PN}-core"
131FILES_${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.* "
132
133SUMMARY_${PN}-logging="Python logging support"
134RDEPENDS_${PN}-logging="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold"
135FILES_${PN}-logging="${libdir}/python2.7/logging "
136
137SUMMARY_${PN}-mailbox="Python mailbox format support"
138RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime"
139FILES_${PN}-mailbox="${libdir}/python2.7/mailbox.* "
140
141SUMMARY_${PN}-math="Python math support"
142RDEPENDS_${PN}-math="${PN}-core ${PN}-crypt"
143FILES_${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.* "
144
145SUMMARY_${PN}-mime="Python MIME handling APIs"
146RDEPENDS_${PN}-mime="${PN}-core ${PN}-io"
147FILES_${PN}-mime="${libdir}/python2.7/mimetools.* ${libdir}/python2.7/uu.* ${libdir}/python2.7/quopri.* ${libdir}/python2.7/rfc822.* ${libdir}/python2.7/MimeWriter.* "
148
149SUMMARY_${PN}-mmap="Python memory-mapped file support"
150RDEPENDS_${PN}-mmap="${PN}-core ${PN}-io"
151FILES_${PN}-mmap="${libdir}/python2.7/lib-dynload/mmap.so "
152
153SUMMARY_${PN}-multiprocessing="Python multiprocessing support"
154RDEPENDS_${PN}-multiprocessing="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap"
155FILES_${PN}-multiprocessing="${libdir}/python2.7/lib-dynload/_multiprocessing.so ${libdir}/python2.7/multiprocessing "
156
157SUMMARY_${PN}-netclient="Python Internet Protocol clients"
158RDEPENDS_${PN}-netclient="${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime"
159FILES_${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.* "
160
161SUMMARY_${PN}-netserver="Python Internet Protocol servers"
162RDEPENDS_${PN}-netserver="${PN}-core ${PN}-netclient"
163FILES_${PN}-netserver="${libdir}/python2.7/cgi.* ${libdir}/python2.7/*HTTPServer.* ${libdir}/python2.7/SocketServer.* "
164
165SUMMARY_${PN}-numbers="Python number APIs"
166RDEPENDS_${PN}-numbers="${PN}-core ${PN}-lang ${PN}-re"
167FILES_${PN}-numbers="${libdir}/python2.7/decimal.* ${libdir}/python2.7/numbers.* "
168
169SUMMARY_${PN}-pickle="Python serialisation/persistence support"
170RDEPENDS_${PN}-pickle="${PN}-core ${PN}-codecs ${PN}-io ${PN}-re"
171FILES_${PN}-pickle="${libdir}/python2.7/pickle.* ${libdir}/python2.7/shelve.* ${libdir}/python2.7/lib-dynload/cPickle.so ${libdir}/python2.7/pickletools.* "
172
173SUMMARY_${PN}-pkgutil="Python package extension utility support"
174RDEPENDS_${PN}-pkgutil="${PN}-core"
175FILES_${PN}-pkgutil="${libdir}/python2.7/pkgutil.* "
176
177SUMMARY_${PN}-pprint="Python pretty-print support"
178RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io"
179FILES_${PN}-pprint="${libdir}/python2.7/pprint.* "
180
181SUMMARY_${PN}-profile="Python basic performance profiling support"
182RDEPENDS_${PN}-profile="${PN}-core ${PN}-textutils"
183FILES_${PN}-profile="${libdir}/python2.7/profile.* ${libdir}/python2.7/pstats.* ${libdir}/python2.7/cProfile.* ${libdir}/python2.7/lib-dynload/_lsprof.so "
184
185SUMMARY_${PN}-pydoc="Python interactive help support"
186RDEPENDS_${PN}-pydoc="${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re"
187FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python2.7/pydoc.* ${libdir}/python2.7/pydoc_data "
188
189SUMMARY_${PN}-re="Python Regular Expression APIs"
190RDEPENDS_${PN}-re="${PN}-core"
191FILES_${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.* "
192
193SUMMARY_${PN}-readline="Python readline support"
194RDEPENDS_${PN}-readline="${PN}-core"
195FILES_${PN}-readline="${libdir}/python2.7/lib-dynload/readline.so ${libdir}/python2.7/rlcompleter.* "
196
197SUMMARY_${PN}-resource="Python resource control interface"
198RDEPENDS_${PN}-resource="${PN}-core"
199FILES_${PN}-resource="${libdir}/python2.7/lib-dynload/resource.so "
200
201SUMMARY_${PN}-robotparser="Python robots.txt parser"
202RDEPENDS_${PN}-robotparser="${PN}-core ${PN}-netclient"
203FILES_${PN}-robotparser="${libdir}/python2.7/robotparser.* "
204
205SUMMARY_${PN}-shell="Python shell-like functionality"
206RDEPENDS_${PN}-shell="${PN}-core ${PN}-re"
207FILES_${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.* "
208
209SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon"
210RDEPENDS_${PN}-smtpd="${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime"
211FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python2.7/smtpd.* "
212
213SUMMARY_${PN}-sqlite3="Python Sqlite3 database support"
214RDEPENDS_${PN}-sqlite3="${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading ${PN}-zlib"
215FILES_${PN}-sqlite3="${libdir}/python2.7/lib-dynload/_sqlite3.so ${libdir}/python2.7/sqlite3/dbapi2.* ${libdir}/python2.7/sqlite3/__init__.* ${libdir}/python2.7/sqlite3/dump.* "
216
217SUMMARY_${PN}-sqlite3-tests="Python Sqlite3 database support tests"
218RDEPENDS_${PN}-sqlite3-tests="${PN}-core ${PN}-sqlite3"
219FILES_${PN}-sqlite3-tests="${libdir}/python2.7/sqlite3/test "
220
221SUMMARY_${PN}-stringold="Python string APIs [deprecated]"
222RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re"
223FILES_${PN}-stringold="${libdir}/python2.7/lib-dynload/strop.so ${libdir}/python2.7/string.* ${libdir}/python2.7/stringold.* "
224
225SUMMARY_${PN}-subprocess="Python subprocess support"
226RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle"
227FILES_${PN}-subprocess="${libdir}/python2.7/subprocess.* "
228
229SUMMARY_${PN}-syslog="Python syslog interface"
230RDEPENDS_${PN}-syslog="${PN}-core"
231FILES_${PN}-syslog="${libdir}/python2.7/lib-dynload/syslog.so "
232
233SUMMARY_${PN}-terminal="Python terminal controlling support"
234RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io"
235FILES_${PN}-terminal="${libdir}/python2.7/pty.* ${libdir}/python2.7/tty.* "
236
237SUMMARY_${PN}-tests="Python tests"
238RDEPENDS_${PN}-tests="${PN}-core"
239FILES_${PN}-tests="${libdir}/python2.7/test "
240
241SUMMARY_${PN}-textutils="Python option parsing, text wrapping and CSV support"
242RDEPENDS_${PN}-textutils="${PN}-core ${PN}-io ${PN}-re ${PN}-stringold"
243FILES_${PN}-textutils="${libdir}/python2.7/lib-dynload/_csv.so ${libdir}/python2.7/csv.* ${libdir}/python2.7/optparse.* ${libdir}/python2.7/textwrap.* "
244
245SUMMARY_${PN}-threading="Python threading & synchronization support"
246RDEPENDS_${PN}-threading="${PN}-core ${PN}-lang"
247FILES_${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.* "
248
249SUMMARY_${PN}-tkinter="Python Tcl/Tk bindings"
250RDEPENDS_${PN}-tkinter="${PN}-core"
251FILES_${PN}-tkinter="${libdir}/python2.7/lib-dynload/_tkinter.so ${libdir}/python2.7/lib-tk "
252
253SUMMARY_${PN}-unittest="Python unit testing framework"
254RDEPENDS_${PN}-unittest="${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell"
255FILES_${PN}-unittest="${libdir}/python2.7/unittest/ "
256
257SUMMARY_${PN}-unixadmin="Python Unix administration support"
258RDEPENDS_${PN}-unixadmin="${PN}-core"
259FILES_${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.* "
260
261SUMMARY_${PN}-xml="Python basic XML support"
262RDEPENDS_${PN}-xml="${PN}-core ${PN}-elementtree ${PN}-re"
263FILES_${PN}-xml="${libdir}/python2.7/lib-dynload/pyexpat.so ${libdir}/python2.7/xml ${libdir}/python2.7/xmllib.* "
264
265SUMMARY_${PN}-xmlrpc="Python XML-RPC support"
266RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang"
267FILES_${PN}-xmlrpc="${libdir}/python2.7/xmlrpclib.* ${libdir}/python2.7/SimpleXMLRPCServer.* ${libdir}/python2.7/DocXMLRPCServer.* "
268
269SUMMARY_${PN}-zlib="Python zlib compression support"
270RDEPENDS_${PN}-zlib="${PN}-core"
271FILES_${PN}-zlib="${libdir}/python2.7/lib-dynload/zlib.so "
272
273SUMMARY_${PN}-modules="All Python modules"
274RDEPENDS_${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}-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 "
275ALLOW_EMPTY_${PN}-modules = "1"
276
277
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..ea56970842
--- /dev/null
+++ b/meta/recipes-devtools/python/python-3.3-manifest.inc
@@ -0,0 +1,260 @@
1
2# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
3# Generator: '../../../scripts/contrib/python/generate-manifest-3.3.py' Version 20140131 (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
4# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
5
6
7
8PROVIDES+="${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}-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 "
9
10PACKAGES="${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}-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}-modules"
11
12SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator"
13RDEPENDS_${PN}-2to3="${PN}-core"
14FILES_${PN}-2to3="${bindir}/2to3 ${libdir}/python3.3/lib2to3 "
15
16SUMMARY_${PN}-audio="Python Audio Handling"
17RDEPENDS_${PN}-audio="${PN}-core"
18FILES_${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.* "
19
20SUMMARY_${PN}-codecs="Python codecs, encodings & i18n support"
21RDEPENDS_${PN}-codecs="${PN}-core ${PN}-lang"
22FILES_${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.* "
23
24SUMMARY_${PN}-compile="Python bytecode compilation support"
25RDEPENDS_${PN}-compile="${PN}-core"
26FILES_${PN}-compile="${libdir}/python3.3/py_compile.* ${libdir}/python3.3/compileall.* "
27
28SUMMARY_${PN}-compression="Python high-level compression support"
29RDEPENDS_${PN}-compression="${PN}-core ${PN}-codecs"
30FILES_${PN}-compression="${libdir}/python3.3/gzip.* ${libdir}/python3.3/zipfile.* ${libdir}/python3.3/tarfile.* ${libdir}/python3.3/lib-dynload/bz2.*.so "
31
32SUMMARY_${PN}-core="Python interpreter and core modules"
33RDEPENDS_${PN}-core="${PN}-lang ${PN}-re"
34FILES_${PN}-core="${libdir}/python3.3/__future__.* ${libdir}/python3.3/_abcoll.* ${libdir}/python3.3/abc.* ${libdir}/python3.3/copy.* ${libdir}/python3.3/copy_reg.* ${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/config/Makefile ${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h ${libdir}/python${PYTHON_MAJMIN}/collections ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py "
35
36SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support"
37RDEPENDS_${PN}-crypt="${PN}-core"
38FILES_${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 "
39
40SUMMARY_${PN}-ctypes="Python C types support"
41RDEPENDS_${PN}-ctypes="${PN}-core"
42FILES_${PN}-ctypes="${libdir}/python3.3/ctypes ${libdir}/python3.3/lib-dynload/_ctypes.*.so ${libdir}/python3.3/lib-dynload/_ctypes_test.*.so "
43
44SUMMARY_${PN}-curses="Python curses support"
45RDEPENDS_${PN}-curses="${PN}-core"
46FILES_${PN}-curses="${libdir}/python3.3/curses ${libdir}/python3.3/lib-dynload/_curses.*.so ${libdir}/python3.3/lib-dynload/_curses_panel.*.so "
47
48SUMMARY_${PN}-datetime="Python calendar and time support"
49RDEPENDS_${PN}-datetime="${PN}-core ${PN}-codecs"
50FILES_${PN}-datetime="${libdir}/python3.3/_strptime.* ${libdir}/python3.3/calendar.* ${libdir}/python3.3/lib-dynload/datetime.*.so "
51
52SUMMARY_${PN}-db="Python file-based database support"
53RDEPENDS_${PN}-db="${PN}-core"
54FILES_${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 "
55
56SUMMARY_${PN}-debugger="Python debugger"
57RDEPENDS_${PN}-debugger="${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint"
58FILES_${PN}-debugger="${libdir}/python3.3/bdb.* ${libdir}/python3.3/pdb.* "
59
60SUMMARY_${PN}-dev="Python development package"
61RDEPENDS_${PN}-dev="${PN}-core"
62FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig "
63
64SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects"
65RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re"
66FILES_${PN}-difflib="${libdir}/python3.3/difflib.* "
67
68SUMMARY_${PN}-distutils="Python Distribution Utilities"
69RDEPENDS_${PN}-distutils="${PN}-core"
70FILES_${PN}-distutils="${libdir}/python3.3/config ${libdir}/python3.3/distutils "
71
72SUMMARY_${PN}-distutils-staticdev="Python distribution utilities (static libraries)"
73RDEPENDS_${PN}-distutils-staticdev="${PN}-distutils"
74FILES_${PN}-distutils-staticdev="${libdir}/python3.3/config/lib*.a "
75
76SUMMARY_${PN}-doctest="Python framework for running examples in docstrings"
77RDEPENDS_${PN}-doctest="${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib"
78FILES_${PN}-doctest="${libdir}/python3.3/doctest.* "
79
80SUMMARY_${PN}-elementtree="Python elementree"
81RDEPENDS_${PN}-elementtree="${PN}-core"
82FILES_${PN}-elementtree="${libdir}/python3.3/lib-dynload/_elementtree.*.so "
83
84SUMMARY_${PN}-email="Python email support"
85RDEPENDS_${PN}-email="${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient"
86FILES_${PN}-email="${libdir}/python3.3/imaplib.* ${libdir}/python3.3/email "
87
88SUMMARY_${PN}-fcntl="Python's fcntl interface"
89RDEPENDS_${PN}-fcntl="${PN}-core"
90FILES_${PN}-fcntl="${libdir}/python3.3/lib-dynload/fcntl.*.so "
91
92SUMMARY_${PN}-gdbm="Python GNU database support"
93RDEPENDS_${PN}-gdbm="${PN}-core"
94FILES_${PN}-gdbm="${libdir}/python3.3/lib-dynload/_gdbm.*.so "
95
96SUMMARY_${PN}-html="Python HTML processing support"
97RDEPENDS_${PN}-html="${PN}-core"
98FILES_${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.* "
99
100SUMMARY_${PN}-idle="Python Integrated Development Environment"
101RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter"
102FILES_${PN}-idle="${bindir}/idle ${libdir}/python3.3/idlelib "
103
104SUMMARY_${PN}-image="Python graphical image handling"
105RDEPENDS_${PN}-image="${PN}-core"
106FILES_${PN}-image="${libdir}/python3.3/colorsys.* ${libdir}/python3.3/imghdr.* ${libdir}/python3.3/lib-dynload/imageop.*.so ${libdir}/python3.3/lib-dynload/rgbimg.*.so "
107
108SUMMARY_${PN}-io="Python low-level I/O"
109RDEPENDS_${PN}-io="${PN}-core ${PN}-math"
110FILES_${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.* "
111
112SUMMARY_${PN}-json="Python JSON support"
113RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re"
114FILES_${PN}-json="${libdir}/python3.3/json ${libdir}/python3.3/lib-dynload/_json.*.so "
115
116SUMMARY_${PN}-lang="Python low-level language support"
117RDEPENDS_${PN}-lang="${PN}-core"
118FILES_${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.* "
119
120SUMMARY_${PN}-logging="Python logging support"
121RDEPENDS_${PN}-logging="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold"
122FILES_${PN}-logging="${libdir}/python3.3/logging "
123
124SUMMARY_${PN}-mailbox="Python mailbox format support"
125RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime"
126FILES_${PN}-mailbox="${libdir}/python3.3/mailbox.* "
127
128SUMMARY_${PN}-math="Python math support"
129RDEPENDS_${PN}-math="${PN}-core"
130FILES_${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.* "
131
132SUMMARY_${PN}-mime="Python MIME handling APIs"
133RDEPENDS_${PN}-mime="${PN}-core ${PN}-io"
134FILES_${PN}-mime="${libdir}/python3.3/mimetools.* ${libdir}/python3.3/uu.* ${libdir}/python3.3/quopri.* ${libdir}/python3.3/rfc822.* ${libdir}/python3.3/MimeWriter.* "
135
136SUMMARY_${PN}-mmap="Python memory-mapped file support"
137RDEPENDS_${PN}-mmap="${PN}-core ${PN}-io"
138FILES_${PN}-mmap="${libdir}/python3.3/lib-dynload/mmap.*.so "
139
140SUMMARY_${PN}-multiprocessing="Python multiprocessing support"
141RDEPENDS_${PN}-multiprocessing="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap"
142FILES_${PN}-multiprocessing="${libdir}/python3.3/lib-dynload/_multiprocessing.*.so ${libdir}/python3.3/multiprocessing "
143
144SUMMARY_${PN}-netclient="Python Internet Protocol clients"
145RDEPENDS_${PN}-netclient="${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime"
146FILES_${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.* "
147
148SUMMARY_${PN}-netserver="Python Internet Protocol servers"
149RDEPENDS_${PN}-netserver="${PN}-core ${PN}-netclient"
150FILES_${PN}-netserver="${libdir}/python3.3/cgi.* ${libdir}/python3.3/*HTTPServer.* ${libdir}/python3.3/SocketServer.* "
151
152SUMMARY_${PN}-numbers="Python number APIs"
153RDEPENDS_${PN}-numbers="${PN}-core ${PN}-lang ${PN}-re"
154FILES_${PN}-numbers="${libdir}/python3.3/decimal.* ${libdir}/python3.3/numbers.* "
155
156SUMMARY_${PN}-pickle="Python serialisation/persistence support"
157RDEPENDS_${PN}-pickle="${PN}-core ${PN}-codecs ${PN}-io ${PN}-re"
158FILES_${PN}-pickle="${libdir}/python3.3/pickle.* ${libdir}/python3.3/shelve.* ${libdir}/python3.3/lib-dynload/cPickle.*.so ${libdir}/python3.3/pickletools.* "
159
160SUMMARY_${PN}-pkgutil="Python package extension utility support"
161RDEPENDS_${PN}-pkgutil="${PN}-core"
162FILES_${PN}-pkgutil="${libdir}/python3.3/pkgutil.* "
163
164SUMMARY_${PN}-pprint="Python pretty-print support"
165RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io"
166FILES_${PN}-pprint="${libdir}/python3.3/pprint.* "
167
168SUMMARY_${PN}-profile="Python basic performance profiling support"
169RDEPENDS_${PN}-profile="${PN}-core ${PN}-textutils"
170FILES_${PN}-profile="${libdir}/python3.3/profile.* ${libdir}/python3.3/pstats.* ${libdir}/python3.3/cProfile.* ${libdir}/python3.3/lib-dynload/_lsprof.*.so "
171
172SUMMARY_${PN}-pydoc="Python interactive help support"
173RDEPENDS_${PN}-pydoc="${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re"
174FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python3.3/pydoc.* ${libdir}/python3.3/pydoc_data "
175
176SUMMARY_${PN}-re="Python Regular Expression APIs"
177RDEPENDS_${PN}-re="${PN}-core"
178FILES_${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.* "
179
180SUMMARY_${PN}-readline="Python readline support"
181RDEPENDS_${PN}-readline="${PN}-core"
182FILES_${PN}-readline="${libdir}/python3.3/lib-dynload/readline.*.so ${libdir}/python3.3/rlcompleter.* "
183
184SUMMARY_${PN}-resource="Python resource control interface"
185RDEPENDS_${PN}-resource="${PN}-core"
186FILES_${PN}-resource="${libdir}/python3.3/lib-dynload/resource.*.so "
187
188SUMMARY_${PN}-robotparser="Python robots.txt parser"
189RDEPENDS_${PN}-robotparser="${PN}-core ${PN}-netclient"
190FILES_${PN}-robotparser="${libdir}/python3.3/urllib/robotparser.* "
191
192SUMMARY_${PN}-shell="Python shell-like functionality"
193RDEPENDS_${PN}-shell="${PN}-core ${PN}-re"
194FILES_${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.* "
195
196SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon"
197RDEPENDS_${PN}-smtpd="${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime"
198FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python3.3/smtpd.* "
199
200SUMMARY_${PN}-sqlite3="Python Sqlite3 database support"
201RDEPENDS_${PN}-sqlite3="${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading"
202FILES_${PN}-sqlite3="${libdir}/python3.3/lib-dynload/_sqlite3.*.so ${libdir}/python3.3/sqlite3/dbapi2.* ${libdir}/python3.3/sqlite3/__init__.* ${libdir}/python3.3/sqlite3/dump.* "
203
204SUMMARY_${PN}-sqlite3-tests="Python Sqlite3 database support tests"
205RDEPENDS_${PN}-sqlite3-tests="${PN}-core ${PN}-sqlite3"
206FILES_${PN}-sqlite3-tests="${libdir}/python3.3/sqlite3/test "
207
208SUMMARY_${PN}-stringold="Python string APIs [deprecated]"
209RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re"
210FILES_${PN}-stringold="${libdir}/python3.3/lib-dynload/strop.*.so ${libdir}/python3.3/string.* ${libdir}/python3.3/stringold.* "
211
212SUMMARY_${PN}-subprocess="Python subprocess support"
213RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle"
214FILES_${PN}-subprocess="${libdir}/python3.3/subprocess.* "
215
216SUMMARY_${PN}-syslog="Python syslog interface"
217RDEPENDS_${PN}-syslog="${PN}-core"
218FILES_${PN}-syslog="${libdir}/python3.3/lib-dynload/syslog.*.so "
219
220SUMMARY_${PN}-terminal="Python terminal controlling support"
221RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io"
222FILES_${PN}-terminal="${libdir}/python3.3/pty.* ${libdir}/python3.3/tty.* "
223
224SUMMARY_${PN}-tests="Python tests"
225RDEPENDS_${PN}-tests="${PN}-core"
226FILES_${PN}-tests="${libdir}/python3.3/test "
227
228SUMMARY_${PN}-textutils="Python option parsing, text wrapping and CSV support"
229RDEPENDS_${PN}-textutils="${PN}-core ${PN}-io ${PN}-re ${PN}-stringold"
230FILES_${PN}-textutils="${libdir}/python3.3/lib-dynload/_csv.*.so ${libdir}/python3.3/csv.* ${libdir}/python3.3/optparse.* ${libdir}/python3.3/textwrap.* "
231
232SUMMARY_${PN}-threading="Python threading & synchronization support"
233RDEPENDS_${PN}-threading="${PN}-core ${PN}-lang"
234FILES_${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.* "
235
236SUMMARY_${PN}-tkinter="Python Tcl/Tk bindings"
237RDEPENDS_${PN}-tkinter="${PN}-core"
238FILES_${PN}-tkinter="${libdir}/python3.3/lib-dynload/_tkinter.*.so ${libdir}/python3.3/lib-tk ${libdir}/python3.3/tkinter "
239
240SUMMARY_${PN}-unittest="Python unit testing framework"
241RDEPENDS_${PN}-unittest="${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell"
242FILES_${PN}-unittest="${libdir}/python3.3/unittest/ "
243
244SUMMARY_${PN}-unixadmin="Python Unix administration support"
245RDEPENDS_${PN}-unixadmin="${PN}-core"
246FILES_${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.* "
247
248SUMMARY_${PN}-xml="Python basic XML support"
249RDEPENDS_${PN}-xml="${PN}-core ${PN}-elementtree ${PN}-re"
250FILES_${PN}-xml="${libdir}/python3.3/lib-dynload/pyexpat.*.so ${libdir}/python3.3/xml ${libdir}/python3.3/xmllib.* "
251
252SUMMARY_${PN}-xmlrpc="Python XML-RPC support"
253RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang"
254FILES_${PN}-xmlrpc="${libdir}/python3.3/xmlrpclib.* ${libdir}/python3.3/SimpleXMLRPCServer.* ${libdir}/python3.3/DocXMLRPCServer.* ${libdir}/python3.3/xmlrpc "
255
256SUMMARY_${PN}-modules="All Python modules"
257RDEPENDS_${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}-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 "
258ALLOW_EMPTY_${PN}-modules = "1"
259
260
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 @@
1SUMMARY = "Python command-line parsing library"
2SECTION = "devel/python"
3LICENSE = "PSF"
4LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=09d08bb5b7047e2688ea3faad6408aa8"
5SRCNAME = "argparse"
6PR = "r4"
7RDEPENDS_${PN} += "python-codecs python-textutils"
8
9SRC_URI = "http://argparse.googlecode.com/files/${SRCNAME}-${PV}.tar.gz"
10SRC_URI[md5sum] = "2fbef8cb61e506c706957ab6e135840c"
11SRC_URI[sha256sum] = "ddaf4b0a618335a32b6664d4ae038a1de8fbada3b25033f9021510ed2b3941a4"
12
13S = "${WORKDIR}/${SRCNAME}-${PV}"
14
15inherit setuptools
16
17BBCLASSEXTEND = "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 @@
1SUMMARY = "Python framework to process interdependent tasks in a pool of workers"
2HOMEPAGE = "http://github.com/gitpython-developers/async"
3SECTION = "devel/python"
4LICENSE = "BSD"
5LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=88df8e78b9edfd744953862179f2d14e"
6
7SRC_URI = "http://pypi.python.org/packages/source/a/async/async-${PV}.tar.gz"
8SRC_URI[md5sum] = "6f0e2ced1fe85f8410b9bde11be08587"
9SRC_URI[sha256sum] = "41d14cc0456e03f34d13af284f65821d07d05c20e621bcaebd38f9ab5095d5d1"
10
11S = "${WORKDIR}/async-${PV}"
12
13inherit distutils
14
15RDEPENDS_${PN} += "python-threading python-lang"
16
17BBCLASSEXTEND = "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..e64f99f87a
--- /dev/null
+++ b/meta/recipes-devtools/python/python-dbus_1.2.0.bb
@@ -0,0 +1,25 @@
1SUMMARY = "Python bindings for the DBus inter-process communication system"
2SECTION = "devel/python"
3HOMEPAGE = "http://www.freedesktop.org/Software/dbus"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://COPYING;md5=0b83047ce9e948b67c0facc5f233476a"
6DEPENDS = "expat dbus dbus-glib virtual/libintl python-pyrex-native"
7
8SRC_URI = "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-${PV}.tar.gz \
9"
10
11SRC_URI[md5sum] = "b09cd2d1a057cc432ce944de3fc06bf7"
12SRC_URI[sha256sum] = "e12c6c8b2bf3a9302f75166952cbe41d6b38c3441bbc6767dbd498942316c6df"
13S = "${WORKDIR}/dbus-python-${PV}"
14
15inherit distutils-base autotools pkgconfig
16
17export BUILD_SYS
18export HOST_SYS
19
20export STAGING_LIBDIR
21export STAGING_INCDIR
22
23RDEPENDS_${PN} = "python-io python-logging python-stringold python-threading python-xml"
24
25FILES_${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..58bb8b4545
--- /dev/null
+++ b/meta/recipes-devtools/python/python-distribute_0.6.32.bb
@@ -0,0 +1,49 @@
1SUMMARY = "Download, build, install, upgrade, and uninstall Python packages"
2HOMEPAGE = "http://packages.python.org/distribute"
3SECTION = "devel/python"
4LICENSE = "PSF"
5LIC_FILES_CHKSUM = "file://setup.py;beginline=234;endline=234;md5=26f6b02022b737126d3c88838782dddb"
6
7SRCNAME = "distribute"
8PR = "ml5"
9DEPENDS += "python"
10DEPENDS_class-native += "python-native"
11
12SRC_URI = " \
13 http://pypi.python.org/packages/source/d/distribute/${SRCNAME}-${PV}.tar.gz \
14"
15SRC_URI[md5sum] = "acb7a2da81e3612bfb1608abe4f0e568"
16SRC_URI[sha256sum] = "8970cd1e148b5d1fea9430584aea66c45ea22d80e0933393ec49ebc388f718df"
17
18S = "${WORKDIR}/${SRCNAME}-${PV}"
19
20# http://python-distribute.org/distribute_setup.py
21
22# force the selection of python3
23#PYTHON_BASEVERSION = "3.3"
24#PYTHON_MAJMIN = "3.3"
25
26inherit distutils
27
28DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
29
30do_install_prepend() {
31 install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
32}
33
34#
35# The installer puts the wrong path in the setuptools.pth file. Correct it.
36#
37do_install_append() {
38 rm ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
39 echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
40}
41
42RDEPENDS_${PN} = "\
43 python-distutils \
44 python-compression \
45"
46
47RPROVIDES_${PN} += "python-setuptools"
48
49BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/python/python-docutils_0.11.bb b/meta/recipes-devtools/python/python-docutils_0.11.bb
new file mode 100644
index 0000000000..f5da973d99
--- /dev/null
+++ b/meta/recipes-devtools/python/python-docutils_0.11.bb
@@ -0,0 +1,18 @@
1SUMMARY = "Text processing system for documentation"
2HOMEPAGE = "http://docutils.sourceforge.net"
3SECTION = "devel/python"
4LICENSE = "PSF & BSD-2-Clause & GPLv3"
5LIC_FILES_CHKSUM = "file://COPYING.txt;md5=da0d261d1db78ab21ce86c79364a4098"
6
7DEPENDS = "python"
8
9SRC_URI = "${SOURCEFORGE_MIRROR}/docutils/docutils-${PV}.tar.gz"
10SRC_URI[md5sum] = "20ac380a18b369824276864d98ec0ad6"
11SRC_URI[sha256sum] = "9af4166adf364447289c5c697bb83c52f1d6f57e77849abcccd6a4a18a5e7ec9"
12
13S = "${WORKDIR}/docutils-${PV}"
14
15inherit distutils
16
17BBCLASSEXTEND = "native"
18
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 @@
1SUMMARY = "Python library used to interact with Git repositories"
2DESCRIPTION = "GitPython provides object model read and write access to \
3a git repository. Access repository information conveniently, alter the \
4index directly, handle remotes, or go down to low-level object database \
5access with big-files support."
6HOMEPAGE = "http://github.com/gitpython-developers/GitPython"
7SECTION = "devel/python"
8LICENSE = "BSD-3-Clause"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=8b8d26c37c1d5a04f9b0186edbebc183"
10DEPENDS = "python-gitdb"
11
12SRC_URI = "http://pypi.python.org/packages/source/G/GitPython/GitPython-${PV}.tar.gz"
13SRC_URI[md5sum] = "849082fe29adc653a3621465213cab96"
14SRC_URI[sha256sum] = "fd6786684a0d0dd7ebb961da754e3312fafe0c8e88f55ceb09858aa0af6094e0"
15
16S = "${WORKDIR}/GitPython-${PV}"
17
18inherit setuptools
19
20RDEPENDS_${PN} += "python-gitdb python-lang python-io python-shell python-math python-re python-subprocess python-stringold"
21
22BBCLASSEXTEND = "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 @@
1SUMMARY = "A pure-Python git object database"
2HOMEPAGE = "http://github.com/gitpython-developers/gitdb"
3SECTION = "devel/python"
4LICENSE = "BSD-3-Clause"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=59e5ecb13339a936eedf83282eaf4528"
6DEPENDS = "python-async python-smmap"
7
8SRC_URI = "https://pypi.python.org/packages/source/g/gitdb/gitdb-${PV}.tar.gz"
9SRC_URI[md5sum] = "25353bb8d3ea527ba443dd88cd4e8a1c"
10SRC_URI[sha256sum] = "de5d2dac0daec4a9cd7bb1ae1cd42d53510dcf597397c608c12a154b69ad3783"
11
12S = "${WORKDIR}/gitdb-${PV}"
13
14inherit distutils
15
16RDEPENDS_${PN} += "python-smmap python-async python-mmap python-lang python-zlib python-io python-shell"
17
18BBCLASSEXTEND = "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 @@
1Upstream-Status:Pending
2
3Index: gst-python-0.10.19/acinclude.m4
4===================================================================
5--- gst-python-0.10.19.orig/acinclude.m4 2010-04-21 15:23:44.000000000 -0700
6+++ gst-python-0.10.19/acinclude.m4 2010-11-15 14:43:00.642994001 -0800
7@@ -43,6 +43,13 @@
8 [AC_REQUIRE([AM_PATH_PYTHON])
9 AC_MSG_CHECKING(for headers required to compile python extensions)
10 dnl deduce PYTHON_INCLUDES
11+
12+AC_ARG_WITH(python-includes,
13+ [ --with-python-includes=DIR path to Python includes], py_exec_prefix=$withval)
14+if test x$py_exec_prefix != x; then
15+PYTHON_INCLUDES="-I${py_exec_prefix}/include/python${PYTHON_VERSION}"
16+py_prefix="${py_exec_prefix}"
17+else
18 py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
19 py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
20 if $PYTHON-config --help 2>/dev/null; then
21@@ -53,6 +60,7 @@
22 PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
23 fi
24 fi
25+fi
26 AC_SUBST(PYTHON_INCLUDES)
27 dnl check if the headers exist:
28 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..a551adbfa6
--- /dev/null
+++ b/meta/recipes-devtools/python/python-gst_0.10.22.bb
@@ -0,0 +1,23 @@
1SUMMARY = "Python bindings for the GStreamer multimedia framework"
2SECTION = "devel/python"
3LICENSE = "LGPLv2.1"
4DEPENDS = "gstreamer gst-plugins-base python-pygobject"
5RDEPENDS_${PN} += "python-pygtk"
6PR = "r2"
7
8SRC_URI = "http://gstreamer.freedesktop.org/src/gst-python/gst-python-${PV}.tar.bz2 \
9 file://python-path.patch"
10
11SRC_URI[md5sum] = "937152fe896241f827689f4b53e79b22"
12SRC_URI[sha256sum] = "8f26f519a5bccd770864317e098e5e307fc5ad1201eb96329634b6508b253178"
13S = "${WORKDIR}/gst-python-${PV}"
14
15LIC_FILES_CHKSUM = "file://COPYING;md5=39ff67e932b7bdfa9b78bad67151690b"
16
17inherit autotools distutils-base pkgconfig
18
19EXTRA_OECONF += "--with-python-includes=${STAGING_INCDIR}/../"
20
21FILES_${PN} += "${datadir}/gst-python"
22FILES_${PN}-dev += "${datadir}/gst-python/0.10/defs"
23FILES_${PN}-dbg += "${libdir}/${PYTHON_DIR}/site-packages/gst-0.10/gst/.debug/ ${libdir}/gstreamer-0.10/.debug/"
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 @@
1From 07d4f095a9e22ae676a8d68073101131e65012dc Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Tue, 15 Nov 2011 13:16:54 +0100
4Subject: [PATCH] python imaging setup.py: force paths for zlib, freetype and jpeg and don't add host paths
5
6Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
7
8Upstream-Status: Inappropriate [embedded specific]
9---
10 setup.py | 14 +++-----------
11 1 files changed, 3 insertions(+), 11 deletions(-)
12
13diff --git a/setup.py b/setup.py
14index 5d4d53a..b1a22ec 100644
15--- a/setup.py
16+++ b/setup.py
17@@ -34,10 +34,10 @@ def libinclude(root):
18 # TIFF_ROOT = libinclude("/opt/tiff")
19
20 TCL_ROOT = None
21-JPEG_ROOT = None
22-ZLIB_ROOT = None
23+JPEG_ROOT = os.environ['STAGING_LIBDIR']
24+ZLIB_ROOT = os.environ['STAGING_LIBDIR']
25 TIFF_ROOT = None
26-FREETYPE_ROOT = None
27+FREETYPE_ROOT = os.environ['STAGING_LIBDIR'], os.environ['STAGING_INCDIR']
28 LCMS_ROOT = None
29
30 # FIXME: add mechanism to explicitly *disable* the use of a library
31@@ -147,7 +147,6 @@ class pil_build_ext(build_ext):
32 add_directory(library_dirs, "/opt/local/lib")
33 add_directory(include_dirs, "/opt/local/include")
34
35- add_directory(library_dirs, "/usr/local/lib")
36 # FIXME: check /opt/stuff directories here?
37
38 prefix = sysconfig.get_config_var("prefix")
39@@ -207,13 +206,6 @@ class pil_build_ext(build_ext):
40 if os.path.isfile(os.path.join(tcl_dir, "tk.h")):
41 add_directory(include_dirs, tcl_dir)
42
43- # standard locations
44- add_directory(library_dirs, "/usr/local/lib")
45- add_directory(include_dirs, "/usr/local/include")
46-
47- add_directory(library_dirs, "/usr/lib")
48- add_directory(include_dirs, "/usr/include")
49-
50 #
51 # insert new dirs *before* default libs, to avoid conflicts
52 # between Python PYD stub libs and real libraries
53--
541.7.2.5
55
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 @@
1At least lcms wasn't deterministicly detected from sysroot.
2
3This will allow to export LCMS_ENABLED=False when lcms isn't in PACKAGECONFIG.
4
5Upstream-Status: Inappropriate [configuration]
6
7Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
8
9diff -uNr Imaging-1.1.7.orig/setup.py Imaging-1.1.7/setup.py
10--- Imaging-1.1.7.orig/setup.py 2013-07-22 10:17:02.081457075 +0200
11+++ Imaging-1.1.7/setup.py 2013-07-22 13:10:09.029707492 +0200
12@@ -39,6 +39,12 @@
13 TIFF_ROOT = None
14 FREETYPE_ROOT = os.environ['STAGING_LIBDIR'], os.environ['STAGING_INCDIR']
15 LCMS_ROOT = None
16+TCL_ENABLED = os.getenv('TCL_ENABLED', "True")
17+JPEG_ENABLED = os.getenv('JPEG_ENABLED', "True")
18+ZLIB_ENABLED = os.getenv('ZLIB_ENABLED', "True")
19+TIFF_ENABLED = os.getenv('TIFF_ENABLED', "True")
20+FREETYPE_ENABLED = os.getenv('FREETYPE_ENABLED', "True")
21+LCMS_ENABLED = os.getenv('LCMS_ENABLED', "True")
22
23 # FIXME: add mechanism to explicitly *disable* the use of a library
24
25@@ -220,22 +226,22 @@
26 zlib = jpeg = tiff = freetype = tcl = tk = lcms = None
27 feature = feature()
28
29- if find_include_file(self, "zlib.h"):
30+ if ZLIB_ENABLED == 'True' and find_include_file(self, "zlib.h"):
31 if find_library_file(self, "z"):
32 feature.zlib = "z"
33 elif sys.platform == "win32" and find_library_file(self, "zlib"):
34 feature.zlib = "zlib" # alternative name
35
36- if find_include_file(self, "jpeglib.h"):
37+ if JPEG_ENABLED == 'True' and find_include_file(self, "jpeglib.h"):
38 if find_library_file(self, "jpeg"):
39 feature.jpeg = "jpeg"
40 elif sys.platform == "win32" and find_library_file(self, "libjpeg"):
41 feature.jpeg = "libjpeg" # alternative name
42
43- if find_library_file(self, "tiff"):
44+ if TIFF_ENABLED == 'True' and find_library_file(self, "tiff"):
45 feature.tiff = "tiff"
46
47- if find_library_file(self, "freetype"):
48+ if FREETYPE_ENABLED == 'True' and find_library_file(self, "freetype"):
49 # look for freetype2 include files
50 freetype_version = 0
51 for dir in self.compiler.include_dirs:
52@@ -256,11 +262,11 @@
53 if dir:
54 add_directory(self.compiler.include_dirs, dir, 0)
55
56- if find_include_file(self, "lcms.h"):
57+ if LCMS_ENABLED == 'True' and find_include_file(self, "lcms.h"):
58 if find_library_file(self, "lcms"):
59 feature.lcms = "lcms"
60
61- if _tkinter and find_include_file(self, "tk.h"):
62+ if TCL_ENABLED == 'True' and _tkinter and find_include_file(self, "tk.h"):
63 # the library names may vary somewhat (e.g. tcl84 or tcl8.4)
64 version = TCL_VERSION[0] + TCL_VERSION[2]
65 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 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@intel.com>
3
4From c6040f618d8f2706a7b46d1cdf37d1a587f9701f Mon Sep 17 00:00:00 2001
5From: Andrew Stromnov <stromnov@gmail.com>
6Date: Thu, 28 Nov 2013 16:58:43 +0400
7Subject: [PATCH] fix compiling with FreeType 2.5.1
8
9---
10 _imagingft.c | 4 ++++
11 1 file changed, 4 insertions(+)
12
13diff --git a/_imagingft.c b/_imagingft.c
14index 47d50bd..f19555b 100644
15--- a/_imagingft.c
16+++ b/_imagingft.c
17@@ -59,7 +59,11 @@ struct {
18 const char* message;
19 } ft_errors[] =
20
21+#if defined(USE_FREETYPE_2_1)
22+#include FT_ERRORS_H
23+#else
24 #include <freetype/fterrors.h>
25+#endif
26
27 /* -------------------------------------------------------------------- */
28 /* font objects */
29--
301.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..ed8cfcc212
--- /dev/null
+++ b/meta/recipes-devtools/python/python-imaging_1.1.7.bb
@@ -0,0 +1,45 @@
1SUMMARY = "Python Imaging Library (PIL)"
2SECTION = "devel/python"
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://README;beginline=92;endline=120;md5=c4371af4579f1e489cf881c1443dd4ec"
5DEPENDS = "freetype jpeg tiff"
6SRCNAME = "Imaging"
7PR = "r5"
8
9SRC_URI = "http://effbot.org/downloads/Imaging-${PV}.tar.gz \
10 file://0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch \
11 file://allow.to.disable.some.features.patch \
12 file://fix-freetype-includes.patch"
13
14SRC_URI[md5sum] = "fc14a54e1ce02a0225be8854bfba478e"
15SRC_URI[sha256sum] = "895bc7c2498c8e1f9b99938f1a40dc86b3f149741f105cf7c7bd2e0725405211"
16S = "${WORKDIR}/${SRCNAME}-${PV}"
17
18# There isn't enable/disable option, and lcms is in meta-oe, at least make it explicit when enabled
19# setup.py already has FIXME: add mechanism to explicitly *disable* the use of a library
20PACKAGECONFIG ??= ""
21PACKAGECONFIG[lcms] = ",,lcms"
22
23inherit distutils
24
25do_compile() {
26 export STAGING_LIBDIR=${STAGING_LIBDIR}
27 export STAGING_INCDIR=${STAGING_INCDIR}
28 export LCMS_ENABLED=${@base_contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)}
29 distutils_do_compile
30}
31
32do_install() {
33 export STAGING_LIBDIR=${STAGING_LIBDIR}
34 export STAGING_INCDIR=${STAGING_INCDIR}
35 export LCMS_ENABLED=${@base_contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)}
36 distutils_do_install
37 install -d ${D}${datadir}/doc/${BPN}/html/
38 install -m 0644 ${S}/README ${D}${datadir}/doc/${BPN}/
39 install -m 0644 ${S}/Docs/* ${D}${datadir}/doc/${BPN}/html/
40
41 # get rid of #!/usr/local/bin/python
42 sed -i -e 's:/usr/local/bin/:${bindir}/env :g' ${D}${bindir}/*
43}
44
45RDEPENDS_${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 @@
1SUMMARY = "Templating library for Python"
2SECTION = "devel/python"
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=da2a9d126b93cab0996a8287dacc480b"
5
6SRC_URI = "https://pypi.python.org/packages/source/M/Mako/Mako-${PV}.tar.gz"
7SRC_URI[md5sum] = "fe3f394ef714776d09ec6133923736a7"
8SRC_URI[sha256sum] = "ed74d72b720a97a51590dfa839f2048ceeb76cc80d1d9ea5731a5262384316ae"
9
10S = "${WORKDIR}/Mako-${PV}"
11
12inherit setuptools
13
14RDEPENDS_${PN} = "python-threading \
15 python-netclient \
16 python-html \
17"
18RDEPENDS_${PN}_class-native = ""
19
20BBCLASSEXTEND = "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 @@
1Upstream-Status: Pending
2
3# Some versions of SWIG do not use the extension parameter.
4# Make it optional.
5# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
6Index: Python-2.6.1/Lib/distutils/command/build_ext.py
7===================================================================
8--- Python-2.6.1.orig/Lib/distutils/command/build_ext.py
9+++ Python-2.6.1/Lib/distutils/command/build_ext.py
10@@ -566,7 +566,7 @@ class build_ext (Command):
11 target_lang=language)
12
13
14- def swig_sources (self, sources, extension):
15+ def swig_sources (self, sources, extension=None):
16
17 """Walk the list of source files in 'sources', looking for SWIG
18 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 @@
1Upstream-Status: Pending
2
3# Don't modify the she-bang line for a cross-build.
4# Otherwise it points to our hostpython (which we do not want)
5#
6# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
7
8Index: Python-2.6.1/Lib/distutils/command/build_scripts.py
9===================================================================
10--- Python-2.6.1.orig/Lib/distutils/command/build_scripts.py
11+++ Python-2.6.1/Lib/distutils/command/build_scripts.py
12@@ -87,7 +87,7 @@ class build_scripts (Command):
13 continue
14
15 match = first_line_re.match(first_line)
16- if match:
17+ if False: #match:
18 adjust = 1
19 post_interp = match.group(1) or ''
20
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 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3# The proper prefix is inside our staging area.
4# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
5# Signed-off-by: Phil Blundell <philb@gnu.org>
6
7--- Python-2.6.6/Lib/distutils/sysconfig.py.orig 2012-01-03 14:02:03.027005296 +0000
8+++ Python-2.6.6/Lib/distutils/sysconfig.py 2012-01-03 14:02:31.517601081 +0000
9@@ -19,8 +19,8 @@
10 from distutils.errors import DistutilsPlatformError
11
12 # These are needed in a couple of spots, so just compute them once.
13-PREFIX = os.path.normpath(sys.prefix)
14-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
15+PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
16+EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
17
18 # Path to the base directory of the project. On Windows the binary may
19 # live in project/PCBuild9. If we're dealing with an x64 Windows build,
20@@ -70,7 +70,7 @@
21 sys.exec_prefix -- i.e., ignore 'plat_specific'.
22 """
23 if prefix is None:
24- prefix = plat_specific and EXEC_PREFIX or PREFIX
25+ prefix = os.environ['STAGING_INCDIR'].rstrip('include')
26
27 if os.name == "posix":
28 if python_build:
29@@ -115,12 +115,16 @@
30 If 'prefix' is supplied, use it instead of sys.prefix or
31 sys.exec_prefix -- i.e., ignore 'plat_specific'.
32 """
33+ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
34 if prefix is None:
35- prefix = plat_specific and EXEC_PREFIX or PREFIX
36+ if plat_specific:
37+ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
38+ else:
39+ prefix = PREFIX
40
41 if os.name == "posix":
42 libpython = os.path.join(prefix,
43- "lib", "python" + get_python_version())
44+ lib_basename, "python" + get_python_version())
45 if standard_lib:
46 return libpython
47 else:
48@@ -216,7 +220,7 @@
49 else:
50 # The name of the config.h file changed in 2.2
51 config_h = 'pyconfig.h'
52- return os.path.join(inc_dir, config_h)
53+ return os.path.join(inc_dir, config_h).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
54
55
56 def get_makefile_filename():
57@@ -225,7 +229,7 @@
58 return os.path.join(os.path.dirname(os.path.realpath(sys.executable)),
59 "Makefile")
60 lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
61- return os.path.join(lib_dir, "config", "Makefile")
62+ return os.path.join(lib_dir, "config", "Makefile").replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
63
64
65 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 @@
1Upstream-Status: Pending
2
3Index: Python-2.6.1/Lib/distutils/unixccompiler.py
4===================================================================
5--- Python-2.6.1.orig/Lib/distutils/unixccompiler.py 2009-11-13 16:04:54.000000000 +0000
6+++ Python-2.6.1/Lib/distutils/unixccompiler.py 2009-11-13 16:06:27.000000000 +0000
7@@ -300,6 +300,8 @@
8 dylib_f = self.library_filename(lib, lib_type='dylib')
9 static_f = self.library_filename(lib, lib_type='static')
10
11+ print "Looking in %s for %s" % (lib, dirs)
12+
13 for dir in dirs:
14 shared = os.path.join(dir, shared_f)
15 dylib = os.path.join(dir, dylib_f)
16@@ -309,10 +311,13 @@
17 # assuming that *all* Unix C compilers do. And of course I'm
18 # ignoring even GCC's "-static" option. So sue me.
19 if os.path.exists(dylib):
20+ print "Found %s" % (dylib)
21 return dylib
22 elif os.path.exists(shared):
23+ print "Found %s" % (shared)
24 return shared
25 elif os.path.exists(static):
26+ print "Found %s" % (static)
27 return static
28
29 # 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 @@
1commit 248279e54467a8cd5cde98fc124d1d1384703513
2Author: Yu Ke <ke.yu@intel.com>
3Date: Tue Jun 28 21:21:29 2011 +0800
4
5 SUSE patch for the lib64 issue
6
7 see detail in http://bugs.python.org/issue1294959
8
9 also rebased a bit for Yocto python 2.6.6
10
11 Picked-by: Yu Ke <ke.yu@intel.com>
12
13
142011/09/29
15The python recipe building was failing because python-native
16could not handle sys.lib var. sys.lib var is defined in the
17multilib patch hence added this multilib.patch for python-native
18recipe.
19
20Upstream-Status: Inappropriate [oe-specific]
21
22Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
23
24Index: Python-2.7.2/Include/pythonrun.h
25===================================================================
26--- Python-2.7.2.orig/Include/pythonrun.h
27+++ Python-2.7.2/Include/pythonrun.h
28@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
29 /* In their own files */
30 PyAPI_FUNC(const char *) Py_GetVersion(void);
31 PyAPI_FUNC(const char *) Py_GetPlatform(void);
32+PyAPI_FUNC(const char *) Py_GetLib(void);
33 PyAPI_FUNC(const char *) Py_GetCopyright(void);
34 PyAPI_FUNC(const char *) Py_GetCompiler(void);
35 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
36Index: Python-2.7.2/Lib/distutils/command/install.py
37===================================================================
38--- Python-2.7.2.orig/Lib/distutils/command/install.py
39+++ Python-2.7.2/Lib/distutils/command/install.py
40@@ -22,6 +22,8 @@ from site import USER_BASE
41 from site import USER_SITE
42
43
44+libname = sys.lib
45+
46 if sys.version < "2.2":
47 WINDOWS_SCHEME = {
48 'purelib': '$base',
49@@ -42,7 +44,7 @@ else:
50 INSTALL_SCHEMES = {
51 'unix_prefix': {
52 'purelib': '$base/lib/python$py_version_short/site-packages',
53- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
54+ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
55 'headers': '$base/include/python$py_version_short/$dist_name',
56 'scripts': '$base/bin',
57 'data' : '$base',
58Index: Python-2.7.2/Lib/pydoc.py
59===================================================================
60--- Python-2.7.2.orig/Lib/pydoc.py
61+++ Python-2.7.2/Lib/pydoc.py
62@@ -352,7 +352,7 @@ class Doc:
63
64 docloc = os.environ.get("PYTHONDOCS",
65 "http://docs.python.org/library")
66- basedir = os.path.join(sys.exec_prefix, "lib",
67+ basedir = os.path.join(sys.exec_prefix, sys.lib,
68 "python"+sys.version[0:3])
69 if (isinstance(object, type(os)) and
70 (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
71Index: Python-2.7.2/Lib/site.py
72===================================================================
73--- Python-2.7.2.orig/Lib/site.py
74+++ Python-2.7.2/Lib/site.py
75@@ -300,13 +300,19 @@ def getsitepackages():
76 if sys.platform in ('os2emx', 'riscos'):
77 sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
78 elif os.sep == '/':
79- sitepackages.append(os.path.join(prefix, "lib",
80+ sitepackages.append(os.path.join(prefix, sys.lib,
81 "python" + sys.version[:3],
82 "site-packages"))
83- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
84+ if sys.lib != "lib":
85+ sitepackages.append(os.path.join(prefix, "lib",
86+ "python" + sys.version[:3],
87+ "site-packages"))
88+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
89+ if sys.lib != "lib":
90+ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
91 else:
92 sitepackages.append(prefix)
93- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
94+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
95 if sys.platform == "darwin":
96 # for framework builds *only* we add the standard Apple
97 # locations.
98Index: Python-2.7.2/Lib/test/test_dl.py
99===================================================================
100--- Python-2.7.2.orig/Lib/test/test_dl.py
101+++ Python-2.7.2/Lib/test/test_dl.py
102@@ -5,10 +5,11 @@
103 import unittest
104 from test.test_support import verbose, import_module
105 dl = import_module('dl', deprecated=True)
106+import sys
107
108 sharedlibs = [
109- ('/usr/lib/libc.so', 'getpid'),
110- ('/lib/libc.so.6', 'getpid'),
111+ ('/usr/'+sys.lib+'/libc.so', 'getpid'),
112+ ('/'+sys.lib+'/libc.so.6', 'getpid'),
113 ('/usr/bin/cygwin1.dll', 'getpid'),
114 ('/usr/lib/libc.dylib', 'getpid'),
115 ]
116Index: Python-2.7.2/Lib/trace.py
117===================================================================
118--- Python-2.7.2.orig/Lib/trace.py
119+++ Python-2.7.2/Lib/trace.py
120@@ -762,10 +762,10 @@ def main(argv=None):
121 # should I also call expanduser? (after all, could use $HOME)
122
123 s = s.replace("$prefix",
124- os.path.join(sys.prefix, "lib",
125+ os.path.join(sys.prefix, sys.lib,
126 "python" + sys.version[:3]))
127 s = s.replace("$exec_prefix",
128- os.path.join(sys.exec_prefix, "lib",
129+ os.path.join(sys.exec_prefix, sys.lib,
130 "python" + sys.version[:3]))
131 s = os.path.normpath(s)
132 ignore_dirs.append(s)
133Index: Python-2.7.2/Makefile.pre.in
134===================================================================
135--- Python-2.7.2.orig/Makefile.pre.in
136+++ Python-2.7.2/Makefile.pre.in
137@@ -81,6 +81,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
138
139 # Machine-dependent subdirectories
140 MACHDEP= @MACHDEP@
141+LIB= @LIB@
142
143 # Install prefix for architecture-independent files
144 prefix= @prefix@
145@@ -97,7 +98,7 @@ LIBDIR= @libdir@
146 MANDIR= @mandir@
147 INCLUDEDIR= @includedir@
148 CONFINCLUDEDIR= $(exec_prefix)/include
149-SCRIPTDIR= $(prefix)/lib
150+SCRIPTDIR= $(prefix)/@LIB@
151
152 # Detailed destination directories
153 BINLIBDEST= $(LIBDIR)/python$(VERSION)
154@@ -532,6 +533,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
155 -DEXEC_PREFIX='"$(exec_prefix)"' \
156 -DVERSION='"$(VERSION)"' \
157 -DVPATH='"$(VPATH)"' \
158+ -DLIB='"$(LIB)"' \
159 -o $@ $(srcdir)/Modules/getpath.c
160
161 Modules/python.o: $(srcdir)/Modules/python.c
162@@ -566,7 +568,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
163 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
164
165 Python/getplatform.o: $(srcdir)/Python/getplatform.c
166- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
167+ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
168
169 Python/importdl.o: $(srcdir)/Python/importdl.c
170 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
171Index: Python-2.7.2/Modules/getpath.c
172===================================================================
173--- Python-2.7.2.orig/Modules/getpath.c
174+++ Python-2.7.2/Modules/getpath.c
175@@ -116,9 +116,11 @@
176 #define EXEC_PREFIX PREFIX
177 #endif
178
179+#define LIB_PYTHON LIB "/python" VERSION
180+
181 #ifndef PYTHONPATH
182-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
183- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
184+#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
185+ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
186 #endif
187
188 #ifndef LANDMARK
189@@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1];
190 static char exec_prefix[MAXPATHLEN+1];
191 static char progpath[MAXPATHLEN+1];
192 static char *module_search_path = NULL;
193-static char lib_python[] = "lib/python" VERSION;
194+static char lib_python[] = LIB_PYTHON;
195
196 static void
197 reduce(char *dir)
198Index: Python-2.7.2/Python/getplatform.c
199===================================================================
200--- Python-2.7.2.orig/Python/getplatform.c
201+++ Python-2.7.2/Python/getplatform.c
202@@ -10,3 +10,13 @@ Py_GetPlatform(void)
203 {
204 return PLATFORM;
205 }
206+
207+#ifndef LIB
208+#define LIB "lib"
209+#endif
210+
211+const char *
212+Py_GetLib(void)
213+{
214+ return LIB;
215+}
216Index: Python-2.7.2/Python/sysmodule.c
217===================================================================
218--- Python-2.7.2.orig/Python/sysmodule.c
219+++ Python-2.7.2/Python/sysmodule.c
220@@ -1416,6 +1416,8 @@ _PySys_Init(void)
221 PyString_FromString(Py_GetCopyright()));
222 SET_SYS_FROM_STRING("platform",
223 PyString_FromString(Py_GetPlatform()));
224+ SET_SYS_FROM_STRING("lib",
225+ PyString_FromString(Py_GetLib()));
226 SET_SYS_FROM_STRING("executable",
227 PyString_FromString(Py_GetProgramFullPath()));
228 SET_SYS_FROM_STRING("prefix",
229Index: Python-2.7.2/configure.in
230===================================================================
231--- Python-2.7.2.orig/configure.in
232+++ Python-2.7.2/configure.in
233@@ -629,6 +629,10 @@ SunOS*)
234 ;;
235 esac
236
237+AC_SUBST(LIB)
238+AC_MSG_CHECKING(LIB)
239+LIB=`basename ${libdir}`
240+AC_MSG_RESULT($LIB)
241
242 AC_SUBST(LIBRARY)
243 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 @@
1Upstream-Status: Inappropriate [embedded specific]
2
32011/09/29
4rebased for python-2.7.2
5Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
6
7Index: Python-2.7.2/setup.py
8===================================================================
9--- Python-2.7.2.orig/setup.py
10+++ Python-2.7.2/setup.py
11@@ -369,8 +369,8 @@ class PyBuildExt(build_ext):
12
13 def detect_modules(self):
14 # Ensure that /usr/local is always used
15- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
16- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
17+ #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
18+ #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
19 self.add_multiarch_paths()
20
21 # Add paths specified in the environment variables LDFLAGS and
22@@ -407,15 +407,15 @@ class PyBuildExt(build_ext):
23 for directory in reversed(options.dirs):
24 add_dir_to_list(dir_list, directory)
25
26- if os.path.normpath(sys.prefix) != '/usr' \
27- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
28+ #if os.path.normpath(sys.prefix) != '/usr' \
29+ #and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
30 # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
31 # (PYTHONFRAMEWORK is set) to avoid # linking problems when
32 # building a framework with different architectures than
33 # the one that is currently installed (issue #7473)
34- add_dir_to_list(self.compiler.library_dirs,
35+ add_dir_to_list(self.compiler.library_dirs,
36 sysconfig.get_config_var("LIBDIR"))
37- add_dir_to_list(self.compiler.include_dirs,
38+ add_dir_to_list(self.compiler.include_dirs,
39 sysconfig.get_config_var("INCLUDEDIR"))
40
41 try:
42@@ -426,11 +426,8 @@ class PyBuildExt(build_ext):
43 # lib_dirs and inc_dirs are used to search for files;
44 # if a file is found in one of those directories, it can
45 # be assumed that no additional -I,-L directives are needed.
46- lib_dirs = self.compiler.library_dirs + [
47- '/lib64', '/usr/lib64',
48- '/lib', '/usr/lib',
49- ]
50- inc_dirs = self.compiler.include_dirs + ['/usr/include']
51+ lib_dirs = self.compiler.library_dirs
52+ inc_dirs = self.compiler.include_dirs
53 exts = []
54 missing = []
55
56@@ -676,9 +673,8 @@ class PyBuildExt(build_ext):
57 pass # Issue 7384: Already linked against curses or tinfo.
58 elif curses_library:
59 readline_libs.append(curses_library)
60- elif self.compiler.find_library_file(lib_dirs +
61- ['/usr/lib/termcap'],
62- 'termcap'):
63+ elif self.compiler.find_library_file(lib_dirs,
64+ 'termcap'):
65 readline_libs.append('termcap')
66 exts.append( Extension('readline', ['readline.c'],
67 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 @@
1Upstream-Status: Pending
2
3The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information.
4This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name.
5
6Signed-off-by: Mei Lei <lei.mei@intel.com>
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8Index: Python-2.7.2/Lib/distutils/unixccompiler.py
9===================================================================
10--- Python-2.7.2.orig/Lib/distutils/unixccompiler.py 2011-11-24 13:51:10.539998722 -0800
11+++ Python-2.7.2/Lib/distutils/unixccompiler.py 2011-11-24 15:54:36.872137766 -0800
12@@ -282,7 +282,7 @@
13 # this time, there's no way to determine this information from
14 # the configuration data stored in the Python installation, so
15 # we use this hack.
16- compiler = os.path.basename(sysconfig.get_config_var("CC"))
17+ compiler = sysconfig.get_config_var("CC")
18 if sys.platform[:6] == "darwin":
19 # MacOSX's linker doesn't understand the -R flag at all
20 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..0c66d27c2d
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native_2.7.3.bb
@@ -0,0 +1,59 @@
1require python.inc
2
3EXTRANATIVEPATH += "bzip2-native"
4DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native"
5PR = "${INC_PR}.1"
6
7SRC_URI += "\
8 file://05-enable-ctypes-cross-build.patch \
9 file://06-ctypes-libffi-fix-configure.patch \
10 file://10-distutils-fix-swig-parameter.patch \
11 file://11-distutils-never-modify-shebang-line.patch \
12 file://12-distutils-prefix-is-inside-staging-area.patch \
13 file://debug.patch \
14 file://unixccompiler.patch \
15 file://nohostlibs.patch \
16 file://multilib.patch \
17 file://add-md5module-support.patch \
18 file://builddir.patch \
19 file://parallel-makeinst-create-bindir.patch \
20 file://python-fix-build-error-with-Readline-6.3.patch \
21 "
22S = "${WORKDIR}/Python-${PV}"
23
24FILESPATH = "${FILE_DIRNAME}/python-native/:${FILE_DIRNAME}/python/"
25
26inherit native
27
28RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-codecs-native python-core-native"
29
30EXTRA_OECONF_append = " --bindir=${bindir}/${PN}"
31
32EXTRA_OEMAKE = '\
33 BUILD_SYS="" \
34 HOST_SYS="" \
35 LIBC="" \
36 STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
37 STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
38'
39
40do_configure_prepend() {
41 autoreconf --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf"
42}
43
44do_install() {
45 oe_runmake 'DESTDIR=${D}' install
46 install -d ${D}${bindir}/${PN}
47 install -m 0755 Parser/pgen ${D}${bindir}/${PN}
48
49 # Make sure we use /usr/bin/env python
50 for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
51 sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
52 done
53
54 # Add a symlink to the native Python so that scripts can just invoke
55 # "nativepython" and get the right one without needing absolute paths
56 # (these often end up too long for the #! parser in the kernel as the
57 # buffer is 128 bytes long).
58 ln -s python-native/python ${D}${bindir}/nativepython
59}
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 @@
1DESCRIPTION = "nose extends the test loading and running features of unittest, \
2making it easier to write, find and run tests."
3SECTION = "devel/python"
4LICENSE = "LGPLv2.1"
5LIC_FILES_CHKSUM = "file://lgpl.txt;md5=a6f89e2100d9b6cdffcea4f398e37343"
6
7SRC_URI = "http://pypi.python.org/packages/source/n/nose/nose-${PV}.tar.gz"
8
9SRC_URI[md5sum] = "735e3f1ce8b07e70ee1b742a8a53585a"
10SRC_URI[sha256sum] = "2171e9202d118d302d5db1decb52dd862b79e2a626ca19653a6914574a6ca7d9"
11
12S = "${WORKDIR}/nose-${PV}"
13
14inherit setuptools
15
16BBCLASSEXTEND = "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 @@
1#define NPY_HAVE_ENDIAN_H 1
2#define NPY_SIZEOF_SHORT SIZEOF_SHORT
3#define NPY_SIZEOF_INT SIZEOF_INT
4#define NPY_SIZEOF_LONG SIZEOF_LONG
5#define NPY_SIZEOF_FLOAT 4
6#define NPY_SIZEOF_COMPLEX_FLOAT 8
7#define NPY_SIZEOF_DOUBLE 8
8#define NPY_SIZEOF_COMPLEX_DOUBLE 16
9#define NPY_SIZEOF_LONGDOUBLE 16
10#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
11#define NPY_SIZEOF_PY_INTPTR_T 8
12#define NPY_SIZEOF_PY_LONG_LONG 8
13#define NPY_SIZEOF_LONGLONG 8
14#define NPY_NO_SMP 0
15#define NPY_HAVE_DECL_ISNAN
16#define NPY_HAVE_DECL_ISINF
17#define NPY_HAVE_DECL_ISFINITE
18#define NPY_HAVE_DECL_SIGNBIT
19#define NPY_USE_C99_COMPLEX 1
20#define NPY_HAVE_COMPLEX_DOUBLE 1
21#define NPY_HAVE_COMPLEX_FLOAT 1
22#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
23#define NPY_USE_C99_FORMATS 1
24#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
25#define NPY_ABI_VERSION 0x01000009
26#define NPY_API_VERSION 0x00000007
27
28#ifndef __STDC_FORMAT_MACROS
29#define __STDC_FORMAT_MACROS 1
30#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 @@
1#define HAVE_ENDIAN_H 1
2#define SIZEOF_PY_INTPTR_T 8
3#define SIZEOF_PY_LONG_LONG 8
4#define MATHLIB m
5#define HAVE_SIN 1
6#define HAVE_COS 1
7#define HAVE_TAN 1
8#define HAVE_SINH 1
9#define HAVE_COSH 1
10#define HAVE_TANH 1
11#define HAVE_FABS 1
12#define HAVE_FLOOR 1
13#define HAVE_CEIL 1
14#define HAVE_SQRT 1
15#define HAVE_LOG10 1
16#define HAVE_LOG 1
17#define HAVE_EXP 1
18#define HAVE_ASIN 1
19#define HAVE_ACOS 1
20#define HAVE_ATAN 1
21#define HAVE_FMOD 1
22#define HAVE_MODF 1
23#define HAVE_FREXP 1
24#define HAVE_LDEXP 1
25#define HAVE_RINT 1
26#define HAVE_TRUNC 1
27#define HAVE_EXP2 1
28#define HAVE_LOG2 1
29#define HAVE_ATAN2 1
30#define HAVE_POW 1
31#define HAVE_NEXTAFTER 1
32#define HAVE_SINF 1
33#define HAVE_COSF 1
34#define HAVE_TANF 1
35#define HAVE_SINHF 1
36#define HAVE_COSHF 1
37#define HAVE_TANHF 1
38#define HAVE_FABSF 1
39#define HAVE_FLOORF 1
40#define HAVE_CEILF 1
41#define HAVE_RINTF 1
42#define HAVE_TRUNCF 1
43#define HAVE_SQRTF 1
44#define HAVE_LOG10F 1
45#define HAVE_LOGF 1
46#define HAVE_LOG1PF 1
47#define HAVE_EXPF 1
48#define HAVE_EXPM1F 1
49#define HAVE_ASINF 1
50#define HAVE_ACOSF 1
51#define HAVE_ATANF 1
52#define HAVE_ASINHF 1
53#define HAVE_ACOSHF 1
54#define HAVE_ATANHF 1
55#define HAVE_HYPOTF 1
56#define HAVE_ATAN2F 1
57#define HAVE_POWF 1
58#define HAVE_FMODF 1
59#define HAVE_MODFF 1
60#define HAVE_FREXPF 1
61#define HAVE_LDEXPF 1
62#define HAVE_EXP2F 1
63#define HAVE_LOG2F 1
64#define HAVE_COPYSIGNF 1
65#define HAVE_NEXTAFTERF 1
66#define HAVE_SINL 1
67#define HAVE_COSL 1
68#define HAVE_TANL 1
69#define HAVE_SINHL 1
70#define HAVE_COSHL 1
71#define HAVE_TANHL 1
72#define HAVE_FABSL 1
73#define HAVE_FLOORL 1
74#define HAVE_CEILL 1
75#define HAVE_RINTL 1
76#define HAVE_TRUNCL 1
77#define HAVE_SQRTL 1
78#define HAVE_LOG10L 1
79#define HAVE_LOGL 1
80#define HAVE_LOG1PL 1
81#define HAVE_EXPL 1
82#define HAVE_EXPM1L 1
83#define HAVE_ASINL 1
84#define HAVE_ACOSL 1
85#define HAVE_ATANL 1
86#define HAVE_ASINHL 1
87#define HAVE_ACOSHL 1
88#define HAVE_ATANHL 1
89#define HAVE_HYPOTL 1
90#define HAVE_ATAN2L 1
91#define HAVE_POWL 1
92#define HAVE_FMODL 1
93#define HAVE_MODFL 1
94#define HAVE_FREXPL 1
95#define HAVE_LDEXPL 1
96#define HAVE_EXP2L 1
97#define HAVE_LOG2L 1
98#define HAVE_COPYSIGNL 1
99#define HAVE_NEXTAFTERL 1
100#define HAVE_DECL_SIGNBIT
101#define HAVE_COMPLEX_H 1
102#define HAVE_CREAL 1
103#define HAVE_CIMAG 1
104#define HAVE_CABS 1
105#define HAVE_CARG 1
106#define HAVE_CEXP 1
107#define HAVE_CSQRT 1
108#define HAVE_CLOG 1
109#define HAVE_CCOS 1
110#define HAVE_CSIN 1
111#define HAVE_CPOW 1
112#define HAVE_CREALF 1
113#define HAVE_CIMAGF 1
114#define HAVE_CABSF 1
115#define HAVE_CARGF 1
116#define HAVE_CEXPF 1
117#define HAVE_CSQRTF 1
118#define HAVE_CLOGF 1
119#define HAVE_CCOSF 1
120#define HAVE_CSINF 1
121#define HAVE_CPOWF 1
122#define HAVE_CREALL 1
123#define HAVE_CIMAGL 1
124#define HAVE_CABSL 1
125#define HAVE_CARGL 1
126#define HAVE_CEXPL 1
127#define HAVE_CSQRTL 1
128#define HAVE_CLOGL 1
129#define HAVE_CCOSL 1
130#define HAVE_CSINL 1
131#define HAVE_CPOWL 1
132#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
133#ifndef __cplusplus
134/* #undef inline */
135#endif
136
137#ifndef _NPY_NPY_CONFIG_H_
138#error config.h should never be included directly, include npy_config.h instead
139#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 @@
1/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */
2/* #define SIZEOF_SHORT 2 */
3/* #define SIZEOF_INT 4 */
4/* #define SIZEOF_LONG 4 */
5/* #define SIZEOF_FLOAT 4 */
6/* #define SIZEOF_DOUBLE 8 */
7#define SIZEOF_LONG_DOUBLE 12
8#define SIZEOF_PY_INTPTR_T 4
9/* #define SIZEOF_LONG_LONG 8 */
10#define SIZEOF_PY_LONG_LONG 8
11/* #define CHAR_BIT 8 */
12#define MATHLIB m
13#define HAVE_FLOAT_FUNCS
14#define HAVE_LOG1P
15#define HAVE_EXPM1
16#define HAVE_INVERSE_HYPERBOLIC
17#define HAVE_INVERSE_HYPERBOLIC_FLOAT
18#define HAVE_ISNAN
19#define HAVE_ISINF
20#define HAVE_RINT
21
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 @@
1/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */
2/*
3 * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT
4 * */
5#define NPY_SIZEOF_SHORT 2
6#define NPY_SIZEOF_INT 4
7#define NPY_SIZEOF_LONG 4
8#define NPY_SIZEOF_FLOAT 4
9#define NPY_SIZEOF_DOUBLE 8
10#define NPY_SIZEOF_LONGDOUBLE 12
11#define NPY_SIZEOF_PY_INTPTR_T 4
12#define NPY_NO_SMP 0
13
14#define NPY_SIZEOF_LONGLONG 8
15#define NPY_SIZEOF_PY_LONG_LONG 8
16/* #define CHAR_BIT 8 */
17
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 @@
1/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */
2/* #define SIZEOF_SHORT 2 */
3/* #define SIZEOF_INT 4 */
4/* #define SIZEOF_LONG 4 */
5/* #define SIZEOF_FLOAT 4 */
6/* #define SIZEOF_DOUBLE 8 */
7#define SIZEOF_LONG_DOUBLE 12
8#define SIZEOF_PY_INTPTR_T 4
9/* #define SIZEOF_LONG_LONG 8 */
10#define SIZEOF_PY_LONG_LONG 8
11/* #define CHAR_BIT 8 */
12#define MATHLIB m
13#define HAVE_FLOAT_FUNCS
14#define HAVE_LOG1P
15#define HAVE_EXPM1
16#define HAVE_INVERSE_HYPERBOLIC
17#define HAVE_INVERSE_HYPERBOLIC_FLOAT
18#define HAVE_ISNAN
19#define HAVE_ISINF
20#define HAVE_RINT
21
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 @@
1/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */
2/*
3 * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT
4 * */
5#define NPY_SIZEOF_SHORT 2
6#define NPY_SIZEOF_INT 4
7#define NPY_SIZEOF_LONG 4
8#define NPY_SIZEOF_FLOAT 4
9#define NPY_SIZEOF_DOUBLE 8
10#define NPY_SIZEOF_LONGDOUBLE 12
11#define NPY_SIZEOF_PY_INTPTR_T 4
12#define NPY_NO_SMP 0
13
14#define NPY_SIZEOF_LONGLONG 8
15#define NPY_SIZEOF_PY_LONG_LONG 8
16/* #define CHAR_BIT 8 */
17
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 @@
1#define SIZEOF_PY_INTPTR_T 4
2#define SIZEOF_PY_LONG_LONG 8
3#define MATHLIB m
4#define HAVE_SIN
5#define HAVE_COS
6#define HAVE_TAN
7#define HAVE_SINH
8#define HAVE_COSH
9#define HAVE_TANH
10#define HAVE_FABS
11#define HAVE_FLOOR
12#define HAVE_CEIL
13#define HAVE_SQRT
14#define HAVE_LOG10
15#define HAVE_LOG
16#define HAVE_EXP
17#define HAVE_ASIN
18#define HAVE_ACOS
19#define HAVE_ATAN
20#define HAVE_FMOD
21#define HAVE_MODF
22#define HAVE_FREXP
23#define HAVE_LDEXP
24#define HAVE_RINT
25#define HAVE_TRUNC
26#define HAVE_EXP2
27#define HAVE_LOG2
28#define HAVE_ATAN2
29#define HAVE_POW
30#define HAVE_NEXTAFTER
31#define HAVE_SINF
32#define HAVE_COSF
33#define HAVE_TANF
34#define HAVE_SINHF
35#define HAVE_COSHF
36#define HAVE_TANHF
37#define HAVE_FABSF
38#define HAVE_FLOORF
39#define HAVE_CEILF
40#define HAVE_RINTF
41#define HAVE_TRUNCF
42#define HAVE_SQRTF
43#define HAVE_LOG10F
44#define HAVE_LOGF
45#define HAVE_LOG1PF
46#define HAVE_EXPF
47#define HAVE_EXPM1F
48#define HAVE_ASINF
49#define HAVE_ACOSF
50#define HAVE_ATANF
51#define HAVE_ASINHF
52#define HAVE_ACOSHF
53#define HAVE_ATANHF
54#define HAVE_HYPOTF
55#define HAVE_ATAN2F
56#define HAVE_POWF
57#define HAVE_FMODF
58#define HAVE_MODFF
59#define HAVE_FREXPF
60#define HAVE_LDEXPF
61#define HAVE_EXP2F
62#define HAVE_LOG2F
63#define HAVE_COPYSIGNF
64#define HAVE_NEXTAFTERF
65#define HAVE_SINL
66#define HAVE_COSL
67#define HAVE_TANL
68#define HAVE_SINHL
69#define HAVE_COSHL
70#define HAVE_TANHL
71#define HAVE_FABSL
72#define HAVE_FLOORL
73#define HAVE_CEILL
74#define HAVE_RINTL
75#define HAVE_TRUNCL
76#define HAVE_SQRTL
77#define HAVE_LOG10L
78#define HAVE_LOGL
79#define HAVE_LOG1PL
80#define HAVE_EXPL
81#define HAVE_EXPM1L
82#define HAVE_ASINL
83#define HAVE_ACOSL
84#define HAVE_ATANL
85#define HAVE_ASINHL
86#define HAVE_ACOSHL
87#define HAVE_ATANHL
88#define HAVE_HYPOTL
89#define HAVE_ATAN2L
90#define HAVE_POWL
91#define HAVE_FMODL
92#define HAVE_MODFL
93#define HAVE_FREXPL
94#define HAVE_LDEXPL
95#define HAVE_EXP2L
96#define HAVE_LOG2L
97#define HAVE_COPYSIGNL
98#define HAVE_NEXTAFTERL
99#define HAVE_DECL_SIGNBIT
100#define HAVE_COMPLEX_H
101#define HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE 1
102#ifndef __cplusplus
103/* #undef inline */
104#endif
105
106#ifndef _NPY_NPY_CONFIG_H_
107#error config.h should never be included directly, include npy_config.h instead
108#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 @@
1#ifndef _NPY_NUMPYCONFIG_H_
2#define _NPY_NUMPYCONFIG_H_
3
4#include "_numpyconfig.h"
5
6/*
7 * On Mac OS X, because there is only one configuration stage for all the archs
8 * in universal builds, any macro which depends on the arch needs to be
9 * harcoded
10 */
11#ifdef __APPLE__
12 #undef NPY_SIZEOF_LONG
13 #undef NPY_SIZEOF_PY_INTPTR_T
14
15 #ifdef __LP64__
16 #define NPY_SIZEOF_LONG 8
17 #define NPY_SIZEOF_PY_INTPTR_T 8
18 #else
19 #define NPY_SIZEOF_LONG 4
20 #define NPY_SIZEOF_PY_INTPTR_T 4
21 #endif
22#endif
23
24#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 @@
1#define NPY_HAVE_ENDIAN_H 1
2#define NPY_SIZEOF_SHORT SIZEOF_SHORT
3#define NPY_SIZEOF_INT SIZEOF_INT
4#define NPY_SIZEOF_LONG SIZEOF_LONG
5#define NPY_SIZEOF_FLOAT 4
6#define NPY_SIZEOF_COMPLEX_FLOAT 8
7#define NPY_SIZEOF_DOUBLE 8
8#define NPY_SIZEOF_COMPLEX_DOUBLE 16
9#define NPY_SIZEOF_LONGDOUBLE 8
10#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 16
11#define NPY_SIZEOF_PY_INTPTR_T 4
12#define NPY_SIZEOF_PY_LONG_LONG 8
13#define NPY_SIZEOF_LONGLONG 8
14#define NPY_NO_SMP 0
15#define NPY_HAVE_DECL_ISNAN
16#define NPY_HAVE_DECL_ISINF
17#define NPY_HAVE_DECL_ISFINITE
18#define NPY_HAVE_DECL_SIGNBIT
19#define NPY_USE_C99_COMPLEX 1
20#define NPY_HAVE_COMPLEX_DOUBLE 1
21#define NPY_HAVE_COMPLEX_FLOAT 1
22#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
23#define NPY_USE_C99_FORMATS 1
24#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
25#define NPY_ABI_VERSION 0x01000009
26#define NPY_API_VERSION 0x00000007
27
28#ifndef __STDC_FORMAT_MACROS
29#define __STDC_FORMAT_MACROS 1
30#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 @@
1#define HAVE_ENDIAN_H 1
2#define SIZEOF_PY_INTPTR_T 4
3#define SIZEOF_PY_LONG_LONG 8
4#define MATHLIB m
5#define HAVE_SIN 1
6#define HAVE_COS 1
7#define HAVE_TAN 1
8#define HAVE_SINH 1
9#define HAVE_COSH 1
10#define HAVE_TANH 1
11#define HAVE_FABS 1
12#define HAVE_FLOOR 1
13#define HAVE_CEIL 1
14#define HAVE_SQRT 1
15#define HAVE_LOG10 1
16#define HAVE_LOG 1
17#define HAVE_EXP 1
18#define HAVE_ASIN 1
19#define HAVE_ACOS 1
20#define HAVE_ATAN 1
21#define HAVE_FMOD 1
22#define HAVE_MODF 1
23#define HAVE_FREXP 1
24#define HAVE_LDEXP 1
25#define HAVE_RINT 1
26#define HAVE_TRUNC 1
27#define HAVE_EXP2 1
28#define HAVE_LOG2 1
29#define HAVE_ATAN2 1
30#define HAVE_POW 1
31#define HAVE_NEXTAFTER 1
32#define HAVE_SINF 1
33#define HAVE_COSF 1
34#define HAVE_TANF 1
35#define HAVE_SINHF 1
36#define HAVE_COSHF 1
37#define HAVE_TANHF 1
38#define HAVE_FABSF 1
39#define HAVE_FLOORF 1
40#define HAVE_CEILF 1
41#define HAVE_RINTF 1
42#define HAVE_TRUNCF 1
43#define HAVE_SQRTF 1
44#define HAVE_LOG10F 1
45#define HAVE_LOGF 1
46#define HAVE_LOG1PF 1
47#define HAVE_EXPF 1
48#define HAVE_EXPM1F 1
49#define HAVE_ASINF 1
50#define HAVE_ACOSF 1
51#define HAVE_ATANF 1
52#define HAVE_ASINHF 1
53#define HAVE_ACOSHF 1
54#define HAVE_ATANHF 1
55#define HAVE_HYPOTF 1
56#define HAVE_ATAN2F 1
57#define HAVE_POWF 1
58#define HAVE_FMODF 1
59#define HAVE_MODFF 1
60#define HAVE_FREXPF 1
61#define HAVE_LDEXPF 1
62#define HAVE_EXP2F 1
63#define HAVE_LOG2F 1
64#define HAVE_COPYSIGNF 1
65#define HAVE_NEXTAFTERF 1
66#define HAVE_SINL 1
67#define HAVE_COSL 1
68#define HAVE_TANL 1
69#define HAVE_SINHL 1
70#define HAVE_COSHL 1
71#define HAVE_TANHL 1
72#define HAVE_FABSL 1
73#define HAVE_FLOORL 1
74#define HAVE_CEILL 1
75#define HAVE_RINTL 1
76#define HAVE_TRUNCL 1
77#define HAVE_SQRTL 1
78#define HAVE_LOG10L 1
79#define HAVE_LOGL 1
80#define HAVE_LOG1PL 1
81#define HAVE_EXPL 1
82#define HAVE_EXPM1L 1
83#define HAVE_ASINL 1
84#define HAVE_ACOSL 1
85#define HAVE_ATANL 1
86#define HAVE_ASINHL 1
87#define HAVE_ACOSHL 1
88#define HAVE_ATANHL 1
89#define HAVE_HYPOTL 1
90#define HAVE_ATAN2L 1
91#define HAVE_POWL 1
92#define HAVE_FMODL 1
93#define HAVE_MODFL 1
94#define HAVE_FREXPL 1
95#define HAVE_LDEXPL 1
96#define HAVE_EXP2L 1
97#define HAVE_LOG2L 1
98#define HAVE_COPYSIGNL 1
99#define HAVE_NEXTAFTERL 1
100#define HAVE_DECL_SIGNBIT
101#define HAVE_COMPLEX_H 1
102#define HAVE_CREAL 1
103#define HAVE_CIMAG 1
104#define HAVE_CABS 1
105#define HAVE_CARG 1
106#define HAVE_CEXP 1
107#define HAVE_CSQRT 1
108#define HAVE_CLOG 1
109#define HAVE_CCOS 1
110#define HAVE_CSIN 1
111#define HAVE_CPOW 1
112#define HAVE_CREALF 1
113#define HAVE_CIMAGF 1
114#define HAVE_CABSF 1
115#define HAVE_CARGF 1
116#define HAVE_CEXPF 1
117#define HAVE_CSQRTF 1
118#define HAVE_CLOGF 1
119#define HAVE_CCOSF 1
120#define HAVE_CSINF 1
121#define HAVE_CPOWF 1
122#define HAVE_CREALL 1
123#define HAVE_CIMAGL 1
124#define HAVE_CABSL 1
125#define HAVE_CARGL 1
126#define HAVE_CEXPL 1
127#define HAVE_CSQRTL 1
128#define HAVE_CLOGL 1
129#define HAVE_CCOSL 1
130#define HAVE_CSINL 1
131#define HAVE_CPOWL 1
132#define HAVE_LDOUBLE_IEEE_DOUBLE_BE 1
133#ifndef __cplusplus
134/* #undef inline */
135#endif
136
137#ifndef _NPY_NPY_CONFIG_H_
138#error config.h should never be included directly, include npy_config.h instead
139#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 @@
1/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */
2/* #define SIZEOF_SHORT 2 */
3/* #define SIZEOF_INT 4 */
4/* #define SIZEOF_LONG 4 */
5/* #define SIZEOF_FLOAT 4 */
6/* #define SIZEOF_DOUBLE 8 */
7#define SIZEOF_LONG_DOUBLE 12
8#define SIZEOF_PY_INTPTR_T 4
9/* #define SIZEOF_LONG_LONG 8 */
10#define SIZEOF_PY_LONG_LONG 8
11/* #define CHAR_BIT 8 */
12#define MATHLIB m
13#define HAVE_FLOAT_FUNCS
14#define HAVE_LOG1P
15#define HAVE_EXPM1
16#define HAVE_INVERSE_HYPERBOLIC
17#define HAVE_INVERSE_HYPERBOLIC_FLOAT
18#define HAVE_ISNAN
19#define HAVE_ISINF
20#define HAVE_RINT
21
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 @@
1/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */
2/*
3 * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT
4 * */
5#define NPY_SIZEOF_SHORT 2
6#define NPY_SIZEOF_INT 4
7#define NPY_SIZEOF_LONG 4
8#define NPY_SIZEOF_FLOAT 4
9#define NPY_SIZEOF_DOUBLE 8
10#define NPY_SIZEOF_LONGDOUBLE 12
11#define NPY_SIZEOF_PY_INTPTR_T 4
12#define NPY_NO_SMP 0
13
14#define NPY_SIZEOF_LONGLONG 8
15#define NPY_SIZEOF_PY_LONG_LONG 8
16/* #define CHAR_BIT 8 */
17
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 @@
1Don't search /usr and so on for libraries by default to avoid host contamination.
2
3Upstream-Status: Inapproprite (As the code stands, this is a hack)
4Signed-off-by: Ross Burton <ross.burton@intel.com>
5
6diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
7index bac90fb..a63d796 100644
8--- a/numpy/distutils/system_info.py
9+++ b/numpy/distutils/system_info.py
10@@ -191,41 +191,12 @@ if sys.platform == 'win32':
11 default_x11_lib_dirs = []
12 default_x11_include_dirs = []
13 else:
14- default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib',
15- '/opt/local/lib', '/sw/lib'], platform_bits)
16- default_include_dirs = ['/usr/local/include',
17- '/opt/include', '/usr/include',
18- # path of umfpack under macports
19- '/opt/local/include/ufsparse',
20- '/opt/local/include', '/sw/include',
21- '/usr/include/suitesparse']
22- default_src_dirs = ['.', '/usr/local/src', '/opt/src', '/sw/src']
23-
24- default_x11_lib_dirs = libpaths(['/usr/X11R6/lib', '/usr/X11/lib',
25- '/usr/lib'], platform_bits)
26- default_x11_include_dirs = ['/usr/X11R6/include', '/usr/X11/include',
27- '/usr/include']
28-
29- if os.path.exists('/usr/lib/X11'):
30- globbed_x11_dir = glob('/usr/lib/*/libX11.so')
31- if globbed_x11_dir:
32- x11_so_dir = os.path.split(globbed_x11_dir[0])[0]
33- default_x11_lib_dirs.extend([x11_so_dir, '/usr/lib/X11'])
34- default_x11_include_dirs.extend(['/usr/lib/X11/include',
35- '/usr/include/X11'])
36-
37- import subprocess as sp
38- try:
39- p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE,
40- stderr=open(os.devnull, 'w'))
41- except OSError:
42- pass # gcc is not installed
43- else:
44- triplet = str(p.communicate()[0].decode().strip())
45- if p.returncode == 0:
46- # gcc supports the "-print-multiarch" option
47- default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
48- default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
49+ default_lib_dirs = libpaths(['/deadir/lib'], platform_bits)
50+ default_include_dirs = ['/deaddir/include']
51+ default_src_dirs = ['.', '/deaddir/src']
52+
53+ default_x11_lib_dirs = libpaths(['/deaddir/lib'], platform_bits)
54+ default_x11_include_dirs = ['/deaddir/include']
55
56 if os.path.join(sys.prefix, 'lib') not in default_lib_dirs:
57 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 @@
1#define NPY_HAVE_ENDIAN_H 1
2#define NPY_SIZEOF_SHORT SIZEOF_SHORT
3#define NPY_SIZEOF_INT SIZEOF_INT
4#define NPY_SIZEOF_LONG SIZEOF_LONG
5#define NPY_SIZEOF_FLOAT 4
6#define NPY_SIZEOF_COMPLEX_FLOAT 8
7#define NPY_SIZEOF_DOUBLE 8
8#define NPY_SIZEOF_COMPLEX_DOUBLE 16
9#define NPY_SIZEOF_LONGDOUBLE 16
10#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
11#define NPY_SIZEOF_PY_INTPTR_T 4
12#define NPY_SIZEOF_PY_LONG_LONG 8
13#define NPY_SIZEOF_LONGLONG 8
14#define NPY_NO_SMP 0
15#define NPY_HAVE_DECL_ISNAN
16#define NPY_HAVE_DECL_ISINF
17#define NPY_HAVE_DECL_ISFINITE
18#define NPY_HAVE_DECL_SIGNBIT
19#define NPY_USE_C99_COMPLEX 1
20#define NPY_HAVE_COMPLEX_DOUBLE 1
21#define NPY_HAVE_COMPLEX_FLOAT 1
22#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
23#define NPY_USE_C99_FORMATS 1
24#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
25#define NPY_ABI_VERSION 0x01000009
26#define NPY_API_VERSION 0x00000007
27
28#ifndef __STDC_FORMAT_MACROS
29#define __STDC_FORMAT_MACROS 1
30#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 @@
1#define HAVE_ENDIAN_H 1
2#define SIZEOF_PY_INTPTR_T 4
3#define SIZEOF_PY_LONG_LONG 8
4#define MATHLIB m
5#define HAVE_SIN 1
6#define HAVE_COS 1
7#define HAVE_TAN 1
8#define HAVE_SINH 1
9#define HAVE_COSH 1
10#define HAVE_TANH 1
11#define HAVE_FABS 1
12#define HAVE_FLOOR 1
13#define HAVE_CEIL 1
14#define HAVE_SQRT 1
15#define HAVE_LOG10 1
16#define HAVE_LOG 1
17#define HAVE_EXP 1
18#define HAVE_ASIN 1
19#define HAVE_ACOS 1
20#define HAVE_ATAN 1
21#define HAVE_FMOD 1
22#define HAVE_MODF 1
23#define HAVE_FREXP 1
24#define HAVE_LDEXP 1
25#define HAVE_RINT 1
26#define HAVE_TRUNC 1
27#define HAVE_EXP2 1
28#define HAVE_LOG2 1
29#define HAVE_ATAN2 1
30#define HAVE_POW 1
31#define HAVE_NEXTAFTER 1
32#define HAVE_SINF 1
33#define HAVE_COSF 1
34#define HAVE_TANF 1
35#define HAVE_SINHF 1
36#define HAVE_COSHF 1
37#define HAVE_TANHF 1
38#define HAVE_FABSF 1
39#define HAVE_FLOORF 1
40#define HAVE_CEILF 1
41#define HAVE_RINTF 1
42#define HAVE_TRUNCF 1
43#define HAVE_SQRTF 1
44#define HAVE_LOG10F 1
45#define HAVE_LOGF 1
46#define HAVE_LOG1PF 1
47#define HAVE_EXPF 1
48#define HAVE_EXPM1F 1
49#define HAVE_ASINF 1
50#define HAVE_ACOSF 1
51#define HAVE_ATANF 1
52#define HAVE_ASINHF 1
53#define HAVE_ACOSHF 1
54#define HAVE_ATANHF 1
55#define HAVE_HYPOTF 1
56#define HAVE_ATAN2F 1
57#define HAVE_POWF 1
58#define HAVE_FMODF 1
59#define HAVE_MODFF 1
60#define HAVE_FREXPF 1
61#define HAVE_LDEXPF 1
62#define HAVE_EXP2F 1
63#define HAVE_LOG2F 1
64#define HAVE_COPYSIGNF 1
65#define HAVE_NEXTAFTERF 1
66#define HAVE_SINL 1
67#define HAVE_COSL 1
68#define HAVE_TANL 1
69#define HAVE_SINHL 1
70#define HAVE_COSHL 1
71#define HAVE_TANHL 1
72#define HAVE_FABSL 1
73#define HAVE_FLOORL 1
74#define HAVE_CEILL 1
75#define HAVE_RINTL 1
76#define HAVE_TRUNCL 1
77#define HAVE_SQRTL 1
78#define HAVE_LOG10L 1
79#define HAVE_LOGL 1
80#define HAVE_LOG1PL 1
81#define HAVE_EXPL 1
82#define HAVE_EXPM1L 1
83#define HAVE_ASINL 1
84#define HAVE_ACOSL 1
85#define HAVE_ATANL 1
86#define HAVE_ASINHL 1
87#define HAVE_ACOSHL 1
88#define HAVE_ATANHL 1
89#define HAVE_HYPOTL 1
90#define HAVE_ATAN2L 1
91#define HAVE_POWL 1
92#define HAVE_FMODL 1
93#define HAVE_MODFL 1
94#define HAVE_FREXPL 1
95#define HAVE_LDEXPL 1
96#define HAVE_EXP2L 1
97#define HAVE_LOG2L 1
98#define HAVE_COPYSIGNL 1
99#define HAVE_NEXTAFTERL 1
100#define HAVE_DECL_SIGNBIT
101#define HAVE_COMPLEX_H 1
102#define HAVE_CREAL 1
103#define HAVE_CIMAG 1
104#define HAVE_CABS 1
105#define HAVE_CARG 1
106#define HAVE_CEXP 1
107#define HAVE_CSQRT 1
108#define HAVE_CLOG 1
109#define HAVE_CCOS 1
110#define HAVE_CSIN 1
111#define HAVE_CPOW 1
112#define HAVE_CREALF 1
113#define HAVE_CIMAGF 1
114#define HAVE_CABSF 1
115#define HAVE_CARGF 1
116#define HAVE_CEXPF 1
117#define HAVE_CSQRTF 1
118#define HAVE_CLOGF 1
119#define HAVE_CCOSF 1
120#define HAVE_CSINF 1
121#define HAVE_CPOWF 1
122#define HAVE_CREALL 1
123#define HAVE_CIMAGL 1
124#define HAVE_CABSL 1
125#define HAVE_CARGL 1
126#define HAVE_CEXPL 1
127#define HAVE_CSQRTL 1
128#define HAVE_CLOGL 1
129#define HAVE_CCOSL 1
130#define HAVE_CSINL 1
131#define HAVE_CPOWL 1
132#define HAVE_LDOUBLE_DOUBLE_DOUBLE_BE 1
133#ifndef __cplusplus
134/* #undef inline */
135#endif
136
137#ifndef _NPY_NPY_CONFIG_H_
138#error config.h should never be included directly, include npy_config.h instead
139#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..3ab3d72f2c
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/trycompile.diff
@@ -0,0 +1,33 @@
1--- /tmp/setup.py 2008-09-01 10:37:44.000000000 +0200
2+++ numpy-1.1.1/numpy/core/setup.py 2008-09-01 10:38:20.373198000 +0200
3@@ -80,8 +80,7 @@
4 raise SystemError,\
5 "Non-existing %s. Perhaps you need to install"\
6 " python-dev|python-devel." % (python_h)
7- result = config_cmd.try_run(tc,include_dirs=[python_include],
8- library_dirs = default_lib_dirs)
9+ result = config_cmd.try_compile(tc)
10 if not result:
11 raise SystemError,"Failed to test configuration. "\
12 "See previous error messages for more information."
13@@ -95,7 +94,7 @@
14 if mathlib:
15 mathlibs_choices.insert(0,mathlib.split(','))
16 for libs in mathlibs_choices:
17- if config_cmd.try_run(tc,libraries=libs):
18+ if config_cmd.try_compile(tc):
19 mathlibs = libs
20 break
21 else:
22@@ -180,10 +179,7 @@
23 " python-dev|python-devel." % (python_h)
24
25 config.numpy_include_dirs
26- result = config_cmd.try_run(testcode,
27- include_dirs = [python_include] + \
28- config.numpy_include_dirs,
29- library_dirs = default_lib_dirs)
30+ result = config_cmd.try_compile(testcode)
31
32 if not result:
33 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..c5b448167f
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/unbreak-assumptions.diff
@@ -0,0 +1,16 @@
1--- /tmp/system_info.py 2008-08-22 00:38:16.000000000 +0200
2+++ numpy-1.1.1/numpy/distutils/system_info.py 2008-08-22 00:40:33.013198000 +0200
3@@ -137,11 +137,8 @@
4 default_x11_lib_dirs = []
5 default_x11_include_dirs = []
6 else:
7- default_lib_dirs = ['/usr/local/lib', '/opt/lib', '/usr/lib',
8- '/opt/local/lib', '/sw/lib']
9- default_include_dirs = ['/usr/local/include',
10- '/opt/include', '/usr/include',
11- '/opt/local/include', '/sw/include']
12+ default_lib_dirs = ['/non-existant-dir']
13+ default_include_dirs = ['non-existant-dir']
14 default_src_dirs = ['.','/usr/local/src', '/opt/src','/sw/src']
15
16 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 @@
1#define NPY_HAVE_ENDIAN_H 1
2#define NPY_SIZEOF_SHORT SIZEOF_SHORT
3#define NPY_SIZEOF_INT SIZEOF_INT
4#define NPY_SIZEOF_LONG SIZEOF_LONG
5#define NPY_SIZEOF_FLOAT 4
6#define NPY_SIZEOF_COMPLEX_FLOAT 8
7#define NPY_SIZEOF_DOUBLE 8
8#define NPY_SIZEOF_COMPLEX_DOUBLE 16
9#define NPY_SIZEOF_LONGDOUBLE 16
10#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
11#define NPY_SIZEOF_PY_INTPTR_T 8
12#define NPY_SIZEOF_PY_LONG_LONG 8
13#define NPY_SIZEOF_LONGLONG 8
14#define NPY_NO_SMP 0
15#define NPY_HAVE_DECL_ISNAN
16#define NPY_HAVE_DECL_ISINF
17#define NPY_HAVE_DECL_ISFINITE
18#define NPY_HAVE_DECL_SIGNBIT
19#define NPY_USE_C99_COMPLEX 1
20#define NPY_HAVE_COMPLEX_DOUBLE 1
21#define NPY_HAVE_COMPLEX_FLOAT 1
22#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
23#define NPY_USE_C99_FORMATS 1
24#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
25#define NPY_ABI_VERSION 0x01000009
26#define NPY_API_VERSION 0x00000007
27
28#ifndef __STDC_FORMAT_MACROS
29#define __STDC_FORMAT_MACROS 1
30#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 @@
1#define HAVE_ENDIAN_H 1
2#define SIZEOF_PY_INTPTR_T 8
3#define SIZEOF_PY_LONG_LONG 8
4#define MATHLIB m
5#define HAVE_SIN 1
6#define HAVE_COS 1
7#define HAVE_TAN 1
8#define HAVE_SINH 1
9#define HAVE_COSH 1
10#define HAVE_TANH 1
11#define HAVE_FABS 1
12#define HAVE_FLOOR 1
13#define HAVE_CEIL 1
14#define HAVE_SQRT 1
15#define HAVE_LOG10 1
16#define HAVE_LOG 1
17#define HAVE_EXP 1
18#define HAVE_ASIN 1
19#define HAVE_ACOS 1
20#define HAVE_ATAN 1
21#define HAVE_FMOD 1
22#define HAVE_MODF 1
23#define HAVE_FREXP 1
24#define HAVE_LDEXP 1
25#define HAVE_RINT 1
26#define HAVE_TRUNC 1
27#define HAVE_EXP2 1
28#define HAVE_LOG2 1
29#define HAVE_ATAN2 1
30#define HAVE_POW 1
31#define HAVE_NEXTAFTER 1
32#define HAVE_SINF 1
33#define HAVE_COSF 1
34#define HAVE_TANF 1
35#define HAVE_SINHF 1
36#define HAVE_COSHF 1
37#define HAVE_TANHF 1
38#define HAVE_FABSF 1
39#define HAVE_FLOORF 1
40#define HAVE_CEILF 1
41#define HAVE_RINTF 1
42#define HAVE_TRUNCF 1
43#define HAVE_SQRTF 1
44#define HAVE_LOG10F 1
45#define HAVE_LOGF 1
46#define HAVE_LOG1PF 1
47#define HAVE_EXPF 1
48#define HAVE_EXPM1F 1
49#define HAVE_ASINF 1
50#define HAVE_ACOSF 1
51#define HAVE_ATANF 1
52#define HAVE_ASINHF 1
53#define HAVE_ACOSHF 1
54#define HAVE_ATANHF 1
55#define HAVE_HYPOTF 1
56#define HAVE_ATAN2F 1
57#define HAVE_POWF 1
58#define HAVE_FMODF 1
59#define HAVE_MODFF 1
60#define HAVE_FREXPF 1
61#define HAVE_LDEXPF 1
62#define HAVE_EXP2F 1
63#define HAVE_LOG2F 1
64#define HAVE_COPYSIGNF 1
65#define HAVE_NEXTAFTERF 1
66#define HAVE_SINL 1
67#define HAVE_COSL 1
68#define HAVE_TANL 1
69#define HAVE_SINHL 1
70#define HAVE_COSHL 1
71#define HAVE_TANHL 1
72#define HAVE_FABSL 1
73#define HAVE_FLOORL 1
74#define HAVE_CEILL 1
75#define HAVE_RINTL 1
76#define HAVE_TRUNCL 1
77#define HAVE_SQRTL 1
78#define HAVE_LOG10L 1
79#define HAVE_LOGL 1
80#define HAVE_LOG1PL 1
81#define HAVE_EXPL 1
82#define HAVE_EXPM1L 1
83#define HAVE_ASINL 1
84#define HAVE_ACOSL 1
85#define HAVE_ATANL 1
86#define HAVE_ASINHL 1
87#define HAVE_ACOSHL 1
88#define HAVE_ATANHL 1
89#define HAVE_HYPOTL 1
90#define HAVE_ATAN2L 1
91#define HAVE_POWL 1
92#define HAVE_FMODL 1
93#define HAVE_MODFL 1
94#define HAVE_FREXPL 1
95#define HAVE_LDEXPL 1
96#define HAVE_EXP2L 1
97#define HAVE_LOG2L 1
98#define HAVE_COPYSIGNL 1
99#define HAVE_NEXTAFTERL 1
100#define HAVE_DECL_SIGNBIT
101#define HAVE_COMPLEX_H 1
102#define HAVE_CREAL 1
103#define HAVE_CIMAG 1
104#define HAVE_CABS 1
105#define HAVE_CARG 1
106#define HAVE_CEXP 1
107#define HAVE_CSQRT 1
108#define HAVE_CLOG 1
109#define HAVE_CCOS 1
110#define HAVE_CSIN 1
111#define HAVE_CPOW 1
112#define HAVE_CREALF 1
113#define HAVE_CIMAGF 1
114#define HAVE_CABSF 1
115#define HAVE_CARGF 1
116#define HAVE_CEXPF 1
117#define HAVE_CSQRTF 1
118#define HAVE_CLOGF 1
119#define HAVE_CCOSF 1
120#define HAVE_CSINF 1
121#define HAVE_CPOWF 1
122#define HAVE_CREALL 1
123#define HAVE_CIMAGL 1
124#define HAVE_CABSL 1
125#define HAVE_CARGL 1
126#define HAVE_CEXPL 1
127#define HAVE_CSQRTL 1
128#define HAVE_CLOGL 1
129#define HAVE_CCOSL 1
130#define HAVE_CSINL 1
131#define HAVE_CPOWL 1
132#define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE 1
133#ifndef __cplusplus
134/* #undef inline */
135#endif
136
137#ifndef _NPY_NPY_CONFIG_H_
138#error config.h should never be included directly, include npy_config.h instead
139#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..f8974cf802
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy_1.7.0.bb
@@ -0,0 +1,87 @@
1SUMMARY = "A sophisticated Numeric Processing Package for Python"
2SECTION = "devel/python"
3LICENSE = "PSF"
4LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f87832d854acbade6e9f5c601c8b30b1"
5PR = "r1"
6
7SRC_URI = "${SOURCEFORGE_MIRROR}/numpy/numpy-${PV}.tar.gz \
8 file://no-host-paths.patch \
9 ${CONFIGFILESURI} "
10
11CONFIGFILESURI ?= ""
12
13CONFIGFILESURI_aarch64 = " \
14 file://config.h \
15 file://_numpyconfig.h \
16"
17CONFIGFILESURI_arm = " \
18 file://config.h \
19 file://numpyconfig.h \
20"
21CONFIGFILESURI_armeb = " \
22 file://config.h \
23 file://numpyconfig.h \
24"
25CONFIGFILESURI_mipsel = " \
26 file://config.h \
27 file://numpyconfig.h \
28"
29CONFIGFILESURI_i586 = " \
30 file://config.h \
31 file://numpyconfig.h \
32"
33CONFIGFILESURI_x86-64 = " \
34 file://config.h \
35 file://_numpyconfig.h \
36"
37CONFIGFILESURI_mips = " \
38 file://config.h \
39 file://_numpyconfig.h \
40"
41CONFIGFILESURI_powerpc = " \
42 file://config.h \
43 file://_numpyconfig.h \
44"
45
46S = "${WORKDIR}/numpy-${PV}"
47
48inherit distutils
49
50# Make the build fail and replace *config.h with proper one
51# This is a ugly, ugly hack - Koen
52do_compile_prepend_class-target() {
53 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
54 ${STAGING_BINDIR_NATIVE}/python-native/python setup.py build ${DISTUTILS_BUILD_ARGS} || \
55 true
56 cp ${WORKDIR}/*config.h ${S}/build/$(ls ${S}/build | grep src)/numpy/core/include/numpy/
57}
58
59FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a"
60
61SRC_URI[md5sum] = "4fa54e40b6a243416f0248123b6ec332"
62SRC_URI[sha256sum] = "f4fa70b7edbab65ee6432eb63743f5489f1919c614632b20b2fb45aa7e682ac6"
63
64# install what is needed for numpy.test()
65RDEPENDS_${PN} = "python-unittest \
66 python-difflib \
67 python-pprint \
68 python-pickle \
69 python-shell \
70 python-nose \
71 python-doctest \
72 python-datetime \
73 python-distutils \
74 python-misc \
75 python-mmap \
76 python-netclient \
77 python-numbers \
78 python-pydoc \
79 python-pkgutil \
80 python-email \
81 python-subprocess \
82 python-compression \
83"
84
85RDEPENDS_${PN}_class-native = ""
86
87BBCLASSEXTEND = "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..5b59b6ccc1
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
@@ -0,0 +1,39 @@
1SUMMARY = "Python bindings for the Cairo canvas library"
2HOMEPAGE = "http://cairographics.org/pycairo"
3BUGTRACKER = "http://bugs.freedesktop.org"
4SECTION = "python-devel"
5LICENSE = "LGPLv2.1 & MPL-1.1"
6LIC_FILES_CHKSUM = "file://COPYING;md5=f2e071ab72978431b294a0d696327421 \
7 file://COPYING-LGPL-2.1;md5=fad9b3332be894bab9bc501572864b29 \
8 file://COPYING-MPL-1.1;md5=bfe1f75d606912a4111c90743d6c7325"
9
10# cairo >= 1.8.8
11DEPENDS = "cairo"
12PR = "r2"
13
14SRC_URI = "http://cairographics.org/releases/py2cairo-${PV}.tar.bz2"
15
16SRC_URI[md5sum] = "20337132c4ab06c1146ad384d55372c5"
17SRC_URI[sha256sum] = "d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431"
18
19S = "${WORKDIR}/py2cairo-${PV}"
20
21inherit distutils pkgconfig
22
23do_configure() {
24 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} ./waf configure --prefix=${D}${prefix} --libdir=${D}${libdir}
25}
26
27do_compile() {
28 ./waf build ${PARALLEL_MAKE}
29}
30
31do_install() {
32 ./waf install
33 sed \
34 -e 's:@prefix@:${prefix}:' \
35 -e 's:@VERSION@:${PV}:' \
36 -e 's:@includedir@:${includedir}:' \
37 pycairo.pc.in > pycairo.pc
38 install -m 0644 pycairo.pc ${D}${libdir}/pkgconfig/
39}
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..907380f1ca
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pycurl/no-static-link.patch
@@ -0,0 +1,17 @@
1Upstream-Status: Pending
2
3Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
4
5Index: pycurl-7.19.3/setup.py
6===================================================================
7--- pycurl-7.19.3.orig/setup.py 2014-01-10 08:04:40.000000000 +0200
8+++ pycurl-7.19.3/setup.py 2014-02-04 15:09:08.411552887 +0200
9@@ -211,7 +211,7 @@
10 # If neither --libs nor --static-libs work, fail.
11 optbuf = ""
12 errtext = ''
13- for option in ["--libs", "--static-libs"]:
14+ for option in ["--libs"]:
15 p = subprocess.Popen((CURL_CONFIG, option),
16 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
17 stdout, stderr = p.communicate()
diff --git a/meta/recipes-devtools/python/python-pycurl_7.19.3.bb b/meta/recipes-devtools/python/python-pycurl_7.19.3.bb
new file mode 100644
index 0000000000..aee6cdda82
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pycurl_7.19.3.bb
@@ -0,0 +1,34 @@
1SUMMARY = "Python bindings for libcurl"
2HOMEPAGE = "http://pycurl.sourceforge.net/"
3SECTION = "devel/python"
4LICENSE = "LGPLv2.1+ | MIT"
5LIC_FILES_CHKSUM = "file://README.rst;beginline=204;endline=219;md5=57e5ab0c0f964533fc59d93dec5695bb \
6 file://COPYING-LGPL;md5=3579a9fd0221d49a237aaa33492f988c \
7 file://COPYING-MIT;md5=e8200955c773b2a0fd6cea36ea5e87be"
8
9DEPENDS = "curl python"
10RDEPENDS_${PN} = "python-core curl"
11SRCNAME = "pycurl"
12
13SRC_URI = "\
14 http://${SRCNAME}.sourceforge.net/download/${SRCNAME}-${PV}.tar.gz;name=archive \
15 file://no-static-link.patch \
16"
17
18SRC_URI[archive.md5sum] = "b9091b7438d3de1552e28862d2971cd1"
19SRC_URI[archive.sha256sum] = "05e48835fe445ff327dcd373f49d9970e0b828a07cd4d08a23264507a742d616"
20S = "${WORKDIR}/${SRCNAME}-${PV}"
21
22inherit distutils
23
24# need to export these variables for python-config to work
25export BUILD_SYS
26export HOST_SYS
27export STAGING_INCDIR
28export STAGING_LIBDIR
29
30BBCLASSEXTEND = "native"
31
32do_install_append() {
33 rm -rf ${D}${datadir}/share
34}
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 @@
1Upstream-Status: Accepted [https://bugzilla.gnome.org/show_bug.cgi?id=691101]
2
3Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
4diff -Nurd pygobject-2.27.91/configure.ac pygobject-2.27.91/configure.ac
5--- pygobject-2.27.91/configure.ac 2011-02-23 22:14:37.000000000 +0200
6+++ pygobject-2.27.91/configure.ac 2013-01-03 05:13:44.034949954 +0200
7@@ -35,7 +35,7 @@
8 AC_DEFINE(PYGOBJECT_MICRO_VERSION, pygobject_micro_version, [pygobject micro version])
9 AC_SUBST(PYGOBJECT_MICRO_VERSION, pygobject_micro_version)
10
11-AM_CONFIG_HEADER(config.h)
12+AC_CONFIG_HEADERS(config.h)
13 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
14 AM_INIT_AUTOMAKE(foreign)
15 AM_MAINTAINER_MODE
16@@ -82,7 +82,6 @@
17 m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
18 AC_ISC_POSIX
19 AC_PROG_CC
20-AM_PROG_CC_STDC
21 AM_PROG_CC_C_O
22
23 # check that we have the minimum version of python necisary to build
diff --git a/meta/recipes-devtools/python/python-pygobject_2.27.91.bb b/meta/recipes-devtools/python/python-pygobject_2.27.91.bb
new file mode 100644
index 0000000000..49ee1083cf
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygobject_2.27.91.bb
@@ -0,0 +1,41 @@
1SUMMARY = "Python GObject bindings"
2SECTION = "devel/python"
3LICENSE = "LGPLv2.1"
4LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7"
5DEPENDS = "python python-pygobject-native glib-2.0"
6DEPENDS_class-native = "python-native glib-2.0-native"
7RDEPENDS_class-native = ""
8PR = "r6"
9
10MAJ_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
11
12SRC_URI = "${GNOME_MIRROR}/pygobject/${MAJ_VER}/pygobject-${PV}.tar.bz2 \
13 file://obsolete_automake_macros.patch \
14"
15
16SRC_URI[md5sum] = "2b11a3050264721aac83188224b093a8"
17SRC_URI[sha256sum] = "a1dffbe2a8e0d490594554ed8d06f0ee4a371acb6c210e7f35158e9ae77e0df4"
18S = "${WORKDIR}/pygobject-${PV}"
19
20FILESPATH = "${FILE_DIRNAME}/python-pygobject:${FILE_DIRNAME}/files"
21EXTRA_OECONF += "--disable-introspection"
22
23PARALLEL_MAKEINST = ""
24
25inherit autotools distutils-base pkgconfig
26
27# necessary to let the call for python-config succeed
28export BUILD_SYS
29export HOST_SYS
30export STAGING_INCDIR
31export STAGING_LIBDIR
32
33PACKAGES += "${PN}-lib"
34
35RDEPENDS_${PN} += "python-textutils"
36
37FILES_${PN} = "${libdir}/python*"
38FILES_${PN}-lib = "${libdir}/lib*.so.*"
39FILES_${PN}-dev += "${bindir} ${datadir}"
40
41BBCLASSEXTEND = "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 @@
1## this one is commonly used with AM_PATH_PYTHONDIR ...
2dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
3dnl Check if a module containing a given symbol is visible to python.
4AC_DEFUN(AM_CHECK_PYMOD,
5[AC_REQUIRE([AM_PATH_PYTHON])
6py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
7AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
8AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
9ifelse([$2],[], [prog="
10import sys
11try:
12 import $1
13except ImportError:
14 sys.exit(1)
15except:
16 sys.exit(0)
17sys.exit(0)"], [prog="
18import $1
19$1.$2"])
20if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
21 then
22 eval "py_cv_mod_$py_mod_var=yes"
23 else
24 eval "py_cv_mod_$py_mod_var=no"
25 fi
26])
27py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
28if test "x$py_val" != xno; then
29 AC_MSG_RESULT(yes)
30 ifelse([$3], [],, [$3
31])dnl
32else
33 AC_MSG_RESULT(no)
34 ifelse([$4], [],, [$4
35])dnl
36fi
37])
38
39dnl a macro to check for ability to create python extensions
40dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
41dnl function also defines PYTHON_INCLUDES
42AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
43[AC_REQUIRE([AM_PATH_PYTHON])
44AC_MSG_CHECKING(for headers required to compile python extensions)
45dnl deduce PYTHON_INCLUDES
46AC_ARG_WITH(python-includes,
47 [ --with-python-includes=DIR path to Python includes], py_exec_prefix=$withval)
48if test x$py_exec_prefix != x; then
49PYTHON_INCLUDES="-I${py_exec_prefix}/include/python${PYTHON_VERSION}"
50else
51py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
52py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
53PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
54if test "$py_prefix" != "$py_exec_prefix"; then
55 PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
56fi
57fi
58AC_SUBST(PYTHON_INCLUDES)
59dnl check if the headers exist:
60save_CPPFLAGS="$CPPFLAGS"
61CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
62AC_TRY_CPP([#include <Python.h>],dnl
63[AC_MSG_RESULT(found)
64$1],dnl
65[AC_MSG_RESULT(not found)
66$2])
67CPPFLAGS="$save_CPPFLAGS"
68])
69
70dnl
71dnl JH_ADD_CFLAG(FLAG)
72dnl checks whether the C compiler supports the given flag, and if so, adds
73dnl it to $CFLAGS. If the flag is already present in the list, then the
74dnl check is not performed.
75AC_DEFUN([JH_ADD_CFLAG],
76[
77case " $CFLAGS " in
78*@<:@\ \ @:>@$1@<:@\ \ @:>@*)
79 ;;
80*)
81 save_CFLAGS="$CFLAGS"
82 CFLAGS="$CFLAGS $1"
83 AC_MSG_CHECKING([whether [$]CC understands $1])
84 AC_TRY_COMPILE([], [], [jh_has_option=yes], [jh_has_option=no])
85 AC_MSG_RESULT($jh_has_option)
86 if test $jh_has_option = no; then
87 CFLAGS="$save_CFLAGS"
88 fi
89 ;;
90esac])
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 @@
1Upstream-Status: Submitted
2
3add gtk-types.defs into gdk.c dependence
4
5gdk.c depends on gtk-types.defs but
6gdk/Makefile.am miss this. This will cause
7build error sometimes when built
8with multi-jobbing, so add gtk-types.defs into
9gdk.c dependence.
10
11Signed-off-by: Song.Li <Song.Li@windriver.com>
12Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
13---
14 gtk/Makefile.am | 2 +-
15 1 files changed, 1 insertions(+), 1 deletions(-)
16
17diff --git a/gtk/Makefile.am b/gtk/Makefile.am
18index 7bb5d0c..4a88351 100644
19--- a/gtk/Makefile.am
20+++ b/gtk/Makefile.am
21@@ -214,7 +214,7 @@ gtkunixprint.defs: $(GTKUNIXPRINT_DEFS) Makefile
22 gtkunixprint-types.defs: $(GTKUNIXPRINT_TYPES_DEFS) Makefile
23 $(CREATEDEFS) $@ $(GTKUNIXPRINT_TYPES_DEFS)
24
25-gdk.c: gdk-types.defs gdk.defs $(GDK_OVERRIDES)
26+gdk.c: gdk-types.defs gtk-types.defs gdk.defs $(GDK_OVERRIDES)
27 gtk.c: gdk-types.defs gtk-types.defs gtk.defs gdk-types.defs $(GTK_OVERRIDES)
28 _gtk_la_CFLAGS = $(PYCAIRO_CFLAGS) $(GTK_CFLAGS)
29 _gtk_la_LDFLAGS = $(common_ldflags) -export-symbols-regex init_gtk
30--
311.7.4
32
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 @@
1Upstream-Status: Inappropriate [configuration]
2
3Signed-off-by: Saul Wold <sgw@linux.intel.com>
4
5Index: pygtk-2.24.0/gtk/gtkunixprint.override
6===================================================================
7--- pygtk-2.24.0.orig/gtk/gtkunixprint.override
8+++ pygtk-2.24.0/gtk/gtkunixprint.override
9@@ -102,11 +102,6 @@ _wrap_gtk_print_job_get_surface(PyGObjec
10 if (pyg_error_check(&error))
11 return NULL;
12
13-#if PYCAIRO_VERSION_HEX >= 0x1010600
14- return PycairoSurface_FromSurface(cairo_surface_reference(surface), NULL);
15-#else
16- return PycairoSurface_FromSurface(cairo_surface_reference(surface), NULL, NULL);
17-#endif
18 }
19 %%
20 override gtk_print_job_send kwargs
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 @@
1Upstream-Status: Inappropriate [configuration]
2
3Index: pygtk-2.17.0/Makefile.am
4===================================================================
5--- pygtk-2.17.0.orig/Makefile.am
6+++ pygtk-2.17.0/Makefile.am
7@@ -4,7 +4,7 @@ if BUILD_GTK
8 GTK_SUBDIR = gtk
9 endif
10
11-SUBDIRS = . $(GTK_SUBDIR) examples tests docs
12+SUBDIRS = . $(GTK_SUBDIR) examples tests
13
14 PLATFORM_VERSION = 2.0
15
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 @@
1Upstream-Status: Pending
2
3Index: pygtk-2.10.4/gtk/__init__.py
4===================================================================
5--- pygtk-2.10.4.orig/gtk/__init__.py 2007-11-27 19:27:05.000000000 -0300
6+++ pygtk-2.10.4/gtk/__init__.py 2007-11-27 19:28:22.000000000 -0300
7@@ -78,7 +78,8 @@
8
9 keysyms = LazyModule('keysyms', locals())
10
11-_init()
12+if not hasattr(sys.modules['__main__'], 'python_launcher_enabled'):
13+ _init()
14
15 # CAPI
16 _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 @@
1## this one is commonly used with AM_PATH_PYTHONDIR ...
2dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
3dnl Check if a module containing a given symbol is visible to python.
4AC_DEFUN(AM_CHECK_PYMOD,
5[AC_REQUIRE([AM_PATH_PYTHON])
6py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
7AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
8AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
9ifelse([$2],[], [prog="
10import sys
11try:
12 import $1
13except ImportError:
14 sys.exit(1)
15except:
16 sys.exit(0)
17sys.exit(0)"], [prog="
18import $1
19$1.$2"])
20if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
21 then
22 eval "py_cv_mod_$py_mod_var=yes"
23 else
24 eval "py_cv_mod_$py_mod_var=no"
25 fi
26])
27py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
28if test "x$py_val" != xno; then
29 AC_MSG_RESULT(yes)
30 ifelse([$3], [],, [$3
31])dnl
32else
33 AC_MSG_RESULT(no)
34 ifelse([$4], [],, [$4
35])dnl
36fi
37])
38
39dnl a macro to check for ability to create python extensions
40dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
41dnl function also defines PYTHON_INCLUDES
42AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
43[AC_REQUIRE([AM_PATH_PYTHON])
44AC_MSG_CHECKING(for headers required to compile python extensions)
45dnl deduce PYTHON_INCLUDES
46AC_ARG_WITH(python-includes,
47 [ --with-python-includes=DIR path to Python includes], py_exec_prefix=$withval)
48if test x$py_exec_prefix != x; then
49PYTHON_INCLUDES="-I${py_exec_prefix}/include/python${PYTHON_VERSION}"
50else
51py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
52py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
53PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
54if test "$py_prefix" != "$py_exec_prefix"; then
55 PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
56fi
57fi
58AC_SUBST(PYTHON_INCLUDES)
59dnl check if the headers exist:
60save_CPPFLAGS="$CPPFLAGS"
61CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
62AC_TRY_CPP([#include <Python.h>],dnl
63[AC_MSG_RESULT(found)
64$1],dnl
65[AC_MSG_RESULT(not found)
66$2])
67CPPFLAGS="$save_CPPFLAGS"
68])
69
70dnl
71dnl JH_ADD_CFLAG(FLAG)
72dnl checks whether the C compiler supports the given flag, and if so, adds
73dnl it to $CFLAGS. If the flag is already present in the list, then the
74dnl check is not performed.
75AC_DEFUN([JH_ADD_CFLAG],
76[
77case " $CFLAGS " in
78*@<:@\ \ @:>@$1@<:@\ \ @:>@*)
79 ;;
80*)
81 save_CFLAGS="$CFLAGS"
82 CFLAGS="$CFLAGS $1"
83 AC_MSG_CHECKING([whether [$]CC understands $1])
84 AC_TRY_COMPILE([], [], [jh_has_option=yes], [jh_has_option=no])
85 AC_MSG_RESULT($jh_has_option)
86 if test $jh_has_option = no; then
87 CFLAGS="$save_CFLAGS"
88 fi
89 ;;
90esac])
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 @@
1From dc024e9079bbffbb44436ba3e70a758ebad5520f Mon Sep 17 00:00:00 2001
2From: "Song.Li" <Song.Li@windriver.com>
3Date: Sat, 5 Jan 2013 14:55:59 +0800
4Subject: [PATCH] update dependences of defs.c in Makefile.am
5
6In gtk/Makefile.am, defs.c should dependes on gdk-types.defs and
7gtk-types.defs, otherwise it fails occasionally when parallel compile.
8The error message:
9"IOError: [Errno 2] No such file or directory: 'gtk-types.defs'"
10
11Add them to dependences of defs.c to fix this issue.
12
13Upstream-Status: Submitted
14https://bugzilla.gnome.org/show_bug.cgi?id=702706
15
16Signed-off-by: Song.Li <Song.Li@windriver.com>
17Signed-off-by: Kai Kang <kai.kang@windriver.com>
18
19---
20 gtk/Makefile.am | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/gtk/Makefile.am b/gtk/Makefile.am
24index 7bb5d0c..91826cb 100644
25--- a/gtk/Makefile.am
26+++ b/gtk/Makefile.am
27@@ -289,7 +289,7 @@ if HAVE_GIO_TYPES_DEFS
28 extra_codegen_args += --register $(PYGOBJECT_DEFSDIR)/gio-types.defs
29 endif
30
31-.defs.c:
32+.defs.c: gdk-types.defs gtk-types.defs
33 ($(PYTHON) $(CODEGENDIR)/codegen.py \
34 $(PYGTK_CODEGEN_DEFINES) \
35 -I $(srcdir) \
36--
371.7.9.5
38
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..3dbef897a2
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygtk_2.24.0.bb
@@ -0,0 +1,58 @@
1SUMMARY = "Python bindings for the GTK+ UI toolkit"
2SECTION = "devel/python"
3# needs gtk+ 2.17.x
4DEPENDS = "gtk+ libglade python-pycairo python-pygobject"
5RDEPENDS_${PN} = "python-shell python-pycairo python-pygobject"
6PROVIDES = "python-pygtk2"
7SRCNAME = "pygtk"
8LICENSE = "LGPLv2.1"
9LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7"
10
11PR = "r1"
12
13SRC_URI = "ftp://ftp.gnome.org/pub/gnome/sources/pygtk/2.24/${SRCNAME}-${PV}.tar.bz2 \
14 file://add-gtk-types.defs-into-gdk.c-dependence.patch \
15 file://fix-gtkunixprint.patch \
16 file://prevent_to_get_display_during_import.patch \
17 file://nodocs.patch \
18 file://acinclude.m4 \
19 file://update-dependences-of-defs.c.patch"
20
21SRC_URI[md5sum] = "a1051d5794fd7696d3c1af6422d17a49"
22SRC_URI[sha256sum] = "cd1c1ea265bd63ff669e92a2d3c2a88eb26bcd9e5363e0f82c896e649f206912"
23
24S = "${WORKDIR}/${SRCNAME}-${PV}"
25
26EXTRA_OECONF = "--disable-docs --with-python-includes=${STAGING_INCDIR}/../"
27
28inherit autotools pkgconfig distutils-base
29
30do_configure_prepend() {
31 install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/
32 sed -i \
33 -e s:'`$PKG_CONFIG --variable defsdir pygobject-2.0`':\"${STAGING_DATADIR}/pygobject/2.0/defs\":g \
34 -e s:'`$PKG_CONFIG --variable=pygtkincludedir pygobject-2.0`':\"${STAGING_INCDIR}/pygtk-2.0\":g \
35 -e s:'`$PKG_CONFIG --variable=datadir pygobject-2.0`':\"${STAGING_DATADIR}\":g \
36 -e s:'`$PKG_CONFIG --variable codegendir pygobject-2.0`':\"${STAGING_DATADIR}/pygobject/2.0/codegen\":g \
37 -e s:'`$PKG_CONFIG --variable=fixxref pygobject-2.0`':\"${STAGING_DATADIR}/pygobject/xsl/fixxref.py\":g \
38 ${S}/configure.ac
39 sed -i 's:tests docs:tests:' ${S}/Makefile.am
40}
41
42# dirty fix #1: remove dependency on python-pygobject-dev
43do_install_append() {
44 find ${D} -name "*.la"|xargs rm -f
45 rm -f ${D}/${bindir}/pygtk-codegen-2.0
46 rm -rf ${D}/${libdir}/pkgconfig
47}
48
49# dirty fix #2: fix build system paths leaking in
50require fix-path.inc
51
52PACKAGES =+ "${PN}-demo"
53FILES_${PN}-demo = " ${bindir}/pygtk-demo ${libdir}/pygtk "
54RDEPENDS_${PN}-demo = "python-pygtk python-stringold python-lang"
55
56# todo: revamp packaging, package demo seperatly
57FILES_${PN}-dev += " ${libdir}/pygtk/2.0 ${bindir}/pygtk-* ${datadir}/pygtk/2.0"
58
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 @@
1require python-pyrex_${PV}.bb
2inherit native pythonnative
3DEPENDS = "python-native"
4RDEPENDS_${PN} = ""
5PR = "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 @@
1Upstream-Status: Pending
2
3Index: Pyrex-0.9.8.4/Pyrex/Distutils/extension.py
4===================================================================
5--- Pyrex-0.9.8.4.orig/Pyrex/Distutils/extension.py
6+++ Pyrex-0.9.8.4/Pyrex/Distutils/extension.py
7@@ -15,7 +15,7 @@ except ImportError:
8 warnings = None
9
10 class Extension(_Extension.Extension):
11- _Extension.Extension.__doc__ + \
12+ _Extension.Extension.__doc__ or "" + \
13 """pyrex_include_dirs : [string]
14 list of directories to search for Pyrex header files (.pxd) (in
15 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 @@
1SUMMARY = "Language for writing Python extension modules"
2DESCRIPTION = "Pyrex is a language specially designed for writing Python extension modules. \
3It's designed to bridge the gap between the nice, high-level, easy-to-use world of Python \
4and the messy, low-level world of C."
5SECTION = "devel/python"
6LICENSE = "Apache-2.0"
7LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=771d472f53f933033f57eeee7808e5bd"
8SRCNAME = "Pyrex"
9PR = "r4"
10
11SRC_URI = "\
12 http://www.cosc.canterbury.ac.nz/greg.ewing/python/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
13 file://pyrex-fix-optimized-mode.patch \
14"
15
16SRC_URI[md5sum] = "515dee67d15d4393841e2d60e8341947"
17SRC_URI[sha256sum] = "5f87df06831d0b3412eb4bc9d3fc2ee7bfae1b913d7da8c23ab2bf5699fb6b50"
18S = "${WORKDIR}/${SRCNAME}-${PV}"
19
20inherit distutils
21
22FILES_${PN} += "${datadir}${base_libdir}/${PYTHON_DIR}/site-packages/Pyrex/Compiler/Lexicon.pickle"
diff --git a/meta/recipes-devtools/python/python-scons-native_2.3.0.bb b/meta/recipes-devtools/python/python-scons-native_2.3.0.bb
new file mode 100644
index 0000000000..067ed61a4e
--- /dev/null
+++ b/meta/recipes-devtools/python/python-scons-native_2.3.0.bb
@@ -0,0 +1,8 @@
1require python-scons_${PV}.bb
2inherit native pythonnative
3DEPENDS = "python-native"
4RDEPENDS_${PN} = ""
5
6do_install_append() {
7 create_wrapper ${D}${bindir}/scons PYTHONPATH='$PYTHONPATH:${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}'
8}
diff --git a/meta/recipes-devtools/python/python-scons_2.3.0.bb b/meta/recipes-devtools/python/python-scons_2.3.0.bb
new file mode 100644
index 0000000000..eb2735d46f
--- /dev/null
+++ b/meta/recipes-devtools/python/python-scons_2.3.0.bb
@@ -0,0 +1,14 @@
1SUMMARY = "Software Construction tool (make/autotools replacement)"
2SECTION = "devel/python"
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=98e9a1e6029e715255c52032a1eba637"
5SRCNAME = "scons"
6
7SRC_URI = "${SOURCEFORGE_MIRROR}/scons/scons-${PV}.tar.gz"
8
9SRC_URI[md5sum] = "083ce5624d6adcbdaf2526623f456ca9"
10SRC_URI[sha256sum] = "9442069999cf4b2caa94a5886ab4c2c71de1718ed5e9176c18e2b6dbca463b4b"
11
12S = "${WORKDIR}/${SRCNAME}-${PV}"
13
14inherit distutils
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..113618255f
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch
@@ -0,0 +1,167 @@
1From 7ee23804a06f81476cc2b31a6db11b52d7af764e Mon Sep 17 00:00:00 2001
2From: Mark Hatle <mark.hatle@windriver.com>
3Date: Mon, 20 Jan 2014 14:30:52 +0000
4Subject: [PATCH] Add mechanism to attempt install without failing
5
6In OpenEmbedded, for complementary and 'attemptonly' package processing,
7we need a way to instruct smart to try to install, but ignore any
8failures (usually conflicts).
9
10This option only works for the install operation.
11
12Upstream-Status: Pending
13
14Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
15Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
16---
17 smart/commands/install.py | 5 ++++
18 smart/transaction.py | 65 +++++++++++++++++++++++++++++++++++------------
19 2 files changed, 54 insertions(+), 16 deletions(-)
20
21diff --git a/smart/commands/install.py b/smart/commands/install.py
22index 590222c..6ef9682 100644
23--- a/smart/commands/install.py
24+++ b/smart/commands/install.py
25@@ -50,6 +50,8 @@ def option_parser():
26 parser = OptionParser(usage=USAGE,
27 description=DESCRIPTION,
28 examples=EXAMPLES)
29+ parser.add_option("--attempt", action="store_true",
30+ help=_("attempt to install packages, ignore failures"))
31 parser.add_option("--stepped", action="store_true",
32 help=_("split operation in steps"))
33 parser.add_option("--urls", action="store_true",
34@@ -80,6 +82,9 @@ def main(ctrl, opts):
35 if not opts.args:
36 raise Error, _("no package(s) given")
37
38+ if opts.attempt:
39+ sysconf.set("attempt-install", True, soft=True)
40+
41 if opts.explain:
42 sysconf.set("explain-changesets", True, soft=True)
43
44diff --git a/smart/transaction.py b/smart/transaction.py
45index 5730a42..e3e61c6 100644
46--- a/smart/transaction.py
47+++ b/smart/transaction.py
48@@ -555,6 +555,8 @@ class Transaction(object):
49 changeset.set(pkg, INSTALL)
50 isinst = changeset.installed
51
52+ attempt = sysconf.has("attempt-install", soft=True)
53+
54 # Remove packages conflicted by this one.
55 for cnf in pkg.conflicts:
56 for prv in cnf.providedby:
57@@ -564,11 +566,16 @@ class Transaction(object):
58 if not isinst(prvpkg):
59 locked[prvpkg] = (LOCKED_CONFLICT_BY, pkg)
60 continue
61- if prvpkg in locked:
62- raise Failed, _("Can't install %s: conflicted package "
63- "%s is locked") % (pkg, prvpkg)
64- self._remove(prvpkg, changeset, locked, pending, depth)
65- pending.append((PENDING_UPDOWN, prvpkg))
66+ if attempt:
67+ del changeset[pkg]
68+ raise Failed, _("Can't install %s: it conflicts with package "
69+ "%s") % (pkg, prvpkg)
70+ else:
71+ if prvpkg in locked:
72+ raise Failed, _("Can't install %s: conflicted package "
73+ "%s is locked") % (pkg, prvpkg)
74+ self._remove(prvpkg, changeset, locked, pending, depth)
75+ pending.append((PENDING_UPDOWN, prvpkg))
76
77 # Remove packages conflicting with this one.
78 for prv in pkg.provides:
79@@ -579,12 +586,18 @@ class Transaction(object):
80 if not isinst(cnfpkg):
81 locked[cnfpkg] = (LOCKED_CONFLICT, pkg)
82 continue
83- if cnfpkg in locked:
84+ if attempt:
85+ del changeset[pkg]
86 raise Failed, _("Can't install %s: it's conflicted by "
87- "the locked package %s") \
88- % (pkg, cnfpkg)
89- self._remove(cnfpkg, changeset, locked, pending, depth)
90- pending.append((PENDING_UPDOWN, cnfpkg))
91+ "the package %s") \
92+ % (pkg, cnfpkg)
93+ else:
94+ if cnfpkg in locked:
95+ raise Failed, _("Can't install %s: it's conflicted by "
96+ "the locked package %s") \
97+ % (pkg, cnfpkg)
98+ self._remove(cnfpkg, changeset, locked, pending, depth)
99+ pending.append((PENDING_UPDOWN, cnfpkg))
100
101 # Remove packages with the same name that can't
102 # coexist with this one.
103@@ -594,10 +607,15 @@ class Transaction(object):
104 if not isinst(namepkg):
105 locked[namepkg] = (LOCKED_NO_COEXIST, pkg)
106 continue
107- if namepkg in locked:
108+ if attempt:
109+ del changeset[pkg]
110 raise Failed, _("Can't install %s: it can't coexist "
111 "with %s") % (pkg, namepkg)
112- self._remove(namepkg, changeset, locked, pending, depth)
113+ else:
114+ if namepkg in locked:
115+ raise Failed, _("Can't install %s: it can't coexist "
116+ "with %s") % (pkg, namepkg)
117+ self._remove(namepkg, changeset, locked, pending, depth)
118
119 # Install packages required by this one.
120 for req in pkg.requires + pkg.recommends:
121@@ -1176,6 +1194,8 @@ class Transaction(object):
122
123 self._policy.runStarting()
124
125+ attempt = sysconf.has("attempt-install", soft=True)
126+
127 try:
128 changeset = self._changeset.copy()
129 isinst = changeset.installed
130@@ -1190,7 +1210,11 @@ class Transaction(object):
131 locked[pkg] = (LOCKED_KEEP, None)
132 elif op is INSTALL:
133 if not isinst(pkg) and pkg in locked:
134- raise Failed, _("Can't install %s: it's locked") % pkg
135+ if attempt:
136+ iface.warning(_("Can't install %s: it's locked") % pkg)
137+ del changeset[pkg]
138+ else:
139+ raise Failed, _("Can't install %s: it's locked") % pkg
140 changeset.set(pkg, INSTALL)
141 locked[pkg] = (LOCKED_INSTALL, None)
142 elif op is REMOVE:
143@@ -1216,9 +1240,18 @@ class Transaction(object):
144 else:
145 op = REMOVE
146 if op is INSTALL or op is REINSTALL:
147- self._install(pkg, changeset, locked, pending)
148- if pkg in changeset:
149- changeset.setRequested(pkg, True)
150+ try:
151+ self._install(pkg, changeset, locked, pending)
152+ if pkg in changeset:
153+ changeset.setRequested(pkg, True)
154+ except Failed, e:
155+ if attempt:
156+ iface.warning(_("Can't install %s: %s") % (pkg, e))
157+ if pkg in changeset:
158+ del changeset[pkg]
159+ continue
160+ else:
161+ raise Failed, e
162 elif op is REMOVE:
163 self._remove(pkg, changeset, locked, pending)
164 elif op is UPGRADE:
165--
1661.8.4.2
167
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 @@
1Make CHANNELSDIR in smart empty, since this causes host contamination issues
2on some RPM-based hosts on which smart is already installed.
3
4[YOCTO #3881]
5
6Upstream-Status: Inappropriate [embedded specific]
7
8diff --git a/smart/plugins/channelsync.py b/smart/plugins/channelsync.py
9index 3ba95ff..646d696 100644
10--- a/smart/plugins/channelsync.py
11+++ b/smart/plugins/channelsync.py
12@@ -23,7 +23,11 @@ from smart.channel import *
13 from smart import *
14 import os
15
16-CHANNELSDIR = "/etc/smart/channels/"
17+# For now, we leave the definition of CHANNELSDIR empty. This prevents smart
18+# from erroneously consider the build host's channels while setting up its
19+# channels [YOCTO #3881]. If this feature will be used in the future, CHANNELSDIR
20+# should be set to a proper value.
21+CHANNELSDIR = ""
22
23 def syncChannels(channelsdir, force=None):
24
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 @@
1Add a simple method to disable the install of recommended packages
2
3Upstream-Status: Pending
4
5Usage:
6 smart config --set ignore-all-recommends=1
7
8Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
9
10Index: smart-1.4.1/smart/transaction.py
11===================================================================
12--- smart-1.4.1.orig/smart/transaction.py
13+++ smart-1.4.1/smart/transaction.py
14@@ -611,7 +611,9 @@ class Transaction(object):
15 for prv in req.providedby:
16 for prvpkg in prv.packages:
17 if not reqrequired:
18- if pkgconf.testFlag("ignore-recommends", prvpkg):
19+ if sysconf.get("ignore-all-recommends", 0) == 1:
20+ continue
21+ elif pkgconf.testFlag("ignore-recommends", prvpkg):
22 continue
23 if isinst(prvpkg):
24 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 @@
1Report a reason when a dependency could not be installed because it is locked
2
3If a requirement of a package is conflicted, depending on how the
4solution is reached, the transaction code may eliminate all providers
5of the requirement and then error out because nothing provides them. To
6work around this, store a reason in the locked dict and report that back
7if we need to, so for example instead of:
8
9 error: Can't install packagegroup-core-ssh-dropbear-1.0-r1@all: no package provides dropbear
10
11we now get:
12
13 error: Can't install packagegroup-core-ssh-dropbear-1.0-r1@all: unable to install provider for dropbear:
14 error: dropbear-2013.58-r1.0@armv5te is conflicted by openssh-sshd-6.2p2-r0@armv5te
15
16Upstream-Status: Pending
17
18Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
19---
20 smart/const.py | 7 +++++++
21 smart/transaction.py | 58 +++++++++++++++++++++++++++++++++++++++++-----------
22 2 files changed, 53 insertions(+), 12 deletions(-)
23
24diff --git a/smart/const.py b/smart/const.py
25index 4d8e5cb..67c1ac5 100644
26--- a/smart/const.py
27+++ b/smart/const.py
28@@ -70,4 +70,11 @@ DATADIR = "/var/lib/smart/"
29 USERDATADIR = "~/.smart/"
30 CONFFILE = "config"
31
32+LOCKED_INSTALL = Enum('LOCKED_INSTALL')
33+LOCKED_REMOVE = Enum('LOCKED_REMOVE')
34+LOCKED_CONFLICT = Enum('LOCKED_CONFLICT')
35+LOCKED_CONFLICT_BY = Enum('LOCKED_CONFLICT_BY')
36+LOCKED_NO_COEXIST = Enum('LOCKED_NO_COEXIST')
37+LOCKED_SYSCONF = Enum('LOCKED_SYSCONF')
38+
39 # vim:ts=4:sw=4:et
40diff --git a/smart/transaction.py b/smart/transaction.py
41index 300b9cc..dd9aa38 100644
42--- a/smart/transaction.py
43+++ b/smart/transaction.py
44@@ -19,10 +19,31 @@
45 # along with Smart Package Manager; if not, write to the Free Software
46 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
47 #
48-from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP
49+from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP, LOCKED_INSTALL, LOCKED_CONFLICT, LOCKED_CONFLICT_BY, LOCKED_NO_COEXIST, LOCKED_SYSCONF, LOCKED_REMOVE
50 from smart.cache import PreRequires, Package
51 from smart import *
52
53+def lock_reason(pkg, lockvalue):
54+ try:
55+ (reason, otherpkg) = lockvalue
56+ except TypeError:
57+ reason = None
58+ lockvalue = None
59+ if reason == LOCKED_INSTALL:
60+ return _("%s is to be installed") % pkg
61+ elif reason == LOCKED_CONFLICT:
62+ return _("%s conflicts with %s") % (pkg, otherpkg)
63+ elif reason == LOCKED_CONFLICT_BY:
64+ return _("%s is conflicted by %s") % (pkg, otherpkg)
65+ elif reason == LOCKED_NO_COEXIST:
66+ return _("%s cannot coexist with %s") % (pkg, otherpkg)
67+ elif reason == LOCKED_SYSCONF:
68+ return _("%s is locked in system configuration") % pkg
69+ elif reason == LOCKED_REMOVE:
70+ return _("%s is to be removed") % pkg
71+ else:
72+ return _("%s is locked (unknown reason)") % pkg
73+
74 class ChangeSet(dict):
75
76 def __init__(self, cache, state=None, requested=None):
77@@ -187,7 +208,7 @@ class Policy(object):
78 for pkg in pkgconf.filterByFlag("lock", cache.getPackages()):
79 if pkg not in self._locked:
80 self._sysconflocked.append(pkg)
81- self._locked[pkg] = True
82+ self._locked[pkg] = (LOCKED_SYSCONF, None)
83
84 def runFinished(self):
85 self._priorities.clear()
86@@ -524,7 +545,7 @@ class Transaction(object):
87 if ownpending:
88 pending = []
89
90- locked[pkg] = True
91+ locked[pkg] = (LOCKED_INSTALL, None)
92 changeset.set(pkg, INSTALL)
93 isinst = changeset.installed
94
95@@ -535,7 +556,7 @@ class Transaction(object):
96 if prvpkg is pkg:
97 continue
98 if not isinst(prvpkg):
99- locked[prvpkg] = True
100+ locked[prvpkg] = (LOCKED_CONFLICT_BY, pkg)
101 continue
102 if prvpkg in locked:
103 raise Failed, _("Can't install %s: conflicted package "
104@@ -550,7 +571,7 @@ class Transaction(object):
105 if cnfpkg is pkg:
106 continue
107 if not isinst(cnfpkg):
108- locked[cnfpkg] = True
109+ locked[cnfpkg] = (LOCKED_CONFLICT, pkg)
110 continue
111 if cnfpkg in locked:
112 raise Failed, _("Can't install %s: it's conflicted by "
113@@ -565,7 +586,7 @@ class Transaction(object):
114 for namepkg in namepkgs:
115 if namepkg is not pkg and not pkg.coexists(namepkg):
116 if not isinst(namepkg):
117- locked[namepkg] = True
118+ locked[namepkg] = (LOCKED_NO_COEXIST, pkg)
119 continue
120 if namepkg in locked:
121 raise Failed, _("Can't install %s: it can't coexist "
122@@ -577,6 +598,7 @@ class Transaction(object):
123
124 # Check if someone is already providing it.
125 prvpkgs = {}
126+ lockedpkgs = {}
127 found = False
128 for prv in req.providedby:
129 for prvpkg in prv.packages:
130@@ -585,6 +607,8 @@ class Transaction(object):
131 break
132 if prvpkg not in locked:
133 prvpkgs[prvpkg] = True
134+ else:
135+ lockedpkgs[prvpkg] = locked[prvpkg]
136 else:
137 continue
138 break
139@@ -597,7 +621,17 @@ class Transaction(object):
140 if not prvpkgs:
141 # No packages provide it at all. Give up.
142 if req in pkg.requires:
143- raise Failed, _("Can't install %s: no package provides %s") % \
144+ reasons = []
145+ for prv in req.providedby:
146+ for prvpkg in prv.packages:
147+ lockedres = lockedpkgs.get(prvpkg, None)
148+ if lockedres:
149+ reasons.append(lock_reason(prvpkg, lockedres))
150+ if reasons:
151+ raise Failed, _("Can't install %s: unable to install provider for %s:\n %s") % \
152+ (pkg, req, '\n '.join(reasons))
153+ else:
154+ raise Failed, _("Can't install %s: no package provides %s") % \
155 (pkg, req)
156 else:
157 # It's only a recommend, skip
158@@ -627,7 +661,7 @@ class Transaction(object):
159 if ownpending:
160 pending = []
161
162- locked[pkg] = True
163+ locked[pkg] = (LOCKED_REMOVE, None)
164 changeset.set(pkg, REMOVE)
165 isinst = changeset.installed
166
167@@ -1140,22 +1174,22 @@ class Transaction(object):
168 if op is KEEP:
169 if pkg in changeset:
170 del changeset[pkg]
171- locked[pkg] = True
172+ locked[pkg] = (LOCKED_KEEP, None)
173 elif op is INSTALL:
174 if not isinst(pkg) and pkg in locked:
175 raise Failed, _("Can't install %s: it's locked") % pkg
176 changeset.set(pkg, INSTALL)
177- locked[pkg] = True
178+ locked[pkg] = (LOCKED_INSTALL, None)
179 elif op is REMOVE:
180 if isinst(pkg) and pkg in locked:
181 raise Failed, _("Can't remove %s: it's locked") % pkg
182 changeset.set(pkg, REMOVE)
183- locked[pkg] = True
184+ locked[pkg] = (LOCKED_REMOVE, None)
185 elif op is REINSTALL:
186 if pkg in locked:
187 raise Failed, _("Can't reinstall %s: it's locked")%pkg
188 changeset.set(pkg, INSTALL, force=True)
189- locked[pkg] = True
190+ locked[pkg] = (LOCKED_INSTALL, None)
191 elif op is UPGRADE:
192 pass
193
194--
1951.8.1.2
196
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..3f27262156
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-dflags.patch
@@ -0,0 +1,40 @@
1backends/rpm: add support for setting dependency flags
2
3This is useful for OpenEmbedded so that we can do the equivalent of
4the --nolinktos and --noparentdirs rpm command line options.
5
6Upstream-Status: Pending
7
8Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
9
10diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py
11index 707a146..aec82e7 100644
12--- a/smart/backends/rpm/pm.py
13+++ b/smart/backends/rpm/pm.py
14@@ -106,6 +106,23 @@ class RPMPackageManager(PackageManager):
15 flags |= rpm.RPMTRANS_FLAG_TEST
16 ts.setFlags(flags)
17
18+ dflags = ts.setDFlags(0)
19+ if sysconf.get("rpm-noupgrade", False):
20+ dflags |= rpm.RPMDEPS_FLAG_NOUPGRADE
21+ if sysconf.get("rpm-norequires", False):
22+ dflags |= rpm.RPMDEPS_FLAG_NOREQUIRES
23+ if sysconf.get("rpm-noconflicts", False):
24+ dflags |= rpm.RPMDEPS_FLAG_NOCONFLICTS
25+ if sysconf.get("rpm-noobsoletes", False):
26+ dflags |= rpm.RPMDEPS_FLAG_NOOBSOLETES
27+ if sysconf.get("rpm-noparentdirs", False):
28+ dflags |= rpm.RPMDEPS_FLAG_NOPARENTDIRS
29+ if sysconf.get("rpm-nolinktos", False):
30+ dflags |= rpm.RPMDEPS_FLAG_NOLINKTOS
31+ if sysconf.get("rpm-nosuggest", False):
32+ dflags |= rpm.RPMDEPS_FLAG_NOSUGGEST
33+ ts.setDFlags(dflags)
34+
35 # Set rpm verbosity level.
36 levelname = sysconf.get('rpm-log-level')
37 level = {
38--
391.7.9.5
40
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 @@
1From a17998b6be3319ae476a64f366737bc267a53a8a Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Mon, 16 Sep 2013 05:54:13 -0400
4Subject: [PATCH] fetcher.py: truncate the filename to meet NAME_MAX
5
6The function getLocalPath() converts the filepath into the filename,
7there would be a "File name too long" error when len(filename) >
8NAME_MAX, truncate it to meet NAME_MAX will fix the problem.
9
10Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
11---
12 smart/fetcher.py | 8 ++++++++
13 1 file changed, 8 insertions(+)
14
15diff --git a/smart/fetcher.py b/smart/fetcher.py
16--- a/smart/fetcher.py
17+++ b/smart/fetcher.py
18@@ -139,6 +139,14 @@ class Fetcher(object):
19 filename = os.path.basename(path)
20 if self._localpathprefix:
21 filename = self._localpathprefix+filename
22+ # pathconf requires the path existed
23+ if not os.path.exists(self._localdir):
24+ os.makedirs(self._localdir)
25+ name_max = os.pathconf(self._localdir, 'PC_NAME_MAX')
26+ # The length of the filename should be less than NAME_MAX
27+ if len(filename) > name_max:
28+ iface.debug(_("Truncate %s to %s") % (filename, filename[-name_max:]))
29+ filename = filename[-name_max:]
30 return os.path.join(self._localdir, filename)
31
32 def setForceCopy(self, value):
33--
341.7.10.4
35
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 @@
1Add exclude-packages flag support
2
3Allow configuring specific packages to be excluded. This will allow
4users to specify things NOT to install, and if they are attempted an
5error will be generated.
6
7Upstream-Status: Pending
8
9Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
10
11Index: smart-1.4.1/smart/const.py
12===================================================================
13--- smart-1.4.1.orig/smart/const.py
14+++ smart-1.4.1/smart/const.py
15@@ -70,6 +70,7 @@ DATADIR = "/var/lib/smart/"
16 USERDATADIR = "~/.smart/"
17 CONFFILE = "config"
18
19+LOCKED_EXCLUDE = Enum('LOCKED_EXCLUDE')
20 LOCKED_INSTALL = Enum('LOCKED_INSTALL')
21 LOCKED_REMOVE = Enum('LOCKED_REMOVE')
22 LOCKED_CONFLICT = Enum('LOCKED_CONFLICT')
23Index: smart-1.4.1/smart/transaction.py
24===================================================================
25--- smart-1.4.1.orig/smart/transaction.py
26+++ smart-1.4.1/smart/transaction.py
27@@ -19,7 +19,7 @@
28 # along with Smart Package Manager; if not, write to the Free Software
29 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 #
31-from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP, LOCKED_INSTALL, LOCKED_CONFLICT, LOCKED_CONFLICT_BY, LOCKED_NO_COEXIST, LOCKED_SYSCONF, LOCKED_REMOVE
32+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
33 from smart.cache import PreRequires, Package
34 from smart import *
35
36@@ -29,7 +29,9 @@ def lock_reason(pkg, lockvalue):
37 except TypeError:
38 reason = None
39 lockvalue = None
40- if reason == LOCKED_INSTALL:
41+ if reason == LOCKED_EXCLUDE:
42+ return _("%s is to be excluded") % pkg
43+ elif reason == LOCKED_INSTALL:
44 return _("%s is to be installed") % pkg
45 elif reason == LOCKED_CONFLICT:
46 return _("%s conflicts with %s") % (pkg, otherpkg)
47@@ -210,6 +212,10 @@ class Policy(object):
48 self._sysconflocked.append(pkg)
49 self._locked[pkg] = (LOCKED_SYSCONF, None)
50
51+ for pkg in pkgconf.filterByFlag("exclude-packages", cache.getPackages()):
52+ if pkg not in self._locked:
53+ self._locked[pkg] = (LOCKED_EXCLUDE, None)
54+
55 def runFinished(self):
56 self._priorities.clear()
57 for pkg in self._sysconflocked:
58Index: smart-1.4.1/smart/commands/flag.py
59===================================================================
60--- smart-1.4.1.orig/smart/commands/flag.py
61+++ smart-1.4.1/smart/commands/flag.py
62@@ -47,6 +47,8 @@ Currently known flags are:
63 multi-version - Flagged packages may have more than one version
64 installed in the system at the same time
65 (backend dependent).
66+ exclude-packages - Flagged packages will be excluded, if they are
67+ required, an error will be generated.
68 ignore-recommends - Flagged packages will not be installed, if
69 they are only recommended by a package to be
70 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 @@
1Add ignore-recommends flag support
2
3Allow configuring recommends on specific packages to be ignored.
4
5Upstream-Status: Pending
6
7Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
8---
9 smart/commands/flag.py | 3 +++
10 smart/transaction.py | 7 ++++++-
11 2 files changed, 9 insertions(+), 1 deletion(-)
12
13diff --git a/smart/commands/flag.py b/smart/commands/flag.py
14index 8b90496..191bb11 100644
15--- a/smart/commands/flag.py
16+++ b/smart/commands/flag.py
17@@ -47,6 +47,9 @@ Currently known flags are:
18 multi-version - Flagged packages may have more than one version
19 installed in the system at the same time
20 (backend dependent).
21+ ignore-recommends - Flagged packages will not be installed, if
22+ they are only recommended by a package to be
23+ installed rather than required.
24
25 security - Flagged packages are updates for security errata.
26 bugfix - Flagged packages are updates for bugfix errata.
27diff --git a/smart/transaction.py b/smart/transaction.py
28index dd9aa38..38eabae 100644
29--- a/smart/transaction.py
30+++ b/smart/transaction.py
31@@ -596,12 +596,17 @@ class Transaction(object):
32 # Install packages required by this one.
33 for req in pkg.requires + pkg.recommends:
34
35+ reqrequired = req in pkg.requires
36+
37 # Check if someone is already providing it.
38 prvpkgs = {}
39 lockedpkgs = {}
40 found = False
41 for prv in req.providedby:
42 for prvpkg in prv.packages:
43+ if not reqrequired:
44+ if pkgconf.testFlag("ignore-recommends", prvpkg):
45+ continue
46 if isinst(prvpkg):
47 found = True
48 break
49@@ -620,7 +625,7 @@ class Transaction(object):
50
51 if not prvpkgs:
52 # No packages provide it at all. Give up.
53- if req in pkg.requires:
54+ if reqrequired:
55 reasons = []
56 for prv in req.providedby:
57 for prvpkg in prv.packages:
58--
591.8.1.2
60
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..fece5b9009
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
@@ -0,0 +1,253 @@
1Improve error reporting in smart
2
3Add code to check proper command line arguments for various
4smart commands. Exit with error if erroneous/additional arguments
5are given in the command line.
6
7Upstream-Status: Pending
8
9Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
10
11diff --git a/smart/commands/channel.py b/smart/commands/channel.py
12index aa76f91..63fbb35 100644
13--- a/smart/commands/channel.py
14+++ b/smart/commands/channel.py
15@@ -157,7 +157,17 @@ def main(ctrl, opts):
16 opts.show is None and opts.yaml is None):
17 iface.warning(_("Can't edit channels information."))
18 raise Error, _("Configuration is in readonly mode.")
19-
20+
21+ # Argument check
22+ opts.check_args_of_option("set", -1)
23+ opts.check_args_of_option("remove", -1)
24+ opts.check_args_of_option("edit", 0)
25+ opts.check_args_of_option("enable", -1)
26+ opts.check_args_of_option("disable", -1)
27+ opts.ensure_action("channel", ["add", "set", "remove", "remove-all",
28+ "list", "show", "yaml", "enable", "disable"])
29+ opts.check_remaining_args()
30+
31 if opts.add is not None:
32 if not opts.add and opts.args == ["-"]:
33 newchannels = []
34diff --git a/smart/commands/check.py b/smart/commands/check.py
35index b08608a..506e852 100644
36--- a/smart/commands/check.py
37+++ b/smart/commands/check.py
38@@ -72,6 +72,9 @@ def parse_options(argv):
39
40 def main(ctrl, opts, reloadchannels=True):
41
42+ # Argument check
43+ opts.check_args_of_option("channels", 1)
44+
45 if sysconf.get("auto-update"):
46 from smart.commands import update
47 updateopts = update.parse_options([])
48diff --git a/smart/commands/config.py b/smart/commands/config.py
49index dd50dee..4fe4366 100644
50--- a/smart/commands/config.py
51+++ b/smart/commands/config.py
52@@ -80,6 +80,12 @@ def main(ctrl, opts):
53 globals["false"] = False
54 globals["no"] = False
55
56+ # Check arguments
57+ opts.check_args_of_option("set", -1)
58+ opts.check_args_of_option("remove", -1)
59+ opts.ensure_action("config", ["set", "show", "yaml", "remove"])
60+ opts.check_remaining_args()
61+
62 if opts.set:
63 for opt in opts.set:
64 m = SETRE.match(opt)
65diff --git a/smart/commands/download.py b/smart/commands/download.py
66index 6837993..b853c61 100644
67--- a/smart/commands/download.py
68+++ b/smart/commands/download.py
69@@ -81,6 +81,14 @@ def parse_options(argv):
70
71 def main(ctrl, opts):
72
73+ # Argument check
74+ opts.check_args_of_option("target", 1)
75+ opts.check_args_of_option("output", 1)
76+ opts.check_args_of_option("from_urls", -1)
77+ opts.check_args_of_option("from_metalink", -1)
78+ if not opts.args and not opts.from_metalink and not opts.from_urls:
79+ raise Error, _("no package(s) given")
80+
81 packages = []
82 if opts.args:
83 if sysconf.get("auto-update"):
84diff --git a/smart/commands/info.py b/smart/commands/info.py
85index 12f74f0..59fbe98 100644
86--- a/smart/commands/info.py
87+++ b/smart/commands/info.py
88@@ -58,6 +58,10 @@ def parse_options(argv):
89
90 def main(ctrl, opts, reloadchannels=True):
91
92+ # Argument check
93+ if not opts.args:
94+ raise Error, _("No package(s) given")
95+
96 if sysconf.get("auto-update"):
97 from smart.commands import update
98 updateopts = update.parse_options([])
99diff --git a/smart/commands/install.py b/smart/commands/install.py
100index 8a45954..590222c 100644
101--- a/smart/commands/install.py
102+++ b/smart/commands/install.py
103@@ -76,6 +76,10 @@ def parse_options(argv):
104
105 def main(ctrl, opts):
106
107+ # Argument check
108+ if not opts.args:
109+ raise Error, _("no package(s) given")
110+
111 if opts.explain:
112 sysconf.set("explain-changesets", True, soft=True)
113
114diff --git a/smart/commands/reinstall.py b/smart/commands/reinstall.py
115index e59d896..32da3e6 100644
116--- a/smart/commands/reinstall.py
117+++ b/smart/commands/reinstall.py
118@@ -68,7 +68,11 @@ def parse_options(argv):
119 return opts
120
121 def main(ctrl, opts):
122-
123+
124+ # Argument check
125+ if not opts.args:
126+ raise Error, _("no package(s) given")
127+
128 if opts.explain:
129 sysconf.set("explain-changesets", True, soft=True)
130
131diff --git a/smart/commands/remove.py b/smart/commands/remove.py
132index b4823a6..acd3bbd 100644
133--- a/smart/commands/remove.py
134+++ b/smart/commands/remove.py
135@@ -74,6 +74,10 @@ def parse_options(argv):
136
137 def main(ctrl, opts):
138
139+ # Argument check
140+ if not opts.args:
141+ raise Error, _("no package(s) given")
142+
143 if opts.explain:
144 sysconf.set("explain-changesets", True, soft=True)
145
146diff --git a/smart/commands/search.py b/smart/commands/search.py
147index 0d0b573..44806b8 100644
148--- a/smart/commands/search.py
149+++ b/smart/commands/search.py
150@@ -44,6 +44,8 @@ def option_parser():
151 def parse_options(argv):
152 opts = query.parse_options(argv, usage=USAGE, \
153 description=DESCRIPTION, examples=EXAMPLES)
154+ if not argv:
155+ raise Error, _("Search expression not specified")
156 opts.name = opts.args
157 opts.summary = opts.args
158 opts.description = opts.args
159diff --git a/smart/commands/upgrade.py b/smart/commands/upgrade.py
160index ec86290..7e290d8 100644
161--- a/smart/commands/upgrade.py
162+++ b/smart/commands/upgrade.py
163@@ -91,6 +91,9 @@ def parse_options(argv):
164
165 def main(ctrl, opts):
166
167+ # Argument check
168+ opts.check_args_of_option("flag", 1)
169+
170 if opts.explain:
171 sysconf.set("explain-changesets", True, soft=True)
172
173diff --git a/smart/util/optparse.py b/smart/util/optparse.py
174index 4a3d3a8..279b0bf 100644
175--- a/smart/util/optparse.py
176+++ b/smart/util/optparse.py
177@@ -70,6 +70,8 @@ import sys, os
178 import types
179 import textwrap
180 from gettext import gettext as _
181+from smart import Error
182+import re
183
184 def _repr(self):
185 return "<%s at 0x%x: %s>" % (self.__class__.__name__, id(self), self)
186@@ -708,6 +710,12 @@ class Option:
187 self.action, self.dest, opt, value, values, parser)
188
189 def take_action(self, action, dest, opt, value, values, parser):
190+ # Keep all the options in the command line in the '_given_opts' array
191+ # This will be used later to validate the command line
192+ given_opts = getattr(parser.values, "_given_opts", [])
193+ user_opt = re.sub(r"^\-*", "", opt).replace("-", "_")
194+ given_opts.append(user_opt)
195+ setattr(parser.values, "_given_opts", given_opts)
196 if action == "store":
197 setattr(values, dest, value)
198 elif action == "store_const":
199@@ -819,6 +827,54 @@ class Values:
200 setattr(self, attr, value)
201 return getattr(self, attr)
202
203+ # Check if the given option has the specified number of arguments
204+ # Raise an error if the option has an invalid number of arguments
205+ # A negative number for 'nargs' means "at least |nargs| arguments are needed"
206+ def check_args_of_option(self, opt, nargs, err=None):
207+ given_opts = getattr(self, "_given_opts", [])
208+ if not opt in given_opts:
209+ return
210+ values = getattr(self, opt, [])
211+ if type(values) != type([]):
212+ return
213+ if nargs < 0:
214+ nargs = -nargs
215+ if len(values) >= nargs:
216+ return
217+ if not err:
218+ if nargs == 1:
219+ err = _("Option '%s' requires at least one argument") % opt
220+ else:
221+ err = _("Option '%s' requires at least %d arguments") % (opt, nargs)
222+ raise Error, err
223+ elif nargs == 0:
224+ if len( values ) == 0:
225+ return
226+ raise Error, err
227+ else:
228+ if len(values) == nargs:
229+ return
230+ if not err:
231+ if nargs == 1:
232+ err = _("Option '%s' requires one argument") % opt
233+ else:
234+ err = _("Option '%s' requires %d arguments") % (opt, nargs)
235+ raise Error, err
236+
237+ # Check that at least one of the options in 'actlist' was given as an argument
238+ # to the command 'cmdname'
239+ def ensure_action(self, cmdname, actlist):
240+ given_opts = getattr(self, "_given_opts", [])
241+ for action in actlist:
242+ if action in given_opts:
243+ return
244+ raise Error, _("No action specified for command '%s'") % cmdname
245+
246+ # Check if there are any other arguments left after parsing the command line and
247+ # raise an error if such arguments are found
248+ def check_remaining_args(self):
249+ if self.args:
250+ raise Error, _("Invalid argument(s) '%s'" % str(self.args))
251
252 class OptionContainer:
253
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 @@
1smart - backends/rmp/metadata.py: Fix incorrect call to the match function
2
3The match function should take three parameters, name, comparison, version...
4The original code was passing it a reference to the object holding the data
5instead, which caused the comparison in match to always fail.
6
7Upstream-Status: Pending
8
9Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
10
11--- a/smart/backends/rpm/metadata.py
12+++ b/smart/backends/rpm/metadata.py
13@@ -332,13 +332,13 @@
14 reqargs = [x for x in reqdict
15 if not ((x[2] is None or "=" in x[2]) and
16 (RPMProvides, x[1], x[3]) in prvdict or
17- system_provides.match(*x[:3]))]
18+ system_provides.match(x[1], x[2], x[3]))]
19 reqargs = collapse_libc_requires(reqargs)
20
21 recargs = [x for x in recdict
22 if not ((x[2] is None or "=" in x[2]) and
23 (RPMProvides, x[1], x[3]) in prvdict or
24- system_provides.match(*x[:3]))]
25+ system_provides.match(x[1], x[2], x[3]))]
26
27 prvargs = prvdict.keys()
28 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 @@
1To fix some multilib issues, change the way the RPM backend decides
2if two packages can coexist: if they have a different architecture,
3automatically assume that they can coexist (which is fundamental for
4multilib).
5
6Upstream-Status: Pending
7
8Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
9
10diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
11index 6e83d40..7140c1b 100644
12--- a/smart/backends/rpm/base.py
13+++ b/smart/backends/rpm/base.py
14@@ -228,6 +228,8 @@ class RPMPackage(Package):
15 return False
16 selfver, selfarch = splitarch(self.version)
17 otherver, otherarch = splitarch(other.version)
18+ if selfarch != otherarch:
19+ return True
20 selfcolor = getArchColor(selfarch)
21 othercolor = getArchColor(otherarch)
22 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 @@
1Handle recommended packages in core and rpm backends
2
3Identify and store recommended packages in the cache, add a query option
4to read them and ignore them if they are not present when installing.
5
6Initial identification code from Mark Hatle <mark.hatle@windriver.com>.
7
8Upstream-Status: Pending
9
10Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
11
12diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
13index 0489e11..b9e9cb2 100644
14--- a/smart/backends/rpm/base.py
15+++ b/smart/backends/rpm/base.py
16@@ -198,6 +198,29 @@ class RPMPackage(Package):
17 break
18 else:
19 return False
20+ srecs = fk(self.recommends)
21+ orecs = fk(other.recommends)
22+ if srecs != orecs:
23+ for srec in srecs:
24+ if srec.name[0] == "/" or srec in orecs:
25+ continue
26+ for orec in orecs:
27+ if (srec.name == orec.name and
28+ srec.relation == orec.relation and
29+ checkver(srec.version, orec.version)):
30+ break
31+ else:
32+ return False
33+ for orec in orecs:
34+ if orec.name[0] == "/" or orec in srecs:
35+ continue
36+ for srec in srecs:
37+ if (srec.name == orec.name and
38+ srec.relation == orec.relation and
39+ checkver(srec.version, orec.version)):
40+ break
41+ else:
42+ return False
43 return True
44
45 def coexists(self, other):
46diff --git a/smart/backends/rpm/header.py b/smart/backends/rpm/header.py
47index 31786cc..4880f43 100644
48--- a/smart/backends/rpm/header.py
49+++ b/smart/backends/rpm/header.py
50@@ -292,6 +292,7 @@ class RPMHeaderLoader(Loader):
51 f = [0]
52 elif type(f) != list:
53 f = [f]
54+ recdict = {}
55 reqdict = {}
56 for i in range(len(n)):
57 ni = n[i]
58@@ -308,10 +309,16 @@ class RPMHeaderLoader(Loader):
59 # RPMSENSE_SCRIPT_PREUN |
60 # RPMSENSE_SCRIPT_POST |
61 # RPMSENSE_SCRIPT_POSTUN == 7744
62- reqdict[(f[i]&7744 and PreReq or Req,
63- intern(ni), r, vi)] = True
64+ if (f[i]&rpm.RPMSENSE_MISSINGOK):
65+ recdict[(f[i]&7744 and PreReq or Req,
66+ intern(ni), r, vi)] = True
67+ else:
68+ reqdict[(f[i]&7744 and PreReq or Req,
69+ intern(ni), r, vi)] = True
70+ recargs = collapse_libc_requires(recdict.keys())
71 reqargs = collapse_libc_requires(reqdict.keys())
72 else:
73+ recargs = None
74 reqargs = None
75
76 n = h[1054] # RPMTAG_CONFLICTNAME
77@@ -365,7 +372,7 @@ class RPMHeaderLoader(Loader):
78 versionarch = "%s@%s" % (distversion, arch)
79
80 pkg = self.buildPackage((Pkg, name, versionarch),
81- prvargs, reqargs, upgargs, cnfargs)
82+ prvargs, reqargs, upgargs, cnfargs, recargs)
83 pkg.loaders[self] = offset
84 self._offsets[offset] = pkg
85 self._groups[pkg] = intern(h[rpm.RPMTAG_GROUP])
86@@ -583,8 +590,8 @@ class URPMILoader(RPMHeaderListLoader):
87 def setErrataFlags(self, flagdict):
88 self._flagdict = flagdict
89
90- def buildPackage(self, pkgargs, prvargs, reqargs, upgargs, cnfargs):
91- pkg = Loader.buildPackage(self, pkgargs, prvargs, reqargs, upgargs, cnfargs)
92+ def buildPackage(self, pkgargs, prvargs, reqargs, upgargs, cnfargs, recargs):
93+ pkg = Loader.buildPackage(self, pkgargs, prvargs, reqargs, upgargs, cnfargs, recargs)
94 name = pkgargs[1]
95 if hasattr(self, '_flagdict') and self._flagdict and name in self._flagdict:
96 if sysconf.getReadOnly():
97diff --git a/smart/backends/rpm/metadata.py b/smart/backends/rpm/metadata.py
98index 2c54f39..568fe06 100644
99--- a/smart/backends/rpm/metadata.py
100+++ b/smart/backends/rpm/metadata.py
101@@ -165,6 +165,7 @@ class RPMMetaDataLoader(Loader):
102 distepoch = None
103 info = {}
104 reqdict = {}
105+ recdict = {}
106 prvdict = {}
107 upgdict = {}
108 cnfdict = {}
109@@ -287,12 +288,16 @@ class RPMMetaDataLoader(Loader):
110
111 lasttag = queue[-1].tag
112 if lasttag == REQUIRES:
113- if elem.get("pre") == "1":
114- reqdict[(RPMPreRequires,
115- ename, erelation, eversion)] = True
116+ if elem.get("missingok") == "1":
117+ recdict[(RPMRequires,
118+ ename, erelation, eversion)] = True
119 else:
120- reqdict[(RPMRequires,
121- ename, erelation, eversion)] = True
122+ if elem.get("pre") == "1":
123+ reqdict[(RPMPreRequires,
124+ ename, erelation, eversion)] = True
125+ else:
126+ reqdict[(RPMRequires,
127+ ename, erelation, eversion)] = True
128
129 elif lasttag == PROVIDES:
130 if ename[0] == "/":
131@@ -328,6 +333,12 @@ class RPMMetaDataLoader(Loader):
132 (RPMProvides, x[1], x[3]) in prvdict or
133 system_provides.match(*x[:3]))]
134 reqargs = collapse_libc_requires(reqargs)
135+
136+ recargs = [x for x in recdict
137+ if not ((x[2] is None or "=" in x[2]) and
138+ (RPMProvides, x[1], x[3]) in prvdict or
139+ system_provides.match(*x[:3]))]
140+
141 prvargs = prvdict.keys()
142 cnfargs = cnfdict.keys()
143 upgargs = upgdict.keys()
144@@ -339,7 +350,7 @@ class RPMMetaDataLoader(Loader):
145 versionarch = "%s@%s" % (distversion, arch)
146
147 pkg = self.buildPackage((RPMPackage, name, versionarch),
148- prvargs, reqargs, upgargs, cnfargs)
149+ prvargs, reqargs, upgargs, cnfargs, recargs)
150 pkg.loaders[self] = info
151
152 # Store the provided files for future usage.
153@@ -362,6 +373,7 @@ class RPMMetaDataLoader(Loader):
154 distepoch = None
155 pkgid = None
156 reqdict.clear()
157+ recdict.clear()
158 prvdict.clear()
159 upgdict.clear()
160 cnfdict.clear()
161diff --git a/smart/cache.py b/smart/cache.py
162index b829825..cec8bb3 100644
163--- a/smart/cache.py
164+++ b/smart/cache.py
165@@ -32,7 +32,8 @@ class Package(object):
166 self.name = name
167 self.version = version
168 self.provides = ()
169- self.requires = ()
170+ self.requires = []
171+ self.recommends = []
172 self.upgrades = ()
173 self.conflicts = ()
174 self.installed = False
175@@ -55,7 +56,9 @@ class Package(object):
176 fk([x for x in self.provides if x.name[0] != "/"]) !=
177 fk([x for x in other.provides if x.name[0] != "/"]) or
178 fk([x for x in self.requires if x.name[0] != "/"]) !=
179- fk([x for x in other.requires if x.name[0] != "/"])):
180+ fk([x for x in other.requires if x.name[0] != "/"]) or
181+ fk([x for x in self.recommends if x.name[0] != "/"]) !=
182+ fk([x for x in other.recommends if x.name[0] != "/"])):
183 return False
184 return True
185
186@@ -110,6 +113,7 @@ class Package(object):
187 self.version,
188 self.provides,
189 self.requires,
190+ self.recommends,
191 self.upgrades,
192 self.conflicts,
193 self.installed,
194@@ -122,6 +126,7 @@ class Package(object):
195 self.version,
196 self.provides,
197 self.requires,
198+ self.recommends,
199 self.upgrades,
200 self.conflicts,
201 self.installed,
202@@ -274,6 +279,7 @@ class Provides(object):
203 self.version = version
204 self.packages = []
205 self.requiredby = ()
206+ self.recommendedby = ()
207 self.upgradedby = ()
208 self.conflictedby = ()
209
210@@ -401,7 +407,7 @@ class Loader(object):
211 def loadFileProvides(self, fndict):
212 pass
213
214- def buildPackage(self, pkgargs, prvargs, reqargs, upgargs, cnfargs):
215+ def buildPackage(self, pkgargs, prvargs, reqargs, upgargs, cnfargs, recargs = None):
216 cache = self._cache
217 pkg = pkgargs[0](*pkgargs[1:])
218 relpkgs = []
219@@ -427,6 +433,17 @@ class Loader(object):
220 relpkgs.append(req.packages)
221 pkg.requires.append(req)
222
223+ if recargs:
224+ pkg.recommends = []
225+ for args in recargs:
226+ rec = cache._objmap.get(args)
227+ if not rec:
228+ rec = args[0](*args[1:])
229+ cache._objmap[args] = rec
230+ cache._recommends.append(rec)
231+ relpkgs.append(rec.packages)
232+ pkg.recommends.append(rec)
233+
234 if upgargs:
235 pkg.upgrades = []
236 for args in upgargs:
237@@ -572,6 +589,7 @@ class Cache(object):
238 self._packages = []
239 self._provides = []
240 self._requires = []
241+ self._recommends = []
242 self._upgrades = []
243 self._conflicts = []
244 self._objmap = {}
245@@ -581,6 +599,8 @@ class Cache(object):
246 del prv.packages[:]
247 if prv.requiredby:
248 del prv.requiredby[:]
249+ if prv.recommendedby:
250+ del prv.recommendedby[:]
251 if prv.upgradedby:
252 del prv.upgradedby[:]
253 if prv.conflictedby:
254@@ -589,6 +609,10 @@ class Cache(object):
255 del req.packages[:]
256 if req.providedby:
257 del req.providedby[:]
258+ for rec in self._recommends:
259+ del rec.packages[:]
260+ if rec.providedby:
261+ del rec.providedby[:]
262 for upg in self._upgrades:
263 del upg.packages[:]
264 if upg.providedby:
265@@ -600,6 +624,7 @@ class Cache(object):
266 del self._packages[:]
267 del self._provides[:]
268 del self._requires[:]
269+ del self._recommends[:]
270 del self._upgrades[:]
271 del self._conflicts[:]
272 self._objmap.clear()
273@@ -621,6 +646,7 @@ class Cache(object):
274 packages = {}
275 provides = {}
276 requires = {}
277+ recommends = {}
278 upgrades = {}
279 conflicts = {}
280 objmap = self._objmap
281@@ -646,6 +672,11 @@ class Cache(object):
282 if req not in requires:
283 objmap[req.getInitArgs()] = req
284 requires[req] = True
285+ for rec in pkg.recommends[:]:
286+ rec.packages.append(pkg)
287+ if rec not in recommends:
288+ objmap[rec.getInitArgs()] = rec
289+ recommends[rec] = True
290 for upg in pkg.upgrades:
291 upg.packages.append(pkg)
292 if upg not in upgrades:
293@@ -659,6 +690,7 @@ class Cache(object):
294 self._packages[:] = packages.keys()
295 self._provides[:] = provides.keys()
296 self._requires[:] = requires.keys()
297+ self._recommends[:] = recommends.keys()
298 self._upgrades[:] = upgrades.keys()
299 self._conflicts[:] = conflicts.keys()
300
301@@ -710,6 +742,14 @@ class Cache(object):
302 lst.append(req)
303 else:
304 reqnames[name] = [req]
305+ recnames = {}
306+ for rec in self._recommends:
307+ for name in rec.getMatchNames():
308+ lst = recnames.get(name)
309+ if lst:
310+ lst.append(rec)
311+ else:
312+ recnames[name] = [rec]
313 upgnames = {}
314 for upg in self._upgrades:
315 for name in upg.getMatchNames():
316@@ -739,6 +779,18 @@ class Cache(object):
317 prv.requiredby.append(req)
318 else:
319 prv.requiredby = [req]
320+ lst = recnames.get(prv.name)
321+ if lst:
322+ for rec in lst:
323+ if rec.matches(prv):
324+ if rec.providedby:
325+ rec.providedby.append(prv)
326+ else:
327+ rec.providedby = [prv]
328+ if prv.recommendedby:
329+ prv.recommendedby.append(rec)
330+ else:
331+ prv.recommendedby = [rec]
332 lst = upgnames.get(prv.name)
333 if lst:
334 for upg in lst:
335@@ -782,6 +834,12 @@ class Cache(object):
336 else:
337 return [x for x in self._requires if x.name == name]
338
339+ def getRecommends(self, name=None):
340+ if not name:
341+ return self._recommends
342+ else:
343+ return [x for x in self._recommends if x.name == name]
344+
345 def getUpgrades(self, name=None):
346 if not name:
347 return self._upgrades
348@@ -807,6 +865,12 @@ class Cache(object):
349 for req in self._requires:
350 if prvname in req.getMatchNames() and req.matches(prv):
351 searcher.addResult(req)
352+ if searcher.recommends:
353+ for prv in searcher.recommends:
354+ prvname = prv.name
355+ for req in self._recommends:
356+ if prvname in req.getMatchNames() and req.matches(prv):
357+ searcher.addResult(req)
358 if searcher.upgrades:
359 for prv in searcher.upgrades:
360 prvname = prv.name
361@@ -839,6 +903,7 @@ class Cache(object):
362 self._packages = state["_packages"]
363 provides = {}
364 requires = {}
365+ recommends = {}
366 upgrades = {}
367 conflicts = {}
368 for pkg in self._packages:
369@@ -848,6 +913,9 @@ class Cache(object):
370 for req in pkg.requires:
371 req.packages.append(pkg)
372 requires[req] = True
373+ for rec in pkg.recommends:
374+ rec.packages.append(pkg)
375+ recommends[rec] = True
376 for upg in pkg.upgrades:
377 upg.packages.append(pkg)
378 upgrades[upg] = True
379@@ -856,6 +924,7 @@ class Cache(object):
380 conflicts[cnf] = True
381 self._provides = provides.keys()
382 self._requires = requires.keys()
383+ self._recommends = recommends.keys()
384 self._upgrades = upgrades.keys()
385 self._conflicts = conflicts.keys()
386 self._objmap = {}
387diff --git a/smart/ccache.c b/smart/ccache.c
388index 7541e26..7193185 100644
389--- a/smart/ccache.c
390+++ b/smart/ccache.c
391@@ -82,6 +82,7 @@ typedef struct {
392 PyObject *version;
393 PyObject *provides;
394 PyObject *requires;
395+ PyObject *recommends;
396 PyObject *upgrades;
397 PyObject *conflicts;
398 PyObject *installed;
399@@ -96,6 +97,7 @@ typedef struct {
400 PyObject *version;
401 PyObject *packages;
402 PyObject *requiredby;
403+ PyObject *recommendedby;
404 PyObject *upgradedby;
405 PyObject *conflictedby;
406 } ProvidesObject;
407@@ -123,6 +125,7 @@ typedef struct {
408 PyObject *_packages;
409 PyObject *_provides;
410 PyObject *_requires;
411+ PyObject *_recommends;
412 PyObject *_upgrades;
413 PyObject *_conflicts;
414 PyObject *_objmap;
415@@ -211,7 +214,8 @@ Package_init(PackageObject *self, PyObject *args)
416 Py_INCREF(self->name);
417 Py_INCREF(self->version);
418 self->provides = PyTuple_New(0);
419- self->requires = PyTuple_New(0);
420+ self->requires = PyList_New(0);
421+ self->recommends = PyList_New(0);
422 self->upgrades = PyTuple_New(0);
423 self->conflicts = PyTuple_New(0);
424 Py_INCREF(Py_False);
425@@ -228,6 +232,7 @@ Package_traverse(PackageObject *self, visitproc visit, void *arg)
426 {
427 Py_VISIT(self->provides);
428 Py_VISIT(self->requires);
429+ Py_VISIT(self->recommends);
430 Py_VISIT(self->upgrades);
431 Py_VISIT(self->conflicts);
432 Py_VISIT(self->loaders);
433@@ -239,6 +244,7 @@ Package_clear(PackageObject *self)
434 {
435 Py_CLEAR(self->provides);
436 Py_CLEAR(self->requires);
437+ Py_CLEAR(self->recommends);
438 Py_CLEAR(self->upgrades);
439 Py_CLEAR(self->conflicts);
440 Py_CLEAR(self->loaders);
441@@ -252,6 +258,7 @@ Package_dealloc(PackageObject *self)
442 Py_XDECREF(self->version);
443 Py_XDECREF(self->provides);
444 Py_XDECREF(self->requires);
445+ Py_XDECREF(self->recommends);
446 Py_XDECREF(self->upgrades);
447 Py_XDECREF(self->conflicts);
448 Py_XDECREF(self->installed);
449@@ -453,6 +460,46 @@ Package_equals(PackageObject *self, PackageObject *other)
450 }
451 }
452
453+ ilen = 0;
454+ jlen = 0;
455+ for (i = 0; i != PyList_GET_SIZE(self->recommends); i++) {
456+ PyObject *item = PyList_GET_ITEM(self->recommends, i);
457+ if (!PyObject_IsInstance(item, (PyObject *)&Depends_Type)) {
458+ PyErr_SetString(PyExc_TypeError, "Depends instance expected");
459+ return NULL;
460+ }
461+ if (STR(((DependsObject *)item)->name)[0] != '/')
462+ ilen += 1;
463+ }
464+ for (j = 0; j != PyList_GET_SIZE(other->recommends); j++) {
465+ PyObject *item = PyList_GET_ITEM(other->recommends, j);
466+ if (!PyObject_IsInstance(item, (PyObject *)&Depends_Type)) {
467+ PyErr_SetString(PyExc_TypeError, "Depends instance expected");
468+ return NULL;
469+ }
470+ if (STR(((DependsObject *)item)->name)[0] != '/')
471+ jlen += 1;
472+ }
473+ if (ilen != jlen) {
474+ ret = Py_False;
475+ goto exit;
476+ }
477+
478+ ilen = PyList_GET_SIZE(self->recommends);
479+ jlen = PyList_GET_SIZE(other->recommends);
480+ for (i = 0; i != ilen; i++) {
481+ PyObject *item = PyList_GET_ITEM(self->recommends, i);
482+ if (STR(((DependsObject *)item)->name)[0] != '/') {
483+ for (j = 0; j != jlen; j++)
484+ if (item == PyList_GET_ITEM(other->recommends, j))
485+ break;
486+ if (j == jlen) {
487+ ret = Py_False;
488+ goto exit;
489+ }
490+ }
491+ }
492+
493 exit:
494 Py_INCREF(ret);
495 return ret;
496@@ -606,13 +653,14 @@ Package_getPriority(PackageObject *self, PyObject *args)
497 static PyObject *
498 Package__getstate__(PackageObject *self, PyObject *args)
499 {
500- PyObject *state = PyTuple_New(10);
501+ PyObject *state = PyTuple_New(11);
502 if (!state) return NULL;
503
504 Py_INCREF(self->name);
505 Py_INCREF(self->version);
506 Py_INCREF(self->provides);
507 Py_INCREF(self->requires);
508+ Py_INCREF(self->recommends);
509 Py_INCREF(self->upgrades);
510 Py_INCREF(self->conflicts);
511 Py_INCREF(self->installed);
512@@ -620,16 +668,17 @@ Package__getstate__(PackageObject *self, PyObject *args)
513 Py_INCREF(self->priority);
514 Py_INCREF(self->loaders);
515
516- PyTuple_SET_ITEM(state, 0, self->name);
517- PyTuple_SET_ITEM(state, 1, self->version);
518- PyTuple_SET_ITEM(state, 2, self->provides);
519- PyTuple_SET_ITEM(state, 3, self->requires);
520- PyTuple_SET_ITEM(state, 4, self->upgrades);
521- PyTuple_SET_ITEM(state, 5, self->conflicts);
522- PyTuple_SET_ITEM(state, 6, self->installed);
523- PyTuple_SET_ITEM(state, 7, self->essential);
524- PyTuple_SET_ITEM(state, 8, self->priority);
525- PyTuple_SET_ITEM(state, 9, self->loaders);
526+ PyTuple_SET_ITEM(state, 0, self->name);
527+ PyTuple_SET_ITEM(state, 1, self->version);
528+ PyTuple_SET_ITEM(state, 2, self->provides);
529+ PyTuple_SET_ITEM(state, 3, self->requires);
530+ PyTuple_SET_ITEM(state, 4, self->recommends);
531+ PyTuple_SET_ITEM(state, 5, self->upgrades);
532+ PyTuple_SET_ITEM(state, 6, self->conflicts);
533+ PyTuple_SET_ITEM(state, 7, self->installed);
534+ PyTuple_SET_ITEM(state, 8, self->essential);
535+ PyTuple_SET_ITEM(state, 9, self->priority);
536+ PyTuple_SET_ITEM(state, 10, self->loaders);
537
538 return state;
539 }
540@@ -637,7 +686,7 @@ Package__getstate__(PackageObject *self, PyObject *args)
541 static PyObject *
542 Package__setstate__(PackageObject *self, PyObject *state)
543 {
544- if (!PyTuple_Check(state) || PyTuple_GET_SIZE(state) != 10) {
545+ if (!PyTuple_Check(state) || PyTuple_GET_SIZE(state) != 11) {
546 PyErr_SetString(StateVersionError, "");
547 return NULL;
548 }
549@@ -645,18 +694,20 @@ Package__setstate__(PackageObject *self, PyObject *state)
550 self->version = PyTuple_GET_ITEM(state, 1);
551 self->provides = PyTuple_GET_ITEM(state, 2);
552 self->requires = PyTuple_GET_ITEM(state, 3);
553- self->upgrades = PyTuple_GET_ITEM(state, 4);
554- self->conflicts = PyTuple_GET_ITEM(state, 5);
555- self->installed = PyTuple_GET_ITEM(state, 6);
556- self->essential = PyTuple_GET_ITEM(state, 7);
557- self->priority = PyTuple_GET_ITEM(state, 8);
558- self->loaders = PyTuple_GET_ITEM(state, 9);
559+ self->recommends = PyTuple_GET_ITEM(state, 4);
560+ self->upgrades = PyTuple_GET_ITEM(state, 5);
561+ self->conflicts = PyTuple_GET_ITEM(state, 6);
562+ self->installed = PyTuple_GET_ITEM(state, 7);
563+ self->essential = PyTuple_GET_ITEM(state, 8);
564+ self->priority = PyTuple_GET_ITEM(state, 9);
565+ self->loaders = PyTuple_GET_ITEM(state, 10);
566
567
568 Py_INCREF(self->name);
569 Py_INCREF(self->version);
570 Py_INCREF(self->provides);
571 Py_INCREF(self->requires);
572+ Py_INCREF(self->recommends);
573 Py_INCREF(self->upgrades);
574 Py_INCREF(self->conflicts);
575 Py_INCREF(self->installed);
576@@ -686,6 +737,7 @@ static PyMemberDef Package_members[] = {
577 {"version", T_OBJECT, OFF(version), 0, 0},
578 {"provides", T_OBJECT, OFF(provides), 0, 0},
579 {"requires", T_OBJECT, OFF(requires), 0, 0},
580+ {"recommends", T_OBJECT, OFF(recommends), 0, 0},
581 {"upgrades", T_OBJECT, OFF(upgrades), 0, 0},
582 {"conflicts", T_OBJECT, OFF(conflicts), 0, 0},
583 {"installed", T_OBJECT, OFF(installed), 0, 0},
584@@ -750,6 +802,7 @@ Provides_init(ProvidesObject *self, PyObject *args)
585 Py_INCREF(self->version);
586 self->packages = PyList_New(0);
587 self->requiredby = PyTuple_New(0);
588+ self->recommendedby = PyTuple_New(0);
589 self->upgradedby = PyTuple_New(0);
590 self->conflictedby = PyTuple_New(0);
591 return 0;
592@@ -760,6 +813,7 @@ Provides_traverse(ProvidesObject *self, visitproc visit, void *arg)
593 {
594 Py_VISIT(self->packages);
595 Py_VISIT(self->requiredby);
596+ Py_VISIT(self->recommendedby);
597 Py_VISIT(self->upgradedby);
598 Py_VISIT(self->conflictedby);
599 return 0;
600@@ -770,6 +824,7 @@ Provides_clear(ProvidesObject *self)
601 {
602 Py_CLEAR(self->packages);
603 Py_CLEAR(self->requiredby);
604+ Py_CLEAR(self->recommendedby);
605 Py_CLEAR(self->upgradedby);
606 Py_CLEAR(self->conflictedby);
607 return 0;
608@@ -782,6 +837,7 @@ Provides_dealloc(ProvidesObject *self)
609 Py_XDECREF(self->version);
610 Py_XDECREF(self->packages);
611 Py_XDECREF(self->requiredby);
612+ Py_XDECREF(self->recommendedby);
613 Py_XDECREF(self->upgradedby);
614 Py_XDECREF(self->conflictedby);
615 self->ob_type->tp_free((PyObject *)self);
616@@ -960,6 +1016,7 @@ static PyMemberDef Provides_members[] = {
617 {"version", T_OBJECT, OFF(version), 0, 0},
618 {"packages", T_OBJECT, OFF(packages), 0, 0},
619 {"requiredby", T_OBJECT, OFF(requiredby), 0, 0},
620+ {"recommendedby", T_OBJECT, OFF(recommendedby), 0, 0},
621 {"upgradedby", T_OBJECT, OFF(upgradedby), 0, 0},
622 {"conflictedby", T_OBJECT, OFF(conflictedby), 0, 0},
623 {NULL}
624@@ -1555,6 +1612,7 @@ Loader_buildPackage(LoaderObject *self, PyObject *args)
625 PyObject *reqargs;
626 PyObject *upgargs;
627 PyObject *cnfargs;
628+ PyObject *recargs = NULL;
629 PyObject *callargs;
630
631 PyObject *pkg;
632@@ -1574,9 +1632,10 @@ Loader_buildPackage(LoaderObject *self, PyObject *args)
633
634 cache = (CacheObject *)self->_cache;
635
636- if (!PyArg_ParseTuple(args, "O!O&O&O&O&", &PyTuple_Type, &pkgargs,
637+ if (!PyArg_ParseTuple(args, "O!O&O&O&O&|O&", &PyTuple_Type, &pkgargs,
638 mylist, &prvargs, mylist, &reqargs,
639- mylist, &upgargs, mylist, &cnfargs))
640+ mylist, &upgargs, mylist, &cnfargs,
641+ mylist, &recargs))
642 return NULL;
643
644 if (PyTuple_GET_SIZE(pkgargs) < 2) {
645@@ -1701,6 +1760,59 @@ Loader_buildPackage(LoaderObject *self, PyObject *args)
646 }
647 }
648
649+ /* if recargs: */
650+ if (recargs) {
651+ int i = 0;
652+ int len = PyList_GET_SIZE(recargs);
653+ /* pkg.recommends = [] */
654+ Py_DECREF(pkgobj->recommends);
655+ pkgobj->recommends = PyList_New(len);
656+ /* for args in recargs: */
657+ for (; i != len; i++) {
658+ PyObject *args = PyList_GET_ITEM(recargs, i);
659+ DependsObject *recobj;
660+ PyObject *rec;
661+
662+ if (!PyTuple_Check(args)) {
663+ PyErr_SetString(PyExc_TypeError,
664+ "Item in recargs is not a tuple");
665+ return NULL;
666+ }
667+
668+ /* rec = cache._objmap.get(args) */
669+ rec = PyDict_GetItem(cache->_objmap, args);
670+ recobj = (DependsObject *)rec;
671+
672+ /* if not rec: */
673+ if (!rec) {
674+ if (!PyTuple_Check(args) || PyTuple_GET_SIZE(args) < 2) {
675+ PyErr_SetString(PyExc_ValueError, "Invalid recargs tuple");
676+ return NULL;
677+ }
678+ /* rec = args[0](*args[1:]) */
679+ callargs = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
680+ rec = PyObject_CallObject(PyTuple_GET_ITEM(args, 0), callargs);
681+ Py_DECREF(callargs);
682+ if (!rec) return NULL;
683+ recobj = (DependsObject *)rec;
684+
685+ /* cache._objmap[args] = rec */
686+ PyDict_SetItem(cache->_objmap, args, rec);
687+ Py_DECREF(rec);
688+
689+ /* cache._recommends.append(rec) */
690+ PyList_Append(cache->_recommends, rec);
691+ }
692+
693+ /* relpkgs.append(rec.packages) */
694+ PyList_Append(relpkgs, recobj->packages);
695+
696+ /* pkg.recommends.append(rec) */
697+ Py_INCREF(rec);
698+ PyList_SET_ITEM(pkgobj->recommends, i, rec);
699+ }
700+ }
701+
702 /* if upgargs: */
703 if (upgargs) {
704 int i = 0;
705@@ -2391,6 +2503,7 @@ Cache_init(CacheObject *self, PyObject *args)
706 self->_packages = PyList_New(0);
707 self->_provides = PyList_New(0);
708 self->_requires = PyList_New(0);
709+ self->_recommends = PyList_New(0);
710 self->_upgrades = PyList_New(0);
711 self->_conflicts = PyList_New(0);
712 self->_objmap = PyDict_New();
713@@ -2404,6 +2517,7 @@ Cache_traverse(CacheObject *self, visitproc visit, void *arg)
714 Py_VISIT(self->_packages);
715 Py_VISIT(self->_provides);
716 Py_VISIT(self->_requires);
717+ Py_VISIT(self->_recommends);
718 Py_VISIT(self->_upgrades);
719 Py_VISIT(self->_conflicts);
720 Py_VISIT(self->_objmap);
721@@ -2417,6 +2531,7 @@ Cache_clear(CacheObject *self)
722 Py_CLEAR(self->_packages);
723 Py_CLEAR(self->_provides);
724 Py_CLEAR(self->_requires);
725+ Py_CLEAR(self->_recommends);
726 Py_CLEAR(self->_upgrades);
727 Py_CLEAR(self->_conflicts);
728 Py_CLEAR(self->_objmap);
729@@ -2430,6 +2545,7 @@ Cache_dealloc(CacheObject *self)
730 Py_XDECREF(self->_packages);
731 Py_XDECREF(self->_provides);
732 Py_XDECREF(self->_requires);
733+ Py_XDECREF(self->_recommends);
734 Py_XDECREF(self->_upgrades);
735 Py_XDECREF(self->_conflicts);
736 Py_XDECREF(self->_objmap);
737@@ -2449,6 +2565,8 @@ Cache_reset(CacheObject *self, PyObject *args)
738 LIST_CLEAR(prvobj->packages);
739 if (PyList_Check(prvobj->requiredby))
740 LIST_CLEAR(prvobj->requiredby);
741+ if (PyList_Check(prvobj->recommendedby))
742+ LIST_CLEAR(prvobj->recommendedby);
743 if (PyList_Check(prvobj->upgradedby))
744 LIST_CLEAR(prvobj->upgradedby);
745 if (PyList_Check(prvobj->conflictedby))
746@@ -2464,6 +2582,16 @@ Cache_reset(CacheObject *self, PyObject *args)
747 if (PyList_Check(reqobj->providedby))
748 LIST_CLEAR(reqobj->providedby);
749 }
750+ len = PyList_GET_SIZE(self->_recommends);
751+ for (i = 0; i != len; i++) {
752+ DependsObject *reqobj;
753+ PyObject *req;
754+ req = PyList_GET_ITEM(self->_recommends, i);
755+ reqobj = (DependsObject *)req;
756+ LIST_CLEAR(reqobj->packages);
757+ if (PyList_Check(reqobj->providedby))
758+ LIST_CLEAR(reqobj->providedby);
759+ }
760 len = PyList_GET_SIZE(self->_upgrades);
761 for (i = 0; i != len; i++) {
762 DependsObject *upgobj;
763@@ -2487,6 +2615,7 @@ Cache_reset(CacheObject *self, PyObject *args)
764 LIST_CLEAR(self->_packages);
765 LIST_CLEAR(self->_provides);
766 LIST_CLEAR(self->_requires);
767+ LIST_CLEAR(self->_recommends);
768 LIST_CLEAR(self->_upgrades);
769 LIST_CLEAR(self->_conflicts);
770 PyDict_Clear(self->_objmap);
771@@ -2534,6 +2663,7 @@ Cache__reload(CacheObject *self, PyObject *args)
772 packages = {}
773 provides = {}
774 requires = {}
775+ recommends = {}
776 upgrades = {}
777 conflicts = {}
778 objmap = self._objmap
779@@ -2541,11 +2671,12 @@ Cache__reload(CacheObject *self, PyObject *args)
780 PyObject *packages = PyDict_New();
781 PyObject *provides = PyDict_New();
782 PyObject *requires = PyDict_New();
783+ PyObject *recommends = PyDict_New();
784 PyObject *upgrades = PyDict_New();
785 PyObject *conflicts = PyDict_New();
786 PyObject *objmap = self->_objmap;
787 int i, ilen;
788- if (!packages || !provides || !requires || !conflicts)
789+ if (!packages || !provides || !requires || !recommends || !conflicts )
790 return NULL;
791
792 /* for loader in loaders: */
793@@ -2679,6 +2810,30 @@ Cache__reload(CacheObject *self, PyObject *args)
794 }
795
796 /*
797+ for rec in pkg.recommends:
798+ rec.packages.append(pkg)
799+ if rec not in recommends:
800+ recommends[rec] = True
801+ objmap[rec.getInitArgs()] = rec
802+ */
803+ if (PyList_Check(pkg->recommends)) {
804+ klen = PyList_GET_SIZE(pkg->recommends);
805+ for (k = 0; k != klen; k++) {
806+ PyObject *rec = PyList_GET_ITEM(pkg->recommends, k);
807+ PyList_Append(((DependsObject *)rec)->packages,
808+ (PyObject *)pkg);
809+ if (!PyDict_GetItem(recommends, rec)) {
810+ PyDict_SetItem(recommends, rec, Py_True);
811+ args = PyObject_CallMethod(rec, "getInitArgs",
812+ NULL);
813+ if (!args) return NULL;
814+ PyDict_SetItem(objmap, args, rec);
815+ Py_DECREF(args);
816+ }
817+ }
818+ }
819+
820+ /*
821 for upg in pkg.upgrades:
822 upg.packages.append(pkg)
823 if upg not in upgrades:
824@@ -2747,6 +2902,11 @@ Cache__reload(CacheObject *self, PyObject *args)
825 self->_requires = PyDict_Keys(requires);
826 Py_DECREF(requires);
827
828+ /* self._recommends[:] = recommends.keys() */
829+ Py_DECREF(self->_recommends);
830+ self->_recommends = PyDict_Keys(recommends);
831+ Py_DECREF(recommends);
832+
833 /* self._upgrades[:] = upgrades.keys() */
834 Py_DECREF(self->_upgrades);
835 self->_upgrades = PyDict_Keys(upgrades);
836@@ -2852,7 +3012,7 @@ PyObject *
837 Cache_linkDeps(CacheObject *self, PyObject *args)
838 {
839 int i, j, len;
840- PyObject *reqnames, *upgnames, *cnfnames;
841+ PyObject *reqnames, *recnames, *upgnames, *cnfnames;
842 PyObject *lst;
843
844 /* reqnames = {} */
845@@ -2896,6 +3056,47 @@ Cache_linkDeps(CacheObject *self, PyObject *args)
846 Py_DECREF(seq);
847 }
848
849+ /* recnames = {} */
850+ recnames = PyDict_New();
851+ /* for rec in self._recommends: */
852+ len = PyList_GET_SIZE(self->_recommends);
853+ for (i = 0; i != len; i++) {
854+ PyObject *rec = PyList_GET_ITEM(self->_recommends, i);
855+
856+ /* for name in rec.getMatchNames(): */
857+ PyObject *names = PyObject_CallMethod(rec, "getMatchNames", NULL);
858+ PyObject *seq = PySequence_Fast(names, "getMatchNames() returned "
859+ "non-sequence object");
860+ int nameslen;
861+ if (!seq) return NULL;
862+ nameslen = PySequence_Fast_GET_SIZE(seq);
863+ for (j = 0; j != nameslen; j++) {
864+ PyObject *name = PySequence_Fast_GET_ITEM(seq, j);
865+
866+ /* lst = recnames.get(name) */
867+ lst = PyDict_GetItem(recnames, name);
868+
869+ /*
870+ if lst:
871+ lst.append(rec)
872+ else:
873+ recnames[name] = [rec]
874+ */
875+ if (lst) {
876+ PyList_Append(lst, rec);
877+ } else {
878+ lst = PyList_New(1);
879+ Py_INCREF(rec);
880+ PyList_SET_ITEM(lst, 0, rec);
881+ PyDict_SetItem(recnames, name, lst);
882+ Py_DECREF(lst);
883+ }
884+ }
885+
886+ Py_DECREF(names);
887+ Py_DECREF(seq);
888+ }
889+
890 /* upgnames = {} */
891 upgnames = PyDict_New();
892 /* for upg in self._upgrades: */
893@@ -3035,6 +3236,56 @@ Cache_linkDeps(CacheObject *self, PyObject *args)
894 }
895 }
896
897+ /* lst = recnames.get(prv.name) */
898+ lst = PyDict_GetItem(recnames, prv->name);
899+
900+ /* if lst: */
901+ if (lst) {
902+ /* for rec in lst: */
903+ int reclen = PyList_GET_SIZE(lst);
904+ for (j = 0; j != reclen; j++) {
905+ DependsObject *rec = (DependsObject *)PyList_GET_ITEM(lst, j);
906+ /* if rec.matches(prv): */
907+ PyObject *ret = PyObject_CallMethod((PyObject *)rec, "matches",
908+ "O", (PyObject *)prv);
909+ if (!ret) return NULL;
910+ if (PyObject_IsTrue(ret)) {
911+ /*
912+ if rec.providedby:
913+ rec.providedby.append(prv)
914+ else:
915+ rec.providedby = [prv]
916+ */
917+ if (PyList_Check(rec->providedby)) {
918+ PyList_Append(rec->providedby, (PyObject *)prv);
919+ } else {
920+ PyObject *_lst = PyList_New(1);
921+ Py_INCREF(prv);
922+ PyList_SET_ITEM(_lst, 0, (PyObject *)prv);
923+ Py_DECREF(rec->providedby);
924+ rec->providedby = _lst;
925+ }
926+
927+ /*
928+ if prv.recommendedby:
929+ prv.recommendedby.append(prv)
930+ else:
931+ prv.recommendedby = [prv]
932+ */
933+ if (PyList_Check(prv->recommendedby)) {
934+ PyList_Append(prv->recommendedby, (PyObject *)rec);
935+ } else {
936+ PyObject *_lst = PyList_New(1);
937+ Py_INCREF(rec);
938+ PyList_SET_ITEM(_lst, 0, (PyObject *)rec);
939+ Py_DECREF(prv->recommendedby);
940+ prv->recommendedby = _lst;
941+ }
942+ }
943+ Py_DECREF(ret);
944+ }
945+ }
946+
947 /* lst = upgnames.get(prv.name) */
948 lst = PyDict_GetItem(upgnames, prv->name);
949
950@@ -3139,6 +3390,7 @@ Cache_linkDeps(CacheObject *self, PyObject *args)
951 }
952
953 Py_DECREF(reqnames);
954+ Py_DECREF(recnames);
955 Py_DECREF(upgnames);
956 Py_DECREF(cnfnames);
957
958@@ -3215,6 +3467,29 @@ Cache_getRequires(CacheObject *self, PyObject *args)
959 }
960
961 PyObject *
962+Cache_getRecommends(CacheObject *self, PyObject *args)
963+{
964+ const char *name = NULL;
965+ PyObject *lst;
966+ int i, len;
967+ if (!PyArg_ParseTuple(args, "|s", &name))
968+ return NULL;
969+ if (!name) {
970+ Py_INCREF(self->_recommends);
971+ return self->_recommends;
972+ }
973+ lst = PyList_New(0);
974+ len = PyList_GET_SIZE(self->_recommends);
975+ for (i = 0; i != len; i++) {
976+ DependsObject *rec =
977+ (DependsObject*)PyList_GET_ITEM(self->_recommends, i);
978+ if (strcmp(STR(rec->name), name) == 0)
979+ PyList_Append(lst, (PyObject *)rec);
980+ }
981+ return lst;
982+}
983+
984+PyObject *
985 Cache_getUpgrades(CacheObject *self, PyObject *args)
986 {
987 const char *name = NULL;
988@@ -3324,6 +3599,38 @@ Cache_search(CacheObject *self, PyObject *searcher)
989 }
990 Py_DECREF(lst);
991
992+ lst = PyObject_GetAttrString(searcher, "recommends");
993+ if (lst == NULL || !PyList_Check(lst)) {
994+ PyErr_SetString(PyExc_TypeError, "Invalid recommends attribute");
995+ return NULL;
996+ }
997+ for (i = 0; i != PyList_GET_SIZE(lst); i++) {
998+ ProvidesObject *prv = (ProvidesObject *)PyList_GET_ITEM(lst, i);
999+ for (j = 0; j != PyList_GET_SIZE(self->_recommends); j++) {
1000+ PyObject *rec = PyList_GET_ITEM(self->_recommends, j);
1001+ PyObject *names = PyObject_CallMethod(rec, "getMatchNames", NULL);
1002+ PyObject *seq = PySequence_Fast(names, "getMatchNames() returned "
1003+ "non-sequence object");
1004+ if (seq == NULL) return NULL;
1005+ for (k = 0; k != PySequence_Fast_GET_SIZE(seq); k++) {
1006+ if (strcmp(PyString_AS_STRING(PySequence_Fast_GET_ITEM(seq, k)),
1007+ PyString_AS_STRING(prv->name)) == 0) {
1008+ res = PyObject_CallMethod(rec, "matches", "O", prv);
1009+ if (res == NULL)
1010+ return NULL;
1011+ if (PyObject_IsTrue(res))
1012+ CALLMETHOD(searcher, "addResult", "O", rec);
1013+ Py_DECREF(res);
1014+ break;
1015+ }
1016+ }
1017+
1018+ Py_DECREF(names);
1019+ Py_DECREF(seq);
1020+ }
1021+ }
1022+ Py_DECREF(lst);
1023+
1024 lst = PyObject_GetAttrString(searcher, "upgrades");
1025 if (lst == NULL || !PyList_Check(lst)) {
1026 PyErr_SetString(PyExc_TypeError, "Invalid upgrades attribute");
1027@@ -3420,7 +3727,7 @@ Cache__getstate__(CacheObject *self, PyObject *args)
1028 static PyObject *
1029 Cache__setstate__(CacheObject *self, PyObject *state)
1030 {
1031- PyObject *provides, *requires, *upgrades, *conflicts;
1032+ PyObject *provides, *requires, *recommends, *upgrades, *conflicts;
1033 int i, ilen;
1034 int j, jlen;
1035
1036@@ -3452,11 +3759,13 @@ Cache__setstate__(CacheObject *self, PyObject *state)
1037 /*
1038 provides = {}
1039 requires = {}
1040+ recommends = {}
1041 upgrades = {}
1042 conflicts = {}
1043 */
1044 provides = PyDict_New();
1045 requires = PyDict_New();
1046+ recommends = PyDict_New();
1047 upgrades = PyDict_New();
1048 conflicts = PyDict_New();
1049
1050@@ -3497,6 +3806,21 @@ Cache__setstate__(CacheObject *self, PyObject *state)
1051 }
1052
1053 /*
1054+ for rec in pkg.recommends:
1055+ rec.packages.append(pkg)
1056+ recommends[rec] = True
1057+ */
1058+ if (PyList_Check(pkgobj->recommends)) {
1059+ jlen = PyList_GET_SIZE(pkgobj->recommends);
1060+ for (j = 0; j != jlen; j++) {
1061+ PyObject *rec = PyList_GET_ITEM(pkgobj->recommends, j);
1062+ DependsObject *recobj = (DependsObject *)rec;
1063+ PyList_Append(recobj->packages, pkg);
1064+ PyDict_SetItem(recommends, rec, Py_True);
1065+ }
1066+ }
1067+
1068+ /*
1069 for upg in pkg.upgrades:
1070 upg.packages.append(pkg)
1071 upgrades[upg] = True
1072@@ -3525,6 +3849,7 @@ Cache__setstate__(CacheObject *self, PyObject *state)
1073 PyDict_SetItem(conflicts, cnf, Py_True);
1074 }
1075 }
1076+
1077 }
1078
1079 /* self._provides = provides.keys() */
1080@@ -3535,6 +3860,10 @@ Cache__setstate__(CacheObject *self, PyObject *state)
1081 self->_requires = PyDict_Keys(requires);
1082 Py_DECREF(requires);
1083
1084+ /* self._recommends = recommends.keys() */
1085+ self->_recommends = PyDict_Keys(recommends);
1086+ Py_DECREF(recommends);
1087+
1088 /* self._upgrades = upgrades.keys() */
1089 self->_upgrades = PyDict_Keys(upgrades);
1090 Py_DECREF(upgrades);
1091@@ -3562,6 +3891,7 @@ static PyMethodDef Cache_methods[] = {
1092 {"getPackages", (PyCFunction)Cache_getPackages, METH_VARARGS, NULL},
1093 {"getProvides", (PyCFunction)Cache_getProvides, METH_VARARGS, NULL},
1094 {"getRequires", (PyCFunction)Cache_getRequires, METH_VARARGS, NULL},
1095+ {"getRecommends", (PyCFunction)Cache_getRecommends, METH_VARARGS, NULL},
1096 {"getUpgrades", (PyCFunction)Cache_getUpgrades, METH_VARARGS, NULL},
1097 {"getConflicts", (PyCFunction)Cache_getConflicts, METH_VARARGS, NULL},
1098 {"search", (PyCFunction)Cache_search, METH_O, NULL},
1099@@ -3576,6 +3906,7 @@ static PyMemberDef Cache_members[] = {
1100 {"_packages", T_OBJECT, OFF(_packages), RO, 0},
1101 {"_provides", T_OBJECT, OFF(_provides), RO, 0},
1102 {"_requires", T_OBJECT, OFF(_requires), RO, 0},
1103+ {"_recommends", T_OBJECT, OFF(_recommends), RO, 0},
1104 {"_upgrades", T_OBJECT, OFF(_upgrades), RO, 0},
1105 {"_conflicts", T_OBJECT, OFF(_conflicts), RO, 0},
1106 {"_objmap", T_OBJECT, OFF(_objmap), RO, 0},
1107diff --git a/smart/commands/query.py b/smart/commands/query.py
1108index 808e53a..9265cd9 100644
1109--- a/smart/commands/query.py
1110+++ b/smart/commands/query.py
1111@@ -107,6 +107,8 @@ def option_parser(**kwargs):
1112 help=_("show requires for the given packages"))
1113 parser.add_option("--show-prerequires", action="store_true",
1114 help=_("show requires selecting only pre-dependencies"))
1115+ parser.add_option("--show-recommends", action="store_true",
1116+ help=_("show recommends for the given packages"))
1117 parser.add_option("--show-upgrades", action="store_true",
1118 help=_("show upgrades for the given packages"))
1119 parser.add_option("--show-conflicts", action="store_true",
1120@@ -488,6 +490,19 @@ def main(ctrl, opts, reloadchannels=True):
1121 continue
1122 output.showRequiresProvidedBy(pkg, req,
1123 prv, prvpkg)
1124+ if pkg.recommends and (opts.show_recommends):
1125+ pkg.recommends.sort()
1126+ first = True
1127+ for req in pkg.recommends:
1128+ output.showRecommends(pkg, req)
1129+ if opts.show_providedby and req.providedby:
1130+ for prv in req.providedby:
1131+ prv.packages.sort()
1132+ for prvpkg in prv.packages:
1133+ if opts.installed and not prvpkg.installed:
1134+ continue
1135+ output.showRecommendsProvidedBy(pkg, req,
1136+ prv, prvpkg)
1137 if pkg.upgrades and (opts.show_upgrades or whoupgrades):
1138 pkg.upgrades.sort()
1139 first = True
1140@@ -594,6 +609,12 @@ class NullOutput(object):
1141 def showRequiresProvidedBy(self, pkg, req, prv, prvpkg):
1142 pass
1143
1144+ def showRecommends(self, pkg, req):
1145+ pass
1146+
1147+ def showRecommendsProvidedBy(self, pkg, req, prv, prvpkg):
1148+ pass
1149+
1150 def showUpgrades(self, pkg, upg):
1151 pass
1152
1153@@ -619,6 +640,8 @@ class TextOutput(NullOutput):
1154 self._firstconflictedby = True
1155 self._firstrequires = True
1156 self._firstrequiresprovidedby = True
1157+ self._firstrecommends = True
1158+ self._firstrecommendsprovidedby = True
1159 self._firstupgrades = True
1160 self._firstupgradesprovidedby = True
1161 self._firstconflicts = True
1162@@ -711,6 +734,22 @@ class TextOutput(NullOutput):
1163 name = str(prvpkg)
1164 print " ", "%s (%s)" % (name, prv)
1165
1166+ def showRecommends(self, pkg, rec):
1167+ if self._firstrecommends:
1168+ self._firstrecommends = False
1169+ print " ", _("Recommends:")
1170+ print " ", rec
1171+
1172+ def showRecommendsProvidedBy(self, pkg, req, prv, prvpkg):
1173+ if self._firstrecommendsprovidedby:
1174+ self._firstrecommendsprovidedby = False
1175+ print " ", _("Provided By:")
1176+ if self.opts.hide_version:
1177+ name = prvpkg.name
1178+ else:
1179+ name = str(prvpkg)
1180+ print " ", "%s (%s)" % (name, prv)
1181+
1182 def showUpgrades(self, pkg, upg):
1183 if self._firstupgrades:
1184 self._firstupgrades = False
1185@@ -797,6 +836,18 @@ class GraphVizOutput(NullOutput):
1186 self._shown[req, prv] = True
1187 print ' "Requires: %s" -> "Provides: %s";' % (req, prv)
1188
1189+ def showRecommends(self, pkg, req):
1190+ if (pkg, req) not in self._shown:
1191+ self._shown[pkg, req] = True
1192+ print ' "%s" -> "Recommends: %s";' % (pkg, req)
1193+
1194+ def showRecommendsProvidedBy(self, pkg, req, prv, prvpkg):
1195+ self.showPackage(prvpkg)
1196+ self.showProvides(prvpkg, prv)
1197+ if (req, prv) not in self._shown:
1198+ self._shown[req, prv] = True
1199+ print ' "Recommends: %s" -> "Provides: %s";' % (req, prv)
1200+
1201 def showUpgrades(self, pkg, upg):
1202 if (pkg, upg) not in self._shown:
1203 self._shown[pkg, upg] = True
1204diff --git a/smart/control.py b/smart/control.py
1205index fd7083a..d44abe7 100644
1206--- a/smart/control.py
1207+++ b/smart/control.py
1208@@ -447,7 +447,7 @@ class Control(object):
1209 queue = marked.keys()
1210 while queue:
1211 pkg = queue.pop(0)
1212- for req in pkg.requires:
1213+ for req in pkg.requires + pkg.recommends:
1214 for prv in req.providedby:
1215 for prvpkg in prv.packages:
1216 if (prvpkg.installed and
1217@@ -794,7 +794,7 @@ class Control(object):
1218 pkglst = []
1219 for pkg in changeset:
1220 n = 0
1221- for req in pkg.requires:
1222+ for req in pkg.requires + pkg.recommends:
1223 for prv in req.providedby:
1224 for prvpkg in prv.packages:
1225 if changeset.get(prvpkg) is INSTALL:
1226diff --git a/smart/searcher.py b/smart/searcher.py
1227index 216f4ce..32eb825 100644
1228--- a/smart/searcher.py
1229+++ b/smart/searcher.py
1230@@ -45,9 +45,9 @@ class Searcher(object):
1231
1232 - provides is matched in Provides.search(), for the same reason.
1233
1234- - requires, upgrades, and conflicts don't have special searching
1235- methods. Instead, their usual match() method is given an instance
1236- of the Provides type.
1237+ - requires, recommends, upgrades, and conflicts don't have special
1238+ searching methods. Instead, their usual match() method is given
1239+ an instance of the Provides type.
1240
1241 - group, path, url, and other information which is found by
1242 PackageInfo, is searched by the Loader.search() method and
1243@@ -62,6 +62,7 @@ class Searcher(object):
1244 self.nameversion = []
1245 self.provides = []
1246 self.requires = []
1247+ self.recommends = []
1248 self.upgrades = []
1249 self.conflicts = []
1250 self.path = []
1251@@ -76,6 +77,7 @@ class Searcher(object):
1252 del self.nameversion[:]
1253 del self.provides[:]
1254 del self.requires[:]
1255+ del self.recommends[:]
1256 del self.upgrades[:]
1257 del self.conflicts[:]
1258 del self.path[:]
1259@@ -122,6 +124,8 @@ class Searcher(object):
1260 self.addProvides(s[9:], cutoff)
1261 elif s.startswith("requires:"):
1262 self.addRequires(s[9:])
1263+ elif s.startswith("recommends:"):
1264+ self.addRecommends(s[11:])
1265 elif s.startswith("upgrades:"):
1266 self.addUpgrades(s[9:])
1267 elif s.startswith("conflicts:"):
1268@@ -151,6 +155,7 @@ class Searcher(object):
1269 return s and (
1270 s.startswith("provides:") or
1271 s.startswith("requires:") or
1272+ s.startswith("recommends:") or
1273 s.startswith("upgrades:") or
1274 s.startswith("conflicts:") or
1275 s.startswith("url:") or
1276@@ -182,6 +187,9 @@ class Searcher(object):
1277 def addRequires(self, s):
1278 self.requires.append(self._buildProvides(s))
1279
1280+ def addRecommends(self, s):
1281+ self.recommends.append(self._buildProvides(s))
1282+
1283 def addUpgrades(self, s):
1284 self.upgrades.append(self._buildProvides(s))
1285
1286diff --git a/smart/transaction.py b/smart/transaction.py
1287index eb320d2..300b9cc 100644
1288--- a/smart/transaction.py
1289+++ b/smart/transaction.py
1290@@ -573,7 +573,7 @@ class Transaction(object):
1291 self._remove(namepkg, changeset, locked, pending, depth)
1292
1293 # Install packages required by this one.
1294- for req in pkg.requires:
1295+ for req in pkg.requires + pkg.recommends:
1296
1297 # Check if someone is already providing it.
1298 prvpkgs = {}
1299@@ -596,8 +596,12 @@ class Transaction(object):
1300
1301 if not prvpkgs:
1302 # No packages provide it at all. Give up.
1303- raise Failed, _("Can't install %s: no package provides %s") % \
1304- (pkg, req)
1305+ if req in pkg.requires:
1306+ raise Failed, _("Can't install %s: no package provides %s") % \
1307+ (pkg, req)
1308+ else:
1309+ # It's only a recommend, skip
1310+ continue
1311
1312 if len(prvpkgs) == 1:
1313 # Don't check locked here. prvpkgs was
1314@@ -1359,7 +1363,7 @@ class ChangeSetSplitter(object):
1315 set = self._changeset
1316
1317 # Check all dependencies needed by this package.
1318- for req in pkg.requires:
1319+ for req in pkg.requires + pkg.recommends:
1320
1321 # Check if any already installed or to be installed
1322 # package will solve the problem.
1323@@ -1424,8 +1428,9 @@ class ChangeSetSplitter(object):
1324
1325 # There are no solutions for the problem.
1326 # Should we really care about it?
1327- if (self._forcerequires or
1328- isinstance(req, PreRequires)):
1329+ if ((self._forcerequires or
1330+ isinstance(req, PreRequires))
1331+ and req in pkg.requires):
1332 raise Error, _("No providers for '%s', "
1333 "required by '%s'") % (req, pkg)
1334
1335@@ -1625,7 +1630,7 @@ def recursiveInternalRequires(pkgmap, pkg, numrel, done=None):
1336 return n
1337
1338 def forwardRequires(pkg, map):
1339- for req in pkg.requires:
1340+ for req in pkg.requires + pkg.recommends:
1341 if req not in map:
1342 map[req] = True
1343 for prv in req.providedby:
1344@@ -1794,6 +1799,15 @@ def checkPackages(cache, checkset, relateset, report=False):
1345 iface.info(_("Unsatisfied dependency: %s requires %s") %
1346 (pkg, req))
1347
1348+ for req in pkg.recommends:
1349+ for prv in req.providedby:
1350+ for prvpkg in prv.packages:
1351+ if prvpkg in relateset:
1352+ break
1353+ else:
1354+ continue
1355+ break
1356+
1357 if not pkg.installed:
1358 continue
1359
1360--
13611.7.9.5
1362
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 @@
1backends/rpm: implement rpm-extra-macros option
2
3Allow defining extra macros in the smart configuration to be passed
4to rpm before opening the database.
5
6Upstream-Status: Pending
7
8Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
9
10diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
11index b9e9cb2..234c844 100644
12--- a/smart/backends/rpm/base.py
13+++ b/smart/backends/rpm/base.py
14@@ -53,6 +53,10 @@ def rpm_join_dbpath(root, dbpath):
15 return os.path.join(root, dbpath)
16
17 def getTS(new=False):
18+ if sysconf.get("rpm-extra-macros"):
19+ for key, value in sysconf.get("rpm-extra-macros").items():
20+ rpm.addMacro(key, str(value))
21+
22 rpm_root = os.path.abspath(sysconf.get("rpm-root", "/"))
23 if not hasattr(getTS, "ts") or getTS.root != rpm_root:
24 getTS.root = rpm_root
25--
261.7.9.5
27
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 @@
1backends/rpm: fix parsing of rpm-md metadata
2
3If assertions are disabled then the queue.pop() wasn't being executed,
4leading to requires, recommends etc. not being read properly.
5
6Upstream-Status: Pending
7
8Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
9
10diff --git a/smart/backends/rpm/metadata.py b/smart/backends/rpm/metadata.py
11index 2c54f39..dc9df22 100644
12--- a/smart/backends/rpm/metadata.py
13+++ b/smart/backends/rpm/metadata.py
14@@ -188,7 +188,8 @@ class RPMMetaDataLoader(Loader):
15
16 elif event == "end":
17
18- assert queue.pop() is elem
19+ popped = queue.pop()
20+ assert popped is elem
21
22 if skip:
23 if tag == skip:
24--
251.7.9.5
26
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 @@
1Fix smart RPM backend to handle rpm-dbpath/rpm-root properly
2
3Don't assume that if the dbpath starts with / that it is an absolute
4path. This matches the behaviour of rpm itself. (If the root path is
5specified and does not start with /, rpm will prepend the root path
6twice and fail).
7
8Upstream-Status: Pending
9
10Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
11
12diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
13index 7092332..0489e11 100644
14--- a/smart/backends/rpm/base.py
15+++ b/smart/backends/rpm/base.py
16@@ -46,6 +46,12 @@ __all__ = ["RPMPackage", "RPMProvides", "RPMNameProvides", "RPMPreRequires",
17 "rpm", "getTS", "getArchScore", "getArchColor", "system_provides",
18 "collapse_libc_requires"]
19
20+def rpm_join_dbpath(root, dbpath):
21+ if dbpath.startswith('/') and root:
22+ return os.path.join(root, dbpath[1:])
23+ else:
24+ return os.path.join(root, dbpath)
25+
26 def getTS(new=False):
27 rpm_root = os.path.abspath(sysconf.get("rpm-root", "/"))
28 if not hasattr(getTS, "ts") or getTS.root != rpm_root:
29@@ -56,7 +62,7 @@ def getTS(new=False):
30 #if not sysconf.get("rpm-check-signatures", False):
31 # getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
32 rpm_dbpath = sysconf.get("rpm-dbpath", "var/lib/rpm")
33- dbdir = os.path.join(getTS.root, rpm_dbpath)
34+ dbdir = rpm_join_dbpath(getTS.root, rpm_dbpath)
35 if not os.path.isdir(dbdir):
36 try:
37 os.makedirs(dbdir)
38diff --git a/smart/channels/rpm_sys.py b/smart/channels/rpm_sys.py
39index efcb10e..b9fda27 100644
40--- a/smart/channels/rpm_sys.py
41+++ b/smart/channels/rpm_sys.py
42@@ -20,7 +20,7 @@
43 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
44 #
45 from smart.backends.rpm.header import RPMDBLoader
46-from smart.backends.rpm.base import getTS
47+from smart.backends.rpm.base import getTS, rpm_join_dbpath
48 from smart.channel import PackageChannel
49 from smart import *
50 import os
51@@ -32,9 +32,9 @@ class RPMSysChannel(PackageChannel):
52
53 def fetch(self, fetcher, progress):
54 getTS() # Make sure the db exists.
55- path = os.path.join(sysconf.get("rpm-root", "/"),
56- sysconf.get("rpm-dbpath", "var/lib/rpm"),
57- "Packages")
58+ dbdir = rpm_join_dbpath(sysconf.get("rpm-root", "/"),
59+ sysconf.get("rpm-dbpath", "var/lib/rpm"))
60+ path = os.path.join(dbdir, "Packages")
61 digest = os.path.getmtime(path)
62 if digest == self._digest:
63 return True
64diff --git a/smart/plugins/detectsys.py b/smart/plugins/detectsys.py
65index 2cd49ad..3959d07 100644
66--- a/smart/plugins/detectsys.py
67+++ b/smart/plugins/detectsys.py
68@@ -20,10 +20,11 @@
69 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
70 #
71 from smart import *
72+from smart.backends.rpm.base import rpm_join_dbpath
73 import os
74
75 def detectRPMSystem():
76- dir = os.path.join(sysconf.get("rpm-root", "/"),
77+ dir = rpm_join_dbpath(sysconf.get("rpm-root", "/"),
78 sysconf.get("rpm-dbpath", "var/lib/rpm"))
79 file = os.path.join(dir, "Packages")
80 if os.path.exists(file):
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 @@
1backends/rpm: remove creation of /var/tmp
2
3This doesn't appear to be needed, and breaks installation of base-files
4in OpenEmbedded (since that is a symlink installed as part of the
5package).
6
7Upstream-Status: Pending
8
9Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
10
11diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
12index 234c844..127354d 100644
13--- a/smart/backends/rpm/base.py
14+++ b/smart/backends/rpm/base.py
15@@ -82,12 +82,6 @@ def getTS(new=False):
16 else:
17 iface.warning(_("Initialized new rpm database at %s")
18 % getTS.root)
19- tmpdir = os.path.join(getTS.root, "var/tmp")
20- if not os.path.isdir(tmpdir):
21- try:
22- os.makedirs(tmpdir)
23- except OSError:
24- pass
25 if new:
26 if sysconf.get("rpm-dbpath"):
27 rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath"))
28--
291.7.9.5
30
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 @@
1Print a more friendly error if YAML output is requested without PyYAML
2
3Upstream-Status: Pending
4
5Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
6
7diff --git a/smart/commands/channel.py b/smart/commands/channel.py
8index 63fbb35..108f3f1 100644
9--- a/smart/commands/channel.py
10+++ b/smart/commands/channel.py
11@@ -339,7 +339,10 @@ def main(ctrl, opts):
12 print
13
14 if opts.yaml is not None:
15- import yaml
16+ try:
17+ import yaml
18+ except ImportError:
19+ raise Error, _("Please install PyYAML in order to use this function")
20 yamlchannels = {}
21 for alias in (opts.yaml or sysconf.get("channels", ())):
22 channel = sysconf.get(("channels", alias))
23diff --git a/smart/commands/config.py b/smart/commands/config.py
24index 4fe4366..aa1db78 100644
25--- a/smart/commands/config.py
26+++ b/smart/commands/config.py
27@@ -137,7 +137,10 @@ def main(ctrl, opts):
28 pprint.pprint(sysconf.get((), hard=True))
29
30 if opts.yaml is not None:
31- import yaml
32+ try:
33+ import yaml
34+ except ImportError:
35+ raise Error, _("Please install PyYAML in order to use this function")
36 if opts.yaml:
37 marker = object()
38 for opt in opts.yaml:
39diff --git a/smart/commands/flag.py b/smart/commands/flag.py
40index ed18999..8b90496 100644
41--- a/smart/commands/flag.py
42+++ b/smart/commands/flag.py
43@@ -138,7 +138,10 @@ def main(ctrl, opts):
44 print
45
46 if opts.yaml is not None:
47- import yaml
48+ try:
49+ import yaml
50+ except ImportError:
51+ raise Error, _("Please install PyYAML in order to use this function")
52 yamlflags = {}
53 for flag in opts.yaml or pkgconf.getFlagNames():
54 flag = flag.strip()
55diff --git a/smart/commands/mirror.py b/smart/commands/mirror.py
56index ca50a95..f7b019d 100644
57--- a/smart/commands/mirror.py
58+++ b/smart/commands/mirror.py
59@@ -218,7 +218,10 @@ def main(ctrl, opts):
60 print
61
62 if opts.yaml:
63- import yaml
64+ try:
65+ import yaml
66+ except ImportError:
67+ raise Error, _("Please install PyYAML in order to use this function")
68 yamlmirrors = {}
69 mirrors = sysconf.get("mirrors", ())
70 for origin in mirrors:
71diff --git a/smart/commands/priority.py b/smart/commands/priority.py
72index d850d29..441ea32 100644
73--- a/smart/commands/priority.py
74+++ b/smart/commands/priority.py
75@@ -117,7 +117,10 @@ def main(ctrl, opts):
76 print
77
78 elif opts.yaml:
79- import yaml
80+ try:
81+ import yaml
82+ except ImportError:
83+ raise Error, _("Please install PyYAML in order to use this function")
84 yamlpriorities = {}
85 priorities = sysconf.get("package-priorities", {})
86 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 @@
1RPM5 has removed support for RPMVSF_NOSIGNATURES
2
3Patch smart to no longer use this flag
4
5Upstream-Status: Pending
6
7Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
8
9diff -ur smart-1.4.1.orig/smart/backends/rpm/base.py smart-1.4.1/smart/backends/rpm/base.py
10--- smart-1.4.1.orig/smart/backends/rpm/base.py 2012-10-04 11:22:11.229351164 -0500
11+++ smart-1.4.1/smart/backends/rpm/base.py 2012-10-04 11:22:44.820170786 -0500
12@@ -53,8 +53,8 @@
13 if sysconf.get("rpm-dbpath"):
14 rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath"))
15 getTS.ts = rpm.ts(getTS.root)
16- if not sysconf.get("rpm-check-signatures", False):
17- getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
18+ #if not sysconf.get("rpm-check-signatures", False):
19+ # getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
20 rpm_dbpath = sysconf.get("rpm-dbpath", "var/lib/rpm")
21 dbdir = os.path.join(getTS.root, rpm_dbpath)
22 if not os.path.isdir(dbdir):
23@@ -82,8 +82,8 @@
24 if sysconf.get("rpm-dbpath"):
25 rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath"))
26 ts = rpm.ts(getTS.root)
27- if not sysconf.get("rpm-check-signatures", False):
28- ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
29+ #if not sysconf.get("rpm-check-signatures", False):
30+ # ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
31 return ts
32 else:
33 return getTS.ts
34diff -ur smart-1.4.1.orig/smart/plugins/yumchannelsync.py smart-1.4.1/smart/plugins/yumchannelsync.py
35--- smart-1.4.1.orig/smart/plugins/yumchannelsync.py 2010-12-06 03:11:05.000000000 -0600
36+++ smart-1.4.1/smart/plugins/yumchannelsync.py 2012-10-04 11:23:09.799350924 -0500
37@@ -56,7 +56,8 @@
38
39 rpmroot = sysconf.get("rpm-root", "/")
40 ts = rpmUtils.transaction.initReadOnlyTransaction(root=rpmroot)
41- ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
42+ #ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
43+ ts.pushVSFlags(~(rpm._RPMVSF_NODIGESTS))
44 releasever = None
45 # HACK: we're hard-coding the most used distros, will add more if needed
46 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..464c5c5571
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
@@ -0,0 +1,146 @@
1SUMMARY = "The Smart Package Manager"
2DESCRIPTION = "The Smart Package Manager project has the ambitious objective of creating \
3smart and portable algorithms for solving adequately the problem of managing software \
4upgrades and installation."
5
6HOMEPAGE = "http://labix.org/smart/"
7SECTION = "devel/python"
8LICENSE = "GPLv2"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833"
10
11DEPENDS = "python rpm gettext-native"
12PR = "r9"
13SRCNAME = "smart"
14
15SRC_URI = "\
16 http://launchpad.net/smart/trunk/${PV}/+download/${SRCNAME}-${PV}.tar.bz2 \
17 file://smartpm-rpm5-nodig.patch \
18 file://smart-rpm-root.patch \
19 file://smart-recommends.patch \
20 file://smart-rpm-extra-macros.patch \
21 file://smart-dflags.patch \
22 file://smart-rpm-md-parse.patch \
23 file://smart-tmpdir.patch \
24 file://smart-metadata-match.patch \
25 file://smart-improve-error-reporting.patch \
26 file://smart-multilib-fixes.patch \
27 file://smart-yaml-error.patch \
28 file://smart-channelsdir.patch \
29 file://smart-conflict-provider.patch \
30 file://smart-flag-ignore-recommends.patch \
31 file://smart-flag-exclude-packages.patch \
32 file://smart-config-ignore-all-recommends.patch \
33 file://smart-attempt.patch \
34 file://smart-filename-NAME_MAX.patch \
35 "
36
37SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6"
38SRC_URI[sha256sum] = "b1d519ddb43d60f293b065c28870a5d9e8b591cd49e8c68caea48ace91085eba"
39S = "${WORKDIR}/${SRCNAME}-${PV}"
40
41# Options - rpm, qt4, gtk
42PACKAGECONFIG ??= "rpm"
43
44RPM_RDEP = "${PN}-backend-rpm"
45QT_RDEP = "${PN}-interface-qt4"
46GTK_RDEP = "${PN}-interface-gtk"
47
48RPM_RDEP_class-native = ""
49QT_RDEP_class-native = ""
50GTK_RDEP_class-native = ""
51
52RPM_RDEP_class-nativesdk = ""
53QT_RDEP_class-nativesdk = ""
54GTK_RDEP_class-nativesdk = ""
55
56PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}"
57PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}"
58PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}"
59
60inherit distutils
61
62do_install_append() {
63 # We don't support the following items
64 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/slack
65 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/arch
66 rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt
67
68 # Temporary, debian support in OE is missing the python module
69 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/aptchannelsync.py*
70 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/debdir.py*
71 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/deb
72
73 # Disable automatic channel detection
74 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/detectsys.py*
75
76 # Disable landscape support
77 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/landscape.py*
78
79 # Disable urpmi channel support
80 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/urpmichannelsync.py*
81
82 # Disable yum channel support
83 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/yumchannelsync.py*
84
85 # Disable zypper channel support
86 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/zyppchannelsync.py*
87
88 if [ -z "${@base_contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then
89 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/rpmdir.py*
90 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/rpm
91 fi
92
93 if [ -z "${@base_contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then
94 rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt4
95 fi
96
97 if [ -z "${@base_contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then
98 rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/gtk
99 fi
100}
101
102add_native_wrapper() {
103 create_wrapper ${D}/${bindir}/smart \
104 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
105 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
106 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
107}
108
109do_install_append_class-native() {
110 add_native_wrapper
111}
112
113do_install_append_class-nativesdk() {
114 add_native_wrapper
115}
116
117PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \
118 ${@base_contains('PACKAGECONFIG', 'rpm', '${PN}-backend-rpm', '', d)} \
119 ${@base_contains('PACKAGECONFIG', 'qt4', '${PN}-interface-qt4', '', d)} \
120 ${@base_contains('PACKAGECONFIG', 'gtk', '${PN}-interface-gtk', '', d)} \
121 ${PN}-interface-images ${PN}"
122
123RDEPENDS_smartpm = "${PN}"
124
125RDEPENDS_${PN} += "${PN}-backend-rpm python-codecs python-textutils python-xml python-fcntl \
126 python-pickle python-crypt python-compression python-shell \
127 python-resource python-netclient python-threading python-unixadmin python-pprint"
128RDEPENDS_${PN}_class-native = ""
129
130RDEPENDS_${PN}-backend-rpm = "python-rpm"
131
132RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images"
133RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images"
134
135FILES_smartpm = "${bindir}/smart"
136
137FILES_${PN}-dbg += "${libdir}/python*/site-packages/smart/backends/rpm/.debug"
138
139FILES_${PN}-backend-rpm = "${libdir}/python*/site-packages/smart/backends/rpm"
140
141FILES_${PN}-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4"
142FILES_${PN}-interface-gtk = "${libdir}/python*/site-packages/smart/interfaces/gtk"
143FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images"
144
145BBCLASSEXTEND = "native nativesdk"
146
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 @@
1SUMMARY = "Python implementation of a sliding window memory map manager"
2DESCRIPTION = "A pure Python implementation of a sliding memory map to \
3help unifying memory mapped access on 32 and 64 bit systems and to help \
4managing resources more efficiently."
5HOMEPAGE = "http://github.com/gitpython-developers/GitPython"
6SECTION = "devel/python"
7LICENSE = "BSD"
8LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709"
9
10SRC_URI = "http://pypi.python.org/packages/source/s/smmap/smmap-${PV}.tar.gz"
11SRC_URI[md5sum] = "f5426b7626ddcf5e447253fae0396b0c"
12SRC_URI[sha256sum] = "dea2955cc045ec5527da6b762f7e95a5be7f645c683b54ccce52d56b4d7e2d6f"
13
14S = "${WORKDIR}/smmap-${PV}"
15
16inherit setuptools
17
18RDEPENDS_${PN} += "python-codecs python-mmap python-lang"
19
20BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/python/python.inc b/meta/recipes-devtools/python/python.inc
new file mode 100644
index 0000000000..90079a29c8
--- /dev/null
+++ b/meta/recipes-devtools/python/python.inc
@@ -0,0 +1,31 @@
1SUMMARY = "The Python Programming Language"
2HOMEPAGE = "http://www.python.org"
3LICENSE = "PSFv2"
4SECTION = "devel/python"
5# bump this on every change in contrib/python/generate-manifest-2.7.py
6INC_PR = "r0"
7
8LIC_FILES_CHKSUM = "file://LICENSE;md5=ed3abfd1059e2d3a36a8cff3986f9bb6"
9
10SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2"
11
12SRC_URI[md5sum] = "c57477edd6d18bd9eeca2f21add73919"
13SRC_URI[sha256sum] = "726457e11cb153adc3f428aaf1901fc561a374c30e5e7da6742c0742a338663c"
14
15PYTHON_MAJMIN = "2.7"
16
17inherit autotools-brokensep
18
19PYTHONLSBOPTS = "--with-wctype-functions"
20PYTHONLSBOPTS_linuxstdbase = "ac_cv_sizeof_off_t=8"
21
22EXTRA_OECONF = "\
23 --with-threads \
24 --with-pymalloc \
25 --without-cxx-main \
26 --with-signal-module \
27 --enable-shared \
28 --enable-ipv6=${@base_contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)} \
29 ac_cv_header_bluetooth_bluetooth_h=no ac_cv_header_bluetooth_h=no \
30 ${PYTHONLSBOPTS} \
31"
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 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3# We need to ensure our host tools get run during build, not the freshly
4# built cross-tools (this will not work), so we introduce HOSTPYTHON and HOSTPGEN.
5# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
6
7Index: Python-2.7.2/Makefile.pre.in
8===================================================================
9--- Python-2.7.2.orig/Makefile.pre.in
10+++ Python-2.7.2/Makefile.pre.in
11@@ -182,6 +182,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
12
13 PYTHON= python$(EXE)
14 BUILDPYTHON= python$(BUILDEXE)
15+HOSTPYTHON= $(BUILDPYTHON)
16
17 # The task to run while instrument when building the profile-opt target
18 PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
19@@ -214,7 +215,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
20 ##########################################################################
21 # Parser
22 PGEN= Parser/pgen$(EXE)
23-
24+HOSTPGEN= $(PGEN)$(EXE)
25 POBJS= \
26 Parser/acceler.o \
27 Parser/grammar1.o \
28@@ -401,14 +402,14 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA
29 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
30
31 platform: $(BUILDPYTHON)
32- $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
33+ $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
34
35
36 # Build the shared modules
37 sharedmods: $(BUILDPYTHON)
38 @case $$MAKEFLAGS in \
39- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
40- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
41+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
42+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
43 esac
44
45 # Build static library
46@@ -542,7 +543,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
47 $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
48 Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
49 -@$(INSTALL) -d Include
50- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
51+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
52 -touch Parser/pgen.stamp
53
54 $(PGEN): $(PGENOBJS)
55@@ -926,25 +927,25 @@ libinstall: build_all $(srcdir)/Lib/$(PL
56 done
57 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
58 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
59- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
60+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
61 -d $(LIBDEST) -f \
62 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
63 $(DESTDIR)$(LIBDEST)
64 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
65- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
66+ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
67 -d $(LIBDEST) -f \
68 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
69 $(DESTDIR)$(LIBDEST)
70 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
71- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
72+ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
73 -d $(LIBDEST)/site-packages -f \
74 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
75 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
76- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
77+ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
78 -d $(LIBDEST)/site-packages -f \
79 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
80 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
81- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
82+ $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
83
84 # Create the PLATDIR source directory, if one wasn't distributed..
85 $(srcdir)/Lib/$(PLATDIR):
86@@ -1049,7 +1050,7 @@ libainstall: all python-config
87 # Install the dynamically loadable modules
88 # This goes into $(exec_prefix)
89 sharedinstall: sharedmods
90- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
91+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
92 --prefix=$(prefix) \
93 --install-scripts=$(BINDIR) \
94 --install-platlib=$(DESTSHARED) \
95Index: Python-2.7.2/setup.py
96===================================================================
97--- Python-2.7.2.orig/setup.py
98+++ Python-2.7.2/setup.py
99@@ -313,6 +313,7 @@ class PyBuildExt(build_ext):
100 self.failed.append(ext.name)
101 self.announce('*** WARNING: renaming "%s" since importing it'
102 ' failed: %s' % (ext.name, why), level=3)
103+ return
104 assert not self.inplace
105 basename, tail = os.path.splitext(ext_filename)
106 newname = basename + "_failed" + tail
107@@ -369,8 +370,8 @@ class PyBuildExt(build_ext):
108
109 def detect_modules(self):
110 # Ensure that /usr/local is always used
111- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
112- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
113+ #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
114+ #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
115 self.add_multiarch_paths()
116
117 # Add paths specified in the environment variables LDFLAGS and
118@@ -475,6 +476,9 @@ class PyBuildExt(build_ext):
119
120 # XXX Omitted modules: gl, pure, dl, SGI-specific modules
121
122+ lib_dirs = [ os.getenv("STAGING_LIBDIR"), os.getenv("STAGING_BASELIBDIR") ]
123+ inc_dirs = [ os.getenv("STAGING_INCDIR") ]
124+
125 #
126 # The following modules are all pretty straightforward, and compile
127 # on pretty much any POSIXish platform.
128@@ -677,8 +681,8 @@ class PyBuildExt(build_ext):
129 elif curses_library:
130 readline_libs.append(curses_library)
131 elif self.compiler.find_library_file(lib_dirs +
132- ['/usr/lib/termcap'],
133- 'termcap'):
134+ ['/usr/lib/termcap'],
135+ 'termcap'):
136 readline_libs.append('termcap')
137 exts.append( Extension('readline', ['readline.c'],
138 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 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3# We need to supply STAGING_INCDIR here, otherwise the Tk headers
4# will not be found.
5# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille.de>
6
7Index: Python-2.6.1/setup.py
8===================================================================
9--- Python-2.6.1.orig/setup.py
10+++ Python-2.6.1/setup.py
11@@ -1543,7 +1543,7 @@ class PyBuildExt(build_ext):
12 dotversion = dotversion[:-1] + '.' + dotversion[-1]
13 tcl_include_sub = []
14 tk_include_sub = []
15- for dir in inc_dirs:
16+ for dir in [os.getenv("STAGING_INCDIR")]:
17 tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
18 tk_include_sub += [dir + os.sep + "tk" + dotversion]
19 tk_include_sub += tcl_include_sub
20@@ -1562,22 +1562,6 @@ class PyBuildExt(build_ext):
21 if dir not in include_dirs:
22 include_dirs.append(dir)
23
24- # Check for various platform-specific directories
25- if platform == 'sunos5':
26- include_dirs.append('/usr/openwin/include')
27- added_lib_dirs.append('/usr/openwin/lib')
28- elif os.path.exists('/usr/X11R6/include'):
29- include_dirs.append('/usr/X11R6/include')
30- added_lib_dirs.append('/usr/X11R6/lib64')
31- added_lib_dirs.append('/usr/X11R6/lib')
32- elif os.path.exists('/usr/X11R5/include'):
33- include_dirs.append('/usr/X11R5/include')
34- added_lib_dirs.append('/usr/X11R5/lib')
35- else:
36- # Assume default location for X11
37- include_dirs.append('/usr/X11/include')
38- added_lib_dirs.append('/usr/X11/lib')
39-
40 # If Cygwin, then verify that X is installed before proceeding
41 if platform == 'cygwin':
42 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 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3# CTypes need to know the actual host we are building on.
4# Signed-Off: Michael Dietrich <mdt@emdete.de>
5
6Index: Python-2.6.1/setup.py
7===================================================================
8--- Python-2.6.1.orig/setup.py
9+++ Python-2.6.1/setup.py
10@@ -1656,16 +1656,16 @@ class PyBuildExt(build_ext):
11 ffi_configfile):
12 from distutils.dir_util import mkpath
13 mkpath(ffi_builddir)
14- config_args = []
15+ config_args = ['--host=%s' % os.environ["HOST_SYS"], ]
16
17 # Pass empty CFLAGS because we'll just append the resulting
18 # CFLAGS to Python's; -g or -O2 is to be avoided.
19- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
20- % (ffi_builddir, ffi_srcdir, " ".join(config_args))
21+ cmd = "(cd %s && autoconf -W cross) && (cd %s && env CFLAGS='' '%s/configure' %s)" \
22+ % (ffi_srcdir, ffi_builddir, ffi_srcdir, " ".join(config_args))
23
24 res = os.system(cmd)
25 if res or not os.path.exists(ffi_configfile):
26- print "Failed to configure _ctypes module"
27+ print "Failed to configure _ctypes module (res=%d) or missing conffile=%s" % ( res, ffi_configfile )
28 return False
29
30 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 @@
1Upstream-Status: Pending
2
3The poison directories patch has detected library path issue while
4compiling the python in cross environment, as seen bellow.
5
6warning: library search path "/usr/lib/termcap" is unsafe for cross-compilation
7
8This Patch fixes this issue in the python build environment.
911 Oct 2010
10Nitin A Kamble <nitin.a.kamble@intel.com>
11
122011/09/29
13Rebased for python 2.7.2
14Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
15
16Index: Python-2.7.2/setup.py
17===================================================================
18--- Python-2.7.2.orig/setup.py
19+++ Python-2.7.2/setup.py
20@@ -680,12 +680,10 @@ class PyBuildExt(build_ext):
21 pass # Issue 7384: Already linked against curses or tinfo.
22 elif curses_library:
23 readline_libs.append(curses_library)
24- elif self.compiler.find_library_file(lib_dirs +
25- ['/usr/lib/termcap'],
26+ elif self.compiler.find_library_file(lib_dirs,
27 'termcap'):
28 readline_libs.append('termcap')
29 exts.append( Extension('readline', ['readline.c'],
30- library_dirs=['/usr/lib/termcap'],
31 extra_link_args=readline_extra_link_args,
32 libraries=readline_libs) )
33 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 @@
1This fixes configure issues with recent autoconf, e.g:
2 autoreconf: Entering directory `Modules/_ctypes/libffi'
3 autoreconf: configure.ac: not using Gettext
4 autoreconf: running: aclocal --force
5 configure.ac:26: error: m4_copy: won't overwrite defined macro: _AC_ARG_VAR_PRECIOUS
6 configure.ac:26: the top level
7
8The problem is still present in python-2.6.5 but fixed in python-svn.
9
10Upstream-Status: Accepted [python-svn]
11
12Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
13Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
15Signed-off-by: Saul Wold <sgw@linux.intel.com>
16
17
182011/09/29
19Rebased for python 2.7.2
20Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
21
22
23Index: Python-2.7.2/Modules/_ctypes/libffi/Makefile.am
24===================================================================
25--- Python-2.7.2.orig/Modules/_ctypes/libffi/Makefile.am
26+++ Python-2.7.2/Modules/_ctypes/libffi/Makefile.am
27@@ -2,7 +2,7 @@
28
29 AUTOMAKE_OPTIONS = foreign subdir-objects
30
31-SUBDIRS = include testsuite man
32+SUBDIRS = include
33
34 EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
35 src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \
36@@ -34,8 +34,6 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change
37 libtool-version ChangeLog.libffi m4/libtool.m4 \
38 m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4
39
40-info_TEXINFOS = doc/libffi.texi
41-
42 ## ################################################################
43
44 ##
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 @@
1Upstream-Status: Backport
2
3Signed-off-by: Saul Wold <sgw@linux.intel.com>
4
5diff -r 9ddc63c039ba Lib/test/nullbytecert.pem
6--- /dev/null Thu Jan 01 00:00:00 1970 +0000
7+++ b/Lib/test/nullbytecert.pem Sun Aug 11 18:13:17 2013 +0200
8@@ -0,0 +1,90 @@
9+Certificate:
10+ Data:
11+ Version: 3 (0x2)
12+ Serial Number: 0 (0x0)
13+ Signature Algorithm: sha1WithRSAEncryption
14+ 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
15+ Validity
16+ Not Before: Aug 7 13:11:52 2013 GMT
17+ Not After : Aug 7 13:12:52 2013 GMT
18+ 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
19+ Subject Public Key Info:
20+ Public Key Algorithm: rsaEncryption
21+ Public-Key: (2048 bit)
22+ Modulus:
23+ 00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3:
24+ 03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97:
25+ 16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2:
26+ 88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1:
27+ 32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4:
28+ 56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8:
29+ a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02:
30+ 45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75:
31+ ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91:
32+ 90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d:
33+ 7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30:
34+ 68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7:
35+ f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12:
36+ f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5:
37+ ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb:
38+ d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f:
39+ 9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da:
40+ 2f:85
41+ Exponent: 65537 (0x10001)
42+ X509v3 extensions:
43+ X509v3 Basic Constraints: critical
44+ CA:FALSE
45+ X509v3 Subject Key Identifier:
46+ 88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C
47+ X509v3 Key Usage:
48+ Digital Signature, Non Repudiation, Key Encipherment
49+ X509v3 Subject Alternative Name:
50+ *************************************************************
51+ WARNING: The values for DNS, email and URI are WRONG. OpenSSL
52+ doesn't print the text after a NULL byte.
53+ *************************************************************
54+ 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
55+ Signature Algorithm: sha1WithRSAEncryption
56+ ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5:
57+ a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44:
58+ 3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37:
59+ 86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3:
60+ 56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86:
61+ de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac:
62+ 3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4:
63+ 60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60:
64+ d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5:
65+ 25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60:
66+ 1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6:
67+ 4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d:
68+ 0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e:
69+ 5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6:
70+ c1:ca:a9:94
71+-----BEGIN CERTIFICATE-----
72+MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx
73+DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ
74+eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg
75+RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y
76+ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw
77+NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI
78+DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv
79+ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt
80+ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq
81+hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB
82+BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j
83+pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P
84+vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv
85+KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA
86+oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL
87+08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV
88+HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E
89+BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu
90+Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251
91+bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA
92+AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9
93+i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j
94+HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk
95+kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx
96+VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
97+RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
98+-----END CERTIFICATE-----
99diff -r 9ddc63c039ba Lib/test/test_ssl.py
100--- a/Lib/test/test_ssl.py Sun Aug 11 13:04:50 2013 +0300
101+++ b/Lib/test/test_ssl.py Sun Aug 11 18:13:17 2013 +0200
102@@ -25,6 +25,7 @@
103 HOST = test_support.HOST
104 CERTFILE = None
105 SVN_PYTHON_ORG_ROOT_CERT = None
106+NULLBYTECERT = None
107
108 def handle_error(prefix):
109 exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
110@@ -123,6 +124,27 @@
111 ('DNS', 'projects.forum.nokia.com'))
112 )
113
114+ def test_parse_cert_CVE_2013_4073(self):
115+ p = ssl._ssl._test_decode_cert(NULLBYTECERT)
116+ if test_support.verbose:
117+ sys.stdout.write("\n" + pprint.pformat(p) + "\n")
118+ subject = ((('countryName', 'US'),),
119+ (('stateOrProvinceName', 'Oregon'),),
120+ (('localityName', 'Beaverton'),),
121+ (('organizationName', 'Python Software Foundation'),),
122+ (('organizationalUnitName', 'Python Core Development'),),
123+ (('commonName', 'null.python.org\x00example.org'),),
124+ (('emailAddress', 'python-dev@python.org'),))
125+ self.assertEqual(p['subject'], subject)
126+ self.assertEqual(p['issuer'], subject)
127+ self.assertEqual(p['subjectAltName'],
128+ (('DNS', 'altnull.python.org\x00example.com'),
129+ ('email', 'null@python.org\x00user@example.org'),
130+ ('URI', 'http://null.python.org\x00http://example.org'),
131+ ('IP Address', '192.0.2.1'),
132+ ('IP Address', '2001:DB8:0:0:0:0:0:1\n'))
133+ )
134+
135 def test_DER_to_PEM(self):
136 with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:
137 pem = f.read()
138@@ -1360,7 +1382,7 @@
139
140
141 def test_main(verbose=False):
142- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT
143+ global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT
144 CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
145 "keycert.pem")
146 SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
147@@ -1368,10 +1390,13 @@
148 "https_svn_python_org_root.pem")
149 NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
150 "nokia.pem")
151+ NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir,
152+ "nullbytecert.pem")
153
154 if (not os.path.exists(CERTFILE) or
155 not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
156- not os.path.exists(NOKIACERT)):
157+ not os.path.exists(NOKIACERT) or
158+ not os.path.exists(NULLBYTECERT)):
159 raise test_support.TestFailed("Can't read certificate files!")
160
161 tests = [BasicTests, BasicSocketTests]
162diff -r 9ddc63c039ba Modules/_ssl.c
163--- a/Modules/_ssl.c Sun Aug 11 13:04:50 2013 +0300
164+++ b/Modules/_ssl.c Sun Aug 11 18:13:17 2013 +0200
165@@ -741,8 +741,13 @@
166
167 /* get a rendering of each name in the set of names */
168
169+ int gntype;
170+ ASN1_STRING *as = NULL;
171+
172 name = sk_GENERAL_NAME_value(names, j);
173- if (name->type == GEN_DIRNAME) {
174+ gntype = name-> type;
175+ switch (gntype) {
176+ case GEN_DIRNAME:
177
178 /* we special-case DirName as a tuple of tuples of attributes */
179
180@@ -764,11 +769,61 @@
181 goto fail;
182 }
183 PyTuple_SET_ITEM(t, 1, v);
184+ break;
185
186- } else {
187+ case GEN_EMAIL:
188+ case GEN_DNS:
189+ case GEN_URI:
190+ /* GENERAL_NAME_print() doesn't handle NUL bytes in ASN1_string
191+ correctly. */
192+ t = PyTuple_New(2);
193+ if (t == NULL)
194+ goto fail;
195+ switch (gntype) {
196+ case GEN_EMAIL:
197+ v = PyUnicode_FromString("email");
198+ as = name->d.rfc822Name;
199+ break;
200+ case GEN_DNS:
201+ v = PyUnicode_FromString("DNS");
202+ as = name->d.dNSName;
203+ break;
204+ case GEN_URI:
205+ v = PyUnicode_FromString("URI");
206+ as = name->d.uniformResourceIdentifier;
207+ break;
208+ }
209+ if (v == NULL) {
210+ Py_DECREF(t);
211+ goto fail;
212+ }
213+ PyTuple_SET_ITEM(t, 0, v);
214+ v = PyString_FromStringAndSize((char *)ASN1_STRING_data(as),
215+ ASN1_STRING_length(as));
216+ if (v == NULL) {
217+ Py_DECREF(t);
218+ goto fail;
219+ }
220+ PyTuple_SET_ITEM(t, 1, v);
221+ break;
222
223+ default:
224 /* for everything else, we use the OpenSSL print form */
225-
226+ switch (gntype) {
227+ /* check for new general name type */
228+ case GEN_OTHERNAME:
229+ case GEN_X400:
230+ case GEN_EDIPARTY:
231+ case GEN_IPADD:
232+ case GEN_RID:
233+ break;
234+ default:
235+ if (PyErr_Warn(PyExc_RuntimeWarning,
236+ "Unknown general name type") == -1) {
237+ goto fail;
238+ }
239+ break;
240+ }
241 (void) BIO_reset(biobuf);
242 GENERAL_NAME_print(biobuf, name);
243 len = BIO_gets(biobuf, buf, sizeof(buf)-1);
244@@ -794,6 +849,7 @@
245 goto fail;
246 }
247 PyTuple_SET_ITEM(t, 1, v);
248+ break;
249 }
250
251 /* 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 @@
1
2Upstream-Status: Inappropriate [configuration]
3
4Signed-off-by: Saul Wold <sgw@linux.intel.com>
5
6Index: Python-2.7.2/Modules/Setup.dist
7===================================================================
8--- Python-2.7.2.orig/Modules/Setup.dist 2011-06-11 08:46:26.000000000 -0700
9+++ Python-2.7.2/Modules/Setup.dist 2011-12-27 15:51:41.244623219 -0800
10@@ -248,7 +248,7 @@
11 # Message-Digest Algorithm, described in RFC 1321. The necessary files
12 # md5.c and md5.h are included here.
13
14-#_md5 md5module.c md5.c
15+_md5 md5module.c md5.c
16
17
18 # 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..208c57c822
--- /dev/null
+++ b/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
@@ -0,0 +1,25 @@
1_tkinter module needs tk module along with tcl. tk is not yet integrated
2in yocto so we skip the check for this module.
3Avoid a warning by not adding this module to missing variable.
4
5Upstream-Status: Inappropriate [distribution]
6
7Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
8
9Index: Python-2.7.2/setup.py
10===================================================================
11--- Python-2.7.2.orig/setup.py 2012-04-05 23:18:38.500136647 +0300
12+++ Python-2.7.2/setup.py 2012-04-05 23:19:35.888134969 +0300
13@@ -1634,8 +1634,10 @@
14 # Call the method for detecting whether _tkinter can be compiled
15 self.detect_tkinter(inc_dirs, lib_dirs)
16
17- if '_tkinter' not in [e.name for e in self.extensions]:
18- missing.append('_tkinter')
19+ # tkinter module will not be avalaible as yocto
20+ # doesn't have tk integrated (yet)
21+ #if '_tkinter' not in [e.name for e in self.extensions]:
22+ # missing.append('_tkinter')
23
24 return missing
25
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 @@
1sunaudiodev module is sunos specific so we avoid a warning by not
2adding this module to missing variable.
3
4Upstream-Status: Inappropriate [distribution]
5
6Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
7
8Index: Python-2.7.2/setup.py
9===================================================================
10--- Python-2.7.2.orig/setup.py 2012-04-05 22:29:18.049196608 +0300
11+++ Python-2.7.2/setup.py 2012-04-05 22:29:57.505195453 +0300
12@@ -1522,8 +1522,9 @@
13 if platform == 'sunos5':
14 # SunOS specific modules
15 exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
16- else:
17- missing.append('sunaudiodev')
18+ # If platform is not sunos warning is useless
19+ #else:
20+ # missing.append('sunaudiodev')
21
22 if platform == 'darwin':
23 # _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 @@
1When cross compiling python, we used to need to install the Makefile, pyconfig.h
2and the python library to their final location before being able to compile the
3rest of python. This change allows us to point python at its own source when
4building, avoiding a variety of sysroot staging issues and simplifying the main
5python recipe.
6
7Upstream-Status: Inappropriate
8RP 2012/11/13
9
10Index: Python-2.7.3/Lib/sysconfig.py
11===================================================================
12--- Python-2.7.3.orig/Lib/sysconfig.py 2012-11-13 14:36:08.429167199 +0000
13+++ Python-2.7.3/Lib/sysconfig.py 2012-11-13 21:58:31.788551800 +0000
14@@ -93,6 +93,7 @@
15 _EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
16 _CONFIG_VARS = None
17 _USER_BASE = None
18+_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None)
19
20 def _safe_realpath(path):
21 try:
22@@ -100,7 +102,9 @@
23 except OSError:
24 return path
25
26-if sys.executable:
27+if _PYTHONBUILDDIR:
28+ _PROJECT_BASE = _PYTHONBUILDDIR
29+elif sys.executable:
30 _PROJECT_BASE = os.path.dirname(_safe_realpath(sys.executable))
31 else:
32 # sys.executable can be empty if argv[0] has been changed and Python is
33Index: Python-2.7.3/Lib/distutils/sysconfig.py
34===================================================================
35--- Python-2.7.3.orig/Lib/distutils/sysconfig.py 2012-11-13 14:36:08.005167209 +0000
36+++ Python-2.7.3/Lib/distutils/sysconfig.py 2012-11-13 22:07:05.644540695 +0000
37@@ -26,6 +26,9 @@
38 # live in project/PCBuild9. If we're dealing with an x64 Windows build,
39 # it'll live in project/PCbuild/amd64.
40 project_base = os.path.dirname(os.path.abspath(sys.executable))
41+_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None)
42+if _PYTHONBUILDDIR:
43+ project_base = _PYTHONBUILDDIR
44 if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
45 project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
46 # PC/VS7.1
47@@ -247,7 +250,7 @@
48 def get_makefile_filename():
49 """Return full pathname of installed Makefile from the Python build."""
50 if python_build:
51- return os.path.join(os.path.dirname(sys.executable), "Makefile")
52+ return os.path.join(project_base, "Makefile")
53 lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
54 return os.path.join(lib_dir, "config", "Makefile")
55
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 @@
1Lib/cgi.py: Update the script as mentioned in the comment
2
3Upstream-Status: Inappropriate [distribution]
4
5Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
6
7--- Python-2.6.6/Lib/cgi.py.orig 2010-08-01 22:14:27.000000000 -0500
8+++ Python-2.6.6/Lib/cgi.py 2011-09-21 15:28:40.478208631 -0500
9@@ -1,13 +1,4 @@
10-#! /usr/local/bin/python
11-
12-# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
13-# intentionally NOT "/usr/bin/env python". On many systems
14-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
15-# scripts, and /usr/local/bin is the default directory where Python is
16-# installed, so /usr/bin/env would be unable to find python. Granted,
17-# binary installations by Linux vendors often install Python in
18-# /usr/bin. So let those vendors patch cgi.py to match their choice
19-# of installation.
20+#! /usr/bin/env python
21
22 """Support module for CGI (Common Gateway Interface) scripts.
23
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 @@
1Author: Andrei Gherzan <andrei@gherzan.ro>
2Date: Sun Mar 25 02:02:27 2012 +0200
3
4This patch was added for 64bit host machines. In the compile process python
5is checking if platform is a 64bit platform using sys.maxint which is the host's
6value. The patch fixes this issue so that python would check if TARGET machine
7is 64bit not the HOST machine. In this way will have "dl" and "imageop" modules
8built if HOST machine is 64bit but the target machine is 32bit.
9
10Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
11
12Upstream-Status: Pending
13
14Index: Python-2.7.2/setup.py
15===================================================================
16--- Python-2.7.2.orig/setup.py 2012-03-25 01:10:41.540163187 +0200
17+++ Python-2.7.2/setup.py 2012-03-25 01:26:06.092539990 +0200
18@@ -23,6 +23,21 @@
19 # This global variable is used to hold the list of modules to be disabled.
20 disabled_module_list = []
21
22+def target_is_64bit_platform ():
23+ """
24+ In case of cross-compile, some modules are not build as setup checks if HOST
25+ is 64bit and not TARGET.
26+ As python was built for TARGET we can check this in pyconfig.h in this way:
27+ Sizeof LONG on a 32 bit platform is 4 bytes
28+ Sizeof LONG on a 64 bit platform is 8 bytes
29+ """
30+ pyconf = open("pyconfig.h").read()
31+ aux = re.search(r"#s*define\s+SIZEOF_LONG\s+8\s*", pyconf)
32+ if aux is not None:
33+ return True
34+ else:
35+ return False
36+
37 def add_dir_to_list(dirlist, dir):
38 """Add the directory 'dir' to the list 'dirlist' (at the front) if
39 1) 'dir' is not already in 'dirlist'
40@@ -628,7 +643,7 @@
41 exts.append( Extension('audioop', ['audioop.c']) )
42
43 # Disabled on 64-bit platforms
44- if sys.maxint != 9223372036854775807L:
45+ if not target_is_64bit_platform():
46 # Operations on images
47 exts.append( Extension('imageop', ['imageop.c']) )
48 else:
49@@ -1418,7 +1433,7 @@
50 missing.append('_codecs_%s' % loc)
51
52 # Dynamic loading module
53- if sys.maxint == 0x7fffffff:
54+ if not target_is_64bit_platform():
55 # This requires sizeof(int) == sizeof(long) == sizeof(char*)
56 dl_inc = find_file('dlfcn.h', [], inc_dirs)
57 if (dl_inc is not None) and (platform not in ['atheos']):
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 @@
1Add 'build-test' and 'runtest-TESTS' targets to Makefile, to build and run tests
2cross-compiled.
3
4Signed-off-by: Tudor Florea <tudor.florea@enea.com>
5Upstream-Status: Pending
6---
7diff -ruN a/Makefile.pre.in b/Makefile.pre.in
8--- a/Makefile.pre.in 2013-06-27 10:44:11.033840532 +0200
9+++ b/Makefile.pre.in 2013-06-27 10:44:39.572635273 +0200
10@@ -709,14 +709,19 @@
11 # generated bytecode. This is sometimes a very shy bug needing a lot of
12 # sample data.
13
14-TESTOPTS= -l $(EXTRATESTOPTS)
15+TESTOPTS= -l -v $(EXTRATESTOPTS)
16 TESTPROG= $(srcdir)/Lib/test/regrtest.py
17-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
18-test: all platform
19- -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
20+TESTPYTHON= $(RUNSHARED) $(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
21+test: build-test
22+ $(MAKE) runtest-TESTS
23+
24+runtest-TESTS:
25+ -find $(srcdir) -name '*.py[co]' -print | xargs rm -f
26 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
27 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
28
29+build-test: all platform
30+
31 testall: all platform
32 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
33 $(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 @@
1Upstream-Status: Inappropriate [Embedded specific]
2
3This patch fixes issuing with different libdir like lib64.
4This patch makes the native python binary modules findable
5in the install process of the host python.
6
7Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
8Date: 2012/03/14
9
10Updated for python 2.7.3
11Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
12Date: 2012/05/01
13
14Index: Python-2.7.3/Lib/sysconfig.py
15===================================================================
16--- Python-2.7.3.orig/Lib/sysconfig.py
17+++ Python-2.7.3/Lib/sysconfig.py
18@@ -7,10 +7,10 @@ from os.path import pardir, realpath
19
20 _INSTALL_SCHEMES = {
21 'posix_prefix': {
22- 'stdlib': '{base}/lib/python{py_version_short}',
23- 'platstdlib': '{platbase}/lib/python{py_version_short}',
24- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
25- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
26+ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
27+ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
28+ 'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages',
29+ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
30 'include': '{base}/include/python{py_version_short}',
31 'platinclude': '{platbase}/include/python{py_version_short}',
32 'scripts': '{base}/bin',
33@@ -65,10 +65,10 @@ _INSTALL_SCHEMES = {
34 'data' : '{userbase}',
35 },
36 'posix_user': {
37- 'stdlib': '{userbase}/lib/python{py_version_short}',
38- 'platstdlib': '{userbase}/lib/python{py_version_short}',
39- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
40- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
41+ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
42+ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
43+ 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
44+ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
45 'include': '{userbase}/include/python{py_version_short}',
46 'scripts': '{userbase}/bin',
47 'data' : '{userbase}',
48Index: Python-2.7.3/Makefile.pre.in
49===================================================================
50--- Python-2.7.3.orig/Makefile.pre.in
51+++ Python-2.7.3/Makefile.pre.in
52@@ -941,25 +941,25 @@ libinstall: build_all $(srcdir)/Lib/$(PL
53 $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
54 $(DESTDIR)$(LIBDEST)/distutils/tests ; \
55 fi
56- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
57+ PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
58 $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
59 -d $(LIBDEST) -f \
60 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
61 $(DESTDIR)$(LIBDEST)
62- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
63+ PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
64 $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
65 -d $(LIBDEST) -f \
66 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
67 $(DESTDIR)$(LIBDEST)
68- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
69+ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
70 $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
71 -d $(LIBDEST)/site-packages -f \
72 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
73- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
74+ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
75 $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
76 -d $(LIBDEST)/site-packages -f \
77 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
78- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
79+ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
80 $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
81
82 # 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 @@
1backport bug 17547 from http://hg.python.org/cpython/rev/9d50af4c482f/
2
3-Wformat is needed by gcc 4.8
4
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6
7Upstream-Status: Backport
8Index: Python-2.7.3/configure.in
9===================================================================
10--- Python-2.7.3.orig/configure.in 2013-06-11 02:22:04.186529212 -0700
11+++ Python-2.7.3/configure.in 2013-06-13 02:17:06.324403327 -0700
12@@ -1196,7 +1196,7 @@
13 then
14 AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
15 save_CFLAGS=$CFLAGS
16- CFLAGS="$CFLAGS -Werror"
17+ CFLAGS="$CFLAGS -Werror -Wformat"
18 AC_COMPILE_IFELSE([
19 AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]])
20 ],[
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 @@
1when building python for qemux86-64 on ubuntu 11.10/64bit
2it gropes into host includes and then mixes them with cross
3includes and as a result some modules fail to compile and link
4one of the modules is python-elementtree which is then not
5found during image creation
6
7Proble is that setup.py tries to add native includes that newer
8ubuntu has introduced for multiarch support. But that should
9only happen for native builds and not cross building python
10so we add a check here.
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13Upstream-Status: Pending
14
15Index: Python-2.7.2/setup.py
16===================================================================
17--- Python-2.7.2.orig/setup.py 2012-02-03 12:10:42.307057756 -0800
18+++ Python-2.7.2/setup.py 2012-02-03 12:11:12.363059210 -0800
19@@ -360,6 +360,8 @@
20 # https://wiki.ubuntu.com/MultiarchSpec
21 if not find_executable('dpkg-architecture'):
22 return
23+ if os.environ.get('CROSS_COMPILE') is not None:
24+ return
25 tmpfile = os.path.join(self.build_temp, 'multiarch')
26 if not os.path.exists(self.build_temp):
27 os.makedirs(self.build_temp)
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 @@
1commit 248279e54467a8cd5cde98fc124d1d1384703513
2Author: Yu Ke <ke.yu@intel.com>
3Date: Tue Jun 28 21:21:29 2011 +0800
4
5 SUSE patch for the lib64 issue
6
7 see detail in http://bugs.python.org/issue1294959
8
9 also rebased a bit for Yocto python 2.6.6
10
11 Picked-by: Yu Ke <ke.yu@intel.com>
12
132011/09/29
14Rebased for python 2.7.2
15
16Upstream-Status: Inappropriate [configuration]
17
18Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
19
20Index: Python-2.7.2/Include/pythonrun.h
21===================================================================
22--- Python-2.7.2.orig/Include/pythonrun.h
23+++ Python-2.7.2/Include/pythonrun.h
24@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
25 /* In their own files */
26 PyAPI_FUNC(const char *) Py_GetVersion(void);
27 PyAPI_FUNC(const char *) Py_GetPlatform(void);
28+PyAPI_FUNC(const char *) Py_GetLib(void);
29 PyAPI_FUNC(const char *) Py_GetCopyright(void);
30 PyAPI_FUNC(const char *) Py_GetCompiler(void);
31 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
32Index: Python-2.7.2/Lib/distutils/command/install.py
33===================================================================
34--- Python-2.7.2.orig/Lib/distutils/command/install.py
35+++ Python-2.7.2/Lib/distutils/command/install.py
36@@ -22,6 +22,8 @@ from site import USER_BASE
37 from site import USER_SITE
38
39
40+libname = sys.lib
41+
42 if sys.version < "2.2":
43 WINDOWS_SCHEME = {
44 'purelib': '$base',
45@@ -42,7 +44,7 @@ else:
46 INSTALL_SCHEMES = {
47 'unix_prefix': {
48 'purelib': '$base/lib/python$py_version_short/site-packages',
49- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
50+ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
51 'headers': '$base/include/python$py_version_short/$dist_name',
52 'scripts': '$base/bin',
53 'data' : '$base',
54Index: Python-2.7.2/Lib/distutils/sysconfig.py
55===================================================================
56--- Python-2.7.2.orig/Lib/distutils/sysconfig.py
57+++ Python-2.7.2/Lib/distutils/sysconfig.py
58@@ -114,8 +114,11 @@ def get_python_lib(plat_specific=0, stan
59 prefix = plat_specific and EXEC_PREFIX or PREFIX
60
61 if os.name == "posix":
62- libpython = os.path.join(prefix,
63- "lib", "python" + get_python_version())
64+ if plat_specific or standard_lib:
65+ lib = sys.lib
66+ else:
67+ lib = "lib"
68+ libpython = os.path.join(prefix, lib, "python" + get_python_version())
69 if standard_lib:
70 return libpython
71 else:
72Index: Python-2.7.2/Lib/pydoc.py
73===================================================================
74--- Python-2.7.2.orig/Lib/pydoc.py
75+++ Python-2.7.2/Lib/pydoc.py
76@@ -352,7 +352,7 @@ class Doc:
77
78 docloc = os.environ.get("PYTHONDOCS",
79 "http://docs.python.org/library")
80- basedir = os.path.join(sys.exec_prefix, "lib",
81+ basedir = os.path.join(sys.exec_prefix, sys.lib,
82 "python"+sys.version[0:3])
83 if (isinstance(object, type(os)) and
84 (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
85Index: Python-2.7.2/Lib/site.py
86===================================================================
87--- Python-2.7.2.orig/Lib/site.py
88+++ Python-2.7.2/Lib/site.py
89@@ -300,13 +300,19 @@ def getsitepackages():
90 if sys.platform in ('os2emx', 'riscos'):
91 sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
92 elif os.sep == '/':
93- sitepackages.append(os.path.join(prefix, "lib",
94+ sitepackages.append(os.path.join(prefix, sys.lib,
95 "python" + sys.version[:3],
96 "site-packages"))
97- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
98+ if sys.lib != "lib":
99+ sitepackages.append(os.path.join(prefix, "lib",
100+ "python" + sys.version[:3],
101+ "site-packages"))
102+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
103+ if sys.lib != "lib":
104+ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
105 else:
106 sitepackages.append(prefix)
107- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
108+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
109 if sys.platform == "darwin":
110 # for framework builds *only* we add the standard Apple
111 # locations.
112Index: Python-2.7.2/Lib/test/test_dl.py
113===================================================================
114--- Python-2.7.2.orig/Lib/test/test_dl.py
115+++ Python-2.7.2/Lib/test/test_dl.py
116@@ -5,10 +5,11 @@
117 import unittest
118 from test.test_support import verbose, import_module
119 dl = import_module('dl', deprecated=True)
120+import sys
121
122 sharedlibs = [
123- ('/usr/lib/libc.so', 'getpid'),
124- ('/lib/libc.so.6', 'getpid'),
125+ ('/usr/'+sys.lib+'/libc.so', 'getpid'),
126+ ('/'+sys.lib+'/libc.so.6', 'getpid'),
127 ('/usr/bin/cygwin1.dll', 'getpid'),
128 ('/usr/lib/libc.dylib', 'getpid'),
129 ]
130Index: Python-2.7.2/Lib/trace.py
131===================================================================
132--- Python-2.7.2.orig/Lib/trace.py
133+++ Python-2.7.2/Lib/trace.py
134@@ -762,10 +762,10 @@ def main(argv=None):
135 # should I also call expanduser? (after all, could use $HOME)
136
137 s = s.replace("$prefix",
138- os.path.join(sys.prefix, "lib",
139+ os.path.join(sys.prefix, sys.lib,
140 "python" + sys.version[:3]))
141 s = s.replace("$exec_prefix",
142- os.path.join(sys.exec_prefix, "lib",
143+ os.path.join(sys.exec_prefix, sys.lib,
144 "python" + sys.version[:3]))
145 s = os.path.normpath(s)
146 ignore_dirs.append(s)
147Index: Python-2.7.2/Makefile.pre.in
148===================================================================
149--- Python-2.7.2.orig/Makefile.pre.in
150+++ Python-2.7.2/Makefile.pre.in
151@@ -81,6 +81,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
152
153 # Machine-dependent subdirectories
154 MACHDEP= @MACHDEP@
155+LIB= @LIB@
156
157 # Install prefix for architecture-independent files
158 prefix= @prefix@
159@@ -97,7 +98,7 @@ LIBDIR= @libdir@
160 MANDIR= @mandir@
161 INCLUDEDIR= @includedir@
162 CONFINCLUDEDIR= $(exec_prefix)/include
163-SCRIPTDIR= $(prefix)/lib
164+SCRIPTDIR= $(prefix)/@LIB@
165
166 # Detailed destination directories
167 BINLIBDEST= $(LIBDIR)/python$(VERSION)
168@@ -533,6 +534,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
169 -DEXEC_PREFIX='"$(exec_prefix)"' \
170 -DVERSION='"$(VERSION)"' \
171 -DVPATH='"$(VPATH)"' \
172+ -DLIB='"$(LIB)"' \
173 -o $@ $(srcdir)/Modules/getpath.c
174
175 Modules/python.o: $(srcdir)/Modules/python.c
176@@ -567,7 +569,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
177 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
178
179 Python/getplatform.o: $(srcdir)/Python/getplatform.c
180- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
181+ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
182
183 Python/importdl.o: $(srcdir)/Python/importdl.c
184 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
185Index: Python-2.7.2/Modules/getpath.c
186===================================================================
187--- Python-2.7.2.orig/Modules/getpath.c
188+++ Python-2.7.2/Modules/getpath.c
189@@ -116,9 +116,11 @@
190 #define EXEC_PREFIX PREFIX
191 #endif
192
193+#define LIB_PYTHON LIB "/python" VERSION
194+
195 #ifndef PYTHONPATH
196-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
197- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
198+#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
199+ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
200 #endif
201
202 #ifndef LANDMARK
203@@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1];
204 static char exec_prefix[MAXPATHLEN+1];
205 static char progpath[MAXPATHLEN+1];
206 static char *module_search_path = NULL;
207-static char lib_python[] = "lib/python" VERSION;
208+static char lib_python[] = LIB_PYTHON;
209
210 static void
211 reduce(char *dir)
212Index: Python-2.7.2/Python/getplatform.c
213===================================================================
214--- Python-2.7.2.orig/Python/getplatform.c
215+++ Python-2.7.2/Python/getplatform.c
216@@ -10,3 +10,13 @@ Py_GetPlatform(void)
217 {
218 return PLATFORM;
219 }
220+
221+#ifndef LIB
222+#define LIB "lib"
223+#endif
224+
225+const char *
226+Py_GetLib(void)
227+{
228+ return LIB;
229+}
230Index: Python-2.7.2/Python/sysmodule.c
231===================================================================
232--- Python-2.7.2.orig/Python/sysmodule.c
233+++ Python-2.7.2/Python/sysmodule.c
234@@ -1416,6 +1416,8 @@ _PySys_Init(void)
235 PyString_FromString(Py_GetCopyright()));
236 SET_SYS_FROM_STRING("platform",
237 PyString_FromString(Py_GetPlatform()));
238+ SET_SYS_FROM_STRING("lib",
239+ PyString_FromString(Py_GetLib()));
240 SET_SYS_FROM_STRING("executable",
241 PyString_FromString(Py_GetProgramFullPath()));
242 SET_SYS_FROM_STRING("prefix",
243Index: Python-2.7.2/configure.in
244===================================================================
245--- Python-2.7.2.orig/configure.in
246+++ Python-2.7.2/configure.in
247@@ -629,6 +629,10 @@ SunOS*)
248 ;;
249 esac
250
251+AC_SUBST(LIB)
252+AC_MSG_CHECKING(LIB)
253+LIB=`basename ${libdir}`
254+AC_MSG_RESULT($LIB)
255
256 AC_SUBST(LIBRARY)
257 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 @@
1When using make -j with the 'install' target, it's possible for altbininstall
2(which normally creates BINDIR) and libainstall (which doesn't, though it
3installs python-config there) to race, resulting in a failure due to
4attempting to install python-config into a nonexistent BINDIR. Ensure it also
5exists in the libainstall target.
6
7Upstream-Status: Pending
8
9--- Python-2.7.3.orig/Makefile.pre.in
10+++ Python-2.7.3/Makefile.pre.in
11@@ -1008,7 +1008,7 @@ LIBPL= $(LIBP)/config
12 LIBPC= $(LIBDIR)/pkgconfig
13
14 libainstall: all python-config
15- @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
16+ @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC) $(BINDIR); \
17 do \
18 if test ! -d $(DESTDIR)$$i; then \
19 echo "Creating directory $$i"; \
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 @@
1# HG changeset patch
2# User Philip Jenvey <pjenvey@underboss.org>
3# Date 1322701507 28800
4# Branch 2.7
5# Node ID e7c20a8476a0e2ca18f8040864cbc400818d8f24
6# Parent 3ecddf168f1f554a17a047384fe0b02f2d688277
7create the .pypirc securely
8
9Upstream-Status: Backport
10
11Signed-off-by: Saul Wold <sgw@linux.intel.com>
12
13
14diff -r 3ecddf168f1f -r e7c20a8476a0 Lib/distutils/config.py
15--- a/Lib/distutils/config.py Tue Nov 29 00:53:09 2011 +0100
16+++ b/Lib/distutils/config.py Wed Nov 30 17:05:07 2011 -0800
17@@ -42,16 +42,8 @@
18 def _store_pypirc(self, username, password):
19 """Creates a default .pypirc file."""
20 rc = self._get_rc_file()
21- f = open(rc, 'w')
22- try:
23- f.write(DEFAULT_PYPIRC % (username, password))
24- finally:
25- f.close()
26- try:
27- os.chmod(rc, 0600)
28- except OSError:
29- # should do something better here
30- pass
31+ with os.fdopen(os.open(rc, os.O_CREAT | os.O_WRONLY, 0600), 'w') as fp:
32+ fp.write(DEFAULT_PYPIRC % (username, password))
33
34 def _read_pypirc(self):
35 """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 @@
1Upstream-Status: Backport
2
3Reference:http://bugs.python.org/issue14579
4
5The utf-16 decoder in Python 3.1 through 3.3 does not update the
6aligned_end variable after calling the unicode_decode_call_errorhandler
7function, which allows remote attackers to obtain sensitive information
8(process memory) or cause a denial of service (memory corruption and crash)
9via unspecified vectors.
10
11http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-2135
12
13diff -urpN a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
14--- a/Lib/test/test_codecs.py
15+++ b/Lib/test/test_codecs.py
16@@ -495,8 +495,21 @@ class UTF16LETest(ReadTest):
17 )
18
19 def test_errors(self):
20- self.assertRaises(UnicodeDecodeError, codecs.utf_16_le_decode, "\xff", "strict", True)
21-
22+ tests = [
23+ (b'\xff', u'\ufffd'),
24+ (b'A\x00Z', u'A\ufffd'),
25+ (b'A\x00B\x00C\x00D\x00Z', u'ABCD\ufffd'),
26+ (b'\x00\xd8', u'\ufffd'),
27+ (b'\x00\xd8A', u'\ufffd'),
28+ (b'\x00\xd8A\x00', u'\ufffdA'),
29+ (b'\x00\xdcA\x00', u'\ufffdA'),
30+ ]
31+ for raw, expected in tests:
32+ print('*****', raw, expected)
33+ self.assertRaises(UnicodeDecodeError, codecs.utf_16_le_decode,
34+ raw, 'strict', True)
35+ self.assertEqual(raw.decode('utf-16le', 'replace'), expected)
36+
37 class UTF16BETest(ReadTest):
38 encoding = "utf-16-be"
39
40@@ -516,7 +529,20 @@ class UTF16BETest(ReadTest):
41 )
42
43 def test_errors(self):
44- self.assertRaises(UnicodeDecodeError, codecs.utf_16_be_decode, "\xff", "strict", True)
45+ tests = [
46+ (b'\xff', u'\ufffd'),
47+ (b'\x00A\xff', u'A\ufffd'),
48+ (b'\x00A\x00B\x00C\x00DZ', u'ABCD\ufffd'),
49+ (b'\xd8\x00', u'\ufffd'),
50+ (b'\xd8\x00\xdc', u'\ufffd'),
51+ (b'\xd8\x00\x00A', u'\ufffdA'),
52+ (b'\xdc\x00\x00A', u'\ufffdA'),
53+ ]
54+ for raw, expected in tests:
55+ print('*****', raw, expected)
56+ self.assertRaises(UnicodeDecodeError, codecs.utf_16_be_decode,
57+ raw, 'strict', True)
58+ self.assertEqual(raw.decode('utf-16be', 'replace'), expected)
59
60 class UTF8Test(ReadTest):
61 encoding = "utf-8"
62diff -urpN a/Objects/unicodeobject.c b/Objects/unicodeobject.c
63--- a/Objects/unicodeobject.c 2013-03-04 11:34:34.000000000 +0800
64+++ b/Objects/unicodeobject.c 2013-03-04 11:36:01.000000000 +0800
65@@ -2564,7 +2564,7 @@ PyUnicode_DecodeUTF16Stateful(const char
66 }
67
68 /* UTF-16 code pair: */
69- if (q >= e) {
70+ if (e - q < 2) {
71 errmsg = "unexpected end of data";
72 startinpos = (((const char *)q)-2)-starts;
73 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 @@
1Upstream-Status: Backport
2
3Reference: http://bugs.python.org/issue16042
4
5CVE-2013-1752: smtplib: Limit amount of data read by limiting the
6call to readline(). Original patch by Christian Heimes
7
8Signed-off-by: Maxin B. John <maxin.john@enea.com>
9---
10diff -Naur Python-2.7.3-orig/Lib/smtplib.py Python-2.7.3/Lib/smtplib.py
11--- Python-2.7.3-orig/Lib/smtplib.py 2012-04-10 01:07:31.000000000 +0200
12+++ Python-2.7.3/Lib/smtplib.py 2014-02-27 14:15:24.444198465 +0100
13@@ -57,6 +57,7 @@
14 SMTP_PORT = 25
15 SMTP_SSL_PORT = 465
16 CRLF = "\r\n"
17+_MAXLINE = 8192 # more than 8 times larger than RFC 821, 4.5.3
18
19 OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I)
20
21@@ -179,10 +180,14 @@
22 def __init__(self, sslobj):
23 self.sslobj = sslobj
24
25- def readline(self):
26+ def readline(self, size=-1):
27+ if size < 0:
28+ size = None
29 str = ""
30 chr = None
31 while chr != "\n":
32+ if size is not None and len(str) >= size:
33+ break
34 chr = self.sslobj.read(1)
35 if not chr:
36 break
37@@ -351,7 +356,7 @@
38 self.file = self.sock.makefile('rb')
39 while 1:
40 try:
41- line = self.file.readline()
42+ line = self.file.readline(_MAXLINE + 1)
43 except socket.error as e:
44 self.close()
45 raise SMTPServerDisconnected("Connection unexpectedly closed: "
46@@ -361,6 +366,8 @@
47 raise SMTPServerDisconnected("Connection unexpectedly closed")
48 if self.debuglevel > 0:
49 print>>stderr, 'reply:', repr(line)
50+ if len(line) > _MAXLINE:
51+ raise SMTPResponseException(500, "Line too long.")
52 resp.append(line[4:].strip())
53 code = line[:3]
54 # Check that the error code is syntactically correct.
55diff -Naur Python-2.7.3-orig/Lib/test/test_smtplib.py Python-2.7.3/Lib/test/test_smtplib.py
56--- Python-2.7.3-orig/Lib/test/test_smtplib.py 2012-04-10 01:07:32.000000000 +0200
57+++ Python-2.7.3/Lib/test/test_smtplib.py 2014-02-27 14:15:24.448198293 +0100
58@@ -292,6 +292,33 @@
59 HOST, self.port, 'localhost', 3)
60
61
62+@unittest.skipUnless(threading, 'Threading required for this test.')
63+class TooLongLineTests(unittest.TestCase):
64+ respdata = '250 OK' + ('.' * smtplib._MAXLINE * 2) + '\n'
65+
66+ def setUp(self):
67+ self.old_stdout = sys.stdout
68+ self.output = StringIO.StringIO()
69+ sys.stdout = self.output
70+
71+ self.evt = threading.Event()
72+ self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
73+ self.sock.settimeout(15)
74+ self.port = test_support.bind_port(self.sock)
75+ servargs = (self.evt, self.respdata, self.sock)
76+ threading.Thread(target=server, args=servargs).start()
77+ self.evt.wait()
78+ self.evt.clear()
79+
80+ def tearDown(self):
81+ self.evt.wait()
82+ sys.stdout = self.old_stdout
83+
84+ def testLineTooLong(self):
85+ self.assertRaises(smtplib.SMTPResponseException, smtplib.SMTP,
86+ HOST, self.port, 'localhost', 3)
87+
88+
89 sim_users = {'Mr.A@somewhere.com':'John A',
90 'Ms.B@somewhere.com':'Sally B',
91 'Mrs.C@somewhereesle.com':'Ruth C',
92@@ -511,7 +538,8 @@
93 def test_main(verbose=None):
94 test_support.run_unittest(GeneralTests, DebuggingServerTests,
95 NonConnectingTests,
96- BadHELOServerTests, SMTPSimTests)
97+ BadHELOServerTests, SMTPSimTests,
98+ TooLongLineTests)
99
100 if __name__ == '__main__':
101 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 @@
1Upstream-Status: Backport
2
3Reference: http://bugs.python.org/issue20246
4
5CVE-2014-1912: Python buffer overflow in socket.recvfrom_into()
6lets remote users execute arbitrary code.Original patch by Benjamin Peterson
7
8Signed-off-by: Maxin B. John <maxin.john@enea.com>
9---
10diff -r 40fb60df4755 Modules/socketmodule.c
11--- a/Modules/socketmodule.c Sun Jan 12 12:11:47 2014 +0200
12+++ b/Modules/socketmodule.c Mon Jan 13 16:36:35 2014 -0800
13@@ -2744,6 +2744,13 @@
14 recvlen = buflen;
15 }
16
17+ /* Check if the buffer is large enough */
18+ if (buflen < recvlen) {
19+ PyErr_SetString(PyExc_ValueError,
20+ "buffer too small for requested bytes");
21+ goto error;
22+ }
23+
24 readlen = sock_recvfrom_guts(s, buf.buf, recvlen, flags, &addr);
25 if (readlen < 0) {
26 /* Return an error */
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 @@
1Upstream-Status: Inappropriate [not author]
2
3Fix to support db 5.3 for bsddb module in python 2.7.2
4
5This patch is made from the db5.1.diff in
6http://archive.ubuntu.com/ubuntu/pool/main/p/python2.7/python2.7_2.7.3-0ubuntu3.diff.gz
7
8Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
9---
10 Lib/bsddb/__init__.py | 2 +-
11 Lib/bsddb/test/test_all.py | 5 +-
12 Lib/bsddb/test/test_dbenv.py | 29 +++-
13 Modules/_bsddb.c | 439 +++++++++++++++++++++++-------------------
14 Modules/bsddb.h | 20 +-
15 setup.py | 25 +++-
16 6 files changed, 307 insertions(+), 213 deletions(-)
17
18diff --git a/Lib/bsddb/__init__.py b/Lib/bsddb/__init__.py
19index ed4deea..1b1c388 100644
20--- a/Lib/bsddb/__init__.py
21+++ b/Lib/bsddb/__init__.py
22@@ -33,7 +33,7 @@
23 #----------------------------------------------------------------------
24
25
26-"""Support for Berkeley DB 4.1 through 4.8 with a simple interface.
27+"""Support for Berkeley DB 4.2 through 5.3 with a simple interface.
28
29 For the full featured object oriented interface use the bsddb.db module
30 instead. It mirrors the Oracle Berkeley DB C API.
31diff --git a/Lib/bsddb/test/test_all.py b/Lib/bsddb/test/test_all.py
32index e9fe618..6a25f4a 100644
33--- a/Lib/bsddb/test/test_all.py
34+++ b/Lib/bsddb/test/test_all.py
35@@ -484,6 +484,8 @@ def print_versions():
36 print '-=' * 38
37 print db.DB_VERSION_STRING
38 print 'bsddb.db.version(): %s' % (db.version(), )
39+ if db.version() >= (5, 0) :
40+ print 'bsddb.db.full_version(): %s' %repr(db.full_version())
41 print 'bsddb.db.__version__: %s' % db.__version__
42 print 'bsddb.db.cvsid: %s' % db.cvsid
43
44@@ -528,7 +530,8 @@ def get_new_database_path() :
45
46 # This path can be overriden via "set_test_path_prefix()".
47 import os, os.path
48-get_new_path.prefix=os.path.join(os.sep,"tmp","z-Berkeley_DB")
49+get_new_path.prefix=os.path.join(os.environ.get("TMPDIR",
50+ os.path.join(os.sep,"tmp")), "z-Berkeley_DB")
51 get_new_path.num=0
52
53 def get_test_path_prefix() :
54diff --git a/Lib/bsddb/test/test_dbenv.py b/Lib/bsddb/test/test_dbenv.py
55index 37281df..6ac1e54 100644
56--- a/Lib/bsddb/test/test_dbenv.py
57+++ b/Lib/bsddb/test/test_dbenv.py
58@@ -25,12 +25,31 @@ class DBEnv(unittest.TestCase):
59 test_support.rmtree(self.homeDir)
60
61 class DBEnv_general(DBEnv) :
62+ def test_get_open_flags(self) :
63+ flags = db.DB_CREATE | db.DB_INIT_MPOOL
64+ self.env.open(self.homeDir, flags)
65+ self.assertEqual(flags, self.env.get_open_flags())
66+
67+ def test_get_open_flags2(self) :
68+ flags = db.DB_CREATE | db.DB_INIT_MPOOL | \
69+ db.DB_INIT_LOCK | db.DB_THREAD
70+ self.env.open(self.homeDir, flags)
71+ self.assertEqual(flags, self.env.get_open_flags())
72+
73 if db.version() >= (4, 7) :
74 def test_lk_partitions(self) :
75 for i in [10, 20, 40] :
76 self.env.set_lk_partitions(i)
77 self.assertEqual(i, self.env.get_lk_partitions())
78
79+ def test_getset_intermediate_dir_mode(self) :
80+ self.assertEqual(None, self.env.get_intermediate_dir_mode())
81+ for mode in ["rwx------", "rw-rw-rw-", "rw-r--r--"] :
82+ self.env.set_intermediate_dir_mode(mode)
83+ self.assertEqual(mode, self.env.get_intermediate_dir_mode())
84+ self.assertRaises(db.DBInvalidArgError,
85+ self.env.set_intermediate_dir_mode, "abcde")
86+
87 if db.version() >= (4, 6) :
88 def test_thread(self) :
89 for i in [16, 100, 1000] :
90@@ -115,7 +134,7 @@ class DBEnv_general(DBEnv) :
91 self.assertEqual(i, self.env.get_lk_max_lockers())
92
93 def test_lg_regionmax(self) :
94- for i in [128, 256, 1024] :
95+ for i in [128, 256, 1000] :
96 i = i*1024*1024
97 self.env.set_lg_regionmax(i)
98 j = self.env.get_lg_regionmax()
99@@ -172,8 +191,12 @@ class DBEnv_general(DBEnv) :
100 self.env.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL)
101 cachesize = (0, 2*1024*1024, 1)
102 self.assertRaises(db.DBInvalidArgError,
103- self.env.set_cachesize, *cachesize)
104- self.assertEqual(cachesize2, self.env.get_cachesize())
105+ self.env.set_cachesize, *cachesize)
106+ cachesize3 = self.env.get_cachesize()
107+ self.assertEqual(cachesize2[0], cachesize3[0])
108+ self.assertEqual(cachesize2[2], cachesize3[2])
109+ # In Berkeley DB 5.3, the cachesize can change when opening the Env
110+ self.assertTrue(cachesize2[1] <= cachesize3[1])
111
112 def test_set_cachesize_dbenv_db(self) :
113 # You can not configure the cachesize using
114diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
115index d2d12ff..e98e4bc 100644
116--- a/Modules/_bsddb.c
117+++ b/Modules/_bsddb.c
118@@ -187,8 +187,10 @@ static PyObject* DBOldVersionError; /* DB_OLD_VERSION */
119 static PyObject* DBRunRecoveryError; /* DB_RUNRECOVERY */
120 static PyObject* DBVerifyBadError; /* DB_VERIFY_BAD */
121 static PyObject* DBNoServerError; /* DB_NOSERVER */
122+#if (DBVER < 52)
123 static PyObject* DBNoServerHomeError; /* DB_NOSERVER_HOME */
124 static PyObject* DBNoServerIDError; /* DB_NOSERVER_ID */
125+#endif
126 static PyObject* DBPageNotFoundError; /* DB_PAGE_NOTFOUND */
127 static PyObject* DBSecondaryBadError; /* DB_SECONDARY_BAD */
128
129@@ -202,9 +204,7 @@ static PyObject* DBFileExistsError; /* EEXIST */
130 static PyObject* DBNoSuchFileError; /* ENOENT */
131 static PyObject* DBPermissionsError; /* EPERM */
132
133-#if (DBVER >= 42)
134 static PyObject* DBRepHandleDeadError; /* DB_REP_HANDLE_DEAD */
135-#endif
136 #if (DBVER >= 44)
137 static PyObject* DBRepLockoutError; /* DB_REP_LOCKOUT */
138 #endif
139@@ -696,8 +696,10 @@ static int makeDBError(int err)
140 case DB_RUNRECOVERY: errObj = DBRunRecoveryError; break;
141 case DB_VERIFY_BAD: errObj = DBVerifyBadError; break;
142 case DB_NOSERVER: errObj = DBNoServerError; break;
143+#if (DBVER < 52)
144 case DB_NOSERVER_HOME: errObj = DBNoServerHomeError; break;
145 case DB_NOSERVER_ID: errObj = DBNoServerIDError; break;
146+#endif
147 case DB_PAGE_NOTFOUND: errObj = DBPageNotFoundError; break;
148 case DB_SECONDARY_BAD: errObj = DBSecondaryBadError; break;
149 case DB_BUFFER_SMALL: errObj = DBNoMemoryError; break;
150@@ -715,9 +717,7 @@ static int makeDBError(int err)
151 case ENOENT: errObj = DBNoSuchFileError; break;
152 case EPERM : errObj = DBPermissionsError; break;
153
154-#if (DBVER >= 42)
155 case DB_REP_HANDLE_DEAD : errObj = DBRepHandleDeadError; break;
156-#endif
157 #if (DBVER >= 44)
158 case DB_REP_LOCKOUT : errObj = DBRepLockoutError; break;
159 #endif
160@@ -2132,7 +2132,7 @@ DB_get_size(DBObject* self, PyObject* args, PyObject* kwargs)
161 MYDB_BEGIN_ALLOW_THREADS;
162 err = self->db->get(self->db, txn, &key, &data, flags);
163 MYDB_END_ALLOW_THREADS;
164- if (err == DB_BUFFER_SMALL) {
165+ if ((err == DB_BUFFER_SMALL) || (err == 0)) {
166 retval = NUMBER_FromLong((long)data.size);
167 err = 0;
168 }
169@@ -2385,9 +2385,7 @@ DB_open(DBObject* self, PyObject* args, PyObject* kwargs)
170 return NULL;
171 }
172
173-#if (DBVER >= 42)
174 self->db->get_flags(self->db, &self->setflags);
175-#endif
176
177 self->flags = flags;
178
179@@ -2539,6 +2537,37 @@ DB_get_priority(DBObject* self)
180 #endif
181
182 static PyObject*
183+DB_get_dbname(DBObject* self)
184+{
185+ int err;
186+ const char *filename, *dbname;
187+
188+ CHECK_DB_NOT_CLOSED(self);
189+
190+ MYDB_BEGIN_ALLOW_THREADS;
191+ err = self->db->get_dbname(self->db, &filename, &dbname);
192+ MYDB_END_ALLOW_THREADS;
193+ RETURN_IF_ERR();
194+ /* If "dbname==NULL", it is correctly converted to "None" */
195+ return Py_BuildValue("(ss)", filename, dbname);
196+}
197+
198+static PyObject*
199+DB_get_open_flags(DBObject* self)
200+{
201+ int err;
202+ unsigned int flags;
203+
204+ CHECK_DB_NOT_CLOSED(self);
205+
206+ MYDB_BEGIN_ALLOW_THREADS;
207+ err = self->db->get_open_flags(self->db, &flags);
208+ MYDB_END_ALLOW_THREADS;
209+ RETURN_IF_ERR();
210+ return NUMBER_FromLong(flags);
211+}
212+
213+static PyObject*
214 DB_set_q_extentsize(DBObject* self, PyObject* args)
215 {
216 int err;
217@@ -2555,7 +2584,6 @@ DB_set_q_extentsize(DBObject* self, PyObject* args)
218 RETURN_NONE();
219 }
220
221-#if (DBVER >= 42)
222 static PyObject*
223 DB_get_q_extentsize(DBObject* self)
224 {
225@@ -2570,7 +2598,6 @@ DB_get_q_extentsize(DBObject* self)
226 RETURN_IF_ERR();
227 return NUMBER_FromLong(extentsize);
228 }
229-#endif
230
231 static PyObject*
232 DB_set_bt_minkey(DBObject* self, PyObject* args)
233@@ -2588,7 +2615,6 @@ DB_set_bt_minkey(DBObject* self, PyObject* args)
234 RETURN_NONE();
235 }
236
237-#if (DBVER >= 42)
238 static PyObject*
239 DB_get_bt_minkey(DBObject* self)
240 {
241@@ -2603,7 +2629,6 @@ DB_get_bt_minkey(DBObject* self)
242 RETURN_IF_ERR();
243 return NUMBER_FromLong(bt_minkey);
244 }
245-#endif
246
247 static int
248 _default_cmp(const DBT *leftKey,
249@@ -2759,7 +2784,6 @@ DB_set_cachesize(DBObject* self, PyObject* args)
250 RETURN_NONE();
251 }
252
253-#if (DBVER >= 42)
254 static PyObject*
255 DB_get_cachesize(DBObject* self)
256 {
257@@ -2777,7 +2801,6 @@ DB_get_cachesize(DBObject* self)
258
259 return Py_BuildValue("(iii)", gbytes, bytes, ncache);
260 }
261-#endif
262
263 static PyObject*
264 DB_set_flags(DBObject* self, PyObject* args)
265@@ -2797,7 +2820,6 @@ DB_set_flags(DBObject* self, PyObject* args)
266 RETURN_NONE();
267 }
268
269-#if (DBVER >= 42)
270 static PyObject*
271 DB_get_flags(DBObject* self)
272 {
273@@ -2812,6 +2834,35 @@ DB_get_flags(DBObject* self)
274 RETURN_IF_ERR();
275 return NUMBER_FromLong(flags);
276 }
277+
278+#if (DBVER >= 43)
279+static PyObject*
280+DB_get_transactional(DBObject* self)
281+{
282+ int err;
283+
284+ CHECK_DB_NOT_CLOSED(self);
285+
286+ MYDB_BEGIN_ALLOW_THREADS;
287+ err = self->db->get_transactional(self->db);
288+ MYDB_END_ALLOW_THREADS;
289+
290+ if(err == 0) {
291+ Py_INCREF(Py_False);
292+ return Py_False;
293+ } else if(err == 1) {
294+ Py_INCREF(Py_True);
295+ return Py_True;
296+ }
297+
298+ /*
299+ ** If we reach there, there was an error. The
300+ ** "return" should be unreachable.
301+ */
302+ RETURN_IF_ERR();
303+ assert(0); /* This coude SHOULD be unreachable */
304+ return NULL;
305+}
306 #endif
307
308 static PyObject*
309@@ -2830,7 +2881,6 @@ DB_set_h_ffactor(DBObject* self, PyObject* args)
310 RETURN_NONE();
311 }
312
313-#if (DBVER >= 42)
314 static PyObject*
315 DB_get_h_ffactor(DBObject* self)
316 {
317@@ -2845,7 +2895,6 @@ DB_get_h_ffactor(DBObject* self)
318 RETURN_IF_ERR();
319 return NUMBER_FromLong(ffactor);
320 }
321-#endif
322
323 static PyObject*
324 DB_set_h_nelem(DBObject* self, PyObject* args)
325@@ -2863,7 +2912,6 @@ DB_set_h_nelem(DBObject* self, PyObject* args)
326 RETURN_NONE();
327 }
328
329-#if (DBVER >= 42)
330 static PyObject*
331 DB_get_h_nelem(DBObject* self)
332 {
333@@ -2878,7 +2926,6 @@ DB_get_h_nelem(DBObject* self)
334 RETURN_IF_ERR();
335 return NUMBER_FromLong(nelem);
336 }
337-#endif
338
339 static PyObject*
340 DB_set_lorder(DBObject* self, PyObject* args)
341@@ -2896,7 +2943,6 @@ DB_set_lorder(DBObject* self, PyObject* args)
342 RETURN_NONE();
343 }
344
345-#if (DBVER >= 42)
346 static PyObject*
347 DB_get_lorder(DBObject* self)
348 {
349@@ -2911,7 +2957,6 @@ DB_get_lorder(DBObject* self)
350 RETURN_IF_ERR();
351 return NUMBER_FromLong(lorder);
352 }
353-#endif
354
355 static PyObject*
356 DB_set_pagesize(DBObject* self, PyObject* args)
357@@ -2929,7 +2974,6 @@ DB_set_pagesize(DBObject* self, PyObject* args)
358 RETURN_NONE();
359 }
360
361-#if (DBVER >= 42)
362 static PyObject*
363 DB_get_pagesize(DBObject* self)
364 {
365@@ -2944,7 +2988,6 @@ DB_get_pagesize(DBObject* self)
366 RETURN_IF_ERR();
367 return NUMBER_FromLong(pagesize);
368 }
369-#endif
370
371 static PyObject*
372 DB_set_re_delim(DBObject* self, PyObject* args)
373@@ -2967,7 +3010,6 @@ DB_set_re_delim(DBObject* self, PyObject* args)
374 RETURN_NONE();
375 }
376
377-#if (DBVER >= 42)
378 static PyObject*
379 DB_get_re_delim(DBObject* self)
380 {
381@@ -2981,7 +3023,6 @@ DB_get_re_delim(DBObject* self)
382 RETURN_IF_ERR();
383 return NUMBER_FromLong(re_delim);
384 }
385-#endif
386
387 static PyObject*
388 DB_set_re_len(DBObject* self, PyObject* args)
389@@ -2999,7 +3040,6 @@ DB_set_re_len(DBObject* self, PyObject* args)
390 RETURN_NONE();
391 }
392
393-#if (DBVER >= 42)
394 static PyObject*
395 DB_get_re_len(DBObject* self)
396 {
397@@ -3014,7 +3054,6 @@ DB_get_re_len(DBObject* self)
398 RETURN_IF_ERR();
399 return NUMBER_FromLong(re_len);
400 }
401-#endif
402
403 static PyObject*
404 DB_set_re_pad(DBObject* self, PyObject* args)
405@@ -3036,7 +3075,6 @@ DB_set_re_pad(DBObject* self, PyObject* args)
406 RETURN_NONE();
407 }
408
409-#if (DBVER >= 42)
410 static PyObject*
411 DB_get_re_pad(DBObject* self)
412 {
413@@ -3050,7 +3088,6 @@ DB_get_re_pad(DBObject* self)
414 RETURN_IF_ERR();
415 return NUMBER_FromLong(re_pad);
416 }
417-#endif
418
419 static PyObject*
420 DB_set_re_source(DBObject* self, PyObject* args)
421@@ -3069,7 +3106,6 @@ DB_set_re_source(DBObject* self, PyObject* args)
422 RETURN_NONE();
423 }
424
425-#if (DBVER >= 42)
426 static PyObject*
427 DB_get_re_source(DBObject* self)
428 {
429@@ -3084,7 +3120,6 @@ DB_get_re_source(DBObject* self)
430 RETURN_IF_ERR();
431 return PyBytes_FromString(source);
432 }
433-#endif
434
435 static PyObject*
436 DB_stat(DBObject* self, PyObject* args, PyObject* kwargs)
437@@ -3381,7 +3416,6 @@ DB_set_encrypt(DBObject* self, PyObject* args, PyObject* kwargs)
438 RETURN_NONE();
439 }
440
441-#if (DBVER >= 42)
442 static PyObject*
443 DB_get_encrypt_flags(DBObject* self)
444 {
445@@ -3396,7 +3430,6 @@ DB_get_encrypt_flags(DBObject* self)
446
447 return NUMBER_FromLong(flags);
448 }
449-#endif
450
451
452
453@@ -4987,7 +5020,6 @@ DBEnv_set_encrypt(DBEnvObject* self, PyObject* args, PyObject* kwargs)
454 RETURN_NONE();
455 }
456
457-#if (DBVER >= 42)
458 static PyObject*
459 DBEnv_get_encrypt_flags(DBEnvObject* self)
460 {
461@@ -5025,7 +5057,6 @@ DBEnv_get_timeout(DBEnvObject* self, PyObject* args, PyObject* kwargs)
462 RETURN_IF_ERR();
463 return NUMBER_FromLong(timeout);
464 }
465-#endif
466
467
468 static PyObject*
469@@ -5064,7 +5095,6 @@ DBEnv_set_shm_key(DBEnvObject* self, PyObject* args)
470 RETURN_NONE();
471 }
472
473-#if (DBVER >= 42)
474 static PyObject*
475 DBEnv_get_shm_key(DBEnvObject* self)
476 {
477@@ -5081,7 +5111,6 @@ DBEnv_get_shm_key(DBEnvObject* self)
478
479 return NUMBER_FromLong(shm_key);
480 }
481-#endif
482
483 #if (DBVER >= 46)
484 static PyObject*
485@@ -5170,7 +5199,6 @@ DBEnv_set_cachesize(DBEnvObject* self, PyObject* args)
486 RETURN_NONE();
487 }
488
489-#if (DBVER >= 42)
490 static PyObject*
491 DBEnv_get_cachesize(DBEnvObject* self)
492 {
493@@ -5188,7 +5216,6 @@ DBEnv_get_cachesize(DBEnvObject* self)
494
495 return Py_BuildValue("(iii)", gbytes, bytes, ncache);
496 }
497-#endif
498
499
500 static PyObject*
501@@ -5208,7 +5235,6 @@ DBEnv_set_flags(DBEnvObject* self, PyObject* args)
502 RETURN_NONE();
503 }
504
505-#if (DBVER >= 42)
506 static PyObject*
507 DBEnv_get_flags(DBEnvObject* self)
508 {
509@@ -5223,7 +5249,6 @@ DBEnv_get_flags(DBEnvObject* self)
510 RETURN_IF_ERR();
511 return NUMBER_FromLong(flags);
512 }
513-#endif
514
515 #if (DBVER >= 47)
516 static PyObject*
517@@ -5423,7 +5448,6 @@ DBEnv_set_data_dir(DBEnvObject* self, PyObject* args)
518 RETURN_NONE();
519 }
520
521-#if (DBVER >= 42)
522 static PyObject*
523 DBEnv_get_data_dirs(DBEnvObject* self)
524 {
525@@ -5463,7 +5487,6 @@ DBEnv_get_data_dirs(DBEnvObject* self)
526 }
527 return tuple;
528 }
529-#endif
530
531 #if (DBVER >= 44)
532 static PyObject*
533@@ -5513,7 +5536,6 @@ DBEnv_set_lg_bsize(DBEnvObject* self, PyObject* args)
534 RETURN_NONE();
535 }
536
537-#if (DBVER >= 42)
538 static PyObject*
539 DBEnv_get_lg_bsize(DBEnvObject* self)
540 {
541@@ -5528,7 +5550,6 @@ DBEnv_get_lg_bsize(DBEnvObject* self)
542 RETURN_IF_ERR();
543 return NUMBER_FromLong(lg_bsize);
544 }
545-#endif
546
547 static PyObject*
548 DBEnv_set_lg_dir(DBEnvObject* self, PyObject* args)
549@@ -5547,7 +5568,6 @@ DBEnv_set_lg_dir(DBEnvObject* self, PyObject* args)
550 RETURN_NONE();
551 }
552
553-#if (DBVER >= 42)
554 static PyObject*
555 DBEnv_get_lg_dir(DBEnvObject* self)
556 {
557@@ -5562,7 +5582,6 @@ DBEnv_get_lg_dir(DBEnvObject* self)
558 RETURN_IF_ERR();
559 return PyBytes_FromString(dirp);
560 }
561-#endif
562
563 static PyObject*
564 DBEnv_set_lg_max(DBEnvObject* self, PyObject* args)
565@@ -5580,7 +5599,6 @@ DBEnv_set_lg_max(DBEnvObject* self, PyObject* args)
566 RETURN_NONE();
567 }
568
569-#if (DBVER >= 42)
570 static PyObject*
571 DBEnv_get_lg_max(DBEnvObject* self)
572 {
573@@ -5595,8 +5613,6 @@ DBEnv_get_lg_max(DBEnvObject* self)
574 RETURN_IF_ERR();
575 return NUMBER_FromLong(lg_max);
576 }
577-#endif
578-
579
580 static PyObject*
581 DBEnv_set_lg_regionmax(DBEnvObject* self, PyObject* args)
582@@ -5614,7 +5630,6 @@ DBEnv_set_lg_regionmax(DBEnvObject* self, PyObject* args)
583 RETURN_NONE();
584 }
585
586-#if (DBVER >= 42)
587 static PyObject*
588 DBEnv_get_lg_regionmax(DBEnvObject* self)
589 {
590@@ -5629,7 +5644,6 @@ DBEnv_get_lg_regionmax(DBEnvObject* self)
591 RETURN_IF_ERR();
592 return NUMBER_FromLong(lg_regionmax);
593 }
594-#endif
595
596 #if (DBVER >= 47)
597 static PyObject*
598@@ -5680,7 +5694,6 @@ DBEnv_set_lk_detect(DBEnvObject* self, PyObject* args)
599 RETURN_NONE();
600 }
601
602-#if (DBVER >= 42)
603 static PyObject*
604 DBEnv_get_lk_detect(DBEnvObject* self)
605 {
606@@ -5695,8 +5708,6 @@ DBEnv_get_lk_detect(DBEnvObject* self)
607 RETURN_IF_ERR();
608 return NUMBER_FromLong(lk_detect);
609 }
610-#endif
611-
612
613 #if (DBVER < 45)
614 static PyObject*
615@@ -5734,7 +5745,6 @@ DBEnv_set_lk_max_locks(DBEnvObject* self, PyObject* args)
616 RETURN_NONE();
617 }
618
619-#if (DBVER >= 42)
620 static PyObject*
621 DBEnv_get_lk_max_locks(DBEnvObject* self)
622 {
623@@ -5749,7 +5759,6 @@ DBEnv_get_lk_max_locks(DBEnvObject* self)
624 RETURN_IF_ERR();
625 return NUMBER_FromLong(lk_max);
626 }
627-#endif
628
629 static PyObject*
630 DBEnv_set_lk_max_lockers(DBEnvObject* self, PyObject* args)
631@@ -5767,7 +5776,6 @@ DBEnv_set_lk_max_lockers(DBEnvObject* self, PyObject* args)
632 RETURN_NONE();
633 }
634
635-#if (DBVER >= 42)
636 static PyObject*
637 DBEnv_get_lk_max_lockers(DBEnvObject* self)
638 {
639@@ -5782,7 +5790,6 @@ DBEnv_get_lk_max_lockers(DBEnvObject* self)
640 RETURN_IF_ERR();
641 return NUMBER_FromLong(lk_max);
642 }
643-#endif
644
645 static PyObject*
646 DBEnv_set_lk_max_objects(DBEnvObject* self, PyObject* args)
647@@ -5800,7 +5807,6 @@ DBEnv_set_lk_max_objects(DBEnvObject* self, PyObject* args)
648 RETURN_NONE();
649 }
650
651-#if (DBVER >= 42)
652 static PyObject*
653 DBEnv_get_lk_max_objects(DBEnvObject* self)
654 {
655@@ -5815,9 +5821,7 @@ DBEnv_get_lk_max_objects(DBEnvObject* self)
656 RETURN_IF_ERR();
657 return NUMBER_FromLong(lk_max);
658 }
659-#endif
660
661-#if (DBVER >= 42)
662 static PyObject*
663 DBEnv_get_mp_mmapsize(DBEnvObject* self)
664 {
665@@ -5832,8 +5836,6 @@ DBEnv_get_mp_mmapsize(DBEnvObject* self)
666 RETURN_IF_ERR();
667 return NUMBER_FromLong(mmapsize);
668 }
669-#endif
670-
671
672 static PyObject*
673 DBEnv_set_mp_mmapsize(DBEnvObject* self, PyObject* args)
674@@ -5869,8 +5871,6 @@ DBEnv_set_tmp_dir(DBEnvObject* self, PyObject* args)
675 RETURN_NONE();
676 }
677
678-
679-#if (DBVER >= 42)
680 static PyObject*
681 DBEnv_get_tmp_dir(DBEnvObject* self)
682 {
683@@ -5887,8 +5887,6 @@ DBEnv_get_tmp_dir(DBEnvObject* self)
684
685 return PyBytes_FromString(dirpp);
686 }
687-#endif
688-
689
690 static PyObject*
691 DBEnv_txn_recover(DBEnvObject* self)
692@@ -5899,7 +5897,7 @@ DBEnv_txn_recover(DBEnvObject* self)
693 DBTxnObject *txn;
694 #define PREPLIST_LEN 16
695 DB_PREPLIST preplist[PREPLIST_LEN];
696-#if (DBVER < 48)
697+#if (DBVER < 48 || DBVER > 51)
698 long retp;
699 #else
700 u_int32_t retp;
701@@ -6003,8 +6001,6 @@ DBEnv_txn_checkpoint(DBEnvObject* self, PyObject* args)
702 RETURN_NONE();
703 }
704
705-
706-#if (DBVER >= 42)
707 static PyObject*
708 DBEnv_get_tx_max(DBEnvObject* self)
709 {
710@@ -6019,8 +6015,6 @@ DBEnv_get_tx_max(DBEnvObject* self)
711 RETURN_IF_ERR();
712 return PyLong_FromUnsignedLong(max);
713 }
714-#endif
715-
716
717 static PyObject*
718 DBEnv_set_tx_max(DBEnvObject* self, PyObject* args)
719@@ -6038,8 +6032,6 @@ DBEnv_set_tx_max(DBEnvObject* self, PyObject* args)
720 RETURN_NONE();
721 }
722
723-
724-#if (DBVER >= 42)
725 static PyObject*
726 DBEnv_get_tx_timestamp(DBEnvObject* self)
727 {
728@@ -6054,7 +6046,6 @@ DBEnv_get_tx_timestamp(DBEnvObject* self)
729 RETURN_IF_ERR();
730 return NUMBER_FromLong(timestamp);
731 }
732-#endif
733
734 static PyObject*
735 DBEnv_set_tx_timestamp(DBEnvObject* self, PyObject* args)
736@@ -6756,6 +6747,55 @@ DBEnv_set_private(DBEnvObject* self, PyObject* private_obj)
737 RETURN_NONE();
738 }
739
740+#if (DBVER >= 47)
741+static PyObject*
742+DBEnv_set_intermediate_dir_mode(DBEnvObject* self, PyObject* args)
743+{
744+ int err;
745+ const char *mode;
746+
747+ if (!PyArg_ParseTuple(args,"s:set_intermediate_dir_mode", &mode))
748+ return NULL;
749+
750+ CHECK_ENV_NOT_CLOSED(self);
751+
752+ MYDB_BEGIN_ALLOW_THREADS;
753+ err = self->db_env->set_intermediate_dir_mode(self->db_env, mode);
754+ MYDB_END_ALLOW_THREADS;
755+ RETURN_IF_ERR();
756+ RETURN_NONE();
757+}
758+
759+static PyObject*
760+DBEnv_get_intermediate_dir_mode(DBEnvObject* self)
761+{
762+ int err;
763+ const char *mode;
764+
765+ CHECK_ENV_NOT_CLOSED(self);
766+
767+ MYDB_BEGIN_ALLOW_THREADS;
768+ err = self->db_env->get_intermediate_dir_mode(self->db_env, &mode);
769+ MYDB_END_ALLOW_THREADS;
770+ RETURN_IF_ERR();
771+ return Py_BuildValue("s", mode);
772+}
773+#endif
774+
775+static PyObject*
776+DBEnv_get_open_flags(DBEnvObject* self)
777+{
778+ int err;
779+ unsigned int flags;
780+
781+ CHECK_ENV_NOT_CLOSED(self);
782+
783+ MYDB_BEGIN_ALLOW_THREADS;
784+ err = self->db_env->get_open_flags(self->db_env, &flags);
785+ MYDB_END_ALLOW_THREADS;
786+ RETURN_IF_ERR();
787+ return NUMBER_FromLong(flags);
788+}
789
790 #if (DBVER < 48)
791 static PyObject*
792@@ -6875,7 +6915,6 @@ DBEnv_set_verbose(DBEnvObject* self, PyObject* args)
793 RETURN_NONE();
794 }
795
796-#if (DBVER >= 42)
797 static PyObject*
798 DBEnv_get_verbose(DBEnvObject* self, PyObject* args)
799 {
800@@ -6893,7 +6932,6 @@ DBEnv_get_verbose(DBEnvObject* self, PyObject* args)
801 RETURN_IF_ERR();
802 return PyBool_FromLong(verbose);
803 }
804-#endif
805
806 #if (DBVER >= 45)
807 static void
808@@ -6975,9 +7013,7 @@ DBEnv_rep_process_message(DBEnvObject* self, PyObject* args)
809 PyObject *control_py, *rec_py;
810 DBT control, rec;
811 int envid;
812-#if (DBVER >= 42)
813 DB_LSN lsn;
814-#endif
815
816 if (!PyArg_ParseTuple(args, "OOi:rep_process_message", &control_py,
817 &rec_py, &envid))
818@@ -6994,13 +7030,8 @@ DBEnv_rep_process_message(DBEnvObject* self, PyObject* args)
819 err = self->db_env->rep_process_message(self->db_env, &control, &rec,
820 envid, &lsn);
821 #else
822-#if (DBVER >= 42)
823 err = self->db_env->rep_process_message(self->db_env, &control, &rec,
824 &envid, &lsn);
825-#else
826- err = self->db_env->rep_process_message(self->db_env, &control, &rec,
827- &envid);
828-#endif
829 #endif
830 MYDB_END_ALLOW_THREADS;
831 switch (err) {
832@@ -7029,12 +7060,10 @@ DBEnv_rep_process_message(DBEnvObject* self, PyObject* args)
833 return r;
834 break;
835 }
836-#if (DBVER >= 42)
837 case DB_REP_NOTPERM :
838 case DB_REP_ISPERM :
839 return Py_BuildValue("(i(ll))", err, lsn.file, lsn.offset);
840 break;
841-#endif
842 }
843 RETURN_IF_ERR();
844 return Py_BuildValue("(OO)", Py_None, Py_None);
845@@ -7086,20 +7115,6 @@ _DBEnv_rep_transportCallback(DB_ENV* db_env, const DBT* control, const DBT* rec,
846 return ret;
847 }
848
849-#if (DBVER <= 41)
850-static int
851-_DBEnv_rep_transportCallbackOLD(DB_ENV* db_env, const DBT* control, const DBT* rec,
852- int envid, u_int32_t flags)
853-{
854- DB_LSN lsn;
855-
856- lsn.file = -1; /* Dummy values */
857- lsn.offset = -1;
858- return _DBEnv_rep_transportCallback(db_env, control, rec, &lsn, envid,
859- flags);
860-}
861-#endif
862-
863 static PyObject*
864 DBEnv_rep_set_transport(DBEnvObject* self, PyObject* args)
865 {
866@@ -7120,13 +7135,8 @@ DBEnv_rep_set_transport(DBEnvObject* self, PyObject* args)
867 err = self->db_env->rep_set_transport(self->db_env, envid,
868 &_DBEnv_rep_transportCallback);
869 #else
870-#if (DBVER >= 42)
871 err = self->db_env->set_rep_transport(self->db_env, envid,
872 &_DBEnv_rep_transportCallback);
873-#else
874- err = self->db_env->set_rep_transport(self->db_env, envid,
875- &_DBEnv_rep_transportCallbackOLD);
876-#endif
877 #endif
878 MYDB_END_ALLOW_THREADS;
879 RETURN_IF_ERR();
880@@ -7608,6 +7618,7 @@ DBEnv_repmgr_start(DBEnvObject* self, PyObject* args, PyObject*
881 RETURN_NONE();
882 }
883
884+#if (DBVER < 52)
885 static PyObject*
886 DBEnv_repmgr_set_local_site(DBEnvObject* self, PyObject* args, PyObject*
887 kwargs)
888@@ -7654,6 +7665,7 @@ DBEnv_repmgr_add_remote_site(DBEnvObject* self, PyObject* args, PyObject*
889 RETURN_IF_ERR();
890 return NUMBER_FromLong(eidp);
891 }
892+#endif
893
894 static PyObject*
895 DBEnv_repmgr_set_ack_policy(DBEnvObject* self, PyObject* args)
896@@ -8482,65 +8494,43 @@ static PyMethodDef DB_methods[] = {
897 {"remove", (PyCFunction)DB_remove, METH_VARARGS|METH_KEYWORDS},
898 {"rename", (PyCFunction)DB_rename, METH_VARARGS},
899 {"set_bt_minkey", (PyCFunction)DB_set_bt_minkey, METH_VARARGS},
900-#if (DBVER >= 42)
901 {"get_bt_minkey", (PyCFunction)DB_get_bt_minkey, METH_NOARGS},
902-#endif
903 {"set_bt_compare", (PyCFunction)DB_set_bt_compare, METH_O},
904 {"set_cachesize", (PyCFunction)DB_set_cachesize, METH_VARARGS},
905-#if (DBVER >= 42)
906 {"get_cachesize", (PyCFunction)DB_get_cachesize, METH_NOARGS},
907-#endif
908 {"set_encrypt", (PyCFunction)DB_set_encrypt, METH_VARARGS|METH_KEYWORDS},
909-#if (DBVER >= 42)
910 {"get_encrypt_flags", (PyCFunction)DB_get_encrypt_flags, METH_NOARGS},
911-#endif
912-
913 {"set_flags", (PyCFunction)DB_set_flags, METH_VARARGS},
914-#if (DBVER >= 42)
915 {"get_flags", (PyCFunction)DB_get_flags, METH_NOARGS},
916+#if (DBVER >= 43)
917+ {"get_transactional", (PyCFunction)DB_get_transactional, METH_NOARGS},
918 #endif
919 {"set_h_ffactor", (PyCFunction)DB_set_h_ffactor, METH_VARARGS},
920-#if (DBVER >= 42)
921 {"get_h_ffactor", (PyCFunction)DB_get_h_ffactor, METH_NOARGS},
922-#endif
923 {"set_h_nelem", (PyCFunction)DB_set_h_nelem, METH_VARARGS},
924-#if (DBVER >= 42)
925 {"get_h_nelem", (PyCFunction)DB_get_h_nelem, METH_NOARGS},
926-#endif
927 {"set_lorder", (PyCFunction)DB_set_lorder, METH_VARARGS},
928-#if (DBVER >= 42)
929 {"get_lorder", (PyCFunction)DB_get_lorder, METH_NOARGS},
930-#endif
931 {"set_pagesize", (PyCFunction)DB_set_pagesize, METH_VARARGS},
932-#if (DBVER >= 42)
933 {"get_pagesize", (PyCFunction)DB_get_pagesize, METH_NOARGS},
934-#endif
935 {"set_re_delim", (PyCFunction)DB_set_re_delim, METH_VARARGS},
936-#if (DBVER >= 42)
937 {"get_re_delim", (PyCFunction)DB_get_re_delim, METH_NOARGS},
938-#endif
939 {"set_re_len", (PyCFunction)DB_set_re_len, METH_VARARGS},
940-#if (DBVER >= 42)
941 {"get_re_len", (PyCFunction)DB_get_re_len, METH_NOARGS},
942-#endif
943 {"set_re_pad", (PyCFunction)DB_set_re_pad, METH_VARARGS},
944-#if (DBVER >= 42)
945 {"get_re_pad", (PyCFunction)DB_get_re_pad, METH_NOARGS},
946-#endif
947 {"set_re_source", (PyCFunction)DB_set_re_source, METH_VARARGS},
948-#if (DBVER >= 42)
949 {"get_re_source", (PyCFunction)DB_get_re_source, METH_NOARGS},
950-#endif
951 {"set_q_extentsize",(PyCFunction)DB_set_q_extentsize, METH_VARARGS},
952-#if (DBVER >= 42)
953 {"get_q_extentsize",(PyCFunction)DB_get_q_extentsize, METH_NOARGS},
954-#endif
955 {"set_private", (PyCFunction)DB_set_private, METH_O},
956 {"get_private", (PyCFunction)DB_get_private, METH_NOARGS},
957 #if (DBVER >= 46)
958 {"set_priority", (PyCFunction)DB_set_priority, METH_VARARGS},
959 {"get_priority", (PyCFunction)DB_get_priority, METH_NOARGS},
960 #endif
961+ {"get_dbname", (PyCFunction)DB_get_dbname, METH_NOARGS},
962+ {"get_open_flags", (PyCFunction)DB_get_open_flags, METH_NOARGS},
963 {"stat", (PyCFunction)DB_stat, METH_VARARGS|METH_KEYWORDS},
964 #if (DBVER >= 43)
965 {"stat_print", (PyCFunction)DB_stat_print,
966@@ -8639,24 +8629,18 @@ static PyMethodDef DBEnv_methods[] = {
967 {"get_thread_count", (PyCFunction)DBEnv_get_thread_count, METH_NOARGS},
968 #endif
969 {"set_encrypt", (PyCFunction)DBEnv_set_encrypt, METH_VARARGS|METH_KEYWORDS},
970-#if (DBVER >= 42)
971 {"get_encrypt_flags", (PyCFunction)DBEnv_get_encrypt_flags, METH_NOARGS},
972 {"get_timeout", (PyCFunction)DBEnv_get_timeout,
973 METH_VARARGS|METH_KEYWORDS},
974-#endif
975 {"set_timeout", (PyCFunction)DBEnv_set_timeout, METH_VARARGS|METH_KEYWORDS},
976 {"set_shm_key", (PyCFunction)DBEnv_set_shm_key, METH_VARARGS},
977-#if (DBVER >= 42)
978 {"get_shm_key", (PyCFunction)DBEnv_get_shm_key, METH_NOARGS},
979-#endif
980 #if (DBVER >= 46)
981 {"set_cache_max", (PyCFunction)DBEnv_set_cache_max, METH_VARARGS},
982 {"get_cache_max", (PyCFunction)DBEnv_get_cache_max, METH_NOARGS},
983 #endif
984 {"set_cachesize", (PyCFunction)DBEnv_set_cachesize, METH_VARARGS},
985-#if (DBVER >= 42)
986 {"get_cachesize", (PyCFunction)DBEnv_get_cachesize, METH_NOARGS},
987-#endif
988 {"memp_trickle", (PyCFunction)DBEnv_memp_trickle, METH_VARARGS},
989 {"memp_sync", (PyCFunction)DBEnv_memp_sync, METH_VARARGS},
990 {"memp_stat", (PyCFunction)DBEnv_memp_stat,
991@@ -8685,33 +8669,21 @@ static PyMethodDef DBEnv_methods[] = {
992 #endif
993 #endif
994 {"set_data_dir", (PyCFunction)DBEnv_set_data_dir, METH_VARARGS},
995-#if (DBVER >= 42)
996 {"get_data_dirs", (PyCFunction)DBEnv_get_data_dirs, METH_NOARGS},
997-#endif
998-#if (DBVER >= 42)
999 {"get_flags", (PyCFunction)DBEnv_get_flags, METH_NOARGS},
1000-#endif
1001 {"set_flags", (PyCFunction)DBEnv_set_flags, METH_VARARGS},
1002 #if (DBVER >= 47)
1003 {"log_set_config", (PyCFunction)DBEnv_log_set_config, METH_VARARGS},
1004 {"log_get_config", (PyCFunction)DBEnv_log_get_config, METH_VARARGS},
1005 #endif
1006 {"set_lg_bsize", (PyCFunction)DBEnv_set_lg_bsize, METH_VARARGS},
1007-#if (DBVER >= 42)
1008 {"get_lg_bsize", (PyCFunction)DBEnv_get_lg_bsize, METH_NOARGS},
1009-#endif
1010 {"set_lg_dir", (PyCFunction)DBEnv_set_lg_dir, METH_VARARGS},
1011-#if (DBVER >= 42)
1012 {"get_lg_dir", (PyCFunction)DBEnv_get_lg_dir, METH_NOARGS},
1013-#endif
1014 {"set_lg_max", (PyCFunction)DBEnv_set_lg_max, METH_VARARGS},
1015-#if (DBVER >= 42)
1016 {"get_lg_max", (PyCFunction)DBEnv_get_lg_max, METH_NOARGS},
1017-#endif
1018 {"set_lg_regionmax",(PyCFunction)DBEnv_set_lg_regionmax, METH_VARARGS},
1019-#if (DBVER >= 42)
1020 {"get_lg_regionmax",(PyCFunction)DBEnv_get_lg_regionmax, METH_NOARGS},
1021-#endif
1022 #if (DBVER >= 44)
1023 {"set_lg_filemode", (PyCFunction)DBEnv_set_lg_filemode, METH_VARARGS},
1024 {"get_lg_filemode", (PyCFunction)DBEnv_get_lg_filemode, METH_NOARGS},
1025@@ -8721,36 +8693,24 @@ static PyMethodDef DBEnv_methods[] = {
1026 {"get_lk_partitions", (PyCFunction)DBEnv_get_lk_partitions, METH_NOARGS},
1027 #endif
1028 {"set_lk_detect", (PyCFunction)DBEnv_set_lk_detect, METH_VARARGS},
1029-#if (DBVER >= 42)
1030 {"get_lk_detect", (PyCFunction)DBEnv_get_lk_detect, METH_NOARGS},
1031-#endif
1032 #if (DBVER < 45)
1033 {"set_lk_max", (PyCFunction)DBEnv_set_lk_max, METH_VARARGS},
1034 #endif
1035 {"set_lk_max_locks", (PyCFunction)DBEnv_set_lk_max_locks, METH_VARARGS},
1036-#if (DBVER >= 42)
1037 {"get_lk_max_locks", (PyCFunction)DBEnv_get_lk_max_locks, METH_NOARGS},
1038-#endif
1039 {"set_lk_max_lockers", (PyCFunction)DBEnv_set_lk_max_lockers, METH_VARARGS},
1040-#if (DBVER >= 42)
1041 {"get_lk_max_lockers", (PyCFunction)DBEnv_get_lk_max_lockers, METH_NOARGS},
1042-#endif
1043 {"set_lk_max_objects", (PyCFunction)DBEnv_set_lk_max_objects, METH_VARARGS},
1044-#if (DBVER >= 42)
1045 {"get_lk_max_objects", (PyCFunction)DBEnv_get_lk_max_objects, METH_NOARGS},
1046-#endif
1047 #if (DBVER >= 43)
1048 {"stat_print", (PyCFunction)DBEnv_stat_print,
1049 METH_VARARGS|METH_KEYWORDS},
1050 #endif
1051 {"set_mp_mmapsize", (PyCFunction)DBEnv_set_mp_mmapsize, METH_VARARGS},
1052-#if (DBVER >= 42)
1053 {"get_mp_mmapsize", (PyCFunction)DBEnv_get_mp_mmapsize, METH_NOARGS},
1054-#endif
1055 {"set_tmp_dir", (PyCFunction)DBEnv_set_tmp_dir, METH_VARARGS},
1056-#if (DBVER >= 42)
1057 {"get_tmp_dir", (PyCFunction)DBEnv_get_tmp_dir, METH_NOARGS},
1058-#endif
1059 {"txn_begin", (PyCFunction)DBEnv_txn_begin, METH_VARARGS|METH_KEYWORDS},
1060 {"txn_checkpoint", (PyCFunction)DBEnv_txn_checkpoint, METH_VARARGS},
1061 {"txn_stat", (PyCFunction)DBEnv_txn_stat, METH_VARARGS},
1062@@ -8758,10 +8718,8 @@ static PyMethodDef DBEnv_methods[] = {
1063 {"txn_stat_print", (PyCFunction)DBEnv_txn_stat_print,
1064 METH_VARARGS|METH_KEYWORDS},
1065 #endif
1066-#if (DBVER >= 42)
1067 {"get_tx_max", (PyCFunction)DBEnv_get_tx_max, METH_NOARGS},
1068 {"get_tx_timestamp", (PyCFunction)DBEnv_get_tx_timestamp, METH_NOARGS},
1069-#endif
1070 {"set_tx_max", (PyCFunction)DBEnv_set_tx_max, METH_VARARGS},
1071 {"set_tx_timestamp", (PyCFunction)DBEnv_set_tx_timestamp, METH_VARARGS},
1072 {"lock_detect", (PyCFunction)DBEnv_lock_detect, METH_VARARGS},
1073@@ -8804,11 +8762,16 @@ static PyMethodDef DBEnv_methods[] = {
1074 {"get_mp_max_write", (PyCFunction)DBEnv_get_mp_max_write, METH_NOARGS},
1075 #endif
1076 {"set_verbose", (PyCFunction)DBEnv_set_verbose, METH_VARARGS},
1077-#if (DBVER >= 42)
1078- {"get_verbose", (PyCFunction)DBEnv_get_verbose, METH_VARARGS},
1079+ {"get_verbose", (PyCFunction)DBEnv_get_verbose, METH_VARARGS},
1080+ {"set_private", (PyCFunction)DBEnv_set_private, METH_O},
1081+ {"get_private", (PyCFunction)DBEnv_get_private, METH_NOARGS},
1082+ {"get_open_flags", (PyCFunction)DBEnv_get_open_flags, METH_NOARGS},
1083+#if (DBVER >= 47)
1084+ {"set_intermediate_dir_mode", (PyCFunction)DBEnv_set_intermediate_dir_mode,
1085+ METH_VARARGS},
1086+ {"get_intermediate_dir_mode", (PyCFunction)DBEnv_get_intermediate_dir_mode,
1087+ METH_NOARGS},
1088 #endif
1089- {"set_private", (PyCFunction)DBEnv_set_private, METH_O},
1090- {"get_private", (PyCFunction)DBEnv_get_private, METH_NOARGS},
1091 {"rep_start", (PyCFunction)DBEnv_rep_start,
1092 METH_VARARGS|METH_KEYWORDS},
1093 {"rep_set_transport", (PyCFunction)DBEnv_rep_set_transport, METH_VARARGS},
1094@@ -8855,10 +8818,12 @@ static PyMethodDef DBEnv_methods[] = {
1095 #if (DBVER >= 45)
1096 {"repmgr_start", (PyCFunction)DBEnv_repmgr_start,
1097 METH_VARARGS|METH_KEYWORDS},
1098+#if (DBVER < 52)
1099 {"repmgr_set_local_site", (PyCFunction)DBEnv_repmgr_set_local_site,
1100 METH_VARARGS|METH_KEYWORDS},
1101 {"repmgr_add_remote_site", (PyCFunction)DBEnv_repmgr_add_remote_site,
1102 METH_VARARGS|METH_KEYWORDS},
1103+#endif
1104 {"repmgr_set_ack_policy", (PyCFunction)DBEnv_repmgr_set_ack_policy,
1105 METH_VARARGS},
1106 {"repmgr_get_ack_policy", (PyCFunction)DBEnv_repmgr_get_ack_policy,
1107@@ -8922,13 +8887,9 @@ DBEnv_db_home_get(DBEnvObject* self)
1108
1109 CHECK_ENV_NOT_CLOSED(self);
1110
1111-#if (DBVER >= 42)
1112 MYDB_BEGIN_ALLOW_THREADS;
1113 self->db_env->get_home(self->db_env, &home);
1114 MYDB_END_ALLOW_THREADS;
1115-#else
1116- home=self->db_env->db_home;
1117-#endif
1118
1119 if (home == NULL) {
1120 RETURN_NONE();
1121@@ -9298,10 +9259,25 @@ bsddb_version(PyObject* self)
1122 {
1123 int major, minor, patch;
1124
1125+ /* This should be instantaneous, no need to release the GIL */
1126 db_version(&major, &minor, &patch);
1127 return Py_BuildValue("(iii)", major, minor, patch);
1128 }
1129
1130+#if (DBVER >= 50)
1131+static PyObject*
1132+bsddb_version_full(PyObject* self)
1133+{
1134+ char *version_string;
1135+ int family, release, major, minor, patch;
1136+
1137+ /* This should be instantaneous, no need to release the GIL */
1138+ version_string = db_full_version(&family, &release, &major, &minor, &patch);
1139+ return Py_BuildValue("(siiiii)",
1140+ version_string, family, release, major, minor, patch);
1141+}
1142+#endif
1143+
1144
1145 /* List of functions defined in the module */
1146 static PyMethodDef bsddb_methods[] = {
1147@@ -9311,6 +9287,9 @@ static PyMethodDef bsddb_methods[] = {
1148 {"DBSequence", (PyCFunction)DBSequence_construct, METH_VARARGS | METH_KEYWORDS },
1149 #endif
1150 {"version", (PyCFunction)bsddb_version, METH_NOARGS, bsddb_version_doc},
1151+#if (DBVER >= 50)
1152+ {"full_version", (PyCFunction)bsddb_version_full, METH_NOARGS},
1153+#endif
1154 {NULL, NULL} /* sentinel */
1155 };
1156
1157@@ -9328,6 +9307,11 @@ static BSDDB_api bsddb_api;
1158 */
1159 #define ADD_INT(dict, NAME) _addIntToDict(dict, #NAME, NAME)
1160
1161+/*
1162+** We can rename the module at import time, so the string allocated
1163+** must be big enough, and any use of the name must use this particular
1164+** string.
1165+*/
1166 #define MODULE_NAME_MAX_LEN 11
1167 static char _bsddbModuleName[MODULE_NAME_MAX_LEN+1] = "_bsddb";
1168
1169@@ -9428,16 +9412,10 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1170 ADD_INT(d, DB_MAX_RECORDS);
1171
1172 #if (DBVER < 48)
1173-#if (DBVER >= 42)
1174 ADD_INT(d, DB_RPCCLIENT);
1175-#else
1176- ADD_INT(d, DB_CLIENT);
1177- /* allow apps to be written using DB_RPCCLIENT on older Berkeley DB */
1178- _addIntToDict(d, "DB_RPCCLIENT", DB_CLIENT);
1179-#endif
1180 #endif
1181
1182-#if (DBVER < 48)
1183+#if (DBVER < 48 || DBVER > 51)
1184 ADD_INT(d, DB_XA_CREATE);
1185 #endif
1186
1187@@ -9477,6 +9455,14 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1188 ADD_INT(d, DB_TXN_SYNC);
1189 ADD_INT(d, DB_TXN_NOWAIT);
1190
1191+#if (DBVER >= 51)
1192+ ADD_INT(d, DB_TXN_BULK);
1193+#endif
1194+
1195+#if (DBVER >= 48)
1196+ ADD_INT(d, DB_CURSOR_BULK);
1197+#endif
1198+
1199 #if (DBVER >= 46)
1200 ADD_INT(d, DB_TXN_WAIT);
1201 #endif
1202@@ -9561,9 +9547,7 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1203 ADD_INT(d, DB_ARCH_ABS);
1204 ADD_INT(d, DB_ARCH_DATA);
1205 ADD_INT(d, DB_ARCH_LOG);
1206-#if (DBVER >= 42)
1207 ADD_INT(d, DB_ARCH_REMOVE);
1208-#endif
1209
1210 ADD_INT(d, DB_BTREE);
1211 ADD_INT(d, DB_HASH);
1212@@ -9591,9 +9575,6 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1213 ADD_INT(d, DB_CACHED_COUNTS);
1214 #endif
1215
1216-#if (DBVER <= 41)
1217- ADD_INT(d, DB_COMMIT);
1218-#endif
1219 ADD_INT(d, DB_CONSUME);
1220 ADD_INT(d, DB_CONSUME_WAIT);
1221 ADD_INT(d, DB_CURRENT);
1222@@ -9651,8 +9632,10 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1223 ADD_INT(d, DB_LOCK_DEADLOCK);
1224 ADD_INT(d, DB_LOCK_NOTGRANTED);
1225 ADD_INT(d, DB_NOSERVER);
1226+#if (DBVER < 52)
1227 ADD_INT(d, DB_NOSERVER_HOME);
1228 ADD_INT(d, DB_NOSERVER_ID);
1229+#endif
1230 ADD_INT(d, DB_NOTFOUND);
1231 ADD_INT(d, DB_OLD_VERSION);
1232 ADD_INT(d, DB_RUNRECOVERY);
1233@@ -9671,6 +9654,10 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1234 #if (DBVER >= 43)
1235 ADD_INT(d, DB_STAT_SUBSYSTEM);
1236 ADD_INT(d, DB_STAT_MEMP_HASH);
1237+ ADD_INT(d, DB_STAT_LOCK_CONF);
1238+ ADD_INT(d, DB_STAT_LOCK_LOCKERS);
1239+ ADD_INT(d, DB_STAT_LOCK_OBJECTS);
1240+ ADD_INT(d, DB_STAT_LOCK_PARAMS);
1241 #endif
1242
1243 #if (DBVER >= 48)
1244@@ -9690,7 +9677,6 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1245 ADD_INT(d, DB_EID_INVALID);
1246 ADD_INT(d, DB_EID_BROADCAST);
1247
1248-#if (DBVER >= 42)
1249 ADD_INT(d, DB_TIME_NOTGRANTED);
1250 ADD_INT(d, DB_TXN_NOT_DURABLE);
1251 ADD_INT(d, DB_TXN_WRITE_NOSYNC);
1252@@ -9698,9 +9684,8 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1253 ADD_INT(d, DB_INIT_REP);
1254 ADD_INT(d, DB_ENCRYPT);
1255 ADD_INT(d, DB_CHKSUM);
1256-#endif
1257
1258-#if (DBVER >= 42) && (DBVER < 47)
1259+#if (DBVER < 47)
1260 ADD_INT(d, DB_LOG_AUTOREMOVE);
1261 ADD_INT(d, DB_DIRECT_LOG);
1262 #endif
1263@@ -9733,6 +9718,20 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1264 ADD_INT(d, DB_VERB_REPLICATION);
1265 ADD_INT(d, DB_VERB_WAITSFOR);
1266
1267+#if (DBVER >= 50)
1268+ ADD_INT(d, DB_VERB_REP_SYSTEM);
1269+#endif
1270+
1271+#if (DBVER >= 47)
1272+ ADD_INT(d, DB_VERB_REP_ELECT);
1273+ ADD_INT(d, DB_VERB_REP_LEASE);
1274+ ADD_INT(d, DB_VERB_REP_MISC);
1275+ ADD_INT(d, DB_VERB_REP_MSGS);
1276+ ADD_INT(d, DB_VERB_REP_SYNC);
1277+ ADD_INT(d, DB_VERB_REPMGR_CONNFAIL);
1278+ ADD_INT(d, DB_VERB_REPMGR_MISC);
1279+#endif
1280+
1281 #if (DBVER >= 45)
1282 ADD_INT(d, DB_EVENT_PANIC);
1283 ADD_INT(d, DB_EVENT_REP_CLIENT);
1284@@ -9748,16 +9747,25 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1285 ADD_INT(d, DB_EVENT_WRITE_FAILED);
1286 #endif
1287
1288+#if (DBVER >= 50)
1289+ ADD_INT(d, DB_REPMGR_CONF_ELECTIONS);
1290+ ADD_INT(d, DB_EVENT_REP_MASTER_FAILURE);
1291+ ADD_INT(d, DB_EVENT_REP_DUPMASTER);
1292+ ADD_INT(d, DB_EVENT_REP_ELECTION_FAILED);
1293+#endif
1294+#if (DBVER >= 48)
1295+ ADD_INT(d, DB_EVENT_REG_ALIVE);
1296+ ADD_INT(d, DB_EVENT_REG_PANIC);
1297+#endif
1298+
1299 ADD_INT(d, DB_REP_DUPMASTER);
1300 ADD_INT(d, DB_REP_HOLDELECTION);
1301 #if (DBVER >= 44)
1302 ADD_INT(d, DB_REP_IGNORE);
1303 ADD_INT(d, DB_REP_JOIN_FAILURE);
1304 #endif
1305-#if (DBVER >= 42)
1306 ADD_INT(d, DB_REP_ISPERM);
1307 ADD_INT(d, DB_REP_NOTPERM);
1308-#endif
1309 ADD_INT(d, DB_REP_NEWSITE);
1310
1311 ADD_INT(d, DB_REP_MASTER);
1312@@ -9766,7 +9774,13 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1313 ADD_INT(d, DB_REP_PERMANENT);
1314
1315 #if (DBVER >= 44)
1316+#if (DBVER >= 50)
1317+ ADD_INT(d, DB_REP_CONF_AUTOINIT);
1318+#else
1319 ADD_INT(d, DB_REP_CONF_NOAUTOINIT);
1320+#endif /* 5.0 */
1321+#endif /* 4.4 */
1322+#if (DBVER >= 44)
1323 ADD_INT(d, DB_REP_CONF_DELAYCLIENT);
1324 ADD_INT(d, DB_REP_CONF_BULK);
1325 ADD_INT(d, DB_REP_CONF_NOWAIT);
1326@@ -9774,9 +9788,7 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1327 ADD_INT(d, DB_REP_REREQUEST);
1328 #endif
1329
1330-#if (DBVER >= 42)
1331 ADD_INT(d, DB_REP_NOBUFFER);
1332-#endif
1333
1334 #if (DBVER >= 46)
1335 ADD_INT(d, DB_REP_LEASE_EXPIRED);
1336@@ -9819,6 +9831,28 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1337 ADD_INT(d, DB_STAT_ALL);
1338 #endif
1339
1340+#if (DBVER >= 51)
1341+ ADD_INT(d, DB_REPMGR_ACKS_ALL_AVAILABLE);
1342+#endif
1343+
1344+#if (DBVER >= 48)
1345+ ADD_INT(d, DB_REP_CONF_INMEM);
1346+#endif
1347+
1348+ ADD_INT(d, DB_TIMEOUT);
1349+
1350+#if (DBVER >= 50)
1351+ ADD_INT(d, DB_FORCESYNC);
1352+#endif
1353+
1354+#if (DBVER >= 48)
1355+ ADD_INT(d, DB_FAILCHK);
1356+#endif
1357+
1358+#if (DBVER >= 51)
1359+ ADD_INT(d, DB_HOTBACKUP_IN_PROGRESS);
1360+#endif
1361+
1362 #if (DBVER >= 43)
1363 ADD_INT(d, DB_BUFFER_SMALL);
1364 ADD_INT(d, DB_SEQ_DEC);
1365@@ -9856,6 +9890,10 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1366 ADD_INT(d, DB_SET_LOCK_TIMEOUT);
1367 ADD_INT(d, DB_SET_TXN_TIMEOUT);
1368
1369+#if (DBVER >= 48)
1370+ ADD_INT(d, DB_SET_REG_TIMEOUT);
1371+#endif
1372+
1373 /* The exception name must be correct for pickled exception *
1374 * objects to unpickle properly. */
1375 #ifdef PYBSDDB_STANDALONE /* different value needed for standalone pybsddb */
1376@@ -9912,8 +9950,10 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1377 MAKE_EX(DBRunRecoveryError);
1378 MAKE_EX(DBVerifyBadError);
1379 MAKE_EX(DBNoServerError);
1380+#if (DBVER >= 44 && DBVER < 52)
1381 MAKE_EX(DBNoServerHomeError);
1382 MAKE_EX(DBNoServerIDError);
1383+#endif
1384 MAKE_EX(DBPageNotFoundError);
1385 MAKE_EX(DBSecondaryBadError);
1386
1387@@ -9927,9 +9967,7 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1388 MAKE_EX(DBNoSuchFileError);
1389 MAKE_EX(DBPermissionsError);
1390
1391-#if (DBVER >= 42)
1392 MAKE_EX(DBRepHandleDeadError);
1393-#endif
1394 #if (DBVER >= 44)
1395 MAKE_EX(DBRepLockoutError);
1396 #endif
1397@@ -9947,6 +9985,7 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1398 #undef MAKE_EX
1399
1400 /* Initialise the C API structure and add it to the module */
1401+ bsddb_api.api_version = PYBSDDB_API_VERSION;
1402 bsddb_api.db_type = &DB_Type;
1403 bsddb_api.dbcursor_type = &DBCursor_Type;
1404 bsddb_api.dblogcursor_type = &DBLogCursor_Type;
1405@@ -9955,19 +9994,25 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
1406 bsddb_api.dblock_type = &DBLock_Type;
1407 #if (DBVER >= 43)
1408 bsddb_api.dbsequence_type = &DBSequence_Type;
1409+#else
1410+ bsddb_api.dbsequence_type = NULL;
1411 #endif
1412 bsddb_api.makeDBError = makeDBError;
1413
1414 /*
1415- ** Capsules exist from Python 3.1, but I
1416- ** don't want to break the API compatibility
1417- ** for already published Python versions.
1418+ ** Capsules exist from Python 2.7 and 3.1.
1419+ ** We don't support Python 3.0 anymore, so...
1420+ ** #if (PY_VERSION_HEX < ((PY_MAJOR_VERSION < 3) ? 0x02070000 : 0x03020000))
1421 */
1422-#if (PY_VERSION_HEX < 0x03020000)
1423+#if (PY_VERSION_HEX < 0x02070000)
1424 py_api = PyCObject_FromVoidPtr((void*)&bsddb_api, NULL);
1425 #else
1426 {
1427- char py_api_name[250];
1428+ /*
1429+ ** The data must outlive the call!!. So, the static definition.
1430+ ** The buffer must be big enough...
1431+ */
1432+ static char py_api_name[MODULE_NAME_MAX_LEN+10];
1433
1434 strcpy(py_api_name, _bsddbModuleName);
1435 strcat(py_api_name, ".api");
1436diff --git a/Modules/bsddb.h b/Modules/bsddb.h
1437index a3a687b..c1d862a 100644
1438--- a/Modules/bsddb.h
1439+++ b/Modules/bsddb.h
1440@@ -109,7 +109,7 @@
1441 #error "eek! DBVER can't handle minor versions > 9"
1442 #endif
1443
1444-#define PY_BSDDB_VERSION "4.8.4.2"
1445+#define PY_BSDDB_VERSION "5.3.15"
1446
1447 /* Python object definitions */
1448
1449@@ -236,7 +236,7 @@ typedef struct DBSequenceObject {
1450 /* To access the structure from an external module, use code like the
1451 following (error checking missed out for clarity):
1452
1453- // If you are using Python before 3.2:
1454+ // If you are using Python before 2.7:
1455 BSDDB_api* bsddb_api;
1456 PyObject* mod;
1457 PyObject* cobj;
1458@@ -249,7 +249,7 @@ typedef struct DBSequenceObject {
1459 Py_DECREF(mod);
1460
1461
1462- // If you are using Python 3.2 or up:
1463+ // If you are using Python 2.7 or up: (except Python 3.0, unsupported)
1464 BSDDB_api* bsddb_api;
1465
1466 // Use "bsddb3._pybsddb.api" if you're using
1467@@ -257,10 +257,14 @@ typedef struct DBSequenceObject {
1468 bsddb_api = (void **)PyCapsule_Import("bsddb._bsddb.api", 1);
1469
1470
1471+ Check "api_version" number before trying to use the API.
1472+
1473 The structure's members must not be changed.
1474 */
1475
1476+#define PYBSDDB_API_VERSION 1
1477 typedef struct {
1478+ unsigned int api_version;
1479 /* Type objects */
1480 PyTypeObject* db_type;
1481 PyTypeObject* dbcursor_type;
1482@@ -268,9 +272,7 @@ typedef struct {
1483 PyTypeObject* dbenv_type;
1484 PyTypeObject* dbtxn_type;
1485 PyTypeObject* dblock_type;
1486-#if (DBVER >= 43)
1487- PyTypeObject* dbsequence_type;
1488-#endif
1489+ PyTypeObject* dbsequence_type; /* If DBVER < 43 -> NULL */
1490
1491 /* Functions */
1492 int (*makeDBError)(int err);
1493@@ -289,9 +291,9 @@ typedef struct {
1494 #define DBEnvObject_Check(v) ((v)->ob_type == bsddb_api->dbenv_type)
1495 #define DBTxnObject_Check(v) ((v)->ob_type == bsddb_api->dbtxn_type)
1496 #define DBLockObject_Check(v) ((v)->ob_type == bsddb_api->dblock_type)
1497-#if (DBVER >= 43)
1498-#define DBSequenceObject_Check(v) ((v)->ob_type == bsddb_api->dbsequence_type)
1499-#endif
1500+#define DBSequenceObject_Check(v) \
1501+ ((bsddb_api->dbsequence_type) && \
1502+ ((v)->ob_type == bsddb_api->dbsequence_type))
1503
1504 #endif /* COMPILING_BSDDB_C */
1505
1506diff --git a/setup.py b/setup.py
1507index 6b47451..e8ac96c 100644
1508--- a/setup.py
1509+++ b/setup.py
1510@@ -799,7 +799,7 @@ class PyBuildExt(build_ext):
1511 # a release. Most open source OSes come with one or more
1512 # versions of BerkeleyDB already installed.
1513
1514- max_db_ver = (4, 8)
1515+ max_db_ver = (5, 3)
1516 min_db_ver = (4, 1)
1517 db_setup_debug = False # verbose debug prints from this script?
1518
1519@@ -821,7 +821,11 @@ class PyBuildExt(build_ext):
1520 return True
1521
1522 def gen_db_minor_ver_nums(major):
1523- if major == 4:
1524+ if major == 5:
1525+ for x in range(max_db_ver[1]+1):
1526+ if allow_db_ver((5, x)):
1527+ yield x
1528+ elif major == 4:
1529 for x in range(max_db_ver[1]+1):
1530 if allow_db_ver((4, x)):
1531 yield x
1532@@ -835,6 +839,9 @@ class PyBuildExt(build_ext):
1533 # construct a list of paths to look for the header file in on
1534 # top of the normal inc_dirs.
1535 db_inc_paths = [
1536+ '/usr/include/db5',
1537+ '/usr/local/include/db5',
1538+ '/opt/sfw/include/db5',
1539 '/usr/include/db4',
1540 '/usr/local/include/db4',
1541 '/opt/sfw/include/db4',
1542@@ -845,6 +852,16 @@ class PyBuildExt(build_ext):
1543 '/sw/include/db4',
1544 '/sw/include/db3',
1545 ]
1546+ # 5.x minor number specific paths
1547+ for x in gen_db_minor_ver_nums(5):
1548+ db_inc_paths.append('/usr/include/db5%d' % x)
1549+ db_inc_paths.append('/usr/include/db5.%d' % x)
1550+ db_inc_paths.append('/usr/local/BerkeleyDB.5.%d/include' % x)
1551+ db_inc_paths.append('/usr/local/include/db5%d' % x)
1552+ db_inc_paths.append('/pkg/db-5.%d/include' % x)
1553+ db_inc_paths.append('/opt/db-5.%d/include' % x)
1554+ # MacPorts default (http://www.macports.org/)
1555+ db_inc_paths.append('/opt/local/include/db5%d' % x)
1556 # 4.x minor number specific paths
1557 for x in gen_db_minor_ver_nums(4):
1558 db_inc_paths.append('/usr/include/db4%d' % x)
1559@@ -871,6 +888,10 @@ class PyBuildExt(build_ext):
1560 for dn in inc_dirs:
1561 std_variants.append(os.path.join(dn, 'db3'))
1562 std_variants.append(os.path.join(dn, 'db4'))
1563+ std_variants.append(os.path.join(dn, 'db5'))
1564+ for x in gen_db_minor_ver_nums(5):
1565+ std_variants.append(os.path.join(dn, "db5%d"%x))
1566+ std_variants.append(os.path.join(dn, "db5.%d"%x))
1567 for x in gen_db_minor_ver_nums(4):
1568 std_variants.append(os.path.join(dn, "db4%d"%x))
1569 std_variants.append(os.path.join(dn, "db4.%d"%x))
1570--
15711.7.7
1572
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 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Remove the RPATH to avoid QA issue warning.
4
5RP: Added secondary unnecessary rpath to the list 2012/8/7
6Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
7
8
9Index: Python-2.7.3/setup.py
10===================================================================
11--- Python-2.7.3.orig/setup.py 2012-08-07 10:41:58.560132529 +0000
12+++ Python-2.7.3/setup.py 2012-08-07 11:09:47.852094515 +0000
13@@ -1042,7 +1042,6 @@
14 exts.append(Extension('_bsddb', ['_bsddb.c'],
15 depends = ['bsddb.h'],
16 library_dirs=dblib_dir,
17- runtime_library_dirs=dblib_dir,
18 include_dirs=db_incs,
19 libraries=dblibs))
20 else:
21@@ -1252,7 +1251,6 @@
22 print "building dbm using bdb"
23 dbmext = Extension('dbm', ['dbmmodule.c'],
24 library_dirs=dblib_dir,
25- runtime_library_dirs=dblib_dir,
26 include_dirs=db_incs,
27 define_macros=[
28 ('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 @@
1python: fix build error with Readline 6.3
2
3Backport two patches from upstream:
4
5use new readline function types (closes #20374)
6Issue #20374: Avoid compiler warnings when compiling readline with libedit.
7
8Upstream-Status: Backport
9
10Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
11---
12 Modules/readline.c | 15 ++++++++++++---
13 1 file changed, 12 insertions(+), 3 deletions(-)
14
15diff --git a/Modules/readline.c b/Modules/readline.c
16index b5e258d..d3f52aa 100644
17--- a/Modules/readline.c
18+++ b/Modules/readline.c
19@@ -735,15 +735,24 @@ on_hook(PyObject *func)
20 return result;
21 }
22
23+
24 static int
25+#if defined(_RL_FUNCTION_TYPEDEF)
26 on_startup_hook(void)
27+#else
28+on_startup_hook()
29+#endif
30 {
31 return on_hook(startup_hook);
32 }
33
34 #ifdef HAVE_RL_PRE_INPUT_HOOK
35 static int
36+#if defined(_RL_FUNCTION_TYPEDEF)
37 on_pre_input_hook(void)
38+#else
39+on_pre_input_hook()
40+#endif
41 {
42 return on_hook(pre_input_hook);
43 }
44@@ -886,12 +895,12 @@ setup_readline(void)
45 rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap);
46 rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap);
47 /* Set our hook functions */
48- rl_startup_hook = (Function *)on_startup_hook;
49+ rl_startup_hook = (rl_hook_func_t *)on_startup_hook;
50 #ifdef HAVE_RL_PRE_INPUT_HOOK
51- rl_pre_input_hook = (Function *)on_pre_input_hook;
52+ rl_pre_input_hook = (rl_hook_func_t *)on_pre_input_hook;
53 #endif
54 /* Set our completion function */
55- rl_attempted_completion_function = (CPPFunction *)flex_complete;
56+ rl_attempted_completion_function = (rl_completion_func_t *)flex_complete;
57 /* Set Python word break characters */
58 rl_completer_word_break_characters =
59 strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?");
60--
611.7.9.5
62
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 @@
1This patch removes the RPATH setting which contains a pointer to
2the target relocated sysroot, which is incorrect.
3
4Upstream-Status: Inappropriate [Embedded Specific]
5
6Signed-off-by: Saul Wold <sgw@linux.intel.com>
7
8Index: Python-2.6.6/setup.py
9===================================================================
10--- Python-2.6.6.orig/setup.py 2011-09-28 14:22:57.000000000 -0700
11+++ Python-2.6.6/setup.py 2011-09-28 16:11:25.147279633 -0700
12@@ -1079,7 +1079,6 @@
13 include_dirs=["Modules/_sqlite",
14 sqlite_incdir],
15 library_dirs=sqlite_libdir,
16- runtime_library_dirs=sqlite_libdir,
17 extra_link_args=sqlite_extra_link_args,
18 libraries=["sqlite3",]))
19 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 @@
1#!/bin/sh
2#
3#This script is used to run python test suites
4
5make -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 @@
1python should search for db.h in inc_dirs and not in a hardcoded path.
2If db.h is found but HASHVERSION is not 2 we avoid a warning by not
3adding this module to missing variable.
4
5Upstream-Status: Inappropriate [distribution]
6
7Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
8
9Index: Python-2.7.2/setup.py
10===================================================================
11--- Python-2.7.2.orig/setup.py 2012-04-05 22:27:22.437199989 +0300
12+++ Python-2.7.2/setup.py 2012-04-05 22:26:38.000000000 +0300
13@@ -1141,12 +1141,12 @@
14 # the more recent berkeleydb's db.h file first in the include path
15 # when attempting to compile and it will fail.
16 f = "/usr/include/db.h"
17-
18+ if len(inc_dirs) != 0:
19+ f = os.path.join(inc_dirs[0], "db.h")
20 if sys.platform == 'darwin':
21 if is_macosx_sdk_path(f):
22 sysroot = macosx_sdk_root()
23 f = os.path.join(sysroot, f[1:])
24-
25 if os.path.exists(f) and not db_incs:
26 data = open(f).read()
27 m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
28@@ -1161,8 +1161,10 @@
29 libraries=libraries))
30 else:
31 exts.append(Extension('bsddb185', ['bsddbmodule.c']))
32- else:
33- missing.append('bsddb185')
34+ # If a newer version is detected don't report an useless
35+ # warning
36+ #else:
37+ # missing.append('bsddb185')
38 else:
39 missing.append('bsddb185')
40
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 @@
1This patch skips over the 'import check' setup.py does when building
2extensions. This generally won't work when cross-compiling.
3
4Upstream-Status: Inappropriate [embedded-specific]
5
6Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
7
8Index: Python-2.7.2/setup.py
9===================================================================
10--- Python-2.7.2.orig/setup.py 2011-11-04 16:46:34.553796410 -0500
11+++ Python-2.7.2/setup.py 2011-11-04 16:59:49.692802313 -0500
12@@ -287,6 +287,15 @@
13 (ext.name, sys.exc_info()[1]))
14 self.failed.append(ext.name)
15 return
16+
17+ # If we're cross-compiling, we want to skip the import check
18+ # i.e. we shouldn't be dynamically loading target shared libs
19+ if os.environ.get('CROSS_COMPILE') is not None:
20+ self.announce(
21+ 'WARNING: skipping import check for cross-compiled "%s"' %
22+ ext.name)
23+ return
24+
25 # Workaround for Mac OS X: The Carbon-based modules cannot be
26 # reliably imported into a command-line Python
27 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 @@
1This patch removes various ways native system options can pass into the python
2compilation and somehow break C modules.
3
4Upstream-Status: Configuration [OE Specific]
5
6RP 2012/04/23
7
8Index: Python-2.7.2/setup.py
9===================================================================
10--- Python-2.7.2.orig/setup.py 2012-04-23 20:03:47.295582553 +0000
11+++ Python-2.7.2/setup.py 2012-04-23 20:03:15.000000000 +0000
12@@ -231,7 +231,13 @@
13 # compilers
14 if compiler is not None:
15 (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
16- args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
17+ # Need to filter out -isysroot from the flags. Ideally should
18+ # figure out target flags here.
19+ flags = []
20+ for f in cflags.split():
21+ if not f.startswith("-isystem"):
22+ flags.append(f)
23+ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + ' '.join(flags)
24 self.compiler.set_executables(**args)
25
26 build_ext.build_extensions(self)
27@@ -393,7 +399,6 @@
28 # into configure and stored in the Makefile (issue found on OS X 10.3).
29 for env_var, arg_name, dir_list in (
30 ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
31- ('LDFLAGS', '-L', self.compiler.library_dirs),
32 ('CPPFLAGS', '-I', self.compiler.include_dirs)):
33 env_val = sysconfig.get_config_var(env_var)
34 if env_val:
35@@ -419,16 +424,16 @@
36 for directory in reversed(options.dirs):
37 add_dir_to_list(dir_list, directory)
38
39- if os.path.normpath(sys.prefix) != '/usr' \
40- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
41+# if os.path.normpath(sys.prefix) != '/usr' \
42+# and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
43 # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
44 # (PYTHONFRAMEWORK is set) to avoid # linking problems when
45 # building a framework with different architectures than
46 # the one that is currently installed (issue #7473)
47- add_dir_to_list(self.compiler.library_dirs,
48- sysconfig.get_config_var("LIBDIR"))
49- add_dir_to_list(self.compiler.include_dirs,
50- sysconfig.get_config_var("INCLUDEDIR"))
51+# add_dir_to_list(self.compiler.library_dirs,
52+# sysconfig.get_config_var("LIBDIR"))
53+# add_dir_to_list(self.compiler.include_dirs,
54+# sysconfig.get_config_var("INCLUDEDIR"))
55
56 try:
57 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 @@
1# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
2# GPLv2 or later
3# Version: 20081123
4# Features:
5# * set proper default encoding
6# * enable readline completion in the interactive interpreter
7# * load command line history on startup
8# * save command line history on exit
9
10import os
11
12def __exithandler():
13 try:
14 readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
15 except IOError:
16 pass
17
18def __registerExitHandler():
19 import atexit
20 atexit.register( __exithandler )
21
22def __enableReadlineSupport():
23 readline.set_history_length( 1000 )
24 readline.parse_and_bind( "tab: complete" )
25 try:
26 readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
27 except IOError:
28 pass
29
30def __enableDefaultEncoding():
31 import sys
32 try:
33 sys.setdefaultencoding( "utf8" )
34 except LookupError:
35 pass
36
37import sys
38try:
39 import rlcompleter, readline
40except ImportError:
41 pass
42else:
43 __enableDefaultEncoding()
44 __registerExitHandler()
45 __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..573096cb1c
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-distribute_0.6.32.bb
@@ -0,0 +1,49 @@
1SUMMARY = "Download, build, install, upgrade, and uninstall Python packages"
2HOMEPAGE = "http://packages.python.org/distribute"
3SECTION = "devel/python"
4LICENSE = "PSF"
5LIC_FILES_CHKSUM = "file://setup.py;beginline=234;endline=234;md5=26f6b02022b737126d3c88838782dddb"
6
7SRCNAME = "distribute"
8PR = "ml5"
9DEPENDS += "python3"
10DEPENDS_class-native += "python3-native"
11
12SRC_URI = " \
13 http://pypi.python.org/packages/source/d/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
14"
15SRC_URI[md5sum] = "acb7a2da81e3612bfb1608abe4f0e568"
16SRC_URI[sha256sum] = "8970cd1e148b5d1fea9430584aea66c45ea22d80e0933393ec49ebc388f718df"
17
18S = "${WORKDIR}/${SRCNAME}-${PV}"
19
20# http://python-distribute.org/distribute_setup.py
21
22# force the selection of python3
23#PYTHON_BASEVERSION = "3.3"
24#PYTHON_MAJMIN = "3.3"
25
26inherit distutils3
27
28DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
29
30do_install_prepend() {
31 install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
32}
33#
34# The installer puts the wrong path in the setuptools.pth file. Correct it.
35#
36do_install_append() {
37 rm ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
38 mv ${D}${bindir}/easy_install ${D}${bindir}/easy3_install
39 echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
40}
41
42RDEPENDS_${PN} = "\
43 python3-distutils \
44 python3-compression \
45"
46
47RPROVIDES_${PN} += "python3-setuptools"
48
49BBCLASSEXTEND = "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..7238eaf27d
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-native_3.3.3.bb
@@ -0,0 +1,76 @@
1require recipes-devtools/python/python.inc
2
3PR = "${INC_PR}.0"
4PYTHON_MAJMIN = "3.3"
5DISTRO_SRC_URI ?= "file://sitecustomize.py"
6DISTRO_SRC_URI_linuxstdbase = ""
7SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
8file://12-distutils-prefix-is-inside-staging-area.patch \
9file://000-cross-compile.patch \
10file://020-dont-compile-python-files.patch \
11file://030-fixup-include-dirs.patch \
12file://070-dont-clean-ipkg-install.patch \
13file://080-distutils-dont_adjust_files.patch \
14file://110-enable-zlib.patch \
15file://130-readline-setup.patch \
16file://150-fix-setupterm.patch \
17file://python-3.3-multilib.patch \
18file://03-fix-tkinter-detection.patch \
19file://avoid_warning_about_tkinter.patch \
20file://06-ctypes-libffi-fix-configure.patch \
21file://shutil-follow-symlink-fix.patch \
22file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
23file://sysroot-include-headers.patch \
24file://unixccompiler.patch \
25file://fix-ast.h-dependency.patch \
26file://makerace.patch \
27${DISTRO_SRC_URI} \
28file://python3-fix-build-error-with-Readline-6.3.patch \
29"
30SRC_URI[md5sum] = "f3ebe34d4d8695bf889279b54673e10c"
31SRC_URI[sha256sum] = "e526e9b612f623888364d30cc9f3dfc34dcef39065c713bdbcddf47df84d8dcb"
32
33LIC_FILES_CHKSUM = "file://LICENSE;md5=4eaea08eaaf6875189b0c49f26fa2005"
34
35S = "${WORKDIR}/Python-${PV}"
36
37EXTRANATIVEPATH += "bzip2-native"
38DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native"
39
40inherit native
41
42RPROVIDES += "python3-distutils-native python3-compression-native python3-textutils-native python3-core-native"
43
44EXTRA_OECONF_append = " --bindir=${bindir}/${PN}"
45
46EXTRA_OEMAKE = '\
47 BUILD_SYS="" \
48 HOST_SYS="" \
49 LIBC="" \
50 STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
51 STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
52 LIB=${baselib} \
53 ARCH=${TARGET_ARCH} \
54'
55
56# No ctypes option for python 3
57PYTHONLSBOPTS = ""
58
59do_configure_prepend() {
60 autoreconf --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf"
61}
62
63do_install() {
64 install -d ${D}${libdir}/pkgconfig
65 oe_runmake 'DESTDIR=${D}' install
66 if [ -e ${WORKDIR}/sitecustomize.py ]; then
67 install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
68 fi
69 install -d ${D}${bindir}/${PN}
70 install -m 0755 Parser/pgen ${D}${bindir}/${PN}
71
72 # Make sure we use /usr/bin/env python
73 for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
74 sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
75 done
76}
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 @@
1We cross compile python. This patch uses tools from host/native
2python instead of in-tree tools
3
4-Khem
5
6Upstream-Status: Inappropriate[Configuration Specific]
7
8---
9 Makefile.pre.in | 25 +++++++++++++------------
10 1 file changed, 13 insertions(+), 12 deletions(-)
11
12--- a/Makefile.pre.in
13+++ b/Makefile.pre.in
14@@ -193,6 +193,7 @@ LIBOBJS= @LIBOBJS@
15
16 PYTHON= python$(EXE)
17 BUILDPYTHON= python$(BUILDEXE)
18+HOSTPYTHON= $(BUILDPYTHON)
19
20 PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
21 _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
22@@ -239,6 +240,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
23 ##########################################################################
24 # Parser
25 PGEN= Parser/pgen$(EXE)
26+HOSTPGEN= $(PGEN)$(EXE)
27
28 PSRCS= \
29 Parser/acceler.c \
30@@ -451,7 +453,7 @@ build_all_generate_profile:
31
32 run_profile_task:
33 : # FIXME: can't run for a cross build
34- $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
35+ $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK)
36
37 build_all_use_profile:
38 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use -fprofile-correction"
39@@ -640,7 +642,7 @@ $(IO_OBJS): $(IO_H)
40 $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
41 @$(MKDIR_P) Include
42 $(MAKE) $(PGEN)
43- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
44+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
45 $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
46 $(MAKE) $(GRAMMAR_H)
47 touch $(GRAMMAR_C)
48@@ -820,7 +822,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
49 ######################################################################
50
51 TESTOPTS= $(EXTRATESTOPTS)
52-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS)
53+TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS)
54 TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
55 TESTTIMEOUT= 3600
56
57@@ -1229,7 +1231,7 @@ frameworkinstallstructure: $(LDLIBRARY)
58 fi; \
59 done
60 $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
61- sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
62+ sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
63 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
64 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
65 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
66@@ -1288,7 +1290,7 @@ config.status: $(srcdir)/configure
67
68 # Run reindent on the library
69 reindent:
70- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
71+ $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
72
73 # Rerun configure with the same options as it was run last time,
74 # provided the config.status script exists
75@@ -1414,7 +1416,7 @@ funny:
76
77 # Perform some verification checks on any modified files.
78 patchcheck:
79- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
80+ $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
81
82 # Dependencies
83
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 @@
1From 2f5a4c708d90fa8db21f446ae879cff79387448d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 20 May 2013 21:03:16 -0700
4Subject: [PATCH] h2py: Fix issue 13032 where it fails with UnicodeDecodeError
5
6use utf-8 to open the files
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9
10Upstream-Status: Pending
11---
12 Tools/scripts/h2py.py | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py
16index 4f871d9..a53fbe0 100755
17--- a/Tools/scripts/h2py.py
18+++ b/Tools/scripts/h2py.py
19@@ -69,13 +69,13 @@ def main():
20 sys.stdout.write('# Generated by h2py from stdin\n')
21 process(sys.stdin, sys.stdout)
22 else:
23- fp = open(filename, 'r')
24+ fp = open(filename, 'r', encoding='utf-8')
25 outfile = os.path.basename(filename)
26 i = outfile.rfind('.')
27 if i > 0: outfile = outfile[:i]
28 modname = outfile.upper()
29 outfile = modname + '.py'
30- outfp = open(outfile, 'w')
31+ outfp = open(outfile, 'w', encoding='utf-8')
32 outfp.write('# Generated by h2py from %s\n' % filename)
33 filedict = {}
34 for dir in searchdirs:
35--
361.8.1.2
37
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 @@
1Dont cross compile site packages
2
3-Khem
4
5Upstream-Status: Inappropriate[Embedded-Specific]
6
7---
8 Makefile.pre.in | 16 ----------------
9 1 file changed, 16 deletions(-)
10
11--- a/Makefile.pre.in
12+++ b/Makefile.pre.in
13@@ -1078,24 +1078,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL
14 $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
15 $(DESTDIR)$(LIBDEST)/distutils/tests ; \
16 fi
17- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
18- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
19- -d $(LIBDEST) -f \
20- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
21- $(DESTDIR)$(LIBDEST)
22- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
23- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
24- -d $(LIBDEST) -f \
25- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
26- $(DESTDIR)$(LIBDEST)
27- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
28- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
29- -d $(LIBDEST)/site-packages -f \
30- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
31- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
32- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
33- -d $(LIBDEST)/site-packages -f \
34- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
35 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
36 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
37 -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 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3# We need to supply STAGING_INCDIR here, otherwise the Tk headers
4# will not be found.
5# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille.de>
6
7Index: Python-3.3.0rc2/setup.py
8===================================================================
9--- Python-3.3.0rc2.orig/setup.py 2012-09-20 15:24:14.009124003 -0700
10+++ Python-3.3.0rc2/setup.py 2012-09-20 15:25:08.449124963 -0700
11@@ -1620,7 +1620,7 @@
12 dotversion = dotversion[:-1] + '.' + dotversion[-1]
13 tcl_include_sub = []
14 tk_include_sub = []
15- for dir in inc_dirs:
16+ for dir in [os.getenv("STAGING_INCDIR")]:
17 tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
18 tk_include_sub += [dir + os.sep + "tk" + dotversion]
19 tk_include_sub += tcl_include_sub
20@@ -1639,22 +1639,6 @@
21 if dir not in include_dirs:
22 include_dirs.append(dir)
23
24- # Check for various platform-specific directories
25- if host_platform == 'sunos5':
26- include_dirs.append('/usr/openwin/include')
27- added_lib_dirs.append('/usr/openwin/lib')
28- elif os.path.exists('/usr/X11R6/include'):
29- include_dirs.append('/usr/X11R6/include')
30- added_lib_dirs.append('/usr/X11R6/lib64')
31- added_lib_dirs.append('/usr/X11R6/lib')
32- elif os.path.exists('/usr/X11R5/include'):
33- include_dirs.append('/usr/X11R5/include')
34- added_lib_dirs.append('/usr/X11R5/lib')
35- else:
36- # Assume default location for X11
37- include_dirs.append('/usr/X11/include')
38- added_lib_dirs.append('/usr/X11/lib')
39-
40 # If Cygwin, then verify that X is installed before proceeding
41 if host_platform == 'cygwin':
42 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 @@
1Do not hardcode /usr into include paths when cross compiling
2
3-Khem
4
5Upstream-Status: Pending
6
7---
8 setup.py | 15 ++-------------
9 1 file changed, 2 insertions(+), 13 deletions(-)
10
11Index: Python-3.3.2/setup.py
12===================================================================
13--- Python-3.3.2.orig/setup.py
14+++ Python-3.3.2/setup.py
15@@ -444,7 +444,8 @@ class PyBuildExt(build_ext):
16 # only change this for cross builds for 3.3, issues on Mageia
17 if cross_compiling:
18 self.add_gcc_paths()
19- self.add_multiarch_paths()
20+ if not cross_compiling:
21+ self.add_multiarch_paths()
22
23 # Add paths specified in the environment variables LDFLAGS and
24 # CPPFLAGS for header and library files.
25@@ -480,7 +481,7 @@ class PyBuildExt(build_ext):
26 for directory in reversed(options.dirs):
27 add_dir_to_list(dir_list, directory)
28
29- if os.path.normpath(sys.base_prefix) != '/usr' \
30+ if not cross_compiling and os.path.normpath(sys.base_prefix) != '/usr' \
31 and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
32 # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
33 # (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 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Updated original patch for python 2.7.3
4
5Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
62012/05/01
7
8
9# when compiling for an embedded system, we need every bit of
10# performance we can get. default to optimized with the option
11# of opt-out.
12# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
13
14Index: Python-3.2.3/Python/compile.c
15===================================================================
16--- Python-3.2.3.orig/Python/compile.c 2012-04-10 23:54:08.000000000 -0700
17+++ Python-3.2.3/Python/compile.c 2012-09-19 15:58:46.649123998 -0700
18@@ -30,7 +30,7 @@
19 #include "symtable.h"
20 #include "opcode.h"
21
22-int Py_OptimizeFlag = 0;
23+int Py_OptimizeFlag = 1;
24
25 #define DEFAULT_BLOCK_SIZE 16
26 #define DEFAULT_BLOCKS 8
27Index: Python-3.2.3/Modules/main.c
28===================================================================
29--- Python-3.2.3.orig/Modules/main.c 2012-04-10 23:54:07.000000000 -0700
30+++ Python-3.2.3/Modules/main.c 2012-09-19 16:00:32.153124053 -0700
31@@ -46,7 +46,7 @@
32 static int orig_argc;
33
34 /* command line options */
35-#define BASE_OPTS L"bBc:dEhiJm:OqRsStuvVW:xX:?"
36+#define BASE_OPTS L"bBc:dEhiJm:NOqRsStuvVW:xX:?"
37
38 #define PROGRAM_OPTS BASE_OPTS
39
40@@ -71,6 +71,7 @@
41 -m mod : run library module as a script (terminates option list)\n\
42 -O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\
43 -OO : remove doc-strings in addition to the -O optimizations\n\
44+-N : do NOT optimize generated bytecode\n\
45 -q : don't print version and copyright messages on interactive startup\n\
46 -R : use a pseudo-random salt to make hash() values of various types be\n\
47 unpredictable between separate invocations of the interpreter, as\n\
48@@ -407,8 +408,8 @@
49
50 /* case 'J': reserved for Jython */
51
52- case 'O':
53- Py_OptimizeFlag++;
54+ case 'N':
55+ Py_OptimizeFlag=0;
56 break;
57
58 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 @@
1This fixes configure issues with recent autoconf, e.g:
2 autoreconf: Entering directory `Modules/_ctypes/libffi'
3 autoreconf: configure.ac: not using Gettext
4 autoreconf: running: aclocal --force
5 configure.ac:26: error: m4_copy: won't overwrite defined macro: _AC_ARG_VAR_PRECIOUS
6 configure.ac:26: the top level
7
8The problem is still present in python-2.6.5 but fixed in python-svn.
9
10Upstream-Status: Accepted [python-svn]
11
12Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
13Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
15Signed-off-by: Saul Wold <sgw@linux.intel.com>
16
17
182011/09/29
19Rebased for python 2.7.2
20Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
21
22
23Index: Python-2.7.2/Modules/_ctypes/libffi/Makefile.am
24===================================================================
25--- Python-2.7.2.orig/Modules/_ctypes/libffi/Makefile.am
26+++ Python-2.7.2/Modules/_ctypes/libffi/Makefile.am
27@@ -2,7 +2,7 @@
28
29 AUTOMAKE_OPTIONS = foreign subdir-objects
30
31-SUBDIRS = include testsuite man
32+SUBDIRS = include
33
34 EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
35 src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \
36@@ -34,8 +34,6 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change
37 libtool-version ChangeLog.libffi m4/libtool.m4 \
38 m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4
39
40-info_TEXINFOS = doc/libffi.texi
41-
42 ## ################################################################
43
44 ##
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 @@
1consider opkg directories when cleaning up
2
3-Khem
4
5Upstream-Status: Inappropriate [OE specific]
6
7---
8 Makefile.pre.in | 6 +++---
9 1 file changed, 3 insertions(+), 3 deletions(-)
10
11--- a/Makefile.pre.in
12+++ b/Makefile.pre.in
13@@ -1306,8 +1306,8 @@ touch:
14 # Sanitation targets -- clean leaves libraries, executables and tags
15 # files, which clobber removes as well
16 pycremoval:
17- -find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';'
18- -find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
19+ -find $(srcdir) ! -path './ipkg-install/*' -depth -name '__pycache__' -exec rm -rf {} ';'
20+ -find $(srcdir) ! -path './ipkg-install/*' -name '*.py[co]' -exec rm -f {} ';'
21
22 rmtestturds:
23 -rm -f *BAD *GOOD *SKIPPED
24@@ -1321,9 +1321,9 @@ docclean:
25 -rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils
26
27 clean: pycremoval
28- find . -name '*.[oa]' -exec rm -f {} ';'
29- find . -name '*.s[ol]' -exec rm -f {} ';'
30- find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
31+ find . ! -path './ipkg-install/*' -name '*.[oa]' -exec rm -f {} ';'
32+ find . ! -path './ipkg-install/*' -name '*.s[ol]' -exec rm -f {} ';'
33+ find . ! -path './ipkg-install/*' -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
34 find build -name 'fficonfig.h' -exec rm -f {} ';' || true
35 find build -name 'fficonfig.py' -exec rm -f {} ';' || true
36 -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 @@
1do not "adjust" python files before copying
2
3-Khem
4
5Upstream-Status: Inappropriate [Embedded-Specific]
6
7---
8 Lib/distutils/command/build_scripts.py | 43 +++------------------------------
9 1 file changed, 4 insertions(+), 39 deletions(-)
10
11--- a/Lib/distutils/command/build_scripts.py
12+++ b/Lib/distutils/command/build_scripts.py
13@@ -51,10 +51,7 @@ class build_scripts(Command):
14
15
16 def copy_scripts(self):
17- """Copy each script listed in 'self.scripts'; if it's marked as a
18- Python script in the Unix way (first line matches 'first_line_re',
19- ie. starts with "\#!" and contains "python"), then adjust the first
20- line to refer to the current Python interpreter as we copy.
21+ """Copy each script listed in 'self.scripts'
22 """
23 self.mkpath(self.build_dir)
24 outfiles = []
25@@ -78,64 +75,10 @@ class build_scripts(Command):
26 if not self.dry_run:
27 raise
28 f = None
29- else:
30- encoding, lines = tokenize.detect_encoding(f.readline)
31- f.seek(0)
32- first_line = f.readline()
33- if not first_line:
34- self.warn("%s is an empty file (skipping)" % script)
35- continue
36-
37- match = first_line_re.match(first_line)
38- if match:
39- adjust = True
40- post_interp = match.group(1) or b''
41-
42- if adjust:
43- log.info("copying and adjusting %s -> %s", script,
44- self.build_dir)
45- updated_files.append(outfile)
46- if not self.dry_run:
47- if not sysconfig.python_build:
48- executable = self.executable
49- else:
50- executable = os.path.join(
51- sysconfig.get_config_var("BINDIR"),
52- "python%s%s" % (sysconfig.get_config_var("VERSION"),
53- sysconfig.get_config_var("EXE")))
54- executable = os.fsencode(executable)
55- shebang = b"#!" + executable + post_interp + b"\n"
56- # Python parser starts to read a script using UTF-8 until
57- # it gets a #coding:xxx cookie. The shebang has to be the
58- # first line of a file, the #coding:xxx cookie cannot be
59- # written before. So the shebang has to be decodable from
60- # UTF-8.
61- try:
62- shebang.decode('utf-8')
63- except UnicodeDecodeError:
64- raise ValueError(
65- "The shebang ({!r}) is not decodable "
66- "from utf-8".format(shebang))
67- # If the script is encoded to a custom encoding (use a
68- # #coding:xxx cookie), the shebang has to be decodable from
69- # the script encoding too.
70- try:
71- shebang.decode(encoding)
72- except UnicodeDecodeError:
73- raise ValueError(
74- "The shebang ({!r}) is not decodable "
75- "from the script encoding ({})"
76- .format(shebang, encoding))
77- with open(outfile, "wb") as outf:
78- outf.write(shebang)
79- outf.writelines(f.readlines())
80- if f:
81- f.close()
82- else:
83- if f:
84+ if f:
85 f.close()
86- updated_files.append(outfile)
87- self.copy_file(script, outfile)
88+ updated_files.append(outfile)
89+ self.copy_file(script, outfile)
90
91 if os.name == 'posix':
92 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 @@
1Enable zlib in python
2
3-Khem
4
5Upstream-Status: Inappropriate [OE-Specific]
6
7---
8 Modules/Setup.dist | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11--- a/Modules/Setup.dist
12+++ b/Modules/Setup.dist
13@@ -354,7 +354,7 @@ _symtable symtablemodule.c
14 # Andrew Kuchling's zlib module.
15 # This require zlib 1.1.3 (or later).
16 # See http://www.gzip.org/zlib/
17-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
18+zlib zlibmodule.c -lz
19
20 # Interface to the Expat XML parser
21 #
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 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3# The proper prefix is inside our staging area.
4# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
5# Signed-off-by: Phil Blundell <philb@gnu.org>
6# Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8Index: Python-3.3.2/Lib/distutils/sysconfig.py
9===================================================================
10--- Python-3.3.2.orig/Lib/distutils/sysconfig.py 2013-07-30 00:00:52.769749805 -0700
11+++ Python-3.3.2/Lib/distutils/sysconfig.py 2013-07-30 00:16:22.545767248 -0700
12@@ -16,10 +16,11 @@
13 from .errors import DistutilsPlatformError
14
15 # These are needed in a couple of spots, so just compute them once.
16-PREFIX = os.path.normpath(sys.prefix)
17-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
18-BASE_PREFIX = os.path.normpath(sys.base_prefix)
19-BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
20+PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
21+EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
22+BASE_PREFIX = os.path.normpath(sys.base_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
23+BASE_EXEC_PREFIX= os.path.normpath(sys.base_exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
24+
25
26 # Path to the base directory of the project. On Windows the binary may
27 # live in project/PCBuild9. If we're dealing with an x64 Windows build,
28@@ -93,7 +94,9 @@
29 If 'prefix' is supplied, use it instead of sys.base_prefix or
30 sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
31 """
32- if prefix is None:
33+ if prefix is None and os.environ['STAGING_INCDIR'] != "":
34+ prefix = os.environ['STAGING_INCDIR'].rstrip('include')
35+ elif prefix is None:
36 prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
37 if os.name == "posix":
38 if python_build:
39@@ -136,6 +139,12 @@
40 If 'prefix' is supplied, use it instead of sys.base_prefix or
41 sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
42 """
43+ if prefix is None and os.environ['STAGING_LIBDIR'] != "":
44+ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
45+ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
46+ else:
47+ lib_basename = sys.lib
48+
49 if prefix is None:
50 if standard_lib:
51 prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
52@@ -144,7 +153,7 @@
53
54 if os.name == "posix":
55 libpython = os.path.join(prefix,
56- "lib", "python" + get_python_version())
57+ lib_basename, "python" + get_python_version())
58 if standard_lib:
59 return libpython
60 else:
61@@ -249,7 +258,7 @@
62 else:
63 # The name of the config.h file changed in 2.2
64 config_h = 'pyconfig.h'
65- return os.path.join(inc_dir, config_h)
66+ return os.path.join(inc_dir, config_h).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
67
68
69 def get_makefile_filename():
70@@ -258,7 +267,7 @@
71 return os.path.join(_sys_home or project_base, "Makefile")
72 lib_dir = get_python_lib(plat_specific=0, standard_lib=1)
73 config_file = 'config-{}{}'.format(get_python_version(), build_flags)
74- return os.path.join(lib_dir, config_file, 'Makefile')
75+ return os.path.join(lib_dir, config_file, 'Makefile').replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
76
77
78 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 @@
1package python-readline
2
3-Khem
4
5Upstream-Status: Inappropriate [Embedded Specific]
6
7--- a/setup.py
8+++ b/setup.py
9@@ -666,45 +666,7 @@ class PyBuildExt(build_ext):
10 # readline
11 do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
12 readline_termcap_library = ""
13- curses_library = ""
14- # Cannot use os.popen here in py3k.
15- tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib')
16- if not os.path.exists(self.build_temp):
17- os.makedirs(self.build_temp)
18- # Determine if readline is already linked against curses or tinfo.
19- if do_readline:
20- if cross_compiling:
21- ret = os.system("%s -d %s | grep '(NEEDED)' > %s" \
22- % (sysconfig.get_config_var('READELF'),
23- do_readline, tmpfile))
24- elif find_executable('ldd'):
25- ret = os.system("ldd %s > %s" % (do_readline, tmpfile))
26- else:
27- ret = 256
28- if ret >> 8 == 0:
29- with open(tmpfile) as fp:
30- for ln in fp:
31- if 'curses' in ln:
32- readline_termcap_library = re.sub(
33- r'.*lib(n?cursesw?)\.so.*', r'\1', ln
34- ).rstrip()
35- break
36- # termcap interface split out from ncurses
37- if 'tinfo' in ln:
38- readline_termcap_library = 'tinfo'
39- break
40- if os.path.exists(tmpfile):
41- os.unlink(tmpfile)
42- # Issue 7384: If readline is already linked against curses,
43- # use the same library for the readline and curses modules.
44- if 'curses' in readline_termcap_library:
45- curses_library = readline_termcap_library
46- elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
47- curses_library = 'ncursesw'
48- elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
49- curses_library = 'ncurses'
50- elif self.compiler.find_library_file(lib_dirs, 'curses'):
51- curses_library = 'curses'
52+ curses_library = "ncurses"
53
54 if host_platform == 'darwin':
55 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 @@
1Fix warning with newer compiler
2
3-Khem
4
5Upstream-Status: Pending
6
7--- a/Modules/_cursesmodule.c
8+++ b/Modules/_cursesmodule.c
9@@ -116,7 +116,7 @@ char *PyCursesVersion = "2.2";
10 #defines many common symbols (such as "lines") which breaks the
11 curses module in other ways. So the code will just specify
12 explicit prototypes here. */
13-extern int setupterm(char *,int,int *);
14+//extern int setupterm(char *,int,int *);
15 #ifdef __sgi
16 #include <term.h>
17 #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 @@
1We should make sure that sysroot is used by gcc instead of assuming
2hardcoded locations for include paths
3
4Upstream-Status: Pending
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7:
8Index: Python-3.3.3/configure.ac
9===================================================================
10--- Python-3.3.3.orig/configure.ac 2014-01-29 19:00:15.245312752 -0800
11+++ Python-3.3.3/configure.ac 2014-01-29 23:27:22.938526262 -0800
12@@ -1548,7 +1548,7 @@
13 # checks for header files
14 AC_HEADER_STDC
15 ac_save_cppflags="$CPPFLAGS"
16-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
17+CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw"
18 AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
19 fcntl.h grp.h \
20 ieeefp.h io.h langinfo.h libintl.h ncurses.h process.h pthread.h \
21@@ -4308,7 +4308,7 @@
22 fi
23
24 ac_save_cppflags="$CPPFLAGS"
25-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
26+CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw"
27 # On HP/UX 11.0, mvwdelch is a block with a return statement
28 AC_MSG_CHECKING(whether mvwdelch is an expression)
29 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 @@
1_tkinter module needs tk module along with tcl. tk is not yet integrated
2in yocto so we skip the check for this module.
3Avoid a warning by not adding this module to missing variable.
4
5Upstream-Status: Inappropriate [distribution]
6
7Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
8
9Index: Python-2.7.2/setup.py
10===================================================================
11--- Python-2.7.2.orig/setup.py 2012-04-05 23:18:38.500136647 +0300
12+++ Python-2.7.2/setup.py 2012-04-05 23:19:35.888134969 +0300
13@@ -1634,8 +1634,10 @@
14 # Call the method for detecting whether _tkinter can be compiled
15 self.detect_tkinter(inc_dirs, lib_dirs)
16
17- if '_tkinter' not in [e.name for e in self.extensions]:
18- missing.append('_tkinter')
19+ # tkinter module will not be avalaible as yocto
20+ # doesn't have tk integrated (yet)
21+ #if '_tkinter' not in [e.name for e in self.extensions]:
22+ # missing.append('_tkinter')
23
24 return missing
25
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 @@
1Lib/cgi.py: Update the script as mentioned in the comment
2
3Upstream-Status: Inappropriate [distribution]
4
5Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
6
7--- Python-2.6.6/Lib/cgi.py.orig 2010-08-01 22:14:27.000000000 -0500
8+++ Python-2.6.6/Lib/cgi.py 2011-09-21 15:28:40.478208631 -0500
9@@ -1,13 +1,4 @@
10-#! /usr/local/bin/python
11-
12-# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
13-# intentionally NOT "/usr/bin/env python". On many systems
14-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
15-# scripts, and /usr/local/bin is the default directory where Python is
16-# installed, so /usr/bin/env would be unable to find python. Granted,
17-# binary installations by Linux vendors often install Python in
18-# /usr/bin. So let those vendors patch cgi.py to match their choice
19-# of installation.
20+#! /usr/bin/env python
21
22 """Support module for CGI (Common Gateway Interface) scripts.
23
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 @@
1Fix a missed dependency on ast.h which can result in race condition
2at high parallel build
3
4It fixed here
5
6http://hg.python.org/cpython/rev/cfe0a293551f
7
8[YOCTO #5884]
9
10Upstream-Status: Backport
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12
13Index: Python-3.3.3/Makefile.pre.in
14===================================================================
15--- Python-3.3.3.orig/Makefile.pre.in 2014-02-26 09:33:13.868288863 -0800
16+++ Python-3.3.3/Makefile.pre.in 2014-02-26 09:36:27.348292492 -0800
17@@ -853,7 +853,8 @@
18 $(srcdir)/Include/warnings.h \
19 $(srcdir)/Include/weakrefobject.h \
20 pyconfig.h \
21- $(PARSER_HEADERS)
22+ $(PARSER_HEADERS) \
23+ $(AST_H)
24
25 $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
26
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 @@
1Upstream-Status: Inappropriate [Embedded specific]
2
3This patch fixes issuing with different libdir like lib64.
4This patch makes the native python binary modules findable
5in the install process of the host python.
6
7Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
8Date: 2012/03/14
9
10Updated for python 2.7.3
11Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
12Date: 2012/05/01
13
14Index: Python-3.3.0rc2/Lib/sysconfig.py
15===================================================================
16--- Python-3.3.0rc2.orig/Lib/sysconfig.py 2012-09-20 22:50:11.000000000 -0700
17+++ Python-3.3.0rc2/Lib/sysconfig.py 2012-09-20 22:53:01.561123396 -0700
18@@ -21,9 +21,9 @@
19
20 _INSTALL_SCHEMES = {
21 'posix_prefix': {
22- 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}',
23+ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
24 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
25- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
26+ 'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages',
27 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
28 'include':
29 '{installed_base}/include/python{py_version_short}{abiflags}',
30@@ -83,7 +83,7 @@
31 'posix_user': {
32 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
33 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
34- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
35+ 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
36 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
37 'include': '{userbase}/include/python{py_version_short}',
38 'scripts': '{userbase}/bin',
39Index: Python-3.3.0rc2/Makefile.pre.in
40===================================================================
41--- Python-3.3.0rc2.orig/Makefile.pre.in 2012-09-20 22:50:11.000000000 -0700
42+++ Python-3.3.0rc2/Makefile.pre.in 2012-09-20 22:50:54.245123997 -0700
43@@ -1080,9 +1080,9 @@
44 $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
45 $(DESTDIR)$(LIBDEST)/distutils/tests ; \
46 fi
47- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
48+ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
49 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
50- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
51+ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
52 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
53
54 # 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 @@
1when building python for qemux86-64 on ubuntu 11.10/64bit
2it gropes into host includes and then mixes them with cross
3includes and as a result some modules fail to compile and link
4one of the modules is python-elementtree which is then not
5found during image creation
6
7Proble is that setup.py tries to add native includes that newer
8ubuntu has introduced for multiarch support. But that should
9only happen for native builds and not cross building python
10so we add a check here.
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13Upstream-Status: Pending
14
15Index: Python-3.3.0rc2/setup.py
16===================================================================
17--- Python-3.3.0rc2.orig/setup.py 2012-09-20 21:54:50.000000000 -0700
18+++ Python-3.3.0rc2/setup.py 2012-09-20 21:57:35.029123858 -0700
19@@ -402,6 +402,9 @@
20
21 if not find_executable('dpkg-architecture'):
22 return
23+ if cross_compiling:
24+ return
25+
26 opt = ''
27 if cross_compiling:
28 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..62d7de12f9
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/makerace.patch
@@ -0,0 +1,26 @@
1There is a race due to the execution of make inside the makefile:
2
3| 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
4| 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
5| 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
6| Objects/obmalloc.o: file not recognized: File truncated
7| collect2: error: ld returned 1 exit status
8| make[1]: *** [Parser/pgen] Error 1
9
10The easiest way to avoid this is to list the dependencies explictly.
11
12RP 28/2/2014
13
14Index: Python-3.3.3/Makefile.pre.in
15===================================================================
16--- Python-3.3.3.orig/Makefile.pre.in 2014-02-27 14:04:38.268339533 +0000
17+++ Python-3.3.3/Makefile.pre.in 2014-02-28 10:40:59.166361125 +0000
18@@ -676,7 +676,7 @@
19
20 $(IO_OBJS): $(IO_H)
21
22-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
23+$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) $(PGEN)
24 @$(MKDIR_P) Include
25 $(MAKE) $(PGEN)
26 $(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 @@
1get the sys.lib from python itself and do not use hardcoded value of 'lib'
2
3-Khem
4
5Upstream-Status: Pending
6
7Index: Python-3.3.2/Include/pythonrun.h
8===================================================================
9--- Python-3.3.2.orig/Include/pythonrun.h 2013-05-15 09:32:54.000000000 -0700
10+++ Python-3.3.2/Include/pythonrun.h 2013-07-27 16:19:54.099877246 -0700
11@@ -181,6 +181,8 @@
12 /* In their own files */
13 PyAPI_FUNC(const char *) Py_GetVersion(void);
14 PyAPI_FUNC(const char *) Py_GetPlatform(void);
15+PyAPI_FUNC(const char *) Py_GetArch(void);
16+PyAPI_FUNC(const char *) Py_GetLib(void);
17 PyAPI_FUNC(const char *) Py_GetCopyright(void);
18 PyAPI_FUNC(const char *) Py_GetCompiler(void);
19 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
20Index: Python-3.3.2/Lib/distutils/command/install.py
21===================================================================
22--- Python-3.3.2.orig/Lib/distutils/command/install.py 2013-05-15 09:32:54.000000000 -0700
23+++ Python-3.3.2/Lib/distutils/command/install.py 2013-07-27 16:19:54.099877246 -0700
24@@ -25,6 +25,8 @@
25 from site import USER_SITE
26 HAS_USER_SITE = True
27
28+libname = sys.lib
29+
30 if sys.version < "2.2":
31 WINDOWS_SCHEME = {
32 'purelib': '$base',
33@@ -45,7 +47,7 @@
34 INSTALL_SCHEMES = {
35 'unix_prefix': {
36 'purelib': '$base/lib/python$py_version_short/site-packages',
37- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
38+ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
39 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
40 'scripts': '$base/bin',
41 'data' : '$base',
42Index: Python-3.3.2/Lib/pydoc.py
43===================================================================
44--- Python-3.3.2.orig/Lib/pydoc.py 2013-05-15 09:32:55.000000000 -0700
45+++ Python-3.3.2/Lib/pydoc.py 2013-07-27 16:19:54.103877246 -0700
46@@ -372,7 +372,7 @@
47
48 docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS)
49
50- basedir = os.path.join(sys.base_exec_prefix, "lib",
51+ basedir = os.path.join(sys.base_exec_prefix, sys.lib,
52 "python%d.%d" % sys.version_info[:2])
53 if (isinstance(object, type(os)) and
54 (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
55Index: Python-3.3.2/Lib/site.py
56===================================================================
57--- Python-3.3.2.orig/Lib/site.py 2013-05-15 09:32:55.000000000 -0700
58+++ Python-3.3.2/Lib/site.py 2013-07-27 16:19:54.103877246 -0700
59@@ -303,13 +303,19 @@
60 if sys.platform in ('os2emx', 'riscos'):
61 sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
62 elif os.sep == '/':
63- sitepackages.append(os.path.join(prefix, "lib",
64+ sitepackages.append(os.path.join(prefix, sys.lib,
65 "python" + sys.version[:3],
66 "site-packages"))
67- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
68+ if sys.lib != "lib":
69+ sitepackages.append(os.path.join(prefix, "lib",
70+ "python" + sys.version[:3],
71+ "site-packages"))
72+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
73+ if sys.lib != "lib":
74+ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
75 else:
76 sitepackages.append(prefix)
77- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
78+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
79 if sys.platform == "darwin":
80 # for framework builds *only* we add the standard Apple
81 # locations.
82Index: Python-3.3.2/Lib/trace.py
83===================================================================
84--- Python-3.3.2.orig/Lib/trace.py 2013-05-15 09:32:56.000000000 -0700
85+++ Python-3.3.2/Lib/trace.py 2013-07-27 16:19:54.103877246 -0700
86@@ -751,10 +751,10 @@
87 # should I also call expanduser? (after all, could use $HOME)
88
89 s = s.replace("$prefix",
90- os.path.join(sys.base_prefix, "lib",
91+ os.path.join(sys.base_prefix, sys.lib,
92 "python" + sys.version[:3]))
93 s = s.replace("$exec_prefix",
94- os.path.join(sys.base_exec_prefix, "lib",
95+ os.path.join(sys.base_exec_prefix, sys.lib,
96 "python" + sys.version[:3]))
97 s = os.path.normpath(s)
98 ignore_dirs.append(s)
99Index: Python-3.3.2/Makefile.pre.in
100===================================================================
101--- Python-3.3.2.orig/Makefile.pre.in 2013-07-27 16:19:16.000000000 -0700
102+++ Python-3.3.2/Makefile.pre.in 2013-07-27 16:19:54.103877246 -0700
103@@ -96,6 +96,8 @@
104
105 # Machine-dependent subdirectories
106 MACHDEP= @MACHDEP@
107+LIB= @LIB@
108+ARCH= @ARCH@
109
110 # Multiarch directory (may be empty)
111 MULTIARCH= @MULTIARCH@
112@@ -115,7 +117,7 @@
113 MANDIR= @mandir@
114 INCLUDEDIR= @includedir@
115 CONFINCLUDEDIR= $(exec_prefix)/include
116-SCRIPTDIR= $(prefix)/lib
117+SCRIPTDIR= @libdir@
118 ABIFLAGS= @ABIFLAGS@
119
120 # Detailed destination directories
121@@ -635,6 +637,7 @@
122 -DEXEC_PREFIX='"$(exec_prefix)"' \
123 -DVERSION='"$(VERSION)"' \
124 -DVPATH='"$(VPATH)"' \
125+ -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \
126 -o $@ $(srcdir)/Modules/getpath.c
127
128 Modules/python.o: $(srcdir)/Modules/python.c
129@@ -701,7 +704,7 @@
130 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
131
132 Python/getplatform.o: $(srcdir)/Python/getplatform.c
133- $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
134+ $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
135
136 Python/importdl.o: $(srcdir)/Python/importdl.c
137 $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
138Index: Python-3.3.2/Modules/getpath.c
139===================================================================
140--- Python-3.3.2.orig/Modules/getpath.c 2013-05-15 09:32:59.000000000 -0700
141+++ Python-3.3.2/Modules/getpath.c 2013-07-27 16:19:54.107877246 -0700
142@@ -121,9 +121,11 @@
143 #define EXEC_PREFIX PREFIX
144 #endif
145
146+#define LIB_PYTHON LIB "/python" VERSION
147+
148 #ifndef PYTHONPATH
149-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
150- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
151+#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
152+ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
153 #endif
154
155 #ifndef LANDMARK
156@@ -135,7 +137,7 @@
157 static wchar_t progpath[MAXPATHLEN+1];
158 static wchar_t *module_search_path = NULL;
159 static int module_search_path_malloced = 0;
160-static wchar_t *lib_python = L"lib/python" VERSION;
161+static wchar_t *lib_python = L"" LIB_PYTHON;
162
163 static void
164 reduce(wchar_t *dir)
165Index: Python-3.3.2/Python/getplatform.c
166===================================================================
167--- Python-3.3.2.orig/Python/getplatform.c 2013-05-15 09:33:00.000000000 -0700
168+++ Python-3.3.2/Python/getplatform.c 2013-07-27 16:19:54.107877246 -0700
169@@ -10,3 +10,23 @@
170 {
171 return PLATFORM;
172 }
173+
174+#ifndef ARCH
175+#define ARCH "unknown"
176+#endif
177+
178+const char *
179+Py_GetArch(void)
180+{
181+ return ARCH;
182+}
183+
184+#ifndef LIB
185+#define LIB "lib"
186+#endif
187+
188+const char *
189+Py_GetLib(void)
190+{
191+ return LIB;
192+}
193Index: Python-3.3.2/Python/sysmodule.c
194===================================================================
195--- Python-3.3.2.orig/Python/sysmodule.c 2013-05-15 09:33:00.000000000 -0700
196+++ Python-3.3.2/Python/sysmodule.c 2013-07-27 16:19:54.107877246 -0700
197@@ -1612,6 +1612,10 @@
198 PyUnicode_FromString(Py_GetCopyright()));
199 SET_SYS_FROM_STRING("platform",
200 PyUnicode_FromString(Py_GetPlatform()));
201+ SET_SYS_FROM_STRING("arch",
202+ PyUnicode_FromString(Py_GetArch()));
203+ SET_SYS_FROM_STRING("lib",
204+ PyUnicode_FromString(Py_GetLib()));
205 SET_SYS_FROM_STRING("executable",
206 PyUnicode_FromWideChar(
207 Py_GetProgramFullPath(), -1));
208Index: Python-3.3.2/setup.py
209===================================================================
210--- Python-3.3.2.orig/setup.py 2013-07-27 16:19:17.000000000 -0700
211+++ Python-3.3.2/setup.py 2013-07-27 16:19:54.107877246 -0700
212@@ -439,7 +439,7 @@
213 # directories (i.e. '.' and 'Include') must be first. See issue
214 # 10520.
215 if not cross_compiling:
216- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
217+ add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib))
218 add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
219 # only change this for cross builds for 3.3, issues on Mageia
220 if cross_compiling:
221@@ -497,8 +497,7 @@
222 # be assumed that no additional -I,-L directives are needed.
223 if not cross_compiling:
224 lib_dirs = self.compiler.library_dirs + [
225- '/lib64', '/usr/lib64',
226- '/lib', '/usr/lib',
227+ '/' + sys.lib, '/usr/' + sys.lib,
228 ]
229 inc_dirs = self.compiler.include_dirs + ['/usr/include']
230 else:
231@@ -675,11 +674,11 @@
232 elif curses_library:
233 readline_libs.append(curses_library)
234 elif self.compiler.find_library_file(lib_dirs +
235- ['/usr/lib/termcap'],
236+ ['/usr/'+sys.lib+'/termcap'],
237 'termcap'):
238 readline_libs.append('termcap')
239 exts.append( Extension('readline', ['readline.c'],
240- library_dirs=['/usr/lib/termcap'],
241+ library_dirs=['/usr/'+sys.lib+'/termcap'],
242 extra_link_args=readline_extra_link_args,
243 libraries=readline_libs) )
244 else:
245Index: Python-3.3.2/Lib/sysconfig.py
246===================================================================
247--- Python-3.3.2.orig/Lib/sysconfig.py 2013-05-15 09:32:55.000000000 -0700
248+++ Python-3.3.2/Lib/sysconfig.py 2013-07-27 16:19:54.111877246 -0700
249@@ -21,10 +21,10 @@
250
251 _INSTALL_SCHEMES = {
252 'posix_prefix': {
253- 'stdlib': '{installed_base}/lib/python{py_version_short}',
254- 'platstdlib': '{platbase}/lib/python{py_version_short}',
255+ 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}',
256+ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
257 'purelib': '{base}/lib/python{py_version_short}/site-packages',
258- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
259+ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
260 'include':
261 '{installed_base}/include/python{py_version_short}{abiflags}',
262 'platinclude':
263@@ -33,10 +33,10 @@
264 'data': '{base}',
265 },
266 'posix_home': {
267- 'stdlib': '{installed_base}/lib/python',
268- 'platstdlib': '{base}/lib/python',
269+ 'stdlib': '{installed_base}/'+sys.lib+'/python',
270+ 'platstdlib': '{base}/'+sys.lib+'/python',
271 'purelib': '{base}/lib/python',
272- 'platlib': '{base}/lib/python',
273+ 'platlib': '{base}/'+sys.lib+'/python',
274 'include': '{installed_base}/include/python',
275 'platinclude': '{installed_base}/include/python',
276 'scripts': '{base}/bin',
277@@ -81,10 +81,10 @@
278 'data': '{userbase}',
279 },
280 'posix_user': {
281- 'stdlib': '{userbase}/lib/python{py_version_short}',
282- 'platstdlib': '{userbase}/lib/python{py_version_short}',
283+ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
284+ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
285 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
286- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
287+ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
288 'include': '{userbase}/include/python{py_version_short}',
289 'scripts': '{userbase}/bin',
290 'data': '{userbase}',
291Index: Python-3.3.2/configure.ac
292===================================================================
293--- Python-3.3.2.orig/configure.ac 2013-05-15 09:33:00.000000000 -0700
294+++ Python-3.3.2/configure.ac 2013-07-27 16:19:54.111877246 -0700
295@@ -769,6 +769,41 @@
296 MULTIARCH=$($CC --print-multiarch 2>/dev/null)
297 AC_SUBST(MULTIARCH)
298
299+AC_SUBST(ARCH)
300+AC_MSG_CHECKING(ARCH)
301+ARCH=`uname -m`
302+case $ARCH in
303+i?86) ARCH=i386;;
304+esac
305+AC_MSG_RESULT($ARCH)
306+
307+AC_SUBST(LIB)
308+AC_MSG_CHECKING(LIB)
309+case $ac_sys_system in
310+Linux*)
311+ # Test if the compiler is 64bit
312+ echo 'int i;' > conftest.$ac_ext
313+ python_cv_cc_64bit_output=no
314+ if AC_TRY_EVAL(ac_compile); then
315+ case `/usr/bin/file conftest.$ac_objext` in
316+ *"ELF 64"*)
317+ python_cv_cc_64bit_output=yes
318+ ;;
319+ esac
320+ fi
321+ rm -rf conftest*
322+ ;;
323+esac
324+
325+case $ARCH:$python_cv_cc_64bit_output in
326+ppc64:yes | powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
327+ LIB="lib64"
328+ ;;
329+*:*)
330+ LIB="lib"
331+ ;;
332+esac
333+AC_MSG_RESULT($LIB)
334
335 AC_SUBST(LIBRARY)
336 AC_MSG_CHECKING(LIBRARY)
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 @@
1python3: fix build error with Readline 6.3
2
3Backport two patches from upstream:
4
5use new readline function types (closes #20374)
6Issue #20374: Avoid compiler warnings when compiling readline with libedit.
7
8Upstream-Status: Backport
9
10Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
11---
12 Modules/readline.c | 15 ++++++++++++---
13 1 file changed, 12 insertions(+), 3 deletions(-)
14
15diff --git a/Modules/readline.c b/Modules/readline.c
16index 096c6d1..1646ef8 100644
17--- a/Modules/readline.c
18+++ b/Modules/readline.c
19@@ -773,15 +773,24 @@ on_hook(PyObject *func)
20 return result;
21 }
22
23+
24 static int
25+#if defined(_RL_FUNCTION_TYPEDEF)
26 on_startup_hook(void)
27+#else
28+on_startup_hook()
29+#endif
30 {
31 return on_hook(startup_hook);
32 }
33
34 #ifdef HAVE_RL_PRE_INPUT_HOOK
35 static int
36+#if defined(_RL_FUNCTION_TYPEDEF)
37 on_pre_input_hook(void)
38+#else
39+on_pre_input_hook()
40+#endif
41 {
42 return on_hook(pre_input_hook);
43 }
44@@ -936,12 +945,12 @@ setup_readline(void)
45 rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap);
46 rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap);
47 /* Set our hook functions */
48- rl_startup_hook = (Function *)on_startup_hook;
49+ rl_startup_hook = (rl_hook_func_t *)on_startup_hook;
50 #ifdef HAVE_RL_PRE_INPUT_HOOK
51- rl_pre_input_hook = (Function *)on_pre_input_hook;
52+ rl_pre_input_hook = (rl_hook_func_t *)on_pre_input_hook;
53 #endif
54 /* Set our completion function */
55- rl_attempted_completion_function = (CPPFunction *)flex_complete;
56+ rl_attempted_completion_function = (rl_completion_func_t *)flex_complete;
57 /* Set Python word break characters */
58 completer_word_break_characters =
59 rl_completer_word_break_characters =
60--
611.7.9.5
62
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 @@
1This patch removes the RPATH setting which contains a pointer to
2the target relocated sysroot, which is incorrect.
3
4Upstream-Status: Inappropriate [Embedded Specific]
5
6Signed-off-by: Saul Wold <sgw@linux.intel.com>
7
8Index: Python-2.6.6/setup.py
9===================================================================
10--- Python-2.6.6.orig/setup.py 2011-09-28 14:22:57.000000000 -0700
11+++ Python-2.6.6/setup.py 2011-09-28 16:11:25.147279633 -0700
12@@ -1079,7 +1079,6 @@
13 include_dirs=["Modules/_sqlite",
14 sqlite_incdir],
15 library_dirs=sqlite_libdir,
16- runtime_library_dirs=sqlite_libdir,
17 extra_link_args=sqlite_extra_link_args,
18 libraries=["sqlite3",]))
19 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 @@
1This patch removes various ways native system options can pass into the python
2compilation and somehow break C modules.
3
4Upstream-Status: Configuration [OE Specific]
5
6RP 2012/04/23
7
8Index: Python-2.7.2/setup.py
9===================================================================
10--- Python-2.7.2.orig/setup.py 2012-04-23 20:03:47.295582553 +0000
11+++ Python-2.7.2/setup.py 2012-04-23 20:03:15.000000000 +0000
12@@ -231,7 +231,13 @@
13 # compilers
14 if compiler is not None:
15 (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
16- args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
17+ # Need to filter out -isysroot from the flags. Ideally should
18+ # figure out target flags here.
19+ flags = []
20+ for f in cflags.split():
21+ if not f.startswith("-isystem"):
22+ flags.append(f)
23+ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + ' '.join(flags)
24 self.compiler.set_executables(**args)
25
26 build_ext.build_extensions(self)
27@@ -393,7 +399,6 @@
28 # into configure and stored in the Makefile (issue found on OS X 10.3).
29 for env_var, arg_name, dir_list in (
30 ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
31- ('LDFLAGS', '-L', self.compiler.library_dirs),
32 ('CPPFLAGS', '-I', self.compiler.include_dirs)):
33 env_val = sysconfig.get_config_var(env_var)
34 if env_val:
35@@ -419,16 +424,16 @@
36 for directory in reversed(options.dirs):
37 add_dir_to_list(dir_list, directory)
38
39- if os.path.normpath(sys.prefix) != '/usr' \
40- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
41+# if os.path.normpath(sys.prefix) != '/usr' \
42+# and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
43 # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
44 # (PYTHONFRAMEWORK is set) to avoid # linking problems when
45 # building a framework with different architectures than
46 # the one that is currently installed (issue #7473)
47- add_dir_to_list(self.compiler.library_dirs,
48- sysconfig.get_config_var("LIBDIR"))
49- add_dir_to_list(self.compiler.include_dirs,
50- sysconfig.get_config_var("INCLUDEDIR"))
51+# add_dir_to_list(self.compiler.library_dirs,
52+# sysconfig.get_config_var("LIBDIR"))
53+# add_dir_to_list(self.compiler.include_dirs,
54+# sysconfig.get_config_var("INCLUDEDIR"))
55
56 try:
57 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 @@
1shutils should consider symlinks
2
3-Khem
4
5Upstream-Status: Pending
6
7--- a/Lib/shutil.py 2013-01-29 12:31:06.926555779 -0800
8+++ b/Lib/shutil.py 2013-01-29 16:31:39.097554182 -0800
9@@ -132,7 +132,7 @@ def copymode(src, dst, *, follow_symlink
10 st = stat_func(src)
11 chmod_func(dst, stat.S_IMODE(st.st_mode))
12
13-if hasattr(os, 'listxattr'):
14+if hasattr(os, 'listxattr') and os.listxattr in os.supports_follow_symlinks:
15 def _copyxattr(src, dst, *, follow_symlinks=True):
16 """Copy extended filesystem attributes from `src` to `dst`.
17
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 @@
1# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
2# GPLv2 or later
3# Version: 20081123
4# Features:
5# * set proper default encoding
6# * enable readline completion in the interactive interpreter
7# * load command line history on startup
8# * save command line history on exit
9
10import os
11
12def __exithandler():
13 try:
14 readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
15 except IOError:
16 pass
17
18def __registerExitHandler():
19 import atexit
20 atexit.register( __exithandler )
21
22def __enableReadlineSupport():
23 readline.set_history_length( 1000 )
24 readline.parse_and_bind( "tab: complete" )
25 try:
26 readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
27 except IOError:
28 pass
29
30import sys
31try:
32 import rlcompleter, readline
33except ImportError:
34 pass
35else:
36 __registerExitHandler()
37 __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 @@
1Upstream-Status: Accepted [http://hg.python.org/cpython/rev/c816479f6aaf/]
2Bugtracker: http://bugs.python.org/issue12326
3
4[Removed "Misc/NEWS" hunk]
5
6Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
7
8# HG changeset patch
9# User Victor Stinner <victor.stinner@haypocalc.com>
10# Date 1313841758 -7200
11# Node ID c816479f6aaf71dbd3f3fe4b239186d60c55ce48
12# Parent 3e093590ac57fdda428c7da3f72ddf0c475ecf2b
13Issue #12326: sys.platform is now always 'linux2' on Linux
14
15Even if Python is compiled on Linux 3.
16
17Index: Python-3.3.0rc2/configure.ac
18===================================================================
19--- Python-3.3.0rc2.orig/configure.ac 2012-09-09 02:11:14.000000000 -0700
20+++ Python-3.3.0rc2/configure.ac 2012-09-20 00:44:03.317124001 -0700
21@@ -366,7 +366,7 @@
22 MACHDEP="$ac_md_system$ac_md_release"
23
24 case $MACHDEP in
25- linux*) MACHDEP="linux";;
26+ linux*) MACHDEP="linux2";;
27 cygwin*) MACHDEP="cygwin";;
28 darwin*) MACHDEP="darwin";;
29 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 @@
1Dont search hardcoded paths, we might be doing a cross-build
2Use '=' in-front to let compiler append sysroot, if it can
3
4Should fix things like
5
6configure: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
7cc1: warning: include location "/usr/include/ncursesw" is unsafe for cross-compilation [-Wpoison-system-directories]
8
9
10Signed-off-by: Khem Raj
11Upstream-Status: Pending
12
13
14Index: Python-3.3.2/setup.py
15===================================================================
16--- Python-3.3.2.orig/setup.py 2013-07-30 01:30:48.000000000 -0700
17+++ Python-3.3.2/setup.py 2013-07-30 01:41:11.697862723 -0700
18@@ -1210,7 +1210,7 @@
19 panel_library = 'panel'
20 if curses_library == 'ncursesw':
21 curses_defines.append(('HAVE_NCURSESW', '1'))
22- curses_includes.append('/usr/include/ncursesw')
23+ curses_includes.append('=/usr/include/ncursesw')
24 # Bug 1464056: If _curses.so links with ncursesw,
25 # _curses_panel.so must link with panelw.
26 panel_library = 'panelw'
27@@ -1819,7 +1819,7 @@
28 if host_platform == 'darwin':
29 # OS X 10.5 comes with libffi.dylib; the include files are
30 # in /usr/include/ffi
31- inc_dirs.append('/usr/include/ffi')
32+ inc_dirs.append('=/usr/include/ffi')
33
34 ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
35 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..b2229b4a57
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/unixccompiler.patch
@@ -0,0 +1,33 @@
1Upstream-Status: Pending
2
3The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information.
4This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name.
5
6Secondly add -L=<path> this way linker will be able to resolve /usr/lib w.r.t sysroot and not
7use hardcoded /usr/lib to look for libs which is wrong in cross compile environment and this will work
8ok on native systems too since sysroot for native compilers is /
9
10Signed-off-by: Mei Lei <lei.mei@intel.com>
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12Index: Python-3.3.2/Lib/distutils/unixccompiler.py
13===================================================================
14--- Python-3.3.2.orig/Lib/distutils/unixccompiler.py 2013-05-15 09:32:54.000000000 -0700
15+++ Python-3.3.2/Lib/distutils/unixccompiler.py 2013-08-01 00:58:18.629056286 -0700
16@@ -202,7 +202,7 @@
17 # ccompiler.py.
18
19 def library_dir_option(self, dir):
20- return "-L" + dir
21+ return "-L=" + dir
22
23 def _is_gcc(self, compiler_name):
24 return "gcc" in compiler_name or "g++" in compiler_name
25@@ -221,7 +221,7 @@
26 # this time, there's no way to determine this information from
27 # the configuration data stored in the Python installation, so
28 # we use this hack.
29- compiler = os.path.basename(sysconfig.get_config_var("CC"))
30+ compiler = sysconfig.get_config_var("CC")
31 if sys.platform[:6] == "darwin":
32 # MacOSX's linker doesn't understand the -R flag at all
33 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..c357bbb07e
--- /dev/null
+++ b/meta/recipes-devtools/python/python3_3.3.3.bb
@@ -0,0 +1,217 @@
1require recipes-devtools/python/python.inc
2
3DEPENDS = "python3-native libffi bzip2 db gdbm openssl readline sqlite3 zlib virtual/libintl xz"
4PR = "${INC_PR}.0"
5PYTHON_MAJMIN = "3.3"
6PYTHON_BINABI= "${PYTHON_MAJMIN}m"
7DISTRO_SRC_URI ?= "file://sitecustomize.py"
8DISTRO_SRC_URI_linuxstdbase = ""
9SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
10file://12-distutils-prefix-is-inside-staging-area.patch \
11file://000-cross-compile.patch \
12file://020-dont-compile-python-files.patch \
13file://030-fixup-include-dirs.patch \
14file://070-dont-clean-ipkg-install.patch \
15file://080-distutils-dont_adjust_files.patch \
16file://110-enable-zlib.patch \
17file://130-readline-setup.patch \
18file://150-fix-setupterm.patch \
19file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
20file://fix-ast.h-dependency.patch \
21file://makerace.patch \
22${DISTRO_SRC_URI} \
23file://python3-fix-build-error-with-Readline-6.3.patch \
24"
25
26SRC_URI += "\
27 file://03-fix-tkinter-detection.patch \
28 file://04-default-is-optimized.patch \
29 file://avoid_warning_about_tkinter.patch \
30 file://06-ctypes-libffi-fix-configure.patch \
31 file://remove_sqlite_rpath.patch \
32 file://cgi_py.patch \
33 file://host_include_contamination.patch \
34 file://python-3.3-multilib.patch \
35 file://shutil-follow-symlink-fix.patch \
36 file://sysroot-include-headers.patch \
37 file://unixccompiler.patch \
38 file://avoid-ncursesw-include-path.patch \
39 "
40SRC_URI[md5sum] = "f3ebe34d4d8695bf889279b54673e10c"
41SRC_URI[sha256sum] = "e526e9b612f623888364d30cc9f3dfc34dcef39065c713bdbcddf47df84d8dcb"
42
43LIC_FILES_CHKSUM = "file://LICENSE;md5=4eaea08eaaf6875189b0c49f26fa2005"
44
45S = "${WORKDIR}/Python-${PV}"
46
47inherit autotools multilib_header python3native pkgconfig
48
49CONFIGUREOPTS += " --with-system-ffi "
50
51CACHED_CONFIGUREVARS = "ac_cv_have_chflags=no \
52 ac_cv_have_lchflags=no \
53 ac_cv_have_long_long_format=yes \
54 ac_cv_buggy_getaddrinfo=no \
55 ac_cv_file__dev_ptmx=yes \
56 ac_cv_file__dev_ptc=no \
57"
58# The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources
59#Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
60TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
61TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__"
62TARGET_CC_ARCH += "-DNDEBUG -fno-inline"
63EXTRA_OEMAKE += "CROSS_COMPILE=yes"
64
65# No ctypes option for python 3
66PYTHONLSBOPTS = ""
67
68do_configure_prepend() {
69 rm -f ${S}/Makefile.orig
70 autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf"
71}
72
73do_compile() {
74 # regenerate platform specific files, because they depend on system headers
75 cd Lib/plat-linux*
76 include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python3-native/python3 \
77 ${S}/Tools/scripts/h2py.py -i '(u_long)' \
78 ${STAGING_INCDIR}/dlfcn.h \
79 ${STAGING_INCDIR}/linux/cdrom.h \
80 ${STAGING_INCDIR}/netinet/in.h \
81 ${STAGING_INCDIR}/sys/types.h
82 sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
83 cd -
84
85 # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144
86 sed -i -e s,ccache,'$(CCACHE)', Makefile
87
88 # remove any bogus LD_LIBRARY_PATH
89 sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
90
91 if [ ! -f Makefile.orig ]; then
92 install -m 0644 Makefile Makefile.orig
93 fi
94 sed -i -e 's,^CONFIGURE_LDFLAGS=.*,CONFIGURE_LDFLAGS=-L. -L${STAGING_LIBDIR},g' \
95 -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
96 -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
97 -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
98 -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
99 -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
100 -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
101 Makefile
102 # save copy of it now, because if we do it in do_install and
103 # then call do_install twice we get Makefile.orig == Makefile.sysroot
104 install -m 0644 Makefile Makefile.sysroot
105
106 export CROSS_COMPILE="${TARGET_PREFIX}"
107 export PYTHONBUILDDIR="${S}"
108 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
109 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
110 STAGING_LIBDIR=${STAGING_LIBDIR} \
111 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
112 STAGING_INCDIR=${STAGING_INCDIR} \
113 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
114 LIB=${baselib} \
115 ARCH=${TARGET_ARCH} \
116 OPT="${CFLAGS}" libpython3.so
117
118 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native3/pgen \
119 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native3/python3 \
120 STAGING_LIBDIR=${STAGING_LIBDIR} \
121 STAGING_INCDIR=${STAGING_INCDIR} \
122 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
123 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
124 LIB=${baselib} \
125 ARCH=${TARGET_ARCH} \
126 OPT="${CFLAGS}"
127}
128
129do_install() {
130 # make install needs the original Makefile, or otherwise the inclues would
131 # go to ${D}${STAGING...}/...
132 install -m 0644 Makefile.orig Makefile
133
134 export CROSS_COMPILE="${TARGET_PREFIX}"
135 export PYTHONBUILDDIR="${S}"
136 install -d ${D}${libdir}/pkgconfig
137 install -d ${D}${libdir}/python${PYTHON_MAJMIN}/config
138
139 # rerun the build once again with original makefile this time
140 # run install in a separate step to avoid compile/install race
141 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native3/pgen \
142 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native3/python3 \
143 CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
144 STAGING_LIBDIR=${STAGING_LIBDIR} \
145 STAGING_INCDIR=${STAGING_INCDIR} \
146 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
147 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
148 LIB=${baselib} \
149 ARCH=${TARGET_ARCH} \
150 DESTDIR=${D} LIBDIR=${libdir}
151
152 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native3/pgen \
153 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native3/python3 \
154 CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
155 STAGING_LIBDIR=${STAGING_LIBDIR} \
156 STAGING_INCDIR=${STAGING_INCDIR} \
157 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
158 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
159 LIB=${baselib} \
160 ARCH=${TARGET_ARCH} \
161 DESTDIR=${D} LIBDIR=${libdir} install
162
163 install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
164
165 if [ -e ${WORKDIR}/sitecustomize.py ]; then
166 install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
167 fi
168
169 oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
170}
171
172do_install_append_class-nativesdk () {
173 create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
174}
175
176SSTATE_SCAN_FILES += "Makefile"
177PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
178
179py_package_preprocess () {
180 # copy back the old Makefile to fix target package
181 install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
182 # Remove references to buildmachine paths in target Makefile
183 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
184}
185
186require python-${PYTHON_MAJMIN}-manifest.inc
187
188# manual dependency additions
189RPROVIDES_${PN}-core = "${PN}"
190RRECOMMENDS_${PN}-core = "${PN}-readline"
191RRECOMMENDS_${PN}-crypt = "openssl"
192RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl"
193
194FILES_${PN}-2to3 += "${bindir}/2to3-${PYTHON_MAJMIN}"
195FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
196FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
197
198PACKAGES =+ "${PN}-pyvenv"
199FILES_${PN}-pyvenv += "${bindir}/pyvenv-${PYTHON_MAJMIN} ${bindir}/pyvenv"
200
201# package libpython3
202PACKAGES =+ "libpython3 libpython3-staticdev"
203FILES_libpython3 = "${libdir}/libpython*.so.*"
204FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/libpython${PYTHON_BINABI}.a"
205
206# catch debug extensions (isn't that already in python-core-dbg?)
207FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug"
208
209# catch all the rest (unsorted)
210PACKAGES += "${PN}-misc"
211FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
212
213# catch manpage
214PACKAGES += "${PN}-man"
215FILES_${PN}-man = "${datadir}/man"
216
217BBCLASSEXTEND = "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..0d641720f1
--- /dev/null
+++ b/meta/recipes-devtools/python/python_2.7.3.bb
@@ -0,0 +1,186 @@
1require python.inc
2DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib"
3PR = "${INC_PR}.3"
4
5DISTRO_SRC_URI ?= "file://sitecustomize.py"
6DISTRO_SRC_URI_linuxstdbase = ""
7SRC_URI += "\
8 file://01-use-proper-tools-for-cross-build.patch \
9 file://03-fix-tkinter-detection.patch \
10 file://05-enable-ctypes-cross-build.patch \
11 file://06-ctypes-libffi-fix-configure.patch \
12 file://06-avoid_usr_lib_termcap_path_in_linking.patch \
13 ${DISTRO_SRC_URI} \
14 file://multilib.patch \
15 file://cgi_py.patch \
16 file://remove_sqlite_rpath.patch \
17 file://setup_py_skip_cross_import_check.patch \
18 file://add-md5module-support.patch \
19 file://host_include_contamination.patch \
20 file://fix_for_using_different_libdir.patch \
21 file://setuptweaks.patch \
22 file://check-if-target-is-64b-not-host.patch \
23 file://search_db_h_in_inc_dirs_and_avoid_warning.patch \
24 file://avoid_warning_about_tkinter.patch \
25 file://avoid_warning_for_sunos_specific_module.patch \
26 file://python-2.7.3-berkeley-db-5.3.patch \
27 file://python-2.7.3-remove-bsdb-rpath.patch \
28 file://builddir.patch \
29 file://python-2.7.3-CVE-2012-2135.patch \
30 file://gcc-4.8-fix-configure-Wformat.patch \
31 file://fix-makefile-for-ptest.patch \
32 file://run-ptest \
33 file://CVE-2013-4073_py27.patch \
34 file://pypirc-secure.patch \
35 file://parallel-makeinst-create-bindir.patch \
36 file://python-2.7.3-CVE-2013-1752-smtplib-fix.patch \
37 file://python-fix-build-error-with-Readline-6.3.patch \
38 file://python-2.7.3-CVE-2014-1912.patch \
39"
40
41S = "${WORKDIR}/Python-${PV}"
42
43inherit autotools multilib_header python-dir pythonnative
44
45# The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources
46#Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
47TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
48TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__"
49
50do_configure_prepend() {
51 rm -f ${S}/Makefile.orig
52 autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf"
53}
54
55do_compile() {
56 # regenerate platform specific files, because they depend on system headers
57 cd Lib/plat-linux2
58 include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \
59 ${S}/Tools/scripts/h2py.py -i '(u_long)' \
60 ${STAGING_INCDIR}/dlfcn.h \
61 ${STAGING_INCDIR}/linux/cdrom.h \
62 ${STAGING_INCDIR}/netinet/in.h \
63 ${STAGING_INCDIR}/sys/types.h
64 sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
65 cd -
66
67 # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144
68 sed -i -e s,ccache\ ,'$(CCACHE) ', Makefile
69
70 # remove any bogus LD_LIBRARY_PATH
71 sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
72
73 if [ ! -f Makefile.orig ]; then
74 install -m 0644 Makefile Makefile.orig
75 fi
76 sed -i -e 's,^LDFLAGS=.*,LDFLAGS=-L. -L${STAGING_LIBDIR},g' \
77 -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
78 -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
79 -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
80 -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
81 -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
82 -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
83 Makefile
84 # save copy of it now, because if we do it in do_install and
85 # then call do_install twice we get Makefile.orig == Makefile.sysroot
86 install -m 0644 Makefile Makefile.sysroot
87
88 export CROSS_COMPILE="${TARGET_PREFIX}"
89 export PYTHONBUILDDIR="${S}"
90
91 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
92 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
93 STAGING_LIBDIR=${STAGING_LIBDIR} \
94 STAGING_INCDIR=${STAGING_INCDIR} \
95 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
96 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
97 OPT="${CFLAGS}"
98}
99
100do_install() {
101 # make install needs the original Makefile, or otherwise the inclues would
102 # go to ${D}${STAGING...}/...
103 install -m 0644 Makefile.orig Makefile
104
105 export CROSS_COMPILE="${TARGET_PREFIX}"
106 export PYTHONBUILDDIR="${S}"
107
108 # After swizzling the makefile, we need to run the build again.
109 # install can race with the build so we have to run this first, then install
110 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
111 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
112 CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
113 STAGING_LIBDIR=${STAGING_LIBDIR} \
114 STAGING_INCDIR=${STAGING_INCDIR} \
115 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
116 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
117 DESTDIR=${D} LIBDIR=${libdir}
118
119 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
120 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
121 CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
122 STAGING_LIBDIR=${STAGING_LIBDIR} \
123 STAGING_INCDIR=${STAGING_INCDIR} \
124 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
125 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
126 DESTDIR=${D} LIBDIR=${libdir} install
127
128 install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
129
130 if [ -e ${WORKDIR}/sitecustomize.py ]; then
131 install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
132 fi
133
134 oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
135}
136
137do_install_append_class-nativesdk () {
138 create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
139}
140
141SSTATE_SCAN_FILES += "Makefile"
142PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
143
144py_package_preprocess () {
145 # copy back the old Makefile to fix target package
146 install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
147
148 # Remove references to buildmachine paths in target Makefile
149 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
150}
151
152require python-${PYTHON_MAJMIN}-manifest.inc
153
154# manual dependency additions
155RPROVIDES_${PN}-core = "${PN}"
156RRECOMMENDS_${PN}-core = "${PN}-readline"
157RRECOMMENDS_${PN}-crypt = "openssl"
158RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl"
159
160# package libpython2
161PACKAGES =+ "lib${BPN}2"
162FILES_lib${BPN}2 = "${libdir}/libpython*.so.*"
163
164# catch debug extensions (isn't that already in python-core-dbg?)
165FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug"
166
167# catch all the rest (unsorted)
168PACKAGES += "${PN}-misc"
169FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
170RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-misc"
171#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten
172inherit ptest
173
174# This must come after inherit ptest for the override to take effect
175do_install_ptest() {
176 cp ${B}/Makefile ${D}${PTEST_PATH}
177 sed -e s:LIBDIR/python/ptest:${PTEST_PATH}:g \
178 -e s:LIBDIR:${libdir}:g \
179 -i ${D}${PTEST_PATH}/run-ptest
180}
181
182# catch manpage
183PACKAGES += "${PN}-man"
184FILES_${PN}-man = "${datadir}/man"
185
186BBCLASSEXTEND = "nativesdk"