From ca782498a9532c48d8e12ce402813486ab90e7f0 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Nov 2019 18:24:49 -0500 Subject: [PATCH] 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 --- pkgs/build-support/emacs/setup-hook.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/emacs/setup-hook.sh b/pkgs/build-support/emacs/setup-hook.sh index e1db3e828fd7..b55c18738023 100644 --- a/pkgs/build-support/emacs/setup-hook.sh +++ b/pkgs/build-support/emacs/setup-hook.sh @@ -1,11 +1,11 @@ addEmacsVars () { - if test -d $1/share/emacs/site-lisp; then - export EMACSLOADPATH="$1/share/emacs/site-lisp:$EMACSLOADPATH" + 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 "$targetOffset" addEmacsVars +addEnvHooks "$hostOffset" addEmacsVars addEnvHooks "$targetOffset" addEmacsVars