[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/19: patches: honor NIX_STORE in site.py.
From: |
guix-commits |
Subject: |
01/19: patches: honor NIX_STORE in site.py. |
Date: |
Tue, 29 Jan 2019 14:19:48 -0500 (EST) |
reepca pushed a commit to branch guile-daemon
in repository guix.
commit a136f3a4aa64643f8d5802bca79477096725fc67
Author: Caleb Ristvedt <address@hidden>
Date: Tue Jan 8 01:26:59 2019 -0600
patches: honor NIX_STORE in site.py.
Previously various python packages would fail to work unless the store they
were kept in was /gnu/store. This fixes that.
* gnu/packages/patches/python-2.7-site-prefixes.patch: Try NIX_STORE first
and only use /gnu/store as a fallback.
---
gnu/packages/patches/python-2.7-site-prefixes.patch | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/patches/python-2.7-site-prefixes.patch
b/gnu/packages/patches/python-2.7-site-prefixes.patch
index 9e30665..0451d07 100644
--- a/gnu/packages/patches/python-2.7-site-prefixes.patch
+++ b/gnu/packages/patches/python-2.7-site-prefixes.patch
@@ -5,7 +5,7 @@ site-packages (and .pth files) are searched.
--- Python-2.7.11/Lib/site.py 2016-10-17 23:44:51.930871644 +0200
***************
*** 65,70 ****
---- 65,82 ----
+--- 65,85 ----
# Prefixes for site-packages; add additional prefixes like /usr/local here
PREFIXES = [sys.prefix, sys.exec_prefix]
@@ -16,9 +16,12 @@ site-packages (and .pth files) are searched.
+ # 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`).
++ guix_store = os.getenv("NIX_STORE")
++ if not guix_store:
++ guix_store = '/gnu/store'
+ for p in sys.path:
-+ if p.startswith('/gnu/store/'):
-+ PREFIXES.append(p[:p.find('/', 44)]) # find first pathsep after hash
++ if p.startswith(guix_store):
++ PREFIXES.append(p[:p.find('/', 34 + len(guix_store))]) # find first
pathsep after hash
+ del p
+
# Enable per user site-packages directory
- branch guile-daemon created (now 10b0562), guix-commits, 2019/01/29
- 07/19: guix: register-path: reset timestamps after registering., guix-commits, 2019/01/29
- 01/19: patches: honor NIX_STORE in site.py.,
guix-commits <=
- 04/19: .dir-locals.el: properly indent sql macros., guix-commits, 2019/01/29
- 08/19: guix: register-path: do deduplication., guix-commits, 2019/01/29
- 12/19: linux-container: new use-output argument., guix-commits, 2019/01/29
- 02/19: guix: register-path: Implement prototype in scheme., guix-commits, 2019/01/29
- 05/19: guix: sql.scm: split into generic and store-specific parts., guix-commits, 2019/01/29
- 09/19: guix: register-path: return #t on success., guix-commits, 2019/01/29
- 03/19: guix: register-path: Honor environment variables., guix-commits, 2019/01/29
- 06/19: guix: register-path: use new %store-database-directory, guix-commits, 2019/01/29
- 10/19: guix: register-path: use new %store-database-directory, guix-commits, 2019/01/29
- 16/19: build-derivations: Leaked environment variables more robust., guix-commits, 2019/01/29