From 1a21e6e2d5a00238c7f9f61315f4aca3659863bc Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 4 Jun 2009 20:46:09 +0100 Subject: 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 --- meta/classes/packaged-staging.bbclass | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'meta/classes/packaged-staging.bbclass') diff --git a/meta/classes/packaged-staging.bbclass b/meta/classes/packaged-staging.bbclass index 144087fedc..094aa5979f 100644 --- a/meta/classes/packaged-staging.bbclass +++ b/meta/classes/packaged-staging.bbclass @@ -176,11 +176,17 @@ python packagestage_scenefunc () { bb.build.exec_func("staging_helper", d) + bb.note("Here 1\n") + removepkg = bb.data.expand("${PSTAGE_PKGPN}", d) - pstage_cleanpackage(removepkg, 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 -- cgit v1.2.3-54-g00ecf