mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-05 09:11:39 -05:00
Merge pull request #663 from trepetti/build-systems-jsonschema
build-systems: optional build system objects with version information
This commit is contained in:
commit
8e53a7d0d1
2 changed files with 31 additions and 3 deletions
|
@ -591,6 +591,9 @@
|
|||
"json-schema-for-humans": [
|
||||
"poetry-core"
|
||||
],
|
||||
"jsonschema": [
|
||||
{ "buildSystem": "hatchling", "from": "4.6.0" }
|
||||
],
|
||||
"jupyter-server": [
|
||||
"jupyter-packaging"
|
||||
],
|
||||
|
@ -1690,7 +1693,8 @@
|
|||
"pbr"
|
||||
],
|
||||
"traitlets": [
|
||||
"flit-core"
|
||||
{ "buildSystem": "flit-core", "until": "5.2.1" },
|
||||
{ "buildSystem": "hatchling", "from": "5.2.1" }
|
||||
],
|
||||
"transmission-rpc": [
|
||||
"poetry-core"
|
||||
|
|
|
@ -11,7 +11,28 @@ let
|
|||
, extraAttrs ? [ ]
|
||||
}:
|
||||
let
|
||||
buildSystem = if attr == "cython" then self.python.pythonForBuild.pkgs.cython else self.${attr};
|
||||
buildSystem =
|
||||
if builtins.isAttrs attr then
|
||||
let
|
||||
fromIsValid =
|
||||
if builtins.hasAttr "from" attr then
|
||||
lib.versionAtLeast drv.version attr.from
|
||||
else
|
||||
true;
|
||||
untilIsValid =
|
||||
if builtins.hasAttr "until" attr then
|
||||
lib.versionOlder drv.version attr.until
|
||||
else
|
||||
true;
|
||||
intendedBuildSystem =
|
||||
if attr.buildSystem == "cython" then
|
||||
self.python.pythonForBuild.cython
|
||||
else
|
||||
self.${attr.buildSystem};
|
||||
in
|
||||
if fromIsValid && untilIsValid then intendedBuildSystem else null
|
||||
else
|
||||
if attr == "cython" then self.python.pythonForBuild.pkgs.cython else self.${attr};
|
||||
in
|
||||
(
|
||||
# Flit only works on Python3
|
||||
|
@ -24,7 +45,10 @@ let
|
|||
{ }
|
||||
else
|
||||
{
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.${attr} ] ++ map (a: self.${a}) extraAttrs;
|
||||
nativeBuildInputs =
|
||||
(old.nativeBuildInputs or [ ])
|
||||
++ lib.optionals (!(builtins.isNull buildSystem)) [ buildSystem ]
|
||||
++ map (a: self.${a}) extraAttrs;
|
||||
}
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue