summaryrefslogtreecommitdiffstats
path: root/scripts/contrib/python/generate-manifest-3.5.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/contrib/python/generate-manifest-3.5.py')
-rwxr-xr-xscripts/contrib/python/generate-manifest-3.5.py442
1 files changed, 0 insertions, 442 deletions
diff --git a/scripts/contrib/python/generate-manifest-3.5.py b/scripts/contrib/python/generate-manifest-3.5.py
deleted file mode 100755
index 7dfae46992..0000000000
--- a/scripts/contrib/python/generate-manifest-3.5.py
+++ /dev/null
@@ -1,442 +0,0 @@
1#!/usr/bin/env python
2
3# generate Python Manifest for the OpenEmbedded build system
4# (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
5# (C) 2007 Jeremy Laine
6# licensed under MIT, see COPYING.MIT
7#
8# June 22, 2011 -- Mark Hatle <mark.hatle@windriver.com>
9# * Updated to no longer generate special -dbg package, instead use the
10# single system -dbg
11# * Update version with ".1" to indicate this change
12#
13# 2014 Khem Raj <raj.khem@gmail.com>
14# Added python3 support
15#
16# February 26, 2017 -- Ming Liu <peter.x.liu@external.atlascopco.com>
17# * Updated to support generating manifest for native python3
18
19import os
20import sys
21import time
22import argparse
23
24VERSION = "3.5.0"
25
26__author__ = "Michael 'Mickey' Lauer <mlauer@vanille-media.de>"
27__version__ = "20140131"
28
29class MakefileMaker:
30
31 def __init__( self, outfile, isNative ):
32 """initialize"""
33 self.packages = {}
34 self.excluded_pkgs = []
35 self.targetPrefix = "${libdir}/python%s/" % VERSION[:3]
36 self.isNative = isNative
37 self.output = outfile
38 self.out( """
39# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
40# Generator: '%s%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
41""" % ( sys.argv[0], ' --native' if isNative else '', __version__ ) )
42
43 #
44 # helper functions
45 #
46
47 def out( self, data ):
48 """print a line to the output file"""
49 self.output.write( "%s\n" % data )
50
51 def setPrefix( self, targetPrefix ):
52 """set a file prefix for addPackage files"""
53 self.targetPrefix = targetPrefix
54
55 def doProlog( self ):
56 self.out( """ """ )
57 self.out( "" )
58
59 def addPackage( self, name, description, dependencies, filenames, mod_exclude = False ):
60 """add a package to the Makefile"""
61 if type( filenames ) == type( "" ):
62 filenames = filenames.split()
63 fullFilenames = []
64 for filename in filenames:
65 if filename[0] != "$":
66 fullFilenames.append( "%s%s" % ( self.targetPrefix, filename ) )
67 fullFilenames.append( "%s%s" % ( self.targetPrefix,
68 self.pycachePath( filename ) ) )
69 else:
70 fullFilenames.append( filename )
71 if mod_exclude:
72 self.excluded_pkgs.append( name )
73 self.packages[name] = description, dependencies, fullFilenames
74
75 def pycachePath( self, filename ):
76 dirname = os.path.dirname( filename )
77 basename = os.path.basename( filename )
78 if '.' in basename:
79 return os.path.join( dirname, '__pycache__', basename )
80 else:
81 return os.path.join( dirname, basename, '__pycache__' )
82
83 def doBody( self ):
84 """generate body of Makefile"""
85
86 global VERSION
87
88 #
89 # generate rprovides line for native
90 #
91
92 if self.isNative:
93 pkglist = []
94 for name in ['${PN}-modules'] + sorted(self.packages):
95 pkglist.append('%s-native' % name.replace('${PN}', 'python3'))
96
97 self.out('RPROVIDES += "%s"' % " ".join(pkglist))
98 return
99
100 #
101 # generate provides line
102 #
103
104 provideLine = 'PROVIDES+="\\\n'
105 for name in sorted(self.packages):
106 provideLine += " %s \\\n" % name
107 provideLine += '"'
108
109 self.out( provideLine )
110 self.out( "" )
111
112 #
113 # generate package line
114 #
115
116 packageLine = 'PACKAGES="\\\n'
117 packageLine += ' ${PN}-dbg \\\n'
118 for name in sorted(self.packages):
119 if name.startswith("${PN}-distutils"):
120 if name == "${PN}-distutils":
121 packageLine += "%s \\\n %s-staticdev \\\n" % (name, name)
122 elif name != '${PN}-dbg':
123 packageLine += " %s \\\n" % name
124 packageLine += ' ${PN}-modules \\\n"'
125
126 self.out( packageLine )
127 self.out( "" )
128
129 #
130 # generate package variables
131 #
132
133 for name, data in sorted(self.packages.items()):
134 desc, deps, files = data
135
136 #
137 # write out the description, revision and dependencies
138 #
139 self.out( 'SUMMARY_%s="%s"' % ( name, desc ) )
140 self.out( 'RDEPENDS_%s="%s"' % ( name, deps ) )
141
142 line = 'FILES_%s="\\\n' % name
143
144 #
145 # check which directories to make in the temporary directory
146 #
147
148 dirset = {} # if python had a set-datatype this would be sufficient. for now, we're using a dict instead.
149 for target in files:
150 dirset[os.path.dirname( target )] = True
151
152 #
153 # generate which files to copy for the target (-dfR because whole directories are also allowed)
154 #
155
156 for target in files:
157 line += " %s \\\n" % target
158
159 line += '"'
160 self.out( line )
161 self.out( "" )
162
163 self.out( 'SUMMARY_${PN}-modules="All Python modules"' )
164 line = 'RDEPENDS_${PN}-modules=" \\\n'
165
166 for name, data in sorted(self.packages.items()):
167 if name not in ['${PN}-dev', '${PN}-distutils-staticdev'] and name not in self.excluded_pkgs:
168 line += " %s \\\n" % name
169
170 line += '"'
171 self.out( line )
172 self.out( 'ALLOW_EMPTY_${PN}-modules = "1"' )
173
174 def doEpilog( self ):
175 self.out( """""" )
176 self.out( "" )
177
178 def make( self ):
179 self.doProlog()
180 self.doBody()
181 self.doEpilog()
182
183if __name__ == "__main__":
184 parser = argparse.ArgumentParser( description='generate python3 manifest' )
185 parser.add_argument( '-n', '--native', help='generate manifest for native python3', action='store_true' )
186 parser.add_argument( 'outfile', metavar='OUTPUT_FILE', nargs='?', default='', help='Output file (defaults to stdout)' )
187 args = parser.parse_args()
188
189 if args.outfile:
190 try:
191 os.unlink( args.outfile )
192 except Exception:
193 sys.exc_clear()
194 outfile = open( args.outfile, "w" )
195 else:
196 outfile = sys.stdout
197
198 m = MakefileMaker( outfile, args.native )
199
200 # Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies!
201 # Parameters: revision, name, description, dependencies, filenames
202 #
203
204 m.addPackage( "${PN}-core", "Python interpreter and core modules", "${PN}-lang ${PN}-re ${PN}-reprlib ${PN}-codecs ${PN}-io ${PN}-math",
205 "__future__.* _abcoll.* abc.* ast.* copy.* copyreg.* configparser.* " +
206 "genericpath.* getopt.* linecache.* new.* " +
207 "os.* posixpath.* struct.* " +
208 "warnings.* site.* stat.* " +
209 "UserDict.* UserList.* UserString.* " +
210 "lib-dynload/binascii.*.so lib-dynload/_struct.*.so lib-dynload/time.*.so " +
211 "lib-dynload/xreadlines.*.so types.* platform.* ${bindir}/python* " +
212 "_weakrefset.* sysconfig.* _sysconfigdata.* " +
213 "${includedir}/python${PYTHON_BINABI}/pyconfig*.h " +
214 "${libdir}/python${PYTHON_MAJMIN}/collections " +
215 "${libdir}/python${PYTHON_MAJMIN}/_collections_abc.* " +
216 "${libdir}/python${PYTHON_MAJMIN}/_markupbase.* " +
217 "${libdir}/python${PYTHON_MAJMIN}/_sitebuiltins.* " +
218 "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py ")
219
220 m.addPackage( "${PN}-dev", "Python development package", "${PN}-core",
221 "${includedir} " +
222 "${libdir}/lib*${SOLIBSDEV} " +
223 "${libdir}/*.la " +
224 "${libdir}/*.a " +
225 "${libdir}/*.o " +
226 "${libdir}/pkgconfig " +
227 "${base_libdir}/*.a " +
228 "${base_libdir}/*.o " +
229 "${datadir}/aclocal " +
230 "${datadir}/pkgconfig " +
231 "config*/Makefile ")
232
233 m.addPackage( "${PN}-2to3", "Python automated Python 2 to 3 code translator", "${PN}-core",
234 "lib2to3" ) # package
235
236 m.addPackage( "${PN}-idle", "Python Integrated Development Environment", "${PN}-core ${PN}-tkinter",
237 "${bindir}/idle idlelib" ) # package
238
239 m.addPackage( "${PN}-pydoc", "Python interactive help support", "${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re",
240 "${bindir}/pydoc pydoc.* pydoc_data" )
241
242 m.addPackage( "${PN}-smtpd", "Python Simple Mail Transport Daemon", "${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime",
243 "${bindir}/smtpd.* smtpd.*" )
244
245 m.addPackage( "${PN}-audio", "Python Audio Handling", "${PN}-core",
246 "wave.* chunk.* sndhdr.* lib-dynload/ossaudiodev.*.so lib-dynload/audioop.*.so audiodev.* sunaudio.* sunau.* toaiff.*" )
247
248 m.addPackage( "${PN}-argparse", "Python command line argument parser", "${PN}-core ${PN}-codecs ${PN}-textutils",
249 "argparse.*" )
250
251 m.addPackage( "${PN}-asyncio", "Python Asynchronous I/O, event loop, coroutines and tasks", "${PN}-core",
252 "asyncio" )
253
254 m.addPackage( "${PN}-codecs", "Python codecs, encodings & i18n support", "${PN}-core ${PN}-lang",
255 "codecs.* encodings gettext.* locale.* lib-dynload/_locale.*.so lib-dynload/_codecs* lib-dynload/_multibytecodec.*.so lib-dynload/unicodedata.*.so stringprep.* xdrlib.*" )
256
257 m.addPackage( "${PN}-compile", "Python bytecode compilation support", "${PN}-core",
258 "py_compile.* compileall.*" )
259
260 m.addPackage( "${PN}-compression", "Python high-level compression support", "${PN}-core ${PN}-codecs ${PN}-importlib ${PN}-threading ${PN}-shell",
261 "gzip.* zipfile.* tarfile.* lib-dynload/bz2.*.so lib-dynload/zlib.*.so bz2.py lzma.py _compression.py" )
262
263 m.addPackage( "${PN}-crypt", "Python basic cryptographic and hashing support", "${PN}-core",
264 "hashlib.* md5.* sha.* lib-dynload/crypt.*.so lib-dynload/_hashlib.*.so lib-dynload/_sha256.*.so lib-dynload/_sha512.*.so" )
265
266 m.addPackage( "${PN}-textutils", "Python option parsing, text wrapping and CSV support", "${PN}-core ${PN}-io ${PN}-re ${PN}-stringold",
267 "lib-dynload/_csv.*.so csv.* optparse.* textwrap.*" )
268
269 m.addPackage( "${PN}-curses", "Python curses support", "${PN}-core",
270 "curses lib-dynload/_curses.*.so lib-dynload/_curses_panel.*.so" ) # directory + low level module
271
272 m.addPackage( "${PN}-ctypes", "Python C types support", "${PN}-core ${PN}-subprocess",
273 "ctypes lib-dynload/_ctypes.*.so lib-dynload/_ctypes_test.*.so" ) # directory + low level module
274
275 m.addPackage( "${PN}-datetime", "Python calendar and time support", "${PN}-core ${PN}-codecs",
276 "_strptime.* calendar.* datetime.* lib-dynload/_datetime.*.so" )
277
278 m.addPackage( "${PN}-db", "Python file-based database support", "${PN}-core",
279 "anydbm.* dumbdbm.* whichdb.* dbm lib-dynload/_dbm.*.so" )
280
281 m.addPackage( "${PN}-debugger", "Python debugger", "${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint ${PN}-importlib ${PN}-pkgutil",
282 "bdb.* pdb.*" )
283
284 m.addPackage( "${PN}-difflib", "Python helpers for computing deltas between objects", "${PN}-lang ${PN}-re",
285 "difflib.*" )
286
287 m.addPackage( "${PN}-distutils-staticdev", "Python distribution utilities (static libraries)", "${PN}-distutils",
288 "config/lib*.a" ) # package
289
290 m.addPackage( "${PN}-distutils", "Python Distribution Utilities", "${PN}-core ${PN}-email",
291 "config distutils" ) # package
292
293 m.addPackage( "${PN}-doctest", "Python framework for running examples in docstrings", "${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib",
294 "doctest.*" )
295
296 m.addPackage( "${PN}-email", "Python email support", "${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient",
297 "imaplib.* email" ) # package
298
299 m.addPackage( "${PN}-enum", "Python support for enumerations", "${PN}-core",
300 "enum.*" )
301
302 m.addPackage( "${PN}-fcntl", "Python's fcntl interface", "${PN}-core",
303 "lib-dynload/fcntl.*.so" )
304
305 m.addPackage( "${PN}-html", "Python HTML processing support", "${PN}-core",
306 "formatter.* htmlentitydefs.* html htmllib.* markupbase.* sgmllib.* HTMLParser.* " )
307
308 m.addPackage( "${PN}-importlib", "Python import implementation library", "${PN}-core ${PN}-lang",
309 "importlib imp.*" )
310
311 m.addPackage( "${PN}-gdbm", "Python GNU database support", "${PN}-core",
312 "lib-dynload/_gdbm.*.so" )
313
314 m.addPackage( "${PN}-image", "Python graphical image handling", "${PN}-core",
315 "colorsys.* imghdr.* lib-dynload/imageop.*.so lib-dynload/rgbimg.*.so" )
316
317 m.addPackage( "${PN}-io", "Python low-level I/O", "${PN}-core ${PN}-math",
318 "lib-dynload/_socket.*.so lib-dynload/_io.*.so lib-dynload/_ssl.*.so lib-dynload/select.*.so lib-dynload/termios.*.so lib-dynload/cStringIO.*.so " +
319 "ipaddress.* pipes.* socket.* ssl.* tempfile.* StringIO.* io.* _pyio.*" )
320
321 m.addPackage( "${PN}-json", "Python JSON support", "${PN}-core ${PN}-math ${PN}-re",
322 "json lib-dynload/_json.*.so" ) # package
323
324 m.addPackage( "${PN}-lang", "Python low-level language support", "${PN}-core ${PN}-importlib",
325 "lib-dynload/_bisect.*.so lib-dynload/_collections.*.so lib-dynload/_heapq.*.so lib-dynload/_weakref.*.so lib-dynload/_functools.*.so " +
326 "lib-dynload/array.*.so lib-dynload/itertools.*.so lib-dynload/operator.*.so lib-dynload/parser.*.so " +
327 "atexit.* bisect.* code.* codeop.* collections.* _collections_abc.* contextlib.* dis.* functools.* heapq.* inspect.* keyword.* opcode.* operator.* symbol.* repr.* token.* " +
328 "tokenize.* traceback.* weakref.*" )
329
330 m.addPackage( "${PN}-logging", "Python logging support", "${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold",
331 "logging" ) # package
332
333 m.addPackage( "${PN}-mailbox", "Python mailbox format support", "${PN}-core ${PN}-mime",
334 "mailbox.*" )
335
336 m.addPackage( "${PN}-math", "Python math support", "${PN}-core ${PN}-crypt",
337 "lib-dynload/cmath.*.so lib-dynload/math.*.so lib-dynload/_random.*.so random.* sets.*" )
338
339 m.addPackage( "${PN}-mime", "Python MIME handling APIs", "${PN}-core ${PN}-io",
340 "mimetools.* uu.* quopri.* rfc822.* MimeWriter.*" )
341
342 m.addPackage( "${PN}-mmap", "Python memory-mapped file support", "${PN}-core ${PN}-io",
343 "lib-dynload/mmap.*.so " )
344
345 m.addPackage( "${PN}-multiprocessing", "Python multiprocessing support", "${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap",
346 "lib-dynload/_multiprocessing.*.so multiprocessing" ) # package
347
348 m.addPackage( "${PN}-netclient", "Python Internet Protocol clients", "${PN}-argparse ${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime ${PN}-html",
349 "*Cookie*.* " +
350 "base64.* cookielib.* ftplib.* gopherlib.* hmac.* http* httplib.* mimetypes.* nntplib.* poplib.* smtplib.* telnetlib.* urllib uuid.* rfc822.* mimetools.*" )
351
352 m.addPackage( "${PN}-netserver", "Python Internet Protocol servers", "${PN}-core ${PN}-netclient ${PN}-shell ${PN}-threading",
353 "cgi.* socketserver.* *HTTPServer.* SocketServer.*" )
354
355 m.addPackage( "${PN}-numbers", "Python number APIs", "${PN}-core ${PN}-lang ${PN}-re",
356 "decimal.* fractions.* numbers.*" )
357
358 m.addPackage( "${PN}-pickle", "Python serialisation/persistence support", "${PN}-core ${PN}-codecs ${PN}-io ${PN}-re",
359 "_compat_pickle.* pickle.* shelve.* lib-dynload/cPickle.*.so pickletools.*" )
360
361 m.addPackage( "${PN}-pkgutil", "Python package extension utility support", "${PN}-core",
362 "pkgutil.*")
363
364 m.addPackage( "${PN}-plistlib", "Generate and parse Mac OS X .plist files", "${PN}-core ${PN}-datetime ${PN}-io",
365 "plistlib.*")
366
367 m.addPackage( "${PN}-pprint", "Python pretty-print support", "${PN}-core ${PN}-io",
368 "pprint.*" )
369
370 m.addPackage( "${PN}-profile", "Python basic performance profiling support", "${PN}-core ${PN}-textutils",
371 "profile.* pstats.* cProfile.* lib-dynload/_lsprof.*.so" )
372
373 m.addPackage( "${PN}-re", "Python Regular Expression APIs", "${PN}-core",
374 "re.* sre.* sre_compile.* sre_constants* sre_parse.*" ) # _sre is builtin
375
376 m.addPackage( "${PN}-readline", "Python readline support", "${PN}-core",
377 "lib-dynload/readline.*.so rlcompleter.*" )
378
379 m.addPackage( "${PN}-reprlib", "Python alternate repr() implementation", "${PN}-core",
380 "reprlib.py" )
381
382 m.addPackage( "${PN}-resource", "Python resource control interface", "${PN}-core",
383 "lib-dynload/resource.*.so" )
384
385 m.addPackage( "${PN}-runpy", "Python script for locating/executing scripts in module namespace", "${PN}-core ${PN}-pkgutil",
386 "runpy.*" )
387
388 m.addPackage( "${PN}-selectors", "Python High-level I/O multiplexing", "${PN}-core",
389 "selectors.*" )
390
391 m.addPackage( "${PN}-shell", "Python shell-like functionality", "${PN}-core ${PN}-re ${PN}-compression",
392 "cmd.* commands.* dircache.* fnmatch.* glob.* popen2.* shlex.* shutil.*" )
393
394 m.addPackage( "${PN}-signal", "Python set handlers for asynchronous events support", "${PN}-core ${PN}-enum",
395 "signal.*" )
396
397 m.addPackage( "${PN}-subprocess", "Python subprocess support", "${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle ${PN}-threading ${PN}-signal ${PN}-selectors",
398 "subprocess.* lib-dynload/_posixsubprocess.*.so" )
399
400 m.addPackage( "${PN}-sqlite3", "Python Sqlite3 database support", "${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading",
401 "lib-dynload/_sqlite3.*.so sqlite3/dbapi2.* sqlite3/__init__.* sqlite3/dump.*" )
402
403 m.addPackage( "${PN}-sqlite3-tests", "Python Sqlite3 database support tests", "${PN}-core ${PN}-sqlite3",
404 "sqlite3/test" )
405
406 m.addPackage( "${PN}-stringold", "Python string APIs [deprecated]", "${PN}-core ${PN}-re",
407 "lib-dynload/strop.*.so string.* stringold.*" )
408
409 m.addPackage( "${PN}-syslog", "Python syslog interface", "${PN}-core",
410 "lib-dynload/syslog.*.so" )
411
412 m.addPackage( "${PN}-terminal", "Python terminal controlling support", "${PN}-core ${PN}-io",
413 "pty.* tty.*" )
414
415 m.addPackage( "${PN}-tests", "Python tests", "${PN}-core ${PN}-compression",
416 "test", True ) # package
417
418 m.addPackage( "${PN}-threading", "Python threading & synchronization support", "${PN}-core ${PN}-lang",
419 "_threading_local.* dummy_thread.* dummy_threading.* mutex.* threading.* queue.*" )
420
421 m.addPackage( "${PN}-tkinter", "Python Tcl/Tk bindings", "${PN}-core",
422 "lib-dynload/_tkinter.*.so lib-tk tkinter" ) # package
423
424 m.addPackage( "${PN}-typing", "Python typing support", "${PN}-core",
425 "typing.*" )
426
427 m.addPackage( "${PN}-unittest", "Python unit testing framework", "${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell",
428 "unittest/" )
429
430 m.addPackage( "${PN}-unixadmin", "Python Unix administration support", "${PN}-core",
431 "lib-dynload/nis.*.so lib-dynload/grp.*.so lib-dynload/pwd.*.so getpass.*" )
432
433 m.addPackage( "${PN}-xml", "Python basic XML support", "${PN}-core ${PN}-re",
434 "lib-dynload/_elementtree.*.so lib-dynload/pyexpat.*.so xml xmllib.*" ) # package
435
436 m.addPackage( "${PN}-xmlrpc", "Python XML-RPC support", "${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang ${PN}-pydoc",
437 "xmlrpclib.* SimpleXMLRPCServer.* DocXMLRPCServer.* xmlrpc" )
438
439 m.addPackage( "${PN}-mailbox", "Python mailbox format support", "${PN}-core ${PN}-mime",
440 "mailbox.*" )
441
442 m.make()