[M8] reusable libraries: install layout + cargoxx-path deps

This commit is contained in:
2026-05-17 18:13:15 +00:00
parent fdf97861a4
commit e6c39914b3
25 changed files with 932 additions and 21 deletions

View File

@@ -106,6 +106,12 @@ auto parse_package(const toml::table& tbl, const std::filesystem::path& path)
}
pkg.brute_force_includes = std::move(*r);
}
if (auto v = tbl["source_kind"].value<std::string>()) {
pkg.source_kind = *v;
}
if (auto v = tbl["source_path"].value<std::string>()) {
pkg.source_path = *v;
}
return pkg;
}
@@ -215,6 +221,12 @@ auto write(const Lockfile& lock, const std::filesystem::path& path) -> util::Res
}
tbl.insert_or_assign("brute_force_includes", std::move(arr));
}
if (p.source_kind) {
tbl.insert_or_assign("source_kind", *p.source_kind);
}
if (p.source_path) {
tbl.insert_or_assign("source_path", *p.source_path);
}
packages.push_back(std::move(tbl));
}
root.insert_or_assign("package", std::move(packages));

View File

@@ -18,6 +18,10 @@ struct LockfilePackage {
std::optional<std::string> pkg_config_module;
std::vector<std::string> brute_force_libs;
std::vector<std::string> brute_force_includes;
// For cargoxx-source deps (not nixpkgs/linkdb-resolved). v1 supports
// "cargoxx-path"; "cargoxx-git" / "cargoxx-registry" land in 1c/1d.
std::optional<std::string> source_kind;
std::optional<std::string> source_path;
bool operator==(const LockfilePackage&) const = default;
};