summary refs log tree commit diff
path: root/pkgs/build-support/emacs
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2019-11-07 18:24:49 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2019-11-08 13:28:59 -0500
commitca782498a9532c48d8e12ce402813486ab90e7f0 (patch)
tree6416780f09de93d3ca096c1f143908d91f814c7a /pkgs/build-support/emacs
parentf1481f2c9084d61cb5ebc55d4fa7edbc756128d3 (diff)
downloadnixpkgs-ca782498a9532c48d8e12ce402813486ab90e7f0.tar
nixpkgs-ca782498a9532c48d8e12ce402813486ab90e7f0.tar.gz
nixpkgs-ca782498a9532c48d8e12ce402813486ab90e7f0.tar.bz2
nixpkgs-ca782498a9532c48d8e12ce402813486ab90e7f0.tar.lz
nixpkgs-ca782498a9532c48d8e12ce402813486ab90e7f0.tar.xz
nixpkgs-ca782498a9532c48d8e12ce402813486ab90e7f0.tar.zst
nixpkgs-ca782498a9532c48d8e12ce402813486ab90e7f0.zip
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
Diffstat (limited to 'pkgs/build-support/emacs')
-rw-r--r--pkgs/build-support/emacs/setup-hook.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkgs/build-support/emacs/setup-hook.sh b/pkgs/build-support/emacs/setup-hook.sh
index e1db3e828fd..b55c1873802 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