From e13b4c71d764cc92a1e5a92f5f2dd1c1f59b4a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 19 Mar 2025 12:27:02 +0100 Subject: Properly handle asdf-installed Elixir --- core/elixir.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/elixir.mk b/core/elixir.mk index 8d1dba9..eb5c487 100644 --- a/core/elixir.mk +++ b/core/elixir.mk @@ -10,7 +10,12 @@ export ELIXIR ifeq ($(ELIXIR),system) # We expect 'elixir' to be on the path. -ELIXIR_LIBS ?= $(dir $(shell readlink -f `which elixir`))/../lib +ELIXIR_BIN ?= $(shell readlink -f `which elixir`) +ELIXIR_LIBS ?= $(abspath $(dir $(ELIXIR_BIN))/../lib) +# Fallback in case 'elixir' is a shim. +ifeq ($(wildcard $(ELIXIR_LIBS)/elixir/),) +ELIXIR_LIBS = $(abspath $(shell elixir -e 'IO.puts(:code.lib_dir(:elixir))')/../) +endif ELIXIR_LIBS := $(ELIXIR_LIBS) export ELIXIR_LIBS ERL_LIBS := $(ERL_LIBS):$(ELIXIR_LIBS) -- cgit v1.2.3