qt5: Instead of fixing paths after installation, fix them in Makefile before

* thanks to Mikko Levonmaa
* move it from qt5.inc to qmake5_base.bbclass, because it can be useful
  for other apps too

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
Martin Jansa 2013-04-29 11:59:52 +02:00
parent cd2ac1d786
commit d57e27ec08
2 changed files with 24 additions and 14 deletions

View File

@ -138,3 +138,26 @@ qmake5_base_do_configure () {
CMD="${OE_QMAKE_QMAKE} -makefile -o Makefile ${OE_QMAKE_DEBUG_OUTPUT} -r $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST"
$CMD || die "Error calling $CMD"
}
qmake5_base_do_install() {
# Fix install paths for all
find -name "Makefile*" | xargs sed -i "s,(INSTALL_ROOT)${STAGING_DIR_TARGET},(INSTALL_ROOT),g"
oe_runmake install INSTALL_ROOT=${D}
# everything except HostData and HostBinaries is prefixed with sysroot value,
# but we cannot remove sysroot override, because that's useful for pkg-config etc
# In some cases like QtQmlDevTools in qtdeclarative, the sed above does not work,
# fix them manually
if [ -d ${D}${STAGING_DIR_TARGET} ] ; then
echo "Some files are installed in wrong directory ${D}${STAGING_DIR_TARGET}"
cp -ra ${D}${STAGING_DIR_TARGET}/* ${D}
rm -rf ${D}${STAGING_DIR_TARGET}
# remove empty dirs
TMP=`dirname ${D}/${STAGING_DIR_TARGET}`
while test ${TMP} != ${D}; do
rmdir ${TMP}
TMP=`dirname ${TMP}`;
done
fi
}

View File

@ -82,20 +82,7 @@ do_compile() {
}
do_install() {
oe_runmake install INSTALL_ROOT=${D}
# everything except HostData and HostBinaries is prefixed with sysroot value,
# but we cannot remove sysroot override, because that's useful for pkg-config etc
if [ -d ${D}${STAGING_DIR_TARGET} ] ; then
cp -ra ${D}${STAGING_DIR_TARGET}/* ${D}
rm -rf ${D}${STAGING_DIR_TARGET}
# remove empty dirs
TMP=`dirname ${D}/${STAGING_DIR_TARGET}`
while test ${TMP} != ${D}; do
rmdir ${TMP}
TMP=`dirname ${TMP}`;
done
fi
qmake5_base_do_install
}
PACKAGES =. "${PN}-tools-dbg ${PN}-plugins-dbg ${PN}-tools ${PN}-plugins ${PN}-mkspecs "