From 8fe3d15c179c827bb9ed05d6352e9e54ea8ca9b3 Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Wed, 26 Jul 2023 00:57:35 -0700 Subject: [PATCH] python3.pkgs.bootstrap.installer: init at 0.7.0 Co-authored-by: K900 --- .../bootstrap/installer/default.nix | 29 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 3 ++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/python-modules/bootstrap/installer/default.nix 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 { });