mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-18 20:11:33 +03:00
fix: php: drop missing requirements
Since we are reading composer.lock, assume that missing requirements are satisfied in upper packages by provides/replaces
This commit is contained in:
parent
e27c43f780
commit
3bd99ac47d
@ -189,9 +189,20 @@ in {
|
||||
};
|
||||
doReplace = pkg: l.foldl replace pkg packages;
|
||||
doProvide = pkg: l.foldl provide pkg packages;
|
||||
resolve = pkg: doProvide (doReplace pkg);
|
||||
dropMissing = pkgs: let
|
||||
doDropMissing = pkg:
|
||||
pkg
|
||||
// {
|
||||
require =
|
||||
l.filterAttrs
|
||||
(name: semver: l.any (pkg: (pkg.name == name) && (satisfiesSemver pkg.version semver)) pkgs)
|
||||
(getDependencies pkg);
|
||||
};
|
||||
in
|
||||
map doDropMissing pkgs;
|
||||
resolve = pkg: (doProvide (doReplace pkg));
|
||||
in
|
||||
map resolve packages;
|
||||
dropMissing (map resolve packages);
|
||||
|
||||
# toplevel php semver
|
||||
phpSemver = composerJson.require."php" or "*";
|
||||
|
Loading…
Reference in New Issue
Block a user