From 713574b3e4932bb74bf8b4231d1fad67a086fbff Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Thu, 10 Jan 2019 16:18:05 +0200 Subject: qt5: patch build paths from installed files All 3rdparty libs and includes are now resolved into full filepaths, which means build paths to the yocto build environment are in module's prl, pri, pc and cmake files. Move existing patching from qtbase to the bbclass so that it's applied to all modules. -L paths are no longer included in the .pc files, remove unneeded patching for those. Task-number: QTBUG-72903 Change-Id: Iae5d150593aef153c46aaf8a3ba22fbafcc9b818 Reviewed-by: Oswald Buddenhagen Reviewed-by: Mikko Gronoff --- classes/qmake5_base.bbclass | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'classes/qmake5_base.bbclass') diff --git a/classes/qmake5_base.bbclass b/classes/qmake5_base.bbclass index 48da05e8..20ff33d4 100644 --- a/classes/qmake5_base.bbclass +++ b/classes/qmake5_base.bbclass @@ -240,9 +240,18 @@ qmake5_base_do_install() { qmake5_base_fix_install ${STAGING_DIR_HOST} qmake5_base_fix_install ${STAGING_DIR_NATIVE} - if ls ${D}${libdir}/pkgconfig/*.pc >/dev/null 2>/dev/null; then - sed -i ${D}${libdir}/pkgconfig/*.pc \ - -e "s@-L${STAGING_LIBDIR}@-L\${libdir}@g" \ - -e "s@${STAGING_DIR_TARGET}@@g" - fi + # Replace host paths with qmake built-in properties + find ${D} \( -name *.pri -or -name *.prl \) -exec \ + sed -i -e 's|${STAGING_DIR_NATIVE}|$$[QT_HOST_PREFIX/get]|g' \ + -e 's|${STAGING_DIR_HOST}|$$[QT_SYSROOT]|g' {} \; + + # Replace host paths with pkg-config built-in variable + find ${D} -name *.pc -exec \ + sed -i -e 's|prefix=${STAGING_DIR_HOST}|prefix=|g' \ + -e 's|${STAGING_DIR_HOST}|${pc_sysrootdir}|g' {} \; + + # Replace resolved lib path with the lib name + find ${D} -name *.cmake -exec \ + sed -i -e 's@/[^;]*/lib\([^;]*\)\.\(so\|a\)@\1@g' {} \; + } -- cgit v1.2.3