[M6] resolver: pkg-config probe + codegen for PkgConfig

This commit is contained in:
2026-05-15 13:03:03 +00:00
parent 4f9b6f1827
commit 6c4933f282
9 changed files with 319 additions and 9 deletions

View File

@@ -167,6 +167,18 @@ auto flake_nix(const GenerateInputs& in) -> std::string {
out += emit_inputs_block(pinned);
const bool any_pkg_config =
std::ranges::any_of(in.recipes,
[](const linkdb::Recipe& r) {
return r.pkg_config_module &&
!r.pkg_config_module->empty();
}) ||
std::ranges::any_of(in.dev_recipes,
[](const linkdb::Recipe& r) {
return r.pkg_config_module &&
!r.pkg_config_module->empty();
});
out += "\n";
out += " outputs = ";
out += emit_outputs_params(pinned);
@@ -181,8 +193,11 @@ auto flake_nix(const GenerateInputs& in) -> std::string {
" version = \"1.0\";\n"
" nativeBuildInputs = [\n"
" pkgs.ninja\n"
" pkgs.cmake\n"
" ];\n"
" pkgs.cmake\n";
if (any_pkg_config) {
out += " pkgs.pkg-config\n";
}
out += " ];\n"
" buildInputs = [\n";
out += emit_build_inputs(bindings);
out += " ];\n"