1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-28 08:31:59 +00:00
nixpkgs/pkgs/development/interpreters/python/build-python-package-common.nix
Frederik Rietdijk 2bcd41b9ff buildPythonPackage: install builds reproducibly
Without --build a temporary directory is created to unpack the wheel in.
We now set a directory instead.
2016-12-13 14:45:05 +01:00

33 lines
724 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} --build tmpbuild
popd
runHook postInstall
'';
}