mirror of
https://github.com/processone/ejabberd.git
synced 2025-01-01 17:53:00 +01:00
Add workaround so rebar2 can use Elixir 1.12.0
Notice that Elixir 1.12.0 requires Erlang/OTP 21 or higher BTW, this workaround works only with rebar2... unfortunately rebar3 doesn't compile the elixir files from lib/
This commit is contained in:
parent
91763bbc61
commit
937e1c2e37
14
Makefile.in
14
Makefile.in
@ -130,6 +130,7 @@ ifeq "$(IS_REBAR)" "3"
|
|||||||
EBINDIR=$(DEPSDIR)/ejabberd/ebin
|
EBINDIR=$(DEPSDIR)/ejabberd/ebin
|
||||||
REBARREL=$(REBAR) as prod tar
|
REBARREL=$(REBAR) as prod tar
|
||||||
REBARDEV=REBAR_PROFILE=dev $(REBAR) release
|
REBARDEV=REBAR_PROFILE=dev $(REBAR) release
|
||||||
|
ELIXIR_WARNING="\033[32m===>\033[00m If you get \033[1;91mDependency failure: source for elixir...\033[00m, please run \033[4;37mmake\033[00m again"
|
||||||
else
|
else
|
||||||
SKIPDEPS=skip_deps=true
|
SKIPDEPS=skip_deps=true
|
||||||
LISTDEPS=-q list-deps
|
LISTDEPS=-q list-deps
|
||||||
@ -142,12 +143,23 @@ else
|
|||||||
EBINDIR=ebin
|
EBINDIR=ebin
|
||||||
REBARREL=$(REBAR) generate
|
REBARREL=$(REBAR) generate
|
||||||
REBARDEV=
|
REBARDEV=
|
||||||
|
ELIXIR_WARNING="\033[32m===>\033[00m If you get \033[1;91mERROR: Dependency dir .../elixir failed...\033[00m, please run \033[4;37mmake\033[00m again"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: deps src
|
all: deps src
|
||||||
|
|
||||||
deps: $(DEPSDIR)/.got
|
deps: elixir-rebar $(DEPSDIR)/.got
|
||||||
|
|
||||||
|
elixir-rebar:
|
||||||
|
@[ @elixir@ = true ] \
|
||||||
|
&& ( [ ! -d $(DEPSDIR)/elixir/ ] \
|
||||||
|
&& echo $(ELIXIR_WARNING) \
|
||||||
|
|| ( [ ! -f $(DEPSDIR)/elixir/rebar.config ] \
|
||||||
|
&& { mkdir $(DEPSDIR)/elixir/src ; \
|
||||||
|
cp lib/elixir.app.src $(DEPSDIR)/elixir/src/ ; \
|
||||||
|
cp lib/rebar.config $(DEPSDIR)/elixir/ ; } \
|
||||||
|
|| true ) ) || true
|
||||||
|
|
||||||
$(DEPSDIR)/.got:
|
$(DEPSDIR)/.got:
|
||||||
rm -rf $(DEPSDIR)/.got
|
rm -rf $(DEPSDIR)/.got
|
||||||
|
11
lib/elixir.app.src
Normal file
11
lib/elixir.app.src
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{application, elixir,
|
||||||
|
[{description, "elixir"},
|
||||||
|
{vsn, "1.12.0"},
|
||||||
|
{modules, [
|
||||||
|
elixir
|
||||||
|
]},
|
||||||
|
{registered, [elixir_config, elixir_code_server]},
|
||||||
|
{applications, [kernel,stdlib,compiler]},
|
||||||
|
{mod, {elixir,[]}},
|
||||||
|
{env, [{ansi_enabled, false}]}
|
||||||
|
]}.
|
21
lib/rebar.config
Normal file
21
lib/rebar.config
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
%% Using Elixir as a Rebar dependency
|
||||||
|
|
||||||
|
%% This configuration file only exists so Elixir can be used
|
||||||
|
%% as a Rebar dependency, the same happens for the file
|
||||||
|
%% src/elixir.app.src.
|
||||||
|
|
||||||
|
%% In practice, Elixir is structured as OTP where many applications
|
||||||
|
%% are placed in the lib directory. Since this structure is not
|
||||||
|
%% supported by default by Rebar, after adding Elixir as a dependency
|
||||||
|
%% you need to explicitly add it to lib_dirs:
|
||||||
|
%%
|
||||||
|
%% {lib_dirs, [
|
||||||
|
%% "deps/elixir/lib"
|
||||||
|
%% ]}.
|
||||||
|
%%
|
||||||
|
|
||||||
|
%% Run "make" as the proper compilation step
|
||||||
|
{post_hooks, [{compile, "make compile"}]}.
|
||||||
|
|
||||||
|
%% This prevents rebar_elixir_plugin from recompiling Elixir
|
||||||
|
{ex_opts, [{src_dirs, [".PHONY"]}]}.
|
@ -24,7 +24,7 @@
|
|||||||
{if_var_true, tools,
|
{if_var_true, tools,
|
||||||
{ejabberd_po, ".*", {git, "https://github.com/processone/ejabberd-po", {branch, "main"}}}},
|
{ejabberd_po, ".*", {git, "https://github.com/processone/ejabberd-po", {branch, "main"}}}},
|
||||||
{if_var_true, elixir,
|
{if_var_true, elixir,
|
||||||
{elixir, ".*", {git, "https://github.com/elixir-lang/elixir", {tag, "v1.4.4"}}}},
|
{elixir, ".*", {git, "https://github.com/elixir-lang/elixir", {tag, "v1.12.0"}}}},
|
||||||
{if_var_true, pam,
|
{if_var_true, pam,
|
||||||
{epam, ".*", {git, "https://github.com/processone/epam", {tag, "1.0.10"}}}},
|
{epam, ".*", {git, "https://github.com/processone/epam", {tag, "1.0.10"}}}},
|
||||||
{if_var_true, redis,
|
{if_var_true, redis,
|
||||||
|
Loading…
Reference in New Issue
Block a user