nixpkgs/pkgs/build-support/emacs/setup-hook.sh
John Ericson ca782498a9 emacs package setup hook: Fix
1. Make the test more robust

2. EMACSLOADPATH may be initially undefined.

3. did `targetOffset` twice when meant `hostOffset` too
2019-11-08 13:28:59 -05:00

12 lines
447 B
Bash

addEmacsVars () {
if [[ -d "$1/share/emacs/site-lisp" ]]; then
export EMACSLOADPATH="$1/share/emacs/site-lisp${EMACSLOADPATH:+:}${EMACSLOADPATH-}"
fi
}
# If this is for a wrapper derivation, emacs and the dependencies are all
# run-time dependencies. If this is for precompiling packages into bytecode,
# emacs is a compile-time dependency of the package.
addEnvHooks "$hostOffset" addEmacsVars
addEnvHooks "$targetOffset" addEmacsVars