diff --git a/pkgs/development/python-modules/bootstrap/installer/default.nix b/pkgs/development/python-modules/bootstrap/installer/default.nix new file mode 100644 index 000000000000..b569e7fa6dc8 --- /dev/null +++ b/pkgs/development/python-modules/bootstrap/installer/default.nix @@ -0,0 +1,29 @@ +{ lib +, stdenv +, python +, flit-core +, installer +}: + +stdenv.mkDerivation { + pname = "${python.libPrefix}-bootstrap-${installer.pname}"; + inherit (installer) version src meta; + + buildPhase = '' + runHook preBuild + + PYTHONPATH="${flit-core}/${python.sitePackages}" \ + ${python.interpreter} -m flit_core.wheel + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + PYTHONPATH=src ${python.interpreter} -m installer \ + --destdir "$out" --prefix "" dist/installer-*.whl + + runHook postInstall + ''; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fd86e596d860..a56e5ea05fc6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10,6 +10,9 @@ self: super: with self; { bootstrap = lib.recurseIntoAttrs { flit-core = toPythonModule (callPackage ../development/python-modules/bootstrap/flit-core { }); + installer = toPythonModule (callPackage ../development/python-modules/bootstrap/installer { + inherit (bootstrap) flit-core; + }); }; bootstrapped-pip = toPythonModule (callPackage ../development/python-modules/bootstrapped-pip { });