summary refs log tree commit diff
path: root/gnu/packages/patches/python-2.7-site-prefixes.patch
diff options
context:
space:
mode:
authorHartmut Goebel <h.goebel@crazy-compilers.com>2016-11-29 19:06:27 +0100
committerHartmut Goebel <h.goebel@crazy-compilers.com>2016-11-29 19:06:27 +0100
commit03e856ddf5d28bc61144effb1a393b73cb4a2d9f (patch)
treef477e079cbdb4b274130e4fcb6c6a5acb781eedf /gnu/packages/patches/python-2.7-site-prefixes.patch
parent072f1e22cc6b1708fddedd1ac7ab12827284a785 (diff)
parent80983df357856fe4e65e384a655e466164e049a1 (diff)
downloadguix-03e856ddf5d28bc61144effb1a393b73cb4a2d9f.tar.gz
Merge branch 'python-build-system'.
Diffstat (limited to 'gnu/packages/patches/python-2.7-site-prefixes.patch')
-rw-r--r--gnu/packages/patches/python-2.7-site-prefixes.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-2.7-site-prefixes.patch b/gnu/packages/patches/python-2.7-site-prefixes.patch
new file mode 100644
index 0000000000..9e3066508f
--- /dev/null
+++ b/gnu/packages/patches/python-2.7-site-prefixes.patch
@@ -0,0 +1,26 @@
+Add all /gnu/store/ prefixes found in PYTHONPATH to the prefixes where
+site-packages (and .pth files) are searched.
+
+*** Python-2.7.11/Lib/site.py.orig	2016-10-17 23:27:23.746149690 +0200
+--- Python-2.7.11/Lib/site.py	2016-10-17 23:44:51.930871644 +0200
+***************
+*** 65,70 ****
+--- 65,82 ----
+  
+  # Prefixes for site-packages; add additional prefixes like /usr/local here
+  PREFIXES = [sys.prefix, sys.exec_prefix]
++ # Guix: Add all /gnu/store-paths in PYTHONPATH--these are all
++ # "prefixes".  This is required to search .pth files in all python
++ # packages contained in /gnu/store which is required to make
++ # .pth-defined namespace packages work.
++ # This is necessary if the packages are not merged into a single
++ # `site-packages` directory (like when using `guix environment`) but
++ # listed in PYTHONPATH (like when running `guix build`).
++ for p in sys.path:
++     if p.startswith('/gnu/store/'):
++         PREFIXES.append(p[:p.find('/', 44)]) # find first pathsep after hash
++ del p
++ 
+  # Enable per user site-packages directory
+  # set it to False to disable the feature or True to force the feature
+  ENABLE_USER_SITE = None