From c7c3cc10c521aa8dc44242b65cc72fa79ffef805 Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 30 Apr 2024 11:11:01 +0200 Subject: [PATCH] mix.exs: Dirty workaround to get port_compiler with OTP 27 support --- mix.exs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index 2d8dcf12a..f978fa0ff 100644 --- a/mix.exs +++ b/mix.exs @@ -13,7 +13,9 @@ defmodule Ejabberd.MixProject do erlc_options: erlc_options(), erlc_paths: ["asn1", "src"], # Elixir tests are starting the part of ejabberd they need - aliases: [test: "test --no-start"], + aliases: [ + test: "test --no-start", + "deps.get": ["deps.get", "pc_branch"]], start_permanent: Mix.env() == :prod, language: :erlang, dialyzer: dialyzer(), @@ -409,6 +411,14 @@ defmodule Ejabberd.MixProject do end end +defmodule Mix.Tasks.PcBranch do + use Mix.Task + def run(_) do + command = "find deps -name rebar.config.script -exec sed -i 's/AppendList..pc/AppendList\(\[{pc, {git, \"https:\\/\\/github.com\\/blt\\/port_compiler.git\", {branch, \"otp-27\"}}}/g' {} ';' " + :os.cmd(to_charlist(command)) + end +end + defmodule Mix.Tasks.Compile.Asn1 do use Mix.Task alias Mix.Compilers.Erlang