summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/bootstrap/packaging/default.nix
blob: 8f429e5f5c652dcfe723056fb09dc3aa2213bb9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
  stdenv,
  python,
  flit-core,
  installer,
  packaging,
}:

stdenv.mkDerivation {
  pname = "${python.libPrefix}-bootstrap-${packaging.pname}";
  inherit (packaging) version src meta;

  buildPhase = ''
    runHook preBuild

    PYTHONPATH="${flit-core}/${python.sitePackages}" \
      ${python.interpreter} -m flit_core.wheel

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    PYTHONPATH="${installer}/${python.sitePackages}" \
      ${python.interpreter} -m installer \
        --destdir "$out" --prefix "" dist/*.whl

    runHook postInstall
  '';
}