14 stdenv.mkDerivation rec {
16 inherit (pip) version;
17 name = "${python.libPrefix}-bootstrapped-${pname}-${version}";
26 dontUseSetuptoolsBuild = true;
27 dontUsePipInstall = true;
29 # Should be propagatedNativeBuildInputs
30 propagatedBuildInputs = [
31 # Override to remove dependencies to prevent infinite recursion.
32 (pipInstallHook.override { pip = null; })
33 (setuptoolsBuildHook.override {
47 buildInputs = [ python ];
52 lib.optionalString (!stdenv.hostPlatform.isWindows) ''
53 export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
56 # Give folders a known name
58 mv setuptools* setuptools
61 # - pip and setuptools need to be in PYTHONPATH to install setuptools, wheel, and pip.
62 # - $out is where we are installing to and takes precedence, and is where wheel will end so we can install pip.
63 export PYTHONPATH="$out/${python.sitePackages}:$(pwd)/pip/src:$(pwd)/setuptools:$(pwd)/setuptools/pkg_resources:$PYTHONPATH"
65 echo "Building setuptools wheel..."
67 ${python.pythonOnBuildForHost.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache .
70 echo "Building wheel wheel..."
72 ${python.pythonOnBuildForHost.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache .
75 echo "Building pip wheel..."
77 ${python.pythonOnBuildForHost.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache .
82 description = "Version of pip used for bootstrapping";
83 license = lib.unique (pip.meta.license ++ setuptools.meta.license ++ wheel.meta.license);
84 homepage = pip.meta.homepage;