Browse Source

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.
Loïc Hoguin 2 years ago
parent
commit
ec5d5db8fe
3 changed files with 6 additions and 2 deletions
  1. 3 0
      core/deps.mk
  2. 2 2
      doc/src/guide/deps.asciidoc
  3. 1 0
      test/Makefile

+ 3 - 0
core/deps.mk

@@ -206,6 +206,9 @@ ifneq ($(ALL_DEPS_DIRS),)
 			echo $$dep >> $(ERLANG_MK_TMP)/deps.log; \
 			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 \
 			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 \
 			elif [ -f $$dep/GNUmakefile ] || [ -f $$dep/makefile ] || [ -f $$dep/Makefile ]; then \
 				$(MAKE) -C $$dep IS_DEP=1; \
 				$(MAKE) -C $$dep IS_DEP=1; \
 				if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $$dep/ebin/dep_built; fi; \
 				if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $$dep/ebin/dep_built; fi; \

+ 2 - 2
doc/src/guide/deps.asciidoc

@@ -559,8 +559,8 @@ performed:
 * Run autopatch on the project
 * Run autopatch on the project
 
 
 Autopatch first checks if there is any project-specific patch
 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
 Otherwise, autopatch performs different operations depending
 on the kind of project it finds the dependency to be.
 on the kind of project it finds the dependency to be.

+ 1 - 0
test/Makefile

@@ -167,6 +167,7 @@ $(eval $(foreach t,$(patsubst %.mk,%,$(patsubst plugin_%,%,$(wildcard plugin_*.m
 # Packages.
 # Packages.
 
 
 PACKAGES = $(foreach pkg,$(sort $(wildcard ../index/*.mk)),$(notdir $(basename $(pkg))))
 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_CHECK = ['ci.erlang.mk', elvis_mk, esh_mk, hexer_mk, inaka_mk, 'lfe.mk', rust_mk]
 EXCLUDE_FROM_APP_CHECK = esh_mk rust_mk
 EXCLUDE_FROM_APP_CHECK = esh_mk rust_mk