pub2nix.readPubspecLock: Add packagePath
convenience attribute
This commit is contained in:
parent
dbc05b2c80
commit
bea71b1fe3
1 changed files with 8 additions and 2 deletions
|
@ -74,13 +74,19 @@ let
|
||||||
mkSdkDependencySource = name: details:
|
mkSdkDependencySource = name: details:
|
||||||
(sdkSourceBuilders.${details.description} or (throw "No SDK source builder has been given for ${details.description}!")) name;
|
(sdkSourceBuilders.${details.description} or (throw "No SDK source builder has been given for ${details.description}!")) name;
|
||||||
|
|
||||||
|
addDependencySourceUtils = dependencySource: dependencySource.overrideAttrs ({ passthru, ... }: {
|
||||||
|
passthru = passthru // {
|
||||||
|
packagePath = dependencySource + "/${dependencySource.packageRoot}";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
dependencySources = lib.filterAttrs (name: src: src != null) (builtins.mapAttrs
|
dependencySources = lib.filterAttrs (name: src: src != null) (builtins.mapAttrs
|
||||||
(name: details: ({
|
(name: details: addDependencySourceUtils (({
|
||||||
"hosted" = mkHostedDependencySource;
|
"hosted" = mkHostedDependencySource;
|
||||||
"git" = mkGitDependencySource;
|
"git" = mkGitDependencySource;
|
||||||
"path" = mkPathDependencySource;
|
"path" = mkPathDependencySource;
|
||||||
"sdk" = mkSdkDependencySource;
|
"sdk" = mkSdkDependencySource;
|
||||||
}.${details.source} name) details)
|
}.${details.source} name) details))
|
||||||
pubspecLock.packages);
|
pubspecLock.packages);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue