From 36bc53ee07600eee193b8655c7e4ff85ff0adede Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Fri, 14 Feb 2025 01:36:16 -0600 Subject: [PATCH] MesonPackage: depends_on pkgconfig (#46955) meson's `dependency` function often uses pkg-config to locate a dependency, and may even fall back to cmake. The former case is very common, and since packagers often forget to add the tiny pkgconfig package as a build dep, we do it for them. --- lib/spack/spack/build_systems/meson.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/spack/spack/build_systems/meson.py b/lib/spack/spack/build_systems/meson.py index 18a3d29ab50..675623e4f4d 100644 --- a/lib/spack/spack/build_systems/meson.py +++ b/lib/spack/spack/build_systems/meson.py @@ -48,6 +48,9 @@ class MesonPackage(spack.package_base.PackageBase): variant("strip", default=False, description="Strip targets on install") depends_on("meson", type="build") depends_on("ninja", type="build") + # Meson uses pkg-config for dependency detection, and this dependency is + # often overlooked by packages that use meson as a build system. + depends_on("pkgconfig", type="build") # Python detection in meson requires distutils to be importable, but distutils no longer # exists in Python 3.12. In Spack, we can't use setuptools as distutils replacement, # because the distutils-precedence.pth startup file that setuptools ships with is not run