aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-12-05 09:38:56 +0100
committerLoïc Hoguin <[email protected]>2018-12-05 11:38:02 +0100
commit672f9310b5a1fc9e6b7bb65f725f278666511db3 (patch)
tree3065f0542330189998b7a864339faf61e60877ec /doc/src
parentf221d99c4188a64352a77f28441985572313ed0f (diff)
downloaderlang.mk-672f9310b5a1fc9e6b7bb65f725f278666511db3.tar.gz
erlang.mk-672f9310b5a1fc9e6b7bb65f725f278666511db3.tar.bz2
erlang.mk-672f9310b5a1fc9e6b7bb65f725f278666511db3.zip
Allow hooking before/after autopatch
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/guide/deps.asciidoc33
1 files changed, 28 insertions, 5 deletions
diff --git a/doc/src/guide/deps.asciidoc b/doc/src/guide/deps.asciidoc
index 9939e82..913fa24 100644
--- a/doc/src/guide/deps.asciidoc
+++ b/doc/src/guide/deps.asciidoc
@@ -502,11 +502,10 @@ performed:
* Run autopatch on the project
Autopatch first checks if there is any project-specific patch
-enabled. There are currently two: `RABBITMQ_CLIENT_PATCH` for
-the `amqp_client` dependency, and `RABBITMQ_SERVER_PATCH` for
-the `rabbit` dependency. These are needed only for RabbitMQ
-versions before 3.6.0 (assuming you are using upstream RabbitMQ,
-and not a fork).
+enabled. There are currently three: `RABBITMQ_CLIENT_PATCH` for
+the `amqp_client` dependency (before 3.6.0), `RABBITMQ_SERVER_PATCH`
+for the `rabbit` dependency (before 3.6.0) and `ELIXIR_PATCH`
+for the `elixir` dependency.
Otherwise, autopatch performs different operations depending
on the kind of project it finds the dependency to be.
@@ -529,6 +528,30 @@ empty Makefile generated, for compatibility purposes.
* Other projects with no Makefile are left untouched.
+You can add additional commands to be run immediately before
+or after autopatch is done by extending the target
+`autopatch-$(dep)::`, for example this would remove
+a module:
+
+[source,make]
+----
+autopatch-ranch::
+ rm -f $(DEPS_DIR)/ranch/src/ranch_proxy_header.erl
+----
+
+A common use case for this feature is to apply a PATCH
+file on the dependency immediately after fetching it.
+It can also be used to add compiler options, for example:
+
+[source,make]
+----
+autopatch-couchbeam::
+ printf "\nERLC_OPTS += -DWITH_JIFFY\n" >> $(DEPS_DIR)/couchbeam/Makefile
+----
+
+The commands will run before autopatch when the target is
+defined before including 'erlang.mk', and after otherwise.
+
You can disable the replacing of the 'erlang.mk' file by
defining the `NO_AUTOPATCH_ERLANG_MK` variable: