[M8] cargoxx-git dependencies: { git = ..., rev = ... } deps

This commit is contained in:
2026-05-17 18:31:13 +00:00
parent e6c39914b3
commit 09f151ad82
12 changed files with 310 additions and 28 deletions

View File

@@ -69,12 +69,19 @@
(builtins.getFlake "github:NixOS/nixpkgs/${rev}")
.legacyPackages.${system};
# cargoxx-path deps recurse into buildCppPackage on the sibling
# source tree; the result joins buildInputs so the consumer's
# find_package(<dep> CONFIG REQUIRED) resolves via CMAKE_PREFIX_PATH.
# cargoxx-source deps recurse into buildCppPackage; the result
# joins buildInputs so the consumer's find_package(<dep> CONFIG
# REQUIRED) resolves via CMAKE_PREFIX_PATH.
evalDep = p:
if (p.source_kind or "") == "cargoxx-path" then
buildCppPackage { src = src + ("/" + p.source_path); }
else if (p.source_kind or "") == "cargoxx-git" then
let depSrc = pkgs.fetchgit {
url = p.source_git_url;
rev = p.source_git_commit;
hash = p.source_git_sha256;
};
in buildCppPackage { src = depSrc; }
else
let rev = if (p ? nixpkgs_rev) && (p.nixpkgs_rev != "")
then p.nixpkgs_rev
@@ -97,9 +104,9 @@
# For cargoxx-source deps we don't have a nixpkgs rev/attr — the
# vendor.toml entry just needs a name + store_path so cargoxx's
# offline pathway can find the dep's installed prefix.
isPath = (p.source_kind or "") == "cargoxx-path";
attr = if isPath then "" else p.nixpkgs_attr;
rev = if isPath then ""
isCargoxx = (p.source_kind or "") != "";
attr = if isCargoxx then "" else p.nixpkgs_attr;
rev = if isCargoxx then ""
else if (p ? nixpkgs_rev) && (p.nixpkgs_rev != "")
then p.nixpkgs_rev else lock.nixpkgs_rev;
in ''