summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python
diff options
context:
space:
mode:
authorAdrian Dudau <adrian.dudau@enea.com>2013-12-12 13:38:32 +0100
committerAdrian Dudau <adrian.dudau@enea.com>2013-12-12 13:50:20 +0100
commite2e6f6fe07049f33cb6348780fa975162752e421 (patch)
treeb1813295411235d1297a0ed642b1346b24fdfb12 /meta/recipes-devtools/python
downloadpoky-e2e6f6fe07049f33cb6348780fa975162752e421.tar.gz
initial commit of Enea Linux 3.1
Migrated from the internal git server on the dora-enea branch Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
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-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-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_1.1.7.bb44
-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/sitecustomize.py45
-rw-r--r--meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch28
-rw-r--r--meta/recipes-devtools/python/python-native/unixccompiler.patch20
-rw-r--r--meta/recipes-devtools/python/python-native_2.7.3.bb57
-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.patch16
-rw-r--r--meta/recipes-devtools/python/python-pycurl_7.19.0.bb35
-rw-r--r--meta/recipes-devtools/python/python-pygobject/generate-constants.patch20
-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.bb21
-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-setuptools_0.6c11.bb41
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-attempt.patch59
-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.bb142
-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/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-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/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/python_2.7.3.bb184
92 files changed, 7764 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..6d3a9e6c04
--- /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
12DESCRIPTION_${PN}-2to3="Python Automated Python 2 to 3 code translation"
13RDEPENDS_${PN}-2to3="${PN}-core"
14FILES_${PN}-2to3="${bindir}/2to3 ${libdir}/python2.7/lib2to3 "
15
16DESCRIPTION_${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
20DESCRIPTION_${PN}-bsddb="Python Berkeley Database Bindings"
21RDEPENDS_${PN}-bsddb="${PN}-core"
22FILES_${PN}-bsddb="${libdir}/python2.7/bsddb ${libdir}/python2.7/lib-dynload/_bsddb.so "
23
24DESCRIPTION_${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
28DESCRIPTION_${PN}-compile="Python Bytecode Compilation Support"
29RDEPENDS_${PN}-compile="${PN}-core"
30FILES_${PN}-compile="${libdir}/python2.7/py_compile.* ${libdir}/python2.7/compileall.* "
31
32DESCRIPTION_${PN}-compiler="Python Compiler Support"
33RDEPENDS_${PN}-compiler="${PN}-core"
34FILES_${PN}-compiler="${libdir}/python2.7/compiler "
35
36DESCRIPTION_${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
40DESCRIPTION_${PN}-core="Python Interpreter and core modules (needed!)"
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
45DESCRIPTION_${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
49DESCRIPTION_${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
53DESCRIPTION_${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
57DESCRIPTION_${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
61DESCRIPTION_${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
65DESCRIPTION_${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
69DESCRIPTION_${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
73DESCRIPTION_${PN}-difflib="Python helpers for computing deltas between objects."
74RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re"
75FILES_${PN}-difflib="${libdir}/python2.7/difflib.* "
76
77DESCRIPTION_${PN}-distutils="Python Distribution Utilities"
78RDEPENDS_${PN}-distutils="${PN}-core"
79FILES_${PN}-distutils="${libdir}/python2.7/config ${libdir}/python2.7/distutils "
80
81DESCRIPTION_${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
85DESCRIPTION_${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
89DESCRIPTION_${PN}-elementtree="Python elementree"
90RDEPENDS_${PN}-elementtree="${PN}-core"
91FILES_${PN}-elementtree="${libdir}/python2.7/lib-dynload/_elementtree.so "
92
93DESCRIPTION_${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
97DESCRIPTION_${PN}-fcntl="Python's fcntl Interface"
98RDEPENDS_${PN}-fcntl="${PN}-core"
99FILES_${PN}-fcntl="${libdir}/python2.7/lib-dynload/fcntl.so "
100
101DESCRIPTION_${PN}-gdbm="Python GNU Database Support"
102RDEPENDS_${PN}-gdbm="${PN}-core"
103FILES_${PN}-gdbm="${libdir}/python2.7/lib-dynload/gdbm.so "
104
105DESCRIPTION_${PN}-hotshot="Python Hotshot Profiler"
106RDEPENDS_${PN}-hotshot="${PN}-core"
107FILES_${PN}-hotshot="${libdir}/python2.7/hotshot ${libdir}/python2.7/lib-dynload/_hotshot.so "
108
109DESCRIPTION_${PN}-html="Python HTML Processing"
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
113DESCRIPTION_${PN}-idle="Python Integrated Development Environment"
114RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter"
115FILES_${PN}-idle="${bindir}/idle ${libdir}/python2.7/idlelib "
116
117DESCRIPTION_${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
121DESCRIPTION_${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
125DESCRIPTION_${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
129DESCRIPTION_${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
133DESCRIPTION_${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
137DESCRIPTION_${PN}-mailbox="Python Mailbox Format Support"
138RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime"
139FILES_${PN}-mailbox="${libdir}/python2.7/mailbox.* "
140
141DESCRIPTION_${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
145DESCRIPTION_${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
149DESCRIPTION_${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
153DESCRIPTION_${PN}-multiprocessing="Python Multiprocessing Support"
154RDEPENDS_${PN}-multiprocessing="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes"
155FILES_${PN}-multiprocessing="${libdir}/python2.7/lib-dynload/_multiprocessing.so ${libdir}/python2.7/multiprocessing "
156
157DESCRIPTION_${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
161DESCRIPTION_${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
165DESCRIPTION_${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
169DESCRIPTION_${PN}-pickle="Python 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
173DESCRIPTION_${PN}-pkgutil="Python Package Extension Utility Support"
174RDEPENDS_${PN}-pkgutil="${PN}-core"
175FILES_${PN}-pkgutil="${libdir}/python2.7/pkgutil.* "
176
177DESCRIPTION_${PN}-pprint="Python Pretty-Print Support"
178RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io"
179FILES_${PN}-pprint="${libdir}/python2.7/pprint.* "
180
181DESCRIPTION_${PN}-profile="Python Basic 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
185DESCRIPTION_${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
189DESCRIPTION_${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
193DESCRIPTION_${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
197DESCRIPTION_${PN}-resource="Python Resource Control Interface"
198RDEPENDS_${PN}-resource="${PN}-core"
199FILES_${PN}-resource="${libdir}/python2.7/lib-dynload/resource.so "
200
201DESCRIPTION_${PN}-robotparser="Python robots.txt parser"
202RDEPENDS_${PN}-robotparser="${PN}-core ${PN}-netclient"
203FILES_${PN}-robotparser="${libdir}/python2.7/robotparser.* "
204
205DESCRIPTION_${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
209DESCRIPTION_${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
213DESCRIPTION_${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
217DESCRIPTION_${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
221DESCRIPTION_${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
225DESCRIPTION_${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
229DESCRIPTION_${PN}-syslog="Python Syslog Interface"
230RDEPENDS_${PN}-syslog="${PN}-core"
231FILES_${PN}-syslog="${libdir}/python2.7/lib-dynload/syslog.so "
232
233DESCRIPTION_${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
237DESCRIPTION_${PN}-tests="Python Tests"
238RDEPENDS_${PN}-tests="${PN}-core"
239FILES_${PN}-tests="${libdir}/python2.7/test "
240
241DESCRIPTION_${PN}-textutils="Python Option Parsing, Text Wrapping and Comma-Separated-Value 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
245DESCRIPTION_${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
249DESCRIPTION_${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
253DESCRIPTION_${PN}-unittest="Python Unit Testing Framework"
254RDEPENDS_${PN}-unittest="${PN}-core ${PN}-stringold ${PN}-lang"
255FILES_${PN}-unittest="${libdir}/python2.7/unittest/ "
256
257DESCRIPTION_${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
261DESCRIPTION_${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
265DESCRIPTION_${PN}-xmlrpc="Python XMLRPC 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
269DESCRIPTION_${PN}-zlib="Python zlib Support."
270RDEPENDS_${PN}-zlib="${PN}-core"
271FILES_${PN}-zlib="${libdir}/python2.7/lib-dynload/zlib.so "
272
273DESCRIPTION_${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-argparse_1.2.1.bb b/meta/recipes-devtools/python/python-argparse_1.2.1.bb
new file mode 100644
index 0000000000..1f07738547
--- /dev/null
+++ b/meta/recipes-devtools/python/python-argparse_1.2.1.bb
@@ -0,0 +1,17 @@
1DESCRIPTION = "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..a185d841e2
--- /dev/null
+++ b/meta/recipes-devtools/python/python-dbus_1.2.0.bb
@@ -0,0 +1,25 @@
1DESCRIPTION = "Python bindings for DBus, a socket-based message bus system for interprocess communication"
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-docutils_0.11.bb b/meta/recipes-devtools/python/python-docutils_0.11.bb
new file mode 100644
index 0000000000..7987244c0c
--- /dev/null
+++ b/meta/recipes-devtools/python/python-docutils_0.11.bb
@@ -0,0 +1,18 @@
1DESCRIPTION = "Text processing system"
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..8b041c3da0
--- /dev/null
+++ b/meta/recipes-devtools/python/python-gst_0.10.22.bb
@@ -0,0 +1,23 @@
1DESCRIPTION = "Python Gstreamer bindings"
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_1.1.7.bb b/meta/recipes-devtools/python/python-imaging_1.1.7.bb
new file mode 100644
index 0000000000..e100358d08
--- /dev/null
+++ b/meta/recipes-devtools/python/python-imaging_1.1.7.bb
@@ -0,0 +1,44 @@
1DESCRIPTION = "Python Imaging Library"
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
13SRC_URI[md5sum] = "fc14a54e1ce02a0225be8854bfba478e"
14SRC_URI[sha256sum] = "895bc7c2498c8e1f9b99938f1a40dc86b3f149741f105cf7c7bd2e0725405211"
15S = "${WORKDIR}/${SRCNAME}-${PV}"
16
17# There isn't enable/disable option, and lcms is in meta-oe, at least make it explicit when enabled
18# setup.py already has FIXME: add mechanism to explicitly *disable* the use of a library
19PACKAGECONFIG ??= ""
20PACKAGECONFIG[lcms] = ",,lcms"
21
22inherit distutils
23
24do_compile() {
25 export STAGING_LIBDIR=${STAGING_LIBDIR}
26 export STAGING_INCDIR=${STAGING_INCDIR}
27 export LCMS_ENABLED=${@base_contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)}
28 distutils_do_compile
29}
30
31do_install() {
32 export STAGING_LIBDIR=${STAGING_LIBDIR}
33 export STAGING_INCDIR=${STAGING_INCDIR}
34 export LCMS_ENABLED=${@base_contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)}
35 distutils_do_install
36 install -d ${D}${datadir}/doc/${BPN}/html/
37 install -m 0644 ${S}/README ${D}${datadir}/doc/${BPN}/
38 install -m 0644 ${S}/Docs/* ${D}${datadir}/doc/${BPN}/html/
39
40 # get rid of #!/usr/local/bin/python
41 sed -i -e 's:/usr/local/bin/:${bindir}/env :g' ${D}${bindir}/*
42}
43
44RDEPENDS_${PN} += "python-lang python-stringold"
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/sitecustomize.py b/meta/recipes-devtools/python/python-native/sitecustomize.py
new file mode 100644
index 0000000000..273901898a
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/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/python-native/sys_platform_is_now_always_linux2.patch b/meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch
new file mode 100644
index 0000000000..1cb8fea50f
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch
@@ -0,0 +1,28 @@
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
17diff --git a/configure.in b/configure.in
18--- a/configure.in
19+++ b/configure.in
20@@ -293,6 +293,7 @@ then
21 MACHDEP="$ac_md_system$ac_md_release"
22
23 case $MACHDEP in
24+ linux*) MACHDEP="linux2";;
25 cygwin*) MACHDEP="cygwin";;
26 darwin*) MACHDEP="darwin";;
27 atheos*) MACHDEP="atheos";;
28
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..ef891b246c
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native_2.7.3.bb
@@ -0,0 +1,57 @@
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 "
20S = "${WORKDIR}/Python-${PV}"
21
22FILESPATH = "${FILE_DIRNAME}/python-native/:${FILE_DIRNAME}/python/"
23
24inherit native
25
26RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-codecs-native python-core-native"
27
28EXTRA_OECONF_append = " --bindir=${bindir}/${PN}"
29
30EXTRA_OEMAKE = '\
31 BUILD_SYS="" \
32 HOST_SYS="" \
33 LIBC="" \
34 STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
35 STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
36'
37
38do_configure_prepend() {
39 autoreconf --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf"
40}
41
42do_install() {
43 oe_runmake 'DESTDIR=${D}' install
44 install -d ${D}${bindir}/${PN}
45 install -m 0755 Parser/pgen ${D}${bindir}/${PN}
46
47 # Make sure we use /usr/bin/env python
48 for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
49 sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
50 done
51
52 # Add a symlink to the native Python so that scripts can just invoke
53 # "nativepython" and get the right one without needing absolute paths
54 # (these often end up too long for the #! parser in the kernel as the
55 # buffer is 128 bytes long).
56 ln -s python-native/python ${D}${bindir}/nativepython
57}
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..dc009b3edf
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
@@ -0,0 +1,39 @@
1DESCRIPTION = "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..c97f5dc029
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pycurl/no-static-link.patch
@@ -0,0 +1,16 @@
1Upstream-Status: Pending
2
3Index: pycurl-7.18.2/setup.py
4===================================================================
5--- pycurl-7.18.2.orig/setup.py
6+++ pycurl-7.18.2/setup.py
7@@ -97,8 +97,7 @@ else:
8 else:
9 extra_compile_args.append(e)
10 libs = split_quoted(
11- os.popen("'%s' --libs" % CURL_CONFIG).read()+\
12- os.popen("'%s' --static-libs" % CURL_CONFIG).read())
13+ os.popen("'%s' --libs" % CURL_CONFIG).read())
14 for e in libs:
15 if e[:2] == "-l":
16 libraries.append(e[2:])
diff --git a/meta/recipes-devtools/python/python-pycurl_7.19.0.bb b/meta/recipes-devtools/python/python-pycurl_7.19.0.bb
new file mode 100644
index 0000000000..122e1bdedc
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pycurl_7.19.0.bb
@@ -0,0 +1,35 @@
1DESCRIPTION = "libcurl python bindings."
2HOMEPAGE = "http://pycurl.sourceforge.net/"
3SECTION = "devel/python"
4LICENSE = "LGPLv2.1+ | MIT"
5LIC_FILES_CHKSUM = "file://README;endline=13;md5=fbfe545b1869617123a08c0983ef17b2 \
6 file://COPYING;md5=3579a9fd0221d49a237aaa33492f988c \
7 file://COPYING2;md5=ffaa1e283b7f9bf5aafd8d45db6f7518"
8
9DEPENDS = "curl python"
10RDEPENDS_${PN} = "python-core curl"
11SRCNAME = "pycurl"
12PR = "r3"
13
14SRC_URI = "\
15 http://${SRCNAME}.sourceforge.net/download/${SRCNAME}-${PV}.tar.gz;name=archive \
16 file://no-static-link.patch \
17"
18
19SRC_URI[archive.md5sum] = "919d58fe37e69fe87ce4534d8b6a1c7b"
20SRC_URI[archive.sha256sum] = "eb782dfcc5a7c023539a077462b83c167e178128ee9f7201665b9fbb1a8b0642"
21S = "${WORKDIR}/${SRCNAME}-${PV}"
22
23inherit distutils
24
25# need to export these variables for python-config to work
26export BUILD_SYS
27export HOST_SYS
28export STAGING_INCDIR
29export STAGING_LIBDIR
30
31BBCLASSEXTEND = "native"
32
33do_install_append() {
34 rm -rf ${D}${datadir}/share
35}
diff --git a/meta/recipes-devtools/python/python-pygobject/generate-constants.patch b/meta/recipes-devtools/python/python-pygobject/generate-constants.patch
new file mode 100644
index 0000000000..be2ecd3b7c
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygobject/generate-constants.patch
@@ -0,0 +1,20 @@
1Upstream-Status: Pending
2
3Index: pygobject-2.14.2/gobject/Makefile.am
4===================================================================
5--- pygobject-2.14.2.orig/gobject/Makefile.am
6+++ pygobject-2.14.2/gobject/Makefile.am
7@@ -21,11 +21,11 @@ if PLATFORM_WIN32
8 common_ldflags += -no-undefined
9 endif
10
11-constants.py: generate-constants$(EXEEXT) constants.py.in
12+constants.py: constants.py.in
13 rm -f constants.py
14 cp $(srcdir)/constants.py.in constants.py
15 chmod 644 constants.py
16- $(top_builddir)/gobject/generate-constants$(EXEEXT) >> constants.py
17+ gobject-generate-constants$(EXEEXT) >> constants.py
18 chmod 444 constants.py
19
20 generate_constants_CFLAGS = $(GLIB_CFLAGS)
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..322521bc20
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygobject_2.27.91.bb
@@ -0,0 +1,41 @@
1DESCRIPTION = "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..475ea17300
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygtk_2.24.0.bb
@@ -0,0 +1,58 @@
1DESCRIPTION = "Python GTK+ 2.17.x Bindings"
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..0ae35b0536
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pyrex_0.9.9.bb
@@ -0,0 +1,21 @@
1DESCRIPTION = "Pyrex is a language specially designed for writing Python extension modules. \
2It's designed to bridge the gap between the nice, high-level, easy-to-use world of Python \
3and the messy, low-level world of C."
4SECTION = "devel/python"
5LICENSE = "Apache-2.0"
6LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=771d472f53f933033f57eeee7808e5bd"
7SRCNAME = "Pyrex"
8PR = "r4"
9
10SRC_URI = "\
11 http://www.cosc.canterbury.ac.nz/greg.ewing/python/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
12 file://pyrex-fix-optimized-mode.patch \
13"
14
15SRC_URI[md5sum] = "515dee67d15d4393841e2d60e8341947"
16SRC_URI[sha256sum] = "5f87df06831d0b3412eb4bc9d3fc2ee7bfae1b913d7da8c23ab2bf5699fb6b50"
17S = "${WORKDIR}/${SRCNAME}-${PV}"
18
19inherit distutils
20
21FILES_${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..1110f6ea43
--- /dev/null
+++ b/meta/recipes-devtools/python/python-scons_2.3.0.bb
@@ -0,0 +1,14 @@
1DESCRIPTION = "A Software Construction Tool"
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-setuptools_0.6c11.bb b/meta/recipes-devtools/python/python-setuptools_0.6c11.bb
new file mode 100644
index 0000000000..f09a312aec
--- /dev/null
+++ b/meta/recipes-devtools/python/python-setuptools_0.6c11.bb
@@ -0,0 +1,41 @@
1DESCRIPTION = "Download, build, install, upgrade, and uninstall Python packages"
2HOMEPAGE = "http://cheeseshop.python.org/pypi/setuptools"
3SECTION = "devel/python"
4LICENSE = "PSF"
5LIC_FILES_CHKSUM = "file://setup.py;beginline=23;endline=23;md5=8a314270dd7a8dbca741775415f1716e"
6
7SRCNAME = "setuptools"
8PR = "ml5"
9DEPENDS += "python"
10DEPENDS_class-native += "python-native"
11
12SRC_URI = "\
13 http://cheeseshop.python.org/packages/source/s/setuptools/${SRCNAME}-${PV}.tar.gz\
14"
15S = "${WORKDIR}/${SRCNAME}-${PV}"
16
17inherit distutils
18
19DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
20
21do_install_prepend() {
22 install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
23}
24
25RDEPENDS_${PN} = "\
26 python-stringold \
27 python-email \
28 python-shell \
29 python-distutils \
30 python-compression \
31"
32
33RDEPENDS_${PN}_class-native = "\
34 python-distutils \
35 python-compression \
36"
37
38SRC_URI[md5sum] = "7df2a529a074f613b509fb44feefe74e"
39SRC_URI[sha256sum] = "630fea9b726320b73ee3ca6ff61732cb32675b0389be658080fe46383b87a1d3"
40
41BBCLASSEXTEND = "native"
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..0d603d3d1b
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch
@@ -0,0 +1,59 @@
1Add a mechanism to attempt the install operation, w/o failing.
2
3For complementary and 'attemptonly' packages, we need a way to instruct smart to
4try to install, but ignore any failures.
5
6This option only works for the install operation.
7
8Upstream-Status: Pending
9
10Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
11
12Index: smart-1.4.1/smart/commands/install.py
13===================================================================
14--- smart-1.4.1.orig/smart/commands/install.py
15+++ smart-1.4.1/smart/commands/install.py
16@@ -50,6 +50,8 @@ def option_parser():
17 parser = OptionParser(usage=USAGE,
18 description=DESCRIPTION,
19 examples=EXAMPLES)
20+ parser.add_option("--attempt", action="store_true",
21+ help=_("attempt to install packages, ignore failures"))
22 parser.add_option("--stepped", action="store_true",
23 help=_("split operation in steps"))
24 parser.add_option("--urls", action="store_true",
25@@ -80,6 +82,9 @@ def main(ctrl, opts):
26 if not opts.args:
27 raise Error, _("no package(s) given")
28
29+ if opts.attempt:
30+ sysconf.set("attempt-install", True, soft=True)
31+
32 if opts.explain:
33 sysconf.set("explain-changesets", True, soft=True)
34
35Index: smart-1.4.1/smart/transaction.py
36===================================================================
37--- smart-1.4.1.orig/smart/transaction.py
38+++ smart-1.4.1/smart/transaction.py
39@@ -1216,9 +1216,17 @@ class Transaction(object):
40 else:
41 op = REMOVE
42 if op is INSTALL or op is REINSTALL:
43- self._install(pkg, changeset, locked, pending)
44- if pkg in changeset:
45- changeset.setRequested(pkg, True)
46+ try:
47+ self._install(pkg, changeset, locked, pending)
48+ if pkg in changeset:
49+ changeset.setRequested(pkg, True)
50+ except Failed, e:
51+ if sysconf.has("attempt-install", soft=True):
52+ if pkg in changeset:
53+ del changeset[pkg]
54+ continue
55+ else:
56+ raise Failed, e
57 elif op is REMOVE:
58 self._remove(pkg, changeset, locked, pending)
59 elif op is UPGRADE:
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..f349469d22
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
@@ -0,0 +1,142 @@
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
52PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}"
53PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}"
54PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}"
55
56inherit distutils
57
58do_install_append() {
59 # We don't support the following items
60 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/slack
61 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/arch
62 rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt
63
64 # Temporary, debian support in OE is missing the python module
65 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/aptchannelsync.py*
66 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/debdir.py*
67 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/deb
68
69 # Disable automatic channel detection
70 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/detectsys.py*
71
72 # Disable landscape support
73 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/landscape.py*
74
75 # Disable urpmi channel support
76 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/urpmichannelsync.py*
77
78 # Disable yum channel support
79 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/yumchannelsync.py*
80
81 # Disable zypper channel support
82 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/zyppchannelsync.py*
83
84 if [ -z "${@base_contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then
85 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/rpmdir.py*
86 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/rpm
87 fi
88
89 if [ -z "${@base_contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then
90 rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt4
91 fi
92
93 if [ -z "${@base_contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then
94 rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/gtk
95 fi
96}
97
98add_native_wrapper() {
99 create_wrapper ${D}/${bindir}/smart \
100 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
101 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
102 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
103}
104
105do_install_append_class-native() {
106 add_native_wrapper
107}
108
109do_install_append_class-nativesdk() {
110 add_native_wrapper
111}
112
113PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \
114 ${@base_contains('PACKAGECONFIG', 'rpm', '${PN}-backend-rpm', '', d)} \
115 ${@base_contains('PACKAGECONFIG', 'qt4', '${PN}-interface-qt4', '', d)} \
116 ${@base_contains('PACKAGECONFIG', 'gtk', '${PN}-interface-gtk', '', d)} \
117 ${PN}-interface-images ${PN}"
118
119RDEPENDS_smartpm = "${PN}"
120
121RDEPENDS_${PN} += "${PN}-backend-rpm python-codecs python-textutils python-xml python-fcntl \
122 python-pickle python-crypt python-compression python-shell \
123 python-resource python-netclient python-threading python-unixadmin python-pprint"
124RDEPENDS_${PN}_class-native = ""
125
126RDEPENDS_${PN}-backend-rpm = "python-rpm"
127
128RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images"
129RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images"
130
131FILES_smartpm = "${bindir}/smart"
132
133FILES_${PN}-dbg += "${libdir}/python*/site-packages/smart/backends/rpm/.debug"
134
135FILES_${PN}-backend-rpm = "${libdir}/python*/site-packages/smart/backends/rpm"
136
137FILES_${PN}-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4"
138FILES_${PN}-interface-gtk = "${libdir}/python*/site-packages/smart/interfaces/gtk"
139FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images"
140
141BBCLASSEXTEND = "native"
142
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..fcfeda5cbc
--- /dev/null
+++ b/meta/recipes-devtools/python/python.inc
@@ -0,0 +1,31 @@
1DESCRIPTION = "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
18
19PYTHONLSBOPTS = "--with-wctype-functions"
20PYTHONLSBOPTS_linuxstdbase = "ac_cv_sizeof_off_t=8"
21
22EXTRA_OECONF = "\
23 --with-threads \
24 --with-pymalloc \
25 --with-cyclic-gc \
26 --without-cxx \
27 --with-signal-module \
28 --enable-shared \
29 --enable-ipv6=${@base_contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)} \
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/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-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/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/python_2.7.3.bb b/meta/recipes-devtools/python/python_2.7.3.bb
new file mode 100644
index 0000000000..5a96d39cdc
--- /dev/null
+++ b/meta/recipes-devtools/python/python_2.7.3.bb
@@ -0,0 +1,184 @@
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"
36
37S = "${WORKDIR}/Python-${PV}"
38
39inherit autotools multilib_header pythonnative
40
41# The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources
42#Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
43TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
44TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__"
45
46do_configure_prepend() {
47 rm -f ${S}/Makefile.orig
48 autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf"
49}
50
51do_compile() {
52 # regenerate platform specific files, because they depend on system headers
53 cd Lib/plat-linux2
54 include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \
55 ${S}/Tools/scripts/h2py.py -i '(u_long)' \
56 ${STAGING_INCDIR}/dlfcn.h \
57 ${STAGING_INCDIR}/linux/cdrom.h \
58 ${STAGING_INCDIR}/netinet/in.h \
59 ${STAGING_INCDIR}/sys/types.h
60 sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
61 cd -
62
63 # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144
64 sed -i -e s,ccache,'$(CCACHE)', Makefile
65
66 # remove any bogus LD_LIBRARY_PATH
67 sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
68
69 if [ ! -f Makefile.orig ]; then
70 install -m 0644 Makefile Makefile.orig
71 fi
72 sed -i -e 's,^LDFLAGS=.*,LDFLAGS=-L. -L${STAGING_LIBDIR},g' \
73 -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
74 -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
75 -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
76 -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
77 -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
78 -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
79 Makefile
80 # save copy of it now, because if we do it in do_install and
81 # then call do_install twice we get Makefile.orig == Makefile.sysroot
82 install -m 0644 Makefile Makefile.sysroot
83
84 export CROSS_COMPILE="${TARGET_PREFIX}"
85 export PYTHONBUILDDIR="${S}"
86
87 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
88 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
89 STAGING_LIBDIR=${STAGING_LIBDIR} \
90 STAGING_INCDIR=${STAGING_INCDIR} \
91 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
92 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
93 OPT="${CFLAGS}"
94}
95
96do_install() {
97 # make install needs the original Makefile, or otherwise the inclues would
98 # go to ${D}${STAGING...}/...
99 install -m 0644 Makefile.orig Makefile
100
101 export CROSS_COMPILE="${TARGET_PREFIX}"
102 export PYTHONBUILDDIR="${S}"
103
104 # After swizzling the makefile, we need to run the build again.
105 # install can race with the build so we have to run this first, then install
106 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
107 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
108 CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
109 STAGING_LIBDIR=${STAGING_LIBDIR} \
110 STAGING_INCDIR=${STAGING_INCDIR} \
111 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
112 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
113 DESTDIR=${D} LIBDIR=${libdir}
114
115 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
116 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
117 CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
118 STAGING_LIBDIR=${STAGING_LIBDIR} \
119 STAGING_INCDIR=${STAGING_INCDIR} \
120 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
121 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
122 DESTDIR=${D} LIBDIR=${libdir} install
123
124 install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
125
126 if [ -e ${WORKDIR}/sitecustomize.py ]; then
127 install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
128 fi
129
130 oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
131}
132
133do_install_append_class-nativesdk () {
134 create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
135}
136
137do_install_ptest() {
138 cp ${B}/Makefile ${D}${PTEST_PATH}
139 sed -i s:LIBDIR:${libdir}:g ${D}${PTEST_PATH}/run-ptest
140}
141
142SSTATE_SCAN_FILES += "Makefile"
143PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
144
145py_package_preprocess () {
146 # copy back the old Makefile to fix target package
147 install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
148
149 # Remove references to buildmachine paths in target Makefile
150 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
151}
152
153require python-${PYTHON_MAJMIN}-manifest.inc
154
155# manual dependency additions
156RPROVIDES_${PN}-core = "${PN}"
157RRECOMMENDS_${PN}-core = "${PN}-readline"
158RRECOMMENDS_${PN}-crypt = "openssl"
159RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl"
160
161# package libpython2
162PACKAGES =+ "lib${BPN}2"
163FILES_lib${BPN}2 = "${libdir}/libpython*.so.*"
164
165# catch debug extensions (isn't that already in python-core-dbg?)
166FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug"
167
168# catch all the rest (unsorted)
169PACKAGES += "${PN}-misc"
170FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
171RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-misc"
172#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten
173inherit ptest
174
175
176RDEPENDS_${PN}-ptest = "${PN}-json ${PN}-crypt ${PN}-unittest ${PN}-difflib ${PN}-pprint ${PN}-shell ${PN}-tests ${PN}-misc ${PN}-netclient ${PN}-mailbox ${PN}-pkgutil ${PN}-profile ${PN}-compile ${PN}-pydoc ${PN}-robotparser ${PN}-netserver ${PN}-datetime ${PN}-compression ${PN}-mime ${PN}-audio ${PN}-db ${PN}-resource ${PN}-image ${PN}-subprocess ${PN}-doctest ${PN}-numbers ${PN}-html ${PN}-email ${PN}-distutils ${PN}-hotshot ${PN}-2to3 ${PN}-mmap ${PN}-terminal ${PN}-xmlrpc ${PN}-smtpd ${PN}-unixadmin ${PN}-compiler"
177#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten
178inherit ptest
179
180# catch manpage
181PACKAGES += "${PN}-man"
182FILES_${PN}-man = "${datadir}/man"
183
184BBCLASSEXTEND = "nativesdk"