qt5-build.eclass: fix avoiding qmake recompilation for Qt 5.8 and later
authorMichael Palimaka <kensington@gentoo.org>
Thu, 1 Dec 2016 18:02:53 +0000 (05:02 +1100)
committerMichael Palimaka <kensington@gentoo.org>
Sun, 8 Oct 2017 01:46:23 +0000 (12:46 +1100)
See qtbase commit 4ce0beee1b69a8695fc24a244a8a3053711906ac.

eclass/qt5-build.eclass

index a627ce882a495ae45efc4ece8abc792ba4229745..62c79d0962855fdc3a25fc34c14210ee0c1def66 100644 (file)
@@ -172,8 +172,14 @@ qt5-build_src_prepare() {
                qt5_symlink_tools_to_build_dir
 
                # Avoid unnecessary qmake recompilations
-               sed -i -re "s|^if true;.*(\[ '\!').*(\"\\\$outpath/bin/qmake\".*)|if \1 -e \2 then|" \
-                       configure || die "sed failed (skip qmake bootstrap)"
+               if [[ ${QT5_MINOR_VERSION} -ge 8 ]]; then
+                       sed -i -e "/Creating qmake/i if [ '!' -e \"\$outpath/bin/qmake\" ]; then" \
+                               -e '/echo "Done."/a fi' \
+                               configure || die "sed failed (skip qmake bootstrap)"
+               else
+                       sed -i -re "s|^if true;.*(\[ '\!').*(\"\\\$outpath/bin/qmake\".*)|if \1 -e \2 then|" \
+                               configure || die "sed failed (skip qmake bootstrap)"
+               fi
 
                # Respect CC, CXX, *FLAGS, MAKEOPTS and EXTRA_EMAKE when bootstrapping qmake
                sed -i -e "/outpath\/qmake\".*\"\$MAKE\")/ s:): \