]> code.ossystems Code Review - openembedded-core.git/commitdiff
packaged-staging.bbclass: Add support for mangling .la files so the staging directory...
authorRichard Purdie <richard@ted.(none)>
Thu, 4 Jun 2009 19:46:09 +0000 (20:46 +0100)
committerRichard Purdie <richard@ted.(none)>
Thu, 4 Jun 2009 19:46:09 +0000 (20:46 +0100)
Signed-off-by: Richard Purdie <richard@ted.(none)>
meta/classes/packaged-staging.bbclass

index 144087fedca14a7d012572257dce702998095e6f..094aa5979fe7b1c26dad8ed31ba7008037688138 100644 (file)
@@ -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