nixpkgs/pkgs/development/interpreters/python/build-python-package-common.nix
Frederik Rietdijk 736169d01d buildPythonPackage: yet another fix, fixes #20943
I didn't copy the old behaviour correctly with
c1d98d959b
2016-12-06 16:48:55 +01:00

33 lines
707 B
Nix

# This function provides generic bits to install a Python wheel.
{ python
, bootstrapped-pip
}:
{ buildInputs ? []
# Additional flags to pass to "pip install".
, installFlags ? []
, ... } @ attrs:
attrs // {
buildInputs = buildInputs ++ [ bootstrapped-pip ];
configurePhase = attrs.configurePhase or ''
runHook preConfigure
runHook postConfigure
'';
installPhase = attrs.installPhase or ''
runHook preInstall
mkdir -p "$out/${python.sitePackages}"
export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
pushd dist
${bootstrapped-pip}/bin/pip install *.whl --no-index --prefix=$out --no-cache ${toString installFlags}
popd
runHook postInstall
'';
}