2016-12-03 13:04:52 +01:00
|
|
|
# This function provides generic bits to install a Python wheel.
|
|
|
|
|
|
|
|
{ python
|
|
|
|
}:
|
|
|
|
|
|
|
|
{ buildInputs ? []
|
|
|
|
# Additional flags to pass to "pip install".
|
|
|
|
, installFlags ? []
|
|
|
|
, ... } @ attrs:
|
|
|
|
|
|
|
|
attrs // {
|
2019-01-02 20:09:44 +01:00
|
|
|
buildInputs = buildInputs ++ [ python.pythonForBuild.pkgs.bootstrapped-pip ];
|
2016-12-03 13:04:52 +01:00
|
|
|
|
2016-12-06 16:36:06 +01:00
|
|
|
configurePhase = attrs.configurePhase or ''
|
2016-12-05 17:29:39 +01:00
|
|
|
runHook preConfigure
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
2016-12-03 13:04:52 +01:00
|
|
|
installPhase = attrs.installPhase or ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p "$out/${python.sitePackages}"
|
|
|
|
export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
|
|
|
|
|
|
|
|
pushd dist
|
2019-01-02 20:09:44 +01:00
|
|
|
${python.pythonForBuild.pkgs.bootstrapped-pip}/bin/pip install *.whl --no-index --prefix=$out --no-cache ${toString installFlags} --build tmpbuild
|
2016-12-03 13:04:52 +01:00
|
|
|
popd
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2016-12-06 16:36:06 +01:00
|
|
|
}
|