Commit cd370ab1 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

environ: Compute the right search path for the profile.

* guix-kernel/environ.scm (make-new-environment): Remove hard-coded
search path variables and use 'profile-search-paths' instead.
parent 669abe5e
......@@ -25,9 +25,11 @@
#:use-module (guix profiles)
#:use-module (guix derivations)
#:use-module (guix build utils)
#:use-module (guix search-paths)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-26)
#:use-module (ice-9 match)
#:export (guile->bin-path
guile-current-version->path
guile-current-load-path->args-list
......@@ -129,33 +131,14 @@
;; Modified variables.
(ps1 (env->str "PS1" (string-append "'Jupyter Guix Kernel ["
name "] -> '")))
(jenv (env->str "JUPYTER_ENV" name)) ;Environment name.
(jenv (env->str "JUPYTER_ENV" name)) ;Environment name.
;; Paths.
(profile (make-profile packages))
(path (env-profile->str "PATH" profile "/bin"))
(cpath (env-profile->str "CPATH" profile "/include"))
(infopath (env-profile->str "INFOPATH" profile "/share/info"))
(manpath (env-profile->str "MANPATH" profile "/share/man"))
(libpath (env-profile->str "LIBRARY_PATH" profile "/lib"))
(alocal (env-profile->str "ALOCAL_PATH" profile "/share/alocal"))
;; Jupyter kernels path.
(jupyter (env-profile->str "JUPYTER_PATH" profile "/share/jupyter"))
;; Guile paths.
(effective (effective-version))
(guile-load-path (env-profile->str "GUILE_LOAD_PATH"
profile
(string-append "/share/guile/site/"
effective)))
(guile-compiled (env-profile->str "GUILE_LOAD_COMPILED_PATH"
profile
(string-append "/lin/guile/"
effective
"/site-ccache"))))
(paths (profile-search-paths profile)))
;; List of environment variables.
(list home user logname term pwd pager shell ps1 jenv
;; Paths.
path cpath infopath manpath libpath alocal
;; Jupyter kernels path.
jupyter
;; Guile paths.
guile-load-path guile-compiled)))
(cons* home user logname term pwd pager shell ps1 jenv
(map (match-lambda
((spec . value)
(env->str (search-path-specification-variable spec)
value)))
paths))))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment