From 6a56f6d98fb7806a59967b0df3ede26544eac4a4 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 18 Aug 2023 12:58:18 -0400 Subject: [PATCH] pkgconfig: Deprecate "pkgconfig" in favor of "pkg-config" in [binaries] --- mesonbuild/dependencies/pkgconfig.py | 2 +- mesonbuild/envconfig.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mesonbuild/dependencies/pkgconfig.py b/mesonbuild/dependencies/pkgconfig.py index ab6896ef9..89442af87 100644 --- a/mesonbuild/dependencies/pkgconfig.py +++ b/mesonbuild/dependencies/pkgconfig.py @@ -177,7 +177,7 @@ class PkgConfigCLI(PkgConfigInterface): def _detect_pkgbin(self) -> None: for potential_pkgbin in find_external_program( - self.env, self.for_machine, 'pkgconfig', 'Pkg-config', + self.env, self.for_machine, 'pkg-config', 'Pkg-config', self.env.default_pkgconfig, allow_default_for_cross=False): version_if_ok = self._check_pkgconfig(potential_pkgbin) if version_if_ok: diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py index 5340521c3..c6b543a34 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py @@ -133,7 +133,6 @@ ENV_VAR_TOOL_MAP: T.Mapping[str, str] = { # Other tools 'cmake': 'CMAKE', 'qmake': 'QMAKE', - 'pkgconfig': 'PKG_CONFIG', 'pkg-config': 'PKG_CONFIG', 'make': 'MAKE', 'vapigen': 'VAPIGEN', @@ -403,6 +402,11 @@ class BinaryTable: if not isinstance(command, (list, str)): raise mesonlib.MesonException( f'Invalid type {command!r} for entry {name!r} in cross file') + if name == 'pkgconfig': + if 'pkg-config' in binaries: + raise mesonlib.MesonException('Both pkgconfig and pkg-config entries in machine file.') + mlog.deprecation('"pkgconfig" entry is deprecated and should be replaced by "pkg-config"') + name = 'pkg-config' self.binaries[name] = mesonlib.listify(command) @staticmethod