aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/populate_sdk_ext.bbclass
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-01-23 00:59:48 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-22 23:42:55 +0000
commit67149ea097d6fab7496b43e85a40853f40bd527e (patch)
treebd19c5deff9189008b1ce772907afc945ffdb00b /meta/classes/populate_sdk_ext.bbclass
parent8d760bd9df101a03f148205e7d79b555b4dfd8c7 (diff)
downloadopenembedded-core-contrib-67149ea097d6fab7496b43e85a40853f40bd527e.tar.gz
classes/populate_sdk_ext: add option to bring in pkgdata for world
Add a variable SDK_INCLUDE_PKGDATA which you can set to "1" to include pkgdata for all recipes in the world target. There are a couple of uses for this: 1) If you use "devtool add" to add a recipe that builds something which depends on anything in world, the dependency can then be correctly mapped to the recipe providing it and that recipe can be added to DEPENDS, since we have the pkg-config and shared library dependency data within pkgdata. 2) You'll be able to search for these recipes and any files they package for the target with "devtool search" since that also uses pkgdata This of course assumes you've tailored world through EXCLUDE_FROM_WORLD to only include recipes you'd want built in your distro, but I think that's a reasonable assumption; failing that there is a WORLD_PKGDATA_EXCLUDE variable that you can set to exclude any recipes you don't want. Note that this patch relies on functionality implemented in a recent BitBake patch and will not work without it. Implements [YOCTO #8600]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/populate_sdk_ext.bbclass')
-rw-r--r--meta/classes/populate_sdk_ext.bbclass24
1 files changed, 22 insertions, 2 deletions
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index e5e55b3606..ebb57bba6b 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -24,6 +24,7 @@ SDK_INHERIT_BLACKLIST ?= "buildhistory icecc"
SDK_UPDATE_URL ?= ""
SDK_TARGETS ?= "${PN}"
+SDK_INSTALL_TARGETS = "${SDK_TARGETS} ${@'meta-world-pkgdata:do_allpackagedata' if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1' else ''}"
OE_INIT_ENV_SCRIPT ?= "oe-init-build-env"
# The files from COREBASE that you want preserved in the COREBASE copied
@@ -45,6 +46,7 @@ SDK_TITLE_task-populate-sdk-ext = "${@d.getVar('DISTRO_NAME', True) or d.getVar(
python copy_buildsystem () {
import re
+ import shutil
import oe.copy_buildsystem
oe_init_env_script = d.getVar('OE_INIT_ENV_SCRIPT', True)
@@ -91,6 +93,7 @@ python copy_buildsystem () {
config.set('General', 'core_meta_subdir', core_meta_subdir)
config.add_section('SDK')
config.set('SDK', 'sdk_targets', d.getVar('SDK_TARGETS', True))
+ config.set('SDK', 'sdk_update_targets', d.getVar('SDK_INSTALL_TARGETS', True))
updateurl = d.getVar('SDK_UPDATE_URL', True)
if updateurl:
config.set('SDK', 'updateserver', updateurl)
@@ -199,6 +202,22 @@ python copy_buildsystem () {
d.getVar('SSTATE_DIR', True),
sstate_out, d,
fixedlsbstring)
+
+ # Add packagedata if enabled
+ if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1':
+ lockedsigs_base = d.getVar('WORKDIR', True) + '/locked-sigs-base.inc'
+ lockedsigs_copy = d.getVar('WORKDIR', True) + '/locked-sigs-copy.inc'
+ shutil.move(lockedsigs_pruned, lockedsigs_base)
+ oe.copy_buildsystem.merge_lockedsigs(['do_packagedata'],
+ lockedsigs_base,
+ d.getVar('STAGING_DIR_HOST', True) + '/world-pkgdata/locked-sigs-pkgdata.inc',
+ lockedsigs_pruned,
+ lockedsigs_copy)
+ oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_copy,
+ d.getVar('SSTATE_DIR', True),
+ sstate_out, d,
+ fixedlsbstring)
+
# We don't need sstate do_package files
for root, dirs, files in os.walk(sstate_out):
for name in files:
@@ -268,7 +287,7 @@ sdk_ext_postinst() {
# current working directory when first ran, nor will it set $1 when
# sourcing a script. That is why this has to look so ugly.
LOGFILE="$target_sdk_dir/preparing_build_system.log"
- sh -c ". buildtools/environment-setup* > $LOGFILE && cd $target_sdk_dir/`dirname ${oe_init_build_env_path}` && set $target_sdk_dir && . $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> $LOGFILE && python $target_sdk_dir/ext-sdk-prepare.py '${SDK_TARGETS}' >> $LOGFILE 2>&1" || { echo "ERROR: SDK preparation failed: see $LOGFILE"; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
+ sh -c ". buildtools/environment-setup* > $LOGFILE && cd $target_sdk_dir/`dirname ${oe_init_build_env_path}` && set $target_sdk_dir && . $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> $LOGFILE && python $target_sdk_dir/ext-sdk-prepare.py '${SDK_INSTALL_TARGETS}' >> $LOGFILE 2>&1" || { echo "ERROR: SDK preparation failed: see $LOGFILE"; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
fi
echo done
}
@@ -314,7 +333,8 @@ def get_sdk_ext_rdepends(d):
do_populate_sdk_ext[dirs] = "${@d.getVarFlag('do_populate_sdk', 'dirs', False)}"
do_populate_sdk_ext[depends] = "${@d.getVarFlag('do_populate_sdk', 'depends', False)} \
- buildtools-tarball:do_populate_sdk uninative-tarball:do_populate_sdk"
+ buildtools-tarball:do_populate_sdk uninative-tarball:do_populate_sdk \
+ ${@'meta-world-pkgdata:do_collect_packagedata' if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1' else ''}"
do_populate_sdk_ext[rdepends] += "${@' '.join([x + ':do_build' for x in d.getVar('SDK_TARGETS', True).split()])}"