diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-devtools/python | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-devtools/python')
166 files changed, 13928 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-2.7-manifest.inc b/meta/recipes-devtools/python/python-2.7-manifest.inc new file mode 100644 index 0000000000..5c2629e851 --- /dev/null +++ b/meta/recipes-devtools/python/python-2.7-manifest.inc | |||
@@ -0,0 +1,280 @@ | |||
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 | |||
8 | PROVIDES+="${PN}-2to3 ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils ${PN}-distutils-staticdev ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-hotshot ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-zlib " | ||
9 | |||
10 | PACKAGES="${PN}-dbg ${PN}-2to3 ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils-staticdev ${PN}-distutils ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-hotshot ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-zlib ${PN}-modules" | ||
11 | |||
12 | SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator" | ||
13 | RDEPENDS_${PN}-2to3="${PN}-core" | ||
14 | FILES_${PN}-2to3="${bindir}/2to3 ${libdir}/python2.7/lib2to3 " | ||
15 | |||
16 | SUMMARY_${PN}-audio="Python Audio Handling" | ||
17 | RDEPENDS_${PN}-audio="${PN}-core" | ||
18 | FILES_${PN}-audio="${libdir}/python2.7/wave.* ${libdir}/python2.7/chunk.* ${libdir}/python2.7/sndhdr.* ${libdir}/python2.7/lib-dynload/ossaudiodev.so ${libdir}/python2.7/lib-dynload/audioop.so ${libdir}/python2.7/audiodev.* ${libdir}/python2.7/sunaudio.* ${libdir}/python2.7/sunau.* ${libdir}/python2.7/toaiff.* " | ||
19 | |||
20 | SUMMARY_${PN}-bsddb="Python bindings for the Berkeley Database" | ||
21 | RDEPENDS_${PN}-bsddb="${PN}-core" | ||
22 | FILES_${PN}-bsddb="${libdir}/python2.7/bsddb ${libdir}/python2.7/lib-dynload/_bsddb.so " | ||
23 | |||
24 | SUMMARY_${PN}-codecs="Python codecs, encodings & i18n support" | ||
25 | RDEPENDS_${PN}-codecs="${PN}-core ${PN}-lang" | ||
26 | FILES_${PN}-codecs="${libdir}/python2.7/codecs.* ${libdir}/python2.7/encodings ${libdir}/python2.7/gettext.* ${libdir}/python2.7/locale.* ${libdir}/python2.7/lib-dynload/_locale.so ${libdir}/python2.7/lib-dynload/_codecs* ${libdir}/python2.7/lib-dynload/_multibytecodec.so ${libdir}/python2.7/lib-dynload/unicodedata.so ${libdir}/python2.7/stringprep.* ${libdir}/python2.7/xdrlib.* " | ||
27 | |||
28 | SUMMARY_${PN}-compile="Python bytecode compilation support" | ||
29 | RDEPENDS_${PN}-compile="${PN}-core" | ||
30 | FILES_${PN}-compile="${libdir}/python2.7/py_compile.* ${libdir}/python2.7/compileall.* " | ||
31 | |||
32 | SUMMARY_${PN}-compiler="Python compiler support" | ||
33 | RDEPENDS_${PN}-compiler="${PN}-core" | ||
34 | FILES_${PN}-compiler="${libdir}/python2.7/compiler " | ||
35 | |||
36 | SUMMARY_${PN}-compression="Python high-level compression support" | ||
37 | RDEPENDS_${PN}-compression="${PN}-core ${PN}-zlib" | ||
38 | FILES_${PN}-compression="${libdir}/python2.7/gzip.* ${libdir}/python2.7/zipfile.* ${libdir}/python2.7/tarfile.* ${libdir}/python2.7/lib-dynload/bz2.so " | ||
39 | |||
40 | SUMMARY_${PN}-core="Python interpreter and core modules" | ||
41 | RDEPENDS_${PN}-core="${PN}-lang ${PN}-re" | ||
42 | FILES_${PN}-core="${libdir}/python2.7/__future__.* ${libdir}/python2.7/_abcoll.* ${libdir}/python2.7/abc.* ${libdir}/python2.7/copy.* ${libdir}/python2.7/copy_reg.* ${libdir}/python2.7/ConfigParser.* ${libdir}/python2.7/genericpath.* ${libdir}/python2.7/getopt.* ${libdir}/python2.7/linecache.* ${libdir}/python2.7/new.* ${libdir}/python2.7/os.* ${libdir}/python2.7/posixpath.* ${libdir}/python2.7/struct.* ${libdir}/python2.7/warnings.* ${libdir}/python2.7/site.* ${libdir}/python2.7/stat.* ${libdir}/python2.7/UserDict.* ${libdir}/python2.7/UserList.* ${libdir}/python2.7/UserString.* ${libdir}/python2.7/lib-dynload/binascii.so ${libdir}/python2.7/lib-dynload/_struct.so ${libdir}/python2.7/lib-dynload/time.so ${libdir}/python2.7/lib-dynload/xreadlines.so ${libdir}/python2.7/types.* ${libdir}/python2.7/platform.* ${bindir}/python* ${libdir}/python2.7/_weakrefset.* ${libdir}/python2.7/sysconfig.* ${libdir}/python2.7/config/Makefile ${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py " | ||
43 | |||
44 | SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support" | ||
45 | RDEPENDS_${PN}-crypt="${PN}-core" | ||
46 | FILES_${PN}-crypt="${libdir}/python2.7/hashlib.* ${libdir}/python2.7/md5.* ${libdir}/python2.7/sha.* ${libdir}/python2.7/lib-dynload/crypt.so ${libdir}/python2.7/lib-dynload/_hashlib.so ${libdir}/python2.7/lib-dynload/_sha256.so ${libdir}/python2.7/lib-dynload/_sha512.so " | ||
47 | |||
48 | SUMMARY_${PN}-ctypes="Python C types support" | ||
49 | RDEPENDS_${PN}-ctypes="${PN}-core" | ||
50 | FILES_${PN}-ctypes="${libdir}/python2.7/ctypes ${libdir}/python2.7/lib-dynload/_ctypes.so ${libdir}/python2.7/lib-dynload/_ctypes_test.so " | ||
51 | |||
52 | SUMMARY_${PN}-curses="Python curses support" | ||
53 | RDEPENDS_${PN}-curses="${PN}-core" | ||
54 | FILES_${PN}-curses="${libdir}/python2.7/curses ${libdir}/python2.7/lib-dynload/_curses.so ${libdir}/python2.7/lib-dynload/_curses_panel.so " | ||
55 | |||
56 | SUMMARY_${PN}-datetime="Python calendar and time support" | ||
57 | RDEPENDS_${PN}-datetime="${PN}-core ${PN}-codecs" | ||
58 | FILES_${PN}-datetime="${libdir}/python2.7/_strptime.* ${libdir}/python2.7/calendar.* ${libdir}/python2.7/lib-dynload/datetime.so " | ||
59 | |||
60 | SUMMARY_${PN}-db="Python file-based database support" | ||
61 | RDEPENDS_${PN}-db="${PN}-core" | ||
62 | FILES_${PN}-db="${libdir}/python2.7/anydbm.* ${libdir}/python2.7/dumbdbm.* ${libdir}/python2.7/whichdb.* " | ||
63 | |||
64 | SUMMARY_${PN}-debugger="Python debugger" | ||
65 | RDEPENDS_${PN}-debugger="${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint" | ||
66 | FILES_${PN}-debugger="${libdir}/python2.7/bdb.* ${libdir}/python2.7/pdb.* " | ||
67 | |||
68 | SUMMARY_${PN}-dev="Python development package" | ||
69 | RDEPENDS_${PN}-dev="${PN}-core" | ||
70 | FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig " | ||
71 | |||
72 | SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects" | ||
73 | RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re" | ||
74 | FILES_${PN}-difflib="${libdir}/python2.7/difflib.* " | ||
75 | |||
76 | SUMMARY_${PN}-distutils="Python Distribution Utilities" | ||
77 | RDEPENDS_${PN}-distutils="${PN}-core" | ||
78 | FILES_${PN}-distutils="${libdir}/python2.7/config ${libdir}/python2.7/distutils " | ||
79 | |||
80 | SUMMARY_${PN}-distutils-staticdev="Python distribution utilities (static libraries)" | ||
81 | RDEPENDS_${PN}-distutils-staticdev="${PN}-distutils" | ||
82 | FILES_${PN}-distutils-staticdev="${libdir}/python2.7/config/lib*.a " | ||
83 | |||
84 | SUMMARY_${PN}-doctest="Python framework for running examples in docstrings" | ||
85 | RDEPENDS_${PN}-doctest="${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib" | ||
86 | FILES_${PN}-doctest="${libdir}/python2.7/doctest.* " | ||
87 | |||
88 | SUMMARY_${PN}-elementtree="Python elementree" | ||
89 | RDEPENDS_${PN}-elementtree="${PN}-core" | ||
90 | FILES_${PN}-elementtree="${libdir}/python2.7/lib-dynload/_elementtree.so " | ||
91 | |||
92 | SUMMARY_${PN}-email="Python email support" | ||
93 | RDEPENDS_${PN}-email="${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient" | ||
94 | FILES_${PN}-email="${libdir}/python2.7/imaplib.* ${libdir}/python2.7/email " | ||
95 | |||
96 | SUMMARY_${PN}-fcntl="Python's fcntl interface" | ||
97 | RDEPENDS_${PN}-fcntl="${PN}-core" | ||
98 | FILES_${PN}-fcntl="${libdir}/python2.7/lib-dynload/fcntl.so " | ||
99 | |||
100 | SUMMARY_${PN}-gdbm="Python GNU database support" | ||
101 | RDEPENDS_${PN}-gdbm="${PN}-core" | ||
102 | FILES_${PN}-gdbm="${libdir}/python2.7/lib-dynload/gdbm.so " | ||
103 | |||
104 | SUMMARY_${PN}-hotshot="Python hotshot performance profiler" | ||
105 | RDEPENDS_${PN}-hotshot="${PN}-core" | ||
106 | FILES_${PN}-hotshot="${libdir}/python2.7/hotshot ${libdir}/python2.7/lib-dynload/_hotshot.so " | ||
107 | |||
108 | SUMMARY_${PN}-html="Python HTML processing support" | ||
109 | RDEPENDS_${PN}-html="${PN}-core" | ||
110 | FILES_${PN}-html="${libdir}/python2.7/formatter.* ${libdir}/python2.7/htmlentitydefs.* ${libdir}/python2.7/htmllib.* ${libdir}/python2.7/markupbase.* ${libdir}/python2.7/sgmllib.* ${libdir}/python2.7/HTMLParser.* " | ||
111 | |||
112 | SUMMARY_${PN}-idle="Python Integrated Development Environment" | ||
113 | RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter" | ||
114 | FILES_${PN}-idle="${bindir}/idle ${libdir}/python2.7/idlelib " | ||
115 | |||
116 | SUMMARY_${PN}-image="Python graphical image handling" | ||
117 | RDEPENDS_${PN}-image="${PN}-core" | ||
118 | FILES_${PN}-image="${libdir}/python2.7/colorsys.* ${libdir}/python2.7/imghdr.* ${libdir}/python2.7/lib-dynload/imageop.so ${libdir}/python2.7/lib-dynload/rgbimg.so " | ||
119 | |||
120 | SUMMARY_${PN}-importlib="Python import implementation library" | ||
121 | RDEPENDS_${PN}-importlib="${PN}-core" | ||
122 | FILES_${PN}-importlib="${libdir}/python2.7/importlib " | ||
123 | |||
124 | SUMMARY_${PN}-io="Python low-level I/O" | ||
125 | RDEPENDS_${PN}-io="${PN}-core ${PN}-math ${PN}-textutils ${PN}-netclient" | ||
126 | FILES_${PN}-io="${libdir}/python2.7/lib-dynload/_socket.so ${libdir}/python2.7/lib-dynload/_io.so ${libdir}/python2.7/lib-dynload/_ssl.so ${libdir}/python2.7/lib-dynload/select.so ${libdir}/python2.7/lib-dynload/termios.so ${libdir}/python2.7/lib-dynload/cStringIO.so ${libdir}/python2.7/pipes.* ${libdir}/python2.7/socket.* ${libdir}/python2.7/ssl.* ${libdir}/python2.7/tempfile.* ${libdir}/python2.7/StringIO.* ${libdir}/python2.7/io.* ${libdir}/python2.7/_pyio.* " | ||
127 | |||
128 | SUMMARY_${PN}-json="Python JSON support" | ||
129 | RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re ${PN}-codecs" | ||
130 | FILES_${PN}-json="${libdir}/python2.7/json ${libdir}/python2.7/lib-dynload/_json.so " | ||
131 | |||
132 | SUMMARY_${PN}-lang="Python low-level language support" | ||
133 | RDEPENDS_${PN}-lang="${PN}-core" | ||
134 | FILES_${PN}-lang="${libdir}/python2.7/lib-dynload/_bisect.so ${libdir}/python2.7/lib-dynload/_collections.so ${libdir}/python2.7/lib-dynload/_heapq.so ${libdir}/python2.7/lib-dynload/_weakref.so ${libdir}/python2.7/lib-dynload/_functools.so ${libdir}/python2.7/lib-dynload/array.so ${libdir}/python2.7/lib-dynload/itertools.so ${libdir}/python2.7/lib-dynload/operator.so ${libdir}/python2.7/lib-dynload/parser.so ${libdir}/python2.7/atexit.* ${libdir}/python2.7/bisect.* ${libdir}/python2.7/code.* ${libdir}/python2.7/codeop.* ${libdir}/python2.7/collections.* ${libdir}/python2.7/dis.* ${libdir}/python2.7/functools.* ${libdir}/python2.7/heapq.* ${libdir}/python2.7/inspect.* ${libdir}/python2.7/keyword.* ${libdir}/python2.7/opcode.* ${libdir}/python2.7/symbol.* ${libdir}/python2.7/repr.* ${libdir}/python2.7/token.* ${libdir}/python2.7/tokenize.* ${libdir}/python2.7/traceback.* ${libdir}/python2.7/weakref.* " | ||
135 | |||
136 | SUMMARY_${PN}-logging="Python logging support" | ||
137 | RDEPENDS_${PN}-logging="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold" | ||
138 | FILES_${PN}-logging="${libdir}/python2.7/logging " | ||
139 | |||
140 | SUMMARY_${PN}-mailbox="Python mailbox format support" | ||
141 | RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime" | ||
142 | FILES_${PN}-mailbox="${libdir}/python2.7/mailbox.* " | ||
143 | |||
144 | SUMMARY_${PN}-math="Python math support" | ||
145 | RDEPENDS_${PN}-math="${PN}-core ${PN}-crypt" | ||
146 | FILES_${PN}-math="${libdir}/python2.7/lib-dynload/cmath.so ${libdir}/python2.7/lib-dynload/math.so ${libdir}/python2.7/lib-dynload/_random.so ${libdir}/python2.7/random.* ${libdir}/python2.7/sets.* " | ||
147 | |||
148 | SUMMARY_${PN}-mime="Python MIME handling APIs" | ||
149 | RDEPENDS_${PN}-mime="${PN}-core ${PN}-io" | ||
150 | FILES_${PN}-mime="${libdir}/python2.7/mimetools.* ${libdir}/python2.7/uu.* ${libdir}/python2.7/quopri.* ${libdir}/python2.7/rfc822.* ${libdir}/python2.7/MimeWriter.* " | ||
151 | |||
152 | SUMMARY_${PN}-mmap="Python memory-mapped file support" | ||
153 | RDEPENDS_${PN}-mmap="${PN}-core ${PN}-io" | ||
154 | FILES_${PN}-mmap="${libdir}/python2.7/lib-dynload/mmap.so " | ||
155 | |||
156 | SUMMARY_${PN}-multiprocessing="Python multiprocessing support" | ||
157 | RDEPENDS_${PN}-multiprocessing="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap" | ||
158 | FILES_${PN}-multiprocessing="${libdir}/python2.7/lib-dynload/_multiprocessing.so ${libdir}/python2.7/multiprocessing " | ||
159 | |||
160 | SUMMARY_${PN}-netclient="Python Internet Protocol clients" | ||
161 | RDEPENDS_${PN}-netclient="${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime" | ||
162 | FILES_${PN}-netclient="${libdir}/python2.7/*Cookie*.* ${libdir}/python2.7/base64.* ${libdir}/python2.7/cookielib.* ${libdir}/python2.7/ftplib.* ${libdir}/python2.7/gopherlib.* ${libdir}/python2.7/hmac.* ${libdir}/python2.7/httplib.* ${libdir}/python2.7/mimetypes.* ${libdir}/python2.7/nntplib.* ${libdir}/python2.7/poplib.* ${libdir}/python2.7/smtplib.* ${libdir}/python2.7/telnetlib.* ${libdir}/python2.7/urllib.* ${libdir}/python2.7/urllib2.* ${libdir}/python2.7/urlparse.* ${libdir}/python2.7/uuid.* ${libdir}/python2.7/rfc822.* ${libdir}/python2.7/mimetools.* " | ||
163 | |||
164 | SUMMARY_${PN}-netserver="Python Internet Protocol servers" | ||
165 | RDEPENDS_${PN}-netserver="${PN}-core ${PN}-netclient" | ||
166 | FILES_${PN}-netserver="${libdir}/python2.7/cgi.* ${libdir}/python2.7/*HTTPServer.* ${libdir}/python2.7/SocketServer.* " | ||
167 | |||
168 | SUMMARY_${PN}-numbers="Python number APIs" | ||
169 | RDEPENDS_${PN}-numbers="${PN}-core ${PN}-lang ${PN}-re" | ||
170 | FILES_${PN}-numbers="${libdir}/python2.7/decimal.* ${libdir}/python2.7/numbers.* " | ||
171 | |||
172 | SUMMARY_${PN}-pickle="Python serialisation/persistence support" | ||
173 | RDEPENDS_${PN}-pickle="${PN}-core ${PN}-codecs ${PN}-io ${PN}-re" | ||
174 | FILES_${PN}-pickle="${libdir}/python2.7/pickle.* ${libdir}/python2.7/shelve.* ${libdir}/python2.7/lib-dynload/cPickle.so ${libdir}/python2.7/pickletools.* " | ||
175 | |||
176 | SUMMARY_${PN}-pkgutil="Python package extension utility support" | ||
177 | RDEPENDS_${PN}-pkgutil="${PN}-core" | ||
178 | FILES_${PN}-pkgutil="${libdir}/python2.7/pkgutil.* " | ||
179 | |||
180 | SUMMARY_${PN}-pprint="Python pretty-print support" | ||
181 | RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io" | ||
182 | FILES_${PN}-pprint="${libdir}/python2.7/pprint.* " | ||
183 | |||
184 | SUMMARY_${PN}-profile="Python basic performance profiling support" | ||
185 | RDEPENDS_${PN}-profile="${PN}-core ${PN}-textutils" | ||
186 | FILES_${PN}-profile="${libdir}/python2.7/profile.* ${libdir}/python2.7/pstats.* ${libdir}/python2.7/cProfile.* ${libdir}/python2.7/lib-dynload/_lsprof.so " | ||
187 | |||
188 | SUMMARY_${PN}-pydoc="Python interactive help support" | ||
189 | RDEPENDS_${PN}-pydoc="${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re" | ||
190 | FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python2.7/pydoc.* ${libdir}/python2.7/pydoc_data " | ||
191 | |||
192 | SUMMARY_${PN}-re="Python Regular Expression APIs" | ||
193 | RDEPENDS_${PN}-re="${PN}-core" | ||
194 | FILES_${PN}-re="${libdir}/python2.7/re.* ${libdir}/python2.7/sre.* ${libdir}/python2.7/sre_compile.* ${libdir}/python2.7/sre_constants* ${libdir}/python2.7/sre_parse.* " | ||
195 | |||
196 | SUMMARY_${PN}-readline="Python readline support" | ||
197 | RDEPENDS_${PN}-readline="${PN}-core" | ||
198 | FILES_${PN}-readline="${libdir}/python2.7/lib-dynload/readline.so ${libdir}/python2.7/rlcompleter.* " | ||
199 | |||
200 | SUMMARY_${PN}-resource="Python resource control interface" | ||
201 | RDEPENDS_${PN}-resource="${PN}-core" | ||
202 | FILES_${PN}-resource="${libdir}/python2.7/lib-dynload/resource.so " | ||
203 | |||
204 | SUMMARY_${PN}-robotparser="Python robots.txt parser" | ||
205 | RDEPENDS_${PN}-robotparser="${PN}-core ${PN}-netclient" | ||
206 | FILES_${PN}-robotparser="${libdir}/python2.7/robotparser.* " | ||
207 | |||
208 | SUMMARY_${PN}-shell="Python shell-like functionality" | ||
209 | RDEPENDS_${PN}-shell="${PN}-core ${PN}-re" | ||
210 | FILES_${PN}-shell="${libdir}/python2.7/cmd.* ${libdir}/python2.7/commands.* ${libdir}/python2.7/dircache.* ${libdir}/python2.7/fnmatch.* ${libdir}/python2.7/glob.* ${libdir}/python2.7/popen2.* ${libdir}/python2.7/shlex.* ${libdir}/python2.7/shutil.* " | ||
211 | |||
212 | SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon" | ||
213 | RDEPENDS_${PN}-smtpd="${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime" | ||
214 | FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python2.7/smtpd.* " | ||
215 | |||
216 | SUMMARY_${PN}-sqlite3="Python Sqlite3 database support" | ||
217 | RDEPENDS_${PN}-sqlite3="${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading ${PN}-zlib" | ||
218 | FILES_${PN}-sqlite3="${libdir}/python2.7/lib-dynload/_sqlite3.so ${libdir}/python2.7/sqlite3/dbapi2.* ${libdir}/python2.7/sqlite3/__init__.* ${libdir}/python2.7/sqlite3/dump.* " | ||
219 | |||
220 | SUMMARY_${PN}-sqlite3-tests="Python Sqlite3 database support tests" | ||
221 | RDEPENDS_${PN}-sqlite3-tests="${PN}-core ${PN}-sqlite3" | ||
222 | FILES_${PN}-sqlite3-tests="${libdir}/python2.7/sqlite3/test " | ||
223 | |||
224 | SUMMARY_${PN}-stringold="Python string APIs [deprecated]" | ||
225 | RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re" | ||
226 | FILES_${PN}-stringold="${libdir}/python2.7/lib-dynload/strop.so ${libdir}/python2.7/string.* ${libdir}/python2.7/stringold.* " | ||
227 | |||
228 | SUMMARY_${PN}-subprocess="Python subprocess support" | ||
229 | RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle" | ||
230 | FILES_${PN}-subprocess="${libdir}/python2.7/subprocess.* " | ||
231 | |||
232 | SUMMARY_${PN}-syslog="Python syslog interface" | ||
233 | RDEPENDS_${PN}-syslog="${PN}-core" | ||
234 | FILES_${PN}-syslog="${libdir}/python2.7/lib-dynload/syslog.so " | ||
235 | |||
236 | SUMMARY_${PN}-terminal="Python terminal controlling support" | ||
237 | RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io" | ||
238 | FILES_${PN}-terminal="${libdir}/python2.7/pty.* ${libdir}/python2.7/tty.* " | ||
239 | |||
240 | SUMMARY_${PN}-tests="Python tests" | ||
241 | RDEPENDS_${PN}-tests="${PN}-core" | ||
242 | FILES_${PN}-tests="${libdir}/python2.7/test " | ||
243 | |||
244 | SUMMARY_${PN}-textutils="Python option parsing, text wrapping and CSV support" | ||
245 | RDEPENDS_${PN}-textutils="${PN}-core ${PN}-io ${PN}-re ${PN}-stringold" | ||
246 | FILES_${PN}-textutils="${libdir}/python2.7/lib-dynload/_csv.so ${libdir}/python2.7/csv.* ${libdir}/python2.7/optparse.* ${libdir}/python2.7/textwrap.* " | ||
247 | |||
248 | SUMMARY_${PN}-threading="Python threading & synchronization support" | ||
249 | RDEPENDS_${PN}-threading="${PN}-core ${PN}-lang" | ||
250 | FILES_${PN}-threading="${libdir}/python2.7/_threading_local.* ${libdir}/python2.7/dummy_thread.* ${libdir}/python2.7/dummy_threading.* ${libdir}/python2.7/mutex.* ${libdir}/python2.7/threading.* ${libdir}/python2.7/Queue.* " | ||
251 | |||
252 | SUMMARY_${PN}-tkinter="Python Tcl/Tk bindings" | ||
253 | RDEPENDS_${PN}-tkinter="${PN}-core" | ||
254 | FILES_${PN}-tkinter="${libdir}/python2.7/lib-dynload/_tkinter.so ${libdir}/python2.7/lib-tk " | ||
255 | |||
256 | SUMMARY_${PN}-unittest="Python unit testing framework" | ||
257 | RDEPENDS_${PN}-unittest="${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell" | ||
258 | FILES_${PN}-unittest="${libdir}/python2.7/unittest/ " | ||
259 | |||
260 | SUMMARY_${PN}-unixadmin="Python Unix administration support" | ||
261 | RDEPENDS_${PN}-unixadmin="${PN}-core" | ||
262 | FILES_${PN}-unixadmin="${libdir}/python2.7/lib-dynload/nis.so ${libdir}/python2.7/lib-dynload/grp.so ${libdir}/python2.7/lib-dynload/pwd.so ${libdir}/python2.7/getpass.* " | ||
263 | |||
264 | SUMMARY_${PN}-xml="Python basic XML support" | ||
265 | RDEPENDS_${PN}-xml="${PN}-core ${PN}-elementtree ${PN}-re" | ||
266 | FILES_${PN}-xml="${libdir}/python2.7/lib-dynload/pyexpat.so ${libdir}/python2.7/xml ${libdir}/python2.7/xmllib.* " | ||
267 | |||
268 | SUMMARY_${PN}-xmlrpc="Python XML-RPC support" | ||
269 | RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang" | ||
270 | FILES_${PN}-xmlrpc="${libdir}/python2.7/xmlrpclib.* ${libdir}/python2.7/SimpleXMLRPCServer.* ${libdir}/python2.7/DocXMLRPCServer.* " | ||
271 | |||
272 | SUMMARY_${PN}-zlib="Python zlib compression support" | ||
273 | RDEPENDS_${PN}-zlib="${PN}-core" | ||
274 | FILES_${PN}-zlib="${libdir}/python2.7/lib-dynload/zlib.so " | ||
275 | |||
276 | SUMMARY_${PN}-modules="All Python modules" | ||
277 | RDEPENDS_${PN}-modules="${PN}-2to3 ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-difflib ${PN}-distutils ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-hotshot ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-zlib " | ||
278 | ALLOW_EMPTY_${PN}-modules = "1" | ||
279 | |||
280 | |||
diff --git a/meta/recipes-devtools/python/python-3.3-manifest.inc b/meta/recipes-devtools/python/python-3.3-manifest.inc new file mode 100644 index 0000000000..61119c687c --- /dev/null +++ b/meta/recipes-devtools/python/python-3.3-manifest.inc | |||
@@ -0,0 +1,268 @@ | |||
1 | |||
2 | # WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file. | ||
3 | # Generator: '../../../scripts/contrib/python/generate-manifest-3.3.py' Version 20140131 (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de> | ||
4 | # Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy | ||
5 | |||
6 | |||
7 | |||
8 | PROVIDES+="${PN}-2to3 ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils ${PN}-distutils-staticdev ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc " | ||
9 | |||
10 | PACKAGES="${PN}-dbg ${PN}-2to3 ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils-staticdev ${PN}-distutils ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-modules" | ||
11 | |||
12 | SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator" | ||
13 | RDEPENDS_${PN}-2to3="${PN}-core" | ||
14 | FILES_${PN}-2to3="${bindir}/2to3 ${libdir}/python3.3/lib2to3 " | ||
15 | |||
16 | SUMMARY_${PN}-audio="Python Audio Handling" | ||
17 | RDEPENDS_${PN}-audio="${PN}-core" | ||
18 | FILES_${PN}-audio="${libdir}/python3.3/wave.* ${libdir}/python3.3/chunk.* ${libdir}/python3.3/sndhdr.* ${libdir}/python3.3/lib-dynload/ossaudiodev.*.so ${libdir}/python3.3/lib-dynload/audioop.*.so ${libdir}/python3.3/audiodev.* ${libdir}/python3.3/sunaudio.* ${libdir}/python3.3/sunau.* ${libdir}/python3.3/toaiff.* " | ||
19 | |||
20 | SUMMARY_${PN}-codecs="Python codecs, encodings & i18n support" | ||
21 | RDEPENDS_${PN}-codecs="${PN}-core ${PN}-lang" | ||
22 | FILES_${PN}-codecs="${libdir}/python3.3/codecs.* ${libdir}/python3.3/encodings ${libdir}/python3.3/gettext.* ${libdir}/python3.3/locale.* ${libdir}/python3.3/lib-dynload/_locale.*.so ${libdir}/python3.3/lib-dynload/_codecs* ${libdir}/python3.3/lib-dynload/_multibytecodec.*.so ${libdir}/python3.3/lib-dynload/unicodedata.*.so ${libdir}/python3.3/stringprep.* ${libdir}/python3.3/xdrlib.* " | ||
23 | |||
24 | SUMMARY_${PN}-compile="Python bytecode compilation support" | ||
25 | RDEPENDS_${PN}-compile="${PN}-core" | ||
26 | FILES_${PN}-compile="${libdir}/python3.3/py_compile.* ${libdir}/python3.3/compileall.* " | ||
27 | |||
28 | SUMMARY_${PN}-compression="Python high-level compression support" | ||
29 | RDEPENDS_${PN}-compression="${PN}-core ${PN}-codecs" | ||
30 | FILES_${PN}-compression="${libdir}/python3.3/gzip.* ${libdir}/python3.3/zipfile.* ${libdir}/python3.3/tarfile.* ${libdir}/python3.3/lib-dynload/bz2.*.so " | ||
31 | |||
32 | SUMMARY_${PN}-core="Python interpreter and core modules" | ||
33 | RDEPENDS_${PN}-core="${PN}-lang ${PN}-re ${PN}-reprlib ${PN}-codecs ${PN}-io ${PN}-math" | ||
34 | FILES_${PN}-core="${libdir}/python3.3/__future__.* ${libdir}/python3.3/_abcoll.* ${libdir}/python3.3/abc.* ${libdir}/python3.3/copy.* ${libdir}/python3.3/copyreg.* ${libdir}/python3.3/ConfigParser.* ${libdir}/python3.3/genericpath.* ${libdir}/python3.3/getopt.* ${libdir}/python3.3/linecache.* ${libdir}/python3.3/new.* ${libdir}/python3.3/os.* ${libdir}/python3.3/posixpath.* ${libdir}/python3.3/struct.* ${libdir}/python3.3/warnings.* ${libdir}/python3.3/site.* ${libdir}/python3.3/stat.* ${libdir}/python3.3/UserDict.* ${libdir}/python3.3/UserList.* ${libdir}/python3.3/UserString.* ${libdir}/python3.3/lib-dynload/binascii.*.so ${libdir}/python3.3/lib-dynload/_struct.*.so ${libdir}/python3.3/lib-dynload/time.*.so ${libdir}/python3.3/lib-dynload/xreadlines.*.so ${libdir}/python3.3/types.* ${libdir}/python3.3/platform.* ${bindir}/python* ${libdir}/python3.3/_weakrefset.* ${libdir}/python3.3/sysconfig.* ${libdir}/python3.3/_sysconfigdata.* ${libdir}/python3.3/config/Makefile ${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h ${libdir}/python${PYTHON_MAJMIN}/collections ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py " | ||
35 | |||
36 | SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support" | ||
37 | RDEPENDS_${PN}-crypt="${PN}-core" | ||
38 | FILES_${PN}-crypt="${libdir}/python3.3/hashlib.* ${libdir}/python3.3/md5.* ${libdir}/python3.3/sha.* ${libdir}/python3.3/lib-dynload/crypt.*.so ${libdir}/python3.3/lib-dynload/_hashlib.*.so ${libdir}/python3.3/lib-dynload/_sha256.*.so ${libdir}/python3.3/lib-dynload/_sha512.*.so " | ||
39 | |||
40 | SUMMARY_${PN}-ctypes="Python C types support" | ||
41 | RDEPENDS_${PN}-ctypes="${PN}-core" | ||
42 | FILES_${PN}-ctypes="${libdir}/python3.3/ctypes ${libdir}/python3.3/lib-dynload/_ctypes.*.so ${libdir}/python3.3/lib-dynload/_ctypes_test.*.so " | ||
43 | |||
44 | SUMMARY_${PN}-curses="Python curses support" | ||
45 | RDEPENDS_${PN}-curses="${PN}-core" | ||
46 | FILES_${PN}-curses="${libdir}/python3.3/curses ${libdir}/python3.3/lib-dynload/_curses.*.so ${libdir}/python3.3/lib-dynload/_curses_panel.*.so " | ||
47 | |||
48 | SUMMARY_${PN}-datetime="Python calendar and time support" | ||
49 | RDEPENDS_${PN}-datetime="${PN}-core ${PN}-codecs" | ||
50 | FILES_${PN}-datetime="${libdir}/python3.3/_strptime.* ${libdir}/python3.3/calendar.* ${libdir}/python3.3/lib-dynload/datetime.*.so " | ||
51 | |||
52 | SUMMARY_${PN}-db="Python file-based database support" | ||
53 | RDEPENDS_${PN}-db="${PN}-core" | ||
54 | FILES_${PN}-db="${libdir}/python3.3/anydbm.* ${libdir}/python3.3/dumbdbm.* ${libdir}/python3.3/whichdb.* ${libdir}/python3.3/dbm ${libdir}/python3.3/lib-dynload/_dbm.*.so " | ||
55 | |||
56 | SUMMARY_${PN}-debugger="Python debugger" | ||
57 | RDEPENDS_${PN}-debugger="${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint" | ||
58 | FILES_${PN}-debugger="${libdir}/python3.3/bdb.* ${libdir}/python3.3/pdb.* " | ||
59 | |||
60 | SUMMARY_${PN}-dev="Python development package" | ||
61 | RDEPENDS_${PN}-dev="${PN}-core" | ||
62 | FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig " | ||
63 | |||
64 | SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects" | ||
65 | RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re" | ||
66 | FILES_${PN}-difflib="${libdir}/python3.3/difflib.* " | ||
67 | |||
68 | SUMMARY_${PN}-distutils="Python Distribution Utilities" | ||
69 | RDEPENDS_${PN}-distutils="${PN}-core" | ||
70 | FILES_${PN}-distutils="${libdir}/python3.3/config ${libdir}/python3.3/distutils " | ||
71 | |||
72 | SUMMARY_${PN}-distutils-staticdev="Python distribution utilities (static libraries)" | ||
73 | RDEPENDS_${PN}-distutils-staticdev="${PN}-distutils" | ||
74 | FILES_${PN}-distutils-staticdev="${libdir}/python3.3/config/lib*.a " | ||
75 | |||
76 | SUMMARY_${PN}-doctest="Python framework for running examples in docstrings" | ||
77 | RDEPENDS_${PN}-doctest="${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib" | ||
78 | FILES_${PN}-doctest="${libdir}/python3.3/doctest.* " | ||
79 | |||
80 | SUMMARY_${PN}-elementtree="Python elementree" | ||
81 | RDEPENDS_${PN}-elementtree="${PN}-core" | ||
82 | FILES_${PN}-elementtree="${libdir}/python3.3/lib-dynload/_elementtree.*.so " | ||
83 | |||
84 | SUMMARY_${PN}-email="Python email support" | ||
85 | RDEPENDS_${PN}-email="${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient" | ||
86 | FILES_${PN}-email="${libdir}/python3.3/imaplib.* ${libdir}/python3.3/email " | ||
87 | |||
88 | SUMMARY_${PN}-fcntl="Python's fcntl interface" | ||
89 | RDEPENDS_${PN}-fcntl="${PN}-core" | ||
90 | FILES_${PN}-fcntl="${libdir}/python3.3/lib-dynload/fcntl.*.so " | ||
91 | |||
92 | SUMMARY_${PN}-gdbm="Python GNU database support" | ||
93 | RDEPENDS_${PN}-gdbm="${PN}-core" | ||
94 | FILES_${PN}-gdbm="${libdir}/python3.3/lib-dynload/_gdbm.*.so " | ||
95 | |||
96 | SUMMARY_${PN}-html="Python HTML processing support" | ||
97 | RDEPENDS_${PN}-html="${PN}-core" | ||
98 | FILES_${PN}-html="${libdir}/python3.3/formatter.* ${libdir}/python3.3/htmlentitydefs.* ${libdir}/python3.3/htmllib.* ${libdir}/python3.3/markupbase.* ${libdir}/python3.3/sgmllib.* ${libdir}/python3.3/HTMLParser.* " | ||
99 | |||
100 | SUMMARY_${PN}-idle="Python Integrated Development Environment" | ||
101 | RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter" | ||
102 | FILES_${PN}-idle="${bindir}/idle ${libdir}/python3.3/idlelib " | ||
103 | |||
104 | SUMMARY_${PN}-image="Python graphical image handling" | ||
105 | RDEPENDS_${PN}-image="${PN}-core" | ||
106 | FILES_${PN}-image="${libdir}/python3.3/colorsys.* ${libdir}/python3.3/imghdr.* ${libdir}/python3.3/lib-dynload/imageop.*.so ${libdir}/python3.3/lib-dynload/rgbimg.*.so " | ||
107 | |||
108 | SUMMARY_${PN}-importlib="Python import implementation library" | ||
109 | RDEPENDS_${PN}-importlib="${PN}-core" | ||
110 | FILES_${PN}-importlib="${libdir}/python3.3/importlib " | ||
111 | |||
112 | SUMMARY_${PN}-io="Python low-level I/O" | ||
113 | RDEPENDS_${PN}-io="${PN}-core ${PN}-math" | ||
114 | FILES_${PN}-io="${libdir}/python3.3/lib-dynload/_socket.*.so ${libdir}/python3.3/lib-dynload/_io.*.so ${libdir}/python3.3/lib-dynload/_ssl.*.so ${libdir}/python3.3/lib-dynload/select.*.so ${libdir}/python3.3/lib-dynload/termios.*.so ${libdir}/python3.3/lib-dynload/cStringIO.*.so ${libdir}/python3.3/pipes.* ${libdir}/python3.3/socket.* ${libdir}/python3.3/ssl.* ${libdir}/python3.3/tempfile.* ${libdir}/python3.3/StringIO.* ${libdir}/python3.3/io.* ${libdir}/python3.3/_pyio.* " | ||
115 | |||
116 | SUMMARY_${PN}-json="Python JSON support" | ||
117 | RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re" | ||
118 | FILES_${PN}-json="${libdir}/python3.3/json ${libdir}/python3.3/lib-dynload/_json.*.so " | ||
119 | |||
120 | SUMMARY_${PN}-lang="Python low-level language support" | ||
121 | RDEPENDS_${PN}-lang="${PN}-core" | ||
122 | FILES_${PN}-lang="${libdir}/python3.3/lib-dynload/_bisect.*.so ${libdir}/python3.3/lib-dynload/_collections.*.so ${libdir}/python3.3/lib-dynload/_heapq.*.so ${libdir}/python3.3/lib-dynload/_weakref.*.so ${libdir}/python3.3/lib-dynload/_functools.*.so ${libdir}/python3.3/lib-dynload/array.*.so ${libdir}/python3.3/lib-dynload/itertools.*.so ${libdir}/python3.3/lib-dynload/operator.*.so ${libdir}/python3.3/lib-dynload/parser.*.so ${libdir}/python3.3/atexit.* ${libdir}/python3.3/bisect.* ${libdir}/python3.3/code.* ${libdir}/python3.3/codeop.* ${libdir}/python3.3/collections.* ${libdir}/python3.3/dis.* ${libdir}/python3.3/functools.* ${libdir}/python3.3/heapq.* ${libdir}/python3.3/inspect.* ${libdir}/python3.3/keyword.* ${libdir}/python3.3/opcode.* ${libdir}/python3.3/symbol.* ${libdir}/python3.3/repr.* ${libdir}/python3.3/token.* ${libdir}/python3.3/tokenize.* ${libdir}/python3.3/traceback.* ${libdir}/python3.3/weakref.* " | ||
123 | |||
124 | SUMMARY_${PN}-logging="Python logging support" | ||
125 | RDEPENDS_${PN}-logging="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold" | ||
126 | FILES_${PN}-logging="${libdir}/python3.3/logging " | ||
127 | |||
128 | SUMMARY_${PN}-mailbox="Python mailbox format support" | ||
129 | RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime" | ||
130 | FILES_${PN}-mailbox="${libdir}/python3.3/mailbox.* " | ||
131 | |||
132 | SUMMARY_${PN}-math="Python math support" | ||
133 | RDEPENDS_${PN}-math="${PN}-core" | ||
134 | FILES_${PN}-math="${libdir}/python3.3/lib-dynload/cmath.*.so ${libdir}/python3.3/lib-dynload/math.*.so ${libdir}/python3.3/lib-dynload/_random.*.so ${libdir}/python3.3/random.* ${libdir}/python3.3/sets.* " | ||
135 | |||
136 | SUMMARY_${PN}-mime="Python MIME handling APIs" | ||
137 | RDEPENDS_${PN}-mime="${PN}-core ${PN}-io" | ||
138 | FILES_${PN}-mime="${libdir}/python3.3/mimetools.* ${libdir}/python3.3/uu.* ${libdir}/python3.3/quopri.* ${libdir}/python3.3/rfc822.* ${libdir}/python3.3/MimeWriter.* " | ||
139 | |||
140 | SUMMARY_${PN}-mmap="Python memory-mapped file support" | ||
141 | RDEPENDS_${PN}-mmap="${PN}-core ${PN}-io" | ||
142 | FILES_${PN}-mmap="${libdir}/python3.3/lib-dynload/mmap.*.so " | ||
143 | |||
144 | SUMMARY_${PN}-multiprocessing="Python multiprocessing support" | ||
145 | RDEPENDS_${PN}-multiprocessing="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap" | ||
146 | FILES_${PN}-multiprocessing="${libdir}/python3.3/lib-dynload/_multiprocessing.*.so ${libdir}/python3.3/multiprocessing " | ||
147 | |||
148 | SUMMARY_${PN}-netclient="Python Internet Protocol clients" | ||
149 | RDEPENDS_${PN}-netclient="${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime" | ||
150 | FILES_${PN}-netclient="${libdir}/python3.3/*Cookie*.* ${libdir}/python3.3/base64.* ${libdir}/python3.3/cookielib.* ${libdir}/python3.3/ftplib.* ${libdir}/python3.3/gopherlib.* ${libdir}/python3.3/hmac.* ${libdir}/python3.3/httplib.* ${libdir}/python3.3/mimetypes.* ${libdir}/python3.3/nntplib.* ${libdir}/python3.3/poplib.* ${libdir}/python3.3/smtplib.* ${libdir}/python3.3/telnetlib.* ${libdir}/python3.3/urllib.* ${libdir}/python3.3/urllib2.* ${libdir}/python3.3/urlparse.* ${libdir}/python3.3/uuid.* ${libdir}/python3.3/rfc822.* ${libdir}/python3.3/mimetools.* " | ||
151 | |||
152 | SUMMARY_${PN}-netserver="Python Internet Protocol servers" | ||
153 | RDEPENDS_${PN}-netserver="${PN}-core ${PN}-netclient" | ||
154 | FILES_${PN}-netserver="${libdir}/python3.3/cgi.* ${libdir}/python3.3/*HTTPServer.* ${libdir}/python3.3/SocketServer.* " | ||
155 | |||
156 | SUMMARY_${PN}-numbers="Python number APIs" | ||
157 | RDEPENDS_${PN}-numbers="${PN}-core ${PN}-lang ${PN}-re" | ||
158 | FILES_${PN}-numbers="${libdir}/python3.3/decimal.* ${libdir}/python3.3/numbers.* " | ||
159 | |||
160 | SUMMARY_${PN}-pickle="Python serialisation/persistence support" | ||
161 | RDEPENDS_${PN}-pickle="${PN}-core ${PN}-codecs ${PN}-io ${PN}-re" | ||
162 | FILES_${PN}-pickle="${libdir}/python3.3/pickle.* ${libdir}/python3.3/shelve.* ${libdir}/python3.3/lib-dynload/cPickle.*.so ${libdir}/python3.3/pickletools.* " | ||
163 | |||
164 | SUMMARY_${PN}-pkgutil="Python package extension utility support" | ||
165 | RDEPENDS_${PN}-pkgutil="${PN}-core" | ||
166 | FILES_${PN}-pkgutil="${libdir}/python3.3/pkgutil.* " | ||
167 | |||
168 | SUMMARY_${PN}-pprint="Python pretty-print support" | ||
169 | RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io" | ||
170 | FILES_${PN}-pprint="${libdir}/python3.3/pprint.* " | ||
171 | |||
172 | SUMMARY_${PN}-profile="Python basic performance profiling support" | ||
173 | RDEPENDS_${PN}-profile="${PN}-core ${PN}-textutils" | ||
174 | FILES_${PN}-profile="${libdir}/python3.3/profile.* ${libdir}/python3.3/pstats.* ${libdir}/python3.3/cProfile.* ${libdir}/python3.3/lib-dynload/_lsprof.*.so " | ||
175 | |||
176 | SUMMARY_${PN}-pydoc="Python interactive help support" | ||
177 | RDEPENDS_${PN}-pydoc="${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re" | ||
178 | FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python3.3/pydoc.* ${libdir}/python3.3/pydoc_data " | ||
179 | |||
180 | SUMMARY_${PN}-re="Python Regular Expression APIs" | ||
181 | RDEPENDS_${PN}-re="${PN}-core" | ||
182 | FILES_${PN}-re="${libdir}/python3.3/re.* ${libdir}/python3.3/sre.* ${libdir}/python3.3/sre_compile.* ${libdir}/python3.3/sre_constants* ${libdir}/python3.3/sre_parse.* " | ||
183 | |||
184 | SUMMARY_${PN}-readline="Python readline support" | ||
185 | RDEPENDS_${PN}-readline="${PN}-core" | ||
186 | FILES_${PN}-readline="${libdir}/python3.3/lib-dynload/readline.*.so ${libdir}/python3.3/rlcompleter.* " | ||
187 | |||
188 | SUMMARY_${PN}-reprlib="Python alternate repr() implementation" | ||
189 | RDEPENDS_${PN}-reprlib="${PN}-core" | ||
190 | FILES_${PN}-reprlib="${libdir}/python3.3/reprlib.py " | ||
191 | |||
192 | SUMMARY_${PN}-resource="Python resource control interface" | ||
193 | RDEPENDS_${PN}-resource="${PN}-core" | ||
194 | FILES_${PN}-resource="${libdir}/python3.3/lib-dynload/resource.*.so " | ||
195 | |||
196 | SUMMARY_${PN}-robotparser="Python robots.txt parser" | ||
197 | RDEPENDS_${PN}-robotparser="${PN}-core ${PN}-netclient" | ||
198 | FILES_${PN}-robotparser="${libdir}/python3.3/urllib/robotparser.* " | ||
199 | |||
200 | SUMMARY_${PN}-shell="Python shell-like functionality" | ||
201 | RDEPENDS_${PN}-shell="${PN}-core ${PN}-re" | ||
202 | FILES_${PN}-shell="${libdir}/python3.3/cmd.* ${libdir}/python3.3/commands.* ${libdir}/python3.3/dircache.* ${libdir}/python3.3/fnmatch.* ${libdir}/python3.3/glob.* ${libdir}/python3.3/popen2.* ${libdir}/python3.3/shlex.* ${libdir}/python3.3/shutil.* " | ||
203 | |||
204 | SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon" | ||
205 | RDEPENDS_${PN}-smtpd="${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime" | ||
206 | FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python3.3/smtpd.* " | ||
207 | |||
208 | SUMMARY_${PN}-sqlite3="Python Sqlite3 database support" | ||
209 | RDEPENDS_${PN}-sqlite3="${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading" | ||
210 | FILES_${PN}-sqlite3="${libdir}/python3.3/lib-dynload/_sqlite3.*.so ${libdir}/python3.3/sqlite3/dbapi2.* ${libdir}/python3.3/sqlite3/__init__.* ${libdir}/python3.3/sqlite3/dump.* " | ||
211 | |||
212 | SUMMARY_${PN}-sqlite3-tests="Python Sqlite3 database support tests" | ||
213 | RDEPENDS_${PN}-sqlite3-tests="${PN}-core ${PN}-sqlite3" | ||
214 | FILES_${PN}-sqlite3-tests="${libdir}/python3.3/sqlite3/test " | ||
215 | |||
216 | SUMMARY_${PN}-stringold="Python string APIs [deprecated]" | ||
217 | RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re" | ||
218 | FILES_${PN}-stringold="${libdir}/python3.3/lib-dynload/strop.*.so ${libdir}/python3.3/string.* ${libdir}/python3.3/stringold.* " | ||
219 | |||
220 | SUMMARY_${PN}-subprocess="Python subprocess support" | ||
221 | RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle" | ||
222 | FILES_${PN}-subprocess="${libdir}/python3.3/subprocess.* " | ||
223 | |||
224 | SUMMARY_${PN}-syslog="Python syslog interface" | ||
225 | RDEPENDS_${PN}-syslog="${PN}-core" | ||
226 | FILES_${PN}-syslog="${libdir}/python3.3/lib-dynload/syslog.*.so " | ||
227 | |||
228 | SUMMARY_${PN}-terminal="Python terminal controlling support" | ||
229 | RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io" | ||
230 | FILES_${PN}-terminal="${libdir}/python3.3/pty.* ${libdir}/python3.3/tty.* " | ||
231 | |||
232 | SUMMARY_${PN}-tests="Python tests" | ||
233 | RDEPENDS_${PN}-tests="${PN}-core" | ||
234 | FILES_${PN}-tests="${libdir}/python3.3/test " | ||
235 | |||
236 | SUMMARY_${PN}-textutils="Python option parsing, text wrapping and CSV support" | ||
237 | RDEPENDS_${PN}-textutils="${PN}-core ${PN}-io ${PN}-re ${PN}-stringold" | ||
238 | FILES_${PN}-textutils="${libdir}/python3.3/lib-dynload/_csv.*.so ${libdir}/python3.3/csv.* ${libdir}/python3.3/optparse.* ${libdir}/python3.3/textwrap.* " | ||
239 | |||
240 | SUMMARY_${PN}-threading="Python threading & synchronization support" | ||
241 | RDEPENDS_${PN}-threading="${PN}-core ${PN}-lang" | ||
242 | FILES_${PN}-threading="${libdir}/python3.3/_threading_local.* ${libdir}/python3.3/dummy_thread.* ${libdir}/python3.3/dummy_threading.* ${libdir}/python3.3/mutex.* ${libdir}/python3.3/threading.* ${libdir}/python3.3/Queue.* " | ||
243 | |||
244 | SUMMARY_${PN}-tkinter="Python Tcl/Tk bindings" | ||
245 | RDEPENDS_${PN}-tkinter="${PN}-core" | ||
246 | FILES_${PN}-tkinter="${libdir}/python3.3/lib-dynload/_tkinter.*.so ${libdir}/python3.3/lib-tk ${libdir}/python3.3/tkinter " | ||
247 | |||
248 | SUMMARY_${PN}-unittest="Python unit testing framework" | ||
249 | RDEPENDS_${PN}-unittest="${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell" | ||
250 | FILES_${PN}-unittest="${libdir}/python3.3/unittest/ " | ||
251 | |||
252 | SUMMARY_${PN}-unixadmin="Python Unix administration support" | ||
253 | RDEPENDS_${PN}-unixadmin="${PN}-core" | ||
254 | FILES_${PN}-unixadmin="${libdir}/python3.3/lib-dynload/nis.*.so ${libdir}/python3.3/lib-dynload/grp.*.so ${libdir}/python3.3/lib-dynload/pwd.*.so ${libdir}/python3.3/getpass.* " | ||
255 | |||
256 | SUMMARY_${PN}-xml="Python basic XML support" | ||
257 | RDEPENDS_${PN}-xml="${PN}-core ${PN}-elementtree ${PN}-re" | ||
258 | FILES_${PN}-xml="${libdir}/python3.3/lib-dynload/pyexpat.*.so ${libdir}/python3.3/xml ${libdir}/python3.3/xmllib.* " | ||
259 | |||
260 | SUMMARY_${PN}-xmlrpc="Python XML-RPC support" | ||
261 | RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang" | ||
262 | FILES_${PN}-xmlrpc="${libdir}/python3.3/xmlrpclib.* ${libdir}/python3.3/SimpleXMLRPCServer.* ${libdir}/python3.3/DocXMLRPCServer.* ${libdir}/python3.3/xmlrpc " | ||
263 | |||
264 | SUMMARY_${PN}-modules="All Python modules" | ||
265 | RDEPENDS_${PN}-modules="${PN}-2to3 ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-difflib ${PN}-distutils ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc " | ||
266 | ALLOW_EMPTY_${PN}-modules = "1" | ||
267 | |||
268 | |||
diff --git a/meta/recipes-devtools/python/python-argparse_1.2.1.bb b/meta/recipes-devtools/python/python-argparse_1.2.1.bb new file mode 100644 index 0000000000..b2850a3831 --- /dev/null +++ b/meta/recipes-devtools/python/python-argparse_1.2.1.bb | |||
@@ -0,0 +1,17 @@ | |||
1 | SUMMARY = "Python command-line parsing library" | ||
2 | SECTION = "devel/python" | ||
3 | LICENSE = "PSF" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=09d08bb5b7047e2688ea3faad6408aa8" | ||
5 | SRCNAME = "argparse" | ||
6 | PR = "r4" | ||
7 | RDEPENDS_${PN} += "python-codecs python-textutils" | ||
8 | |||
9 | SRC_URI = "http://argparse.googlecode.com/files/${SRCNAME}-${PV}.tar.gz" | ||
10 | SRC_URI[md5sum] = "2fbef8cb61e506c706957ab6e135840c" | ||
11 | SRC_URI[sha256sum] = "ddaf4b0a618335a32b6664d4ae038a1de8fbada3b25033f9021510ed2b3941a4" | ||
12 | |||
13 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
14 | |||
15 | inherit setuptools | ||
16 | |||
17 | BBCLASSEXTEND = "native" | ||
diff --git a/meta/recipes-devtools/python/python-async_0.6.1.bb b/meta/recipes-devtools/python/python-async_0.6.1.bb new file mode 100644 index 0000000000..17948200e5 --- /dev/null +++ b/meta/recipes-devtools/python/python-async_0.6.1.bb | |||
@@ -0,0 +1,17 @@ | |||
1 | SUMMARY = "Python framework to process interdependent tasks in a pool of workers" | ||
2 | HOMEPAGE = "http://github.com/gitpython-developers/async" | ||
3 | SECTION = "devel/python" | ||
4 | LICENSE = "BSD" | ||
5 | LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=88df8e78b9edfd744953862179f2d14e" | ||
6 | |||
7 | SRC_URI = "http://pypi.python.org/packages/source/a/async/async-${PV}.tar.gz" | ||
8 | SRC_URI[md5sum] = "6f0e2ced1fe85f8410b9bde11be08587" | ||
9 | SRC_URI[sha256sum] = "41d14cc0456e03f34d13af284f65821d07d05c20e621bcaebd38f9ab5095d5d1" | ||
10 | |||
11 | S = "${WORKDIR}/async-${PV}" | ||
12 | |||
13 | inherit distutils | ||
14 | |||
15 | RDEPENDS_${PN} += "python-threading python-lang" | ||
16 | |||
17 | BBCLASSEXTEND = "nativesdk" | ||
diff --git a/meta/recipes-devtools/python/python-dbus_1.2.0.bb b/meta/recipes-devtools/python/python-dbus_1.2.0.bb new file mode 100644 index 0000000000..b314dce1c7 --- /dev/null +++ b/meta/recipes-devtools/python/python-dbus_1.2.0.bb | |||
@@ -0,0 +1,29 @@ | |||
1 | SUMMARY = "Python bindings for the DBus inter-process communication system" | ||
2 | SECTION = "devel/python" | ||
3 | HOMEPAGE = "http://www.freedesktop.org/Software/dbus" | ||
4 | LICENSE = "MIT" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=0b83047ce9e948b67c0facc5f233476a" | ||
6 | DEPENDS = "expat dbus dbus-glib virtual/libintl python-pyrex-native" | ||
7 | |||
8 | SRC_URI = "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-${PV}.tar.gz \ | ||
9 | " | ||
10 | |||
11 | SRC_URI[md5sum] = "b09cd2d1a057cc432ce944de3fc06bf7" | ||
12 | SRC_URI[sha256sum] = "e12c6c8b2bf3a9302f75166952cbe41d6b38c3441bbc6767dbd498942316c6df" | ||
13 | S = "${WORKDIR}/dbus-python-${PV}" | ||
14 | |||
15 | inherit distutils-base autotools pkgconfig | ||
16 | |||
17 | PACKAGECONFIG ?= "" | ||
18 | PACKAGECONFIG[docs] = "--enable-html-docs,--disable-html-docs,python-docutils-native" | ||
19 | PACKAGECONFIG[api-docs] = "--enable-api-docs,--disable-api-docs,python-docutils-native python-epydoc-native" | ||
20 | |||
21 | export BUILD_SYS | ||
22 | export HOST_SYS | ||
23 | |||
24 | export STAGING_LIBDIR | ||
25 | export STAGING_INCDIR | ||
26 | |||
27 | RDEPENDS_${PN} = "python-io python-logging python-stringold python-threading python-xml" | ||
28 | |||
29 | FILES_${PN}-dev += "${libdir}/pkgconfig" | ||
diff --git a/meta/recipes-devtools/python/python-distribute_0.6.32.bb b/meta/recipes-devtools/python/python-distribute_0.6.32.bb new file mode 100644 index 0000000000..70001457e0 --- /dev/null +++ b/meta/recipes-devtools/python/python-distribute_0.6.32.bb | |||
@@ -0,0 +1,55 @@ | |||
1 | SUMMARY = "Download, build, install, upgrade, and uninstall Python packages" | ||
2 | HOMEPAGE = "http://packages.python.org/distribute" | ||
3 | SECTION = "devel/python" | ||
4 | LICENSE = "PSF" | ||
5 | LIC_FILES_CHKSUM = "file://setup.py;beginline=234;endline=234;md5=26f6b02022b737126d3c88838782dddb" | ||
6 | |||
7 | SRCNAME = "distribute" | ||
8 | PR = "ml5" | ||
9 | DEPENDS += "python" | ||
10 | DEPENDS_class-native += "python-native" | ||
11 | |||
12 | SRC_URI = " \ | ||
13 | http://pypi.python.org/packages/source/d/distribute/${SRCNAME}-${PV}.tar.gz \ | ||
14 | " | ||
15 | SRC_URI[md5sum] = "acb7a2da81e3612bfb1608abe4f0e568" | ||
16 | SRC_URI[sha256sum] = "8970cd1e148b5d1fea9430584aea66c45ea22d80e0933393ec49ebc388f718df" | ||
17 | |||
18 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
19 | |||
20 | # http://python-distribute.org/distribute_setup.py | ||
21 | |||
22 | # force the selection of python3 | ||
23 | #PYTHON_BASEVERSION = "3.3" | ||
24 | #PYTHON_MAJMIN = "3.3" | ||
25 | |||
26 | inherit distutils | ||
27 | |||
28 | DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages" | ||
29 | |||
30 | do_install_prepend() { | ||
31 | install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages | ||
32 | } | ||
33 | |||
34 | # | ||
35 | # The installer puts the wrong path in the setuptools.pth file. Correct it. | ||
36 | # | ||
37 | do_install_append() { | ||
38 | rm ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth | ||
39 | echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth | ||
40 | } | ||
41 | |||
42 | do_install_append_class-nativesdk() { | ||
43 | sed -i -e '1s|^#!.*|#!/usr/bin/env python|' ${D}${PYTHON_SITEPACKAGES_DIR}/distribute-${PV}-py${PYTHON_BASEVERSION}.egg/setuptools/tests/test_resources.py | ||
44 | sed -i -e '1s|^#!.*|#!/usr/bin/env python|' ${D}${bindir}/easy_install | ||
45 | sed -i -e '1s|^#!.*|#!/usr/bin/env python|' ${D}${bindir}/easy_install-${PYTHON_BASEVERSION} | ||
46 | } | ||
47 | |||
48 | RDEPENDS_${PN} = "\ | ||
49 | python-distutils \ | ||
50 | python-compression \ | ||
51 | " | ||
52 | |||
53 | RPROVIDES_${PN} += "python-setuptools" | ||
54 | |||
55 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta/recipes-devtools/python/python-docutils_0.12.bb b/meta/recipes-devtools/python/python-docutils_0.12.bb new file mode 100644 index 0000000000..8cda88d277 --- /dev/null +++ b/meta/recipes-devtools/python/python-docutils_0.12.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | SUMMARY = "Text processing system for documentation" | ||
2 | HOMEPAGE = "http://docutils.sourceforge.net" | ||
3 | SECTION = "devel/python" | ||
4 | LICENSE = "PSF & BSD-2-Clause & GPLv3" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING.txt;md5=a722fbdc20347db7b69223594dd54574" | ||
6 | |||
7 | DEPENDS = "python" | ||
8 | |||
9 | SRC_URI = "${SOURCEFORGE_MIRROR}/docutils/docutils-${PV}.tar.gz" | ||
10 | SRC_URI[md5sum] = "4622263b62c5c771c03502afa3157768" | ||
11 | SRC_URI[sha256sum] = "c7db717810ab6965f66c8cf0398a98c9d8df982da39b4cd7f162911eb89596fa" | ||
12 | |||
13 | S = "${WORKDIR}/docutils-${PV}" | ||
14 | |||
15 | inherit distutils | ||
16 | |||
17 | BBCLASSEXTEND = "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 @@ | |||
1 | SUMMARY = "Python library used to interact with Git repositories" | ||
2 | DESCRIPTION = "GitPython provides object model read and write access to \ | ||
3 | a git repository. Access repository information conveniently, alter the \ | ||
4 | index directly, handle remotes, or go down to low-level object database \ | ||
5 | access with big-files support." | ||
6 | HOMEPAGE = "http://github.com/gitpython-developers/GitPython" | ||
7 | SECTION = "devel/python" | ||
8 | LICENSE = "BSD-3-Clause" | ||
9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=8b8d26c37c1d5a04f9b0186edbebc183" | ||
10 | DEPENDS = "python-gitdb" | ||
11 | |||
12 | SRC_URI = "http://pypi.python.org/packages/source/G/GitPython/GitPython-${PV}.tar.gz" | ||
13 | SRC_URI[md5sum] = "849082fe29adc653a3621465213cab96" | ||
14 | SRC_URI[sha256sum] = "fd6786684a0d0dd7ebb961da754e3312fafe0c8e88f55ceb09858aa0af6094e0" | ||
15 | |||
16 | S = "${WORKDIR}/GitPython-${PV}" | ||
17 | |||
18 | inherit setuptools | ||
19 | |||
20 | RDEPENDS_${PN} += "python-gitdb python-lang python-io python-shell python-math python-re python-subprocess python-stringold" | ||
21 | |||
22 | BBCLASSEXTEND = "nativesdk" | ||
diff --git a/meta/recipes-devtools/python/python-gitdb_0.5.4.bb b/meta/recipes-devtools/python/python-gitdb_0.5.4.bb new file mode 100644 index 0000000000..9e961528b9 --- /dev/null +++ b/meta/recipes-devtools/python/python-gitdb_0.5.4.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | SUMMARY = "A pure-Python git object database" | ||
2 | HOMEPAGE = "http://github.com/gitpython-developers/gitdb" | ||
3 | SECTION = "devel/python" | ||
4 | LICENSE = "BSD-3-Clause" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=59e5ecb13339a936eedf83282eaf4528" | ||
6 | DEPENDS = "python-async python-smmap" | ||
7 | |||
8 | SRC_URI = "https://pypi.python.org/packages/source/g/gitdb/gitdb-${PV}.tar.gz" | ||
9 | SRC_URI[md5sum] = "25353bb8d3ea527ba443dd88cd4e8a1c" | ||
10 | SRC_URI[sha256sum] = "de5d2dac0daec4a9cd7bb1ae1cd42d53510dcf597397c608c12a154b69ad3783" | ||
11 | |||
12 | S = "${WORKDIR}/gitdb-${PV}" | ||
13 | |||
14 | inherit distutils | ||
15 | |||
16 | RDEPENDS_${PN} += "python-smmap python-async python-mmap python-lang python-zlib python-io python-shell" | ||
17 | |||
18 | BBCLASSEXTEND = "nativesdk" | ||
diff --git a/meta/recipes-devtools/python/python-gst/python-path.patch b/meta/recipes-devtools/python/python-gst/python-path.patch new file mode 100644 index 0000000000..21b5bbfcfc --- /dev/null +++ b/meta/recipes-devtools/python/python-gst/python-path.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | Upstream-Status:Pending | ||
2 | |||
3 | Index: 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..2a5f2b3239 --- /dev/null +++ b/meta/recipes-devtools/python/python-gst_0.10.22.bb | |||
@@ -0,0 +1,29 @@ | |||
1 | SUMMARY = "Python bindings for the GStreamer multimedia framework" | ||
2 | SECTION = "devel/python" | ||
3 | LICENSE = "LGPLv2.1" | ||
4 | DEPENDS = "gstreamer gst-plugins-base python-pygobject" | ||
5 | RDEPENDS_${PN} += "python-pygtk" | ||
6 | PR = "r2" | ||
7 | |||
8 | SRC_URI = "http://gstreamer.freedesktop.org/src/gst-python/gst-python-${PV}.tar.bz2 \ | ||
9 | file://python-path.patch" | ||
10 | |||
11 | SRC_URI[md5sum] = "937152fe896241f827689f4b53e79b22" | ||
12 | SRC_URI[sha256sum] = "8f26f519a5bccd770864317e098e5e307fc5ad1201eb96329634b6508b253178" | ||
13 | S = "${WORKDIR}/gst-python-${PV}" | ||
14 | |||
15 | LIC_FILES_CHKSUM = "file://COPYING;md5=39ff67e932b7bdfa9b78bad67151690b" | ||
16 | |||
17 | inherit autotools distutils-base pkgconfig | ||
18 | |||
19 | EXTRA_OECONF += "--with-python-includes=${STAGING_INCDIR}/../" | ||
20 | |||
21 | FILES_${PN} += "${datadir}/gst-python" | ||
22 | FILES_${PN}-dev += "${datadir}/gst-python/0.10/defs" | ||
23 | FILES_${PN}-dbg += "${libdir}/${PYTHON_DIR}/site-packages/gst-0.10/gst/.debug/ ${libdir}/gstreamer-0.10/.debug/" | ||
24 | |||
25 | do_configure_prepend() { | ||
26 | if [ `find ${STAGING_LIBDIR} -name libpython*.so` ]; then | ||
27 | ln -sf ${STAGING_LIBDIR}/libpython*.so `find ${STAGING_LIBDIR} -name libpython*.a -exec dirname {} \;` | ||
28 | fi | ||
29 | } | ||
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 @@ | |||
1 | From 07d4f095a9e22ae676a8d68073101131e65012dc Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Tue, 15 Nov 2011 13:16:54 +0100 | ||
4 | Subject: [PATCH] python imaging setup.py: force paths for zlib, freetype and jpeg and don't add host paths | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
7 | |||
8 | Upstream-Status: Inappropriate [embedded specific] | ||
9 | --- | ||
10 | setup.py | 14 +++----------- | ||
11 | 1 files changed, 3 insertions(+), 11 deletions(-) | ||
12 | |||
13 | diff --git a/setup.py b/setup.py | ||
14 | index 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 | -- | ||
54 | 1.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 @@ | |||
1 | At least lcms wasn't deterministicly detected from sysroot. | ||
2 | |||
3 | This will allow to export LCMS_ENABLED=False when lcms isn't in PACKAGECONFIG. | ||
4 | |||
5 | Upstream-Status: Inappropriate [configuration] | ||
6 | |||
7 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
8 | |||
9 | diff -uNr Imaging-1.1.7.orig/setup.py Imaging-1.1.7/setup.py | ||
10 | --- Imaging-1.1.7.orig/setup.py 2013-07-22 10:17:02.081457075 +0200 | ||
11 | +++ Imaging-1.1.7/setup.py 2013-07-22 13:10:09.029707492 +0200 | ||
12 | @@ -39,6 +39,12 @@ | ||
13 | TIFF_ROOT = None | ||
14 | FREETYPE_ROOT = os.environ['STAGING_LIBDIR'], os.environ['STAGING_INCDIR'] | ||
15 | LCMS_ROOT = None | ||
16 | +TCL_ENABLED = os.getenv('TCL_ENABLED', "True") | ||
17 | +JPEG_ENABLED = os.getenv('JPEG_ENABLED', "True") | ||
18 | +ZLIB_ENABLED = os.getenv('ZLIB_ENABLED', "True") | ||
19 | +TIFF_ENABLED = os.getenv('TIFF_ENABLED', "True") | ||
20 | +FREETYPE_ENABLED = os.getenv('FREETYPE_ENABLED', "True") | ||
21 | +LCMS_ENABLED = os.getenv('LCMS_ENABLED', "True") | ||
22 | |||
23 | # FIXME: add mechanism to explicitly *disable* the use of a library | ||
24 | |||
25 | @@ -220,22 +226,22 @@ | ||
26 | zlib = jpeg = tiff = freetype = tcl = tk = lcms = None | ||
27 | feature = feature() | ||
28 | |||
29 | - if find_include_file(self, "zlib.h"): | ||
30 | + if ZLIB_ENABLED == 'True' and find_include_file(self, "zlib.h"): | ||
31 | if find_library_file(self, "z"): | ||
32 | feature.zlib = "z" | ||
33 | elif sys.platform == "win32" and find_library_file(self, "zlib"): | ||
34 | feature.zlib = "zlib" # alternative name | ||
35 | |||
36 | - if find_include_file(self, "jpeglib.h"): | ||
37 | + if JPEG_ENABLED == 'True' and find_include_file(self, "jpeglib.h"): | ||
38 | if find_library_file(self, "jpeg"): | ||
39 | feature.jpeg = "jpeg" | ||
40 | elif sys.platform == "win32" and find_library_file(self, "libjpeg"): | ||
41 | feature.jpeg = "libjpeg" # alternative name | ||
42 | |||
43 | - if find_library_file(self, "tiff"): | ||
44 | + if TIFF_ENABLED == 'True' and find_library_file(self, "tiff"): | ||
45 | feature.tiff = "tiff" | ||
46 | |||
47 | - if find_library_file(self, "freetype"): | ||
48 | + if FREETYPE_ENABLED == 'True' and find_library_file(self, "freetype"): | ||
49 | # look for freetype2 include files | ||
50 | freetype_version = 0 | ||
51 | for dir in self.compiler.include_dirs: | ||
52 | @@ -256,11 +262,11 @@ | ||
53 | if dir: | ||
54 | add_directory(self.compiler.include_dirs, dir, 0) | ||
55 | |||
56 | - if find_include_file(self, "lcms.h"): | ||
57 | + if LCMS_ENABLED == 'True' and find_include_file(self, "lcms.h"): | ||
58 | if find_library_file(self, "lcms"): | ||
59 | feature.lcms = "lcms" | ||
60 | |||
61 | - if _tkinter and find_include_file(self, "tk.h"): | ||
62 | + if TCL_ENABLED == 'True' and _tkinter and find_include_file(self, "tk.h"): | ||
63 | # the library names may vary somewhat (e.g. tcl84 or tcl8.4) | ||
64 | version = TCL_VERSION[0] + TCL_VERSION[2] | ||
65 | if find_library_file(self, "tcl" + version): | ||
diff --git a/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch b/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch new file mode 100644 index 0000000000..9ecc63a0d6 --- /dev/null +++ b/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
3 | |||
4 | From c6040f618d8f2706a7b46d1cdf37d1a587f9701f Mon Sep 17 00:00:00 2001 | ||
5 | From: Andrew Stromnov <stromnov@gmail.com> | ||
6 | Date: Thu, 28 Nov 2013 16:58:43 +0400 | ||
7 | Subject: [PATCH] fix compiling with FreeType 2.5.1 | ||
8 | |||
9 | --- | ||
10 | _imagingft.c | 4 ++++ | ||
11 | 1 file changed, 4 insertions(+) | ||
12 | |||
13 | diff --git a/_imagingft.c b/_imagingft.c | ||
14 | index 47d50bd..f19555b 100644 | ||
15 | --- a/_imagingft.c | ||
16 | +++ b/_imagingft.c | ||
17 | @@ -59,7 +59,11 @@ struct { | ||
18 | const char* message; | ||
19 | } ft_errors[] = | ||
20 | |||
21 | +#if defined(USE_FREETYPE_2_1) | ||
22 | +#include FT_ERRORS_H | ||
23 | +#else | ||
24 | #include <freetype/fterrors.h> | ||
25 | +#endif | ||
26 | |||
27 | /* -------------------------------------------------------------------- */ | ||
28 | /* font objects */ | ||
29 | -- | ||
30 | 1.8.5.1 | ||
diff --git a/meta/recipes-devtools/python/python-imaging_1.1.7.bb b/meta/recipes-devtools/python/python-imaging_1.1.7.bb new file mode 100644 index 0000000000..a678328275 --- /dev/null +++ b/meta/recipes-devtools/python/python-imaging_1.1.7.bb | |||
@@ -0,0 +1,45 @@ | |||
1 | SUMMARY = "Python Imaging Library (PIL)" | ||
2 | SECTION = "devel/python" | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://README;beginline=92;endline=120;md5=c4371af4579f1e489cf881c1443dd4ec" | ||
5 | DEPENDS = "freetype jpeg tiff" | ||
6 | SRCNAME = "Imaging" | ||
7 | PR = "r5" | ||
8 | |||
9 | SRC_URI = "http://effbot.org/downloads/Imaging-${PV}.tar.gz \ | ||
10 | file://0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch \ | ||
11 | file://allow.to.disable.some.features.patch \ | ||
12 | file://fix-freetype-includes.patch" | ||
13 | |||
14 | SRC_URI[md5sum] = "fc14a54e1ce02a0225be8854bfba478e" | ||
15 | SRC_URI[sha256sum] = "895bc7c2498c8e1f9b99938f1a40dc86b3f149741f105cf7c7bd2e0725405211" | ||
16 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
17 | |||
18 | # There isn't enable/disable option, and lcms is in meta-oe, at least make it explicit when enabled | ||
19 | # setup.py already has FIXME: add mechanism to explicitly *disable* the use of a library | ||
20 | PACKAGECONFIG ??= "" | ||
21 | PACKAGECONFIG[lcms] = ",,lcms" | ||
22 | |||
23 | inherit distutils | ||
24 | |||
25 | do_compile() { | ||
26 | export STAGING_LIBDIR=${STAGING_LIBDIR} | ||
27 | export STAGING_INCDIR=${STAGING_INCDIR} | ||
28 | export LCMS_ENABLED=${@bb.utils.contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)} | ||
29 | distutils_do_compile | ||
30 | } | ||
31 | |||
32 | do_install() { | ||
33 | export STAGING_LIBDIR=${STAGING_LIBDIR} | ||
34 | export STAGING_INCDIR=${STAGING_INCDIR} | ||
35 | export LCMS_ENABLED=${@bb.utils.contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)} | ||
36 | distutils_do_install | ||
37 | install -d ${D}${datadir}/doc/${BPN}/html/ | ||
38 | install -m 0644 ${S}/README ${D}${datadir}/doc/${BPN}/ | ||
39 | install -m 0644 ${S}/Docs/* ${D}${datadir}/doc/${BPN}/html/ | ||
40 | |||
41 | # get rid of #!/usr/local/bin/python | ||
42 | sed -i -e 's:/usr/local/bin/:${bindir}/env :g' ${D}${bindir}/* | ||
43 | } | ||
44 | |||
45 | RDEPENDS_${PN} += "python-lang python-stringold" | ||
diff --git a/meta/recipes-devtools/python/python-mako_0.9.1.bb b/meta/recipes-devtools/python/python-mako_0.9.1.bb new file mode 100644 index 0000000000..57d4220477 --- /dev/null +++ b/meta/recipes-devtools/python/python-mako_0.9.1.bb | |||
@@ -0,0 +1,20 @@ | |||
1 | SUMMARY = "Templating library for Python" | ||
2 | SECTION = "devel/python" | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=da2a9d126b93cab0996a8287dacc480b" | ||
5 | |||
6 | SRC_URI = "https://pypi.python.org/packages/source/M/Mako/Mako-${PV}.tar.gz" | ||
7 | SRC_URI[md5sum] = "fe3f394ef714776d09ec6133923736a7" | ||
8 | SRC_URI[sha256sum] = "ed74d72b720a97a51590dfa839f2048ceeb76cc80d1d9ea5731a5262384316ae" | ||
9 | |||
10 | S = "${WORKDIR}/Mako-${PV}" | ||
11 | |||
12 | inherit setuptools | ||
13 | |||
14 | RDEPENDS_${PN} = "python-threading \ | ||
15 | python-netclient \ | ||
16 | python-html \ | ||
17 | " | ||
18 | RDEPENDS_${PN}_class-native = "" | ||
19 | |||
20 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch b/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch new file mode 100644 index 0000000000..a39247ce70 --- /dev/null +++ b/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | Upstream-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> | ||
6 | Index: 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 @@ | |||
1 | Upstream-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 | |||
8 | Index: 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 @@ | |||
1 | Upstream-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 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | Index: 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 @@ | |||
1 | commit 248279e54467a8cd5cde98fc124d1d1384703513 | ||
2 | Author: Yu Ke <ke.yu@intel.com> | ||
3 | Date: 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 | |||
14 | 2011/09/29 | ||
15 | The python recipe building was failing because python-native | ||
16 | could not handle sys.lib var. sys.lib var is defined in the | ||
17 | multilib patch hence added this multilib.patch for python-native | ||
18 | recipe. | ||
19 | |||
20 | Upstream-Status: Inappropriate [oe-specific] | ||
21 | |||
22 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
23 | |||
24 | Index: 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); | ||
36 | Index: 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', | ||
58 | Index: 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', | ||
71 | Index: 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. | ||
98 | Index: 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 | ] | ||
116 | Index: 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) | ||
133 | Index: 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 | ||
171 | Index: 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) | ||
198 | Index: 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 | +} | ||
216 | Index: 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", | ||
229 | Index: 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 @@ | |||
1 | Upstream-Status: Inappropriate [embedded specific] | ||
2 | |||
3 | 2011/09/29 | ||
4 | rebased for python-2.7.2 | ||
5 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
6 | |||
7 | Index: Python-2.7.2/setup.py | ||
8 | =================================================================== | ||
9 | --- Python-2.7.2.orig/setup.py | ||
10 | +++ Python-2.7.2/setup.py | ||
11 | @@ -369,8 +369,8 @@ class PyBuildExt(build_ext): | ||
12 | |||
13 | def detect_modules(self): | ||
14 | # Ensure that /usr/local is always used | ||
15 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | ||
16 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | ||
17 | + #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | ||
18 | + #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | ||
19 | self.add_multiarch_paths() | ||
20 | |||
21 | # Add paths specified in the environment variables LDFLAGS and | ||
22 | @@ -407,15 +407,15 @@ class PyBuildExt(build_ext): | ||
23 | for directory in reversed(options.dirs): | ||
24 | add_dir_to_list(dir_list, directory) | ||
25 | |||
26 | - if os.path.normpath(sys.prefix) != '/usr' \ | ||
27 | - and not sysconfig.get_config_var('PYTHONFRAMEWORK'): | ||
28 | + #if os.path.normpath(sys.prefix) != '/usr' \ | ||
29 | + #and not sysconfig.get_config_var('PYTHONFRAMEWORK'): | ||
30 | # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework | ||
31 | # (PYTHONFRAMEWORK is set) to avoid # linking problems when | ||
32 | # building a framework with different architectures than | ||
33 | # the one that is currently installed (issue #7473) | ||
34 | - add_dir_to_list(self.compiler.library_dirs, | ||
35 | + add_dir_to_list(self.compiler.library_dirs, | ||
36 | sysconfig.get_config_var("LIBDIR")) | ||
37 | - add_dir_to_list(self.compiler.include_dirs, | ||
38 | + add_dir_to_list(self.compiler.include_dirs, | ||
39 | sysconfig.get_config_var("INCLUDEDIR")) | ||
40 | |||
41 | try: | ||
42 | @@ -426,11 +426,8 @@ class PyBuildExt(build_ext): | ||
43 | # lib_dirs and inc_dirs are used to search for files; | ||
44 | # if a file is found in one of those directories, it can | ||
45 | # be assumed that no additional -I,-L directives are needed. | ||
46 | - lib_dirs = self.compiler.library_dirs + [ | ||
47 | - '/lib64', '/usr/lib64', | ||
48 | - '/lib', '/usr/lib', | ||
49 | - ] | ||
50 | - inc_dirs = self.compiler.include_dirs + ['/usr/include'] | ||
51 | + lib_dirs = self.compiler.library_dirs | ||
52 | + inc_dirs = self.compiler.include_dirs | ||
53 | exts = [] | ||
54 | missing = [] | ||
55 | |||
56 | @@ -676,9 +673,8 @@ class PyBuildExt(build_ext): | ||
57 | pass # Issue 7384: Already linked against curses or tinfo. | ||
58 | elif curses_library: | ||
59 | readline_libs.append(curses_library) | ||
60 | - elif self.compiler.find_library_file(lib_dirs + | ||
61 | - ['/usr/lib/termcap'], | ||
62 | - 'termcap'): | ||
63 | + elif self.compiler.find_library_file(lib_dirs, | ||
64 | + 'termcap'): | ||
65 | readline_libs.append('termcap') | ||
66 | exts.append( Extension('readline', ['readline.c'], | ||
67 | library_dirs=['/usr/lib/termcap'], | ||
diff --git a/meta/recipes-devtools/python/python-native/unixccompiler.patch b/meta/recipes-devtools/python/python-native/unixccompiler.patch new file mode 100644 index 0000000000..4502829129 --- /dev/null +++ b/meta/recipes-devtools/python/python-native/unixccompiler.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information. | ||
4 | This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name. | ||
5 | |||
6 | Signed-off-by: Mei Lei <lei.mei@intel.com> | ||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | Index: 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..e55f5feac2 --- /dev/null +++ b/meta/recipes-devtools/python/python-native_2.7.3.bb | |||
@@ -0,0 +1,65 @@ | |||
1 | require python.inc | ||
2 | |||
3 | EXTRANATIVEPATH += "bzip2-native" | ||
4 | DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native" | ||
5 | PR = "${INC_PR}.1" | ||
6 | |||
7 | SRC_URI += "\ | ||
8 | file://05-enable-ctypes-cross-build.patch \ | ||
9 | file://06-ctypes-libffi-fix-configure.patch \ | ||
10 | file://10-distutils-fix-swig-parameter.patch \ | ||
11 | file://11-distutils-never-modify-shebang-line.patch \ | ||
12 | file://12-distutils-prefix-is-inside-staging-area.patch \ | ||
13 | file://debug.patch \ | ||
14 | file://unixccompiler.patch \ | ||
15 | file://nohostlibs.patch \ | ||
16 | file://multilib.patch \ | ||
17 | file://add-md5module-support.patch \ | ||
18 | file://builddir.patch \ | ||
19 | file://parallel-makeinst-create-bindir.patch \ | ||
20 | file://python-fix-build-error-with-Readline-6.3.patch \ | ||
21 | file://gcc-4.8-fix-configure-Wformat.patch \ | ||
22 | file://json-flaw-fix.patch \ | ||
23 | " | ||
24 | S = "${WORKDIR}/Python-${PV}" | ||
25 | |||
26 | FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:" | ||
27 | |||
28 | inherit native | ||
29 | |||
30 | RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-codecs-native python-core-native" | ||
31 | |||
32 | EXTRA_OECONF_append = " --bindir=${bindir}/${PN}" | ||
33 | |||
34 | EXTRA_OEMAKE = '\ | ||
35 | BUILD_SYS="" \ | ||
36 | HOST_SYS="" \ | ||
37 | LIBC="" \ | ||
38 | STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \ | ||
39 | STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \ | ||
40 | ' | ||
41 | |||
42 | do_configure_prepend() { | ||
43 | autoreconf --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" | ||
44 | } | ||
45 | |||
46 | do_install() { | ||
47 | oe_runmake 'DESTDIR=${D}' install | ||
48 | install -d ${D}${bindir}/${PN} | ||
49 | install -m 0755 Parser/pgen ${D}${bindir}/${PN} | ||
50 | |||
51 | # Make sure we use /usr/bin/env python | ||
52 | for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do | ||
53 | sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT | ||
54 | done | ||
55 | |||
56 | # Add a symlink to the native Python so that scripts can just invoke | ||
57 | # "nativepython" and get the right one without needing absolute paths | ||
58 | # (these often end up too long for the #! parser in the kernel as the | ||
59 | # buffer is 128 bytes long). | ||
60 | ln -s python-native/python ${D}${bindir}/nativepython | ||
61 | |||
62 | # We don't want modules in ~/.local being used in preference to those | ||
63 | # installed in the native sysroot, so disable user site support. | ||
64 | sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py | ||
65 | } | ||
diff --git a/meta/recipes-devtools/python/python-nose_1.2.1.bb b/meta/recipes-devtools/python/python-nose_1.2.1.bb new file mode 100644 index 0000000000..f55461d047 --- /dev/null +++ b/meta/recipes-devtools/python/python-nose_1.2.1.bb | |||
@@ -0,0 +1,16 @@ | |||
1 | DESCRIPTION = "nose extends the test loading and running features of unittest, \ | ||
2 | making it easier to write, find and run tests." | ||
3 | SECTION = "devel/python" | ||
4 | LICENSE = "LGPLv2.1" | ||
5 | LIC_FILES_CHKSUM = "file://lgpl.txt;md5=a6f89e2100d9b6cdffcea4f398e37343" | ||
6 | |||
7 | SRC_URI = "http://pypi.python.org/packages/source/n/nose/nose-${PV}.tar.gz" | ||
8 | |||
9 | SRC_URI[md5sum] = "735e3f1ce8b07e70ee1b742a8a53585a" | ||
10 | SRC_URI[sha256sum] = "2171e9202d118d302d5db1decb52dd862b79e2a626ca19653a6914574a6ca7d9" | ||
11 | |||
12 | S = "${WORKDIR}/nose-${PV}" | ||
13 | |||
14 | inherit setuptools | ||
15 | |||
16 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h new file mode 100644 index 0000000000..be57ac27bf --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
12 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
13 | #define NPY_SIZEOF_LONGLONG 8 | ||
14 | #define NPY_NO_SMP 0 | ||
15 | #define NPY_HAVE_DECL_ISNAN | ||
16 | #define NPY_HAVE_DECL_ISINF | ||
17 | #define NPY_HAVE_DECL_ISFINITE | ||
18 | #define NPY_HAVE_DECL_SIGNBIT | ||
19 | #define NPY_USE_C99_COMPLEX 1 | ||
20 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
21 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
22 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
23 | #define NPY_USE_C99_FORMATS 1 | ||
24 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
25 | #define NPY_ABI_VERSION 0x01000009 | ||
26 | #define NPY_API_VERSION 0x00000007 | ||
27 | |||
28 | #ifndef __STDC_FORMAT_MACROS | ||
29 | #define __STDC_FORMAT_MACROS 1 | ||
30 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/aarch64/config.h b/meta/recipes-devtools/python/python-numpy/aarch64/config.h new file mode 100644 index 0000000000..c30b868f2f --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/aarch64/config.h | |||
@@ -0,0 +1,139 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 8 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_IEEE_QUAD_LE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/arm/config.h b/meta/recipes-devtools/python/python-numpy/arm/config.h new file mode 100644 index 0000000000..17ef186d56 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/arm/config.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */ | ||
2 | /* #define SIZEOF_SHORT 2 */ | ||
3 | /* #define SIZEOF_INT 4 */ | ||
4 | /* #define SIZEOF_LONG 4 */ | ||
5 | /* #define SIZEOF_FLOAT 4 */ | ||
6 | /* #define SIZEOF_DOUBLE 8 */ | ||
7 | #define SIZEOF_LONG_DOUBLE 12 | ||
8 | #define SIZEOF_PY_INTPTR_T 4 | ||
9 | /* #define SIZEOF_LONG_LONG 8 */ | ||
10 | #define SIZEOF_PY_LONG_LONG 8 | ||
11 | /* #define CHAR_BIT 8 */ | ||
12 | #define MATHLIB m | ||
13 | #define HAVE_FLOAT_FUNCS | ||
14 | #define HAVE_LOG1P | ||
15 | #define HAVE_EXPM1 | ||
16 | #define HAVE_INVERSE_HYPERBOLIC | ||
17 | #define HAVE_INVERSE_HYPERBOLIC_FLOAT | ||
18 | #define HAVE_ISNAN | ||
19 | #define HAVE_ISINF | ||
20 | #define HAVE_RINT | ||
21 | |||
diff --git a/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h b/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h new file mode 100644 index 0000000000..c4bf6547f0 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */ | ||
2 | /* | ||
3 | * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT | ||
4 | * */ | ||
5 | #define NPY_SIZEOF_SHORT 2 | ||
6 | #define NPY_SIZEOF_INT 4 | ||
7 | #define NPY_SIZEOF_LONG 4 | ||
8 | #define NPY_SIZEOF_FLOAT 4 | ||
9 | #define NPY_SIZEOF_DOUBLE 8 | ||
10 | #define NPY_SIZEOF_LONGDOUBLE 12 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 4 | ||
12 | #define NPY_NO_SMP 0 | ||
13 | |||
14 | #define NPY_SIZEOF_LONGLONG 8 | ||
15 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
16 | /* #define CHAR_BIT 8 */ | ||
17 | |||
diff --git a/meta/recipes-devtools/python/python-numpy/armeb/config.h b/meta/recipes-devtools/python/python-numpy/armeb/config.h new file mode 100644 index 0000000000..17ef186d56 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/armeb/config.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */ | ||
2 | /* #define SIZEOF_SHORT 2 */ | ||
3 | /* #define SIZEOF_INT 4 */ | ||
4 | /* #define SIZEOF_LONG 4 */ | ||
5 | /* #define SIZEOF_FLOAT 4 */ | ||
6 | /* #define SIZEOF_DOUBLE 8 */ | ||
7 | #define SIZEOF_LONG_DOUBLE 12 | ||
8 | #define SIZEOF_PY_INTPTR_T 4 | ||
9 | /* #define SIZEOF_LONG_LONG 8 */ | ||
10 | #define SIZEOF_PY_LONG_LONG 8 | ||
11 | /* #define CHAR_BIT 8 */ | ||
12 | #define MATHLIB m | ||
13 | #define HAVE_FLOAT_FUNCS | ||
14 | #define HAVE_LOG1P | ||
15 | #define HAVE_EXPM1 | ||
16 | #define HAVE_INVERSE_HYPERBOLIC | ||
17 | #define HAVE_INVERSE_HYPERBOLIC_FLOAT | ||
18 | #define HAVE_ISNAN | ||
19 | #define HAVE_ISINF | ||
20 | #define HAVE_RINT | ||
21 | |||
diff --git a/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h b/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h new file mode 100644 index 0000000000..c4bf6547f0 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */ | ||
2 | /* | ||
3 | * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT | ||
4 | * */ | ||
5 | #define NPY_SIZEOF_SHORT 2 | ||
6 | #define NPY_SIZEOF_INT 4 | ||
7 | #define NPY_SIZEOF_LONG 4 | ||
8 | #define NPY_SIZEOF_FLOAT 4 | ||
9 | #define NPY_SIZEOF_DOUBLE 8 | ||
10 | #define NPY_SIZEOF_LONGDOUBLE 12 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 4 | ||
12 | #define NPY_NO_SMP 0 | ||
13 | |||
14 | #define NPY_SIZEOF_LONGLONG 8 | ||
15 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
16 | /* #define CHAR_BIT 8 */ | ||
17 | |||
diff --git a/meta/recipes-devtools/python/python-numpy/i586/config.h b/meta/recipes-devtools/python/python-numpy/i586/config.h new file mode 100644 index 0000000000..08e41e3d99 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/i586/config.h | |||
@@ -0,0 +1,108 @@ | |||
1 | #define SIZEOF_PY_INTPTR_T 4 | ||
2 | #define SIZEOF_PY_LONG_LONG 8 | ||
3 | #define MATHLIB m | ||
4 | #define HAVE_SIN | ||
5 | #define HAVE_COS | ||
6 | #define HAVE_TAN | ||
7 | #define HAVE_SINH | ||
8 | #define HAVE_COSH | ||
9 | #define HAVE_TANH | ||
10 | #define HAVE_FABS | ||
11 | #define HAVE_FLOOR | ||
12 | #define HAVE_CEIL | ||
13 | #define HAVE_SQRT | ||
14 | #define HAVE_LOG10 | ||
15 | #define HAVE_LOG | ||
16 | #define HAVE_EXP | ||
17 | #define HAVE_ASIN | ||
18 | #define HAVE_ACOS | ||
19 | #define HAVE_ATAN | ||
20 | #define HAVE_FMOD | ||
21 | #define HAVE_MODF | ||
22 | #define HAVE_FREXP | ||
23 | #define HAVE_LDEXP | ||
24 | #define HAVE_RINT | ||
25 | #define HAVE_TRUNC | ||
26 | #define HAVE_EXP2 | ||
27 | #define HAVE_LOG2 | ||
28 | #define HAVE_ATAN2 | ||
29 | #define HAVE_POW | ||
30 | #define HAVE_NEXTAFTER | ||
31 | #define HAVE_SINF | ||
32 | #define HAVE_COSF | ||
33 | #define HAVE_TANF | ||
34 | #define HAVE_SINHF | ||
35 | #define HAVE_COSHF | ||
36 | #define HAVE_TANHF | ||
37 | #define HAVE_FABSF | ||
38 | #define HAVE_FLOORF | ||
39 | #define HAVE_CEILF | ||
40 | #define HAVE_RINTF | ||
41 | #define HAVE_TRUNCF | ||
42 | #define HAVE_SQRTF | ||
43 | #define HAVE_LOG10F | ||
44 | #define HAVE_LOGF | ||
45 | #define HAVE_LOG1PF | ||
46 | #define HAVE_EXPF | ||
47 | #define HAVE_EXPM1F | ||
48 | #define HAVE_ASINF | ||
49 | #define HAVE_ACOSF | ||
50 | #define HAVE_ATANF | ||
51 | #define HAVE_ASINHF | ||
52 | #define HAVE_ACOSHF | ||
53 | #define HAVE_ATANHF | ||
54 | #define HAVE_HYPOTF | ||
55 | #define HAVE_ATAN2F | ||
56 | #define HAVE_POWF | ||
57 | #define HAVE_FMODF | ||
58 | #define HAVE_MODFF | ||
59 | #define HAVE_FREXPF | ||
60 | #define HAVE_LDEXPF | ||
61 | #define HAVE_EXP2F | ||
62 | #define HAVE_LOG2F | ||
63 | #define HAVE_COPYSIGNF | ||
64 | #define HAVE_NEXTAFTERF | ||
65 | #define HAVE_SINL | ||
66 | #define HAVE_COSL | ||
67 | #define HAVE_TANL | ||
68 | #define HAVE_SINHL | ||
69 | #define HAVE_COSHL | ||
70 | #define HAVE_TANHL | ||
71 | #define HAVE_FABSL | ||
72 | #define HAVE_FLOORL | ||
73 | #define HAVE_CEILL | ||
74 | #define HAVE_RINTL | ||
75 | #define HAVE_TRUNCL | ||
76 | #define HAVE_SQRTL | ||
77 | #define HAVE_LOG10L | ||
78 | #define HAVE_LOGL | ||
79 | #define HAVE_LOG1PL | ||
80 | #define HAVE_EXPL | ||
81 | #define HAVE_EXPM1L | ||
82 | #define HAVE_ASINL | ||
83 | #define HAVE_ACOSL | ||
84 | #define HAVE_ATANL | ||
85 | #define HAVE_ASINHL | ||
86 | #define HAVE_ACOSHL | ||
87 | #define HAVE_ATANHL | ||
88 | #define HAVE_HYPOTL | ||
89 | #define HAVE_ATAN2L | ||
90 | #define HAVE_POWL | ||
91 | #define HAVE_FMODL | ||
92 | #define HAVE_MODFL | ||
93 | #define HAVE_FREXPL | ||
94 | #define HAVE_LDEXPL | ||
95 | #define HAVE_EXP2L | ||
96 | #define HAVE_LOG2L | ||
97 | #define HAVE_COPYSIGNL | ||
98 | #define HAVE_NEXTAFTERL | ||
99 | #define HAVE_DECL_SIGNBIT | ||
100 | #define HAVE_COMPLEX_H | ||
101 | #define HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE 1 | ||
102 | #ifndef __cplusplus | ||
103 | /* #undef inline */ | ||
104 | #endif | ||
105 | |||
106 | #ifndef _NPY_NPY_CONFIG_H_ | ||
107 | #error config.h should never be included directly, include npy_config.h instead | ||
108 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/i586/numpyconfig.h b/meta/recipes-devtools/python/python-numpy/i586/numpyconfig.h new file mode 100644 index 0000000000..ff7938cd96 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/i586/numpyconfig.h | |||
@@ -0,0 +1,24 @@ | |||
1 | #ifndef _NPY_NUMPYCONFIG_H_ | ||
2 | #define _NPY_NUMPYCONFIG_H_ | ||
3 | |||
4 | #include "_numpyconfig.h" | ||
5 | |||
6 | /* | ||
7 | * On Mac OS X, because there is only one configuration stage for all the archs | ||
8 | * in universal builds, any macro which depends on the arch needs to be | ||
9 | * harcoded | ||
10 | */ | ||
11 | #ifdef __APPLE__ | ||
12 | #undef NPY_SIZEOF_LONG | ||
13 | #undef NPY_SIZEOF_PY_INTPTR_T | ||
14 | |||
15 | #ifdef __LP64__ | ||
16 | #define NPY_SIZEOF_LONG 8 | ||
17 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
18 | #else | ||
19 | #define NPY_SIZEOF_LONG 4 | ||
20 | #define NPY_SIZEOF_PY_INTPTR_T 4 | ||
21 | #endif | ||
22 | #endif | ||
23 | |||
24 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h new file mode 100644 index 0000000000..c0c42851ba --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 8 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 16 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 4 | ||
12 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
13 | #define NPY_SIZEOF_LONGLONG 8 | ||
14 | #define NPY_NO_SMP 0 | ||
15 | #define NPY_HAVE_DECL_ISNAN | ||
16 | #define NPY_HAVE_DECL_ISINF | ||
17 | #define NPY_HAVE_DECL_ISFINITE | ||
18 | #define NPY_HAVE_DECL_SIGNBIT | ||
19 | #define NPY_USE_C99_COMPLEX 1 | ||
20 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
21 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
22 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
23 | #define NPY_USE_C99_FORMATS 1 | ||
24 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
25 | #define NPY_ABI_VERSION 0x01000009 | ||
26 | #define NPY_API_VERSION 0x00000007 | ||
27 | |||
28 | #ifndef __STDC_FORMAT_MACROS | ||
29 | #define __STDC_FORMAT_MACROS 1 | ||
30 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/mips/config.h b/meta/recipes-devtools/python/python-numpy/mips/config.h new file mode 100644 index 0000000000..2f6135adce --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mips/config.h | |||
@@ -0,0 +1,139 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 4 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_IEEE_DOUBLE_BE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h new file mode 100644 index 0000000000..be57ac27bf --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
12 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
13 | #define NPY_SIZEOF_LONGLONG 8 | ||
14 | #define NPY_NO_SMP 0 | ||
15 | #define NPY_HAVE_DECL_ISNAN | ||
16 | #define NPY_HAVE_DECL_ISINF | ||
17 | #define NPY_HAVE_DECL_ISFINITE | ||
18 | #define NPY_HAVE_DECL_SIGNBIT | ||
19 | #define NPY_USE_C99_COMPLEX 1 | ||
20 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
21 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
22 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
23 | #define NPY_USE_C99_FORMATS 1 | ||
24 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
25 | #define NPY_ABI_VERSION 0x01000009 | ||
26 | #define NPY_API_VERSION 0x00000007 | ||
27 | |||
28 | #ifndef __STDC_FORMAT_MACROS | ||
29 | #define __STDC_FORMAT_MACROS 1 | ||
30 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/mips64/config.h b/meta/recipes-devtools/python/python-numpy/mips64/config.h new file mode 100644 index 0000000000..c30b868f2f --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mips64/config.h | |||
@@ -0,0 +1,139 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 8 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_IEEE_QUAD_LE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h new file mode 100644 index 0000000000..be57ac27bf --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
12 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
13 | #define NPY_SIZEOF_LONGLONG 8 | ||
14 | #define NPY_NO_SMP 0 | ||
15 | #define NPY_HAVE_DECL_ISNAN | ||
16 | #define NPY_HAVE_DECL_ISINF | ||
17 | #define NPY_HAVE_DECL_ISFINITE | ||
18 | #define NPY_HAVE_DECL_SIGNBIT | ||
19 | #define NPY_USE_C99_COMPLEX 1 | ||
20 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
21 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
22 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
23 | #define NPY_USE_C99_FORMATS 1 | ||
24 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
25 | #define NPY_ABI_VERSION 0x01000009 | ||
26 | #define NPY_API_VERSION 0x00000007 | ||
27 | |||
28 | #ifndef __STDC_FORMAT_MACROS | ||
29 | #define __STDC_FORMAT_MACROS 1 | ||
30 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/mips64n32/config.h b/meta/recipes-devtools/python/python-numpy/mips64n32/config.h new file mode 100644 index 0000000000..c30b868f2f --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mips64n32/config.h | |||
@@ -0,0 +1,139 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 8 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_IEEE_QUAD_LE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/mipsel/config.h b/meta/recipes-devtools/python/python-numpy/mipsel/config.h new file mode 100644 index 0000000000..17ef186d56 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mipsel/config.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */ | ||
2 | /* #define SIZEOF_SHORT 2 */ | ||
3 | /* #define SIZEOF_INT 4 */ | ||
4 | /* #define SIZEOF_LONG 4 */ | ||
5 | /* #define SIZEOF_FLOAT 4 */ | ||
6 | /* #define SIZEOF_DOUBLE 8 */ | ||
7 | #define SIZEOF_LONG_DOUBLE 12 | ||
8 | #define SIZEOF_PY_INTPTR_T 4 | ||
9 | /* #define SIZEOF_LONG_LONG 8 */ | ||
10 | #define SIZEOF_PY_LONG_LONG 8 | ||
11 | /* #define CHAR_BIT 8 */ | ||
12 | #define MATHLIB m | ||
13 | #define HAVE_FLOAT_FUNCS | ||
14 | #define HAVE_LOG1P | ||
15 | #define HAVE_EXPM1 | ||
16 | #define HAVE_INVERSE_HYPERBOLIC | ||
17 | #define HAVE_INVERSE_HYPERBOLIC_FLOAT | ||
18 | #define HAVE_ISNAN | ||
19 | #define HAVE_ISINF | ||
20 | #define HAVE_RINT | ||
21 | |||
diff --git a/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h b/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h new file mode 100644 index 0000000000..c4bf6547f0 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */ | ||
2 | /* | ||
3 | * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT | ||
4 | * */ | ||
5 | #define NPY_SIZEOF_SHORT 2 | ||
6 | #define NPY_SIZEOF_INT 4 | ||
7 | #define NPY_SIZEOF_LONG 4 | ||
8 | #define NPY_SIZEOF_FLOAT 4 | ||
9 | #define NPY_SIZEOF_DOUBLE 8 | ||
10 | #define NPY_SIZEOF_LONGDOUBLE 12 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 4 | ||
12 | #define NPY_NO_SMP 0 | ||
13 | |||
14 | #define NPY_SIZEOF_LONGLONG 8 | ||
15 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
16 | /* #define CHAR_BIT 8 */ | ||
17 | |||
diff --git a/meta/recipes-devtools/python/python-numpy/no-host-paths.patch b/meta/recipes-devtools/python/python-numpy/no-host-paths.patch new file mode 100644 index 0000000000..0efb01a6bb --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/no-host-paths.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | Don't search /usr and so on for libraries by default to avoid host contamination. | ||
2 | |||
3 | Upstream-Status: Inapproprite (As the code stands, this is a hack) | ||
4 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
5 | |||
6 | diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py | ||
7 | index bac90fb..a63d796 100644 | ||
8 | --- a/numpy/distutils/system_info.py | ||
9 | +++ b/numpy/distutils/system_info.py | ||
10 | @@ -191,41 +191,12 @@ if sys.platform == 'win32': | ||
11 | default_x11_lib_dirs = [] | ||
12 | default_x11_include_dirs = [] | ||
13 | else: | ||
14 | - default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib', | ||
15 | - '/opt/local/lib', '/sw/lib'], platform_bits) | ||
16 | - default_include_dirs = ['/usr/local/include', | ||
17 | - '/opt/include', '/usr/include', | ||
18 | - # path of umfpack under macports | ||
19 | - '/opt/local/include/ufsparse', | ||
20 | - '/opt/local/include', '/sw/include', | ||
21 | - '/usr/include/suitesparse'] | ||
22 | - default_src_dirs = ['.', '/usr/local/src', '/opt/src', '/sw/src'] | ||
23 | - | ||
24 | - default_x11_lib_dirs = libpaths(['/usr/X11R6/lib', '/usr/X11/lib', | ||
25 | - '/usr/lib'], platform_bits) | ||
26 | - default_x11_include_dirs = ['/usr/X11R6/include', '/usr/X11/include', | ||
27 | - '/usr/include'] | ||
28 | - | ||
29 | - if os.path.exists('/usr/lib/X11'): | ||
30 | - globbed_x11_dir = glob('/usr/lib/*/libX11.so') | ||
31 | - if globbed_x11_dir: | ||
32 | - x11_so_dir = os.path.split(globbed_x11_dir[0])[0] | ||
33 | - default_x11_lib_dirs.extend([x11_so_dir, '/usr/lib/X11']) | ||
34 | - default_x11_include_dirs.extend(['/usr/lib/X11/include', | ||
35 | - '/usr/include/X11']) | ||
36 | - | ||
37 | - import subprocess as sp | ||
38 | - try: | ||
39 | - p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE, | ||
40 | - stderr=open(os.devnull, 'w')) | ||
41 | - except OSError: | ||
42 | - pass # gcc is not installed | ||
43 | - else: | ||
44 | - triplet = str(p.communicate()[0].decode().strip()) | ||
45 | - if p.returncode == 0: | ||
46 | - # gcc supports the "-print-multiarch" option | ||
47 | - default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)] | ||
48 | - default_lib_dirs += [os.path.join("/usr/lib/", triplet)] | ||
49 | + default_lib_dirs = libpaths(['/deadir/lib'], platform_bits) | ||
50 | + default_include_dirs = ['/deaddir/include'] | ||
51 | + default_src_dirs = ['.', '/deaddir/src'] | ||
52 | + | ||
53 | + default_x11_lib_dirs = libpaths(['/deaddir/lib'], platform_bits) | ||
54 | + default_x11_include_dirs = ['/deaddir/include'] | ||
55 | |||
56 | if os.path.join(sys.prefix, 'lib') not in default_lib_dirs: | ||
57 | default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib')) | ||
diff --git a/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h new file mode 100644 index 0000000000..73cbfb1baa --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 4 | ||
12 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
13 | #define NPY_SIZEOF_LONGLONG 8 | ||
14 | #define NPY_NO_SMP 0 | ||
15 | #define NPY_HAVE_DECL_ISNAN | ||
16 | #define NPY_HAVE_DECL_ISINF | ||
17 | #define NPY_HAVE_DECL_ISFINITE | ||
18 | #define NPY_HAVE_DECL_SIGNBIT | ||
19 | #define NPY_USE_C99_COMPLEX 1 | ||
20 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
21 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
22 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
23 | #define NPY_USE_C99_FORMATS 1 | ||
24 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
25 | #define NPY_ABI_VERSION 0x01000009 | ||
26 | #define NPY_API_VERSION 0x00000007 | ||
27 | |||
28 | #ifndef __STDC_FORMAT_MACROS | ||
29 | #define __STDC_FORMAT_MACROS 1 | ||
30 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/powerpc/config.h b/meta/recipes-devtools/python/python-numpy/powerpc/config.h new file mode 100644 index 0000000000..f65d39d5de --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/powerpc/config.h | |||
@@ -0,0 +1,139 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 4 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_DOUBLE_DOUBLE_BE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h new file mode 100644 index 0000000000..be57ac27bf --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
12 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
13 | #define NPY_SIZEOF_LONGLONG 8 | ||
14 | #define NPY_NO_SMP 0 | ||
15 | #define NPY_HAVE_DECL_ISNAN | ||
16 | #define NPY_HAVE_DECL_ISINF | ||
17 | #define NPY_HAVE_DECL_ISFINITE | ||
18 | #define NPY_HAVE_DECL_SIGNBIT | ||
19 | #define NPY_USE_C99_COMPLEX 1 | ||
20 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
21 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
22 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
23 | #define NPY_USE_C99_FORMATS 1 | ||
24 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
25 | #define NPY_ABI_VERSION 0x01000009 | ||
26 | #define NPY_API_VERSION 0x00000007 | ||
27 | |||
28 | #ifndef __STDC_FORMAT_MACROS | ||
29 | #define __STDC_FORMAT_MACROS 1 | ||
30 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/powerpc64/config.h b/meta/recipes-devtools/python/python-numpy/powerpc64/config.h new file mode 100644 index 0000000000..c30b868f2f --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/powerpc64/config.h | |||
@@ -0,0 +1,139 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 8 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_IEEE_QUAD_LE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/trycompile.diff b/meta/recipes-devtools/python/python-numpy/trycompile.diff new file mode 100644 index 0000000000..6824227cff --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/trycompile.diff | |||
@@ -0,0 +1,36 @@ | |||
1 | Upstream-Status: Pending | ||
2 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | |||
4 | --- /tmp/setup.py 2008-09-01 10:37:44.000000000 +0200 | ||
5 | +++ numpy-1.1.1/numpy/core/setup.py 2008-09-01 10:38:20.373198000 +0200 | ||
6 | @@ -80,8 +80,7 @@ | ||
7 | raise SystemError,\ | ||
8 | "Non-existing %s. Perhaps you need to install"\ | ||
9 | " python-dev|python-devel." % (python_h) | ||
10 | - result = config_cmd.try_run(tc,include_dirs=[python_include], | ||
11 | - library_dirs = default_lib_dirs) | ||
12 | + result = config_cmd.try_compile(tc) | ||
13 | if not result: | ||
14 | raise SystemError,"Failed to test configuration. "\ | ||
15 | "See previous error messages for more information." | ||
16 | @@ -95,7 +94,7 @@ | ||
17 | if mathlib: | ||
18 | mathlibs_choices.insert(0,mathlib.split(',')) | ||
19 | for libs in mathlibs_choices: | ||
20 | - if config_cmd.try_run(tc,libraries=libs): | ||
21 | + if config_cmd.try_compile(tc): | ||
22 | mathlibs = libs | ||
23 | break | ||
24 | else: | ||
25 | @@ -180,10 +179,7 @@ | ||
26 | " python-dev|python-devel." % (python_h) | ||
27 | |||
28 | config.numpy_include_dirs | ||
29 | - result = config_cmd.try_run(testcode, | ||
30 | - include_dirs = [python_include] + \ | ||
31 | - config.numpy_include_dirs, | ||
32 | - library_dirs = default_lib_dirs) | ||
33 | + result = config_cmd.try_compile(testcode) | ||
34 | |||
35 | if not result: | ||
36 | raise SystemError,"Failed to generate numpy configuration. "\ | ||
diff --git a/meta/recipes-devtools/python/python-numpy/unbreak-assumptions.diff b/meta/recipes-devtools/python/python-numpy/unbreak-assumptions.diff new file mode 100644 index 0000000000..20ec6fdbc7 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/unbreak-assumptions.diff | |||
@@ -0,0 +1,19 @@ | |||
1 | Upstream-Status: Inappropriate | ||
2 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | |||
4 | --- /tmp/system_info.py 2008-08-22 00:38:16.000000000 +0200 | ||
5 | +++ numpy-1.1.1/numpy/distutils/system_info.py 2008-08-22 00:40:33.013198000 +0200 | ||
6 | @@ -137,11 +137,8 @@ | ||
7 | default_x11_lib_dirs = [] | ||
8 | default_x11_include_dirs = [] | ||
9 | else: | ||
10 | - default_lib_dirs = ['/usr/local/lib', '/opt/lib', '/usr/lib', | ||
11 | - '/opt/local/lib', '/sw/lib'] | ||
12 | - default_include_dirs = ['/usr/local/include', | ||
13 | - '/opt/include', '/usr/include', | ||
14 | - '/opt/local/include', '/sw/include'] | ||
15 | + default_lib_dirs = ['/non-existant-dir'] | ||
16 | + default_include_dirs = ['non-existant-dir'] | ||
17 | default_src_dirs = ['.','/usr/local/src', '/opt/src','/sw/src'] | ||
18 | |||
19 | try: | ||
diff --git a/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h new file mode 100644 index 0000000000..be57ac27bf --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
12 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
13 | #define NPY_SIZEOF_LONGLONG 8 | ||
14 | #define NPY_NO_SMP 0 | ||
15 | #define NPY_HAVE_DECL_ISNAN | ||
16 | #define NPY_HAVE_DECL_ISINF | ||
17 | #define NPY_HAVE_DECL_ISFINITE | ||
18 | #define NPY_HAVE_DECL_SIGNBIT | ||
19 | #define NPY_USE_C99_COMPLEX 1 | ||
20 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
21 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
22 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
23 | #define NPY_USE_C99_FORMATS 1 | ||
24 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
25 | #define NPY_ABI_VERSION 0x01000009 | ||
26 | #define NPY_API_VERSION 0x00000007 | ||
27 | |||
28 | #ifndef __STDC_FORMAT_MACROS | ||
29 | #define __STDC_FORMAT_MACROS 1 | ||
30 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy/x86-64/config.h b/meta/recipes-devtools/python/python-numpy/x86-64/config.h new file mode 100644 index 0000000000..0ce63b7d22 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy/x86-64/config.h | |||
@@ -0,0 +1,139 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 8 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python/python-numpy_1.7.0.bb b/meta/recipes-devtools/python/python-numpy_1.7.0.bb new file mode 100644 index 0000000000..d4fd279230 --- /dev/null +++ b/meta/recipes-devtools/python/python-numpy_1.7.0.bb | |||
@@ -0,0 +1,99 @@ | |||
1 | SUMMARY = "A sophisticated Numeric Processing Package for Python" | ||
2 | SECTION = "devel/python" | ||
3 | LICENSE = "PSF" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f87832d854acbade6e9f5c601c8b30b1" | ||
5 | PR = "r1" | ||
6 | |||
7 | SRC_URI = "${SOURCEFORGE_MIRROR}/numpy/numpy-${PV}.tar.gz \ | ||
8 | file://no-host-paths.patch \ | ||
9 | ${CONFIGFILESURI} " | ||
10 | |||
11 | CONFIGFILESURI ?= "" | ||
12 | |||
13 | CONFIGFILESURI_aarch64 = " \ | ||
14 | file://config.h \ | ||
15 | file://_numpyconfig.h \ | ||
16 | " | ||
17 | CONFIGFILESURI_arm = " \ | ||
18 | file://config.h \ | ||
19 | file://numpyconfig.h \ | ||
20 | " | ||
21 | CONFIGFILESURI_armeb = " \ | ||
22 | file://config.h \ | ||
23 | file://numpyconfig.h \ | ||
24 | " | ||
25 | CONFIGFILESURI_mipsel = " \ | ||
26 | file://config.h \ | ||
27 | file://numpyconfig.h \ | ||
28 | " | ||
29 | CONFIGFILESURI_i586 = " \ | ||
30 | file://config.h \ | ||
31 | file://numpyconfig.h \ | ||
32 | " | ||
33 | CONFIGFILESURI_x86-64 = " \ | ||
34 | file://config.h \ | ||
35 | file://_numpyconfig.h \ | ||
36 | " | ||
37 | CONFIGFILESURI_mips = " \ | ||
38 | file://config.h \ | ||
39 | file://_numpyconfig.h \ | ||
40 | " | ||
41 | CONFIGFILESURI_powerpc = " \ | ||
42 | file://config.h \ | ||
43 | file://_numpyconfig.h \ | ||
44 | " | ||
45 | CONFIGFILESURI_powerpc64 = " \ | ||
46 | file://config.h \ | ||
47 | file://_numpyconfig.h \ | ||
48 | " | ||
49 | CONFIGFILESURI_mips64 = " \ | ||
50 | file://config.h \ | ||
51 | file://_numpyconfig.h \ | ||
52 | " | ||
53 | CONFIGFILESURI_mips64n32 = " \ | ||
54 | file://config.h \ | ||
55 | file://_numpyconfig.h \ | ||
56 | " | ||
57 | |||
58 | S = "${WORKDIR}/numpy-${PV}" | ||
59 | |||
60 | inherit distutils | ||
61 | |||
62 | # Make the build fail and replace *config.h with proper one | ||
63 | # This is a ugly, ugly hack - Koen | ||
64 | do_compile_prepend_class-target() { | ||
65 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
66 | ${STAGING_BINDIR_NATIVE}/python-native/python setup.py build ${DISTUTILS_BUILD_ARGS} || \ | ||
67 | true | ||
68 | cp ${WORKDIR}/*config.h ${S}/build/$(ls ${S}/build | grep src)/numpy/core/include/numpy/ | ||
69 | } | ||
70 | |||
71 | FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a" | ||
72 | |||
73 | SRC_URI[md5sum] = "4fa54e40b6a243416f0248123b6ec332" | ||
74 | SRC_URI[sha256sum] = "f4fa70b7edbab65ee6432eb63743f5489f1919c614632b20b2fb45aa7e682ac6" | ||
75 | |||
76 | # install what is needed for numpy.test() | ||
77 | RDEPENDS_${PN} = "python-unittest \ | ||
78 | python-difflib \ | ||
79 | python-pprint \ | ||
80 | python-pickle \ | ||
81 | python-shell \ | ||
82 | python-nose \ | ||
83 | python-doctest \ | ||
84 | python-datetime \ | ||
85 | python-distutils \ | ||
86 | python-misc \ | ||
87 | python-mmap \ | ||
88 | python-netclient \ | ||
89 | python-numbers \ | ||
90 | python-pydoc \ | ||
91 | python-pkgutil \ | ||
92 | python-email \ | ||
93 | python-subprocess \ | ||
94 | python-compression \ | ||
95 | " | ||
96 | |||
97 | RDEPENDS_${PN}_class-native = "" | ||
98 | |||
99 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta/recipes-devtools/python/python-pycairo_1.10.0.bb b/meta/recipes-devtools/python/python-pycairo_1.10.0.bb new file mode 100644 index 0000000000..70fe25c1a1 --- /dev/null +++ b/meta/recipes-devtools/python/python-pycairo_1.10.0.bb | |||
@@ -0,0 +1,41 @@ | |||
1 | SUMMARY = "Python bindings for the Cairo canvas library" | ||
2 | HOMEPAGE = "http://cairographics.org/pycairo" | ||
3 | BUGTRACKER = "http://bugs.freedesktop.org" | ||
4 | SECTION = "python-devel" | ||
5 | LICENSE = "LGPLv2.1 & MPL-1.1" | ||
6 | LIC_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 | ||
11 | DEPENDS = "cairo" | ||
12 | PR = "r2" | ||
13 | |||
14 | SRC_URI = "http://cairographics.org/releases/py2cairo-${PV}.tar.bz2" | ||
15 | |||
16 | SRC_URI[md5sum] = "20337132c4ab06c1146ad384d55372c5" | ||
17 | SRC_URI[sha256sum] = "d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431" | ||
18 | |||
19 | S = "${WORKDIR}/py2cairo-${PV}" | ||
20 | |||
21 | inherit distutils pkgconfig | ||
22 | |||
23 | BBCLASSEXTEND = "native" | ||
24 | |||
25 | do_configure() { | ||
26 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} ./waf configure --prefix=${D}${prefix} --libdir=${D}${libdir} | ||
27 | } | ||
28 | |||
29 | do_compile() { | ||
30 | ./waf build ${PARALLEL_MAKE} | ||
31 | } | ||
32 | |||
33 | do_install() { | ||
34 | ./waf install | ||
35 | sed \ | ||
36 | -e 's:@prefix@:${prefix}:' \ | ||
37 | -e 's:@VERSION@:${PV}:' \ | ||
38 | -e 's:@includedir@:${includedir}:' \ | ||
39 | pycairo.pc.in > pycairo.pc | ||
40 | install -m 0644 pycairo.pc ${D}${libdir}/pkgconfig/ | ||
41 | } | ||
diff --git a/meta/recipes-devtools/python/python-pycurl/no-static-link.patch b/meta/recipes-devtools/python/python-pycurl/no-static-link.patch new file mode 100644 index 0000000000..c5349ee578 --- /dev/null +++ b/meta/recipes-devtools/python/python-pycurl/no-static-link.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> | ||
4 | |||
5 | Index: pycurl-7.19.3.1/setup.py | ||
6 | =================================================================== | ||
7 | --- pycurl-7.19.3.1.orig/setup.py 2014-07-16 12:57:24.065346887 +0000 | ||
8 | +++ pycurl-7.19.3.1/setup.py 2014-07-16 12:57:53.057347678 +0000 | ||
9 | @@ -147,7 +147,7 @@ | ||
10 | optbuf = '' | ||
11 | sslhintbuf = '' | ||
12 | errtext = '' | ||
13 | - for option in ["--libs", "--static-libs"]: | ||
14 | + for option in ["--libs"]: | ||
15 | p = subprocess.Popen((CURL_CONFIG, option), | ||
16 | stdout=subprocess.PIPE, stderr=subprocess.PIPE) | ||
17 | stdout, stderr = p.communicate() | ||
diff --git a/meta/recipes-devtools/python/python-pycurl_7.19.3.1.bb b/meta/recipes-devtools/python/python-pycurl_7.19.3.1.bb new file mode 100644 index 0000000000..02d0ae9be0 --- /dev/null +++ b/meta/recipes-devtools/python/python-pycurl_7.19.3.1.bb | |||
@@ -0,0 +1,34 @@ | |||
1 | SUMMARY = "Python bindings for libcurl" | ||
2 | HOMEPAGE = "http://pycurl.sourceforge.net/" | ||
3 | SECTION = "devel/python" | ||
4 | LICENSE = "LGPLv2.1+ | MIT" | ||
5 | LIC_FILES_CHKSUM = "file://README.rst;beginline=148;endline=163;md5=57e5ab0c0f964533fc59d93dec5695bb \ | ||
6 | file://COPYING-LGPL;md5=3579a9fd0221d49a237aaa33492f988c \ | ||
7 | file://COPYING-MIT;md5=e8200955c773b2a0fd6cea36ea5e87be" | ||
8 | |||
9 | DEPENDS = "curl python" | ||
10 | RDEPENDS_${PN} = "python-core curl" | ||
11 | SRCNAME = "pycurl" | ||
12 | |||
13 | SRC_URI = "\ | ||
14 | http://${SRCNAME}.sourceforge.net/download/${SRCNAME}-${PV}.tar.gz;name=archive \ | ||
15 | file://no-static-link.patch \ | ||
16 | " | ||
17 | |||
18 | SRC_URI[archive.md5sum] = "6df8fa7fe8b680d93248da1f8d4fcd12" | ||
19 | SRC_URI[archive.sha256sum] = "c0d673fe99a9de07239eabe77c798f1b043f60c02afaec1430ceaf59d7501a4f" | ||
20 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
21 | |||
22 | inherit distutils | ||
23 | |||
24 | # need to export these variables for python-config to work | ||
25 | export BUILD_SYS | ||
26 | export HOST_SYS | ||
27 | export STAGING_INCDIR | ||
28 | export STAGING_LIBDIR | ||
29 | |||
30 | BBCLASSEXTEND = "native" | ||
31 | |||
32 | do_install_append() { | ||
33 | rm -rf ${D}${datadir}/share | ||
34 | } | ||
diff --git a/meta/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch b/meta/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch new file mode 100644 index 0000000000..c2591123b3 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | Upstream-Status: Accepted [https://bugzilla.gnome.org/show_bug.cgi?id=691101] | ||
2 | |||
3 | Signed-off-by: Marko Lindqvist <cazfi74@gmail.com> | ||
4 | diff -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.28.3.bb b/meta/recipes-devtools/python/python-pygobject_2.28.3.bb new file mode 100644 index 0000000000..45a0603eb7 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygobject_2.28.3.bb | |||
@@ -0,0 +1,39 @@ | |||
1 | SUMMARY = "Python GObject bindings" | ||
2 | SECTION = "devel/python" | ||
3 | LICENSE = "LGPLv2.1" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7" | ||
5 | DEPENDS = "python python-pygobject-native libffi glib-2.0" | ||
6 | DEPENDS_class-native = "python-native libffi-native glib-2.0-native" | ||
7 | RDEPENDS_class-native = "" | ||
8 | |||
9 | MAJ_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}" | ||
10 | |||
11 | SRC_URI = "${GNOME_MIRROR}/pygobject/${MAJ_VER}/pygobject-${PV}.tar.bz2 \ | ||
12 | file://obsolete_automake_macros.patch \ | ||
13 | " | ||
14 | |||
15 | SRC_URI[md5sum] = "aa64900b274c4661a5c32e52922977f9" | ||
16 | SRC_URI[sha256sum] = "7da88c169a56efccc516cebd9237da3fe518a343095a664607b368fe21df95b6" | ||
17 | S = "${WORKDIR}/pygobject-${PV}" | ||
18 | |||
19 | EXTRA_OECONF += "--disable-introspection" | ||
20 | |||
21 | PARALLEL_MAKEINST = "" | ||
22 | |||
23 | inherit autotools distutils-base pkgconfig | ||
24 | |||
25 | # necessary to let the call for python-config succeed | ||
26 | export BUILD_SYS | ||
27 | export HOST_SYS | ||
28 | export STAGING_INCDIR | ||
29 | export STAGING_LIBDIR | ||
30 | |||
31 | PACKAGES += "${PN}-lib" | ||
32 | |||
33 | RDEPENDS_${PN} += "python-textutils" | ||
34 | |||
35 | FILES_${PN} = "${libdir}/python*" | ||
36 | FILES_${PN}-lib = "${libdir}/lib*.so.*" | ||
37 | FILES_${PN}-dev += "${bindir} ${datadir}" | ||
38 | |||
39 | BBCLASSEXTEND = "native" | ||
diff --git a/meta/recipes-devtools/python/python-pygtk/acinclude.m4 b/meta/recipes-devtools/python/python-pygtk/acinclude.m4 new file mode 100644 index 0000000000..53518fb2eb --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/acinclude.m4 | |||
@@ -0,0 +1,90 @@ | |||
1 | ## this one is commonly used with AM_PATH_PYTHONDIR ... | ||
2 | dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) | ||
3 | dnl Check if a module containing a given symbol is visible to python. | ||
4 | AC_DEFUN(AM_CHECK_PYMOD, | ||
5 | [AC_REQUIRE([AM_PATH_PYTHON]) | ||
6 | py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` | ||
7 | AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1) | ||
8 | AC_CACHE_VAL(py_cv_mod_$py_mod_var, [ | ||
9 | ifelse([$2],[], [prog=" | ||
10 | import sys | ||
11 | try: | ||
12 | import $1 | ||
13 | except ImportError: | ||
14 | sys.exit(1) | ||
15 | except: | ||
16 | sys.exit(0) | ||
17 | sys.exit(0)"], [prog=" | ||
18 | import $1 | ||
19 | $1.$2"]) | ||
20 | if $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 | ]) | ||
27 | py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` | ||
28 | if test "x$py_val" != xno; then | ||
29 | AC_MSG_RESULT(yes) | ||
30 | ifelse([$3], [],, [$3 | ||
31 | ])dnl | ||
32 | else | ||
33 | AC_MSG_RESULT(no) | ||
34 | ifelse([$4], [],, [$4 | ||
35 | ])dnl | ||
36 | fi | ||
37 | ]) | ||
38 | |||
39 | dnl a macro to check for ability to create python extensions | ||
40 | dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) | ||
41 | dnl function also defines PYTHON_INCLUDES | ||
42 | AC_DEFUN([AM_CHECK_PYTHON_HEADERS], | ||
43 | [AC_REQUIRE([AM_PATH_PYTHON]) | ||
44 | AC_MSG_CHECKING(for headers required to compile python extensions) | ||
45 | dnl deduce PYTHON_INCLUDES | ||
46 | AC_ARG_WITH(python-includes, | ||
47 | [ --with-python-includes=DIR path to Python includes], py_exec_prefix=$withval) | ||
48 | if test x$py_exec_prefix != x; then | ||
49 | PYTHON_INCLUDES="-I${py_exec_prefix}/include/python${PYTHON_VERSION}" | ||
50 | else | ||
51 | py_prefix=`$PYTHON -c "import sys; print sys.prefix"` | ||
52 | py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` | ||
53 | PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" | ||
54 | if test "$py_prefix" != "$py_exec_prefix"; then | ||
55 | PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" | ||
56 | fi | ||
57 | fi | ||
58 | AC_SUBST(PYTHON_INCLUDES) | ||
59 | dnl check if the headers exist: | ||
60 | save_CPPFLAGS="$CPPFLAGS" | ||
61 | CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" | ||
62 | AC_TRY_CPP([#include <Python.h>],dnl | ||
63 | [AC_MSG_RESULT(found) | ||
64 | $1],dnl | ||
65 | [AC_MSG_RESULT(not found) | ||
66 | $2]) | ||
67 | CPPFLAGS="$save_CPPFLAGS" | ||
68 | ]) | ||
69 | |||
70 | dnl | ||
71 | dnl JH_ADD_CFLAG(FLAG) | ||
72 | dnl checks whether the C compiler supports the given flag, and if so, adds | ||
73 | dnl it to $CFLAGS. If the flag is already present in the list, then the | ||
74 | dnl check is not performed. | ||
75 | AC_DEFUN([JH_ADD_CFLAG], | ||
76 | [ | ||
77 | case " $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 | ;; | ||
90 | esac]) | ||
diff --git a/meta/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch b/meta/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch new file mode 100644 index 0000000000..df0f9cd6c0 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Upstream-Status: Submitted | ||
2 | |||
3 | add gtk-types.defs into gdk.c dependence | ||
4 | |||
5 | gdk.c depends on gtk-types.defs but | ||
6 | gdk/Makefile.am miss this. This will cause | ||
7 | build error sometimes when built | ||
8 | with multi-jobbing, so add gtk-types.defs into | ||
9 | gdk.c dependence. | ||
10 | |||
11 | Signed-off-by: Song.Li <Song.Li@windriver.com> | ||
12 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
13 | --- | ||
14 | gtk/Makefile.am | 2 +- | ||
15 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
16 | |||
17 | diff --git a/gtk/Makefile.am b/gtk/Makefile.am | ||
18 | index 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 | -- | ||
31 | 1.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 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
4 | |||
5 | Index: 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/fix-pygtk-2.0.pc.patch b/meta/recipes-devtools/python/python-pygtk/fix-pygtk-2.0.pc.patch new file mode 100644 index 0000000000..b6156540bd --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/fix-pygtk-2.0.pc.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | Index: pygtk-2.24.0/pygtk-2.0.pc.in | ||
4 | =================================================================== | ||
5 | --- pygtk-2.24.0.orig/pygtk-2.0.pc.in | ||
6 | +++ pygtk-2.24.0/pygtk-2.0.pc.in | ||
7 | @@ -1,5 +1,6 @@ | ||
8 | prefix=@prefix@ | ||
9 | exec_prefix=@exec_prefix@ | ||
10 | +libdir=@libdir@ | ||
11 | includedir=@includedir@ | ||
12 | datarootdir=@datarootdir@ | ||
13 | datadir=@datadir@ | ||
diff --git a/meta/recipes-devtools/python/python-pygtk/nodocs.patch b/meta/recipes-devtools/python/python-pygtk/nodocs.patch new file mode 100644 index 0000000000..f07309a7ba --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/nodocs.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | Index: 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 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | Index: 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 ... | ||
2 | dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) | ||
3 | dnl Check if a module containing a given symbol is visible to python. | ||
4 | AC_DEFUN(AM_CHECK_PYMOD, | ||
5 | [AC_REQUIRE([AM_PATH_PYTHON]) | ||
6 | py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` | ||
7 | AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1) | ||
8 | AC_CACHE_VAL(py_cv_mod_$py_mod_var, [ | ||
9 | ifelse([$2],[], [prog=" | ||
10 | import sys | ||
11 | try: | ||
12 | import $1 | ||
13 | except ImportError: | ||
14 | sys.exit(1) | ||
15 | except: | ||
16 | sys.exit(0) | ||
17 | sys.exit(0)"], [prog=" | ||
18 | import $1 | ||
19 | $1.$2"]) | ||
20 | if $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 | ]) | ||
27 | py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` | ||
28 | if test "x$py_val" != xno; then | ||
29 | AC_MSG_RESULT(yes) | ||
30 | ifelse([$3], [],, [$3 | ||
31 | ])dnl | ||
32 | else | ||
33 | AC_MSG_RESULT(no) | ||
34 | ifelse([$4], [],, [$4 | ||
35 | ])dnl | ||
36 | fi | ||
37 | ]) | ||
38 | |||
39 | dnl a macro to check for ability to create python extensions | ||
40 | dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) | ||
41 | dnl function also defines PYTHON_INCLUDES | ||
42 | AC_DEFUN([AM_CHECK_PYTHON_HEADERS], | ||
43 | [AC_REQUIRE([AM_PATH_PYTHON]) | ||
44 | AC_MSG_CHECKING(for headers required to compile python extensions) | ||
45 | dnl deduce PYTHON_INCLUDES | ||
46 | AC_ARG_WITH(python-includes, | ||
47 | [ --with-python-includes=DIR path to Python includes], py_exec_prefix=$withval) | ||
48 | if test x$py_exec_prefix != x; then | ||
49 | PYTHON_INCLUDES="-I${py_exec_prefix}/include/python${PYTHON_VERSION}" | ||
50 | else | ||
51 | py_prefix=`$PYTHON -c "import sys; print sys.prefix"` | ||
52 | py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` | ||
53 | PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" | ||
54 | if test "$py_prefix" != "$py_exec_prefix"; then | ||
55 | PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" | ||
56 | fi | ||
57 | fi | ||
58 | AC_SUBST(PYTHON_INCLUDES) | ||
59 | dnl check if the headers exist: | ||
60 | save_CPPFLAGS="$CPPFLAGS" | ||
61 | CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" | ||
62 | AC_TRY_CPP([#include <Python.h>],dnl | ||
63 | [AC_MSG_RESULT(found) | ||
64 | $1],dnl | ||
65 | [AC_MSG_RESULT(not found) | ||
66 | $2]) | ||
67 | CPPFLAGS="$save_CPPFLAGS" | ||
68 | ]) | ||
69 | |||
70 | dnl | ||
71 | dnl JH_ADD_CFLAG(FLAG) | ||
72 | dnl checks whether the C compiler supports the given flag, and if so, adds | ||
73 | dnl it to $CFLAGS. If the flag is already present in the list, then the | ||
74 | dnl check is not performed. | ||
75 | AC_DEFUN([JH_ADD_CFLAG], | ||
76 | [ | ||
77 | case " $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 | ;; | ||
90 | esac]) | ||
diff --git a/meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch b/meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch new file mode 100644 index 0000000000..3ed954eee5 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From dc024e9079bbffbb44436ba3e70a758ebad5520f Mon Sep 17 00:00:00 2001 | ||
2 | From: "Song.Li" <Song.Li@windriver.com> | ||
3 | Date: Sat, 5 Jan 2013 14:55:59 +0800 | ||
4 | Subject: [PATCH] update dependences of defs.c in Makefile.am | ||
5 | |||
6 | In gtk/Makefile.am, defs.c should dependes on gdk-types.defs and | ||
7 | gtk-types.defs, otherwise it fails occasionally when parallel compile. | ||
8 | The error message: | ||
9 | "IOError: [Errno 2] No such file or directory: 'gtk-types.defs'" | ||
10 | |||
11 | Add them to dependences of defs.c to fix this issue. | ||
12 | |||
13 | Upstream-Status: Submitted | ||
14 | https://bugzilla.gnome.org/show_bug.cgi?id=702706 | ||
15 | |||
16 | Signed-off-by: Song.Li <Song.Li@windriver.com> | ||
17 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
18 | |||
19 | --- | ||
20 | gtk/Makefile.am | 2 +- | ||
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
22 | |||
23 | diff --git a/gtk/Makefile.am b/gtk/Makefile.am | ||
24 | index 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 | -- | ||
37 | 1.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..ff84be2bbc --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk_2.24.0.bb | |||
@@ -0,0 +1,74 @@ | |||
1 | SUMMARY = "Python bindings for the GTK+ UI toolkit" | ||
2 | SECTION = "devel/python" | ||
3 | # needs gtk+ 2.17.x | ||
4 | DEPENDS = "gtk+ libglade python-pycairo python-pygobject" | ||
5 | RDEPENDS_${PN} = "python-shell python-pycairo python-pygobject" | ||
6 | PROVIDES = "python-pygtk2" | ||
7 | SRCNAME = "pygtk" | ||
8 | LICENSE = "LGPLv2.1" | ||
9 | LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7" | ||
10 | |||
11 | PR = "r1" | ||
12 | |||
13 | SRC_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://fix-pygtk-2.0.pc.patch \ | ||
19 | file://acinclude.m4 \ | ||
20 | file://update-dependences-of-defs.c.patch" | ||
21 | |||
22 | SRC_URI[md5sum] = "a1051d5794fd7696d3c1af6422d17a49" | ||
23 | SRC_URI[sha256sum] = "cd1c1ea265bd63ff669e92a2d3c2a88eb26bcd9e5363e0f82c896e649f206912" | ||
24 | |||
25 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
26 | |||
27 | EXTRA_OECONF = "--disable-docs --with-python-includes=${STAGING_INCDIR}/../" | ||
28 | |||
29 | inherit autotools pkgconfig distutils-base | ||
30 | |||
31 | do_configure_prepend() { | ||
32 | install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/ | ||
33 | sed -i \ | ||
34 | -e s:'`$PKG_CONFIG --variable defsdir pygobject-2.0`':\"${STAGING_DATADIR}/pygobject/2.0/defs\":g \ | ||
35 | -e s:'`$PKG_CONFIG --variable=pygtkincludedir pygobject-2.0`':\"${STAGING_INCDIR}/pygtk-2.0\":g \ | ||
36 | -e s:'`$PKG_CONFIG --variable=datadir pygobject-2.0`':\"${STAGING_DATADIR}\":g \ | ||
37 | -e s:'`$PKG_CONFIG --variable codegendir pygobject-2.0`':\"${STAGING_DATADIR}/pygobject/2.0/codegen\":g \ | ||
38 | -e s:'`$PKG_CONFIG --variable=fixxref pygobject-2.0`':\"${STAGING_DATADIR}/pygobject/xsl/fixxref.py\":g \ | ||
39 | ${S}/configure.ac | ||
40 | sed -i 's:tests docs:tests:' ${S}/Makefile.am | ||
41 | } | ||
42 | |||
43 | # dirty fix #2: fix build system paths leaking in | ||
44 | do_install_append() { | ||
45 | for i in `find ${D} -name "*.py"` ; do \ | ||
46 | sed -i -e s:${D}::g $i | ||
47 | done | ||
48 | |||
49 | for i in `find ${D} -name "*.la"` ; do \ | ||
50 | sed -i -e s:${STAGING_LIBDIR}:${libdir}:g $i | ||
51 | done | ||
52 | |||
53 | if test -e ${D}${bindir} ; then | ||
54 | for i in ${D}${bindir}/* ; do \ | ||
55 | sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i | ||
56 | done | ||
57 | fi | ||
58 | |||
59 | if test -e ${D}${sbindir} ; then | ||
60 | for i in ${D}${sbindir}/* ; do \ | ||
61 | sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i | ||
62 | done | ||
63 | fi | ||
64 | |||
65 | sed -i -e '1s|^#!.*python|#!/usr/bin/env python|' ${D}${bindir}/pygtk-demo | ||
66 | } | ||
67 | |||
68 | PACKAGES =+ "${PN}-demo" | ||
69 | FILES_${PN}-demo = " ${bindir}/pygtk-demo ${libdir}/pygtk " | ||
70 | RDEPENDS_${PN}-demo = "python-pygtk python-stringold python-lang" | ||
71 | |||
72 | # todo: revamp packaging, package demo seperatly | ||
73 | FILES_${PN}-dev += " ${libdir}/pygtk/2.0 ${bindir}/pygtk-* ${datadir}/pygtk/2.0" | ||
74 | |||
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 @@ | |||
1 | require python-pyrex_${PV}.bb | ||
2 | inherit native pythonnative | ||
3 | DEPENDS = "python-native" | ||
4 | RDEPENDS_${PN} = "" | ||
5 | PR = "r3" | ||
diff --git a/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch b/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch new file mode 100644 index 0000000000..c58c3280e2 --- /dev/null +++ b/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | Index: Pyrex-0.9.8.4/Pyrex/Distutils/extension.py | ||
4 | =================================================================== | ||
5 | --- Pyrex-0.9.8.4.orig/Pyrex/Distutils/extension.py | ||
6 | +++ Pyrex-0.9.8.4/Pyrex/Distutils/extension.py | ||
7 | @@ -15,7 +15,7 @@ except ImportError: | ||
8 | warnings = None | ||
9 | |||
10 | class Extension(_Extension.Extension): | ||
11 | - _Extension.Extension.__doc__ + \ | ||
12 | + _Extension.Extension.__doc__ or "" + \ | ||
13 | """pyrex_include_dirs : [string] | ||
14 | list of directories to search for Pyrex header files (.pxd) (in | ||
15 | Unix form for portability) | ||
diff --git a/meta/recipes-devtools/python/python-pyrex_0.9.9.bb b/meta/recipes-devtools/python/python-pyrex_0.9.9.bb new file mode 100644 index 0000000000..c4dd2e69b0 --- /dev/null +++ b/meta/recipes-devtools/python/python-pyrex_0.9.9.bb | |||
@@ -0,0 +1,22 @@ | |||
1 | SUMMARY = "Language for writing Python extension modules" | ||
2 | DESCRIPTION = "Pyrex is a language specially designed for writing Python extension modules. \ | ||
3 | It's designed to bridge the gap between the nice, high-level, easy-to-use world of Python \ | ||
4 | and the messy, low-level world of C." | ||
5 | SECTION = "devel/python" | ||
6 | LICENSE = "Apache-2.0" | ||
7 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=771d472f53f933033f57eeee7808e5bd" | ||
8 | SRCNAME = "Pyrex" | ||
9 | PR = "r4" | ||
10 | |||
11 | SRC_URI = "\ | ||
12 | http://www.cosc.canterbury.ac.nz/greg.ewing/python/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \ | ||
13 | file://pyrex-fix-optimized-mode.patch \ | ||
14 | " | ||
15 | |||
16 | SRC_URI[md5sum] = "515dee67d15d4393841e2d60e8341947" | ||
17 | SRC_URI[sha256sum] = "5f87df06831d0b3412eb4bc9d3fc2ee7bfae1b913d7da8c23ab2bf5699fb6b50" | ||
18 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
19 | |||
20 | inherit distutils | ||
21 | |||
22 | FILES_${PN} += "${datadir}${base_libdir}/${PYTHON_DIR}/site-packages/Pyrex/Compiler/Lexicon.pickle" | ||
diff --git a/meta/recipes-devtools/python/python-scons-native_2.3.2.bb b/meta/recipes-devtools/python/python-scons-native_2.3.2.bb new file mode 100644 index 0000000000..dae89ab5d2 --- /dev/null +++ b/meta/recipes-devtools/python/python-scons-native_2.3.2.bb | |||
@@ -0,0 +1,8 @@ | |||
1 | require python-scons_${PV}.bb | ||
2 | inherit native pythonnative | ||
3 | DEPENDS = "python-native" | ||
4 | RDEPENDS_${PN} = "" | ||
5 | |||
6 | do_install_append() { | ||
7 | create_wrapper ${D}${bindir}/scons SCONS_LIB_DIR='${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}' | ||
8 | } | ||
diff --git a/meta/recipes-devtools/python/python-scons_2.3.2.bb b/meta/recipes-devtools/python/python-scons_2.3.2.bb new file mode 100644 index 0000000000..fc5b302aae --- /dev/null +++ b/meta/recipes-devtools/python/python-scons_2.3.2.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Software Construction tool (make/autotools replacement)" | ||
2 | SECTION = "devel/python" | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f0ad8a74a10870caa5e08a3e45d719e2" | ||
5 | SRCNAME = "scons" | ||
6 | |||
7 | SRC_URI = "${SOURCEFORGE_MIRROR}/scons/scons-${PV}.tar.gz" | ||
8 | |||
9 | SRC_URI[md5sum] = "bbd428da35ec176575a2b0be1f8d7162" | ||
10 | SRC_URI[sha256sum] = "f993320c5e9515e6567fcce73df0a7a8808414bf1223c69123d3dcf339a449d4" | ||
11 | |||
12 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
13 | |||
14 | inherit distutils | ||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch b/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch new file mode 100644 index 0000000000..e264de8a58 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | |||
2 | From a74a9a9eb9d75964a0e978950e8b191d7a18d763 Mon Sep 17 00:00:00 2001 | ||
3 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
4 | Date: Fri, 5 Jun 2015 17:07:16 +0100 | ||
5 | Subject: [PATCH] smart: change "is already installed" message from warning to | ||
6 | info | ||
7 | |||
8 | This doesn't need to be a warning. | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
13 | --- | ||
14 | smart/commands/install.py | 4 ++-- | ||
15 | smart/interfaces/text/interactive.py | 2 +- | ||
16 | 2 files changed, 3 insertions(+), 3 deletions(-) | ||
17 | |||
18 | diff --git a/smart/commands/install.py b/smart/commands/install.py | ||
19 | index 6ef9682..80d456b 100644 | ||
20 | --- a/smart/commands/install.py | ||
21 | +++ b/smart/commands/install.py | ||
22 | @@ -152,7 +152,7 @@ def main(ctrl, opts): | ||
23 | for obj in results: | ||
24 | for pkg in obj.packages: | ||
25 | if pkg.installed: | ||
26 | - iface.warning(_("%s (for %s) is already installed") | ||
27 | + iface.info(_("%s (for %s) is already installed") | ||
28 | % (pkg, arg)) | ||
29 | installed = True | ||
30 | break | ||
31 | @@ -184,7 +184,7 @@ def main(ctrl, opts): | ||
32 | for name in names: | ||
33 | pkg = names[name][0] | ||
34 | if pkg.installed: | ||
35 | - iface.warning(_("%s is already installed") % pkg) | ||
36 | + iface.info(_("%s is already installed") % pkg) | ||
37 | else: | ||
38 | trans.enqueue(pkg, INSTALL) | ||
39 | |||
40 | diff --git a/smart/interfaces/text/interactive.py b/smart/interfaces/text/interactive.py | ||
41 | index 9865584..190867b 100644 | ||
42 | --- a/smart/interfaces/text/interactive.py | ||
43 | +++ b/smart/interfaces/text/interactive.py | ||
44 | @@ -278,7 +278,7 @@ class Interpreter(Cmd): | ||
45 | for name in names: | ||
46 | pkg = names[name][0] | ||
47 | if pkg.installed: | ||
48 | - iface.warning(_("%s is already installed") % pkg) | ||
49 | + iface.info(_("%s is already installed") % pkg) | ||
50 | else: | ||
51 | found = True | ||
52 | transaction.enqueue(pkg, INSTALL) | ||
53 | -- | ||
54 | 2.1.0 | ||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch b/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch new file mode 100644 index 0000000000..82d2e6cf31 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch | |||
@@ -0,0 +1,223 @@ | |||
1 | From b105e7fe812da3ccaf7155c0fe14c8728b0d39a5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Hatle <mark.hatle@windriver.com> | ||
3 | Date: Mon, 20 Jan 2014 14:30:52 +0000 | ||
4 | Subject: [PATCH] Add mechanism to attempt install without failing | ||
5 | |||
6 | In OpenEmbedded, for complementary and 'attemptonly' package processing, | ||
7 | we need a way to instruct smart to try to install, but ignore any | ||
8 | failures (usually conflicts). | ||
9 | |||
10 | This option only works for the install operation. | ||
11 | |||
12 | If a complementary install fails, an actual error occurred, one that | ||
13 | we can't ignore without losing the entire attempted transaction. Keep | ||
14 | this as an error so that we can catch these cases in the futre. | ||
15 | |||
16 | Upstream-Status: Pending | ||
17 | |||
18 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
19 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
20 | --- | ||
21 | smart.py | 5 +++- | ||
22 | smart/commands/install.py | 5 ++++ | ||
23 | smart/transaction.py | 65 +++++++++++++++++++++++++++++++++++------------ | ||
24 | 3 files changed, 58 insertions(+), 17 deletions(-) | ||
25 | |||
26 | Index: smart-1.4.1/smart/commands/install.py | ||
27 | =================================================================== | ||
28 | --- smart-1.4.1.orig/smart/commands/install.py | ||
29 | +++ smart-1.4.1/smart/commands/install.py | ||
30 | @@ -50,6 +50,8 @@ def option_parser(): | ||
31 | parser = OptionParser(usage=USAGE, | ||
32 | description=DESCRIPTION, | ||
33 | examples=EXAMPLES) | ||
34 | + parser.add_option("--attempt", action="store_true", | ||
35 | + help=_("attempt to install packages, ignore failures")) | ||
36 | parser.add_option("--stepped", action="store_true", | ||
37 | help=_("split operation in steps")) | ||
38 | parser.add_option("--urls", action="store_true", | ||
39 | @@ -80,6 +82,9 @@ def main(ctrl, opts): | ||
40 | if not opts.args: | ||
41 | raise Error, _("no package(s) given") | ||
42 | |||
43 | + if opts.attempt: | ||
44 | + sysconf.set("attempt-install", True, soft=True) | ||
45 | + | ||
46 | if opts.explain: | ||
47 | sysconf.set("explain-changesets", True, soft=True) | ||
48 | |||
49 | Index: smart-1.4.1/smart/transaction.py | ||
50 | =================================================================== | ||
51 | --- smart-1.4.1.orig/smart/transaction.py | ||
52 | +++ smart-1.4.1/smart/transaction.py | ||
53 | @@ -555,6 +555,8 @@ class Transaction(object): | ||
54 | changeset.set(pkg, INSTALL) | ||
55 | isinst = changeset.installed | ||
56 | |||
57 | + attempt = sysconf.has("attempt-install", soft=True) | ||
58 | + | ||
59 | # Remove packages conflicted by this one. | ||
60 | for cnf in pkg.conflicts: | ||
61 | for prv in cnf.providedby: | ||
62 | @@ -564,11 +566,16 @@ class Transaction(object): | ||
63 | if not isinst(prvpkg): | ||
64 | locked[prvpkg] = (LOCKED_CONFLICT_BY, pkg) | ||
65 | continue | ||
66 | - if prvpkg in locked: | ||
67 | - raise Failed, _("Can't install %s: conflicted package " | ||
68 | - "%s is locked") % (pkg, prvpkg) | ||
69 | - self._remove(prvpkg, changeset, locked, pending, depth) | ||
70 | - pending.append((PENDING_UPDOWN, prvpkg)) | ||
71 | + if attempt: | ||
72 | + del changeset[pkg] | ||
73 | + raise Failed, _("Can't install %s: it conflicts with package " | ||
74 | + "%s") % (pkg, prvpkg) | ||
75 | + else: | ||
76 | + if prvpkg in locked: | ||
77 | + raise Failed, _("Can't install %s: conflicted package " | ||
78 | + "%s is locked") % (pkg, prvpkg) | ||
79 | + self._remove(prvpkg, changeset, locked, pending, depth) | ||
80 | + pending.append((PENDING_UPDOWN, prvpkg)) | ||
81 | |||
82 | # Remove packages conflicting with this one. | ||
83 | for prv in pkg.provides: | ||
84 | @@ -579,12 +586,18 @@ class Transaction(object): | ||
85 | if not isinst(cnfpkg): | ||
86 | locked[cnfpkg] = (LOCKED_CONFLICT, pkg) | ||
87 | continue | ||
88 | - if cnfpkg in locked: | ||
89 | + if attempt: | ||
90 | + del changeset[pkg] | ||
91 | raise Failed, _("Can't install %s: it's conflicted by " | ||
92 | - "the locked package %s") \ | ||
93 | - % (pkg, cnfpkg) | ||
94 | - self._remove(cnfpkg, changeset, locked, pending, depth) | ||
95 | - pending.append((PENDING_UPDOWN, cnfpkg)) | ||
96 | + "the package %s") \ | ||
97 | + % (pkg, cnfpkg) | ||
98 | + else: | ||
99 | + if cnfpkg in locked: | ||
100 | + raise Failed, _("Can't install %s: it's conflicted by " | ||
101 | + "the locked package %s") \ | ||
102 | + % (pkg, cnfpkg) | ||
103 | + self._remove(cnfpkg, changeset, locked, pending, depth) | ||
104 | + pending.append((PENDING_UPDOWN, cnfpkg)) | ||
105 | |||
106 | # Remove packages with the same name that can't | ||
107 | # coexist with this one. | ||
108 | @@ -594,10 +607,15 @@ class Transaction(object): | ||
109 | if not isinst(namepkg): | ||
110 | locked[namepkg] = (LOCKED_NO_COEXIST, pkg) | ||
111 | continue | ||
112 | - if namepkg in locked: | ||
113 | + if attempt: | ||
114 | + del changeset[pkg] | ||
115 | raise Failed, _("Can't install %s: it can't coexist " | ||
116 | "with %s") % (pkg, namepkg) | ||
117 | - self._remove(namepkg, changeset, locked, pending, depth) | ||
118 | + else: | ||
119 | + if namepkg in locked: | ||
120 | + raise Failed, _("Can't install %s: it can't coexist " | ||
121 | + "with %s") % (pkg, namepkg) | ||
122 | + self._remove(namepkg, changeset, locked, pending, depth) | ||
123 | |||
124 | # Install packages required by this one. | ||
125 | for req in pkg.requires + pkg.recommends: | ||
126 | @@ -1176,6 +1194,8 @@ class Transaction(object): | ||
127 | |||
128 | self._policy.runStarting() | ||
129 | |||
130 | + attempt = sysconf.has("attempt-install", soft=True) | ||
131 | + | ||
132 | try: | ||
133 | changeset = self._changeset.copy() | ||
134 | isinst = changeset.installed | ||
135 | @@ -1190,7 +1210,11 @@ class Transaction(object): | ||
136 | locked[pkg] = (LOCKED_KEEP, None) | ||
137 | elif op is INSTALL: | ||
138 | if not isinst(pkg) and pkg in locked: | ||
139 | - raise Failed, _("Can't install %s: it's locked") % pkg | ||
140 | + if attempt: | ||
141 | + iface.warning(_("Can't install %s: it's locked") % pkg) | ||
142 | + del changeset[pkg] | ||
143 | + else: | ||
144 | + raise Failed, _("Can't install %s: it's locked") % pkg | ||
145 | changeset.set(pkg, INSTALL) | ||
146 | locked[pkg] = (LOCKED_INSTALL, None) | ||
147 | elif op is REMOVE: | ||
148 | @@ -1216,9 +1240,18 @@ class Transaction(object): | ||
149 | else: | ||
150 | op = REMOVE | ||
151 | if op is INSTALL or op is REINSTALL: | ||
152 | - self._install(pkg, changeset, locked, pending) | ||
153 | - if pkg in changeset: | ||
154 | - changeset.setRequested(pkg, True) | ||
155 | + try: | ||
156 | + self._install(pkg, changeset, locked, pending) | ||
157 | + if pkg in changeset: | ||
158 | + changeset.setRequested(pkg, True) | ||
159 | + except Failed, e: | ||
160 | + if attempt: | ||
161 | + iface.warning(_("Can't install %s: %s") % (pkg, e)) | ||
162 | + if pkg in changeset: | ||
163 | + del changeset[pkg] | ||
164 | + continue | ||
165 | + else: | ||
166 | + raise Failed, e | ||
167 | elif op is REMOVE: | ||
168 | self._remove(pkg, changeset, locked, pending) | ||
169 | elif op is UPGRADE: | ||
170 | Index: smart-1.4.1/smart/backends/rpm/pm.py | ||
171 | =================================================================== | ||
172 | --- smart-1.4.1.orig/smart/backends/rpm/pm.py | ||
173 | +++ smart-1.4.1/smart/backends/rpm/pm.py | ||
174 | @@ -243,15 +253,48 @@ class RPMPackageManager(PackageManager): | ||
175 | cb = RPMCallback(prog, upgradednames) | ||
176 | cb.grabOutput(True) | ||
177 | probs = None | ||
178 | + retry = 0 | ||
179 | try: | ||
180 | probs = ts.run(cb, None) | ||
181 | finally: | ||
182 | del getTS.ts | ||
183 | cb.grabOutput(False) | ||
184 | + if probs and sysconf.has("attempt-install", soft=True): | ||
185 | + def remove_conflict(pkgNEVR): | ||
186 | + for key in changeset.keys(): | ||
187 | + if pkgNEVR == str(key): | ||
188 | + del changeset[key] | ||
189 | + del pkgpaths[key] | ||
190 | + iface.warning("Removing %s due to file %s conflicting with %s" % (pkgNEVR, fname, altNEVR)) | ||
191 | + break | ||
192 | + | ||
193 | + retry = 1 | ||
194 | + for prob in probs: | ||
195 | + if prob[1][0] == rpm.RPMPROB_NEW_FILE_CONFLICT: | ||
196 | + msg = prob[0].split() | ||
197 | + fname = msg[1] | ||
198 | + pkgNEVR = msg[7] | ||
199 | + altNEVR = msg[9] | ||
200 | + pkgNEVR = pkgNEVR.rsplit('.', 1)[0] + '@' + pkgNEVR.rsplit('.', 1)[1] | ||
201 | + altNEVR = altNEVR.rsplit('.', 1)[0] + '@' + altNEVR.rsplit('.', 1)[1] | ||
202 | + remove_conflict(pkgNEVR) | ||
203 | + elif prob[1][0] == rpm.RPMPROB_FILE_CONFLICT: | ||
204 | + msg = prob[0].split() | ||
205 | + fname = msg[1] | ||
206 | + pkgNEVR = msg[5] | ||
207 | + altNEVR = msg[11] | ||
208 | + pkgNEVR = pkgNEVR.rsplit('.', 1)[0] + '@' + pkgNEVR.rsplit('.', 1)[1] | ||
209 | + altNEVR = altNEVR.rsplit('.', 1)[0] + '@' + altNEVR.rsplit('.', 1)[1] | ||
210 | + remove_conflict(pkgNEVR) | ||
211 | + else: | ||
212 | + retry = 0 | ||
213 | + | ||
214 | prog.setDone() | ||
215 | - if probs: | ||
216 | + if probs and (not retry): | ||
217 | raise Error, "\n".join([x[0] for x in probs]) | ||
218 | prog.stop() | ||
219 | + if retry and len(changeset): | ||
220 | + self.commit(changeset, pkgpaths) | ||
221 | |||
222 | class RPMCallback: | ||
223 | def __init__(self, prog, upgradednames): | ||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch b/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch new file mode 100644 index 0000000000..e621b33875 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | Make CHANNELSDIR in smart empty, since this causes host contamination issues | ||
2 | on some RPM-based hosts on which smart is already installed. | ||
3 | |||
4 | [YOCTO #3881] | ||
5 | |||
6 | Upstream-Status: Inappropriate [embedded specific] | ||
7 | |||
8 | diff --git a/smart/plugins/channelsync.py b/smart/plugins/channelsync.py | ||
9 | index 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 @@ | |||
1 | Add a simple method to disable the install of recommended packages | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Usage: | ||
6 | smart config --set ignore-all-recommends=1 | ||
7 | |||
8 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
9 | |||
10 | Index: 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 @@ | |||
1 | Report a reason when a dependency could not be installed because it is locked | ||
2 | |||
3 | If a requirement of a package is conflicted, depending on how the | ||
4 | solution is reached, the transaction code may eliminate all providers | ||
5 | of the requirement and then error out because nothing provides them. To | ||
6 | work around this, store a reason in the locked dict and report that back | ||
7 | if 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 | |||
11 | we 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 | |||
16 | Upstream-Status: Pending | ||
17 | |||
18 | Signed-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 | |||
24 | diff --git a/smart/const.py b/smart/const.py | ||
25 | index 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 | ||
40 | diff --git a/smart/transaction.py b/smart/transaction.py | ||
41 | index 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 | -- | ||
195 | 1.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..531ea51cad --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-dflags.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | backends/rpm: add support for setting dependency flags | ||
2 | |||
3 | This is useful for OpenEmbedded so that we can do the equivalent of | ||
4 | the --nolinktos and --noparentdirs rpm command line options. | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
9 | |||
10 | [sgw - Added try/catch for rpm4 since it does not have setDFlags() API] | ||
11 | |||
12 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
13 | |||
14 | |||
15 | Index: smart-1.4.1/smart/backends/rpm/pm.py | ||
16 | =================================================================== | ||
17 | --- smart-1.4.1.orig/smart/backends/rpm/pm.py | ||
18 | +++ smart-1.4.1/smart/backends/rpm/pm.py | ||
19 | @@ -106,6 +106,26 @@ class RPMPackageManager(PackageManager): | ||
20 | flags |= rpm.RPMTRANS_FLAG_TEST | ||
21 | ts.setFlags(flags) | ||
22 | |||
23 | + try: | ||
24 | + dflags = ts.setDFlags(0) | ||
25 | + if sysconf.get("rpm-noupgrade", False): | ||
26 | + dflags |= rpm.RPMDEPS_FLAG_NOUPGRADE | ||
27 | + if sysconf.get("rpm-norequires", False): | ||
28 | + dflags |= rpm.RPMDEPS_FLAG_NOREQUIRES | ||
29 | + if sysconf.get("rpm-noconflicts", False): | ||
30 | + dflags |= rpm.RPMDEPS_FLAG_NOCONFLICTS | ||
31 | + if sysconf.get("rpm-noobsoletes", False): | ||
32 | + dflags |= rpm.RPMDEPS_FLAG_NOOBSOLETES | ||
33 | + if sysconf.get("rpm-noparentdirs", False): | ||
34 | + dflags |= rpm.RPMDEPS_FLAG_NOPARENTDIRS | ||
35 | + if sysconf.get("rpm-nolinktos", False): | ||
36 | + dflags |= rpm.RPMDEPS_FLAG_NOLINKTOS | ||
37 | + if sysconf.get("rpm-nosuggest", False): | ||
38 | + dflags |= rpm.RPMDEPS_FLAG_NOSUGGEST | ||
39 | + ts.setDFlags(dflags) | ||
40 | + except AttributeError, ae: | ||
41 | + pass | ||
42 | + | ||
43 | # Set rpm verbosity level. | ||
44 | levelname = sysconf.get('rpm-log-level') | ||
45 | level = { | ||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-filename-NAME_MAX.patch b/meta/recipes-devtools/python/python-smartpm/smart-filename-NAME_MAX.patch new file mode 100644 index 0000000000..22794a7388 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-filename-NAME_MAX.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From a17998b6be3319ae476a64f366737bc267a53a8a Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Mon, 16 Sep 2013 05:54:13 -0400 | ||
4 | Subject: [PATCH] fetcher.py: truncate the filename to meet NAME_MAX | ||
5 | |||
6 | The function getLocalPath() converts the filepath into the filename, | ||
7 | there would be a "File name too long" error when len(filename) > | ||
8 | NAME_MAX, truncate it to meet NAME_MAX will fix the problem. | ||
9 | |||
10 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
11 | --- | ||
12 | smart/fetcher.py | 8 ++++++++ | ||
13 | 1 file changed, 8 insertions(+) | ||
14 | |||
15 | diff --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 | -- | ||
34 | 1.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 @@ | |||
1 | Add exclude-packages flag support | ||
2 | |||
3 | Allow configuring specific packages to be excluded. This will allow | ||
4 | users to specify things NOT to install, and if they are attempted an | ||
5 | error will be generated. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
10 | |||
11 | Index: 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') | ||
23 | Index: 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: | ||
58 | Index: 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 @@ | |||
1 | Add ignore-recommends flag support | ||
2 | |||
3 | Allow configuring recommends on specific packages to be ignored. | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Signed-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 | |||
13 | diff --git a/smart/commands/flag.py b/smart/commands/flag.py | ||
14 | index 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. | ||
27 | diff --git a/smart/transaction.py b/smart/transaction.py | ||
28 | index 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 | -- | ||
59 | 1.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..2ca0f6d593 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch | |||
@@ -0,0 +1,253 @@ | |||
1 | Improve error reporting in smart | ||
2 | |||
3 | Add code to check proper command line arguments for various | ||
4 | smart commands. Exit with error if erroneous/additional arguments | ||
5 | are given in the command line. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com> | ||
10 | |||
11 | diff --git a/smart/commands/channel.py b/smart/commands/channel.py | ||
12 | index 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 = [] | ||
34 | diff --git a/smart/commands/check.py b/smart/commands/check.py | ||
35 | index 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([]) | ||
48 | diff --git a/smart/commands/config.py b/smart/commands/config.py | ||
49 | index 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) | ||
65 | diff --git a/smart/commands/download.py b/smart/commands/download.py | ||
66 | index 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"): | ||
84 | diff --git a/smart/commands/info.py b/smart/commands/info.py | ||
85 | index 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([]) | ||
99 | diff --git a/smart/commands/install.py b/smart/commands/install.py | ||
100 | index 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 | |||
114 | diff --git a/smart/commands/reinstall.py b/smart/commands/reinstall.py | ||
115 | index 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 | |||
131 | diff --git a/smart/commands/remove.py b/smart/commands/remove.py | ||
132 | index 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 | |||
146 | diff --git a/smart/commands/search.py b/smart/commands/search.py | ||
147 | index 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 | ||
159 | diff --git a/smart/commands/upgrade.py b/smart/commands/upgrade.py | ||
160 | index 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 | |||
173 | diff --git a/smart/util/optparse.py b/smart/util/optparse.py | ||
174 | index 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 @@ | |||
1 | smart - backends/rmp/metadata.py: Fix incorrect call to the match function | ||
2 | |||
3 | The match function should take three parameters, name, comparison, version... | ||
4 | The original code was passing it a reference to the object holding the data | ||
5 | instead, which caused the comparison in match to always fail. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-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 @@ | |||
1 | To fix some multilib issues, change the way the RPM backend decides | ||
2 | if two packages can coexist: if they have a different architecture, | ||
3 | automatically assume that they can coexist (which is fundamental for | ||
4 | multilib). | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com> | ||
9 | |||
10 | diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py | ||
11 | index 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 @@ | |||
1 | Handle recommended packages in core and rpm backends | ||
2 | |||
3 | Identify and store recommended packages in the cache, add a query option | ||
4 | to read them and ignore them if they are not present when installing. | ||
5 | |||
6 | Initial identification code from Mark Hatle <mark.hatle@windriver.com>. | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
11 | |||
12 | diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py | ||
13 | index 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): | ||
46 | diff --git a/smart/backends/rpm/header.py b/smart/backends/rpm/header.py | ||
47 | index 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(): | ||
97 | diff --git a/smart/backends/rpm/metadata.py b/smart/backends/rpm/metadata.py | ||
98 | index 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() | ||
161 | diff --git a/smart/cache.py b/smart/cache.py | ||
162 | index 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 = {} | ||
387 | diff --git a/smart/ccache.c b/smart/ccache.c | ||
388 | index 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}, | ||
1107 | diff --git a/smart/commands/query.py b/smart/commands/query.py | ||
1108 | index 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 | ||
1204 | diff --git a/smart/control.py b/smart/control.py | ||
1205 | index 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: | ||
1226 | diff --git a/smart/searcher.py b/smart/searcher.py | ||
1227 | index 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 | |||
1286 | diff --git a/smart/transaction.py b/smart/transaction.py | ||
1287 | index 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 | -- | ||
1361 | 1.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 @@ | |||
1 | backends/rpm: implement rpm-extra-macros option | ||
2 | |||
3 | Allow defining extra macros in the smart configuration to be passed | ||
4 | to rpm before opening the database. | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
9 | |||
10 | diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py | ||
11 | index 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 | -- | ||
26 | 1.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 @@ | |||
1 | backends/rpm: fix parsing of rpm-md metadata | ||
2 | |||
3 | If assertions are disabled then the queue.pop() wasn't being executed, | ||
4 | leading to requires, recommends etc. not being read properly. | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
9 | |||
10 | diff --git a/smart/backends/rpm/metadata.py b/smart/backends/rpm/metadata.py | ||
11 | index 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 | -- | ||
25 | 1.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 @@ | |||
1 | Fix smart RPM backend to handle rpm-dbpath/rpm-root properly | ||
2 | |||
3 | Don't assume that if the dbpath starts with / that it is an absolute | ||
4 | path. This matches the behaviour of rpm itself. (If the root path is | ||
5 | specified and does not start with /, rpm will prepend the root path | ||
6 | twice and fail). | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
11 | |||
12 | diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py | ||
13 | index 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) | ||
38 | diff --git a/smart/channels/rpm_sys.py b/smart/channels/rpm_sys.py | ||
39 | index 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 | ||
64 | diff --git a/smart/plugins/detectsys.py b/smart/plugins/detectsys.py | ||
65 | index 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-rpm4-fixes.patch b/meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch new file mode 100644 index 0000000000..708ffe67d3 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | |||
2 | This patch checks for rpm5 related functions in order to allow rpm4 | ||
3 | to work correctly. Currently the rpm4 archscore and filter work | ||
4 | differently enough that they need to be changed. | ||
5 | |||
6 | Upstream-Status: Inappropriate [OE-Core Specific] | ||
7 | |||
8 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
9 | |||
10 | Index: smart-1.4.1/smart/backends/rpm/base.py | ||
11 | =================================================================== | ||
12 | --- smart-1.4.1.orig/smart/backends/rpm/base.py | ||
13 | +++ smart-1.4.1/smart/backends/rpm/base.py | ||
14 | @@ -338,10 +338,14 @@ class RPMObsoletes(Depends): | ||
15 | |||
16 | _SCOREMAP = {} | ||
17 | def getArchScore(arch, _sm=_SCOREMAP): | ||
18 | - if arch not in _sm: | ||
19 | - score = rpm.archscore(arch) | ||
20 | - _sm[arch] = score | ||
21 | - return _sm.get(arch, 0) | ||
22 | + try: | ||
23 | + rpm.platformscore(arch) | ||
24 | + if arch not in _sm: | ||
25 | + score = rpm.archscore(arch) | ||
26 | + _sm[arch] = score | ||
27 | + return _sm.get(arch, 0) | ||
28 | + except AttributeError: | ||
29 | + return 1 | ||
30 | |||
31 | # TODO: Embed color into nameprovides and obsoletes relations. | ||
32 | _COLORMAP = {"noarch": 0, "x86_64": 2, "ppc64": 2, "s390x": 2, "sparc64": 2} | ||
33 | Index: smart-1.4.1/smart/backends/rpm/pm.py | ||
34 | =================================================================== | ||
35 | --- smart-1.4.1.orig/smart/backends/rpm/pm.py | ||
36 | +++ smart-1.4.1/smart/backends/rpm/pm.py | ||
37 | @@ -235,6 +235,12 @@ class RPMPackageManager(PackageManager): | ||
38 | if sysconf.get("rpm-order"): | ||
39 | ts.order() | ||
40 | probfilter = rpm.RPMPROB_FILTER_OLDPACKAGE | ||
41 | + try: | ||
42 | + # Test for RPM5 function | ||
43 | + rpm.platformscore("") | ||
44 | + except AttributeError: | ||
45 | + probfilter |= rpm.RPMPROB_FILTER_IGNOREARCH | ||
46 | + | ||
47 | if force or reinstall: | ||
48 | probfilter |= rpm.RPMPROB_FILTER_REPLACEPKG | ||
49 | probfilter |= rpm.RPMPROB_FILTER_REPLACEOLDFILES | ||
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-tmpdir.patch b/meta/recipes-devtools/python/python-smartpm/smart-tmpdir.patch new file mode 100644 index 0000000000..2f09ce9248 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-tmpdir.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | backends/rpm: remove creation of /var/tmp | ||
2 | |||
3 | This doesn't appear to be needed, and breaks installation of base-files | ||
4 | in OpenEmbedded (since that is a symlink installed as part of the | ||
5 | package). | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
10 | |||
11 | diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py | ||
12 | index 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 | -- | ||
29 | 1.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 @@ | |||
1 | Print a more friendly error if YAML output is requested without PyYAML | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
6 | |||
7 | diff --git a/smart/commands/channel.py b/smart/commands/channel.py | ||
8 | index 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 | |||
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)) | ||
23 | diff --git a/smart/commands/config.py b/smart/commands/config.py | ||
24 | index 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: | ||
39 | diff --git a/smart/commands/flag.py b/smart/commands/flag.py | ||
40 | index 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 | |||
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() | ||
55 | diff --git a/smart/commands/mirror.py b/smart/commands/mirror.py | ||
56 | index 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 | |||
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: | ||
71 | diff --git a/smart/commands/priority.py b/smart/commands/priority.py | ||
72 | index 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 | |||
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 @@ | |||
1 | RPM5 has removed support for RPMVSF_NOSIGNATURES | ||
2 | |||
3 | Patch smart to no longer use this flag | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
8 | |||
9 | diff -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 | ||
34 | diff -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..ee594ba166 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb | |||
@@ -0,0 +1,148 @@ | |||
1 | SUMMARY = "The Smart Package Manager" | ||
2 | DESCRIPTION = "The Smart Package Manager project has the ambitious objective of creating \ | ||
3 | smart and portable algorithms for solving adequately the problem of managing software \ | ||
4 | upgrades and installation." | ||
5 | |||
6 | HOMEPAGE = "http://labix.org/smart/" | ||
7 | SECTION = "devel/python" | ||
8 | LICENSE = "GPLv2" | ||
9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833" | ||
10 | |||
11 | DEPENDS = "python rpm gettext-native python-rpm" | ||
12 | PR = "r9" | ||
13 | SRCNAME = "smart" | ||
14 | |||
15 | SRC_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 | file://smart-rpm4-fixes.patch \ | ||
36 | file://smart-already-installed-message.patch \ | ||
37 | " | ||
38 | |||
39 | SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6" | ||
40 | SRC_URI[sha256sum] = "b1d519ddb43d60f293b065c28870a5d9e8b591cd49e8c68caea48ace91085eba" | ||
41 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
42 | |||
43 | # Options - rpm, qt4, gtk | ||
44 | PACKAGECONFIG ??= "rpm" | ||
45 | |||
46 | RPM_RDEP = "${PN}-backend-rpm" | ||
47 | QT_RDEP = "${PN}-interface-qt4" | ||
48 | GTK_RDEP = "${PN}-interface-gtk" | ||
49 | |||
50 | RPM_RDEP_class-native = "" | ||
51 | QT_RDEP_class-native = "" | ||
52 | GTK_RDEP_class-native = "" | ||
53 | |||
54 | RPM_RDEP_class-nativesdk = "" | ||
55 | QT_RDEP_class-nativesdk = "" | ||
56 | GTK_RDEP_class-nativesdk = "" | ||
57 | |||
58 | PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}" | ||
59 | PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}" | ||
60 | PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}" | ||
61 | |||
62 | inherit distutils | ||
63 | |||
64 | do_install_append() { | ||
65 | # We don't support the following items | ||
66 | rm -rf ${D}${libdir}/python*/site-packages/smart/backends/slack | ||
67 | rm -rf ${D}${libdir}/python*/site-packages/smart/backends/arch | ||
68 | rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt | ||
69 | |||
70 | # Temporary, debian support in OE is missing the python module | ||
71 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/aptchannelsync.py* | ||
72 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/debdir.py* | ||
73 | rm -rf ${D}${libdir}/python*/site-packages/smart/backends/deb | ||
74 | |||
75 | # Disable automatic channel detection | ||
76 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/detectsys.py* | ||
77 | |||
78 | # Disable landscape support | ||
79 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/landscape.py* | ||
80 | |||
81 | # Disable urpmi channel support | ||
82 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/urpmichannelsync.py* | ||
83 | |||
84 | # Disable yum channel support | ||
85 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/yumchannelsync.py* | ||
86 | |||
87 | # Disable zypper channel support | ||
88 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/zyppchannelsync.py* | ||
89 | |||
90 | if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then | ||
91 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/rpmdir.py* | ||
92 | rm -rf ${D}${libdir}/python*/site-packages/smart/backends/rpm | ||
93 | fi | ||
94 | |||
95 | if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then | ||
96 | rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt4 | ||
97 | fi | ||
98 | |||
99 | if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then | ||
100 | rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/gtk | ||
101 | fi | ||
102 | } | ||
103 | |||
104 | add_native_wrapper() { | ||
105 | create_wrapper ${D}/${bindir}/smart \ | ||
106 | RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \ | ||
107 | RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \ | ||
108 | RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale | ||
109 | } | ||
110 | |||
111 | do_install_append_class-native() { | ||
112 | add_native_wrapper | ||
113 | } | ||
114 | |||
115 | do_install_append_class-nativesdk() { | ||
116 | add_native_wrapper | ||
117 | } | ||
118 | |||
119 | PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \ | ||
120 | ${@bb.utils.contains('PACKAGECONFIG', 'rpm', '${PN}-backend-rpm', '', d)} \ | ||
121 | ${@bb.utils.contains('PACKAGECONFIG', 'qt4', '${PN}-interface-qt4', '', d)} \ | ||
122 | ${@bb.utils.contains('PACKAGECONFIG', 'gtk', '${PN}-interface-gtk', '', d)} \ | ||
123 | ${PN}-interface-images ${PN}" | ||
124 | |||
125 | RDEPENDS_smartpm = "${PN}" | ||
126 | |||
127 | RDEPENDS_${PN} += "${PN}-backend-rpm python-codecs python-textutils python-xml python-fcntl \ | ||
128 | python-pickle python-crypt python-compression python-shell \ | ||
129 | python-resource python-netclient python-threading python-unixadmin python-pprint" | ||
130 | RDEPENDS_${PN}_class-native = "" | ||
131 | |||
132 | RDEPENDS_${PN}-backend-rpm = "python-rpm" | ||
133 | |||
134 | RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images" | ||
135 | RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images" | ||
136 | |||
137 | FILES_smartpm = "${bindir}/smart" | ||
138 | |||
139 | FILES_${PN}-dbg += "${libdir}/python*/site-packages/smart/backends/rpm/.debug" | ||
140 | |||
141 | FILES_${PN}-backend-rpm = "${libdir}/python*/site-packages/smart/backends/rpm" | ||
142 | |||
143 | FILES_${PN}-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4" | ||
144 | FILES_${PN}-interface-gtk = "${libdir}/python*/site-packages/smart/interfaces/gtk" | ||
145 | FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images" | ||
146 | |||
147 | BBCLASSEXTEND = "native nativesdk" | ||
148 | |||
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 @@ | |||
1 | SUMMARY = "Python implementation of a sliding window memory map manager" | ||
2 | DESCRIPTION = "A pure Python implementation of a sliding memory map to \ | ||
3 | help unifying memory mapped access on 32 and 64 bit systems and to help \ | ||
4 | managing resources more efficiently." | ||
5 | HOMEPAGE = "http://github.com/gitpython-developers/GitPython" | ||
6 | SECTION = "devel/python" | ||
7 | LICENSE = "BSD" | ||
8 | LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709" | ||
9 | |||
10 | SRC_URI = "http://pypi.python.org/packages/source/s/smmap/smmap-${PV}.tar.gz" | ||
11 | SRC_URI[md5sum] = "f5426b7626ddcf5e447253fae0396b0c" | ||
12 | SRC_URI[sha256sum] = "dea2955cc045ec5527da6b762f7e95a5be7f645c683b54ccce52d56b4d7e2d6f" | ||
13 | |||
14 | S = "${WORKDIR}/smmap-${PV}" | ||
15 | |||
16 | inherit setuptools | ||
17 | |||
18 | RDEPENDS_${PN} += "python-codecs python-mmap python-lang" | ||
19 | |||
20 | BBCLASSEXTEND = "nativesdk" | ||
diff --git a/meta/recipes-devtools/python/python.inc b/meta/recipes-devtools/python/python.inc new file mode 100644 index 0000000000..19942baeb0 --- /dev/null +++ b/meta/recipes-devtools/python/python.inc | |||
@@ -0,0 +1,31 @@ | |||
1 | SUMMARY = "The Python Programming Language" | ||
2 | HOMEPAGE = "http://www.python.org" | ||
3 | LICENSE = "PSFv2" | ||
4 | SECTION = "devel/python" | ||
5 | # bump this on every change in contrib/python/generate-manifest-2.7.py | ||
6 | INC_PR = "r0" | ||
7 | |||
8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=ed3abfd1059e2d3a36a8cff3986f9bb6" | ||
9 | |||
10 | SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2" | ||
11 | |||
12 | SRC_URI[md5sum] = "c57477edd6d18bd9eeca2f21add73919" | ||
13 | SRC_URI[sha256sum] = "726457e11cb153adc3f428aaf1901fc561a374c30e5e7da6742c0742a338663c" | ||
14 | |||
15 | PYTHON_MAJMIN = "2.7" | ||
16 | |||
17 | inherit autotools-brokensep | ||
18 | |||
19 | PYTHONLSBOPTS = "--with-wctype-functions" | ||
20 | PYTHONLSBOPTS_linuxstdbase = "ac_cv_sizeof_off_t=8" | ||
21 | |||
22 | EXTRA_OECONF = "\ | ||
23 | --with-threads \ | ||
24 | --with-pymalloc \ | ||
25 | --without-cxx-main \ | ||
26 | --with-signal-module \ | ||
27 | --enable-shared \ | ||
28 | --enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)} \ | ||
29 | ac_cv_header_bluetooth_bluetooth_h=no ac_cv_header_bluetooth_h=no \ | ||
30 | ${PYTHONLSBOPTS} \ | ||
31 | " | ||
diff --git a/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch b/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch new file mode 100644 index 0000000000..691beada03 --- /dev/null +++ b/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch | |||
@@ -0,0 +1,138 @@ | |||
1 | Upstream-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 | |||
7 | Index: 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) \ | ||
95 | Index: 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 @@ | |||
1 | Upstream-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 | |||
7 | Index: 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 @@ | |||
1 | Upstream-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 | |||
6 | Index: 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 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | The poison directories patch has detected library path issue while | ||
4 | compiling the python in cross environment, as seen bellow. | ||
5 | |||
6 | warning: library search path "/usr/lib/termcap" is unsafe for cross-compilation | ||
7 | |||
8 | This Patch fixes this issue in the python build environment. | ||
9 | 11 Oct 2010 | ||
10 | Nitin A Kamble <nitin.a.kamble@intel.com> | ||
11 | |||
12 | 2011/09/29 | ||
13 | Rebased for python 2.7.2 | ||
14 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
15 | |||
16 | Index: 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 @@ | |||
1 | This 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 | |||
8 | The problem is still present in python-2.6.5 but fixed in python-svn. | ||
9 | |||
10 | Upstream-Status: Accepted [python-svn] | ||
11 | |||
12 | Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> | ||
13 | Acked-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
14 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
15 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
16 | |||
17 | |||
18 | 2011/09/29 | ||
19 | Rebased for python 2.7.2 | ||
20 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
21 | |||
22 | |||
23 | Index: 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 @@ | |||
1 | Upstream-Status: Backport | ||
2 | |||
3 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
4 | |||
5 | diff -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----- | ||
99 | diff -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] | ||
162 | diff -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 | |||
2 | Upstream-Status: Inappropriate [configuration] | ||
3 | |||
4 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
5 | |||
6 | Index: 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..bedc3909d8 --- /dev/null +++ b/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | _tkinter module needs tk module along with tcl. tk is not yet integrated | ||
2 | in yocto so we skip the check for this module. | ||
3 | Avoid a warning by not adding this module to missing variable. | ||
4 | |||
5 | Also simply disable the tk module since its not in DEPENDS. | ||
6 | |||
7 | Upstream-Status: Inappropriate [distribution] | ||
8 | |||
9 | Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> | ||
10 | |||
11 | Index: Python-2.7.3/setup.py | ||
12 | =================================================================== | ||
13 | --- Python-2.7.3.orig/setup.py 2014-07-07 13:45:15.056233820 +0000 | ||
14 | +++ Python-2.7.3/setup.py 2014-07-16 16:06:37.145656284 +0000 | ||
15 | @@ -1639,10 +1639,12 @@ | ||
16 | self.extensions.extend(exts) | ||
17 | |||
18 | # Call the method for detecting whether _tkinter can be compiled | ||
19 | - self.detect_tkinter(inc_dirs, lib_dirs) | ||
20 | + #self.detect_tkinter(inc_dirs, lib_dirs) | ||
21 | |||
22 | - if '_tkinter' not in [e.name for e in self.extensions]: | ||
23 | - missing.append('_tkinter') | ||
24 | + # tkinter module will not be avalaible as yocto | ||
25 | + # doesn't have tk integrated (yet) | ||
26 | + #if '_tkinter' not in [e.name for e in self.extensions]: | ||
27 | + # missing.append('_tkinter') | ||
28 | |||
29 | return missing | ||
30 | |||
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 @@ | |||
1 | sunaudiodev module is sunos specific so we avoid a warning by not | ||
2 | adding this module to missing variable. | ||
3 | |||
4 | Upstream-Status: Inappropriate [distribution] | ||
5 | |||
6 | Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> | ||
7 | |||
8 | Index: 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 @@ | |||
1 | When cross compiling python, we used to need to install the Makefile, pyconfig.h | ||
2 | and the python library to their final location before being able to compile the | ||
3 | rest of python. This change allows us to point python at its own source when | ||
4 | building, avoiding a variety of sysroot staging issues and simplifying the main | ||
5 | python recipe. | ||
6 | |||
7 | Upstream-Status: Inappropriate | ||
8 | RP 2012/11/13 | ||
9 | |||
10 | Index: 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 | ||
33 | Index: 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 @@ | |||
1 | Lib/cgi.py: Update the script as mentioned in the comment | ||
2 | |||
3 | Upstream-Status: Inappropriate [distribution] | ||
4 | |||
5 | Signed-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 @@ | |||
1 | Author: Andrei Gherzan <andrei@gherzan.ro> | ||
2 | Date: Sun Mar 25 02:02:27 2012 +0200 | ||
3 | |||
4 | This patch was added for 64bit host machines. In the compile process python | ||
5 | is checking if platform is a 64bit platform using sys.maxint which is the host's | ||
6 | value. The patch fixes this issue so that python would check if TARGET machine | ||
7 | is 64bit not the HOST machine. In this way will have "dl" and "imageop" modules | ||
8 | built if HOST machine is 64bit but the target machine is 32bit. | ||
9 | |||
10 | Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | |||
14 | Index: 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/ctypes-libffi-aarch64.patch b/meta/recipes-devtools/python/python/ctypes-libffi-aarch64.patch new file mode 100644 index 0000000000..7349c7bfe3 --- /dev/null +++ b/meta/recipes-devtools/python/python/ctypes-libffi-aarch64.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | Add missing fficonfig.py bits for aarch64 | ||
2 | |||
3 | # HG changeset patch | ||
4 | # User Andreas Schwab <schwab@suse.de> | ||
5 | # Date 1367276434 -7200 | ||
6 | # Node ID 05e8999a3901b4853e60d6701510e9b3dd54a7f3 | ||
7 | # Parent 84cef4f1999ad9e362694cdac2f65f0981e3d5d0 | ||
8 | |||
9 | Upstream-Status: Backport | ||
10 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
11 | |||
12 | diff -r 84cef4f1999a -r 05e8999a3901 Modules/_ctypes/libffi/fficonfig.py.in | ||
13 | --- a/Modules/_ctypes/libffi/fficonfig.py.in Mon Apr 29 16:09:39 2013 -0400 | ||
14 | +++ b/Modules/_ctypes/libffi/fficonfig.py.in Tue Apr 30 01:00:34 2013 +0200 | ||
15 | @@ -28,6 +28,7 @@ | ||
16 | 'PA': ['src/pa/linux.S', 'src/pa/ffi.c'], | ||
17 | 'PA_LINUX': ['src/pa/linux.S', 'src/pa/ffi.c'], | ||
18 | 'PA_HPUX': ['src/pa/hpux32.S', 'src/pa/ffi.c'], | ||
19 | + 'AARCH64' : ['src/aarch64/ffi.c', 'src/aarch64/sysv.S'], | ||
20 | } | ||
21 | |||
22 | ffi_sources += ffi_platforms['@TARGET@'] | ||
diff --git a/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch b/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch new file mode 100644 index 0000000000..669112dab0 --- /dev/null +++ b/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | Add 'build-test' and 'runtest-TESTS' targets to Makefile, to build and run tests | ||
2 | cross-compiled. | ||
3 | |||
4 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
5 | Upstream-Status: Pending | ||
6 | --- | ||
7 | diff -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 @@ | |||
1 | Upstream-Status: Inappropriate [Embedded specific] | ||
2 | |||
3 | This patch fixes issuing with different libdir like lib64. | ||
4 | This patch makes the native python binary modules findable | ||
5 | in the install process of the host python. | ||
6 | |||
7 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
8 | Date: 2012/03/14 | ||
9 | |||
10 | Updated for python 2.7.3 | ||
11 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
12 | Date: 2012/05/01 | ||
13 | |||
14 | Index: 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}', | ||
48 | Index: 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 @@ | |||
1 | backport bug 17547 from http://hg.python.org/cpython/rev/9d50af4c482f/ | ||
2 | |||
3 | -Wformat is needed by gcc 4.8 | ||
4 | |||
5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
6 | |||
7 | Upstream-Status: Backport | ||
8 | Index: 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 @@ | |||
1 | when building python for qemux86-64 on ubuntu 11.10/64bit | ||
2 | it gropes into host includes and then mixes them with cross | ||
3 | includes and as a result some modules fail to compile and link | ||
4 | one of the modules is python-elementtree which is then not | ||
5 | found during image creation | ||
6 | |||
7 | Proble is that setup.py tries to add native includes that newer | ||
8 | ubuntu has introduced for multiarch support. But that should | ||
9 | only happen for native builds and not cross building python | ||
10 | so we add a check here. | ||
11 | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | Upstream-Status: Pending | ||
14 | |||
15 | Index: 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/json-flaw-fix.patch b/meta/recipes-devtools/python/python/json-flaw-fix.patch new file mode 100644 index 0000000000..e9a6cca017 --- /dev/null +++ b/meta/recipes-devtools/python/python/json-flaw-fix.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | |||
2 | python: fix _json module arbitrary process memory read vulnerability | ||
3 | |||
4 | Upstream-Status: submitted | ||
5 | |||
6 | Signed-off-by: Daniel BORNAZ <daniel.bornaz@enea.com> | ||
7 | |||
8 | --- a/Modules/_json.c 2014-07-15 15:37:17.151046356 +0200 | ||
9 | +++ b/Modules/_json.c 2014-07-15 15:38:37.335605042 +0200 | ||
10 | @@ -1491,7 +1491,7 @@ scan_once_str(PyScannerObject *s, PyObje | ||
11 | PyObject *res; | ||
12 | char *str = PyString_AS_STRING(pystr); | ||
13 | Py_ssize_t length = PyString_GET_SIZE(pystr); | ||
14 | - if (idx >= length) { | ||
15 | + if ( idx < 0 || idx >= length) { | ||
16 | PyErr_SetNone(PyExc_StopIteration); | ||
17 | return NULL; | ||
18 | } | ||
19 | @@ -1578,7 +1578,7 @@ scan_once_unicode(PyScannerObject *s, Py | ||
20 | PyObject *res; | ||
21 | Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); | ||
22 | Py_ssize_t length = PyUnicode_GET_SIZE(pystr); | ||
23 | - if (idx >= length) { | ||
24 | + if ( idx < 0 || idx >= length) { | ||
25 | PyErr_SetNone(PyExc_StopIteration); | ||
26 | return NULL; | ||
27 | } | ||
diff --git a/meta/recipes-devtools/python/python/libffi-aarch64.patch b/meta/recipes-devtools/python/python/libffi-aarch64.patch new file mode 100644 index 0000000000..5581922354 --- /dev/null +++ b/meta/recipes-devtools/python/python/libffi-aarch64.patch | |||
@@ -0,0 +1,1608 @@ | |||
1 | Add support for aarch64 for ctypes module | ||
2 | |||
3 | Python have its own version of libffi used for ctypes module. | ||
4 | libffi 3.0.10 contained in original source of Python-2.7.3 does not have | ||
5 | support for aarch64 architecture. | ||
6 | This is patch is backport support for aarch64 from libffi 3.1 | ||
7 | |||
8 | Upstream-Status: Backport | ||
9 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
10 | |||
11 | diff -ruN Python-2.7.3.orig/Modules/_ctypes/libffi/configure.ac Python-2.7.3/Modules/_ctypes/libffi/configure.ac | ||
12 | --- Python-2.7.3.orig/Modules/_ctypes/libffi/configure.ac 2015-02-27 23:15:16.118393178 +0100 | ||
13 | +++ Python-2.7.3/Modules/_ctypes/libffi/configure.ac 2015-02-27 23:51:03.351556903 +0100 | ||
14 | @@ -44,6 +44,10 @@ | ||
15 | |||
16 | TARGETDIR="unknown" | ||
17 | case "$host" in | ||
18 | + aarch64*-*-*) | ||
19 | + TARGET=AARCH64; TARGETDIR=aarch64 | ||
20 | + ;; | ||
21 | + | ||
22 | alpha*-*-*) | ||
23 | TARGET=ALPHA; TARGETDIR=alpha; | ||
24 | # Support 128-bit long double, changeable via command-line switch. | ||
25 | @@ -195,6 +199,7 @@ | ||
26 | AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX) | ||
27 | AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN) | ||
28 | AM_CONDITIONAL(POWERPC_FREEBSD, test x$TARGET = xPOWERPC_FREEBSD) | ||
29 | +AM_CONDITIONAL(AARCH64, test x$TARGET = xAARCH64) | ||
30 | AM_CONDITIONAL(ARM, test x$TARGET = xARM) | ||
31 | AM_CONDITIONAL(AVR32, test x$TARGET = xAVR32) | ||
32 | AM_CONDITIONAL(LIBFFI_CRIS, test x$TARGET = xLIBFFI_CRIS) | ||
33 | diff -ruN Python-2.7.3.orig/Modules/_ctypes/libffi/src/aarch64/ffi.c Python-2.7.3/Modules/_ctypes/libffi/src/aarch64/ffi.c | ||
34 | --- Python-2.7.3.orig/Modules/_ctypes/libffi/src/aarch64/ffi.c 1970-01-01 01:00:00.000000000 +0100 | ||
35 | +++ Python-2.7.3/Modules/_ctypes/libffi/src/aarch64/ffi.c 2014-04-25 19:45:13.000000000 +0200 | ||
36 | @@ -0,0 +1,1168 @@ | ||
37 | +/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. | ||
38 | + | ||
39 | +Permission is hereby granted, free of charge, to any person obtaining | ||
40 | +a copy of this software and associated documentation files (the | ||
41 | +``Software''), to deal in the Software without restriction, including | ||
42 | +without limitation the rights to use, copy, modify, merge, publish, | ||
43 | +distribute, sublicense, and/or sell copies of the Software, and to | ||
44 | +permit persons to whom the Software is furnished to do so, subject to | ||
45 | +the following conditions: | ||
46 | + | ||
47 | +The above copyright notice and this permission notice shall be | ||
48 | +included in all copies or substantial portions of the Software. | ||
49 | + | ||
50 | +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, | ||
51 | +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
52 | +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
53 | +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
54 | +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
55 | +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
56 | +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ | ||
57 | + | ||
58 | +#include <stdio.h> | ||
59 | + | ||
60 | +#include <ffi.h> | ||
61 | +#include <ffi_common.h> | ||
62 | + | ||
63 | +#include <stdlib.h> | ||
64 | + | ||
65 | +/* Stack alignment requirement in bytes */ | ||
66 | +#if defined (__APPLE__) | ||
67 | +#define AARCH64_STACK_ALIGN 1 | ||
68 | +#else | ||
69 | +#define AARCH64_STACK_ALIGN 16 | ||
70 | +#endif | ||
71 | + | ||
72 | +#define N_X_ARG_REG 8 | ||
73 | +#define N_V_ARG_REG 8 | ||
74 | + | ||
75 | +#define AARCH64_FFI_WITH_V (1 << AARCH64_FFI_WITH_V_BIT) | ||
76 | + | ||
77 | +union _d | ||
78 | +{ | ||
79 | + UINT64 d; | ||
80 | + UINT32 s[2]; | ||
81 | +}; | ||
82 | + | ||
83 | +struct call_context | ||
84 | +{ | ||
85 | + UINT64 x [AARCH64_N_XREG]; | ||
86 | + struct | ||
87 | + { | ||
88 | + union _d d[2]; | ||
89 | + } v [AARCH64_N_VREG]; | ||
90 | +}; | ||
91 | + | ||
92 | +#if defined (__clang__) && defined (__APPLE__) | ||
93 | +extern void | ||
94 | +sys_icache_invalidate (void *start, size_t len); | ||
95 | +#endif | ||
96 | + | ||
97 | +static inline void | ||
98 | +ffi_clear_cache (void *start, void *end) | ||
99 | +{ | ||
100 | +#if defined (__clang__) && defined (__APPLE__) | ||
101 | + sys_icache_invalidate (start, (char *)end - (char *)start); | ||
102 | +#elif defined (__GNUC__) | ||
103 | + __builtin___clear_cache (start, end); | ||
104 | +#else | ||
105 | +#error "Missing builtin to flush instruction cache" | ||
106 | +#endif | ||
107 | +} | ||
108 | + | ||
109 | +static void * | ||
110 | +get_x_addr (struct call_context *context, unsigned n) | ||
111 | +{ | ||
112 | + return &context->x[n]; | ||
113 | +} | ||
114 | + | ||
115 | +static void * | ||
116 | +get_s_addr (struct call_context *context, unsigned n) | ||
117 | +{ | ||
118 | +#if defined __AARCH64EB__ | ||
119 | + return &context->v[n].d[1].s[1]; | ||
120 | +#else | ||
121 | + return &context->v[n].d[0].s[0]; | ||
122 | +#endif | ||
123 | +} | ||
124 | + | ||
125 | +static void * | ||
126 | +get_d_addr (struct call_context *context, unsigned n) | ||
127 | +{ | ||
128 | +#if defined __AARCH64EB__ | ||
129 | + return &context->v[n].d[1]; | ||
130 | +#else | ||
131 | + return &context->v[n].d[0]; | ||
132 | +#endif | ||
133 | +} | ||
134 | + | ||
135 | +static void * | ||
136 | +get_v_addr (struct call_context *context, unsigned n) | ||
137 | +{ | ||
138 | + return &context->v[n]; | ||
139 | +} | ||
140 | + | ||
141 | +/* Return the memory location at which a basic type would reside | ||
142 | + were it to have been stored in register n. */ | ||
143 | + | ||
144 | +static void * | ||
145 | +get_basic_type_addr (unsigned short type, struct call_context *context, | ||
146 | + unsigned n) | ||
147 | +{ | ||
148 | + switch (type) | ||
149 | + { | ||
150 | + case FFI_TYPE_FLOAT: | ||
151 | + return get_s_addr (context, n); | ||
152 | + case FFI_TYPE_DOUBLE: | ||
153 | + return get_d_addr (context, n); | ||
154 | +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE | ||
155 | + case FFI_TYPE_LONGDOUBLE: | ||
156 | + return get_v_addr (context, n); | ||
157 | +#endif | ||
158 | + case FFI_TYPE_UINT8: | ||
159 | + case FFI_TYPE_SINT8: | ||
160 | + case FFI_TYPE_UINT16: | ||
161 | + case FFI_TYPE_SINT16: | ||
162 | + case FFI_TYPE_UINT32: | ||
163 | + case FFI_TYPE_SINT32: | ||
164 | + case FFI_TYPE_INT: | ||
165 | + case FFI_TYPE_POINTER: | ||
166 | + case FFI_TYPE_UINT64: | ||
167 | + case FFI_TYPE_SINT64: | ||
168 | + return get_x_addr (context, n); | ||
169 | + case FFI_TYPE_VOID: | ||
170 | + return NULL; | ||
171 | + default: | ||
172 | + FFI_ASSERT (0); | ||
173 | + return NULL; | ||
174 | + } | ||
175 | +} | ||
176 | + | ||
177 | +/* Return the alignment width for each of the basic types. */ | ||
178 | + | ||
179 | +static size_t | ||
180 | +get_basic_type_alignment (unsigned short type) | ||
181 | +{ | ||
182 | + switch (type) | ||
183 | + { | ||
184 | + case FFI_TYPE_FLOAT: | ||
185 | + case FFI_TYPE_DOUBLE: | ||
186 | + return sizeof (UINT64); | ||
187 | +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE | ||
188 | + case FFI_TYPE_LONGDOUBLE: | ||
189 | + return sizeof (long double); | ||
190 | +#endif | ||
191 | + case FFI_TYPE_UINT8: | ||
192 | + case FFI_TYPE_SINT8: | ||
193 | +#if defined (__APPLE__) | ||
194 | + return sizeof (UINT8); | ||
195 | +#endif | ||
196 | + case FFI_TYPE_UINT16: | ||
197 | + case FFI_TYPE_SINT16: | ||
198 | +#if defined (__APPLE__) | ||
199 | + return sizeof (UINT16); | ||
200 | +#endif | ||
201 | + case FFI_TYPE_UINT32: | ||
202 | + case FFI_TYPE_INT: | ||
203 | + case FFI_TYPE_SINT32: | ||
204 | +#if defined (__APPLE__) | ||
205 | + return sizeof (UINT32); | ||
206 | +#endif | ||
207 | + case FFI_TYPE_POINTER: | ||
208 | + case FFI_TYPE_UINT64: | ||
209 | + case FFI_TYPE_SINT64: | ||
210 | + return sizeof (UINT64); | ||
211 | + | ||
212 | + default: | ||
213 | + FFI_ASSERT (0); | ||
214 | + return 0; | ||
215 | + } | ||
216 | +} | ||
217 | + | ||
218 | +/* Return the size in bytes for each of the basic types. */ | ||
219 | + | ||
220 | +static size_t | ||
221 | +get_basic_type_size (unsigned short type) | ||
222 | +{ | ||
223 | + switch (type) | ||
224 | + { | ||
225 | + case FFI_TYPE_FLOAT: | ||
226 | + return sizeof (UINT32); | ||
227 | + case FFI_TYPE_DOUBLE: | ||
228 | + return sizeof (UINT64); | ||
229 | +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE | ||
230 | + case FFI_TYPE_LONGDOUBLE: | ||
231 | + return sizeof (long double); | ||
232 | +#endif | ||
233 | + case FFI_TYPE_UINT8: | ||
234 | + return sizeof (UINT8); | ||
235 | + case FFI_TYPE_SINT8: | ||
236 | + return sizeof (SINT8); | ||
237 | + case FFI_TYPE_UINT16: | ||
238 | + return sizeof (UINT16); | ||
239 | + case FFI_TYPE_SINT16: | ||
240 | + return sizeof (SINT16); | ||
241 | + case FFI_TYPE_UINT32: | ||
242 | + return sizeof (UINT32); | ||
243 | + case FFI_TYPE_INT: | ||
244 | + case FFI_TYPE_SINT32: | ||
245 | + return sizeof (SINT32); | ||
246 | + case FFI_TYPE_POINTER: | ||
247 | + case FFI_TYPE_UINT64: | ||
248 | + return sizeof (UINT64); | ||
249 | + case FFI_TYPE_SINT64: | ||
250 | + return sizeof (SINT64); | ||
251 | + | ||
252 | + default: | ||
253 | + FFI_ASSERT (0); | ||
254 | + return 0; | ||
255 | + } | ||
256 | +} | ||
257 | + | ||
258 | +extern void | ||
259 | +ffi_call_SYSV (unsigned (*)(struct call_context *context, unsigned char *, | ||
260 | + extended_cif *), | ||
261 | + struct call_context *context, | ||
262 | + extended_cif *, | ||
263 | + size_t, | ||
264 | + void (*fn)(void)); | ||
265 | + | ||
266 | +extern void | ||
267 | +ffi_closure_SYSV (ffi_closure *); | ||
268 | + | ||
269 | +/* Test for an FFI floating point representation. */ | ||
270 | + | ||
271 | +static unsigned | ||
272 | +is_floating_type (unsigned short type) | ||
273 | +{ | ||
274 | + return (type == FFI_TYPE_FLOAT || type == FFI_TYPE_DOUBLE | ||
275 | + || type == FFI_TYPE_LONGDOUBLE); | ||
276 | +} | ||
277 | + | ||
278 | +/* Test for a homogeneous structure. */ | ||
279 | + | ||
280 | +static unsigned short | ||
281 | +get_homogeneous_type (ffi_type *ty) | ||
282 | +{ | ||
283 | + if (ty->type == FFI_TYPE_STRUCT && ty->elements) | ||
284 | + { | ||
285 | + unsigned i; | ||
286 | + unsigned short candidate_type | ||
287 | + = get_homogeneous_type (ty->elements[0]); | ||
288 | + for (i =1; ty->elements[i]; i++) | ||
289 | + { | ||
290 | + unsigned short iteration_type = 0; | ||
291 | + /* If we have a nested struct, we must find its homogeneous type. | ||
292 | + If that fits with our candidate type, we are still | ||
293 | + homogeneous. */ | ||
294 | + if (ty->elements[i]->type == FFI_TYPE_STRUCT | ||
295 | + && ty->elements[i]->elements) | ||
296 | + { | ||
297 | + iteration_type = get_homogeneous_type (ty->elements[i]); | ||
298 | + } | ||
299 | + else | ||
300 | + { | ||
301 | + iteration_type = ty->elements[i]->type; | ||
302 | + } | ||
303 | + | ||
304 | + /* If we are not homogeneous, return FFI_TYPE_STRUCT. */ | ||
305 | + if (candidate_type != iteration_type) | ||
306 | + return FFI_TYPE_STRUCT; | ||
307 | + } | ||
308 | + return candidate_type; | ||
309 | + } | ||
310 | + | ||
311 | + /* Base case, we have no more levels of nesting, so we | ||
312 | + are a basic type, and so, trivially homogeneous in that type. */ | ||
313 | + return ty->type; | ||
314 | +} | ||
315 | + | ||
316 | +/* Determine the number of elements within a STRUCT. | ||
317 | + | ||
318 | + Note, we must handle nested structs. | ||
319 | + | ||
320 | + If ty is not a STRUCT this function will return 0. */ | ||
321 | + | ||
322 | +static unsigned | ||
323 | +element_count (ffi_type *ty) | ||
324 | +{ | ||
325 | + if (ty->type == FFI_TYPE_STRUCT && ty->elements) | ||
326 | + { | ||
327 | + unsigned n; | ||
328 | + unsigned elems = 0; | ||
329 | + for (n = 0; ty->elements[n]; n++) | ||
330 | + { | ||
331 | + if (ty->elements[n]->type == FFI_TYPE_STRUCT | ||
332 | + && ty->elements[n]->elements) | ||
333 | + elems += element_count (ty->elements[n]); | ||
334 | + else | ||
335 | + elems++; | ||
336 | + } | ||
337 | + return elems; | ||
338 | + } | ||
339 | + return 0; | ||
340 | +} | ||
341 | + | ||
342 | +/* Test for a homogeneous floating point aggregate. | ||
343 | + | ||
344 | + A homogeneous floating point aggregate is a homogeneous aggregate of | ||
345 | + a half- single- or double- precision floating point type with one | ||
346 | + to four elements. Note that this includes nested structs of the | ||
347 | + basic type. */ | ||
348 | + | ||
349 | +static int | ||
350 | +is_hfa (ffi_type *ty) | ||
351 | +{ | ||
352 | + if (ty->type == FFI_TYPE_STRUCT | ||
353 | + && ty->elements[0] | ||
354 | + && is_floating_type (get_homogeneous_type (ty))) | ||
355 | + { | ||
356 | + unsigned n = element_count (ty); | ||
357 | + return n >= 1 && n <= 4; | ||
358 | + } | ||
359 | + return 0; | ||
360 | +} | ||
361 | + | ||
362 | +/* Test if an ffi_type is a candidate for passing in a register. | ||
363 | + | ||
364 | + This test does not check that sufficient registers of the | ||
365 | + appropriate class are actually available, merely that IFF | ||
366 | + sufficient registers are available then the argument will be passed | ||
367 | + in register(s). | ||
368 | + | ||
369 | + Note that an ffi_type that is deemed to be a register candidate | ||
370 | + will always be returned in registers. | ||
371 | + | ||
372 | + Returns 1 if a register candidate else 0. */ | ||
373 | + | ||
374 | +static int | ||
375 | +is_register_candidate (ffi_type *ty) | ||
376 | +{ | ||
377 | + switch (ty->type) | ||
378 | + { | ||
379 | + case FFI_TYPE_VOID: | ||
380 | + case FFI_TYPE_FLOAT: | ||
381 | + case FFI_TYPE_DOUBLE: | ||
382 | +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE | ||
383 | + case FFI_TYPE_LONGDOUBLE: | ||
384 | +#endif | ||
385 | + case FFI_TYPE_UINT8: | ||
386 | + case FFI_TYPE_UINT16: | ||
387 | + case FFI_TYPE_UINT32: | ||
388 | + case FFI_TYPE_UINT64: | ||
389 | + case FFI_TYPE_POINTER: | ||
390 | + case FFI_TYPE_SINT8: | ||
391 | + case FFI_TYPE_SINT16: | ||
392 | + case FFI_TYPE_SINT32: | ||
393 | + case FFI_TYPE_INT: | ||
394 | + case FFI_TYPE_SINT64: | ||
395 | + return 1; | ||
396 | + | ||
397 | + case FFI_TYPE_STRUCT: | ||
398 | + if (is_hfa (ty)) | ||
399 | + { | ||
400 | + return 1; | ||
401 | + } | ||
402 | + else if (ty->size > 16) | ||
403 | + { | ||
404 | + /* Too large. Will be replaced with a pointer to memory. The | ||
405 | + pointer MAY be passed in a register, but the value will | ||
406 | + not. This test specifically fails since the argument will | ||
407 | + never be passed by value in registers. */ | ||
408 | + return 0; | ||
409 | + } | ||
410 | + else | ||
411 | + { | ||
412 | + /* Might be passed in registers depending on the number of | ||
413 | + registers required. */ | ||
414 | + return (ty->size + 7) / 8 < N_X_ARG_REG; | ||
415 | + } | ||
416 | + break; | ||
417 | + | ||
418 | + default: | ||
419 | + FFI_ASSERT (0); | ||
420 | + break; | ||
421 | + } | ||
422 | + | ||
423 | + return 0; | ||
424 | +} | ||
425 | + | ||
426 | +/* Test if an ffi_type argument or result is a candidate for a vector | ||
427 | + register. */ | ||
428 | + | ||
429 | +static int | ||
430 | +is_v_register_candidate (ffi_type *ty) | ||
431 | +{ | ||
432 | + return is_floating_type (ty->type) | ||
433 | + || (ty->type == FFI_TYPE_STRUCT && is_hfa (ty)); | ||
434 | +} | ||
435 | + | ||
436 | +/* Representation of the procedure call argument marshalling | ||
437 | + state. | ||
438 | + | ||
439 | + The terse state variable names match the names used in the AARCH64 | ||
440 | + PCS. */ | ||
441 | + | ||
442 | +struct arg_state | ||
443 | +{ | ||
444 | + unsigned ngrn; /* Next general-purpose register number. */ | ||
445 | + unsigned nsrn; /* Next vector register number. */ | ||
446 | + size_t nsaa; /* Next stack offset. */ | ||
447 | + | ||
448 | +#if defined (__APPLE__) | ||
449 | + unsigned allocating_variadic; | ||
450 | +#endif | ||
451 | +}; | ||
452 | + | ||
453 | +/* Initialize a procedure call argument marshalling state. */ | ||
454 | +static void | ||
455 | +arg_init (struct arg_state *state, size_t call_frame_size) | ||
456 | +{ | ||
457 | + state->ngrn = 0; | ||
458 | + state->nsrn = 0; | ||
459 | + state->nsaa = 0; | ||
460 | + | ||
461 | +#if defined (__APPLE__) | ||
462 | + state->allocating_variadic = 0; | ||
463 | +#endif | ||
464 | +} | ||
465 | + | ||
466 | +/* Return the number of available consecutive core argument | ||
467 | + registers. */ | ||
468 | + | ||
469 | +static unsigned | ||
470 | +available_x (struct arg_state *state) | ||
471 | +{ | ||
472 | + return N_X_ARG_REG - state->ngrn; | ||
473 | +} | ||
474 | + | ||
475 | +/* Return the number of available consecutive vector argument | ||
476 | + registers. */ | ||
477 | + | ||
478 | +static unsigned | ||
479 | +available_v (struct arg_state *state) | ||
480 | +{ | ||
481 | + return N_V_ARG_REG - state->nsrn; | ||
482 | +} | ||
483 | + | ||
484 | +static void * | ||
485 | +allocate_to_x (struct call_context *context, struct arg_state *state) | ||
486 | +{ | ||
487 | + FFI_ASSERT (state->ngrn < N_X_ARG_REG); | ||
488 | + return get_x_addr (context, (state->ngrn)++); | ||
489 | +} | ||
490 | + | ||
491 | +static void * | ||
492 | +allocate_to_s (struct call_context *context, struct arg_state *state) | ||
493 | +{ | ||
494 | + FFI_ASSERT (state->nsrn < N_V_ARG_REG); | ||
495 | + return get_s_addr (context, (state->nsrn)++); | ||
496 | +} | ||
497 | + | ||
498 | +static void * | ||
499 | +allocate_to_d (struct call_context *context, struct arg_state *state) | ||
500 | +{ | ||
501 | + FFI_ASSERT (state->nsrn < N_V_ARG_REG); | ||
502 | + return get_d_addr (context, (state->nsrn)++); | ||
503 | +} | ||
504 | + | ||
505 | +static void * | ||
506 | +allocate_to_v (struct call_context *context, struct arg_state *state) | ||
507 | +{ | ||
508 | + FFI_ASSERT (state->nsrn < N_V_ARG_REG); | ||
509 | + return get_v_addr (context, (state->nsrn)++); | ||
510 | +} | ||
511 | + | ||
512 | +/* Allocate an aligned slot on the stack and return a pointer to it. */ | ||
513 | +static void * | ||
514 | +allocate_to_stack (struct arg_state *state, void *stack, size_t alignment, | ||
515 | + size_t size) | ||
516 | +{ | ||
517 | + void *allocation; | ||
518 | + | ||
519 | + /* Round up the NSAA to the larger of 8 or the natural | ||
520 | + alignment of the argument's type. */ | ||
521 | + state->nsaa = ALIGN (state->nsaa, alignment); | ||
522 | + state->nsaa = ALIGN (state->nsaa, alignment); | ||
523 | +#if defined (__APPLE__) | ||
524 | + if (state->allocating_variadic) | ||
525 | + state->nsaa = ALIGN (state->nsaa, 8); | ||
526 | +#else | ||
527 | + state->nsaa = ALIGN (state->nsaa, 8); | ||
528 | +#endif | ||
529 | + | ||
530 | + allocation = stack + state->nsaa; | ||
531 | + | ||
532 | + state->nsaa += size; | ||
533 | + return allocation; | ||
534 | +} | ||
535 | + | ||
536 | +static void | ||
537 | +copy_basic_type (void *dest, void *source, unsigned short type) | ||
538 | +{ | ||
539 | + /* This is necessary to ensure that basic types are copied | ||
540 | + sign extended to 64-bits as libffi expects. */ | ||
541 | + switch (type) | ||
542 | + { | ||
543 | + case FFI_TYPE_FLOAT: | ||
544 | + *(float *) dest = *(float *) source; | ||
545 | + break; | ||
546 | + case FFI_TYPE_DOUBLE: | ||
547 | + *(double *) dest = *(double *) source; | ||
548 | + break; | ||
549 | +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE | ||
550 | + case FFI_TYPE_LONGDOUBLE: | ||
551 | + *(long double *) dest = *(long double *) source; | ||
552 | + break; | ||
553 | +#endif | ||
554 | + case FFI_TYPE_UINT8: | ||
555 | + *(ffi_arg *) dest = *(UINT8 *) source; | ||
556 | + break; | ||
557 | + case FFI_TYPE_SINT8: | ||
558 | + *(ffi_sarg *) dest = *(SINT8 *) source; | ||
559 | + break; | ||
560 | + case FFI_TYPE_UINT16: | ||
561 | + *(ffi_arg *) dest = *(UINT16 *) source; | ||
562 | + break; | ||
563 | + case FFI_TYPE_SINT16: | ||
564 | + *(ffi_sarg *) dest = *(SINT16 *) source; | ||
565 | + break; | ||
566 | + case FFI_TYPE_UINT32: | ||
567 | + *(ffi_arg *) dest = *(UINT32 *) source; | ||
568 | + break; | ||
569 | + case FFI_TYPE_INT: | ||
570 | + case FFI_TYPE_SINT32: | ||
571 | + *(ffi_sarg *) dest = *(SINT32 *) source; | ||
572 | + break; | ||
573 | + case FFI_TYPE_POINTER: | ||
574 | + case FFI_TYPE_UINT64: | ||
575 | + *(ffi_arg *) dest = *(UINT64 *) source; | ||
576 | + break; | ||
577 | + case FFI_TYPE_SINT64: | ||
578 | + *(ffi_sarg *) dest = *(SINT64 *) source; | ||
579 | + break; | ||
580 | + case FFI_TYPE_VOID: | ||
581 | + break; | ||
582 | + | ||
583 | + default: | ||
584 | + FFI_ASSERT (0); | ||
585 | + } | ||
586 | +} | ||
587 | + | ||
588 | +static void | ||
589 | +copy_hfa_to_reg_or_stack (void *memory, | ||
590 | + ffi_type *ty, | ||
591 | + struct call_context *context, | ||
592 | + unsigned char *stack, | ||
593 | + struct arg_state *state) | ||
594 | +{ | ||
595 | + unsigned elems = element_count (ty); | ||
596 | + if (available_v (state) < elems) | ||
597 | + { | ||
598 | + /* There are insufficient V registers. Further V register allocations | ||
599 | + are prevented, the NSAA is adjusted (by allocate_to_stack ()) | ||
600 | + and the argument is copied to memory at the adjusted NSAA. */ | ||
601 | + state->nsrn = N_V_ARG_REG; | ||
602 | + memcpy (allocate_to_stack (state, stack, ty->alignment, ty->size), | ||
603 | + memory, | ||
604 | + ty->size); | ||
605 | + } | ||
606 | + else | ||
607 | + { | ||
608 | + int i; | ||
609 | + unsigned short type = get_homogeneous_type (ty); | ||
610 | + for (i = 0; i < elems; i++) | ||
611 | + { | ||
612 | + void *reg = allocate_to_v (context, state); | ||
613 | + copy_basic_type (reg, memory, type); | ||
614 | + memory += get_basic_type_size (type); | ||
615 | + } | ||
616 | + } | ||
617 | +} | ||
618 | + | ||
619 | +/* Either allocate an appropriate register for the argument type, or if | ||
620 | + none are available, allocate a stack slot and return a pointer | ||
621 | + to the allocated space. */ | ||
622 | + | ||
623 | +static void * | ||
624 | +allocate_to_register_or_stack (struct call_context *context, | ||
625 | + unsigned char *stack, | ||
626 | + struct arg_state *state, | ||
627 | + unsigned short type) | ||
628 | +{ | ||
629 | + size_t alignment = get_basic_type_alignment (type); | ||
630 | + size_t size = alignment; | ||
631 | + switch (type) | ||
632 | + { | ||
633 | + case FFI_TYPE_FLOAT: | ||
634 | + /* This is the only case for which the allocated stack size | ||
635 | + should not match the alignment of the type. */ | ||
636 | + size = sizeof (UINT32); | ||
637 | + /* Fall through. */ | ||
638 | + case FFI_TYPE_DOUBLE: | ||
639 | + if (state->nsrn < N_V_ARG_REG) | ||
640 | + return allocate_to_d (context, state); | ||
641 | + state->nsrn = N_V_ARG_REG; | ||
642 | + break; | ||
643 | +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE | ||
644 | + case FFI_TYPE_LONGDOUBLE: | ||
645 | + if (state->nsrn < N_V_ARG_REG) | ||
646 | + return allocate_to_v (context, state); | ||
647 | + state->nsrn = N_V_ARG_REG; | ||
648 | + break; | ||
649 | +#endif | ||
650 | + case FFI_TYPE_UINT8: | ||
651 | + case FFI_TYPE_SINT8: | ||
652 | + case FFI_TYPE_UINT16: | ||
653 | + case FFI_TYPE_SINT16: | ||
654 | + case FFI_TYPE_UINT32: | ||
655 | + case FFI_TYPE_SINT32: | ||
656 | + case FFI_TYPE_INT: | ||
657 | + case FFI_TYPE_POINTER: | ||
658 | + case FFI_TYPE_UINT64: | ||
659 | + case FFI_TYPE_SINT64: | ||
660 | + if (state->ngrn < N_X_ARG_REG) | ||
661 | + return allocate_to_x (context, state); | ||
662 | + state->ngrn = N_X_ARG_REG; | ||
663 | + break; | ||
664 | + default: | ||
665 | + FFI_ASSERT (0); | ||
666 | + } | ||
667 | + | ||
668 | + return allocate_to_stack (state, stack, alignment, size); | ||
669 | +} | ||
670 | + | ||
671 | +/* Copy a value to an appropriate register, or if none are | ||
672 | + available, to the stack. */ | ||
673 | + | ||
674 | +static void | ||
675 | +copy_to_register_or_stack (struct call_context *context, | ||
676 | + unsigned char *stack, | ||
677 | + struct arg_state *state, | ||
678 | + void *value, | ||
679 | + unsigned short type) | ||
680 | +{ | ||
681 | + copy_basic_type ( | ||
682 | + allocate_to_register_or_stack (context, stack, state, type), | ||
683 | + value, | ||
684 | + type); | ||
685 | +} | ||
686 | + | ||
687 | +/* Marshall the arguments from FFI representation to procedure call | ||
688 | + context and stack. */ | ||
689 | + | ||
690 | +static unsigned | ||
691 | +aarch64_prep_args (struct call_context *context, unsigned char *stack, | ||
692 | + extended_cif *ecif) | ||
693 | +{ | ||
694 | + int i; | ||
695 | + struct arg_state state; | ||
696 | + | ||
697 | + arg_init (&state, ALIGN(ecif->cif->bytes, 16)); | ||
698 | + | ||
699 | + for (i = 0; i < ecif->cif->nargs; i++) | ||
700 | + { | ||
701 | + ffi_type *ty = ecif->cif->arg_types[i]; | ||
702 | + switch (ty->type) | ||
703 | + { | ||
704 | + case FFI_TYPE_VOID: | ||
705 | + FFI_ASSERT (0); | ||
706 | + break; | ||
707 | + | ||
708 | + /* If the argument is a basic type the argument is allocated to an | ||
709 | + appropriate register, or if none are available, to the stack. */ | ||
710 | + case FFI_TYPE_FLOAT: | ||
711 | + case FFI_TYPE_DOUBLE: | ||
712 | +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE | ||
713 | + case FFI_TYPE_LONGDOUBLE: | ||
714 | +#endif | ||
715 | + case FFI_TYPE_UINT8: | ||
716 | + case FFI_TYPE_SINT8: | ||
717 | + case FFI_TYPE_UINT16: | ||
718 | + case FFI_TYPE_SINT16: | ||
719 | + case FFI_TYPE_UINT32: | ||
720 | + case FFI_TYPE_INT: | ||
721 | + case FFI_TYPE_SINT32: | ||
722 | + case FFI_TYPE_POINTER: | ||
723 | + case FFI_TYPE_UINT64: | ||
724 | + case FFI_TYPE_SINT64: | ||
725 | + copy_to_register_or_stack (context, stack, &state, | ||
726 | + ecif->avalue[i], ty->type); | ||
727 | + break; | ||
728 | + | ||
729 | + case FFI_TYPE_STRUCT: | ||
730 | + if (is_hfa (ty)) | ||
731 | + { | ||
732 | + copy_hfa_to_reg_or_stack (ecif->avalue[i], ty, context, | ||
733 | + stack, &state); | ||
734 | + } | ||
735 | + else if (ty->size > 16) | ||
736 | + { | ||
737 | + /* If the argument is a composite type that is larger than 16 | ||
738 | + bytes, then the argument has been copied to memory, and | ||
739 | + the argument is replaced by a pointer to the copy. */ | ||
740 | + | ||
741 | + copy_to_register_or_stack (context, stack, &state, | ||
742 | + &(ecif->avalue[i]), FFI_TYPE_POINTER); | ||
743 | + } | ||
744 | + else if (available_x (&state) >= (ty->size + 7) / 8) | ||
745 | + { | ||
746 | + /* If the argument is a composite type and the size in | ||
747 | + double-words is not more than the number of available | ||
748 | + X registers, then the argument is copied into consecutive | ||
749 | + X registers. */ | ||
750 | + int j; | ||
751 | + for (j = 0; j < (ty->size + 7) / 8; j++) | ||
752 | + { | ||
753 | + memcpy (allocate_to_x (context, &state), | ||
754 | + &(((UINT64 *) ecif->avalue[i])[j]), | ||
755 | + sizeof (UINT64)); | ||
756 | + } | ||
757 | + } | ||
758 | + else | ||
759 | + { | ||
760 | + /* Otherwise, there are insufficient X registers. Further X | ||
761 | + register allocations are prevented, the NSAA is adjusted | ||
762 | + (by allocate_to_stack ()) and the argument is copied to | ||
763 | + memory at the adjusted NSAA. */ | ||
764 | + state.ngrn = N_X_ARG_REG; | ||
765 | + | ||
766 | + memcpy (allocate_to_stack (&state, stack, ty->alignment, | ||
767 | + ty->size), ecif->avalue + i, ty->size); | ||
768 | + } | ||
769 | + break; | ||
770 | + | ||
771 | + default: | ||
772 | + FFI_ASSERT (0); | ||
773 | + break; | ||
774 | + } | ||
775 | + | ||
776 | +#if defined (__APPLE__) | ||
777 | + if (i + 1 == ecif->cif->aarch64_nfixedargs) | ||
778 | + { | ||
779 | + state.ngrn = N_X_ARG_REG; | ||
780 | + state.nsrn = N_V_ARG_REG; | ||
781 | + | ||
782 | + state.allocating_variadic = 1; | ||
783 | + } | ||
784 | +#endif | ||
785 | + } | ||
786 | + | ||
787 | + return ecif->cif->aarch64_flags; | ||
788 | +} | ||
789 | + | ||
790 | +ffi_status | ||
791 | +ffi_prep_cif_machdep (ffi_cif *cif) | ||
792 | +{ | ||
793 | + /* Round the stack up to a multiple of the stack alignment requirement. */ | ||
794 | + cif->bytes = | ||
795 | + (cif->bytes + (AARCH64_STACK_ALIGN - 1)) & ~ (AARCH64_STACK_ALIGN - 1); | ||
796 | + | ||
797 | + /* Initialize our flags. We are interested if this CIF will touch a | ||
798 | + vector register, if so we will enable context save and load to | ||
799 | + those registers, otherwise not. This is intended to be friendly | ||
800 | + to lazy float context switching in the kernel. */ | ||
801 | + cif->aarch64_flags = 0; | ||
802 | + | ||
803 | + if (is_v_register_candidate (cif->rtype)) | ||
804 | + { | ||
805 | + cif->aarch64_flags |= AARCH64_FFI_WITH_V; | ||
806 | + } | ||
807 | + else | ||
808 | + { | ||
809 | + int i; | ||
810 | + for (i = 0; i < cif->nargs; i++) | ||
811 | + if (is_v_register_candidate (cif->arg_types[i])) | ||
812 | + { | ||
813 | + cif->aarch64_flags |= AARCH64_FFI_WITH_V; | ||
814 | + break; | ||
815 | + } | ||
816 | + } | ||
817 | + | ||
818 | + return FFI_OK; | ||
819 | +} | ||
820 | + | ||
821 | +#if defined (__APPLE__) | ||
822 | + | ||
823 | +/* Perform Apple-specific cif processing for variadic calls */ | ||
824 | +ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, | ||
825 | + unsigned int nfixedargs, | ||
826 | + unsigned int ntotalargs) | ||
827 | +{ | ||
828 | + cif->aarch64_nfixedargs = nfixedargs; | ||
829 | + | ||
830 | + return ffi_prep_cif_machdep(cif); | ||
831 | +} | ||
832 | + | ||
833 | +#endif | ||
834 | + | ||
835 | +/* Call a function with the provided arguments and capture the return | ||
836 | + value. */ | ||
837 | +void | ||
838 | +ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) | ||
839 | +{ | ||
840 | + extended_cif ecif; | ||
841 | + | ||
842 | + ecif.cif = cif; | ||
843 | + ecif.avalue = avalue; | ||
844 | + ecif.rvalue = rvalue; | ||
845 | + | ||
846 | + switch (cif->abi) | ||
847 | + { | ||
848 | + case FFI_SYSV: | ||
849 | + { | ||
850 | + struct call_context context; | ||
851 | + size_t stack_bytes; | ||
852 | + | ||
853 | + /* Figure out the total amount of stack space we need, the | ||
854 | + above call frame space needs to be 16 bytes aligned to | ||
855 | + ensure correct alignment of the first object inserted in | ||
856 | + that space hence the ALIGN applied to cif->bytes.*/ | ||
857 | + stack_bytes = ALIGN(cif->bytes, 16); | ||
858 | + | ||
859 | + memset (&context, 0, sizeof (context)); | ||
860 | + if (is_register_candidate (cif->rtype)) | ||
861 | + { | ||
862 | + ffi_call_SYSV (aarch64_prep_args, &context, &ecif, stack_bytes, fn); | ||
863 | + switch (cif->rtype->type) | ||
864 | + { | ||
865 | + case FFI_TYPE_VOID: | ||
866 | + case FFI_TYPE_FLOAT: | ||
867 | + case FFI_TYPE_DOUBLE: | ||
868 | +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE | ||
869 | + case FFI_TYPE_LONGDOUBLE: | ||
870 | +#endif | ||
871 | + case FFI_TYPE_UINT8: | ||
872 | + case FFI_TYPE_SINT8: | ||
873 | + case FFI_TYPE_UINT16: | ||
874 | + case FFI_TYPE_SINT16: | ||
875 | + case FFI_TYPE_UINT32: | ||
876 | + case FFI_TYPE_SINT32: | ||
877 | + case FFI_TYPE_POINTER: | ||
878 | + case FFI_TYPE_UINT64: | ||
879 | + case FFI_TYPE_INT: | ||
880 | + case FFI_TYPE_SINT64: | ||
881 | + { | ||
882 | + void *addr = get_basic_type_addr (cif->rtype->type, | ||
883 | + &context, 0); | ||
884 | + copy_basic_type (rvalue, addr, cif->rtype->type); | ||
885 | + break; | ||
886 | + } | ||
887 | + | ||
888 | + case FFI_TYPE_STRUCT: | ||
889 | + if (is_hfa (cif->rtype)) | ||
890 | + { | ||
891 | + int j; | ||
892 | + unsigned short type = get_homogeneous_type (cif->rtype); | ||
893 | + unsigned elems = element_count (cif->rtype); | ||
894 | + for (j = 0; j < elems; j++) | ||
895 | + { | ||
896 | + void *reg = get_basic_type_addr (type, &context, j); | ||
897 | + copy_basic_type (rvalue, reg, type); | ||
898 | + rvalue += get_basic_type_size (type); | ||
899 | + } | ||
900 | + } | ||
901 | + else if ((cif->rtype->size + 7) / 8 < N_X_ARG_REG) | ||
902 | + { | ||
903 | + size_t size = ALIGN (cif->rtype->size, sizeof (UINT64)); | ||
904 | + memcpy (rvalue, get_x_addr (&context, 0), size); | ||
905 | + } | ||
906 | + else | ||
907 | + { | ||
908 | + FFI_ASSERT (0); | ||
909 | + } | ||
910 | + break; | ||
911 | + | ||
912 | + default: | ||
913 | + FFI_ASSERT (0); | ||
914 | + break; | ||
915 | + } | ||
916 | + } | ||
917 | + else | ||
918 | + { | ||
919 | + memcpy (get_x_addr (&context, 8), &rvalue, sizeof (UINT64)); | ||
920 | + ffi_call_SYSV (aarch64_prep_args, &context, &ecif, | ||
921 | + stack_bytes, fn); | ||
922 | + } | ||
923 | + break; | ||
924 | + } | ||
925 | + | ||
926 | + default: | ||
927 | + FFI_ASSERT (0); | ||
928 | + break; | ||
929 | + } | ||
930 | +} | ||
931 | + | ||
932 | +static unsigned char trampoline [] = | ||
933 | +{ 0x70, 0x00, 0x00, 0x58, /* ldr x16, 1f */ | ||
934 | + 0x91, 0x00, 0x00, 0x10, /* adr x17, 2f */ | ||
935 | + 0x00, 0x02, 0x1f, 0xd6 /* br x16 */ | ||
936 | +}; | ||
937 | + | ||
938 | +/* Build a trampoline. */ | ||
939 | + | ||
940 | +#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX,FLAGS) \ | ||
941 | + ({unsigned char *__tramp = (unsigned char*)(TRAMP); \ | ||
942 | + UINT64 __fun = (UINT64)(FUN); \ | ||
943 | + UINT64 __ctx = (UINT64)(CTX); \ | ||
944 | + UINT64 __flags = (UINT64)(FLAGS); \ | ||
945 | + memcpy (__tramp, trampoline, sizeof (trampoline)); \ | ||
946 | + memcpy (__tramp + 12, &__fun, sizeof (__fun)); \ | ||
947 | + memcpy (__tramp + 20, &__ctx, sizeof (__ctx)); \ | ||
948 | + memcpy (__tramp + 28, &__flags, sizeof (__flags)); \ | ||
949 | + ffi_clear_cache(__tramp, __tramp + FFI_TRAMPOLINE_SIZE); \ | ||
950 | + }) | ||
951 | + | ||
952 | +ffi_status | ||
953 | +ffi_prep_closure_loc (ffi_closure* closure, | ||
954 | + ffi_cif* cif, | ||
955 | + void (*fun)(ffi_cif*,void*,void**,void*), | ||
956 | + void *user_data, | ||
957 | + void *codeloc) | ||
958 | +{ | ||
959 | + if (cif->abi != FFI_SYSV) | ||
960 | + return FFI_BAD_ABI; | ||
961 | + | ||
962 | + FFI_INIT_TRAMPOLINE (&closure->tramp[0], &ffi_closure_SYSV, codeloc, | ||
963 | + cif->aarch64_flags); | ||
964 | + | ||
965 | + closure->cif = cif; | ||
966 | + closure->user_data = user_data; | ||
967 | + closure->fun = fun; | ||
968 | + | ||
969 | + return FFI_OK; | ||
970 | +} | ||
971 | + | ||
972 | +/* Primary handler to setup and invoke a function within a closure. | ||
973 | + | ||
974 | + A closure when invoked enters via the assembler wrapper | ||
975 | + ffi_closure_SYSV(). The wrapper allocates a call context on the | ||
976 | + stack, saves the interesting registers (from the perspective of | ||
977 | + the calling convention) into the context then passes control to | ||
978 | + ffi_closure_SYSV_inner() passing the saved context and a pointer to | ||
979 | + the stack at the point ffi_closure_SYSV() was invoked. | ||
980 | + | ||
981 | + On the return path the assembler wrapper will reload call context | ||
982 | + registers. | ||
983 | + | ||
984 | + ffi_closure_SYSV_inner() marshalls the call context into ffi value | ||
985 | + descriptors, invokes the wrapped function, then marshalls the return | ||
986 | + value back into the call context. */ | ||
987 | + | ||
988 | +void FFI_HIDDEN | ||
989 | +ffi_closure_SYSV_inner (ffi_closure *closure, struct call_context *context, | ||
990 | + void *stack) | ||
991 | +{ | ||
992 | + ffi_cif *cif = closure->cif; | ||
993 | + void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); | ||
994 | + void *rvalue = NULL; | ||
995 | + int i; | ||
996 | + struct arg_state state; | ||
997 | + | ||
998 | + arg_init (&state, ALIGN(cif->bytes, 16)); | ||
999 | + | ||
1000 | + for (i = 0; i < cif->nargs; i++) | ||
1001 | + { | ||
1002 | + ffi_type *ty = cif->arg_types[i]; | ||
1003 | + | ||
1004 | + switch (ty->type) | ||
1005 | + { | ||
1006 | + case FFI_TYPE_VOID: | ||
1007 | + FFI_ASSERT (0); | ||
1008 | + break; | ||
1009 | + | ||
1010 | + case FFI_TYPE_UINT8: | ||
1011 | + case FFI_TYPE_SINT8: | ||
1012 | + case FFI_TYPE_UINT16: | ||
1013 | + case FFI_TYPE_SINT16: | ||
1014 | + case FFI_TYPE_UINT32: | ||
1015 | + case FFI_TYPE_SINT32: | ||
1016 | + case FFI_TYPE_INT: | ||
1017 | + case FFI_TYPE_POINTER: | ||
1018 | + case FFI_TYPE_UINT64: | ||
1019 | + case FFI_TYPE_SINT64: | ||
1020 | + case FFI_TYPE_FLOAT: | ||
1021 | + case FFI_TYPE_DOUBLE: | ||
1022 | +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE | ||
1023 | + case FFI_TYPE_LONGDOUBLE: | ||
1024 | + avalue[i] = allocate_to_register_or_stack (context, stack, | ||
1025 | + &state, ty->type); | ||
1026 | + break; | ||
1027 | +#endif | ||
1028 | + | ||
1029 | + case FFI_TYPE_STRUCT: | ||
1030 | + if (is_hfa (ty)) | ||
1031 | + { | ||
1032 | + unsigned n = element_count (ty); | ||
1033 | + if (available_v (&state) < n) | ||
1034 | + { | ||
1035 | + state.nsrn = N_V_ARG_REG; | ||
1036 | + avalue[i] = allocate_to_stack (&state, stack, ty->alignment, | ||
1037 | + ty->size); | ||
1038 | + } | ||
1039 | + else | ||
1040 | + { | ||
1041 | + switch (get_homogeneous_type (ty)) | ||
1042 | + { | ||
1043 | + case FFI_TYPE_FLOAT: | ||
1044 | + { | ||
1045 | + /* Eeek! We need a pointer to the structure, | ||
1046 | + however the homogeneous float elements are | ||
1047 | + being passed in individual S registers, | ||
1048 | + therefore the structure is not represented as | ||
1049 | + a contiguous sequence of bytes in our saved | ||
1050 | + register context. We need to fake up a copy | ||
1051 | + of the structure laid out in memory | ||
1052 | + correctly. The fake can be tossed once the | ||
1053 | + closure function has returned hence alloca() | ||
1054 | + is sufficient. */ | ||
1055 | + int j; | ||
1056 | + UINT32 *p = avalue[i] = alloca (ty->size); | ||
1057 | + for (j = 0; j < element_count (ty); j++) | ||
1058 | + memcpy (&p[j], | ||
1059 | + allocate_to_s (context, &state), | ||
1060 | + sizeof (*p)); | ||
1061 | + break; | ||
1062 | + } | ||
1063 | + | ||
1064 | + case FFI_TYPE_DOUBLE: | ||
1065 | + { | ||
1066 | + /* Eeek! We need a pointer to the structure, | ||
1067 | + however the homogeneous float elements are | ||
1068 | + being passed in individual S registers, | ||
1069 | + therefore the structure is not represented as | ||
1070 | + a contiguous sequence of bytes in our saved | ||
1071 | + register context. We need to fake up a copy | ||
1072 | + of the structure laid out in memory | ||
1073 | + correctly. The fake can be tossed once the | ||
1074 | + closure function has returned hence alloca() | ||
1075 | + is sufficient. */ | ||
1076 | + int j; | ||
1077 | + UINT64 *p = avalue[i] = alloca (ty->size); | ||
1078 | + for (j = 0; j < element_count (ty); j++) | ||
1079 | + memcpy (&p[j], | ||
1080 | + allocate_to_d (context, &state), | ||
1081 | + sizeof (*p)); | ||
1082 | + break; | ||
1083 | + } | ||
1084 | + | ||
1085 | +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE | ||
1086 | + case FFI_TYPE_LONGDOUBLE: | ||
1087 | + memcpy (&avalue[i], | ||
1088 | + allocate_to_v (context, &state), | ||
1089 | + sizeof (*avalue)); | ||
1090 | + break; | ||
1091 | +#endif | ||
1092 | + | ||
1093 | + default: | ||
1094 | + FFI_ASSERT (0); | ||
1095 | + break; | ||
1096 | + } | ||
1097 | + } | ||
1098 | + } | ||
1099 | + else if (ty->size > 16) | ||
1100 | + { | ||
1101 | + /* Replace Composite type of size greater than 16 with a | ||
1102 | + pointer. */ | ||
1103 | + memcpy (&avalue[i], | ||
1104 | + allocate_to_register_or_stack (context, stack, | ||
1105 | + &state, FFI_TYPE_POINTER), | ||
1106 | + sizeof (avalue[i])); | ||
1107 | + } | ||
1108 | + else if (available_x (&state) >= (ty->size + 7) / 8) | ||
1109 | + { | ||
1110 | + avalue[i] = get_x_addr (context, state.ngrn); | ||
1111 | + state.ngrn += (ty->size + 7) / 8; | ||
1112 | + } | ||
1113 | + else | ||
1114 | + { | ||
1115 | + state.ngrn = N_X_ARG_REG; | ||
1116 | + | ||
1117 | + avalue[i] = allocate_to_stack (&state, stack, ty->alignment, | ||
1118 | + ty->size); | ||
1119 | + } | ||
1120 | + break; | ||
1121 | + | ||
1122 | + default: | ||
1123 | + FFI_ASSERT (0); | ||
1124 | + break; | ||
1125 | + } | ||
1126 | + } | ||
1127 | + | ||
1128 | + /* Figure out where the return value will be passed, either in | ||
1129 | + registers or in a memory block allocated by the caller and passed | ||
1130 | + in x8. */ | ||
1131 | + | ||
1132 | + if (is_register_candidate (cif->rtype)) | ||
1133 | + { | ||
1134 | + /* Register candidates are *always* returned in registers. */ | ||
1135 | + | ||
1136 | + /* Allocate a scratchpad for the return value, we will let the | ||
1137 | + callee scrible the result into the scratch pad then move the | ||
1138 | + contents into the appropriate return value location for the | ||
1139 | + call convention. */ | ||
1140 | + rvalue = alloca (cif->rtype->size); | ||
1141 | + (closure->fun) (cif, rvalue, avalue, closure->user_data); | ||
1142 | + | ||
1143 | + /* Copy the return value into the call context so that it is returned | ||
1144 | + as expected to our caller. */ | ||
1145 | + switch (cif->rtype->type) | ||
1146 | + { | ||
1147 | + case FFI_TYPE_VOID: | ||
1148 | + break; | ||
1149 | + | ||
1150 | + case FFI_TYPE_UINT8: | ||
1151 | + case FFI_TYPE_UINT16: | ||
1152 | + case FFI_TYPE_UINT32: | ||
1153 | + case FFI_TYPE_POINTER: | ||
1154 | + case FFI_TYPE_UINT64: | ||
1155 | + case FFI_TYPE_SINT8: | ||
1156 | + case FFI_TYPE_SINT16: | ||
1157 | + case FFI_TYPE_INT: | ||
1158 | + case FFI_TYPE_SINT32: | ||
1159 | + case FFI_TYPE_SINT64: | ||
1160 | + case FFI_TYPE_FLOAT: | ||
1161 | + case FFI_TYPE_DOUBLE: | ||
1162 | +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE | ||
1163 | + case FFI_TYPE_LONGDOUBLE: | ||
1164 | +#endif | ||
1165 | + { | ||
1166 | + void *addr = get_basic_type_addr (cif->rtype->type, context, 0); | ||
1167 | + copy_basic_type (addr, rvalue, cif->rtype->type); | ||
1168 | + break; | ||
1169 | + } | ||
1170 | + case FFI_TYPE_STRUCT: | ||
1171 | + if (is_hfa (cif->rtype)) | ||
1172 | + { | ||
1173 | + int j; | ||
1174 | + unsigned short type = get_homogeneous_type (cif->rtype); | ||
1175 | + unsigned elems = element_count (cif->rtype); | ||
1176 | + for (j = 0; j < elems; j++) | ||
1177 | + { | ||
1178 | + void *reg = get_basic_type_addr (type, context, j); | ||
1179 | + copy_basic_type (reg, rvalue, type); | ||
1180 | + rvalue += get_basic_type_size (type); | ||
1181 | + } | ||
1182 | + } | ||
1183 | + else if ((cif->rtype->size + 7) / 8 < N_X_ARG_REG) | ||
1184 | + { | ||
1185 | + size_t size = ALIGN (cif->rtype->size, sizeof (UINT64)) ; | ||
1186 | + memcpy (get_x_addr (context, 0), rvalue, size); | ||
1187 | + } | ||
1188 | + else | ||
1189 | + { | ||
1190 | + FFI_ASSERT (0); | ||
1191 | + } | ||
1192 | + break; | ||
1193 | + default: | ||
1194 | + FFI_ASSERT (0); | ||
1195 | + break; | ||
1196 | + } | ||
1197 | + } | ||
1198 | + else | ||
1199 | + { | ||
1200 | + memcpy (&rvalue, get_x_addr (context, 8), sizeof (UINT64)); | ||
1201 | + (closure->fun) (cif, rvalue, avalue, closure->user_data); | ||
1202 | + } | ||
1203 | +} | ||
1204 | + | ||
1205 | diff -ruN Python-2.7.3.orig/Modules/_ctypes/libffi/src/aarch64/ffitarget.h Python-2.7.3/Modules/_ctypes/libffi/src/aarch64/ffitarget.h | ||
1206 | --- Python-2.7.3.orig/Modules/_ctypes/libffi/src/aarch64/ffitarget.h 1970-01-01 01:00:00.000000000 +0100 | ||
1207 | +++ Python-2.7.3/Modules/_ctypes/libffi/src/aarch64/ffitarget.h 2014-04-25 19:45:13.000000000 +0200 | ||
1208 | @@ -0,0 +1,63 @@ | ||
1209 | +/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. | ||
1210 | + | ||
1211 | +Permission is hereby granted, free of charge, to any person obtaining | ||
1212 | +a copy of this software and associated documentation files (the | ||
1213 | +``Software''), to deal in the Software without restriction, including | ||
1214 | +without limitation the rights to use, copy, modify, merge, publish, | ||
1215 | +distribute, sublicense, and/or sell copies of the Software, and to | ||
1216 | +permit persons to whom the Software is furnished to do so, subject to | ||
1217 | +the following conditions: | ||
1218 | + | ||
1219 | +The above copyright notice and this permission notice shall be | ||
1220 | +included in all copies or substantial portions of the Software. | ||
1221 | + | ||
1222 | +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, | ||
1223 | +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
1224 | +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
1225 | +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
1226 | +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
1227 | +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
1228 | +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ | ||
1229 | + | ||
1230 | +#ifndef LIBFFI_TARGET_H | ||
1231 | +#define LIBFFI_TARGET_H | ||
1232 | + | ||
1233 | +#ifndef LIBFFI_H | ||
1234 | +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." | ||
1235 | +#endif | ||
1236 | + | ||
1237 | +#ifndef LIBFFI_ASM | ||
1238 | +typedef unsigned long ffi_arg; | ||
1239 | +typedef signed long ffi_sarg; | ||
1240 | + | ||
1241 | +typedef enum ffi_abi | ||
1242 | + { | ||
1243 | + FFI_FIRST_ABI = 0, | ||
1244 | + FFI_SYSV, | ||
1245 | + FFI_LAST_ABI, | ||
1246 | + FFI_DEFAULT_ABI = FFI_SYSV | ||
1247 | + } ffi_abi; | ||
1248 | +#endif | ||
1249 | + | ||
1250 | +/* ---- Definitions for closures ----------------------------------------- */ | ||
1251 | + | ||
1252 | +#define FFI_CLOSURES 1 | ||
1253 | +#define FFI_TRAMPOLINE_SIZE 36 | ||
1254 | +#define FFI_NATIVE_RAW_API 0 | ||
1255 | + | ||
1256 | +/* ---- Internal ---- */ | ||
1257 | + | ||
1258 | +#if defined (__APPLE__) | ||
1259 | +#define FFI_TARGET_SPECIFIC_VARIADIC | ||
1260 | +#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_flags; unsigned aarch64_nfixedargs | ||
1261 | +#else | ||
1262 | +#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_flags | ||
1263 | +#endif | ||
1264 | + | ||
1265 | +#define AARCH64_FFI_WITH_V_BIT 0 | ||
1266 | + | ||
1267 | +#define AARCH64_N_XREG 32 | ||
1268 | +#define AARCH64_N_VREG 32 | ||
1269 | +#define AARCH64_CALL_CONTEXT_SIZE (AARCH64_N_XREG * 8 + AARCH64_N_VREG * 16) | ||
1270 | + | ||
1271 | +#endif | ||
1272 | diff -ruN Python-2.7.3.orig/Modules/_ctypes/libffi/src/aarch64/sysv.S Python-2.7.3/Modules/_ctypes/libffi/src/aarch64/sysv.S | ||
1273 | --- Python-2.7.3.orig/Modules/_ctypes/libffi/src/aarch64/sysv.S 1970-01-01 01:00:00.000000000 +0100 | ||
1274 | +++ Python-2.7.3/Modules/_ctypes/libffi/src/aarch64/sysv.S 2014-04-25 19:45:13.000000000 +0200 | ||
1275 | @@ -0,0 +1,333 @@ | ||
1276 | +/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. | ||
1277 | + | ||
1278 | +Permission is hereby granted, free of charge, to any person obtaining | ||
1279 | +a copy of this software and associated documentation files (the | ||
1280 | +``Software''), to deal in the Software without restriction, including | ||
1281 | +without limitation the rights to use, copy, modify, merge, publish, | ||
1282 | +distribute, sublicense, and/or sell copies of the Software, and to | ||
1283 | +permit persons to whom the Software is furnished to do so, subject to | ||
1284 | +the following conditions: | ||
1285 | + | ||
1286 | +The above copyright notice and this permission notice shall be | ||
1287 | +included in all copies or substantial portions of the Software. | ||
1288 | + | ||
1289 | +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, | ||
1290 | +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
1291 | +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
1292 | +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
1293 | +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
1294 | +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
1295 | +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ | ||
1296 | + | ||
1297 | +#define LIBFFI_ASM | ||
1298 | +#include <fficonfig.h> | ||
1299 | +#include <ffi.h> | ||
1300 | + | ||
1301 | +#ifdef HAVE_MACHINE_ASM_H | ||
1302 | +#include <machine/asm.h> | ||
1303 | +#else | ||
1304 | +#ifdef __USER_LABEL_PREFIX__ | ||
1305 | +#define CONCAT1(a, b) CONCAT2(a, b) | ||
1306 | +#define CONCAT2(a, b) a ## b | ||
1307 | + | ||
1308 | +/* Use the right prefix for global labels. */ | ||
1309 | +#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) | ||
1310 | +#else | ||
1311 | +#define CNAME(x) x | ||
1312 | +#endif | ||
1313 | +#endif | ||
1314 | + | ||
1315 | +#define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off | ||
1316 | +#define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off | ||
1317 | +#define cfi_restore(reg) .cfi_restore reg | ||
1318 | +#define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg | ||
1319 | + | ||
1320 | + .text | ||
1321 | + .globl CNAME(ffi_call_SYSV) | ||
1322 | +#ifdef __ELF__ | ||
1323 | + .type CNAME(ffi_call_SYSV), #function | ||
1324 | +#endif | ||
1325 | +#ifdef __APPLE__ | ||
1326 | + .align 2 | ||
1327 | +#endif | ||
1328 | + | ||
1329 | +/* ffi_call_SYSV() | ||
1330 | + | ||
1331 | + Create a stack frame, setup an argument context, call the callee | ||
1332 | + and extract the result. | ||
1333 | + | ||
1334 | + The maximum required argument stack size is provided, | ||
1335 | + ffi_call_SYSV() allocates that stack space then calls the | ||
1336 | + prepare_fn to populate register context and stack. The | ||
1337 | + argument passing registers are loaded from the register | ||
1338 | + context and the callee called, on return the register passing | ||
1339 | + register are saved back to the context. Our caller will | ||
1340 | + extract the return value from the final state of the saved | ||
1341 | + register context. | ||
1342 | + | ||
1343 | + Prototype: | ||
1344 | + | ||
1345 | + extern unsigned | ||
1346 | + ffi_call_SYSV (void (*)(struct call_context *context, unsigned char *, | ||
1347 | + extended_cif *), | ||
1348 | + struct call_context *context, | ||
1349 | + extended_cif *, | ||
1350 | + size_t required_stack_size, | ||
1351 | + void (*fn)(void)); | ||
1352 | + | ||
1353 | + Therefore on entry we have: | ||
1354 | + | ||
1355 | + x0 prepare_fn | ||
1356 | + x1 &context | ||
1357 | + x2 &ecif | ||
1358 | + x3 bytes | ||
1359 | + x4 fn | ||
1360 | + | ||
1361 | + This function uses the following stack frame layout: | ||
1362 | + | ||
1363 | + == | ||
1364 | + saved x30(lr) | ||
1365 | + x29(fp)-> saved x29(fp) | ||
1366 | + saved x24 | ||
1367 | + saved x23 | ||
1368 | + saved x22 | ||
1369 | + sp' -> saved x21 | ||
1370 | + ... | ||
1371 | + sp -> (constructed callee stack arguments) | ||
1372 | + == | ||
1373 | + | ||
1374 | + Voila! */ | ||
1375 | + | ||
1376 | +#define ffi_call_SYSV_FS (8 * 4) | ||
1377 | + | ||
1378 | + .cfi_startproc | ||
1379 | +CNAME(ffi_call_SYSV): | ||
1380 | + stp x29, x30, [sp, #-16]! | ||
1381 | + cfi_adjust_cfa_offset (16) | ||
1382 | + cfi_rel_offset (x29, 0) | ||
1383 | + cfi_rel_offset (x30, 8) | ||
1384 | + | ||
1385 | + mov x29, sp | ||
1386 | + cfi_def_cfa_register (x29) | ||
1387 | + sub sp, sp, #ffi_call_SYSV_FS | ||
1388 | + | ||
1389 | + stp x21, x22, [sp, #0] | ||
1390 | + cfi_rel_offset (x21, 0 - ffi_call_SYSV_FS) | ||
1391 | + cfi_rel_offset (x22, 8 - ffi_call_SYSV_FS) | ||
1392 | + | ||
1393 | + stp x23, x24, [sp, #16] | ||
1394 | + cfi_rel_offset (x23, 16 - ffi_call_SYSV_FS) | ||
1395 | + cfi_rel_offset (x24, 24 - ffi_call_SYSV_FS) | ||
1396 | + | ||
1397 | + mov x21, x1 | ||
1398 | + mov x22, x2 | ||
1399 | + mov x24, x4 | ||
1400 | + | ||
1401 | + /* Allocate the stack space for the actual arguments, many | ||
1402 | + arguments will be passed in registers, but we assume | ||
1403 | + worst case and allocate sufficient stack for ALL of | ||
1404 | + the arguments. */ | ||
1405 | + sub sp, sp, x3 | ||
1406 | + | ||
1407 | + /* unsigned (*prepare_fn) (struct call_context *context, | ||
1408 | + unsigned char *stack, extended_cif *ecif); | ||
1409 | + */ | ||
1410 | + mov x23, x0 | ||
1411 | + mov x0, x1 | ||
1412 | + mov x1, sp | ||
1413 | + /* x2 already in place */ | ||
1414 | + blr x23 | ||
1415 | + | ||
1416 | + /* Preserve the flags returned. */ | ||
1417 | + mov x23, x0 | ||
1418 | + | ||
1419 | + /* Figure out if we should touch the vector registers. */ | ||
1420 | + tbz x23, #AARCH64_FFI_WITH_V_BIT, 1f | ||
1421 | + | ||
1422 | + /* Load the vector argument passing registers. */ | ||
1423 | + ldp q0, q1, [x21, #8*32 + 0] | ||
1424 | + ldp q2, q3, [x21, #8*32 + 32] | ||
1425 | + ldp q4, q5, [x21, #8*32 + 64] | ||
1426 | + ldp q6, q7, [x21, #8*32 + 96] | ||
1427 | +1: | ||
1428 | + /* Load the core argument passing registers. */ | ||
1429 | + ldp x0, x1, [x21, #0] | ||
1430 | + ldp x2, x3, [x21, #16] | ||
1431 | + ldp x4, x5, [x21, #32] | ||
1432 | + ldp x6, x7, [x21, #48] | ||
1433 | + | ||
1434 | + /* Don't forget x8 which may be holding the address of a return buffer. | ||
1435 | + */ | ||
1436 | + ldr x8, [x21, #8*8] | ||
1437 | + | ||
1438 | + blr x24 | ||
1439 | + | ||
1440 | + /* Save the core argument passing registers. */ | ||
1441 | + stp x0, x1, [x21, #0] | ||
1442 | + stp x2, x3, [x21, #16] | ||
1443 | + stp x4, x5, [x21, #32] | ||
1444 | + stp x6, x7, [x21, #48] | ||
1445 | + | ||
1446 | + /* Note nothing useful ever comes back in x8! */ | ||
1447 | + | ||
1448 | + /* Figure out if we should touch the vector registers. */ | ||
1449 | + tbz x23, #AARCH64_FFI_WITH_V_BIT, 1f | ||
1450 | + | ||
1451 | + /* Save the vector argument passing registers. */ | ||
1452 | + stp q0, q1, [x21, #8*32 + 0] | ||
1453 | + stp q2, q3, [x21, #8*32 + 32] | ||
1454 | + stp q4, q5, [x21, #8*32 + 64] | ||
1455 | + stp q6, q7, [x21, #8*32 + 96] | ||
1456 | +1: | ||
1457 | + /* All done, unwind our stack frame. */ | ||
1458 | + ldp x21, x22, [x29, # - ffi_call_SYSV_FS] | ||
1459 | + cfi_restore (x21) | ||
1460 | + cfi_restore (x22) | ||
1461 | + | ||
1462 | + ldp x23, x24, [x29, # - ffi_call_SYSV_FS + 16] | ||
1463 | + cfi_restore (x23) | ||
1464 | + cfi_restore (x24) | ||
1465 | + | ||
1466 | + mov sp, x29 | ||
1467 | + cfi_def_cfa_register (sp) | ||
1468 | + | ||
1469 | + ldp x29, x30, [sp], #16 | ||
1470 | + cfi_adjust_cfa_offset (-16) | ||
1471 | + cfi_restore (x29) | ||
1472 | + cfi_restore (x30) | ||
1473 | + | ||
1474 | + ret | ||
1475 | + | ||
1476 | + .cfi_endproc | ||
1477 | +#ifdef __ELF__ | ||
1478 | + .size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV) | ||
1479 | +#endif | ||
1480 | + | ||
1481 | +#define ffi_closure_SYSV_FS (8 * 2 + AARCH64_CALL_CONTEXT_SIZE) | ||
1482 | + | ||
1483 | +/* ffi_closure_SYSV | ||
1484 | + | ||
1485 | + Closure invocation glue. This is the low level code invoked directly by | ||
1486 | + the closure trampoline to setup and call a closure. | ||
1487 | + | ||
1488 | + On entry x17 points to a struct trampoline_data, x16 has been clobbered | ||
1489 | + all other registers are preserved. | ||
1490 | + | ||
1491 | + We allocate a call context and save the argument passing registers, | ||
1492 | + then invoked the generic C ffi_closure_SYSV_inner() function to do all | ||
1493 | + the real work, on return we load the result passing registers back from | ||
1494 | + the call context. | ||
1495 | + | ||
1496 | + On entry | ||
1497 | + | ||
1498 | + extern void | ||
1499 | + ffi_closure_SYSV (struct trampoline_data *); | ||
1500 | + | ||
1501 | + struct trampoline_data | ||
1502 | + { | ||
1503 | + UINT64 *ffi_closure; | ||
1504 | + UINT64 flags; | ||
1505 | + }; | ||
1506 | + | ||
1507 | + This function uses the following stack frame layout: | ||
1508 | + | ||
1509 | + == | ||
1510 | + saved x30(lr) | ||
1511 | + x29(fp)-> saved x29(fp) | ||
1512 | + saved x22 | ||
1513 | + saved x21 | ||
1514 | + ... | ||
1515 | + sp -> call_context | ||
1516 | + == | ||
1517 | + | ||
1518 | + Voila! */ | ||
1519 | + | ||
1520 | + .text | ||
1521 | + .globl CNAME(ffi_closure_SYSV) | ||
1522 | +#ifdef __APPLE__ | ||
1523 | + .align 2 | ||
1524 | +#endif | ||
1525 | + .cfi_startproc | ||
1526 | +CNAME(ffi_closure_SYSV): | ||
1527 | + stp x29, x30, [sp, #-16]! | ||
1528 | + cfi_adjust_cfa_offset (16) | ||
1529 | + cfi_rel_offset (x29, 0) | ||
1530 | + cfi_rel_offset (x30, 8) | ||
1531 | + | ||
1532 | + mov x29, sp | ||
1533 | + cfi_def_cfa_register (x29) | ||
1534 | + | ||
1535 | + sub sp, sp, #ffi_closure_SYSV_FS | ||
1536 | + | ||
1537 | + stp x21, x22, [x29, #-16] | ||
1538 | + cfi_rel_offset (x21, -16) | ||
1539 | + cfi_rel_offset (x22, -8) | ||
1540 | + | ||
1541 | + /* Load x21 with &call_context. */ | ||
1542 | + mov x21, sp | ||
1543 | + /* Preserve our struct trampoline_data * */ | ||
1544 | + mov x22, x17 | ||
1545 | + | ||
1546 | + /* Save the rest of the argument passing registers. */ | ||
1547 | + stp x0, x1, [x21, #0] | ||
1548 | + stp x2, x3, [x21, #16] | ||
1549 | + stp x4, x5, [x21, #32] | ||
1550 | + stp x6, x7, [x21, #48] | ||
1551 | + /* Don't forget we may have been given a result scratch pad address. | ||
1552 | + */ | ||
1553 | + str x8, [x21, #64] | ||
1554 | + | ||
1555 | + /* Figure out if we should touch the vector registers. */ | ||
1556 | + ldr x0, [x22, #8] | ||
1557 | + tbz x0, #AARCH64_FFI_WITH_V_BIT, 1f | ||
1558 | + | ||
1559 | + /* Save the argument passing vector registers. */ | ||
1560 | + stp q0, q1, [x21, #8*32 + 0] | ||
1561 | + stp q2, q3, [x21, #8*32 + 32] | ||
1562 | + stp q4, q5, [x21, #8*32 + 64] | ||
1563 | + stp q6, q7, [x21, #8*32 + 96] | ||
1564 | +1: | ||
1565 | + /* Load &ffi_closure.. */ | ||
1566 | + ldr x0, [x22, #0] | ||
1567 | + mov x1, x21 | ||
1568 | + /* Compute the location of the stack at the point that the | ||
1569 | + trampoline was called. */ | ||
1570 | + add x2, x29, #16 | ||
1571 | + | ||
1572 | + bl CNAME(ffi_closure_SYSV_inner) | ||
1573 | + | ||
1574 | + /* Figure out if we should touch the vector registers. */ | ||
1575 | + ldr x0, [x22, #8] | ||
1576 | + tbz x0, #AARCH64_FFI_WITH_V_BIT, 1f | ||
1577 | + | ||
1578 | + /* Load the result passing vector registers. */ | ||
1579 | + ldp q0, q1, [x21, #8*32 + 0] | ||
1580 | + ldp q2, q3, [x21, #8*32 + 32] | ||
1581 | + ldp q4, q5, [x21, #8*32 + 64] | ||
1582 | + ldp q6, q7, [x21, #8*32 + 96] | ||
1583 | +1: | ||
1584 | + /* Load the result passing core registers. */ | ||
1585 | + ldp x0, x1, [x21, #0] | ||
1586 | + ldp x2, x3, [x21, #16] | ||
1587 | + ldp x4, x5, [x21, #32] | ||
1588 | + ldp x6, x7, [x21, #48] | ||
1589 | + /* Note nothing useful is returned in x8. */ | ||
1590 | + | ||
1591 | + /* We are done, unwind our frame. */ | ||
1592 | + ldp x21, x22, [x29, #-16] | ||
1593 | + cfi_restore (x21) | ||
1594 | + cfi_restore (x22) | ||
1595 | + | ||
1596 | + mov sp, x29 | ||
1597 | + cfi_def_cfa_register (sp) | ||
1598 | + | ||
1599 | + ldp x29, x30, [sp], #16 | ||
1600 | + cfi_adjust_cfa_offset (-16) | ||
1601 | + cfi_restore (x29) | ||
1602 | + cfi_restore (x30) | ||
1603 | + | ||
1604 | + ret | ||
1605 | + .cfi_endproc | ||
1606 | +#ifdef __ELF__ | ||
1607 | + .size CNAME(ffi_closure_SYSV), .-CNAME(ffi_closure_SYSV) | ||
1608 | +#endif | ||
diff --git a/meta/recipes-devtools/python/python/multilib.patch b/meta/recipes-devtools/python/python/multilib.patch new file mode 100644 index 0000000000..df470f7c09 --- /dev/null +++ b/meta/recipes-devtools/python/python/multilib.patch | |||
@@ -0,0 +1,257 @@ | |||
1 | commit 248279e54467a8cd5cde98fc124d1d1384703513 | ||
2 | Author: Yu Ke <ke.yu@intel.com> | ||
3 | Date: 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 | 2011/09/29 | ||
14 | Rebased for python 2.7.2 | ||
15 | |||
16 | Upstream-Status: Inappropriate [configuration] | ||
17 | |||
18 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
19 | |||
20 | Index: 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); | ||
32 | Index: 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', | ||
54 | Index: 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: | ||
72 | Index: 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', | ||
85 | Index: 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. | ||
112 | Index: 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 | ] | ||
130 | Index: 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) | ||
147 | Index: 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 | ||
185 | Index: 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) | ||
212 | Index: 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 | +} | ||
230 | Index: 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", | ||
243 | Index: Python-2.7.2/configure.in | ||
244 | =================================================================== | ||
245 | --- Python-2.7.2.orig/configure.in | ||
246 | +++ Python-2.7.2/configure.in | ||
247 | @@ -629,6 +629,10 @@ SunOS*) | ||
248 | ;; | ||
249 | esac | ||
250 | |||
251 | +AC_SUBST(LIB) | ||
252 | +AC_MSG_CHECKING(LIB) | ||
253 | +LIB=`basename ${libdir}` | ||
254 | +AC_MSG_RESULT($LIB) | ||
255 | |||
256 | AC_SUBST(LIBRARY) | ||
257 | AC_MSG_CHECKING(LIBRARY) | ||
diff --git a/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch b/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch new file mode 100644 index 0000000000..951cb466ff --- /dev/null +++ b/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | When using make -j with the 'install' target, it's possible for altbininstall | ||
2 | (which normally creates BINDIR) and libainstall (which doesn't, though it | ||
3 | installs python-config there) to race, resulting in a failure due to | ||
4 | attempting to install python-config into a nonexistent BINDIR. Ensure it also | ||
5 | exists in the libainstall target. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | --- Python-2.7.3.orig/Makefile.pre.in | ||
10 | +++ Python-2.7.3/Makefile.pre.in | ||
11 | @@ -1008,7 +1008,7 @@ LIBPL= $(LIBP)/config | ||
12 | LIBPC= $(LIBDIR)/pkgconfig | ||
13 | |||
14 | libainstall: all python-config | ||
15 | - @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \ | ||
16 | + @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC) $(BINDIR); \ | ||
17 | do \ | ||
18 | if test ! -d $(DESTDIR)$$i; then \ | ||
19 | echo "Creating directory $$i"; \ | ||
diff --git a/meta/recipes-devtools/python/python/posix_close.patch b/meta/recipes-devtools/python/python/posix_close.patch new file mode 100644 index 0000000000..725531a240 --- /dev/null +++ b/meta/recipes-devtools/python/python/posix_close.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | backport from http://bugs.python.org/issue20594 | ||
2 | |||
3 | - Issue #20594: Avoid name clash with the libc function posix_close. | ||
4 | |||
5 | Upstream-Status: Backport | ||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
7 | |||
8 | |||
9 | # HG changeset patch | ||
10 | # User Benjamin Peterson <benjamin@python.org> | ||
11 | # Date 1392131776 18000 | ||
12 | # Node ID 1d253360d5a6d8d987fb2480e26f4fcc2d730932 | ||
13 | # Parent 41e49f1c5bd8ff48a6c18804c958e82c659daab3 | ||
14 | avoid name clash with posix_close (closes #20594) | ||
15 | |||
16 | diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c | ||
17 | --- a/Modules/posixmodule.c | ||
18 | +++ b/Modules/posixmodule.c | ||
19 | @@ -6581,8 +6581,12 @@ PyDoc_STRVAR(posix_close__doc__, | ||
20 | "close(fd)\n\n\ | ||
21 | Close a file descriptor (for low level IO)."); | ||
22 | |||
23 | -static PyObject * | ||
24 | -posix_close(PyObject *self, PyObject *args) | ||
25 | +/* | ||
26 | +The underscore at end of function name avoids a name clash with the libc | ||
27 | +function posix_close. | ||
28 | +*/ | ||
29 | +static PyObject * | ||
30 | +posix_close_(PyObject *self, PyObject *args) | ||
31 | { | ||
32 | int fd, res; | ||
33 | if (!PyArg_ParseTuple(args, "i:close", &fd)) | ||
34 | @@ -8960,7 +8964,7 @@ static PyMethodDef posix_methods[] = { | ||
35 | {"tcsetpgrp", posix_tcsetpgrp, METH_VARARGS, posix_tcsetpgrp__doc__}, | ||
36 | #endif /* HAVE_TCSETPGRP */ | ||
37 | {"open", posix_open, METH_VARARGS, posix_open__doc__}, | ||
38 | - {"close", posix_close, METH_VARARGS, posix_close__doc__}, | ||
39 | + {"close", posix_close_, METH_VARARGS, posix_close__doc__}, | ||
40 | {"closerange", posix_closerange, METH_VARARGS, posix_closerange__doc__}, | ||
41 | {"dup", posix_dup, METH_VARARGS, posix_dup__doc__}, | ||
42 | {"dup2", posix_dup2, METH_VARARGS, posix_dup2__doc__}, | ||
43 | |||
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 | ||
7 | create the .pypirc securely | ||
8 | |||
9 | Upstream-Status: Backport | ||
10 | |||
11 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
12 | |||
13 | |||
14 | diff -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 @@ | |||
1 | Upstream-Status: Backport | ||
2 | |||
3 | Reference:http://bugs.python.org/issue14579 | ||
4 | |||
5 | The utf-16 decoder in Python 3.1 through 3.3 does not update the | ||
6 | aligned_end variable after calling the unicode_decode_call_errorhandler | ||
7 | function, which allows remote attackers to obtain sensitive information | ||
8 | (process memory) or cause a denial of service (memory corruption and crash) | ||
9 | via unspecified vectors. | ||
10 | |||
11 | http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-2135 | ||
12 | |||
13 | diff -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" | ||
62 | diff -urpN a/Objects/unicodeobject.c b/Objects/unicodeobject.c | ||
63 | --- a/Objects/unicodeobject.c 2013-03-04 11:34:34.000000000 +0800 | ||
64 | +++ b/Objects/unicodeobject.c 2013-03-04 11:36:01.000000000 +0800 | ||
65 | @@ -2564,7 +2564,7 @@ PyUnicode_DecodeUTF16Stateful(const char | ||
66 | } | ||
67 | |||
68 | /* UTF-16 code pair: */ | ||
69 | - if (q >= e) { | ||
70 | + if (e - q < 2) { | ||
71 | errmsg = "unexpected end of data"; | ||
72 | startinpos = (((const char *)q)-2)-starts; | ||
73 | endinpos = ((const char *)e)-starts; | ||
diff --git a/meta/recipes-devtools/python/python/python-2.7.3-CVE-2013-1752-smtplib-fix.patch b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2013-1752-smtplib-fix.patch new file mode 100644 index 0000000000..f34ff40ea5 --- /dev/null +++ b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2013-1752-smtplib-fix.patch | |||
@@ -0,0 +1,101 @@ | |||
1 | Upstream-Status: Backport | ||
2 | |||
3 | Reference: http://bugs.python.org/issue16042 | ||
4 | |||
5 | CVE-2013-1752: smtplib: Limit amount of data read by limiting the | ||
6 | call to readline(). Original patch by Christian Heimes | ||
7 | |||
8 | Signed-off-by: Maxin B. John <maxin.john@enea.com> | ||
9 | --- | ||
10 | diff -Naur Python-2.7.3-orig/Lib/smtplib.py Python-2.7.3/Lib/smtplib.py | ||
11 | --- Python-2.7.3-orig/Lib/smtplib.py 2012-04-10 01:07:31.000000000 +0200 | ||
12 | +++ Python-2.7.3/Lib/smtplib.py 2014-02-27 14:15:24.444198465 +0100 | ||
13 | @@ -57,6 +57,7 @@ | ||
14 | SMTP_PORT = 25 | ||
15 | SMTP_SSL_PORT = 465 | ||
16 | CRLF = "\r\n" | ||
17 | +_MAXLINE = 8192 # more than 8 times larger than RFC 821, 4.5.3 | ||
18 | |||
19 | OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I) | ||
20 | |||
21 | @@ -179,10 +180,14 @@ | ||
22 | def __init__(self, sslobj): | ||
23 | self.sslobj = sslobj | ||
24 | |||
25 | - def readline(self): | ||
26 | + def readline(self, size=-1): | ||
27 | + if size < 0: | ||
28 | + size = None | ||
29 | str = "" | ||
30 | chr = None | ||
31 | while chr != "\n": | ||
32 | + if size is not None and len(str) >= size: | ||
33 | + break | ||
34 | chr = self.sslobj.read(1) | ||
35 | if not chr: | ||
36 | break | ||
37 | @@ -351,7 +356,7 @@ | ||
38 | self.file = self.sock.makefile('rb') | ||
39 | while 1: | ||
40 | try: | ||
41 | - line = self.file.readline() | ||
42 | + line = self.file.readline(_MAXLINE + 1) | ||
43 | except socket.error as e: | ||
44 | self.close() | ||
45 | raise SMTPServerDisconnected("Connection unexpectedly closed: " | ||
46 | @@ -361,6 +366,8 @@ | ||
47 | raise SMTPServerDisconnected("Connection unexpectedly closed") | ||
48 | if self.debuglevel > 0: | ||
49 | print>>stderr, 'reply:', repr(line) | ||
50 | + if len(line) > _MAXLINE: | ||
51 | + raise SMTPResponseException(500, "Line too long.") | ||
52 | resp.append(line[4:].strip()) | ||
53 | code = line[:3] | ||
54 | # Check that the error code is syntactically correct. | ||
55 | diff -Naur Python-2.7.3-orig/Lib/test/test_smtplib.py Python-2.7.3/Lib/test/test_smtplib.py | ||
56 | --- Python-2.7.3-orig/Lib/test/test_smtplib.py 2012-04-10 01:07:32.000000000 +0200 | ||
57 | +++ Python-2.7.3/Lib/test/test_smtplib.py 2014-02-27 14:15:24.448198293 +0100 | ||
58 | @@ -292,6 +292,33 @@ | ||
59 | HOST, self.port, 'localhost', 3) | ||
60 | |||
61 | |||
62 | +@unittest.skipUnless(threading, 'Threading required for this test.') | ||
63 | +class TooLongLineTests(unittest.TestCase): | ||
64 | + respdata = '250 OK' + ('.' * smtplib._MAXLINE * 2) + '\n' | ||
65 | + | ||
66 | + def setUp(self): | ||
67 | + self.old_stdout = sys.stdout | ||
68 | + self.output = StringIO.StringIO() | ||
69 | + sys.stdout = self.output | ||
70 | + | ||
71 | + self.evt = threading.Event() | ||
72 | + self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
73 | + self.sock.settimeout(15) | ||
74 | + self.port = test_support.bind_port(self.sock) | ||
75 | + servargs = (self.evt, self.respdata, self.sock) | ||
76 | + threading.Thread(target=server, args=servargs).start() | ||
77 | + self.evt.wait() | ||
78 | + self.evt.clear() | ||
79 | + | ||
80 | + def tearDown(self): | ||
81 | + self.evt.wait() | ||
82 | + sys.stdout = self.old_stdout | ||
83 | + | ||
84 | + def testLineTooLong(self): | ||
85 | + self.assertRaises(smtplib.SMTPResponseException, smtplib.SMTP, | ||
86 | + HOST, self.port, 'localhost', 3) | ||
87 | + | ||
88 | + | ||
89 | sim_users = {'Mr.A@somewhere.com':'John A', | ||
90 | 'Ms.B@somewhere.com':'Sally B', | ||
91 | 'Mrs.C@somewhereesle.com':'Ruth C', | ||
92 | @@ -511,7 +538,8 @@ | ||
93 | def test_main(verbose=None): | ||
94 | test_support.run_unittest(GeneralTests, DebuggingServerTests, | ||
95 | NonConnectingTests, | ||
96 | - BadHELOServerTests, SMTPSimTests) | ||
97 | + BadHELOServerTests, SMTPSimTests, | ||
98 | + TooLongLineTests) | ||
99 | |||
100 | if __name__ == '__main__': | ||
101 | test_main() | ||
diff --git a/meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-1912.patch b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-1912.patch new file mode 100644 index 0000000000..02cc83d314 --- /dev/null +++ b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-1912.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Upstream-Status: Backport | ||
2 | |||
3 | Reference: http://bugs.python.org/issue20246 | ||
4 | |||
5 | CVE-2014-1912: Python buffer overflow in socket.recvfrom_into() | ||
6 | lets remote users execute arbitrary code.Original patch by Benjamin Peterson | ||
7 | |||
8 | Signed-off-by: Maxin B. John <maxin.john@enea.com> | ||
9 | --- | ||
10 | diff -r 40fb60df4755 Modules/socketmodule.c | ||
11 | --- a/Modules/socketmodule.c Sun Jan 12 12:11:47 2014 +0200 | ||
12 | +++ b/Modules/socketmodule.c Mon Jan 13 16:36:35 2014 -0800 | ||
13 | @@ -2744,6 +2744,13 @@ | ||
14 | recvlen = buflen; | ||
15 | } | ||
16 | |||
17 | + /* Check if the buffer is large enough */ | ||
18 | + if (buflen < recvlen) { | ||
19 | + PyErr_SetString(PyExc_ValueError, | ||
20 | + "buffer too small for requested bytes"); | ||
21 | + goto error; | ||
22 | + } | ||
23 | + | ||
24 | readlen = sock_recvfrom_guts(s, buf.buf, recvlen, flags, &addr); | ||
25 | if (readlen < 0) { | ||
26 | /* Return an error */ | ||
diff --git a/meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-7185.patch b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-7185.patch new file mode 100644 index 0000000000..60ef145c7c --- /dev/null +++ b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-7185.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | From 104eb318283dde5203aa6cf7384287bef181e308 Mon Sep 17 00:00:00 2001 | ||
2 | From: Wenzong Fan <wenzong.fan@windriver.com> | ||
3 | Date: Wed, 12 Nov 2014 01:58:02 -0500 | ||
4 | Subject: [PATCH] python: fix CVE-2014-7185 | ||
5 | |||
6 | Reference: http://bugs.python.org/issue21831 | ||
7 | |||
8 | CVE-2014-7185: Integer overflow in bufferobject.c in Python before | ||
9 | 2.7.8 allows context-dependent attackers to obtain sensitive | ||
10 | information from process memory via a large size and offset in a | ||
11 | "buffer" function. | ||
12 | |||
13 | Upstream-Status: Backport | ||
14 | |||
15 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> | ||
16 | --- | ||
17 | Lib/test/test_buffer.py | 6 ++++++ | ||
18 | Misc/NEWS | 3 +++ | ||
19 | Objects/bufferobject.c | 2 +- | ||
20 | 3 files changed, 10 insertions(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py | ||
23 | index 6bdc34d..3ac1f8c 100644 | ||
24 | --- a/Lib/test/test_buffer.py | ||
25 | +++ b/Lib/test/test_buffer.py | ||
26 | @@ -4,6 +4,7 @@ For now, tests just new or changed functionality. | ||
27 | |||
28 | """ | ||
29 | |||
30 | +import sys | ||
31 | import unittest | ||
32 | from test import test_support | ||
33 | |||
34 | @@ -21,6 +22,11 @@ class BufferTests(unittest.TestCase): | ||
35 | self.assertEqual(b[start:stop:step], | ||
36 | s[start:stop:step]) | ||
37 | |||
38 | + def test_large_buffer_size_and_offset(self): | ||
39 | + data = bytearray('hola mundo') | ||
40 | + buf = buffer(data, sys.maxsize, sys.maxsize) | ||
41 | + self.assertEqual(buf[:4096], "") | ||
42 | + | ||
43 | |||
44 | def test_main(): | ||
45 | with test_support.check_py3k_warnings(("buffer.. not supported", | ||
46 | diff --git a/Misc/NEWS b/Misc/NEWS | ||
47 | index e8778ad..77396c5 100644 | ||
48 | --- a/Misc/NEWS | ||
49 | +++ b/Misc/NEWS | ||
50 | @@ -1896,6 +1896,9 @@ What's New in Python 2.7 Release Candidate 1? | ||
51 | Core and Builtins | ||
52 | ----------------- | ||
53 | |||
54 | +- Issue #21831: Avoid integer overflow when large sizes and offsets are given to | ||
55 | + the buffer type. CVE-2014-7185. | ||
56 | + | ||
57 | - Issue #8271: during the decoding of an invalid UTF-8 byte sequence, only the | ||
58 | start byte and the continuation byte(s) are now considered invalid, instead | ||
59 | of the number of bytes specified by the start byte. | ||
60 | diff --git a/Objects/bufferobject.c b/Objects/bufferobject.c | ||
61 | index c52f0bc..c542506 100644 | ||
62 | --- a/Objects/bufferobject.c | ||
63 | +++ b/Objects/bufferobject.c | ||
64 | @@ -88,7 +88,7 @@ get_buf(PyBufferObject *self, void **ptr, Py_ssize_t *size, | ||
65 | *size = count; | ||
66 | else | ||
67 | *size = self->b_size; | ||
68 | - if (offset + *size > count) | ||
69 | + if (*size > count - offset) | ||
70 | *size = count - offset; | ||
71 | } | ||
72 | return 1; | ||
73 | -- | ||
74 | 1.7.9.5 | ||
75 | |||
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 @@ | |||
1 | Upstream-Status: Inappropriate [not author] | ||
2 | |||
3 | Fix to support db 5.3 for bsddb module in python 2.7.2 | ||
4 | |||
5 | This patch is made from the db5.1.diff in | ||
6 | http://archive.ubuntu.com/ubuntu/pool/main/p/python2.7/python2.7_2.7.3-0ubuntu3.diff.gz | ||
7 | |||
8 | Signed-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 | |||
18 | diff --git a/Lib/bsddb/__init__.py b/Lib/bsddb/__init__.py | ||
19 | index 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. | ||
31 | diff --git a/Lib/bsddb/test/test_all.py b/Lib/bsddb/test/test_all.py | ||
32 | index 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() : | ||
54 | diff --git a/Lib/bsddb/test/test_dbenv.py b/Lib/bsddb/test/test_dbenv.py | ||
55 | index 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 | ||
114 | diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c | ||
115 | index 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"); | ||
1436 | diff --git a/Modules/bsddb.h b/Modules/bsddb.h | ||
1437 | index 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 | |||
1506 | diff --git a/setup.py b/setup.py | ||
1507 | index 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 | -- | ||
1571 | 1.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 @@ | |||
1 | Upstream-Status: Inappropriate [embedded specific] | ||
2 | |||
3 | Remove the RPATH to avoid QA issue warning. | ||
4 | |||
5 | RP: Added secondary unnecessary rpath to the list 2012/8/7 | ||
6 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
7 | |||
8 | |||
9 | Index: Python-2.7.3/setup.py | ||
10 | =================================================================== | ||
11 | --- Python-2.7.3.orig/setup.py 2012-08-07 10:41:58.560132529 +0000 | ||
12 | +++ Python-2.7.3/setup.py 2012-08-07 11:09:47.852094515 +0000 | ||
13 | @@ -1042,7 +1042,6 @@ | ||
14 | exts.append(Extension('_bsddb', ['_bsddb.c'], | ||
15 | depends = ['bsddb.h'], | ||
16 | library_dirs=dblib_dir, | ||
17 | - runtime_library_dirs=dblib_dir, | ||
18 | include_dirs=db_incs, | ||
19 | libraries=dblibs)) | ||
20 | else: | ||
21 | @@ -1252,7 +1251,6 @@ | ||
22 | print "building dbm using bdb" | ||
23 | dbmext = Extension('dbm', ['dbmmodule.c'], | ||
24 | library_dirs=dblib_dir, | ||
25 | - runtime_library_dirs=dblib_dir, | ||
26 | include_dirs=db_incs, | ||
27 | define_macros=[ | ||
28 | ('HAVE_BERKDB_H', None), | ||
diff --git a/meta/recipes-devtools/python/python/python-fix-build-error-with-Readline-6.3.patch b/meta/recipes-devtools/python/python/python-fix-build-error-with-Readline-6.3.patch new file mode 100644 index 0000000000..b84f8c3461 --- /dev/null +++ b/meta/recipes-devtools/python/python/python-fix-build-error-with-Readline-6.3.patch | |||
@@ -0,0 +1,62 @@ | |||
1 | python: fix build error with Readline 6.3 | ||
2 | |||
3 | Backport two patches from upstream: | ||
4 | |||
5 | use new readline function types (closes #20374) | ||
6 | Issue #20374: Avoid compiler warnings when compiling readline with libedit. | ||
7 | |||
8 | Upstream-Status: Backport | ||
9 | |||
10 | Signed-off-by: Chong Lu <Chong.Lu@windriver.com> | ||
11 | --- | ||
12 | Modules/readline.c | 15 ++++++++++++--- | ||
13 | 1 file changed, 12 insertions(+), 3 deletions(-) | ||
14 | |||
15 | diff --git a/Modules/readline.c b/Modules/readline.c | ||
16 | index b5e258d..d3f52aa 100644 | ||
17 | --- a/Modules/readline.c | ||
18 | +++ b/Modules/readline.c | ||
19 | @@ -735,15 +735,24 @@ on_hook(PyObject *func) | ||
20 | return result; | ||
21 | } | ||
22 | |||
23 | + | ||
24 | static int | ||
25 | +#if defined(_RL_FUNCTION_TYPEDEF) | ||
26 | on_startup_hook(void) | ||
27 | +#else | ||
28 | +on_startup_hook() | ||
29 | +#endif | ||
30 | { | ||
31 | return on_hook(startup_hook); | ||
32 | } | ||
33 | |||
34 | #ifdef HAVE_RL_PRE_INPUT_HOOK | ||
35 | static int | ||
36 | +#if defined(_RL_FUNCTION_TYPEDEF) | ||
37 | on_pre_input_hook(void) | ||
38 | +#else | ||
39 | +on_pre_input_hook() | ||
40 | +#endif | ||
41 | { | ||
42 | return on_hook(pre_input_hook); | ||
43 | } | ||
44 | @@ -886,12 +895,12 @@ setup_readline(void) | ||
45 | rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap); | ||
46 | rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap); | ||
47 | /* Set our hook functions */ | ||
48 | - rl_startup_hook = (Function *)on_startup_hook; | ||
49 | + rl_startup_hook = (rl_hook_func_t *)on_startup_hook; | ||
50 | #ifdef HAVE_RL_PRE_INPUT_HOOK | ||
51 | - rl_pre_input_hook = (Function *)on_pre_input_hook; | ||
52 | + rl_pre_input_hook = (rl_hook_func_t *)on_pre_input_hook; | ||
53 | #endif | ||
54 | /* Set our completion function */ | ||
55 | - rl_attempted_completion_function = (CPPFunction *)flex_complete; | ||
56 | + rl_attempted_completion_function = (rl_completion_func_t *)flex_complete; | ||
57 | /* Set Python word break characters */ | ||
58 | rl_completer_word_break_characters = | ||
59 | strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?"); | ||
60 | -- | ||
61 | 1.7.9.5 | ||
62 | |||
diff --git a/meta/recipes-devtools/python/python/python2.7.3-nossl3.patch b/meta/recipes-devtools/python/python/python2.7.3-nossl3.patch new file mode 100644 index 0000000000..2d35520a6d --- /dev/null +++ b/meta/recipes-devtools/python/python/python2.7.3-nossl3.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | python: Building without SSLv3 support | ||
2 | |||
3 | Building without SSLv3 support when openssl is built | ||
4 | without any support for SSLv3 | ||
5 | |||
6 | Upstream-Status: Backport | ||
7 | |||
8 | Reference: | ||
9 | https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=76A8611#22 | ||
10 | |||
11 | Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com> | ||
12 | --- | ||
13 | diff -ruN a/Modules/_ssl.c b/Modules/_ssl.c | ||
14 | --- a/Modules/_ssl.c 2014-11-26 07:43:58.755679939 +0100 | ||
15 | +++ b/Modules/_ssl.c 2014-11-26 07:49:10.454182400 +0100 | ||
16 | @@ -302,8 +302,10 @@ | ||
17 | PySSL_BEGIN_ALLOW_THREADS | ||
18 | if (proto_version == PY_SSL_VERSION_TLS1) | ||
19 | self->ctx = SSL_CTX_new(TLSv1_method()); /* Set up context */ | ||
20 | +#ifndef OPENSSL_NO_SSL3 | ||
21 | else if (proto_version == PY_SSL_VERSION_SSL3) | ||
22 | self->ctx = SSL_CTX_new(SSLv3_method()); /* Set up context */ | ||
23 | +#endif | ||
24 | #ifndef OPENSSL_NO_SSL2 | ||
25 | else if (proto_version == PY_SSL_VERSION_SSL2) | ||
26 | self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */ | ||
27 | @@ -1777,8 +1779,10 @@ | ||
28 | PyModule_AddIntConstant(m, "PROTOCOL_SSLv2", | ||
29 | PY_SSL_VERSION_SSL2); | ||
30 | #endif | ||
31 | +#ifndef OPENSSL_NO_SSL3 | ||
32 | PyModule_AddIntConstant(m, "PROTOCOL_SSLv3", | ||
33 | PY_SSL_VERSION_SSL3); | ||
34 | +#endif | ||
35 | PyModule_AddIntConstant(m, "PROTOCOL_SSLv23", | ||
36 | PY_SSL_VERSION_SSL23); | ||
37 | PyModule_AddIntConstant(m, "PROTOCOL_TLSv1", | ||
diff --git a/meta/recipes-devtools/python/python/remove_sqlite_rpath.patch b/meta/recipes-devtools/python/python/remove_sqlite_rpath.patch new file mode 100644 index 0000000000..4ec627ea51 --- /dev/null +++ b/meta/recipes-devtools/python/python/remove_sqlite_rpath.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | This patch removes the RPATH setting which contains a pointer to | ||
2 | the target relocated sysroot, which is incorrect. | ||
3 | |||
4 | Upstream-Status: Inappropriate [Embedded Specific] | ||
5 | |||
6 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
7 | |||
8 | Index: 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 | |||
5 | make -f /usr/lib/python/ptest/Makefile -k runtest-TESTS srcdir=/usr/lib/python2.7 TESTPROG=/usr/lib/python2.7/test/regrtest.py | sed -e '/\.\.\. ok/ s/^/PASS: /g' -e '/\.\.\. [ERROR|FAIL]/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g' | ||
diff --git a/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch b/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch new file mode 100644 index 0000000000..0c1f1741cb --- /dev/null +++ b/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | python should search for db.h in inc_dirs and not in a hardcoded path. | ||
2 | If db.h is found but HASHVERSION is not 2 we avoid a warning by not | ||
3 | adding this module to missing variable. | ||
4 | |||
5 | Upstream-Status: Inappropriate [distribution] | ||
6 | |||
7 | Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> | ||
8 | |||
9 | Index: 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 @@ | |||
1 | This patch skips over the 'import check' setup.py does when building | ||
2 | extensions. This generally won't work when cross-compiling. | ||
3 | |||
4 | Upstream-Status: Inappropriate [embedded-specific] | ||
5 | |||
6 | Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> | ||
7 | |||
8 | Index: 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 @@ | |||
1 | This patch removes various ways native system options can pass into the python | ||
2 | compilation and somehow break C modules. | ||
3 | |||
4 | Upstream-Status: Configuration [OE Specific] | ||
5 | |||
6 | RP 2012/04/23 | ||
7 | |||
8 | Index: 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 | |||
10 | import os | ||
11 | |||
12 | def __exithandler(): | ||
13 | try: | ||
14 | readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) ) | ||
15 | except IOError: | ||
16 | pass | ||
17 | |||
18 | def __registerExitHandler(): | ||
19 | import atexit | ||
20 | atexit.register( __exithandler ) | ||
21 | |||
22 | def __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 | |||
30 | def __enableDefaultEncoding(): | ||
31 | import sys | ||
32 | try: | ||
33 | sys.setdefaultencoding( "utf8" ) | ||
34 | except LookupError: | ||
35 | pass | ||
36 | |||
37 | import sys | ||
38 | try: | ||
39 | import rlcompleter, readline | ||
40 | except ImportError: | ||
41 | pass | ||
42 | else: | ||
43 | __enableDefaultEncoding() | ||
44 | __registerExitHandler() | ||
45 | __enableReadlineSupport() | ||
diff --git a/meta/recipes-devtools/python/python3-distribute_0.6.32.bb b/meta/recipes-devtools/python/python3-distribute_0.6.32.bb new file mode 100644 index 0000000000..0ef3a8762f --- /dev/null +++ b/meta/recipes-devtools/python/python3-distribute_0.6.32.bb | |||
@@ -0,0 +1,51 @@ | |||
1 | SUMMARY = "Download, build, install, upgrade, and uninstall Python packages" | ||
2 | HOMEPAGE = "http://packages.python.org/distribute" | ||
3 | SECTION = "devel/python" | ||
4 | LICENSE = "PSF" | ||
5 | LIC_FILES_CHKSUM = "file://setup.py;beginline=234;endline=234;md5=26f6b02022b737126d3c88838782dddb" | ||
6 | |||
7 | SRCNAME = "distribute" | ||
8 | PR = "ml5" | ||
9 | DEPENDS += "python3" | ||
10 | DEPENDS_class-native += "python3-native" | ||
11 | |||
12 | SRC_URI = " \ | ||
13 | http://pypi.python.org/packages/source/d/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \ | ||
14 | " | ||
15 | SRC_URI[md5sum] = "acb7a2da81e3612bfb1608abe4f0e568" | ||
16 | SRC_URI[sha256sum] = "8970cd1e148b5d1fea9430584aea66c45ea22d80e0933393ec49ebc388f718df" | ||
17 | |||
18 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
19 | |||
20 | # http://python-distribute.org/distribute_setup.py | ||
21 | |||
22 | # force the selection of python3 | ||
23 | #PYTHON_BASEVERSION = "3.3" | ||
24 | #PYTHON_MAJMIN = "3.3" | ||
25 | |||
26 | inherit distutils3 | ||
27 | |||
28 | DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages" | ||
29 | |||
30 | do_install_prepend() { | ||
31 | install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages | ||
32 | } | ||
33 | # | ||
34 | # The installer puts the wrong path in the setuptools.pth file. Correct it. | ||
35 | # | ||
36 | do_install_append() { | ||
37 | rm ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth | ||
38 | mv ${D}${bindir}/easy_install ${D}${bindir}/easy3_install | ||
39 | echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth | ||
40 | sed -i -e '1s|^#!.*python|#!/usr/bin/env python3|' \ | ||
41 | ${D}${PYTHON_SITEPACKAGES_DIR}/distribute-${PV}-py${PYTHON_BASEVERSION}.egg/setuptools/tests/test_resources.py | ||
42 | } | ||
43 | |||
44 | RDEPENDS_${PN} = "\ | ||
45 | python3-distutils \ | ||
46 | python3-compression \ | ||
47 | " | ||
48 | |||
49 | RPROVIDES_${PN} += "python3-setuptools" | ||
50 | |||
51 | BBCLASSEXTEND = "native" | ||
diff --git a/meta/recipes-devtools/python/python3-native_3.3.3.bb b/meta/recipes-devtools/python/python3-native_3.3.3.bb new file mode 100644 index 0000000000..9ae2a0b373 --- /dev/null +++ b/meta/recipes-devtools/python/python3-native_3.3.3.bb | |||
@@ -0,0 +1,77 @@ | |||
1 | require recipes-devtools/python/python.inc | ||
2 | |||
3 | PR = "${INC_PR}.0" | ||
4 | PYTHON_MAJMIN = "3.3" | ||
5 | DISTRO_SRC_URI ?= "file://sitecustomize.py" | ||
6 | DISTRO_SRC_URI_linuxstdbase = "" | ||
7 | SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \ | ||
8 | file://12-distutils-prefix-is-inside-staging-area.patch \ | ||
9 | file://python-config.patch \ | ||
10 | file://000-cross-compile.patch \ | ||
11 | file://020-dont-compile-python-files.patch \ | ||
12 | file://030-fixup-include-dirs.patch \ | ||
13 | file://070-dont-clean-ipkg-install.patch \ | ||
14 | file://080-distutils-dont_adjust_files.patch \ | ||
15 | file://110-enable-zlib.patch \ | ||
16 | file://130-readline-setup.patch \ | ||
17 | file://150-fix-setupterm.patch \ | ||
18 | file://python-3.3-multilib.patch \ | ||
19 | file://03-fix-tkinter-detection.patch \ | ||
20 | file://avoid_warning_about_tkinter.patch \ | ||
21 | file://06-ctypes-libffi-fix-configure.patch \ | ||
22 | file://shutil-follow-symlink-fix.patch \ | ||
23 | file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \ | ||
24 | file://sysroot-include-headers.patch \ | ||
25 | file://unixccompiler.patch \ | ||
26 | file://fix-ast.h-dependency.patch \ | ||
27 | file://makerace.patch \ | ||
28 | ${DISTRO_SRC_URI} \ | ||
29 | file://python3-fix-build-error-with-Readline-6.3.patch \ | ||
30 | " | ||
31 | SRC_URI[md5sum] = "f3ebe34d4d8695bf889279b54673e10c" | ||
32 | SRC_URI[sha256sum] = "e526e9b612f623888364d30cc9f3dfc34dcef39065c713bdbcddf47df84d8dcb" | ||
33 | |||
34 | LIC_FILES_CHKSUM = "file://LICENSE;md5=4eaea08eaaf6875189b0c49f26fa2005" | ||
35 | |||
36 | S = "${WORKDIR}/Python-${PV}" | ||
37 | |||
38 | EXTRANATIVEPATH += "bzip2-native" | ||
39 | DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native" | ||
40 | |||
41 | inherit native | ||
42 | |||
43 | RPROVIDES += "python3-distutils-native python3-compression-native python3-textutils-native python3-core-native" | ||
44 | |||
45 | EXTRA_OECONF_append = " --bindir=${bindir}/${PN}" | ||
46 | |||
47 | EXTRA_OEMAKE = '\ | ||
48 | BUILD_SYS="" \ | ||
49 | HOST_SYS="" \ | ||
50 | LIBC="" \ | ||
51 | STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \ | ||
52 | STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \ | ||
53 | LIB=${baselib} \ | ||
54 | ARCH=${TARGET_ARCH} \ | ||
55 | ' | ||
56 | |||
57 | # No ctypes option for python 3 | ||
58 | PYTHONLSBOPTS = "" | ||
59 | |||
60 | do_configure_prepend() { | ||
61 | autoreconf --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" | ||
62 | } | ||
63 | |||
64 | do_install() { | ||
65 | install -d ${D}${libdir}/pkgconfig | ||
66 | oe_runmake 'DESTDIR=${D}' install | ||
67 | if [ -e ${WORKDIR}/sitecustomize.py ]; then | ||
68 | install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} | ||
69 | fi | ||
70 | install -d ${D}${bindir}/${PN} | ||
71 | install -m 0755 Parser/pgen ${D}${bindir}/${PN} | ||
72 | |||
73 | # Make sure we use /usr/bin/env python | ||
74 | for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do | ||
75 | sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT | ||
76 | done | ||
77 | } | ||
diff --git a/meta/recipes-devtools/python/python3/000-cross-compile.patch b/meta/recipes-devtools/python/python3/000-cross-compile.patch new file mode 100644 index 0000000000..2506a590c0 --- /dev/null +++ b/meta/recipes-devtools/python/python3/000-cross-compile.patch | |||
@@ -0,0 +1,83 @@ | |||
1 | We cross compile python. This patch uses tools from host/native | ||
2 | python instead of in-tree tools | ||
3 | |||
4 | -Khem | ||
5 | |||
6 | Upstream-Status: Inappropriate[Configuration Specific] | ||
7 | |||
8 | --- | ||
9 | Makefile.pre.in | 25 +++++++++++++------------ | ||
10 | 1 file changed, 13 insertions(+), 12 deletions(-) | ||
11 | |||
12 | --- a/Makefile.pre.in | ||
13 | +++ b/Makefile.pre.in | ||
14 | @@ -193,6 +193,7 @@ LIBOBJS= @LIBOBJS@ | ||
15 | |||
16 | PYTHON= python$(EXE) | ||
17 | BUILDPYTHON= python$(BUILDEXE) | ||
18 | +HOSTPYTHON= $(BUILDPYTHON) | ||
19 | |||
20 | PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@ | ||
21 | _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@ | ||
22 | @@ -239,6 +240,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ | ||
23 | ########################################################################## | ||
24 | # Parser | ||
25 | PGEN= Parser/pgen$(EXE) | ||
26 | +HOSTPGEN= $(PGEN)$(EXE) | ||
27 | |||
28 | PSRCS= \ | ||
29 | Parser/acceler.c \ | ||
30 | @@ -451,7 +453,7 @@ build_all_generate_profile: | ||
31 | |||
32 | run_profile_task: | ||
33 | : # FIXME: can't run for a cross build | ||
34 | - $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) | ||
35 | + $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK) | ||
36 | |||
37 | build_all_use_profile: | ||
38 | $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use -fprofile-correction" | ||
39 | @@ -640,7 +642,7 @@ $(IO_OBJS): $(IO_H) | ||
40 | $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) | ||
41 | @$(MKDIR_P) Include | ||
42 | $(MAKE) $(PGEN) | ||
43 | - $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) | ||
44 | + $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) | ||
45 | $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS) | ||
46 | $(MAKE) $(GRAMMAR_H) | ||
47 | touch $(GRAMMAR_C) | ||
48 | @@ -820,7 +822,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho | ||
49 | ###################################################################### | ||
50 | |||
51 | TESTOPTS= $(EXTRATESTOPTS) | ||
52 | -TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS) | ||
53 | +TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS) | ||
54 | TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py | ||
55 | TESTTIMEOUT= 3600 | ||
56 | |||
57 | @@ -1229,7 +1231,7 @@ frameworkinstallstructure: $(LDLIBRARY) | ||
58 | fi; \ | ||
59 | done | ||
60 | $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers | ||
61 | - sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist | ||
62 | + sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist | ||
63 | $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current | ||
64 | $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK) | ||
65 | $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers | ||
66 | @@ -1288,7 +1290,7 @@ config.status: $(srcdir)/configure | ||
67 | |||
68 | # Run reindent on the library | ||
69 | reindent: | ||
70 | - ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib | ||
71 | + $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib | ||
72 | |||
73 | # Rerun configure with the same options as it was run last time, | ||
74 | # provided the config.status script exists | ||
75 | @@ -1414,7 +1416,7 @@ funny: | ||
76 | |||
77 | # Perform some verification checks on any modified files. | ||
78 | patchcheck: | ||
79 | - $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py | ||
80 | + $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py | ||
81 | |||
82 | # Dependencies | ||
83 | |||
diff --git a/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch b/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch new file mode 100644 index 0000000000..dd6b24fe92 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 2f5a4c708d90fa8db21f446ae879cff79387448d Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 20 May 2013 21:03:16 -0700 | ||
4 | Subject: [PATCH] h2py: Fix issue 13032 where it fails with UnicodeDecodeError | ||
5 | |||
6 | use utf-8 to open the files | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | --- | ||
12 | Tools/scripts/h2py.py | 4 ++-- | ||
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py | ||
16 | index 4f871d9..a53fbe0 100755 | ||
17 | --- a/Tools/scripts/h2py.py | ||
18 | +++ b/Tools/scripts/h2py.py | ||
19 | @@ -69,13 +69,13 @@ def main(): | ||
20 | sys.stdout.write('# Generated by h2py from stdin\n') | ||
21 | process(sys.stdin, sys.stdout) | ||
22 | else: | ||
23 | - fp = open(filename, 'r') | ||
24 | + fp = open(filename, 'r', encoding='utf-8') | ||
25 | outfile = os.path.basename(filename) | ||
26 | i = outfile.rfind('.') | ||
27 | if i > 0: outfile = outfile[:i] | ||
28 | modname = outfile.upper() | ||
29 | outfile = modname + '.py' | ||
30 | - outfp = open(outfile, 'w') | ||
31 | + outfp = open(outfile, 'w', encoding='utf-8') | ||
32 | outfp.write('# Generated by h2py from %s\n' % filename) | ||
33 | filedict = {} | ||
34 | for dir in searchdirs: | ||
35 | -- | ||
36 | 1.8.1.2 | ||
37 | |||
diff --git a/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch b/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch new file mode 100644 index 0000000000..03ef286941 --- /dev/null +++ b/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | Dont cross compile site packages | ||
2 | |||
3 | -Khem | ||
4 | |||
5 | Upstream-Status: Inappropriate[Embedded-Specific] | ||
6 | |||
7 | --- | ||
8 | Makefile.pre.in | 16 ---------------- | ||
9 | 1 file changed, 16 deletions(-) | ||
10 | |||
11 | --- a/Makefile.pre.in | ||
12 | +++ b/Makefile.pre.in | ||
13 | @@ -1078,24 +1078,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL | ||
14 | $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ | ||
15 | $(DESTDIR)$(LIBDEST)/distutils/tests ; \ | ||
16 | fi | ||
17 | - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
18 | - $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ | ||
19 | - -d $(LIBDEST) -f \ | ||
20 | - -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ | ||
21 | - $(DESTDIR)$(LIBDEST) | ||
22 | - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
23 | - $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ | ||
24 | - -d $(LIBDEST) -f \ | ||
25 | - -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ | ||
26 | - $(DESTDIR)$(LIBDEST) | ||
27 | - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
28 | - $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ | ||
29 | - -d $(LIBDEST)/site-packages -f \ | ||
30 | - -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages | ||
31 | - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
32 | - $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ | ||
33 | - -d $(LIBDEST)/site-packages -f \ | ||
34 | - -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages | ||
35 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
36 | $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt | ||
37 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
diff --git a/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch b/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch new file mode 100644 index 0000000000..fddfd2b2f6 --- /dev/null +++ b/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | Upstream-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 | |||
7 | Index: Python-3.3.0rc2/setup.py | ||
8 | =================================================================== | ||
9 | --- Python-3.3.0rc2.orig/setup.py 2012-09-20 15:24:14.009124003 -0700 | ||
10 | +++ Python-3.3.0rc2/setup.py 2012-09-20 15:25:08.449124963 -0700 | ||
11 | @@ -1620,7 +1620,7 @@ | ||
12 | dotversion = dotversion[:-1] + '.' + dotversion[-1] | ||
13 | tcl_include_sub = [] | ||
14 | tk_include_sub = [] | ||
15 | - for dir in inc_dirs: | ||
16 | + for dir in [os.getenv("STAGING_INCDIR")]: | ||
17 | tcl_include_sub += [dir + os.sep + "tcl" + dotversion] | ||
18 | tk_include_sub += [dir + os.sep + "tk" + dotversion] | ||
19 | tk_include_sub += tcl_include_sub | ||
20 | @@ -1639,22 +1639,6 @@ | ||
21 | if dir not in include_dirs: | ||
22 | include_dirs.append(dir) | ||
23 | |||
24 | - # Check for various platform-specific directories | ||
25 | - if host_platform == 'sunos5': | ||
26 | - include_dirs.append('/usr/openwin/include') | ||
27 | - added_lib_dirs.append('/usr/openwin/lib') | ||
28 | - elif os.path.exists('/usr/X11R6/include'): | ||
29 | - include_dirs.append('/usr/X11R6/include') | ||
30 | - added_lib_dirs.append('/usr/X11R6/lib64') | ||
31 | - added_lib_dirs.append('/usr/X11R6/lib') | ||
32 | - elif os.path.exists('/usr/X11R5/include'): | ||
33 | - include_dirs.append('/usr/X11R5/include') | ||
34 | - added_lib_dirs.append('/usr/X11R5/lib') | ||
35 | - else: | ||
36 | - # Assume default location for X11 | ||
37 | - include_dirs.append('/usr/X11/include') | ||
38 | - added_lib_dirs.append('/usr/X11/lib') | ||
39 | - | ||
40 | # If Cygwin, then verify that X is installed before proceeding | ||
41 | if host_platform == 'cygwin': | ||
42 | x11_inc = find_file('X11/Xlib.h', [], include_dirs) | ||
diff --git a/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch b/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch new file mode 100644 index 0000000000..6beac7b805 --- /dev/null +++ b/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | Do not hardcode /usr into include paths when cross compiling | ||
2 | |||
3 | -Khem | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | --- | ||
8 | setup.py | 15 ++------------- | ||
9 | 1 file changed, 2 insertions(+), 13 deletions(-) | ||
10 | |||
11 | Index: Python-3.3.2/setup.py | ||
12 | =================================================================== | ||
13 | --- Python-3.3.2.orig/setup.py | ||
14 | +++ Python-3.3.2/setup.py | ||
15 | @@ -444,7 +444,8 @@ class PyBuildExt(build_ext): | ||
16 | # only change this for cross builds for 3.3, issues on Mageia | ||
17 | if cross_compiling: | ||
18 | self.add_gcc_paths() | ||
19 | - self.add_multiarch_paths() | ||
20 | + if not cross_compiling: | ||
21 | + self.add_multiarch_paths() | ||
22 | |||
23 | # Add paths specified in the environment variables LDFLAGS and | ||
24 | # CPPFLAGS for header and library files. | ||
25 | @@ -480,7 +481,7 @@ class PyBuildExt(build_ext): | ||
26 | for directory in reversed(options.dirs): | ||
27 | add_dir_to_list(dir_list, directory) | ||
28 | |||
29 | - if os.path.normpath(sys.base_prefix) != '/usr' \ | ||
30 | + if not cross_compiling and os.path.normpath(sys.base_prefix) != '/usr' \ | ||
31 | and not sysconfig.get_config_var('PYTHONFRAMEWORK'): | ||
32 | # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework | ||
33 | # (PYTHONFRAMEWORK is set) to avoid # linking problems when | ||
diff --git a/meta/recipes-devtools/python/python3/04-default-is-optimized.patch b/meta/recipes-devtools/python/python3/04-default-is-optimized.patch new file mode 100644 index 0000000000..d5afd40025 --- /dev/null +++ b/meta/recipes-devtools/python/python3/04-default-is-optimized.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | Upstream-Status: Inappropriate [embedded specific] | ||
2 | |||
3 | Updated original patch for python 2.7.3 | ||
4 | |||
5 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
6 | 2012/05/01 | ||
7 | |||
8 | |||
9 | # when compiling for an embedded system, we need every bit of | ||
10 | # performance we can get. default to optimized with the option | ||
11 | # of opt-out. | ||
12 | # Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de> | ||
13 | |||
14 | Index: Python-3.2.3/Python/compile.c | ||
15 | =================================================================== | ||
16 | --- Python-3.2.3.orig/Python/compile.c 2012-04-10 23:54:08.000000000 -0700 | ||
17 | +++ Python-3.2.3/Python/compile.c 2012-09-19 15:58:46.649123998 -0700 | ||
18 | @@ -30,7 +30,7 @@ | ||
19 | #include "symtable.h" | ||
20 | #include "opcode.h" | ||
21 | |||
22 | -int Py_OptimizeFlag = 0; | ||
23 | +int Py_OptimizeFlag = 1; | ||
24 | |||
25 | #define DEFAULT_BLOCK_SIZE 16 | ||
26 | #define DEFAULT_BLOCKS 8 | ||
27 | Index: Python-3.2.3/Modules/main.c | ||
28 | =================================================================== | ||
29 | --- Python-3.2.3.orig/Modules/main.c 2012-04-10 23:54:07.000000000 -0700 | ||
30 | +++ Python-3.2.3/Modules/main.c 2012-09-19 16:00:32.153124053 -0700 | ||
31 | @@ -46,7 +46,7 @@ | ||
32 | static int orig_argc; | ||
33 | |||
34 | /* command line options */ | ||
35 | -#define BASE_OPTS L"bBc:dEhiJm:OqRsStuvVW:xX:?" | ||
36 | +#define BASE_OPTS L"bBc:dEhiJm:NOqRsStuvVW:xX:?" | ||
37 | |||
38 | #define PROGRAM_OPTS BASE_OPTS | ||
39 | |||
40 | @@ -71,6 +71,7 @@ | ||
41 | -m mod : run library module as a script (terminates option list)\n\ | ||
42 | -O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\ | ||
43 | -OO : remove doc-strings in addition to the -O optimizations\n\ | ||
44 | +-N : do NOT optimize generated bytecode\n\ | ||
45 | -q : don't print version and copyright messages on interactive startup\n\ | ||
46 | -R : use a pseudo-random salt to make hash() values of various types be\n\ | ||
47 | unpredictable between separate invocations of the interpreter, as\n\ | ||
48 | @@ -407,8 +408,8 @@ | ||
49 | |||
50 | /* case 'J': reserved for Jython */ | ||
51 | |||
52 | - case 'O': | ||
53 | - Py_OptimizeFlag++; | ||
54 | + case 'N': | ||
55 | + Py_OptimizeFlag=0; | ||
56 | break; | ||
57 | |||
58 | case 'B': | ||
diff --git a/meta/recipes-devtools/python/python3/06-ctypes-libffi-fix-configure.patch b/meta/recipes-devtools/python/python3/06-ctypes-libffi-fix-configure.patch new file mode 100644 index 0000000000..abd63d2a96 --- /dev/null +++ b/meta/recipes-devtools/python/python3/06-ctypes-libffi-fix-configure.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | This 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 | |||
8 | The problem is still present in python-2.6.5 but fixed in python-svn. | ||
9 | |||
10 | Upstream-Status: Accepted [python-svn] | ||
11 | |||
12 | Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> | ||
13 | Acked-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
14 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
15 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
16 | |||
17 | |||
18 | 2011/09/29 | ||
19 | Rebased for python 2.7.2 | ||
20 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
21 | |||
22 | |||
23 | Index: Python-2.7.2/Modules/_ctypes/libffi/Makefile.am | ||
24 | =================================================================== | ||
25 | --- Python-2.7.2.orig/Modules/_ctypes/libffi/Makefile.am | ||
26 | +++ Python-2.7.2/Modules/_ctypes/libffi/Makefile.am | ||
27 | @@ -2,7 +2,7 @@ | ||
28 | |||
29 | AUTOMAKE_OPTIONS = foreign subdir-objects | ||
30 | |||
31 | -SUBDIRS = include testsuite man | ||
32 | +SUBDIRS = include | ||
33 | |||
34 | EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \ | ||
35 | src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \ | ||
36 | @@ -34,8 +34,6 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change | ||
37 | libtool-version ChangeLog.libffi m4/libtool.m4 \ | ||
38 | m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 | ||
39 | |||
40 | -info_TEXINFOS = doc/libffi.texi | ||
41 | - | ||
42 | ## ################################################################ | ||
43 | |||
44 | ## | ||
diff --git a/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch b/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch new file mode 100644 index 0000000000..789929b715 --- /dev/null +++ b/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | consider opkg directories when cleaning up | ||
2 | |||
3 | -Khem | ||
4 | |||
5 | Upstream-Status: Inappropriate [OE specific] | ||
6 | |||
7 | --- | ||
8 | Makefile.pre.in | 6 +++--- | ||
9 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
10 | |||
11 | --- a/Makefile.pre.in | ||
12 | +++ b/Makefile.pre.in | ||
13 | @@ -1306,8 +1306,8 @@ touch: | ||
14 | # Sanitation targets -- clean leaves libraries, executables and tags | ||
15 | # files, which clobber removes as well | ||
16 | pycremoval: | ||
17 | - -find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';' | ||
18 | - -find $(srcdir) -name '*.py[co]' -exec rm -f {} ';' | ||
19 | + -find $(srcdir) ! -path './ipkg-install/*' -depth -name '__pycache__' -exec rm -rf {} ';' | ||
20 | + -find $(srcdir) ! -path './ipkg-install/*' -name '*.py[co]' -exec rm -f {} ';' | ||
21 | |||
22 | rmtestturds: | ||
23 | -rm -f *BAD *GOOD *SKIPPED | ||
24 | @@ -1321,9 +1321,9 @@ docclean: | ||
25 | -rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils | ||
26 | |||
27 | clean: pycremoval | ||
28 | - find . -name '*.[oa]' -exec rm -f {} ';' | ||
29 | - find . -name '*.s[ol]' -exec rm -f {} ';' | ||
30 | - find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';' | ||
31 | + find . ! -path './ipkg-install/*' -name '*.[oa]' -exec rm -f {} ';' | ||
32 | + find . ! -path './ipkg-install/*' -name '*.s[ol]' -exec rm -f {} ';' | ||
33 | + find . ! -path './ipkg-install/*' -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';' | ||
34 | find build -name 'fficonfig.h' -exec rm -f {} ';' || true | ||
35 | find build -name 'fficonfig.py' -exec rm -f {} ';' || true | ||
36 | -rm -f Lib/lib2to3/*Grammar*.pickle | ||
diff --git a/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch b/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch new file mode 100644 index 0000000000..b96419a638 --- /dev/null +++ b/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch | |||
@@ -0,0 +1,92 @@ | |||
1 | do not "adjust" python files before copying | ||
2 | |||
3 | -Khem | ||
4 | |||
5 | Upstream-Status: Inappropriate [Embedded-Specific] | ||
6 | |||
7 | --- | ||
8 | Lib/distutils/command/build_scripts.py | 43 +++------------------------------ | ||
9 | 1 file changed, 4 insertions(+), 39 deletions(-) | ||
10 | |||
11 | --- a/Lib/distutils/command/build_scripts.py | ||
12 | +++ b/Lib/distutils/command/build_scripts.py | ||
13 | @@ -51,10 +51,7 @@ class build_scripts(Command): | ||
14 | |||
15 | |||
16 | def copy_scripts(self): | ||
17 | - """Copy each script listed in 'self.scripts'; if it's marked as a | ||
18 | - Python script in the Unix way (first line matches 'first_line_re', | ||
19 | - ie. starts with "\#!" and contains "python"), then adjust the first | ||
20 | - line to refer to the current Python interpreter as we copy. | ||
21 | + """Copy each script listed in 'self.scripts' | ||
22 | """ | ||
23 | self.mkpath(self.build_dir) | ||
24 | outfiles = [] | ||
25 | @@ -78,64 +75,10 @@ class build_scripts(Command): | ||
26 | if not self.dry_run: | ||
27 | raise | ||
28 | f = None | ||
29 | - else: | ||
30 | - encoding, lines = tokenize.detect_encoding(f.readline) | ||
31 | - f.seek(0) | ||
32 | - first_line = f.readline() | ||
33 | - if not first_line: | ||
34 | - self.warn("%s is an empty file (skipping)" % script) | ||
35 | - continue | ||
36 | - | ||
37 | - match = first_line_re.match(first_line) | ||
38 | - if match: | ||
39 | - adjust = True | ||
40 | - post_interp = match.group(1) or b'' | ||
41 | - | ||
42 | - if adjust: | ||
43 | - log.info("copying and adjusting %s -> %s", script, | ||
44 | - self.build_dir) | ||
45 | - updated_files.append(outfile) | ||
46 | - if not self.dry_run: | ||
47 | - if not sysconfig.python_build: | ||
48 | - executable = self.executable | ||
49 | - else: | ||
50 | - executable = os.path.join( | ||
51 | - sysconfig.get_config_var("BINDIR"), | ||
52 | - "python%s%s" % (sysconfig.get_config_var("VERSION"), | ||
53 | - sysconfig.get_config_var("EXE"))) | ||
54 | - executable = os.fsencode(executable) | ||
55 | - shebang = b"#!" + executable + post_interp + b"\n" | ||
56 | - # Python parser starts to read a script using UTF-8 until | ||
57 | - # it gets a #coding:xxx cookie. The shebang has to be the | ||
58 | - # first line of a file, the #coding:xxx cookie cannot be | ||
59 | - # written before. So the shebang has to be decodable from | ||
60 | - # UTF-8. | ||
61 | - try: | ||
62 | - shebang.decode('utf-8') | ||
63 | - except UnicodeDecodeError: | ||
64 | - raise ValueError( | ||
65 | - "The shebang ({!r}) is not decodable " | ||
66 | - "from utf-8".format(shebang)) | ||
67 | - # If the script is encoded to a custom encoding (use a | ||
68 | - # #coding:xxx cookie), the shebang has to be decodable from | ||
69 | - # the script encoding too. | ||
70 | - try: | ||
71 | - shebang.decode(encoding) | ||
72 | - except UnicodeDecodeError: | ||
73 | - raise ValueError( | ||
74 | - "The shebang ({!r}) is not decodable " | ||
75 | - "from the script encoding ({})" | ||
76 | - .format(shebang, encoding)) | ||
77 | - with open(outfile, "wb") as outf: | ||
78 | - outf.write(shebang) | ||
79 | - outf.writelines(f.readlines()) | ||
80 | - if f: | ||
81 | - f.close() | ||
82 | - else: | ||
83 | - if f: | ||
84 | + if f: | ||
85 | f.close() | ||
86 | - updated_files.append(outfile) | ||
87 | - self.copy_file(script, outfile) | ||
88 | + updated_files.append(outfile) | ||
89 | + self.copy_file(script, outfile) | ||
90 | |||
91 | if os.name == 'posix': | ||
92 | for file in outfiles: | ||
diff --git a/meta/recipes-devtools/python/python3/110-enable-zlib.patch b/meta/recipes-devtools/python/python3/110-enable-zlib.patch new file mode 100644 index 0000000000..fb92a19163 --- /dev/null +++ b/meta/recipes-devtools/python/python3/110-enable-zlib.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Enable zlib in python | ||
2 | |||
3 | -Khem | ||
4 | |||
5 | Upstream-Status: Inappropriate [OE-Specific] | ||
6 | |||
7 | --- | ||
8 | Modules/Setup.dist | 2 +- | ||
9 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
10 | |||
11 | --- a/Modules/Setup.dist | ||
12 | +++ b/Modules/Setup.dist | ||
13 | @@ -354,7 +354,7 @@ _symtable symtablemodule.c | ||
14 | # Andrew Kuchling's zlib module. | ||
15 | # This require zlib 1.1.3 (or later). | ||
16 | # See http://www.gzip.org/zlib/ | ||
17 | -#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz | ||
18 | +zlib zlibmodule.c -lz | ||
19 | |||
20 | # Interface to the Expat XML parser | ||
21 | # | ||
diff --git a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch new file mode 100644 index 0000000000..c5846a5af8 --- /dev/null +++ b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch | |||
@@ -0,0 +1,78 @@ | |||
1 | Upstream-Status: Inappropriate [embedded specific] | ||
2 | |||
3 | # The proper prefix is inside our staging area. | ||
4 | # Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de> | ||
5 | # Signed-off-by: Phil Blundell <philb@gnu.org> | ||
6 | # Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
7 | |||
8 | Index: Python-3.3.2/Lib/distutils/sysconfig.py | ||
9 | =================================================================== | ||
10 | --- Python-3.3.2.orig/Lib/distutils/sysconfig.py 2013-07-30 00:00:52.769749805 -0700 | ||
11 | +++ Python-3.3.2/Lib/distutils/sysconfig.py 2013-07-30 00:16:22.545767248 -0700 | ||
12 | @@ -16,10 +16,11 @@ | ||
13 | from .errors import DistutilsPlatformError | ||
14 | |||
15 | # These are needed in a couple of spots, so just compute them once. | ||
16 | -PREFIX = os.path.normpath(sys.prefix) | ||
17 | -EXEC_PREFIX = os.path.normpath(sys.exec_prefix) | ||
18 | -BASE_PREFIX = os.path.normpath(sys.base_prefix) | ||
19 | -BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) | ||
20 | +PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) | ||
21 | +EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) | ||
22 | +BASE_PREFIX = os.path.normpath(sys.base_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) | ||
23 | +BASE_EXEC_PREFIX= os.path.normpath(sys.base_exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) | ||
24 | + | ||
25 | |||
26 | # Path to the base directory of the project. On Windows the binary may | ||
27 | # live in project/PCBuild9. If we're dealing with an x64 Windows build, | ||
28 | @@ -93,7 +94,9 @@ | ||
29 | If 'prefix' is supplied, use it instead of sys.base_prefix or | ||
30 | sys.base_exec_prefix -- i.e., ignore 'plat_specific'. | ||
31 | """ | ||
32 | - if prefix is None: | ||
33 | + if prefix is None and os.environ['STAGING_INCDIR'] != "": | ||
34 | + prefix = os.environ['STAGING_INCDIR'].rstrip('include') | ||
35 | + elif prefix is None: | ||
36 | prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX | ||
37 | if os.name == "posix": | ||
38 | if python_build: | ||
39 | @@ -136,6 +139,12 @@ | ||
40 | If 'prefix' is supplied, use it instead of sys.base_prefix or | ||
41 | sys.base_exec_prefix -- i.e., ignore 'plat_specific'. | ||
42 | """ | ||
43 | + if prefix is None and os.environ['STAGING_LIBDIR'] != "": | ||
44 | + lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1] | ||
45 | + prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename) | ||
46 | + else: | ||
47 | + lib_basename = sys.lib | ||
48 | + | ||
49 | if prefix is None: | ||
50 | if standard_lib: | ||
51 | prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX | ||
52 | @@ -144,7 +153,7 @@ | ||
53 | |||
54 | if os.name == "posix": | ||
55 | libpython = os.path.join(prefix, | ||
56 | - "lib", "python" + get_python_version()) | ||
57 | + lib_basename, "python" + get_python_version()) | ||
58 | if standard_lib: | ||
59 | return libpython | ||
60 | else: | ||
61 | @@ -249,7 +258,7 @@ | ||
62 | else: | ||
63 | # The name of the config.h file changed in 2.2 | ||
64 | config_h = 'pyconfig.h' | ||
65 | - return os.path.join(inc_dir, config_h) | ||
66 | + return os.path.join(inc_dir, config_h).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) | ||
67 | |||
68 | |||
69 | def get_makefile_filename(): | ||
70 | @@ -258,7 +267,7 @@ | ||
71 | return os.path.join(_sys_home or project_base, "Makefile") | ||
72 | lib_dir = get_python_lib(plat_specific=0, standard_lib=1) | ||
73 | config_file = 'config-{}{}'.format(get_python_version(), build_flags) | ||
74 | - return os.path.join(lib_dir, config_file, 'Makefile') | ||
75 | + return os.path.join(lib_dir, config_file, 'Makefile').replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) | ||
76 | |||
77 | |||
78 | def parse_config_h(fp, g=None): | ||
diff --git a/meta/recipes-devtools/python/python3/130-readline-setup.patch b/meta/recipes-devtools/python/python3/130-readline-setup.patch new file mode 100644 index 0000000000..c805652d69 --- /dev/null +++ b/meta/recipes-devtools/python/python3/130-readline-setup.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | package python-readline | ||
2 | |||
3 | -Khem | ||
4 | |||
5 | Upstream-Status: Inappropriate [Embedded Specific] | ||
6 | |||
7 | --- a/setup.py | ||
8 | +++ b/setup.py | ||
9 | @@ -666,45 +666,7 @@ class PyBuildExt(build_ext): | ||
10 | # readline | ||
11 | do_readline = self.compiler.find_library_file(lib_dirs, 'readline') | ||
12 | readline_termcap_library = "" | ||
13 | - curses_library = "" | ||
14 | - # Cannot use os.popen here in py3k. | ||
15 | - tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib') | ||
16 | - if not os.path.exists(self.build_temp): | ||
17 | - os.makedirs(self.build_temp) | ||
18 | - # Determine if readline is already linked against curses or tinfo. | ||
19 | - if do_readline: | ||
20 | - if cross_compiling: | ||
21 | - ret = os.system("%s -d %s | grep '(NEEDED)' > %s" \ | ||
22 | - % (sysconfig.get_config_var('READELF'), | ||
23 | - do_readline, tmpfile)) | ||
24 | - elif find_executable('ldd'): | ||
25 | - ret = os.system("ldd %s > %s" % (do_readline, tmpfile)) | ||
26 | - else: | ||
27 | - ret = 256 | ||
28 | - if ret >> 8 == 0: | ||
29 | - with open(tmpfile) as fp: | ||
30 | - for ln in fp: | ||
31 | - if 'curses' in ln: | ||
32 | - readline_termcap_library = re.sub( | ||
33 | - r'.*lib(n?cursesw?)\.so.*', r'\1', ln | ||
34 | - ).rstrip() | ||
35 | - break | ||
36 | - # termcap interface split out from ncurses | ||
37 | - if 'tinfo' in ln: | ||
38 | - readline_termcap_library = 'tinfo' | ||
39 | - break | ||
40 | - if os.path.exists(tmpfile): | ||
41 | - os.unlink(tmpfile) | ||
42 | - # Issue 7384: If readline is already linked against curses, | ||
43 | - # use the same library for the readline and curses modules. | ||
44 | - if 'curses' in readline_termcap_library: | ||
45 | - curses_library = readline_termcap_library | ||
46 | - elif self.compiler.find_library_file(lib_dirs, 'ncursesw'): | ||
47 | - curses_library = 'ncursesw' | ||
48 | - elif self.compiler.find_library_file(lib_dirs, 'ncurses'): | ||
49 | - curses_library = 'ncurses' | ||
50 | - elif self.compiler.find_library_file(lib_dirs, 'curses'): | ||
51 | - curses_library = 'curses' | ||
52 | + curses_library = "ncurses" | ||
53 | |||
54 | if host_platform == 'darwin': | ||
55 | os_release = int(os.uname()[2].split('.')[0]) | ||
diff --git a/meta/recipes-devtools/python/python3/150-fix-setupterm.patch b/meta/recipes-devtools/python/python3/150-fix-setupterm.patch new file mode 100644 index 0000000000..78d7c78670 --- /dev/null +++ b/meta/recipes-devtools/python/python3/150-fix-setupterm.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | Fix warning with newer compiler | ||
2 | |||
3 | -Khem | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | --- a/Modules/_cursesmodule.c | ||
8 | +++ b/Modules/_cursesmodule.c | ||
9 | @@ -116,7 +116,7 @@ char *PyCursesVersion = "2.2"; | ||
10 | #defines many common symbols (such as "lines") which breaks the | ||
11 | curses module in other ways. So the code will just specify | ||
12 | explicit prototypes here. */ | ||
13 | -extern int setupterm(char *,int,int *); | ||
14 | +//extern int setupterm(char *,int,int *); | ||
15 | #ifdef __sgi | ||
16 | #include <term.h> | ||
17 | #endif | ||
diff --git a/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch b/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch new file mode 100644 index 0000000000..054a13124c --- /dev/null +++ b/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | We should make sure that sysroot is used by gcc instead of assuming | ||
2 | hardcoded locations for include paths | ||
3 | |||
4 | Upstream-Status: Pending | ||
5 | |||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
7 | : | ||
8 | Index: Python-3.3.3/configure.ac | ||
9 | =================================================================== | ||
10 | --- Python-3.3.3.orig/configure.ac 2014-01-29 19:00:15.245312752 -0800 | ||
11 | +++ Python-3.3.3/configure.ac 2014-01-29 23:27:22.938526262 -0800 | ||
12 | @@ -1548,7 +1548,7 @@ | ||
13 | # checks for header files | ||
14 | AC_HEADER_STDC | ||
15 | ac_save_cppflags="$CPPFLAGS" | ||
16 | -CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" | ||
17 | +CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw" | ||
18 | AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \ | ||
19 | fcntl.h grp.h \ | ||
20 | ieeefp.h io.h langinfo.h libintl.h ncurses.h process.h pthread.h \ | ||
21 | @@ -4308,7 +4308,7 @@ | ||
22 | fi | ||
23 | |||
24 | ac_save_cppflags="$CPPFLAGS" | ||
25 | -CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" | ||
26 | +CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw" | ||
27 | # On HP/UX 11.0, mvwdelch is a block with a return statement | ||
28 | AC_MSG_CHECKING(whether mvwdelch is an expression) | ||
29 | AC_CACHE_VAL(ac_cv_mvwdelch_is_expression, | ||
diff --git a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch new file mode 100644 index 0000000000..208c57c822 --- /dev/null +++ b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | _tkinter module needs tk module along with tcl. tk is not yet integrated | ||
2 | in yocto so we skip the check for this module. | ||
3 | Avoid a warning by not adding this module to missing variable. | ||
4 | |||
5 | Upstream-Status: Inappropriate [distribution] | ||
6 | |||
7 | Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> | ||
8 | |||
9 | Index: Python-2.7.2/setup.py | ||
10 | =================================================================== | ||
11 | --- Python-2.7.2.orig/setup.py 2012-04-05 23:18:38.500136647 +0300 | ||
12 | +++ Python-2.7.2/setup.py 2012-04-05 23:19:35.888134969 +0300 | ||
13 | @@ -1634,8 +1634,10 @@ | ||
14 | # Call the method for detecting whether _tkinter can be compiled | ||
15 | self.detect_tkinter(inc_dirs, lib_dirs) | ||
16 | |||
17 | - if '_tkinter' not in [e.name for e in self.extensions]: | ||
18 | - missing.append('_tkinter') | ||
19 | + # tkinter module will not be avalaible as yocto | ||
20 | + # doesn't have tk integrated (yet) | ||
21 | + #if '_tkinter' not in [e.name for e in self.extensions]: | ||
22 | + # missing.append('_tkinter') | ||
23 | |||
24 | return missing | ||
25 | |||
diff --git a/meta/recipes-devtools/python/python3/cgi_py.patch b/meta/recipes-devtools/python/python3/cgi_py.patch new file mode 100644 index 0000000000..de504f9dcf --- /dev/null +++ b/meta/recipes-devtools/python/python3/cgi_py.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | Lib/cgi.py: Update the script as mentioned in the comment | ||
2 | |||
3 | Upstream-Status: Inappropriate [distribution] | ||
4 | |||
5 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
6 | |||
7 | --- Python-2.6.6/Lib/cgi.py.orig 2010-08-01 22:14:27.000000000 -0500 | ||
8 | +++ Python-2.6.6/Lib/cgi.py 2011-09-21 15:28:40.478208631 -0500 | ||
9 | @@ -1,13 +1,4 @@ | ||
10 | -#! /usr/local/bin/python | ||
11 | - | ||
12 | -# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is | ||
13 | -# intentionally NOT "/usr/bin/env python". On many systems | ||
14 | -# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI | ||
15 | -# scripts, and /usr/local/bin is the default directory where Python is | ||
16 | -# installed, so /usr/bin/env would be unable to find python. Granted, | ||
17 | -# binary installations by Linux vendors often install Python in | ||
18 | -# /usr/bin. So let those vendors patch cgi.py to match their choice | ||
19 | -# of installation. | ||
20 | +#! /usr/bin/env python | ||
21 | |||
22 | """Support module for CGI (Common Gateway Interface) scripts. | ||
23 | |||
diff --git a/meta/recipes-devtools/python/python3/fix-ast.h-dependency.patch b/meta/recipes-devtools/python/python3/fix-ast.h-dependency.patch new file mode 100644 index 0000000000..77c220aa82 --- /dev/null +++ b/meta/recipes-devtools/python/python3/fix-ast.h-dependency.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Fix a missed dependency on ast.h which can result in race condition | ||
2 | at high parallel build | ||
3 | |||
4 | It fixed here | ||
5 | |||
6 | http://hg.python.org/cpython/rev/cfe0a293551f | ||
7 | |||
8 | [YOCTO #5884] | ||
9 | |||
10 | Upstream-Status: Backport | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | |||
13 | Index: Python-3.3.3/Makefile.pre.in | ||
14 | =================================================================== | ||
15 | --- Python-3.3.3.orig/Makefile.pre.in 2014-02-26 09:33:13.868288863 -0800 | ||
16 | +++ Python-3.3.3/Makefile.pre.in 2014-02-26 09:36:27.348292492 -0800 | ||
17 | @@ -853,7 +853,8 @@ | ||
18 | $(srcdir)/Include/warnings.h \ | ||
19 | $(srcdir)/Include/weakrefobject.h \ | ||
20 | pyconfig.h \ | ||
21 | - $(PARSER_HEADERS) | ||
22 | + $(PARSER_HEADERS) \ | ||
23 | + $(AST_H) | ||
24 | |||
25 | $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS) | ||
26 | |||
diff --git a/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch b/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch new file mode 100644 index 0000000000..cd1a978eb3 --- /dev/null +++ b/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | Upstream-Status: Inappropriate [Embedded specific] | ||
2 | |||
3 | This patch fixes issuing with different libdir like lib64. | ||
4 | This patch makes the native python binary modules findable | ||
5 | in the install process of the host python. | ||
6 | |||
7 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
8 | Date: 2012/03/14 | ||
9 | |||
10 | Updated for python 2.7.3 | ||
11 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
12 | Date: 2012/05/01 | ||
13 | |||
14 | Index: Python-3.3.0rc2/Lib/sysconfig.py | ||
15 | =================================================================== | ||
16 | --- Python-3.3.0rc2.orig/Lib/sysconfig.py 2012-09-20 22:50:11.000000000 -0700 | ||
17 | +++ Python-3.3.0rc2/Lib/sysconfig.py 2012-09-20 22:53:01.561123396 -0700 | ||
18 | @@ -21,9 +21,9 @@ | ||
19 | |||
20 | _INSTALL_SCHEMES = { | ||
21 | 'posix_prefix': { | ||
22 | - 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}', | ||
23 | + 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}', | ||
24 | 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}', | ||
25 | - 'purelib': '{base}/lib/python{py_version_short}/site-packages', | ||
26 | + 'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages', | ||
27 | 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages', | ||
28 | 'include': | ||
29 | '{installed_base}/include/python{py_version_short}{abiflags}', | ||
30 | @@ -83,7 +83,7 @@ | ||
31 | 'posix_user': { | ||
32 | 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', | ||
33 | 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', | ||
34 | - 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', | ||
35 | + 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages', | ||
36 | 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages', | ||
37 | 'include': '{userbase}/include/python{py_version_short}', | ||
38 | 'scripts': '{userbase}/bin', | ||
39 | Index: Python-3.3.0rc2/Makefile.pre.in | ||
40 | =================================================================== | ||
41 | --- Python-3.3.0rc2.orig/Makefile.pre.in 2012-09-20 22:50:11.000000000 -0700 | ||
42 | +++ Python-3.3.0rc2/Makefile.pre.in 2012-09-20 22:50:54.245123997 -0700 | ||
43 | @@ -1080,9 +1080,9 @@ | ||
44 | $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ | ||
45 | $(DESTDIR)$(LIBDEST)/distutils/tests ; \ | ||
46 | fi | ||
47 | - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
48 | + -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ | ||
49 | $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt | ||
50 | - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
51 | + -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ | ||
52 | $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt | ||
53 | |||
54 | # Create the PLATDIR source directory, if one wasn't distributed.. | ||
diff --git a/meta/recipes-devtools/python/python3/host_include_contamination.patch b/meta/recipes-devtools/python/python3/host_include_contamination.patch new file mode 100644 index 0000000000..ef2054d9a9 --- /dev/null +++ b/meta/recipes-devtools/python/python3/host_include_contamination.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | when building python for qemux86-64 on ubuntu 11.10/64bit | ||
2 | it gropes into host includes and then mixes them with cross | ||
3 | includes and as a result some modules fail to compile and link | ||
4 | one of the modules is python-elementtree which is then not | ||
5 | found during image creation | ||
6 | |||
7 | Proble is that setup.py tries to add native includes that newer | ||
8 | ubuntu has introduced for multiarch support. But that should | ||
9 | only happen for native builds and not cross building python | ||
10 | so we add a check here. | ||
11 | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | Upstream-Status: Pending | ||
14 | |||
15 | Index: Python-3.3.0rc2/setup.py | ||
16 | =================================================================== | ||
17 | --- Python-3.3.0rc2.orig/setup.py 2012-09-20 21:54:50.000000000 -0700 | ||
18 | +++ Python-3.3.0rc2/setup.py 2012-09-20 21:57:35.029123858 -0700 | ||
19 | @@ -402,6 +402,9 @@ | ||
20 | |||
21 | if not find_executable('dpkg-architecture'): | ||
22 | return | ||
23 | + if cross_compiling: | ||
24 | + return | ||
25 | + | ||
26 | opt = '' | ||
27 | if cross_compiling: | ||
28 | opt = '-t' + sysconfig.get_config_var('HOST_GNU_TYPE') | ||
diff --git a/meta/recipes-devtools/python/python3/makerace.patch b/meta/recipes-devtools/python/python3/makerace.patch new file mode 100644 index 0000000000..d8a68923a8 --- /dev/null +++ b/meta/recipes-devtools/python/python3/makerace.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | There is a race due to the execution of make inside the makefile: | ||
2 | |||
3 | | gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c | ||
4 | | gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Parser/pgen.o Parser/pgen.c| gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c | ||
5 | | gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c | ||
6 | | Objects/obmalloc.o: file not recognized: File truncated | ||
7 | | collect2: error: ld returned 1 exit status | ||
8 | | make[1]: *** [Parser/pgen] Error 1 | ||
9 | |||
10 | The easiest way to avoid this is to list the dependencies explictly. | ||
11 | |||
12 | RP 28/2/2014 | ||
13 | |||
14 | Upstream-Status: Pending | ||
15 | |||
16 | Index: Python-3.3.3/Makefile.pre.in | ||
17 | =================================================================== | ||
18 | --- Python-3.3.3.orig/Makefile.pre.in 2014-02-27 14:04:38.268339533 +0000 | ||
19 | +++ Python-3.3.3/Makefile.pre.in 2014-02-28 10:40:59.166361125 +0000 | ||
20 | @@ -676,7 +676,7 @@ | ||
21 | |||
22 | $(IO_OBJS): $(IO_H) | ||
23 | |||
24 | -$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) | ||
25 | +$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) $(PGEN) | ||
26 | @$(MKDIR_P) Include | ||
27 | $(MAKE) $(PGEN) | ||
28 | $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) | ||
diff --git a/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/meta/recipes-devtools/python/python3/python-3.3-multilib.patch new file mode 100644 index 0000000000..7d66a0e00d --- /dev/null +++ b/meta/recipes-devtools/python/python3/python-3.3-multilib.patch | |||
@@ -0,0 +1,336 @@ | |||
1 | get the sys.lib from python itself and do not use hardcoded value of 'lib' | ||
2 | |||
3 | -Khem | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Index: Python-3.3.2/Include/pythonrun.h | ||
8 | =================================================================== | ||
9 | --- Python-3.3.2.orig/Include/pythonrun.h 2013-05-15 09:32:54.000000000 -0700 | ||
10 | +++ Python-3.3.2/Include/pythonrun.h 2013-07-27 16:19:54.099877246 -0700 | ||
11 | @@ -181,6 +181,8 @@ | ||
12 | /* In their own files */ | ||
13 | PyAPI_FUNC(const char *) Py_GetVersion(void); | ||
14 | PyAPI_FUNC(const char *) Py_GetPlatform(void); | ||
15 | +PyAPI_FUNC(const char *) Py_GetArch(void); | ||
16 | +PyAPI_FUNC(const char *) Py_GetLib(void); | ||
17 | PyAPI_FUNC(const char *) Py_GetCopyright(void); | ||
18 | PyAPI_FUNC(const char *) Py_GetCompiler(void); | ||
19 | PyAPI_FUNC(const char *) Py_GetBuildInfo(void); | ||
20 | Index: Python-3.3.2/Lib/distutils/command/install.py | ||
21 | =================================================================== | ||
22 | --- Python-3.3.2.orig/Lib/distutils/command/install.py 2013-05-15 09:32:54.000000000 -0700 | ||
23 | +++ Python-3.3.2/Lib/distutils/command/install.py 2013-07-27 16:19:54.099877246 -0700 | ||
24 | @@ -25,6 +25,8 @@ | ||
25 | from site import USER_SITE | ||
26 | HAS_USER_SITE = True | ||
27 | |||
28 | +libname = sys.lib | ||
29 | + | ||
30 | if sys.version < "2.2": | ||
31 | WINDOWS_SCHEME = { | ||
32 | 'purelib': '$base', | ||
33 | @@ -45,7 +47,7 @@ | ||
34 | INSTALL_SCHEMES = { | ||
35 | 'unix_prefix': { | ||
36 | 'purelib': '$base/lib/python$py_version_short/site-packages', | ||
37 | - 'platlib': '$platbase/lib/python$py_version_short/site-packages', | ||
38 | + 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages', | ||
39 | 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', | ||
40 | 'scripts': '$base/bin', | ||
41 | 'data' : '$base', | ||
42 | Index: Python-3.3.2/Lib/pydoc.py | ||
43 | =================================================================== | ||
44 | --- Python-3.3.2.orig/Lib/pydoc.py 2013-05-15 09:32:55.000000000 -0700 | ||
45 | +++ Python-3.3.2/Lib/pydoc.py 2013-07-27 16:19:54.103877246 -0700 | ||
46 | @@ -372,7 +372,7 @@ | ||
47 | |||
48 | docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS) | ||
49 | |||
50 | - basedir = os.path.join(sys.base_exec_prefix, "lib", | ||
51 | + basedir = os.path.join(sys.base_exec_prefix, sys.lib, | ||
52 | "python%d.%d" % sys.version_info[:2]) | ||
53 | if (isinstance(object, type(os)) and | ||
54 | (object.__name__ in ('errno', 'exceptions', 'gc', 'imp', | ||
55 | Index: Python-3.3.2/Lib/site.py | ||
56 | =================================================================== | ||
57 | --- Python-3.3.2.orig/Lib/site.py 2013-05-15 09:32:55.000000000 -0700 | ||
58 | +++ Python-3.3.2/Lib/site.py 2013-07-27 16:19:54.103877246 -0700 | ||
59 | @@ -303,13 +303,19 @@ | ||
60 | if sys.platform in ('os2emx', 'riscos'): | ||
61 | sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) | ||
62 | elif os.sep == '/': | ||
63 | - sitepackages.append(os.path.join(prefix, "lib", | ||
64 | + sitepackages.append(os.path.join(prefix, sys.lib, | ||
65 | "python" + sys.version[:3], | ||
66 | "site-packages")) | ||
67 | - sitepackages.append(os.path.join(prefix, "lib", "site-python")) | ||
68 | + if sys.lib != "lib": | ||
69 | + sitepackages.append(os.path.join(prefix, "lib", | ||
70 | + "python" + sys.version[:3], | ||
71 | + "site-packages")) | ||
72 | + sitepackages.append(os.path.join(prefix, sys.lib, "site-python")) | ||
73 | + if sys.lib != "lib": | ||
74 | + sitepackages.append(os.path.join(prefix, "lib", "site-python")) | ||
75 | else: | ||
76 | sitepackages.append(prefix) | ||
77 | - sitepackages.append(os.path.join(prefix, "lib", "site-packages")) | ||
78 | + sitepackages.append(os.path.join(prefix, sys.lib, "site-packages")) | ||
79 | if sys.platform == "darwin": | ||
80 | # for framework builds *only* we add the standard Apple | ||
81 | # locations. | ||
82 | Index: Python-3.3.2/Lib/trace.py | ||
83 | =================================================================== | ||
84 | --- Python-3.3.2.orig/Lib/trace.py 2013-05-15 09:32:56.000000000 -0700 | ||
85 | +++ Python-3.3.2/Lib/trace.py 2013-07-27 16:19:54.103877246 -0700 | ||
86 | @@ -751,10 +751,10 @@ | ||
87 | # should I also call expanduser? (after all, could use $HOME) | ||
88 | |||
89 | s = s.replace("$prefix", | ||
90 | - os.path.join(sys.base_prefix, "lib", | ||
91 | + os.path.join(sys.base_prefix, sys.lib, | ||
92 | "python" + sys.version[:3])) | ||
93 | s = s.replace("$exec_prefix", | ||
94 | - os.path.join(sys.base_exec_prefix, "lib", | ||
95 | + os.path.join(sys.base_exec_prefix, sys.lib, | ||
96 | "python" + sys.version[:3])) | ||
97 | s = os.path.normpath(s) | ||
98 | ignore_dirs.append(s) | ||
99 | Index: Python-3.3.2/Makefile.pre.in | ||
100 | =================================================================== | ||
101 | --- Python-3.3.2.orig/Makefile.pre.in 2013-07-27 16:19:16.000000000 -0700 | ||
102 | +++ Python-3.3.2/Makefile.pre.in 2013-07-27 16:19:54.103877246 -0700 | ||
103 | @@ -96,6 +96,8 @@ | ||
104 | |||
105 | # Machine-dependent subdirectories | ||
106 | MACHDEP= @MACHDEP@ | ||
107 | +LIB= @LIB@ | ||
108 | +ARCH= @ARCH@ | ||
109 | |||
110 | # Multiarch directory (may be empty) | ||
111 | MULTIARCH= @MULTIARCH@ | ||
112 | @@ -115,7 +117,7 @@ | ||
113 | MANDIR= @mandir@ | ||
114 | INCLUDEDIR= @includedir@ | ||
115 | CONFINCLUDEDIR= $(exec_prefix)/include | ||
116 | -SCRIPTDIR= $(prefix)/lib | ||
117 | +SCRIPTDIR= @libdir@ | ||
118 | ABIFLAGS= @ABIFLAGS@ | ||
119 | |||
120 | # Detailed destination directories | ||
121 | @@ -635,6 +637,7 @@ | ||
122 | -DEXEC_PREFIX='"$(exec_prefix)"' \ | ||
123 | -DVERSION='"$(VERSION)"' \ | ||
124 | -DVPATH='"$(VPATH)"' \ | ||
125 | + -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \ | ||
126 | -o $@ $(srcdir)/Modules/getpath.c | ||
127 | |||
128 | Modules/python.o: $(srcdir)/Modules/python.c | ||
129 | @@ -701,7 +704,7 @@ | ||
130 | Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) | ||
131 | |||
132 | Python/getplatform.o: $(srcdir)/Python/getplatform.c | ||
133 | - $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c | ||
134 | + $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c | ||
135 | |||
136 | Python/importdl.o: $(srcdir)/Python/importdl.c | ||
137 | $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c | ||
138 | Index: Python-3.3.2/Modules/getpath.c | ||
139 | =================================================================== | ||
140 | --- Python-3.3.2.orig/Modules/getpath.c 2013-05-15 09:32:59.000000000 -0700 | ||
141 | +++ Python-3.3.2/Modules/getpath.c 2013-07-27 16:19:54.107877246 -0700 | ||
142 | @@ -121,9 +121,11 @@ | ||
143 | #define EXEC_PREFIX PREFIX | ||
144 | #endif | ||
145 | |||
146 | +#define LIB_PYTHON LIB "/python" VERSION | ||
147 | + | ||
148 | #ifndef PYTHONPATH | ||
149 | -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \ | ||
150 | - EXEC_PREFIX "/lib/python" VERSION "/lib-dynload" | ||
151 | +#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \ | ||
152 | + EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload" | ||
153 | #endif | ||
154 | |||
155 | #ifndef LANDMARK | ||
156 | @@ -135,7 +137,7 @@ | ||
157 | static wchar_t progpath[MAXPATHLEN+1]; | ||
158 | static wchar_t *module_search_path = NULL; | ||
159 | static int module_search_path_malloced = 0; | ||
160 | -static wchar_t *lib_python = L"lib/python" VERSION; | ||
161 | +static wchar_t *lib_python = L"" LIB_PYTHON; | ||
162 | |||
163 | static void | ||
164 | reduce(wchar_t *dir) | ||
165 | Index: Python-3.3.2/Python/getplatform.c | ||
166 | =================================================================== | ||
167 | --- Python-3.3.2.orig/Python/getplatform.c 2013-05-15 09:33:00.000000000 -0700 | ||
168 | +++ Python-3.3.2/Python/getplatform.c 2013-07-27 16:19:54.107877246 -0700 | ||
169 | @@ -10,3 +10,23 @@ | ||
170 | { | ||
171 | return PLATFORM; | ||
172 | } | ||
173 | + | ||
174 | +#ifndef ARCH | ||
175 | +#define ARCH "unknown" | ||
176 | +#endif | ||
177 | + | ||
178 | +const char * | ||
179 | +Py_GetArch(void) | ||
180 | +{ | ||
181 | + return ARCH; | ||
182 | +} | ||
183 | + | ||
184 | +#ifndef LIB | ||
185 | +#define LIB "lib" | ||
186 | +#endif | ||
187 | + | ||
188 | +const char * | ||
189 | +Py_GetLib(void) | ||
190 | +{ | ||
191 | + return LIB; | ||
192 | +} | ||
193 | Index: Python-3.3.2/Python/sysmodule.c | ||
194 | =================================================================== | ||
195 | --- Python-3.3.2.orig/Python/sysmodule.c 2013-05-15 09:33:00.000000000 -0700 | ||
196 | +++ Python-3.3.2/Python/sysmodule.c 2013-07-27 16:19:54.107877246 -0700 | ||
197 | @@ -1612,6 +1612,10 @@ | ||
198 | PyUnicode_FromString(Py_GetCopyright())); | ||
199 | SET_SYS_FROM_STRING("platform", | ||
200 | PyUnicode_FromString(Py_GetPlatform())); | ||
201 | + SET_SYS_FROM_STRING("arch", | ||
202 | + PyUnicode_FromString(Py_GetArch())); | ||
203 | + SET_SYS_FROM_STRING("lib", | ||
204 | + PyUnicode_FromString(Py_GetLib())); | ||
205 | SET_SYS_FROM_STRING("executable", | ||
206 | PyUnicode_FromWideChar( | ||
207 | Py_GetProgramFullPath(), -1)); | ||
208 | Index: Python-3.3.2/setup.py | ||
209 | =================================================================== | ||
210 | --- Python-3.3.2.orig/setup.py 2013-07-27 16:19:17.000000000 -0700 | ||
211 | +++ Python-3.3.2/setup.py 2013-07-27 16:19:54.107877246 -0700 | ||
212 | @@ -439,7 +439,7 @@ | ||
213 | # directories (i.e. '.' and 'Include') must be first. See issue | ||
214 | # 10520. | ||
215 | if not cross_compiling: | ||
216 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | ||
217 | + add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib)) | ||
218 | add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | ||
219 | # only change this for cross builds for 3.3, issues on Mageia | ||
220 | if cross_compiling: | ||
221 | @@ -497,8 +497,7 @@ | ||
222 | # be assumed that no additional -I,-L directives are needed. | ||
223 | if not cross_compiling: | ||
224 | lib_dirs = self.compiler.library_dirs + [ | ||
225 | - '/lib64', '/usr/lib64', | ||
226 | - '/lib', '/usr/lib', | ||
227 | + '/' + sys.lib, '/usr/' + sys.lib, | ||
228 | ] | ||
229 | inc_dirs = self.compiler.include_dirs + ['/usr/include'] | ||
230 | else: | ||
231 | @@ -675,11 +674,11 @@ | ||
232 | elif curses_library: | ||
233 | readline_libs.append(curses_library) | ||
234 | elif self.compiler.find_library_file(lib_dirs + | ||
235 | - ['/usr/lib/termcap'], | ||
236 | + ['/usr/'+sys.lib+'/termcap'], | ||
237 | 'termcap'): | ||
238 | readline_libs.append('termcap') | ||
239 | exts.append( Extension('readline', ['readline.c'], | ||
240 | - library_dirs=['/usr/lib/termcap'], | ||
241 | + library_dirs=['/usr/'+sys.lib+'/termcap'], | ||
242 | extra_link_args=readline_extra_link_args, | ||
243 | libraries=readline_libs) ) | ||
244 | else: | ||
245 | Index: Python-3.3.2/Lib/sysconfig.py | ||
246 | =================================================================== | ||
247 | --- Python-3.3.2.orig/Lib/sysconfig.py 2013-05-15 09:32:55.000000000 -0700 | ||
248 | +++ Python-3.3.2/Lib/sysconfig.py 2013-07-27 16:19:54.111877246 -0700 | ||
249 | @@ -21,10 +21,10 @@ | ||
250 | |||
251 | _INSTALL_SCHEMES = { | ||
252 | 'posix_prefix': { | ||
253 | - 'stdlib': '{installed_base}/lib/python{py_version_short}', | ||
254 | - 'platstdlib': '{platbase}/lib/python{py_version_short}', | ||
255 | + 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}', | ||
256 | + 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}', | ||
257 | 'purelib': '{base}/lib/python{py_version_short}/site-packages', | ||
258 | - 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', | ||
259 | + 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages', | ||
260 | 'include': | ||
261 | '{installed_base}/include/python{py_version_short}{abiflags}', | ||
262 | 'platinclude': | ||
263 | @@ -33,10 +33,10 @@ | ||
264 | 'data': '{base}', | ||
265 | }, | ||
266 | 'posix_home': { | ||
267 | - 'stdlib': '{installed_base}/lib/python', | ||
268 | - 'platstdlib': '{base}/lib/python', | ||
269 | + 'stdlib': '{installed_base}/'+sys.lib+'/python', | ||
270 | + 'platstdlib': '{base}/'+sys.lib+'/python', | ||
271 | 'purelib': '{base}/lib/python', | ||
272 | - 'platlib': '{base}/lib/python', | ||
273 | + 'platlib': '{base}/'+sys.lib+'/python', | ||
274 | 'include': '{installed_base}/include/python', | ||
275 | 'platinclude': '{installed_base}/include/python', | ||
276 | 'scripts': '{base}/bin', | ||
277 | @@ -81,10 +81,10 @@ | ||
278 | 'data': '{userbase}', | ||
279 | }, | ||
280 | 'posix_user': { | ||
281 | - 'stdlib': '{userbase}/lib/python{py_version_short}', | ||
282 | - 'platstdlib': '{userbase}/lib/python{py_version_short}', | ||
283 | + 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', | ||
284 | + 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', | ||
285 | 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', | ||
286 | - 'platlib': '{userbase}/lib/python{py_version_short}/site-packages', | ||
287 | + 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages', | ||
288 | 'include': '{userbase}/include/python{py_version_short}', | ||
289 | 'scripts': '{userbase}/bin', | ||
290 | 'data': '{userbase}', | ||
291 | Index: Python-3.3.2/configure.ac | ||
292 | =================================================================== | ||
293 | --- Python-3.3.2.orig/configure.ac 2013-05-15 09:33:00.000000000 -0700 | ||
294 | +++ Python-3.3.2/configure.ac 2013-07-27 16:19:54.111877246 -0700 | ||
295 | @@ -769,6 +769,41 @@ | ||
296 | MULTIARCH=$($CC --print-multiarch 2>/dev/null) | ||
297 | AC_SUBST(MULTIARCH) | ||
298 | |||
299 | +AC_SUBST(ARCH) | ||
300 | +AC_MSG_CHECKING(ARCH) | ||
301 | +ARCH=`uname -m` | ||
302 | +case $ARCH in | ||
303 | +i?86) ARCH=i386;; | ||
304 | +esac | ||
305 | +AC_MSG_RESULT($ARCH) | ||
306 | + | ||
307 | +AC_SUBST(LIB) | ||
308 | +AC_MSG_CHECKING(LIB) | ||
309 | +case $ac_sys_system in | ||
310 | +Linux*) | ||
311 | + # Test if the compiler is 64bit | ||
312 | + echo 'int i;' > conftest.$ac_ext | ||
313 | + python_cv_cc_64bit_output=no | ||
314 | + if AC_TRY_EVAL(ac_compile); then | ||
315 | + case `/usr/bin/file conftest.$ac_objext` in | ||
316 | + *"ELF 64"*) | ||
317 | + python_cv_cc_64bit_output=yes | ||
318 | + ;; | ||
319 | + esac | ||
320 | + fi | ||
321 | + rm -rf conftest* | ||
322 | + ;; | ||
323 | +esac | ||
324 | + | ||
325 | +case $ARCH:$python_cv_cc_64bit_output in | ||
326 | +ppc64:yes | powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) | ||
327 | + LIB="lib64" | ||
328 | + ;; | ||
329 | +*:*) | ||
330 | + LIB="lib" | ||
331 | + ;; | ||
332 | +esac | ||
333 | +AC_MSG_RESULT($LIB) | ||
334 | |||
335 | AC_SUBST(LIBRARY) | ||
336 | AC_MSG_CHECKING(LIBRARY) | ||
diff --git a/meta/recipes-devtools/python/python3/python-config.patch b/meta/recipes-devtools/python/python3/python-config.patch new file mode 100644 index 0000000000..f23b8b7df0 --- /dev/null +++ b/meta/recipes-devtools/python/python3/python-config.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | python-config: Revert to using distutils.sysconfig | ||
2 | |||
3 | The newer sysconfig module shares some code with distutils.sysconfig, but the same modifications as in | ||
4 | |||
5 | 12-distutils-prefix-is-inside-staging-area.patch makes distutils.sysconfig | ||
6 | |||
7 | affect the native runtime as well as cross building. Use the old, patched | ||
8 | implementation which returns paths in the staging directory and for the target, | ||
9 | as appropriate. | ||
10 | |||
11 | Upstream-Status: Inappropriate [Embedded Specific] | ||
12 | |||
13 | Signed-off-by: Tyler Hall <tylerwhall@gmail.com> | ||
14 | : | ||
15 | Index: Python-3.3.3/Misc/python-config.in | ||
16 | =================================================================== | ||
17 | --- Python-3.3.3.orig/Misc/python-config.in | ||
18 | +++ Python-3.3.3/Misc/python-config.in | ||
19 | @@ -4,7 +4,7 @@ | ||
20 | import getopt | ||
21 | import os | ||
22 | import sys | ||
23 | -import sysconfig | ||
24 | +from distutils import sysconfig | ||
25 | |||
26 | valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags', | ||
27 | 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir'] | ||
28 | @@ -32,14 +32,14 @@ if '--help' in opt_flags: | ||
29 | |||
30 | for opt in opt_flags: | ||
31 | if opt == '--prefix': | ||
32 | - print(sysconfig.get_config_var('prefix')) | ||
33 | + print(sysconfig.PREFIX) | ||
34 | |||
35 | elif opt == '--exec-prefix': | ||
36 | - print(sysconfig.get_config_var('exec_prefix')) | ||
37 | + print(sysconfig.EXEC_PREFIX) | ||
38 | |||
39 | elif opt in ('--includes', '--cflags'): | ||
40 | - flags = ['-I' + sysconfig.get_path('include'), | ||
41 | - '-I' + sysconfig.get_path('platinclude')] | ||
42 | + flags = ['-I' + sysconfig.get_python_inc(), | ||
43 | + '-I' + sysconfig.get_python_inc(plat_specific=True)] | ||
44 | if opt == '--cflags': | ||
45 | flags.extend(getvar('CFLAGS').split()) | ||
46 | print(' '.join(flags)) | ||
diff --git a/meta/recipes-devtools/python/python3/python3-fix-build-error-with-Readline-6.3.patch b/meta/recipes-devtools/python/python3/python3-fix-build-error-with-Readline-6.3.patch new file mode 100644 index 0000000000..44e2b7e5f1 --- /dev/null +++ b/meta/recipes-devtools/python/python3/python3-fix-build-error-with-Readline-6.3.patch | |||
@@ -0,0 +1,62 @@ | |||
1 | python3: fix build error with Readline 6.3 | ||
2 | |||
3 | Backport two patches from upstream: | ||
4 | |||
5 | use new readline function types (closes #20374) | ||
6 | Issue #20374: Avoid compiler warnings when compiling readline with libedit. | ||
7 | |||
8 | Upstream-Status: Backport | ||
9 | |||
10 | Signed-off-by: Chong Lu <Chong.Lu@windriver.com> | ||
11 | --- | ||
12 | Modules/readline.c | 15 ++++++++++++--- | ||
13 | 1 file changed, 12 insertions(+), 3 deletions(-) | ||
14 | |||
15 | diff --git a/Modules/readline.c b/Modules/readline.c | ||
16 | index 096c6d1..1646ef8 100644 | ||
17 | --- a/Modules/readline.c | ||
18 | +++ b/Modules/readline.c | ||
19 | @@ -773,15 +773,24 @@ on_hook(PyObject *func) | ||
20 | return result; | ||
21 | } | ||
22 | |||
23 | + | ||
24 | static int | ||
25 | +#if defined(_RL_FUNCTION_TYPEDEF) | ||
26 | on_startup_hook(void) | ||
27 | +#else | ||
28 | +on_startup_hook() | ||
29 | +#endif | ||
30 | { | ||
31 | return on_hook(startup_hook); | ||
32 | } | ||
33 | |||
34 | #ifdef HAVE_RL_PRE_INPUT_HOOK | ||
35 | static int | ||
36 | +#if defined(_RL_FUNCTION_TYPEDEF) | ||
37 | on_pre_input_hook(void) | ||
38 | +#else | ||
39 | +on_pre_input_hook() | ||
40 | +#endif | ||
41 | { | ||
42 | return on_hook(pre_input_hook); | ||
43 | } | ||
44 | @@ -936,12 +945,12 @@ setup_readline(void) | ||
45 | rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap); | ||
46 | rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap); | ||
47 | /* Set our hook functions */ | ||
48 | - rl_startup_hook = (Function *)on_startup_hook; | ||
49 | + rl_startup_hook = (rl_hook_func_t *)on_startup_hook; | ||
50 | #ifdef HAVE_RL_PRE_INPUT_HOOK | ||
51 | - rl_pre_input_hook = (Function *)on_pre_input_hook; | ||
52 | + rl_pre_input_hook = (rl_hook_func_t *)on_pre_input_hook; | ||
53 | #endif | ||
54 | /* Set our completion function */ | ||
55 | - rl_attempted_completion_function = (CPPFunction *)flex_complete; | ||
56 | + rl_attempted_completion_function = (rl_completion_func_t *)flex_complete; | ||
57 | /* Set Python word break characters */ | ||
58 | completer_word_break_characters = | ||
59 | rl_completer_word_break_characters = | ||
60 | -- | ||
61 | 1.7.9.5 | ||
62 | |||
diff --git a/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch b/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch new file mode 100644 index 0000000000..8b6476037f --- /dev/null +++ b/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From 43238e1ac13e32984d015c92a5841f3de1fe1d15 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jackie Huang <jackie.huang@windriver.com> | ||
3 | Date: Tue, 18 Nov 2014 00:07:07 -0500 | ||
4 | Subject: [PATCH] setup.py: no host headers libs | ||
5 | |||
6 | When we are cross-compiling, setup.py should never look in /usr | ||
7 | or /usr/local to find headers or libraries. | ||
8 | |||
9 | Upstream-Status: Inappropriate [Cross compile specific] | ||
10 | |||
11 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
12 | --- | ||
13 | setup.py | 3 --- | ||
14 | 1 file changed, 3 deletions(-) | ||
15 | |||
16 | diff --git a/setup.py b/setup.py | ||
17 | index f020b28..e8339cd 100644 | ||
18 | --- a/setup.py | ||
19 | +++ b/setup.py | ||
20 | @@ -444,10 +444,7 @@ class PyBuildExt(build_ext): | ||
21 | if not cross_compiling: | ||
22 | add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib)) | ||
23 | add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | ||
24 | - # only change this for cross builds for 3.3, issues on Mageia | ||
25 | - if cross_compiling: | ||
26 | self.add_gcc_paths() | ||
27 | - if not cross_compiling: | ||
28 | self.add_multiarch_paths() | ||
29 | |||
30 | # Add paths specified in the environment variables LDFLAGS and | ||
31 | -- | ||
32 | 2.0.0 | ||
diff --git a/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch new file mode 100644 index 0000000000..bf0a56f220 --- /dev/null +++ b/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From 53ed216d7bf70dd2a925432b6805a701e5fc3e0e Mon Sep 17 00:00:00 2001 | ||
2 | From: Jackie Huang <jackie.huang@windriver.com> | ||
3 | Date: Mon, 17 Nov 2014 06:44:47 +0000 | ||
4 | Subject: [PATCH] python3 use CROSSPYTHONPATH for PYTHON_FOR_BUILD | ||
5 | |||
6 | Upstream-Status: Inappropriate [Cross compile specific] | ||
7 | |||
8 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
9 | --- | ||
10 | configure.ac | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/configure.ac b/configure.ac | ||
14 | index 989baf9..2890c96 100644 | ||
15 | --- a/configure.ac | ||
16 | +++ b/configure.ac | ||
17 | @@ -67,7 +67,7 @@ if test "$cross_compiling" = yes; then | ||
18 | AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found]) | ||
19 | fi | ||
20 | AC_MSG_RESULT($interp) | ||
21 | - PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp | ||
22 | + PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH) '$interp | ||
23 | fi | ||
24 | elif test "$cross_compiling" = maybe; then | ||
25 | AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH]) | ||
26 | -- | ||
27 | 2.0.1 | ||
diff --git a/meta/recipes-devtools/python/python3/remove_sqlite_rpath.patch b/meta/recipes-devtools/python/python3/remove_sqlite_rpath.patch new file mode 100644 index 0000000000..4ec627ea51 --- /dev/null +++ b/meta/recipes-devtools/python/python3/remove_sqlite_rpath.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | This patch removes the RPATH setting which contains a pointer to | ||
2 | the target relocated sysroot, which is incorrect. | ||
3 | |||
4 | Upstream-Status: Inappropriate [Embedded Specific] | ||
5 | |||
6 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
7 | |||
8 | Index: Python-2.6.6/setup.py | ||
9 | =================================================================== | ||
10 | --- Python-2.6.6.orig/setup.py 2011-09-28 14:22:57.000000000 -0700 | ||
11 | +++ Python-2.6.6/setup.py 2011-09-28 16:11:25.147279633 -0700 | ||
12 | @@ -1079,7 +1079,6 @@ | ||
13 | include_dirs=["Modules/_sqlite", | ||
14 | sqlite_incdir], | ||
15 | library_dirs=sqlite_libdir, | ||
16 | - runtime_library_dirs=sqlite_libdir, | ||
17 | extra_link_args=sqlite_extra_link_args, | ||
18 | libraries=["sqlite3",])) | ||
19 | else: | ||
diff --git a/meta/recipes-devtools/python/python3/setuptweaks.patch b/meta/recipes-devtools/python/python3/setuptweaks.patch new file mode 100644 index 0000000000..c34ef160d3 --- /dev/null +++ b/meta/recipes-devtools/python/python3/setuptweaks.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | This patch removes various ways native system options can pass into the python | ||
2 | compilation and somehow break C modules. | ||
3 | |||
4 | Upstream-Status: Configuration [OE Specific] | ||
5 | |||
6 | RP 2012/04/23 | ||
7 | |||
8 | Index: Python-2.7.2/setup.py | ||
9 | =================================================================== | ||
10 | --- Python-2.7.2.orig/setup.py 2012-04-23 20:03:47.295582553 +0000 | ||
11 | +++ Python-2.7.2/setup.py 2012-04-23 20:03:15.000000000 +0000 | ||
12 | @@ -231,7 +231,13 @@ | ||
13 | # compilers | ||
14 | if compiler is not None: | ||
15 | (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS') | ||
16 | - args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags | ||
17 | + # Need to filter out -isysroot from the flags. Ideally should | ||
18 | + # figure out target flags here. | ||
19 | + flags = [] | ||
20 | + for f in cflags.split(): | ||
21 | + if not f.startswith("-isystem"): | ||
22 | + flags.append(f) | ||
23 | + args['compiler_so'] = compiler + ' ' + ccshared + ' ' + ' '.join(flags) | ||
24 | self.compiler.set_executables(**args) | ||
25 | |||
26 | build_ext.build_extensions(self) | ||
27 | @@ -393,7 +399,6 @@ | ||
28 | # into configure and stored in the Makefile (issue found on OS X 10.3). | ||
29 | for env_var, arg_name, dir_list in ( | ||
30 | ('LDFLAGS', '-R', self.compiler.runtime_library_dirs), | ||
31 | - ('LDFLAGS', '-L', self.compiler.library_dirs), | ||
32 | ('CPPFLAGS', '-I', self.compiler.include_dirs)): | ||
33 | env_val = sysconfig.get_config_var(env_var) | ||
34 | if env_val: | ||
35 | @@ -419,16 +424,16 @@ | ||
36 | for directory in reversed(options.dirs): | ||
37 | add_dir_to_list(dir_list, directory) | ||
38 | |||
39 | - if os.path.normpath(sys.prefix) != '/usr' \ | ||
40 | - and not sysconfig.get_config_var('PYTHONFRAMEWORK'): | ||
41 | +# if os.path.normpath(sys.prefix) != '/usr' \ | ||
42 | +# and not sysconfig.get_config_var('PYTHONFRAMEWORK'): | ||
43 | # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework | ||
44 | # (PYTHONFRAMEWORK is set) to avoid # linking problems when | ||
45 | # building a framework with different architectures than | ||
46 | # the one that is currently installed (issue #7473) | ||
47 | - add_dir_to_list(self.compiler.library_dirs, | ||
48 | - sysconfig.get_config_var("LIBDIR")) | ||
49 | - add_dir_to_list(self.compiler.include_dirs, | ||
50 | - sysconfig.get_config_var("INCLUDEDIR")) | ||
51 | +# add_dir_to_list(self.compiler.library_dirs, | ||
52 | +# sysconfig.get_config_var("LIBDIR")) | ||
53 | +# add_dir_to_list(self.compiler.include_dirs, | ||
54 | +# sysconfig.get_config_var("INCLUDEDIR")) | ||
55 | |||
56 | try: | ||
57 | have_unicode = unicode | ||
diff --git a/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch b/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch new file mode 100644 index 0000000000..802b1c7203 --- /dev/null +++ b/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | shutils should consider symlinks | ||
2 | |||
3 | -Khem | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | --- a/Lib/shutil.py 2013-01-29 12:31:06.926555779 -0800 | ||
8 | +++ b/Lib/shutil.py 2013-01-29 16:31:39.097554182 -0800 | ||
9 | @@ -132,7 +132,7 @@ def copymode(src, dst, *, follow_symlink | ||
10 | st = stat_func(src) | ||
11 | chmod_func(dst, stat.S_IMODE(st.st_mode)) | ||
12 | |||
13 | -if hasattr(os, 'listxattr'): | ||
14 | +if hasattr(os, 'listxattr') and os.listxattr in os.supports_follow_symlinks: | ||
15 | def _copyxattr(src, dst, *, follow_symlinks=True): | ||
16 | """Copy extended filesystem attributes from `src` to `dst`. | ||
17 | |||
diff --git a/meta/recipes-devtools/python/python3/sitecustomize.py b/meta/recipes-devtools/python/python3/sitecustomize.py new file mode 100644 index 0000000000..4c8b5e2ba3 --- /dev/null +++ b/meta/recipes-devtools/python/python3/sitecustomize.py | |||
@@ -0,0 +1,37 @@ | |||
1 | # OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de> | ||
2 | # GPLv2 or later | ||
3 | # Version: 20081123 | ||
4 | # Features: | ||
5 | # * set proper default encoding | ||
6 | # * enable readline completion in the interactive interpreter | ||
7 | # * load command line history on startup | ||
8 | # * save command line history on exit | ||
9 | |||
10 | import os | ||
11 | |||
12 | def __exithandler(): | ||
13 | try: | ||
14 | readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) ) | ||
15 | except IOError: | ||
16 | pass | ||
17 | |||
18 | def __registerExitHandler(): | ||
19 | import atexit | ||
20 | atexit.register( __exithandler ) | ||
21 | |||
22 | def __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 | |||
30 | import sys | ||
31 | try: | ||
32 | import rlcompleter, readline | ||
33 | except ImportError: | ||
34 | pass | ||
35 | else: | ||
36 | __registerExitHandler() | ||
37 | __enableReadlineSupport() | ||
diff --git a/meta/recipes-devtools/python/python3/sys_platform_is_now_always_linux2.patch b/meta/recipes-devtools/python/python3/sys_platform_is_now_always_linux2.patch new file mode 100644 index 0000000000..506210fa17 --- /dev/null +++ b/meta/recipes-devtools/python/python3/sys_platform_is_now_always_linux2.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | Upstream-Status: Accepted [http://hg.python.org/cpython/rev/c816479f6aaf/] | ||
2 | Bugtracker: http://bugs.python.org/issue12326 | ||
3 | |||
4 | [Removed "Misc/NEWS" hunk] | ||
5 | |||
6 | Signed-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 | ||
13 | Issue #12326: sys.platform is now always 'linux2' on Linux | ||
14 | |||
15 | Even if Python is compiled on Linux 3. | ||
16 | |||
17 | Index: Python-3.3.0rc2/configure.ac | ||
18 | =================================================================== | ||
19 | --- Python-3.3.0rc2.orig/configure.ac 2012-09-09 02:11:14.000000000 -0700 | ||
20 | +++ Python-3.3.0rc2/configure.ac 2012-09-20 00:44:03.317124001 -0700 | ||
21 | @@ -366,7 +366,7 @@ | ||
22 | MACHDEP="$ac_md_system$ac_md_release" | ||
23 | |||
24 | case $MACHDEP in | ||
25 | - linux*) MACHDEP="linux";; | ||
26 | + linux*) MACHDEP="linux2";; | ||
27 | cygwin*) MACHDEP="cygwin";; | ||
28 | darwin*) MACHDEP="darwin";; | ||
29 | irix646) MACHDEP="irix6";; | ||
diff --git a/meta/recipes-devtools/python/python3/sysroot-include-headers.patch b/meta/recipes-devtools/python/python3/sysroot-include-headers.patch new file mode 100644 index 0000000000..785b5567f2 --- /dev/null +++ b/meta/recipes-devtools/python/python3/sysroot-include-headers.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | Dont search hardcoded paths, we might be doing a cross-build | ||
2 | Use '=' in-front to let compiler append sysroot, if it can | ||
3 | |||
4 | Should fix things like | ||
5 | |||
6 | configure:6972: arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 -DNDEBUG -fno-inline -D__SOFTFP__ --sysroot=/build/v2013.06/build/tmp-angstrom_v2013_06-eglibc/sysroots/beaglebone -c -O2 -pipe -g -feliminate-unused-debug-types -I/usr/include/ncursesw conftest.c >&5 | ||
7 | cc1: warning: include location "/usr/include/ncursesw" is unsafe for cross-compilation [-Wpoison-system-directories] | ||
8 | |||
9 | |||
10 | Signed-off-by: Khem Raj | ||
11 | Upstream-Status: Pending | ||
12 | |||
13 | |||
14 | Index: Python-3.3.2/setup.py | ||
15 | =================================================================== | ||
16 | --- Python-3.3.2.orig/setup.py 2013-07-30 01:30:48.000000000 -0700 | ||
17 | +++ Python-3.3.2/setup.py 2013-07-30 01:41:11.697862723 -0700 | ||
18 | @@ -1210,7 +1210,7 @@ | ||
19 | panel_library = 'panel' | ||
20 | if curses_library == 'ncursesw': | ||
21 | curses_defines.append(('HAVE_NCURSESW', '1')) | ||
22 | - curses_includes.append('/usr/include/ncursesw') | ||
23 | + curses_includes.append('=/usr/include/ncursesw') | ||
24 | # Bug 1464056: If _curses.so links with ncursesw, | ||
25 | # _curses_panel.so must link with panelw. | ||
26 | panel_library = 'panelw' | ||
27 | @@ -1819,7 +1819,7 @@ | ||
28 | if host_platform == 'darwin': | ||
29 | # OS X 10.5 comes with libffi.dylib; the include files are | ||
30 | # in /usr/include/ffi | ||
31 | - inc_dirs.append('/usr/include/ffi') | ||
32 | + inc_dirs.append('=/usr/include/ffi') | ||
33 | |||
34 | ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")] | ||
35 | if not ffi_inc or ffi_inc[0] == '': | ||
diff --git a/meta/recipes-devtools/python/python3/unixccompiler.patch b/meta/recipes-devtools/python/python3/unixccompiler.patch new file mode 100644 index 0000000000..7b90f13883 --- /dev/null +++ b/meta/recipes-devtools/python/python3/unixccompiler.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information. | ||
4 | This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name. | ||
5 | |||
6 | Secondly add -L=<path> this way linker will be able to resolve /usr/lib w.r.t sysroot and not | ||
7 | use hardcoded /usr/lib to look for libs which is wrong in cross compile environment and this will work | ||
8 | ok on native systems too since sysroot for native compilers is / | ||
9 | |||
10 | Signed-off-by: Mei Lei <lei.mei@intel.com> | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | Index: Python-3.3.2/Lib/distutils/unixccompiler.py | ||
13 | =================================================================== | ||
14 | --- Python-3.3.2.orig/Lib/distutils/unixccompiler.py 2013-05-15 09:32:54.000000000 -0700 | ||
15 | +++ Python-3.3.2/Lib/distutils/unixccompiler.py 2013-08-01 00:58:18.629056286 -0700 | ||
16 | @@ -202,7 +202,9 @@ | ||
17 | # ccompiler.py. | ||
18 | |||
19 | def library_dir_option(self, dir): | ||
20 | - return "-L" + dir | ||
21 | + if dir.startswith("."): | ||
22 | + return "-L" + dir | ||
23 | + return "-L=" + dir | ||
24 | |||
25 | def _is_gcc(self, compiler_name): | ||
26 | return "gcc" in compiler_name or "g++" in compiler_name | ||
27 | @@ -221,7 +221,7 @@ | ||
28 | # this time, there's no way to determine this information from | ||
29 | # the configuration data stored in the Python installation, so | ||
30 | # we use this hack. | ||
31 | - compiler = os.path.basename(sysconfig.get_config_var("CC")) | ||
32 | + compiler = sysconfig.get_config_var("CC") | ||
33 | if sys.platform[:6] == "darwin": | ||
34 | # MacOSX's linker doesn't understand the -R flag at all | ||
35 | return "-L" + dir | ||
diff --git a/meta/recipes-devtools/python/python3_3.3.3.bb b/meta/recipes-devtools/python/python3_3.3.3.bb new file mode 100644 index 0000000000..2c1f63f5b8 --- /dev/null +++ b/meta/recipes-devtools/python/python3_3.3.3.bb | |||
@@ -0,0 +1,219 @@ | |||
1 | require recipes-devtools/python/python.inc | ||
2 | |||
3 | DEPENDS = "python3-native libffi bzip2 db gdbm openssl readline sqlite3 zlib virtual/libintl xz" | ||
4 | PR = "${INC_PR}.0" | ||
5 | PYTHON_MAJMIN = "3.3" | ||
6 | PYTHON_BINABI= "${PYTHON_MAJMIN}m" | ||
7 | DISTRO_SRC_URI ?= "file://sitecustomize.py" | ||
8 | DISTRO_SRC_URI_linuxstdbase = "" | ||
9 | SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \ | ||
10 | file://12-distutils-prefix-is-inside-staging-area.patch \ | ||
11 | file://python-config.patch \ | ||
12 | file://000-cross-compile.patch \ | ||
13 | file://020-dont-compile-python-files.patch \ | ||
14 | file://030-fixup-include-dirs.patch \ | ||
15 | file://070-dont-clean-ipkg-install.patch \ | ||
16 | file://080-distutils-dont_adjust_files.patch \ | ||
17 | file://110-enable-zlib.patch \ | ||
18 | file://130-readline-setup.patch \ | ||
19 | file://150-fix-setupterm.patch \ | ||
20 | file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \ | ||
21 | file://fix-ast.h-dependency.patch \ | ||
22 | file://makerace.patch \ | ||
23 | ${DISTRO_SRC_URI} \ | ||
24 | file://python3-fix-build-error-with-Readline-6.3.patch \ | ||
25 | " | ||
26 | |||
27 | SRC_URI += "\ | ||
28 | file://03-fix-tkinter-detection.patch \ | ||
29 | file://04-default-is-optimized.patch \ | ||
30 | file://avoid_warning_about_tkinter.patch \ | ||
31 | file://06-ctypes-libffi-fix-configure.patch \ | ||
32 | file://remove_sqlite_rpath.patch \ | ||
33 | file://cgi_py.patch \ | ||
34 | file://host_include_contamination.patch \ | ||
35 | file://python-3.3-multilib.patch \ | ||
36 | file://shutil-follow-symlink-fix.patch \ | ||
37 | file://sysroot-include-headers.patch \ | ||
38 | file://unixccompiler.patch \ | ||
39 | file://avoid-ncursesw-include-path.patch \ | ||
40 | file://python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \ | ||
41 | file://python3-setup.py-no-host-headers-libs.patch \ | ||
42 | " | ||
43 | SRC_URI[md5sum] = "f3ebe34d4d8695bf889279b54673e10c" | ||
44 | SRC_URI[sha256sum] = "e526e9b612f623888364d30cc9f3dfc34dcef39065c713bdbcddf47df84d8dcb" | ||
45 | |||
46 | LIC_FILES_CHKSUM = "file://LICENSE;md5=4eaea08eaaf6875189b0c49f26fa2005" | ||
47 | |||
48 | S = "${WORKDIR}/Python-${PV}" | ||
49 | |||
50 | inherit autotools multilib_header python3native pkgconfig | ||
51 | |||
52 | CONFIGUREOPTS += " --with-system-ffi " | ||
53 | |||
54 | CACHED_CONFIGUREVARS = "ac_cv_have_chflags=no \ | ||
55 | ac_cv_have_lchflags=no \ | ||
56 | ac_cv_have_long_long_format=yes \ | ||
57 | ac_cv_buggy_getaddrinfo=no \ | ||
58 | ac_cv_file__dev_ptmx=yes \ | ||
59 | ac_cv_file__dev_ptc=no \ | ||
60 | " | ||
61 | # The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources | ||
62 | #Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :( | ||
63 | TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__" | ||
64 | TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__" | ||
65 | TARGET_CC_ARCH += "-DNDEBUG -fno-inline" | ||
66 | EXTRA_OEMAKE += "CROSS_COMPILE=yes" | ||
67 | EXTRA_OECONF += "CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/" | ||
68 | |||
69 | # No ctypes option for python 3 | ||
70 | PYTHONLSBOPTS = "" | ||
71 | |||
72 | do_configure_prepend() { | ||
73 | rm -f ${S}/Makefile.orig | ||
74 | autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" | ||
75 | } | ||
76 | |||
77 | do_compile() { | ||
78 | # regenerate platform specific files, because they depend on system headers | ||
79 | cd Lib/plat-linux* | ||
80 | include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python3-native/python3 \ | ||
81 | ${S}/Tools/scripts/h2py.py -i '(u_long)' \ | ||
82 | ${STAGING_INCDIR}/dlfcn.h \ | ||
83 | ${STAGING_INCDIR}/linux/cdrom.h \ | ||
84 | ${STAGING_INCDIR}/netinet/in.h \ | ||
85 | ${STAGING_INCDIR}/sys/types.h | ||
86 | sed -e 's,${STAGING_DIR_HOST},,g' -i *.py | ||
87 | cd - | ||
88 | |||
89 | # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144 | ||
90 | sed -i -e s,ccache\ ,'$(CCACHE) ', Makefile | ||
91 | |||
92 | # remove any bogus LD_LIBRARY_PATH | ||
93 | sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile | ||
94 | |||
95 | if [ ! -f Makefile.orig ]; then | ||
96 | install -m 0644 Makefile Makefile.orig | ||
97 | fi | ||
98 | sed -i -e 's,^CONFIGURE_LDFLAGS=.*,CONFIGURE_LDFLAGS=-L. -L${STAGING_LIBDIR},g' \ | ||
99 | -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \ | ||
100 | -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \ | ||
101 | -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \ | ||
102 | -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \ | ||
103 | -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \ | ||
104 | -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \ | ||
105 | Makefile | ||
106 | # save copy of it now, because if we do it in do_install and | ||
107 | # then call do_install twice we get Makefile.orig == Makefile.sysroot | ||
108 | install -m 0644 Makefile Makefile.sysroot | ||
109 | |||
110 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
111 | export PYTHONBUILDDIR="${S}" | ||
112 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ | ||
113 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \ | ||
114 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
115 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
116 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
117 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
118 | LIB=${baselib} \ | ||
119 | ARCH=${TARGET_ARCH} \ | ||
120 | OPT="${CFLAGS}" libpython3.so | ||
121 | |||
122 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ | ||
123 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \ | ||
124 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
125 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
126 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
127 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
128 | LIB=${baselib} \ | ||
129 | ARCH=${TARGET_ARCH} \ | ||
130 | OPT="${CFLAGS}" | ||
131 | } | ||
132 | |||
133 | do_install() { | ||
134 | # make install needs the original Makefile, or otherwise the inclues would | ||
135 | # go to ${D}${STAGING...}/... | ||
136 | install -m 0644 Makefile.orig Makefile | ||
137 | |||
138 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
139 | export PYTHONBUILDDIR="${S}" | ||
140 | install -d ${D}${libdir}/pkgconfig | ||
141 | install -d ${D}${libdir}/python${PYTHON_MAJMIN}/config | ||
142 | |||
143 | # rerun the build once again with original makefile this time | ||
144 | # run install in a separate step to avoid compile/install race | ||
145 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ | ||
146 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \ | ||
147 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
148 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
149 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
150 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
151 | LIB=${baselib} \ | ||
152 | ARCH=${TARGET_ARCH} \ | ||
153 | DESTDIR=${D} LIBDIR=${libdir} | ||
154 | |||
155 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ | ||
156 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \ | ||
157 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
158 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
159 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
160 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
161 | LIB=${baselib} \ | ||
162 | ARCH=${TARGET_ARCH} \ | ||
163 | DESTDIR=${D} LIBDIR=${libdir} install | ||
164 | |||
165 | install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
166 | |||
167 | if [ -e ${WORKDIR}/sitecustomize.py ]; then | ||
168 | install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} | ||
169 | fi | ||
170 | |||
171 | oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h | ||
172 | } | ||
173 | |||
174 | do_install_append_class-nativesdk () { | ||
175 | create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' | ||
176 | } | ||
177 | |||
178 | SSTATE_SCAN_FILES += "Makefile" | ||
179 | PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" | ||
180 | |||
181 | py_package_preprocess () { | ||
182 | # copy back the old Makefile to fix target package | ||
183 | install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
184 | # Remove references to buildmachine paths in target Makefile | ||
185 | 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 | ||
186 | } | ||
187 | |||
188 | require python-${PYTHON_MAJMIN}-manifest.inc | ||
189 | |||
190 | # manual dependency additions | ||
191 | RPROVIDES_${PN}-core = "${PN}" | ||
192 | RRECOMMENDS_${PN}-core = "${PN}-readline" | ||
193 | RRECOMMENDS_${PN}-crypt = "openssl" | ||
194 | RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl" | ||
195 | |||
196 | FILES_${PN}-2to3 += "${bindir}/2to3-${PYTHON_MAJMIN}" | ||
197 | FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3" | ||
198 | FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}" | ||
199 | |||
200 | PACKAGES =+ "${PN}-pyvenv" | ||
201 | FILES_${PN}-pyvenv += "${bindir}/pyvenv-${PYTHON_MAJMIN} ${bindir}/pyvenv" | ||
202 | |||
203 | # package libpython3 | ||
204 | PACKAGES =+ "libpython3 libpython3-staticdev" | ||
205 | FILES_libpython3 = "${libdir}/libpython*.so.*" | ||
206 | FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/libpython${PYTHON_BINABI}.a" | ||
207 | |||
208 | # catch debug extensions (isn't that already in python-core-dbg?) | ||
209 | FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug" | ||
210 | |||
211 | # catch all the rest (unsorted) | ||
212 | PACKAGES += "${PN}-misc" | ||
213 | FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" | ||
214 | |||
215 | # catch manpage | ||
216 | PACKAGES += "${PN}-man" | ||
217 | FILES_${PN}-man = "${datadir}/man" | ||
218 | |||
219 | BBCLASSEXTEND = "nativesdk" | ||
diff --git a/meta/recipes-devtools/python/python_2.7.3.bb b/meta/recipes-devtools/python/python_2.7.3.bb new file mode 100644 index 0000000000..de1f57ffc2 --- /dev/null +++ b/meta/recipes-devtools/python/python_2.7.3.bb | |||
@@ -0,0 +1,195 @@ | |||
1 | require python.inc | ||
2 | DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib" | ||
3 | PR = "${INC_PR}.3" | ||
4 | |||
5 | DISTRO_SRC_URI ?= "file://sitecustomize.py" | ||
6 | DISTRO_SRC_URI_linuxstdbase = "" | ||
7 | SRC_URI += "\ | ||
8 | file://01-use-proper-tools-for-cross-build.patch \ | ||
9 | file://03-fix-tkinter-detection.patch \ | ||
10 | file://05-enable-ctypes-cross-build.patch \ | ||
11 | file://06-ctypes-libffi-fix-configure.patch \ | ||
12 | file://06-avoid_usr_lib_termcap_path_in_linking.patch \ | ||
13 | ${DISTRO_SRC_URI} \ | ||
14 | file://multilib.patch \ | ||
15 | file://cgi_py.patch \ | ||
16 | file://remove_sqlite_rpath.patch \ | ||
17 | file://setup_py_skip_cross_import_check.patch \ | ||
18 | file://add-md5module-support.patch \ | ||
19 | file://host_include_contamination.patch \ | ||
20 | file://fix_for_using_different_libdir.patch \ | ||
21 | file://setuptweaks.patch \ | ||
22 | file://check-if-target-is-64b-not-host.patch \ | ||
23 | file://search_db_h_in_inc_dirs_and_avoid_warning.patch \ | ||
24 | file://avoid_warning_about_tkinter.patch \ | ||
25 | file://avoid_warning_for_sunos_specific_module.patch \ | ||
26 | file://python-2.7.3-berkeley-db-5.3.patch \ | ||
27 | file://python-2.7.3-remove-bsdb-rpath.patch \ | ||
28 | file://builddir.patch \ | ||
29 | file://python-2.7.3-CVE-2012-2135.patch \ | ||
30 | file://gcc-4.8-fix-configure-Wformat.patch \ | ||
31 | file://fix-makefile-for-ptest.patch \ | ||
32 | file://run-ptest \ | ||
33 | file://CVE-2013-4073_py27.patch \ | ||
34 | file://pypirc-secure.patch \ | ||
35 | file://parallel-makeinst-create-bindir.patch \ | ||
36 | file://python-2.7.3-CVE-2013-1752-smtplib-fix.patch \ | ||
37 | file://python-fix-build-error-with-Readline-6.3.patch \ | ||
38 | file://python-2.7.3-CVE-2014-1912.patch \ | ||
39 | file://json-flaw-fix.patch \ | ||
40 | file://posix_close.patch \ | ||
41 | file://python-2.7.3-CVE-2014-7185.patch \ | ||
42 | file://python2.7.3-nossl3.patch \ | ||
43 | file://ctypes-libffi-aarch64.patch \ | ||
44 | file://libffi-aarch64.patch \ | ||
45 | " | ||
46 | |||
47 | S = "${WORKDIR}/Python-${PV}" | ||
48 | |||
49 | inherit autotools multilib_header python-dir pythonnative | ||
50 | |||
51 | # The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources | ||
52 | #Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :( | ||
53 | TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__" | ||
54 | TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__" | ||
55 | |||
56 | # The following is a hack until we drop ac_cv_sizeof_off_t from site files | ||
57 | EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'ac_cv_sizeof_off_t=8', '', d)}" | ||
58 | |||
59 | do_configure_prepend() { | ||
60 | rm -f ${S}/Makefile.orig | ||
61 | autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" | ||
62 | } | ||
63 | |||
64 | do_compile() { | ||
65 | # regenerate platform specific files, because they depend on system headers | ||
66 | cd Lib/plat-linux2 | ||
67 | include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
68 | ${S}/Tools/scripts/h2py.py -i '(u_long)' \ | ||
69 | ${STAGING_INCDIR}/dlfcn.h \ | ||
70 | ${STAGING_INCDIR}/linux/cdrom.h \ | ||
71 | ${STAGING_INCDIR}/netinet/in.h \ | ||
72 | ${STAGING_INCDIR}/sys/types.h | ||
73 | sed -e 's,${STAGING_DIR_HOST},,g' -i *.py | ||
74 | cd - | ||
75 | |||
76 | # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144 | ||
77 | sed -i -e s,ccache\ ,'$(CCACHE) ', Makefile | ||
78 | |||
79 | # remove any bogus LD_LIBRARY_PATH | ||
80 | sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile | ||
81 | |||
82 | if [ ! -f Makefile.orig ]; then | ||
83 | install -m 0644 Makefile Makefile.orig | ||
84 | fi | ||
85 | sed -i -e 's#^LDFLAGS=.*#LDFLAGS=${LDFLAGS} -L. -L${STAGING_LIBDIR}#g' \ | ||
86 | -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \ | ||
87 | -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \ | ||
88 | -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \ | ||
89 | -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \ | ||
90 | -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \ | ||
91 | -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \ | ||
92 | Makefile | ||
93 | # save copy of it now, because if we do it in do_install and | ||
94 | # then call do_install twice we get Makefile.orig == Makefile.sysroot | ||
95 | install -m 0644 Makefile Makefile.sysroot | ||
96 | |||
97 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
98 | export PYTHONBUILDDIR="${S}" | ||
99 | |||
100 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ | ||
101 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
102 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
103 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
104 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
105 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
106 | OPT="${CFLAGS}" | ||
107 | } | ||
108 | |||
109 | do_install() { | ||
110 | # make install needs the original Makefile, or otherwise the inclues would | ||
111 | # go to ${D}${STAGING...}/... | ||
112 | install -m 0644 Makefile.orig Makefile | ||
113 | |||
114 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
115 | export PYTHONBUILDDIR="${S}" | ||
116 | |||
117 | # After swizzling the makefile, we need to run the build again. | ||
118 | # install can race with the build so we have to run this first, then install | ||
119 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ | ||
120 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
121 | CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \ | ||
122 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
123 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
124 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
125 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
126 | DESTDIR=${D} LIBDIR=${libdir} | ||
127 | |||
128 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ | ||
129 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
130 | CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \ | ||
131 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
132 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
133 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
134 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
135 | DESTDIR=${D} LIBDIR=${libdir} install | ||
136 | |||
137 | install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
138 | |||
139 | if [ -e ${WORKDIR}/sitecustomize.py ]; then | ||
140 | install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} | ||
141 | fi | ||
142 | |||
143 | oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h | ||
144 | } | ||
145 | |||
146 | do_install_append_class-nativesdk () { | ||
147 | create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' | ||
148 | } | ||
149 | |||
150 | SSTATE_SCAN_FILES += "Makefile" | ||
151 | PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" | ||
152 | |||
153 | py_package_preprocess () { | ||
154 | # copy back the old Makefile to fix target package | ||
155 | install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
156 | |||
157 | # Remove references to buildmachine paths in target Makefile | ||
158 | 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 | ||
159 | } | ||
160 | |||
161 | require python-${PYTHON_MAJMIN}-manifest.inc | ||
162 | |||
163 | # manual dependency additions | ||
164 | RPROVIDES_${PN}-core = "${PN}" | ||
165 | RRECOMMENDS_${PN}-core = "${PN}-readline" | ||
166 | RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules" | ||
167 | RRECOMMENDS_${PN}-crypt = "openssl" | ||
168 | |||
169 | # package libpython2 | ||
170 | PACKAGES =+ "lib${BPN}2" | ||
171 | FILES_lib${BPN}2 = "${libdir}/libpython*.so.*" | ||
172 | |||
173 | # catch debug extensions (isn't that already in python-core-dbg?) | ||
174 | FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug" | ||
175 | |||
176 | # catch all the rest (unsorted) | ||
177 | PACKAGES += "${PN}-misc" | ||
178 | FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" | ||
179 | RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-misc" | ||
180 | #inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten | ||
181 | inherit ptest | ||
182 | |||
183 | # This must come after inherit ptest for the override to take effect | ||
184 | do_install_ptest() { | ||
185 | cp ${B}/Makefile ${D}${PTEST_PATH} | ||
186 | sed -e s:LIBDIR/python/ptest:${PTEST_PATH}:g \ | ||
187 | -e s:LIBDIR:${libdir}:g \ | ||
188 | -i ${D}${PTEST_PATH}/run-ptest | ||
189 | } | ||
190 | |||
191 | # catch manpage | ||
192 | PACKAGES += "${PN}-man" | ||
193 | FILES_${PN}-man = "${datadir}/man" | ||
194 | |||
195 | BBCLASSEXTEND = "nativesdk" | ||