[M8] cargoxx-git dependencies: { git = ..., rev = ... } deps
This commit is contained in:
19
flake.nix
19
flake.nix
@@ -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 ''
|
||||
|
||||
Reference in New Issue
Block a user