Update "make translations" to reduce build requirements

Previously, preparing translations required rebar3 and:
  ./configure --enable-tools
  make
  make translations

With this change it works with rebar3 and mix, just running:
  ./configure
  make translations
This commit is contained in:
Badlop 2024-02-13 13:05:09 +01:00
parent e1f863afa4
commit 3c98ec5b48
4 changed files with 11 additions and 5 deletions

View File

@ -141,6 +141,8 @@ ifeq "$(REBAR_VER)" "6"
RELIVECMD=$(ESCRIPT) rel/relive.escript && MIX_ENV=dev RELIVE=true $(IEX) --name ejabberd@localhost -S mix run
REL_LIB_DIR = _build/dev/rel/ejabberd/lib
COPY_REL_TARGET = dev
GET_DEPS_TRANSLATIONS=MIX_ENV=translations $(REBAR) $(GET_DEPS)
DEPSDIR_TRANSLATIONS=deps
else
ifeq ($(REBAR_ENABLE_ELIXIR),true)
ELIXIR_LIBDIR_RAW=$(shell elixir -e "IO.puts(:filename.dirname(:code.lib_dir(:elixir)))" -e ":erlang.halt")
@ -169,6 +171,8 @@ endif
RELIVECMD=$(REBAR) relive
REL_LIB_DIR = _build/dev/rel/ejabberd/lib
COPY_REL_TARGET = dev
GET_DEPS_TRANSLATIONS=$(REBAR) as translations $(GET_DEPS)
DEPSDIR_TRANSLATIONS=_build/translations/lib
else
SKIPDEPS=skip_deps=true
LISTDEPS=-q list-deps
@ -228,7 +232,8 @@ options: all
tools/opt_types.sh ejabberd_option $(EBINDIR)
translations:
tools/prepare-tr.sh $(DEPSDIR)
$(GET_DEPS_TRANSLATIONS)
tools/prepare-tr.sh $(DEPSDIR_TRANSLATIONS)
doap:
tools/generate-doap.sh
@ -647,7 +652,7 @@ help:
@echo " doap Generate DOAP file"
@echo " edoc Generate edoc documentation (unused)"
@echo " options Generate ejabberd_option.erl"
@echo " translations Extract translation files (requires --enable-tools)"
@echo " translations Extract translation files"
@echo " TAGS Generate tags file for text editors"
@echo ""
@echo " dialyzer Run Dialyzer static analyzer"

View File

@ -256,7 +256,7 @@ AC_ARG_ENABLE(system_deps,
esac],[if test "x$system_deps" = "x"; then system_deps=false; fi])
AC_ARG_ENABLE(tools,
[AS_HELP_STRING([--enable-tools],[build development tools: ejabberd-po, etop (default: no)])],
[AS_HELP_STRING([--enable-tools],[build development tools: etop (default: no)])],
[case "${enableval}" in
yes) tools=true ;;
no) tools=false ;;

View File

@ -132,6 +132,8 @@ defmodule Ejabberd.MixProject do
defp cond_deps do
for {:true, dep} <- [{config(:pam), {:epam, "~> 1.0"}},
{Mix.env() == :translations,
{:ejabberd_po, git: "https://github.com/processone/ejabberd-po.git"}},
{config(:redis), {:eredis, "~> 1.2.0"}},
{config(:sip), {:esip, "~> 1.0"}},
{config(:zlib), {:ezlib, "~> 1.0"}},

View File

@ -25,8 +25,6 @@
{deps, [{base64url, ".*", {git, "https://github.com/dvv/base64url", {tag, "1.0.1"}}},
{cache_tab, ".*", {git, "https://github.com/processone/cache_tab", {tag, "1.0.30"}}},
{eimp, ".*", {git, "https://github.com/processone/eimp", {tag, "1.0.22"}}},
{if_var_true, tools,
{ejabberd_po, ".*", {git, "https://github.com/processone/ejabberd-po", {branch, "main"}}}},
{if_var_true, pam,
{epam, ".*", {git, "https://github.com/processone/epam", {tag, "1.0.14"}}}},
{if_var_true, redis,
@ -283,6 +281,7 @@
{copy, "ejabberd.yml.example", "conf/ejabberd.yml.example"},
{copy, "test/ejabberd_SUITE_data/ca.pem", "conf/"},
{copy, "test/ejabberd_SUITE_data/cert.pem", "conf/"}]}]}]},
{translations, [{deps, [{ejabberd_po, ".*", {git, "https://github.com/processone/ejabberd-po", {branch, "main"}}}]}]},
{test, [{erl_opts, [nowarn_export_all]}]}]}.
{alias, [{relive, [{shell, "--apps ejabberd \