From 5f3b19e661a18a10f65185a02df025c094ffe59b Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Sat, 7 Sep 2013 00:48:42 +0200 Subject: [PATCH] recursive-pth-loader: build sitecustomize.pyc If this file is not created at build time, then python (when run as root) will create it at run time and mess up the consistency of the nix store. --- .../python-modules/recursive-pth-loader/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/recursive-pth-loader/default.nix b/pkgs/development/python-modules/recursive-pth-loader/default.nix index 959882be9380..e281d69c98ae 100644 --- a/pkgs/development/python-modules/recursive-pth-loader/default.nix +++ b/pkgs/development/python-modules/recursive-pth-loader/default.nix @@ -7,11 +7,15 @@ stdenv.mkDerivation rec { buildInputs = [ python ]; + patchPhase = "cat ${./sitecustomize.py} > sitecustomize.py"; + + buildPhase = "python -m compileall ."; + installPhase = '' dst=$out/lib/${python.libPrefix}/site-packages mkdir -p $dst - cat ${./sitecustomize.py} >> $dst/sitecustomize.py + cp sitecustomize.* $dst/ ''; meta = {