binconfig/pkgconfig.bbclass: Convert staging functions into SYSROOT_PREPROCESS_FUNCS operating on SYSROOT_DESTDIR

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Richard Purdie 2009-11-02 17:27:05 +00:00
parent 6ea78d6489
commit 7c97538327
3 changed files with 16 additions and 7 deletions

View File

@ -996,6 +996,9 @@ do_populate_staging[dirs] = "${STAGING_DIR_TARGET}/${bindir} ${STAGING_DIR_TARGE
# Could be compile but populate_staging and do_install shouldn't run at the same time
addtask populate_staging after do_install
SYSROOT_PREPROCESS_FUNCS ?= ""
SYSROOT_DESTDIR = "${WORKDIR}/sysroot-destdir/"
python do_populate_staging () {
#
# Only run do_stage if its not the empty default above
@ -1003,6 +1006,8 @@ python do_populate_staging () {
stagefunc = bb.data.getVar('do_stage', d, 1).strip()
if stagefunc != "base_do_stage":
bb.build.exec_func('do_stage', d)
for f in (bb.data.getVar('SYSROOT_PREPROCESS_FUNCS', d, True) or '').split():
bb.build.exec_func(f, d)
}
addtask install after do_compile

View File

@ -43,11 +43,13 @@ binconfig_package_preprocess () {
done
}
do_stage_append() {
SYSROOT_PREPROCESS_FUNCS += "binconfig_sysroot_preprocess"
binconfig_sysroot_preprocess () {
for config in `find ${S} -name '${BINCONFIG_GLOB}'`; do
configname=`basename $config`
install -d ${STAGING_BINDIR_CROSS}
cat $config | sed ${@get_binconfig_mangle(d)} > ${STAGING_BINDIR_CROSS}/$configname
chmod u+x ${STAGING_BINDIR_CROSS}/$configname
install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
cat $config | sed ${@get_binconfig_mangle(d)} > ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}/$configname
chmod u+x ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}/$configname
done
}

View File

@ -1,7 +1,9 @@
do_stage_append () {
install -d ${PKG_CONFIG_DIR}
SYSROOT_PREPROCESS_FUNCS += "pkgconfig_sysroot_preprocess"
pkgconfig_sysroot_preprocess () {
install -d ${SYSROOT_DESTDIR}${PKG_CONFIG_DIR}
for pc in `find ${S} -name '*.pc' -type f | grep -v -- '-uninstalled.pc$'`; do
pcname=`basename $pc`
cat $pc > ${PKG_CONFIG_DIR}/$pcname
cat $pc > ${SYSROOT_DESTDIR}${PKG_CONFIG_DIR}/$pcname
done
}