packaged-staging.bbclass: Add support for mangling .la files so the staging directory path can change. Someday libtool will support sysroot but until then...

Signed-off-by: Richard Purdie <richard@ted.(none)>
This commit is contained in:
Richard Purdie 2009-06-04 20:46:09 +01:00
parent 093a11caba
commit 1a21e6e2d5
1 changed files with 30 additions and 6 deletions

View File

@ -176,11 +176,17 @@ python packagestage_scenefunc () {
bb.build.exec_func("staging_helper", d)
removepkg = bb.data.expand("${PSTAGE_PKGPN}", d)
pstage_cleanpackage(removepkg, d)
bb.note("Here 1\n")
removepkg = bb.data.expand("${PSTAGE_PKGPN}", d)
bb.note("Here 1.1\n")
pstage_cleanpackage(removepkg, d)
bb.note("Here 1.2\n")
stagepkg = bb.data.expand("${PSTAGE_PKG}", d)
bb.note("Here 2 %s\n"% stagepkg)
if os.path.exists(stagepkg):
path = bb.data.getVar("PATH", d, 1)
pstage_set_pkgmanager(d)
@ -237,6 +243,8 @@ python packagestage_scenefunc () {
if ret != 0:
bb.note("Failure installing prestage package")
bb.build.exec_func("staging_package_libtoolhack", d)
bb.build.make_stamp("do_stage_package_populated", d)
else:
bb.note("Staging package found but invalid for %s" % file)
@ -320,11 +328,19 @@ staging_packager () {
echo "Architecture: ${PSTAGE_PKGARCH}" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control
# Protect against empty SRC_URI
if [ "${SRC_URI}" != "" ] ; then
echo "Source: ${SRC_URI}" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control
else
echo "Source: OpenEmbedded" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control
srcuri="${SRC_URI}"
if [ "$srcuri" == "" ]; then
srcuri="OpenEmbedded"
fi
echo "Source: ${SRC_URI}" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control
# Deal with libtool not supporting sysroots
# Need to remove hardcoded paths and fix these when we install the
# staging packages.
# Could someone please add sysroot support to libtool!
for i in `find ${PSTAGE_TMPDIR_STAGE} -name "*.la" -type f` ; do \
sed -i -e s:${STAGING_DIR}:FIXMESTAGINGDIR:g $i
done
${PSTAGE_BUILD_CMD} ${PSTAGE_TMPDIR_STAGE} ${DEPLOY_DIR_PSTAGE}/${PSTAGE_PKGPATH}
}
@ -348,6 +364,14 @@ staging_package_installer () {
find -type f | grep -v ./CONTROL | sed -e 's/^\.//' > ${TMPDIR}${layout_libdir}/opkg/info/${PSTAGE_PKGPN}.list
}
staging_package_libtoolhack () {
# Deal with libtool not supporting sysroots and add our new
# staging location
for i in `find ${STAGING_DIR} -name "*.la" -type f` ; do \
sed -i -e s:FIXMESTAGINGDIR:${STAGING_DIR}:g $i
done
}
python do_package_stage () {
if bb.data.getVar("PSTAGING_ACTIVE", d, 1) != "1":
return