2010-03-19 23:12:06 +00:00
packagedstaging_fastpath () {
:
}
sysroot_stage_dir() {
src="$1"
dest="$2"
2010-06-25 12:56:04 +00:00
# if the src doesn't exist don't do anything
if [ ! -d "$src" ]; then
return
fi
# We only want to stage the contents of $src if it's non-empty so first rmdir $src
# then if it still exists (rmdir on non-empty dir fails) we can copy its contents
2010-03-19 23:12:06 +00:00
rmdir "$src" 2> /dev/null || true
2010-06-25 12:56:04 +00:00
# However we always want to stage a $src itself, even if it's empty
mkdir -p "$dest"
2010-03-19 23:12:06 +00:00
if [ -d "$src" ]; then
2011-02-09 04:16:41 +00:00
tar -cf - -C "$src" -ps . | tar -xf - -C "$dest"
2010-03-19 23:12:06 +00:00
fi
}
sysroot_stage_libdir() {
src="$1"
dest="$2"
2011-01-13 13:54:25 +00:00
sysroot_stage_dir $src $dest
2010-03-19 23:12:06 +00:00
}
sysroot_stage_dirs() {
from="$1"
to="$2"
2011-01-18 08:17:58 +00:00
sysroot_stage_dir $from${includedir} $to${includedir}
2010-03-19 23:12:06 +00:00
if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
2011-01-18 08:17:58 +00:00
sysroot_stage_dir $from${bindir} $to${bindir}
sysroot_stage_dir $from${sbindir} $to${sbindir}
sysroot_stage_dir $from${base_bindir} $to${base_bindir}
sysroot_stage_dir $from${base_sbindir} $to${base_sbindir}
sysroot_stage_dir $from${libexecdir} $to${libexecdir}
sysroot_stage_dir $from${sysconfdir} $to${sysconfdir}
sysroot_stage_dir $from${localstatedir} $to${localstatedir}
2010-03-19 23:12:06 +00:00
fi
if [ -d $from${libdir} ]
then
2011-01-18 08:17:58 +00:00
sysroot_stage_libdir $from/${libdir} $to${libdir}
2010-03-19 23:12:06 +00:00
fi
if [ -d $from${base_libdir} ]
then
2011-01-18 08:17:58 +00:00
sysroot_stage_libdir $from${base_libdir} $to${base_libdir}
2010-03-19 23:12:06 +00:00
fi
2011-01-18 08:17:58 +00:00
sysroot_stage_dir $from${datadir} $to${datadir}
2012-07-19 13:18:03 +00:00
# We don't care about docs/info/manpages/locales
rm -rf $to${mandir}/ $to${docdir}/ $to${infodir}/ ${to}${datadir}/locale/
2012-08-25 15:47:25 +00:00
rm -rf $to${datadir}/applications/ $to${datadir}/fonts/ $to${datadir}/pixmaps/
2010-03-19 23:12:06 +00:00
}
sysroot_stage_all() {
sysroot_stage_dirs ${D} ${SYSROOT_DESTDIR}
}
2011-01-26 10:04:15 +00:00
do_populate_sysroot[dirs] = "${SYSROOT_DESTDIR}"
2012-02-26 12:45:47 +00:00
do_populate_sysroot[umask] = "022"
2010-03-19 23:12:06 +00:00
addtask populate_sysroot after do_install
SYSROOT_PREPROCESS_FUNCS ?= ""
SYSROOT_DESTDIR = "${WORKDIR}/sysroot-destdir/"
SYSROOT_LOCK = "${STAGING_DIR}/staging.lock"
2011-01-27 20:58:38 +00:00
# We clean out any existing sstate from the sysroot if we rerun configure
python sysroot_cleansstate () {
2012-08-20 16:52:21 +00:00
ss = sstate_state_fromvars(d, "populate_sysroot")
sstate_clean(ss, d)
2011-01-27 20:58:38 +00:00
}
do_configure[prefuncs] += "sysroot_cleansstate"
2010-03-19 23:12:06 +00:00
2011-11-21 14:37:10 +00:00
BB_SETSCENE_VERIFY_FUNCTION = "sysroot_checkhashes"
2012-07-25 19:08:27 +00:00
def sysroot_checkhashes(covered, tasknames, fnids, fns, d, invalidtasks = None):
2011-11-21 14:37:10 +00:00
problems = set()
configurefnids = set()
2012-07-25 19:08:27 +00:00
if not invalidtasks:
invalidtasks = xrange(len(tasknames))
for task in invalidtasks:
2011-11-21 14:37:10 +00:00
if tasknames[task] == "do_configure" and task not in covered:
configurefnids.add(fnids[task])
for task in covered:
if tasknames[task] == "do_populate_sysroot" and fnids[task] in configurefnids:
problems.add(task)
return problems
2010-03-19 23:12:06 +00:00
python do_populate_sysroot () {
#
# if do_stage exists, we're legacy. In that case run the do_stage,
# modify the SYSROOT_DESTDIR variable and then run the staging preprocess
# functions against staging directly.
#
# Otherwise setup a destdir, copy the results from do_install
# and run the staging preprocess against that
#
2010-07-22 10:27:13 +00:00
bb.build.exec_func("sysroot_stage_all", d)
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
for f in (d.getVar('SYSROOT_PREPROCESS_FUNCS', True) or '').split():
2010-07-22 10:27:13 +00:00
bb.build.exec_func(f, d)
2010-08-05 13:16:28 +00:00
}
SSTATETASKS += "do_populate_sysroot"
2012-07-19 13:11:54 +00:00
do_populate_sysroot[cleandirs] = "${SYSROOT_DESTDIR}"
2010-08-05 13:16:28 +00:00
do_populate_sysroot[sstate-name] = "populate-sysroot"
2011-01-18 08:17:58 +00:00
do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}"
do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_HOST}/"
2011-01-18 08:18:42 +00:00
do_populate_sysroot[stamp-extra-info] = "${MACHINE}"
2010-07-22 10:27:13 +00:00
2010-08-05 13:16:28 +00:00
python do_populate_sysroot_setscene () {
2012-07-11 17:33:43 +00:00
sstate_setscene(d)
2010-03-19 23:12:06 +00:00
}
2010-09-16 05:55:21 +00:00
addtask do_populate_sysroot_setscene
2010-08-05 13:16:28 +00:00
2010-03-19 23:12:06 +00:00
python () {
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
if d.getVar('do_stage', True) is not None:
2012-01-30 12:44:47 +00:00
bb.fatal("Legacy staging found for %s as it has a do_stage function. This will need conversion to a do_install or often simply removal to work with OE-core" % d.getVar("FILE", True))
2010-03-19 23:12:06 +00:00
}