mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 05:00:16 +00:00
a7e33ec60c
svn path=/nixpkgs/trunk/; revision=13554
34 lines
1.1 KiB
Diff
34 lines
1.1 KiB
Diff
--- a/site.py 2008-11-19 14:48:49.000000000 +0100
|
|
--- Python-2.5-orig/Lib/site.py 2008-05-10 19:36:24.000000000 +0200
|
|
+++ Python-2.5/Lib/site.py 2008-11-17 05:37:02.000000000 +0100
|
|
@@ -390,6 +390,20 @@
|
|
except ImportError:
|
|
pass
|
|
|
|
+def addnixsitepackages(known_paths):
|
|
+ """
|
|
+ used to add multiple site packages for /nix/store to sys.path also
|
|
+ evaluating the .pth files (http://docs.python.org/library/site.html#module-site)
|
|
+ """
|
|
+ env_nix_sites = os.environ.get("NIX_PYTHON_SITES", None)
|
|
+ if env_nix_sites:
|
|
+ for path in env_nix_sites.split(":"):
|
|
+
|
|
+ NIX_SITE = os.path.join(path, "lib",
|
|
+ "python" + sys.version[:3],
|
|
+ "site-packages")
|
|
+ addsitedir(NIX_SITE, known_paths)
|
|
+ return known_paths
|
|
|
|
def main():
|
|
abs__file__()
|
|
@@ -400,6 +414,7 @@
|
|
paths_in_sys = addsitepackages(paths_in_sys)
|
|
if sys.platform == 'os2emx':
|
|
setBEGINLIBPATH()
|
|
+ paths_in_sys = addnixsitepackages(paths_in_sys)
|
|
setquit()
|
|
setcopyright()
|
|
sethelper()
|
|
|