diff options
author | Loïc Hoguin <[email protected]> | 2015-12-04 18:44:27 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-12-04 18:44:27 +0100 |
commit | 171361e947c1cc49c9f8b56a5f7c6bd2c443a13d (patch) | |
tree | 35f12c33b4fa6170baf2c988e4c275756a9effc9 | |
parent | f58af72831338efba4d5e20898cf92c0ed9f1c0f (diff) | |
download | erlang.mk-171361e947c1cc49c9f8b56a5f7c6bd2c443a13d.tar.gz erlang.mk-171361e947c1cc49c9f8b56a5f7c6bd2c443a13d.tar.bz2 erlang.mk-171361e947c1cc49c9f8b56a5f7c6bd2c443a13d.zip |
Autopatch: handle $(PROJECT).app.src.script files
This fixes issues when including ErlyDTL in a release.
-rw-r--r-- | core/deps.mk | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/deps.mk b/core/deps.mk index 656ebcc..f2b9760 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -107,6 +107,9 @@ define dep_autopatch endef define dep_autopatch2 + if [ -f $(DEPS_DIR)/$1/src/$1.app.src.script ]; then \ + $(call erlang,$(call dep_autopatch_appsrc_script.erl,$(1))); \ + fi; \ $(call erlang,$(call dep_autopatch_appsrc.erl,$(1))); \ if [ -f $(DEPS_DIR)/$(1)/rebar.config -o -f $(DEPS_DIR)/$(1)/rebar.config.script ]; then \ $(call dep_autopatch_fetch_rebar); \ @@ -480,6 +483,15 @@ define dep_autopatch_app.erl halt() endef +define dep_autopatch_appsrc_script.erl + AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", + AppSrcScript = AppSrc ++ ".script", + Bindings = erl_eval:new_bindings(), + {ok, Conf} = file:script(AppSrcScript, Bindings), + ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), + halt() +endef + define dep_autopatch_appsrc.erl AppSrcOut = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcIn = case filelib:is_regular(AppSrcOut) of false -> "$(call core_native_path,$(DEPS_DIR)/$1/ebin/$1.app)"; true -> AppSrcOut end, |