mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-18 20:11:33 +03:00
fix: php: pass composer-plugin-api to composer-plugins
This commit is contained in:
parent
12791f09ef
commit
f1888d4763
@ -89,6 +89,7 @@
|
||||
|
||||
# Generates a derivation for a specific package name + version
|
||||
makeOnePackage = name: version: let
|
||||
packageType = subsystemAttrs.phpPackageType."${name}@${version}";
|
||||
dependencies = getDependencies name version;
|
||||
repositories = let
|
||||
transform = dep: let
|
||||
@ -127,7 +128,12 @@
|
||||
inherit (dep) name;
|
||||
value = dep.version;
|
||||
})
|
||||
dependencies
|
||||
(dependencies
|
||||
++ l.optional (subsystemAttrs.composerPluginApiSemver ? "${name}@${version}")
|
||||
{
|
||||
name = "composer-plugin-api";
|
||||
version = subsystemAttrs.composerPluginApiSemver."${name}@${version}";
|
||||
})
|
||||
));
|
||||
|
||||
versionString =
|
||||
|
@ -117,6 +117,19 @@ in {
|
||||
in
|
||||
map (l.removePrefix "ext-") extensions;
|
||||
|
||||
composerPluginApiSemver = l.listToAttrs (l.flatten (map
|
||||
(
|
||||
pkg: let
|
||||
requires = getRequire pkg;
|
||||
in
|
||||
l.optional (requires ? "composer-plugin-api")
|
||||
{
|
||||
name = "${pkg.name}@${pkg.version}";
|
||||
value = requires."composer-plugin-api";
|
||||
}
|
||||
)
|
||||
packages));
|
||||
|
||||
# get cleaned pkg attributes
|
||||
getRequire = pkg:
|
||||
l.mapAttrs
|
||||
@ -204,7 +217,7 @@ in {
|
||||
clean = requires:
|
||||
l.filterAttrs
|
||||
(name: _:
|
||||
!(l.elem name ["php" "composer/composer" "composer-runtime-api"])
|
||||
!(l.elem name ["php" "composer-plugin-api" "composer-runtime-api"])
|
||||
&& !(l.strings.hasPrefix "ext-" name))
|
||||
requires;
|
||||
doPin = name: semver:
|
||||
@ -236,6 +249,7 @@ in {
|
||||
# ./src/specifications/{subsystem}
|
||||
subsystemAttrs = {
|
||||
inherit phpSemver phpExtensions;
|
||||
inherit composerPluginApiSemver;
|
||||
};
|
||||
|
||||
# name of the default package
|
||||
|
Loading…
Reference in New Issue
Block a user