From a09f222b4cc1dff6435983c413e3b7fafeda2cc4 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 16 Feb 2024 19:38:50 +0100 Subject: [PATCH] Use Luerl 1.0 for Erlang 20, 1.1.1 for 21-26, and temporary fork for 27 The Luerl 1.1.0 and 1.1.1 hex packages contain garbage files that break compilation with Erlang 20. --- mix.exs | 5 ++++- rebar.config | 22 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/mix.exs b/mix.exs index 38fc3eb73..28fa171e8 100644 --- a/mix.exs +++ b/mix.exs @@ -140,7 +140,10 @@ defmodule Ejabberd.MixProject do {config(:sip), {:esip, "~> 1.0"}}, {config(:zlib), {:ezlib, "~> 1.0"}}, {if_version_below(~c"22", true), {:lager, "~> 3.9.1"}}, - {config(:lua), {:luerl, "~> 1.0"}}, + {config(:lua) and if_version_below(~c"27", true), + {:luerl, "~> 1.1.1"}}, + {config(:lua) and if_version_above(~c"26", true), + {:luerl, git: "https://github.com/processone/luerl", branch: "otp27"}}, {config(:mysql), {:p1_mysql, ">= 1.0.23" }}, {config(:pgsql), {:p1_pgsql, "~> 1.1"}}, {config(:sqlite), {:sqlite3, "~> 1.1"}}, diff --git a/rebar.config b/rebar.config index 8a520a048..de4ebf951 100644 --- a/rebar.config +++ b/rebar.config @@ -48,14 +48,28 @@ {if_version_below, "22", {lager, ".*", {git, "https://github.com/erlang-lager/lager", {tag, "3.9.1"}}} }, + %% Lua, rebar, OTP 20: 1.0 git tag {if_var_true, lua, {if_not_rebar3, - {luerl, ".*", {git, "https://github.com/rvirding/luerl", {tag, "1.0"}}} - }}, + {if_version_below, "21", + {luerl, ".*", {git, "https://github.com/rvirding/luerl", {tag, "1.0"}}} + }}}, + %% Lua, rebar3, OTP 20: 1.0.0 hex package {if_var_true, lua, {if_rebar3, - {luerl, ".*", {git, "https://github.com/rvirding/luerl", {tag, "1.0.0"}}} - }}, + {if_version_below, "21", + {luerl, ".*", {git, "https://github.com/rvirding/luerl", {tag, "1.0.0"}}} + }}}, + %% Lua, any rebar, OTP 21-26: 1.1.1 git tag / 1.1.1 hex package + {if_var_true, lua, + {if_version_above, "20", {if_version_below, "27", + {luerl, ".*", {git, "https://github.com/rvirding/luerl", {tag, "1.1.1"}}} + }}}, + %% Lua, any rebar, OTP 27: temporary otp27 branch from fork + {if_var_true, lua, + {if_version_above, "26", + {luerl, ".*", {git, "https://github.com/processone/luerl", {branch, "otp27"}}} + }}, {mqtree, ".*", {git, "https://github.com/processone/mqtree", {tag, "1.0.15"}}}, {p1_acme, ".*", {git, "https://github.com/processone/p1_acme", {tag, "1.0.22"}}}, {if_var_true, mysql,