From: Nitin A Kamble <nitin.a.kam...@intel.com> When this recipe is rebuilt for a different machine with same arch, then the previous change to EXTRA_OECONF was causing rerun of all the tasks starting from do_configure.
This commit avoids this behavior, needing only rerun of the do_populate_sysroot task. This is achieved by letting the mesa recipe build the GL components provided by the emgd-driver-bin recipe, but avoid these conflicting files getting populated in the machine specific sysroot. Fixes bug: [YOCTO #5120] Signed-off-by: Nitin A Kamble <nitin.a.kam...@intel.com> --- common/recipes-graphics/mesa/mesa_9.1.6.bbappend | 69 +++++++++++++++++------- 1 file changed, 49 insertions(+), 20 deletions(-) diff --git a/common/recipes-graphics/mesa/mesa_9.1.6.bbappend b/common/recipes-graphics/mesa/mesa_9.1.6.bbappend index b92831d..8024f0f 100644 --- a/common/recipes-graphics/mesa/mesa_9.1.6.bbappend +++ b/common/recipes-graphics/mesa/mesa_9.1.6.bbappend @@ -1,24 +1,53 @@ - # The emgd binary driver also provides egl, gles1, gles2 library & headers. -# To avoid conflict disable egl, gles1, gles2 from meta-dri if the BSP image -# is bundling the emgd driver. +# To avoid conflict do not populate sysroot with egl, gles1, gles2 files +# from mesa recipe if the BSP image is bundling the emgd driver. + +EXCLUDE_FROM_STAGING="${libdir}/libGLESv2.so.2 \ + ${libdir}/libEGL.so.1 \ + ${libdir}/libGLESv2.so \ + ${libdir}/libEGL.so \ + ${libdir}/pkgconfig/egl.pc \ + ${libdir}/pkgconfig/glesv2.pc \ + ${includedir}/KHR/khrplatform.h \ + ${includedir}/GLES/glext.h \ + ${includedir}/GLES/glplatform.h \ + ${includedir}/GLES/gl.h \ + ${includedir}/EGL/eglext.h \ + ${includedir}/EGL/eglplatform.h \ + ${includedir}/EGL/egl.h \ + ${includedir}/GLES2/gl2.h \ + ${includedir}/GLES2/gl2platform.h \ + ${includedir}/GLES2/gl2ext.h \ + " + +# override the function from the staging.bbclass +# An exclude list is conveyed to the tar +sysroot_stage_dir () { + src="$1" + dest="$2" + # if the src doesn't exist don't do anything + if [ ! -d "$src" ]; then + return + fi -python __anonymous () { - import re - xserver = d.getVar('XSERVER', True) - if xserver and 'emgd-driver-bin' in xserver.split(' '): - extra_oeconf = d.getVar('EXTRA_OECONF', True).split() - take_out = ["--enable-egl", "--enable-gles1", "--enable-gles2"] - put_in = ["--disable-egl", "--disable-gles1", "--disable-gles2"] - pattern = re.compile("--with-egl-platforms") - new_extra_oeconf = [ ] - for i in extra_oeconf: - if ( i not in take_out ) and ( not pattern.match(i)): - new_extra_oeconf.append(i) - for i in put_in: - new_extra_oeconf.append(i) + # 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 + rmdir "$src" 2> /dev/null || true + # However we always want to stage a $src itself, even if it's empty + mkdir -p "$dest" + + if [ -d "$src" ]; then + tar -X ${T}/exclude_from_staging -cf - -C "$src" -ps . | tar -xf - -C "$dest" + fi +} - d.setVar('EXTRA_OECONF', ' '.join(new_extra_oeconf)) - depends = d.getVar('DEPENDS', True) - d.setVar('DEPENDS', depends + " emgd-driver-bin") +# here the exclude list for tar is prepared +sysroot_stage_all_prepend() { + truncate --size 0 ${T}/exclude_from_staging + if [[ "${XSERVER}" =~ "emgd-driver-bin" ]]; then + for i in ${EXCLUDE_FROM_STAGING} + do + echo ${D}${i} >> ${T}/exclude_from_staging + done + fi } -- 1.8.1.4 _______________________________________________ meta-intel mailing list meta-intel@yoctoproject.org https://lists.yoctoproject.org/listinfo/meta-intel