summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2020-06-16 09:24:28 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2020-06-16 09:24:28 +0200
commit55035b3041001957f6593a7255c03b14e90745dc (patch)
tree5e55dbfbf219ce4e15c9567620496368b4d106f7 /Makefile
parent22873693e3719269ab14f2b53b4a2d16d4a88fcc (diff)
Handle Straight user config
Make was not working with async installed in Straight, and emacs-helm.sh as well. In Makefile try to find Straight build directory and add it to LOAD-PATH if found. Same for emacs-helm.sh and don't use package.el if straight directory is found. Now Helm compile with async installed with Straight and emacs-helm.sh is working with no extra config.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 14 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 1d3a53c8..accc8baf 100644
--- a/Makefile
+++ b/Makefile
@@ -36,8 +36,13 @@ PKGDIR := .
LOADPATH := -L $(PKGDIR)
# Prefer emacs config folder in XDG_CONFIG_HOME to ~/.emacs.d
+# Assume emacs-user-directory is ~/.emacs.d
+# Try to find ELPA directory or STRAIGHT directory.
XDG_ELPA_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME)/emacs/elpa, $(HOME)/.config/emacs/elpa)
-ELPA_DIR := $(if $(shell test -d $(XDG_ELPA_DIR)), $(HOME)/.emacs.d/elpa, $(XDG_ELPA_DIR))
+ELPA_DIR := $(if $(shell test -d $(XDG_ELPA_DIR)), $(XDG_ELPA_DIR), $(HOME)/.emacs.d/elpa)
+
+XDG_STRAIGHT_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME)/emacs/straight/build, $(HOME)/.config/emacs/straight/build)
+STRAIGHT_DIR := $(if $(shell test -d $(XDG_STRAIGHT_DIR)), $(XDG_STRAIGHT_DIR), $(HOME)/.emacs.d/straight/build)
ASYNC_ELPA_DIR = $(shell \
test -d $(ELPA_DIR) && \
@@ -47,6 +52,14 @@ ifneq "$(ASYNC_ELPA_DIR)" ""
LOADPATH += -L $(ASYNC_ELPA_DIR)
endif
+ASYNC_STRAIGHT_DIR = $(shell \
+ test -d $(STRAIGHT_DIR) && \
+ find -L $(STRAIGHT_DIR) -maxdepth 1 -regex '.*/async' 2> /dev/null | \
+ sort | tail -n 1)
+ifneq "$(ASYNC_STRAIGHT_DIR)" ""
+ LOADPATH += -L $(ASYNC_STRAIGHT_DIR)
+endif
+
# Files to compile
EL := $(sort $(wildcard helm*.el))