[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/09: patches: honor NIX_STORE in site.py.
From: |
guix-commits |
Subject: |
01/09: patches: honor NIX_STORE in site.py. |
Date: |
Sat, 2 Feb 2019 14:10:29 -0500 (EST) |
reepca pushed a commit to branch guile-daemon
in repository guix.
commit ab31be5dfc1e6e4deaffffd28ba8536055f98d10
Author: Caleb Ristvedt <address@hidden>
Date: Wed Jan 30 17:00:32 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.
---
configure.ac | 3 ++-
...2.7-site-prefixes.patch => python-2.7-site-prefixes.patch.in} | 9 ++++++---
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 5d70de4..67e0d18 100644
--- a/configure.ac
+++ b/configure.ac
@@ -295,7 +295,8 @@ AC_CONFIG_FILES([Makefile
po/guix/Makefile.in
po/packages/Makefile.in
etc/guix-daemon.cil
- guix/config.scm])
+ guix/config.scm
+ gnu/packages/patches/python-2.7-site-prefixes.patch])
AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env])
AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
diff --git a/gnu/packages/patches/python-2.7-site-prefixes.patch
b/gnu/packages/patches/python-2.7-site-prefixes.patch.in
similarity index 81%
rename from gnu/packages/patches/python-2.7-site-prefixes.patch
rename to gnu/packages/patches/python-2.7-site-prefixes.patch.in
index 9e30665..0ac0da4 100644
--- a/gnu/packages/patches/python-2.7-site-prefixes.patch
+++ b/gnu/packages/patches/python-2.7-site-prefixes.patch.in
@@ -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 = '@storedir@'
+ 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 c1b79c5), guix-commits, 2019/02/02
- 02/09: guix: store: Make register-items transactional, register drv outputs, guix-commits, 2019/02/02
- 01/09: patches: honor NIX_STORE in site.py.,
guix-commits <=
- 05/09: build-derivations: use call-with-container, guix-commits, 2019/02/02
- 04/09: linux-container: new use-output argument., guix-commits, 2019/02/02
- 09/09: gnu: linux-container: Make it more suitable for derivation-building., guix-commits, 2019/02/02
- 06/09: build-derivations: initial build-group support, guix-commits, 2019/02/02
- 08/09: build-derivations: Leaked environment variables more robust., guix-commits, 2019/02/02
- 03/09: guix/store/build-derivations.scm: new module., guix-commits, 2019/02/02
- 07/09: linux-container: don't include /dev/ptmx or /dev/pts from host., guix-commits, 2019/02/02