aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2018-01-25 17:12:21 +0800
committermat <mat@FreeBSD.org>2018-01-25 17:12:21 +0800
commit7fdfe1db314260ec51df0d2f305ab5d85ac31b0f (patch)
treed6aa7d6ca6325a6a215b8dbfa4ed3c66257ce0d2
parent38daea5ade24e85f8fa7dd27fda92a61a1b73f13 (diff)
downloadfreebsd-ports-gnome-7fdfe1db314260ec51df0d2f305ab5d85ac31b0f.tar.gz
freebsd-ports-gnome-7fdfe1db314260ec51df0d2f305ab5d85ac31b0f.tar.zst
freebsd-ports-gnome-7fdfe1db314260ec51df0d2f305ab5d85ac31b0f.zip
Add support to passing directories to EXTRA_PATCHES.
Instead of: EXTRA_PATCHES= ${PATCHDIR}/feat-foo-patch-file.c \ ${PATCHDIR}/feat-foo-patch-file.h \ ${PATCHDIR}/feat-foo-patch-file2.c Move those files to ${PATCHDIR}/feat-foo/, name them patch-*, and set: EXTRA_PATCHES= ${PATCHDIR}/feat-foo Approved by: bdrewery Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D10855
-rw-r--r--CHANGES15
-rw-r--r--Mk/Scripts/do-patch.sh11
-rw-r--r--Mk/bsd.port.mk4
3 files changed, 26 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 692b20435c6e..e2ed37134e97 100644
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,21 @@ in the release notes and/or placed into UPDATING.
All ports committers are allowed to commit to this file.
+20180125:
+AUTHOR: mat@FreeBSD.org
+
+ Add support to passing directories to EXTRA_PATCHES.
+
+ Instead of:
+
+ EXTRA_PATCHES= ${PATCHDIR}/feat-foo-patch-file.c \
+ ${PATCHDIR}/feat-foo-patch-file.h \
+ ${PATCHDIR}/feat-foo-patch-file2.c
+
+ Move those files to ${PATCHDIR}/feat-foo/, name them patch-*, and set:
+
+ EXTRA_PATCHES= ${PATCHDIR}/feat-foo
+
20180116:
AUTHOR: mat@FreeBSD.org
diff --git a/Mk/Scripts/do-patch.sh b/Mk/Scripts/do-patch.sh
index a44208545c3a..10095f56847d 100644
--- a/Mk/Scripts/do-patch.sh
+++ b/Mk/Scripts/do-patch.sh
@@ -107,9 +107,14 @@ fi
if [ -n "${dp_EXTRA_PATCHES}" ]; then
for i in ${dp_EXTRA_PATCHES}; do
- apply_one_patch "${i}" \
- "Applying extra patch" \
- ${dp_PATCH_ARGS}
+ if [ -d "${i}" ]; then
+ patch_from_directory "${i}" \
+ "extra patch"
+ else
+ apply_one_patch "${i}" \
+ "Applying extra patch" \
+ ${dp_PATCH_ARGS}
+ fi
done
fi
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index b5b955e9979c..0ce7ed61b9a6 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -749,7 +749,9 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# ${WRKDIR}, then point EXTRA_PATCHES to them.
# The patches specified by this variable will be
# applied after the normal distribution patches but
-# before those in ${PATCHDIR}.
+# before those in ${PATCHDIR}. This can also contain
+# directories, all the files named patch-* in those directories
+# will be applied.
# EXTRA_PATCH_TREE - where to find extra 'out-of-tree' patches
# Points to a directory hierarchy with the same layout
# as the ports tree, where local patches can be found.