From 49ccf8124aaeda435ec8cd31167418370e36441d Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 18 Jul 2022 11:17:50 +0300 Subject: [PATCH] qt: fix qt 6 tools detection for pkg-config Add correct reading of pkgconfig-announced bindir and pkgconfig-announced libexecdir. Will work only on 6.3+ --- mesonbuild/dependencies/qt.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/mesonbuild/dependencies/qt.py b/mesonbuild/dependencies/qt.py index 562792c2f..750ae42a9 100644 --- a/mesonbuild/dependencies/qt.py +++ b/mesonbuild/dependencies/qt.py @@ -223,11 +223,18 @@ class QtPkgConfigDependency(_QtBase, PkgConfigDependency, metaclass=abc.ABCMeta) if prefix: self.bindir = os.path.join(prefix, 'bin') + self.libexecdir = self.get_pkgconfig_host_libexecs(self) + @staticmethod @abc.abstractmethod def get_pkgconfig_host_bins(core: PkgConfigDependency) -> T.Optional[str]: pass + @staticmethod + @abc.abstractmethod + def get_pkgconfig_host_libexecs(core: PkgConfigDependency) -> T.Optional[str]: + pass + @abc.abstractmethod def get_private_includes(self, mod_inc_dir: str, module: str) -> T.List[str]: pass @@ -405,6 +412,10 @@ class Qt4PkgConfigDependency(QtPkgConfigDependency): def get_private_includes(self, mod_inc_dir: str, module: str) -> T.List[str]: return [] + @staticmethod + def get_pkgconfig_host_libexecs(core: PkgConfigDependency) -> str: + return None + class Qt5PkgConfigDependency(QtPkgConfigDependency): @@ -412,6 +423,10 @@ class Qt5PkgConfigDependency(QtPkgConfigDependency): def get_pkgconfig_host_bins(core: PkgConfigDependency) -> str: return core.get_pkgconfig_variable('host_bins', [], None) + @staticmethod + def get_pkgconfig_host_libexecs(core: PkgConfigDependency) -> str: + return None + def get_private_includes(self, mod_inc_dir: str, module: str) -> T.List[str]: return _qt_get_private_includes(mod_inc_dir, module, self.version) @@ -420,7 +435,12 @@ class Qt6PkgConfigDependency(QtPkgConfigDependency): @staticmethod def get_pkgconfig_host_bins(core: PkgConfigDependency) -> str: - return core.get_pkgconfig_variable('host_bins', [], None) + return core.get_pkgconfig_variable('bindir', [], None) + + @staticmethod + def get_pkgconfig_host_libexecs(core: PkgConfigDependency) -> str: + # Qt6 pkg-config for Qt defines libexecdir from 6.3+ + return core.get_pkgconfig_variable('libexecdir', [], None) def get_private_includes(self, mod_inc_dir: str, module: str) -> T.List[str]: return _qt_get_private_includes(mod_inc_dir, module, self.version)