summaryrefslogtreecommitdiff
path: root/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py
diff options
context:
space:
mode:
Diffstat (limited to 'import-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py')
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py45
1 files changed, 34 insertions, 11 deletions
diff --git a/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py b/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py
index f2ecf8d3f..8c3655d39 100755
--- a/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py
+++ b/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py
@@ -9,10 +9,14 @@
# * Updated to no longer generate special -dbg package, instead use the
# single system -dbg
# * Update version with ".1" to indicate this change
+#
+# February 26, 2017 -- Ming Liu <peter.x.liu@external.atlascopco.com>
+# * Updated to support generating manifest for native python
import os
import sys
import time
+import argparse
VERSION = "2.7.2"
@@ -21,16 +25,16 @@ __version__ = "20110222.2"
class MakefileMaker:
- def __init__( self, outfile ):
+ def __init__( self, outfile, isNative ):
"""initialize"""
self.packages = {}
self.targetPrefix = "${libdir}/python%s/" % VERSION[:3]
+ self.isNative = isNative
self.output = outfile
self.out( """
# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
-# Generator: '%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
-# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
-""" % ( sys.argv[0], __version__ ) )
+# Generator: '%s%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+""" % ( sys.argv[0], ' --native' if isNative else '', __version__ ) )
#
# helper functions
@@ -66,6 +70,20 @@ class MakefileMaker:
global VERSION
#
+ # generate rprovides line for native
+ #
+
+ if self.isNative:
+ rprovideLine = 'RPROVIDES+="'
+ for name in sorted(self.packages):
+ rprovideLine += "%s-native " % name.replace( '${PN}', 'python' )
+ rprovideLine += '"'
+
+ self.out( rprovideLine )
+ self.out( "" )
+ return
+
+ #
# generate provides line
#
@@ -147,17 +165,21 @@ class MakefileMaker:
self.doEpilog()
if __name__ == "__main__":
+ parser = argparse.ArgumentParser( description='generate python manifest' )
+ parser.add_argument( '-n', '--native', help='generate manifest for native python', action='store_true' )
+ parser.add_argument( 'outfile', metavar='OUTPUT_FILE', nargs='?', default='', help='Output file (defaults to stdout)' )
+ args = parser.parse_args()
- if len( sys.argv ) > 1:
+ if args.outfile:
try:
- os.unlink(sys.argv[1])
+ os.unlink( args.outfile )
except Exception:
sys.exc_clear()
- outfile = open( sys.argv[1], "w" )
+ outfile = open( args.outfile, "w" )
else:
outfile = sys.stdout
- m = MakefileMaker( outfile )
+ m = MakefileMaker( outfile, args.native )
# Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies!
# Parameters: revision, name, description, dependencies, filenames
@@ -171,7 +193,7 @@ if __name__ == "__main__":
"UserDict.* UserList.* UserString.* " +
"lib-dynload/binascii.so lib-dynload/_struct.so lib-dynload/time.so " +
"lib-dynload/xreadlines.so types.* platform.* ${bindir}/python* " +
- "_weakrefset.* sysconfig.* _sysconfigdata.* config/Makefile " +
+ "_weakrefset.* sysconfig.* _sysconfigdata.* " +
"${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h " +
"${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py ")
@@ -185,7 +207,8 @@ if __name__ == "__main__":
"${base_libdir}/*.a " +
"${base_libdir}/*.o " +
"${datadir}/aclocal " +
- "${datadir}/pkgconfig " )
+ "${datadir}/pkgconfig " +
+ "config/Makefile ")
m.addPackage( "${PN}-2to3", "Python automated Python 2 to 3 code translator", "${PN}-core",
"${bindir}/2to3 lib2to3" ) # package
@@ -360,7 +383,7 @@ if __name__ == "__main__":
m.addPackage( "${PN}-terminal", "Python terminal controlling support", "${PN}-core ${PN}-io",
"pty.* tty.*" )
- m.addPackage( "${PN}-tests", "Python tests", "${PN}-core",
+ m.addPackage( "${PN}-tests", "Python tests", "${PN}-core ${PN}-modules",
"test" ) # package
m.addPackage( "${PN}-threading", "Python threading & synchronization support", "${PN}-core ${PN}-lang",