qt dependency: find the correct -qtX configtool name

Fixes regression in commit c211fea513. The
original dependency lookup looked for `qmake-{self.name}`, i.e.
`qmake-qt5`, but when porting to config-tool, it got switched to
`qmake-{self.qtname}` i.e. `qmake-Qt6`, which was bogus and never
worked. As a result, if `qmake-qt5` and `qmake` both existed, and the
latter was NOT qt5, it would only try the less preferred name, and then
fail.

We need to define self.name early enough to define the configtool names,
which means we need to set it before running the configtool __init__()
even though configtool/pkgconfig would also set it to the same value.

Mark the tests as passing on two distros that were failing to detect
qmake due to this issue, and were marked for skipping because we assumed
that the CI skipping there was an expected case rather than an old
regression.
pull/9988/head
Eli Schwartz 3 years ago
parent b956d74175
commit e223136b10
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 3
      mesonbuild/dependencies/qt.py
  2. 4
      test cases/frameworks/4 qt/test.json

@ -127,6 +127,7 @@ class _QtBase:
libexecdir: T.Optional[str] = None
def __init__(self, name: str, kwargs: T.Dict[str, T.Any]):
self.name = name
self.qtname = name.capitalize()
self.qtver = name[-1]
if self.qtver == "4":
@ -244,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.qtname}', 'qmake']
self.tools = [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

@ -2,8 +2,8 @@
"matrix": {
"options": {
"method": [
{ "val": "config-tool", "skip_on_jobname": ["fedora", "opensuse"] },
{ "val": "qmake", "skip_on_jobname": ["fedora", "opensuse"] },
{ "val": "config-tool" },
{ "val": "qmake" },
{ "val": "pkg-config" }
]
}

Loading…
Cancel
Save