From ec5d5db8feb8c797ddaaf5e4d1afbae31eda461e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 5 May 2023 16:14:23 +0200 Subject: Deps: Add a project-specific patch for hut Hut has both a Makefile and erlang.mk but the default target does not build the project. To fix a few packages we have a special patch HUT_PATCH that will call the appropriate target. --- core/deps.mk | 3 +++ doc/src/guide/deps.asciidoc | 4 ++-- test/Makefile | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/deps.mk b/core/deps.mk index d07bb0c..6741580 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -206,6 +206,9 @@ ifneq ($(ALL_DEPS_DIRS),) echo $$dep >> $(ERLANG_MK_TMP)/deps.log; \ if [ -z "$(strip $(FULL))" ] $(if $(force_rebuild_dep),&& ! ($(call force_rebuild_dep,$$dep)),) && [ ! -L $$dep ] && [ -f $$dep/ebin/dep_built ]; then \ :; \ + elif [ "$$dep" = "$(DEPS_DIR)/hut" -a "$(HUT_PATCH)" ]; then \ + $(MAKE) -C $$dep app IS_DEP=1; \ + if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $$dep/ebin/dep_built; fi; \ elif [ -f $$dep/GNUmakefile ] || [ -f $$dep/makefile ] || [ -f $$dep/Makefile ]; then \ $(MAKE) -C $$dep IS_DEP=1; \ if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $$dep/ebin/dep_built; fi; \ diff --git a/doc/src/guide/deps.asciidoc b/doc/src/guide/deps.asciidoc index a6b50f8..3f0f77c 100644 --- a/doc/src/guide/deps.asciidoc +++ b/doc/src/guide/deps.asciidoc @@ -559,8 +559,8 @@ performed: * Run autopatch on the project Autopatch first checks if there is any project-specific patch -enabled. There is currently one: `ELIXIR_PATCH` for the `elixir` -dependency. +enabled. There are currently two: `ELIXIR_PATCH` for the `elixir` +dependency and `HUT_PATCH` for the `hut` dependency. Otherwise, autopatch performs different operations depending on the kind of project it finds the dependency to be. diff --git a/test/Makefile b/test/Makefile index e2efc22..dcbdb5f 100644 --- a/test/Makefile +++ b/test/Makefile @@ -167,6 +167,7 @@ $(eval $(foreach t,$(patsubst %.mk,%,$(patsubst plugin_%,%,$(wildcard plugin_*.m # Packages. PACKAGES = $(foreach pkg,$(sort $(wildcard ../index/*.mk)),$(notdir $(basename $(pkg)))) +PATCHES = HUT_PATCH=1 EXCLUDE_FROM_CHECK = ['ci.erlang.mk', elvis_mk, esh_mk, hexer_mk, inaka_mk, 'lfe.mk', rust_mk] EXCLUDE_FROM_APP_CHECK = esh_mk rust_mk -- cgit v1.2.3