summaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool/create.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-09-22 17:21:39 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-23 09:53:20 +0100
commitc4181c6e7ec9626f58e5eeddc8b94c442f19a235 (patch)
treecd4f94e1f261ac2e2619b88eae88b1e0fbce83e1 /scripts/lib/recipetool/create.py
parent76084cdfa6b303f60d10484b84252c7b1560a0ec (diff)
downloadpoky-c4181c6e7ec9626f58e5eeddc8b94c442f19a235.tar.gz
devtool / recipetool: add handling for binary-only packages
Add a means of creating recipes for package files or archives that contain a directory structure to be installed verbatim, for example an rpm file. (We mostly just re-use bin_package here and skip some of the normal build system checks.) This support is available in "recipetool create" and "devtool add" which wraps the former. (From OE-Core rev: 9e0a6b2e6f16185f8032d36b77d40802bc388987) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/recipetool/create.py')
-rw-r--r--scripts/lib/recipetool/create.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 409b255f5f..844073bf59 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -104,6 +104,10 @@ def create_recipe(args):
104 if '://' in args.source: 104 if '://' in args.source:
105 # Fetch a URL 105 # Fetch a URL
106 fetchuri = urlparse.urldefrag(args.source)[0] 106 fetchuri = urlparse.urldefrag(args.source)[0]
107 if args.binary:
108 # Assume the archive contains the directory structure verbatim
109 # so we need to extract to a subdirectory
110 fetchuri += ';subdir=%s' % os.path.splitext(os.path.basename(urlparse.urlsplit(fetchuri).path))[0]
107 srcuri = fetchuri 111 srcuri = fetchuri
108 rev_re = re.compile(';rev=([^;]+)') 112 rev_re = re.compile(';rev=([^;]+)')
109 res = rev_re.search(srcuri) 113 res = rev_re.search(srcuri)
@@ -226,6 +230,10 @@ def create_recipe(args):
226 lines_after.append('PACKAGE_ARCH = "%s"' % pkgarch) 230 lines_after.append('PACKAGE_ARCH = "%s"' % pkgarch)
227 lines_after.append('') 231 lines_after.append('')
228 232
233 if args.binary:
234 lines_after.append('INSANE_SKIP_${PN} += "already-stripped"')
235 lines_after.append('')
236
229 # Find all plugins that want to register handlers 237 # Find all plugins that want to register handlers
230 handlers = [] 238 handlers = []
231 for plugin in plugins: 239 for plugin in plugins:
@@ -235,6 +243,11 @@ def create_recipe(args):
235 # Apply the handlers 243 # Apply the handlers
236 classes = [] 244 classes = []
237 handled = [] 245 handled = []
246
247 if args.binary:
248 classes.append('bin_package')
249 handled.append('buildsystem')
250
238 for handler in handlers: 251 for handler in handlers:
239 handler.process(srctree, classes, lines_before, lines_after, handled) 252 handler.process(srctree, classes, lines_before, lines_after, handled)
240 253
@@ -426,5 +439,6 @@ def register_command(subparsers):
426 parser_create.add_argument('-m', '--machine', help='Make recipe machine-specific as opposed to architecture-specific', action='store_true') 439 parser_create.add_argument('-m', '--machine', help='Make recipe machine-specific as opposed to architecture-specific', action='store_true')
427 parser_create.add_argument('-x', '--extract-to', metavar='EXTRACTPATH', help='Assuming source is a URL, fetch it and extract it to the directory specified as %(metavar)s') 440 parser_create.add_argument('-x', '--extract-to', metavar='EXTRACTPATH', help='Assuming source is a URL, fetch it and extract it to the directory specified as %(metavar)s')
428 parser_create.add_argument('-V', '--version', help='Version to use within recipe (PV)') 441 parser_create.add_argument('-V', '--version', help='Version to use within recipe (PV)')
442 parser_create.add_argument('-b', '--binary', help='Treat the source tree as something that should be installed verbatim (no compilation, same directory structure)', action='store_true')
429 parser_create.set_defaults(func=create_recipe) 443 parser_create.set_defaults(func=create_recipe)
430 444