1{ stdenv, python }:
2
3stdenv.mkDerivation {
4 pname = "python-recursive-pth-loader";
5 version = "1.0";
6
7 dontUnpack = true;
8
9 buildInputs = [ python ];
10
11 patchPhase = "cat ${./sitecustomize.py} > sitecustomize.py";
12
13 buildPhase = "${python.pythonOnBuildForHost}/bin/${python.pythonOnBuildForHost.executable} -m compileall .";
14
15 installPhase = ''
16 dst=$out/${python.sitePackages}
17 mkdir -p $dst
18 cp sitecustomize.* $dst/
19 '';
20
21 meta = {
22 description = "Enable recursive processing of pth files anywhere in sys.path";
23 };
24}