summary refs log tree commit diff
path: root/pkgs/development/python-modules/recursive-pth-loader
diff options
context:
space:
mode:
authorRicardo M. Correia <rcorreia@wizy.org>2013-09-07 00:48:42 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2013-09-08 21:21:28 +0200
commit5f3b19e661a18a10f65185a02df025c094ffe59b (patch)
treec53cc4441f6c884e4db65a34b82056d5fb486424 /pkgs/development/python-modules/recursive-pth-loader
parent575be7dd4bde2121dfff755d3f671ef8822580da (diff)
downloadnixlib-5f3b19e661a18a10f65185a02df025c094ffe59b.tar
nixlib-5f3b19e661a18a10f65185a02df025c094ffe59b.tar.gz
nixlib-5f3b19e661a18a10f65185a02df025c094ffe59b.tar.bz2
nixlib-5f3b19e661a18a10f65185a02df025c094ffe59b.tar.lz
nixlib-5f3b19e661a18a10f65185a02df025c094ffe59b.tar.xz
nixlib-5f3b19e661a18a10f65185a02df025c094ffe59b.tar.zst
nixlib-5f3b19e661a18a10f65185a02df025c094ffe59b.zip
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.
Diffstat (limited to 'pkgs/development/python-modules/recursive-pth-loader')
-rw-r--r--pkgs/development/python-modules/recursive-pth-loader/default.nix6
1 files changed, 5 insertions, 1 deletions
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 = {