aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-02-10 18:57:10 -0500
committerEli Schwartz <eschwartz@archlinux.org>2022-04-12 20:44:07 -0400
commite223136b10a55ebb24c780575092bbf67dd1581c (patch)
tree1dc8a88ccff36292e37099fa6b2570308c698ca1
parentb956d7417589403632a8ab10d924efd5fb199bc1 (diff)
downloadmeson-e223136b10a55ebb24c780575092bbf67dd1581c.zip
meson-e223136b10a55ebb24c780575092bbf67dd1581c.tar.gz
meson-e223136b10a55ebb24c780575092bbf67dd1581c.tar.bz2
qt dependency: find the correct -qtX configtool name
Fixes regression in commit c211fea51389728783cf59ae41156a5e0de9c41a. 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.
-rw-r--r--mesonbuild/dependencies/qt.py3
-rw-r--r--test cases/frameworks/4 qt/test.json4
2 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/dependencies/qt.py b/mesonbuild/dependencies/qt.py
index d2be1a4..bad8ceb 100644
--- a/mesonbuild/dependencies/qt.py
+++ b/mesonbuild/dependencies/qt.py
@@ -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
diff --git a/test cases/frameworks/4 qt/test.json b/test cases/frameworks/4 qt/test.json
index fbeead5..4df0b49 100644
--- a/test cases/frameworks/4 qt/test.json
+++ b/test cases/frameworks/4 qt/test.json
@@ -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" }
]
}