From b5a81ff6348ccd8351af495e21884cbb7a56f308 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Wed, 9 Feb 2022 21:13:26 -0500 Subject: [PATCH] qt dependency: adapt to the qmake command changed name Qt now has official guidance for the symlinked names of the tools, which is great. Qt now officially calls the tools `fooX` instead of `foo-qtX` where the major version of Qt is X. Which is not great, because a bit of an unofficial standard had prior art and now needs to change, and we never adapted. Prefer the official name whenever looking up qmake, and in the testsuite, specifically look only for the official name on versions of qt which we know should have that. --- mesonbuild/dependencies/qt.py | 2 +- unittests/linuxliketests.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mesonbuild/dependencies/qt.py b/mesonbuild/dependencies/qt.py index bad8cebd3..562792c2f 100644 --- a/mesonbuild/dependencies/qt.py +++ b/mesonbuild/dependencies/qt.py @@ -245,7 +245,7 @@ class QmakeQtDependency(_QtBase, ConfigToolDependency, metaclass=abc.ABCMeta): def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any]): _QtBase.__init__(self, name, kwargs) - self.tools = [f'qmake-{self.name}', 'qmake'] + self.tools = [f'qmake{self.qtver}', f'qmake-{self.name}', 'qmake'] # Add additional constraints that the Qt version is met, but preserve # any version requrements the user has set as well. For example, if Qt5 diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py index 406950e89..565b32892 100644 --- a/unittests/linuxliketests.py +++ b/unittests/linuxliketests.py @@ -387,8 +387,8 @@ class LinuxlikeTests(BasePlatformTests): Test that qt6 detection with qmake works. This can't be an ordinary test case because it involves setting the environment. ''' - # Verify that qmake is for Qt5 - if not shutil.which('qmake-qt6'): + # Verify that qmake is for Qt6 + if not shutil.which('qmake6'): if not shutil.which('qmake'): raise SkipTest('QMake not found') output = subprocess.getoutput('qmake --version')