stdenv: steal checkInputs from buildPythonPackage

Note that a bunch of non-python packages use this attribute already.
Some of those are clearly unaware of the fact that this attribute does
not exists in stdenv because they define it but don't to add it to
their `bulidInputs` :)

Also note that I use `buildInputs` here and only handle regular
builds because python and haskell builders do it this way and I'm not
sure how to properly handle the cross-compilation case.
This commit is contained in:
Jan Malakhovski 2018-03-15 00:00:04 +00:00
parent 9345fc51d1
commit 87651b32fe
3 changed files with 22 additions and 2 deletions

View File

@ -1005,6 +1005,13 @@ but only if the <varname>doCheck</varname> variable is enabled.</para>
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>checkInputs</varname></term>
<listitem><para>
A list of dependencies used by the phase. This gets included in <varname>buildInputs</varname> when <varname>doCheck</varname> is set.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>makeFlags</varname> /
<varname>makeFlagsArray</varname> /
@ -1291,6 +1298,13 @@ installcheck</command>.</para>
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>installCheckInputs</varname></term>
<listitem><para>
A list of dependencies used by the phase. This gets included in <varname>buildInputs</varname> when <varname>doInstallCheck</varname> is set.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>preInstallCheck</varname></term>
<listitem><para>Hook executed at the start of the installCheck

View File

@ -75,7 +75,6 @@ toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [
buildInputs = [ wrapPython ]
++ lib.optional (lib.hasSuffix "zip" (attrs.src.name or "")) unzip
++ lib.optionals doCheck checkInputs
++ lib.optional catchConflicts setuptools # If we no longer propagate setuptools
++ buildInputs
++ pythonPath;
@ -86,6 +85,7 @@ toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [
# Python packages don't have a checkPhase, only an installCheckPhase
doCheck = false;
doInstallCheck = doCheck;
installCheckInputs = checkInputs;
postFixup = lib.optionalString (!dontWrapPythonPrograms) ''
wrapPythonPrograms

View File

@ -36,6 +36,9 @@ rec {
, depsTargetTarget ? [] # 1 -> 1
, depsTargetTargetPropagated ? [] # 1 -> 1
, checkInputs ? []
, installCheckInputs ? []
# Configure Phase
, configureFlags ? []
, # Target is not included by default because most programs don't care.
@ -101,7 +104,9 @@ rec {
]
[
(map (drv: drv.__spliced.hostHost or drv) depsHostHost)
(map (drv: drv.crossDrv or drv) buildInputs)
(map (drv: drv.crossDrv or drv) (buildInputs
++ lib.optionals doCheck' checkInputs
++ lib.optionals doInstallCheck' installCheckInputs))
]
[
(map (drv: drv.__spliced.targetTarget or drv) depsTargetTarget)
@ -155,6 +160,7 @@ rec {
(removeAttrs attrs
["meta" "passthru" "crossAttrs" "pos"
"doCheck" "doInstallCheck"
"checkInputs" "installCheckInputs"
"__impureHostDeps" "__propagatedImpureHostDeps"
"sandboxProfile" "propagatedSandboxProfile"])
// {