aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2017-01-17 00:47:00 +0800
committermat <mat@FreeBSD.org>2017-01-17 00:47:00 +0800
commita910cc17afab15cfc4090a2681968937a99ddcfa (patch)
tree3b8ea3a783597953a4328bd04ea5a6b9b48b5db6
parent9bf7d5a787467dacc8f0c2c2fd1cc2be3fa69e06 (diff)
downloadfreebsd-ports-gnome-a910cc17afab15cfc4090a2681968937a99ddcfa.tar.gz
freebsd-ports-gnome-a910cc17afab15cfc4090a2681968937a99ddcfa.tar.zst
freebsd-ports-gnome-a910cc17afab15cfc4090a2681968937a99ddcfa.zip
Extract do-patch into a separate script.
PR: 215761 Submitted by: mat Exp-run by: antoine Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D9029
-rw-r--r--CHANGES14
-rw-r--r--Mk/Scripts/do-patch.sh117
-rw-r--r--Mk/bsd.port.mk106
-rw-r--r--chinese/mutt/Makefile2
-rw-r--r--devel/gdb/Makefile2
-rw-r--r--games/cake/Makefile2
-rw-r--r--graphics/xv/Makefile2
-rw-r--r--japanese/mutt-devel/Makefile5
-rw-r--r--lang/smlnj/Makefile8
-rw-r--r--mail/mutt/Makefile16
-rw-r--r--mail/mutt14/Makefile2
-rw-r--r--russian/napster/Makefile3
-rw-r--r--sysutils/pftop/Makefile2
-rw-r--r--textproc/miller/Makefile4
-rw-r--r--www/publicfile/Makefile10
-rw-r--r--x11/rxvt-unicode/Makefile2
16 files changed, 192 insertions, 105 deletions
diff --git a/CHANGES b/CHANGES
index 523d9e281b9a..a8b1f76cdeba 100644
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,20 @@ in the release notes and/or placed into UPDATING.
All ports committers are allowed to commit to this file.
+20160116:
+AUTHOR: mat@FreeBSD.org
+
+ During extraction of the do-patch target into a separate script, the "-d
+ PATCH_WRKSRC" had to be removed from the PATCH_ARGS and PATCH_DIST_ARGS
+ variables. If using these variables directly, you will need to adapt the
+ Makefile. For example:
+
+ ${PATCH} ${PATCH_ARGS} < ${FILESDIR}/extra-patch
+
+ needs to be changed to:
+
+ ${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${FILESDIR}/extra-patch
+
20161218:
AUTHOR: tcberner@FreeBSD.org
diff --git a/Mk/Scripts/do-patch.sh b/Mk/Scripts/do-patch.sh
new file mode 100644
index 000000000000..25f7dfcbdadb
--- /dev/null
+++ b/Mk/Scripts/do-patch.sh
@@ -0,0 +1,117 @@
+#!/bin/sh
+# $FreeBSD$
+#
+# MAINTAINER: portmgr@FreeBSD.org
+
+set -e
+
+. "${dp_SCRIPTSDIR}/functions.sh"
+
+validate_env dp_BZCAT dp_CAT dp_DISTDIR dp_ECHO_MSG dp_EXTRA_PATCHES \
+ dp_EXTRA_PATCH_TREE dp_GZCAT dp_OPSYS dp_PATCH dp_PATCHDIR \
+ dp_PATCHFILES dp_PATCH_ARGS dp_PATCH_DEBUG_TMP dp_PATCH_DIST_ARGS \
+ dp_PATCH_SILENT dp_PATCH_WRKSRC dp_PKGNAME dp_PKGORIGIN \
+ dp_UNZIP_NATIVE_CMD dp_XZCAT
+
+[ -n "${DEBUG_MK_SCRIPTS}" -o -n "${DEBUG_MK_SCRIPTS_DO_PATCH}" ] && set -x
+
+set -u
+
+apply_one_patch() {
+ local file="$1"
+ local msg="$2"
+ shift 2
+ local patch_strip=""
+
+ case ${file} in
+ *:-p[0-9])
+ patch_strip=${file##*:}
+ file=${file%:-p[0-9]}
+ ;;
+ esac
+
+ if [ -n "${msg}" ]; then
+ ${dp_ECHO_MSG} "===> ${msg} ${file}${patch_strip:+ with ${patch_strip}}"
+ fi
+
+ case "${file}" in
+ *.Z|*.gz)
+ ${dp_GZCAT} "${file}"
+ ;;
+ *.bz2)
+ ${dp_BZCAT} "${file}"
+ ;;
+ *.xz)
+ ${dp_XZCAT} "${file}"
+ ;;
+ *.zip)
+ ${dp_UNZIP_NATIVE_CMD} -p "${file}"
+ ;;
+ *)
+ ${dp_CAT} "${file}"
+ ;;
+ esac | do_patch "$@" ${patch_strip}
+}
+
+do_patch() {
+ "${dp_PATCH}" -d "${dp_PATCH_WRKSRC}" "$@"
+}
+
+patch_from_directory() {
+ local dir="$1"
+ local msg="$2"
+
+ if [ -d "${dir}" ]; then
+ cd "${dir}"
+
+ if [ "$(echo patch-*)" != "patch-*" ]; then
+
+ ${dp_ECHO_MSG} "===> Applying ${msg} patches for ${dp_PKGNAME}"
+
+ PATCHES_APPLIED=""
+
+ for i in patch-*; do
+ case ${i} in
+ *.orig|*.rej|*~|*,v)
+ ${dp_ECHO_MSG} "===> Ignoring patchfile ${i}"
+ ;;
+ *)
+ if [ -n "${dp_PATCH_DEBUG_TMP}" ]; then
+ ${dp_ECHO_MSG} "===> Applying ${msg} patch ${i}"
+ fi
+ if do_patch ${dp_PATCH_ARGS} < ${i}; then
+ PATCHES_APPLIED="${PATCHES_APPLIED} ${i}"
+ else
+ ${dp_ECHO_MSG} "=> ${msg} patch ${i} failed to apply cleanly."
+ if [ -n "${PATCHES_APPLIED}" -a "${dp_PATCH_SILENT}" != "yes" ]; then
+ ${dp_ECHO_MSG} "=> Patch(es) ${PATCHES_APPLIED} applied cleanly."
+ fi
+ false
+ fi
+ ;;
+ esac
+ done
+ fi
+ fi
+}
+
+if [ -n "${dp_PATCHFILES}" ]; then
+ ${dp_ECHO_MSG} "===> Applying distribution patches for ${dp_PKGNAME}"
+ cd "${dp_DISTDIR}"
+ for i in ${dp_PATCHFILES}; do
+ apply_one_patch "${i}" \
+ "${dp_PATCH_DEBUG_TMP:+ Applying distribution patch}" \
+ ${dp_PATCH_DIST_ARGS}
+ done
+fi
+
+if [ -n "${dp_EXTRA_PATCHES}" ]; then
+ for i in ${dp_EXTRA_PATCHES}; do
+ apply_one_patch "${i}" \
+ "Applying extra patch" \
+ ${dp_PATCH_ARGS}
+ done
+fi
+
+patch_from_directory "${dp_PATCHDIR}" "${dp_OPSYS}"
+
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index f67c12b5d037..8fc714d83aa1 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1993,12 +1993,11 @@ PATCH_STRIP?= -p0
PATCH_DIST_STRIP?= -p0
.if defined(PATCH_DEBUG)
PATCH_DEBUG_TMP= yes
-PATCH_ARGS?= -d ${PATCH_WRKSRC} -E ${PATCH_STRIP}
-PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} -E ${PATCH_DIST_STRIP}
+PATCH_ARGS?= -E ${PATCH_STRIP}
+PATCH_DIST_ARGS?= --suffix ${DISTORIG} -E ${PATCH_DIST_STRIP}
.else
-PATCH_DEBUG_TMP= no
-PATCH_ARGS?= -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_STRIP}
-PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
+PATCH_ARGS?= --forward --quiet -E ${PATCH_STRIP}
+PATCH_DIST_ARGS?= --suffix ${DISTORIG} --forward --quiet -E ${PATCH_DIST_STRIP}
.endif
.if !defined(QUIET)
PATCH_SILENT= PATCH_SILENT=yes
@@ -2010,6 +2009,7 @@ PATCH_DIST_ARGS+= --batch
# Prevent breakage with VERSION_CONTROL=numbered
PATCH_ARGS+= -V simple
+PATCH_DIST_ARGS+= -V simple
.if defined(PATCH_CHECK_ONLY)
PATCH_ARGS+= -C
@@ -2372,8 +2372,10 @@ _PATCH_SITES_ALL+= ${_PATCH_SITES_${_group}}
. endfor
. endif
_PATCHFILES:= ${_PATCHFILES} ${_P_file}
-. if !empty(_P_strip)
-_PATCH_DIST_STRIP_CASES:= ${_PATCH_DIST_STRIP_CASES} ("${_P_file}") printf %s "${_P_strip}" ;;
+. if empty(_P_strip)
+_PATCHFILES2:= ${_PATCHFILES2} ${_P_file}
+. else
+_PATCHFILES2:= ${_PATCHFILES2} ${_P_file}:${_P_strip}
. endif
.endfor
_P_groups=
@@ -3076,73 +3078,29 @@ do-extract:
.if !target(do-patch)
do-patch:
-.if defined(PATCHFILES)
- @${ECHO_MSG} "===> Applying distribution patches for ${PKGNAME}"
- @(set -e; \
- cd ${_DISTDIR}; \
- patch_dist_strip () { \
- case "$$1" in \
- ${_PATCH_DIST_STRIP_CASES} \
- esac; \
- }; \
- for i in ${_PATCHFILES}; do \
- if [ ${PATCH_DEBUG_TMP} = yes ]; then \
- ${ECHO_MSG} "===> Applying distribution patch $$i" ; \
- fi ; \
- case $$i in \
- *.Z|*.gz) ${GZCAT} $$i ;; \
- *.bz2) ${BZCAT} $$i ;; \
- *.xz) ${XZCAT} $$i ;; \
- *.zip) ${UNZIP_NATIVE_CMD} -p $$i ;; \
- *) ${CAT} $$i ;; \
- esac | ${PATCH} ${PATCH_DIST_ARGS} `patch_dist_strip $$i` ; \
- done )
-.endif
-.if defined(EXTRA_PATCHES)
- @set -e ; \
- for i in ${EXTRA_PATCHES}; do \
- case $$i in \
- *:-p[0-9]) patch_file=$${i%:*} ; patch_strip=$${i##*:} ;; \
- *) patch_file=$$i ;; \
- esac ; \
- ${ECHO_MSG} "===> Applying extra patch $$patch_file" ; \
- case $$patch_file in \
- *.Z|*.gz) ${GZCAT} $$patch_file ;; \
- *.bz2) ${BZCAT} $$patch_file ;; \
- *.xz) ${XZCAT} $$patch_file ;; \
- *.zip) ${UNZIP_NATIVE_CMD} -p $$patch_file ;; \
- *) ${CAT} $$patch_file ;; \
- esac | ${PATCH} ${PATCH_ARGS} $$patch_strip ; \
- done
-.endif
- @set -e ;\
- if [ -d ${PATCHDIR} ]; then \
- if [ "`${ECHO_CMD} ${PATCHDIR}/patch-*`" != "${PATCHDIR}/patch-*" ]; then \
- ${ECHO_MSG} "===> Applying ${OPSYS} patches for ${PKGNAME}" ; \
- PATCHES_APPLIED="" ; \
- for i in ${PATCHDIR}/patch-*; do \
- case $$i in \
- *.orig|*.rej|*~|*,v) \
- ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \
- ;; \
- *) \
- if [ ${PATCH_DEBUG_TMP} = yes ]; then \
- ${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ; \
- fi; \
- if ${PATCH} ${PATCH_ARGS} < $$i ; then \
- PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \
- else \
- ${ECHO_MSG} `${ECHO_CMD} "=> Patch $$i failed to apply cleanly." | ${SED} "s|${PATCHDIR}/||"` ; \
- if [ x"$$PATCHES_APPLIED" != x"" -a ${PATCH_SILENT} != "yes" ]; then \
- ${ECHO_MSG} `${ECHO_CMD} "=> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${PATCHDIR}/||g"` ; \
- fi; \
- ${FALSE} ; \
- fi; \
- ;; \
- esac; \
- done; \
- fi; \
- fi
+ @${SETENV} \
+ dp_BZCAT="${BZCAT}" \
+ dp_CAT="${CAT}" \
+ dp_DISTDIR="${_DISTDIR}" \
+ dp_ECHO_MSG="${ECHO_MSG}" \
+ dp_EXTRA_PATCHES="${EXTRA_PATCHES}" \
+ dp_EXTRA_PATCH_TREE="${EXTRA_PATCH_TREE}" \
+ dp_GZCAT="${GZCAT}" \
+ dp_OPSYS="${OPSYS}" \
+ dp_PATCH="${PATCH}" \
+ dp_PATCHDIR="${PATCHDIR}" \
+ dp_PATCHFILES="${_PATCHFILES2}" \
+ dp_PATCH_ARGS=${PATCH_ARGS:Q} \
+ dp_PATCH_DEBUG_TMP="${PATCH_DEBUG_TMP}" \
+ dp_PATCH_DIST_ARGS="${PATCH_DIST_ARGS}" \
+ dp_PATCH_SILENT="${PATCH_SILENT}" \
+ dp_PATCH_WRKSRC=${PATCH_WRKSRC} \
+ dp_PKGNAME="${PKGNAME}" \
+ dp_PKGORIGIN="${PKGORIGIN}" \
+ dp_SCRIPTSDIR="${SCRIPTSDIR}" \
+ dp_UNZIP_NATIVE_CMD="${UNZIP_NATIVE_CMD}" \
+ dp_XZCAT="${XZCAT}" \
+ ${SH} ${SCRIPTSDIR}/do-patch.sh
.endif
.if !target(run-autotools-fixup)
diff --git a/chinese/mutt/Makefile b/chinese/mutt/Makefile
index 29ecac57245c..c3261e31b4aa 100644
--- a/chinese/mutt/Makefile
+++ b/chinese/mutt/Makefile
@@ -36,7 +36,7 @@ post-patch::
@${REINPLACE_CMD} -e '/^mutt_SOURCES/s/\\$$/ myiconv.c \\/' ${WRKSRC}/Makefile.am
@for i in ${.CURDIR}/files/patch-*; do \
${ECHO_MSG} "===> Applying extra patch $$i"; \
- ${PATCH} ${PATCH_ARGS} < $$i; \
+ ${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < $$i; \
done
@${REINPLACE_CMD} -e 's|裏|裡|' ${WRKSRC}/po/zh_TW.po
diff --git a/devel/gdb/Makefile b/devel/gdb/Makefile
index 4b2613ff43be..ec52aa45d35d 100644
--- a/devel/gdb/Makefile
+++ b/devel/gdb/Makefile
@@ -86,7 +86,7 @@ post-patch:
post-patch-KGDB-on:
@${CP} -r ${FILESDIR}/kgdb/*.[ch] ${WRKSRC}/gdb/
- @${PATCH} ${PATCH_ARGS} < ${FILESDIR}/extrapatch-kgdb
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${FILESDIR}/extrapatch-kgdb
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb \
diff --git a/games/cake/Makefile b/games/cake/Makefile
index 5beff7497640..e839ce660574 100644
--- a/games/cake/Makefile
+++ b/games/cake/Makefile
@@ -19,7 +19,7 @@ USE_XORG= x11 xext xmu xt xi sm ice
# Need to pass `-l', but PATCH_ARGS+= won't work because of PATCH_ARGS?=
# in bsd.port.mk
-PATCH_ARGS= -d ${PATCH_WRKSRC} -N -s -E ${PATCH_STRIP} -l
+PATCH_ARGS= -N -s -E ${PATCH_STRIP} -l
ALL_TARGET= main
WRKSRC= ${WRKDIR}/cake_src
diff --git a/graphics/xv/Makefile b/graphics/xv/Makefile
index 43aa592bc13d..afbccf244266 100644
--- a/graphics/xv/Makefile
+++ b/graphics/xv/Makefile
@@ -42,7 +42,7 @@ DESCR= ${FILESDIR}/pkg-descr
.endif
pre-patch:
- ${PATCH} ${PATCH_ARGS} -p1 < ${WRKDIR}/xv-3.10a-jumbo-fix-enh-patch-20070520.txt
+ ${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} -p1 < ${WRKDIR}/xv-3.10a-jumbo-fix-enh-patch-20070520.txt
post-patch:
${REINPLACE_CMD} -e "s@%%LOCALBASE%%@${LOCALBASE}@" \
diff --git a/japanese/mutt-devel/Makefile b/japanese/mutt-devel/Makefile
index b893ce41e4dd..c83993f660fd 100644
--- a/japanese/mutt-devel/Makefile
+++ b/japanese/mutt-devel/Makefile
@@ -82,6 +82,8 @@ CYRUS_SASL2_DESC= SASL2 authentication
IMAP_HEADER_CACHE_DESC= imap header cache
MAILDIR_HEADER_CACHE_DESC= maildir header cache
+DOCS_EXTRA_PATCHES_OFF= ${PATCHDIR}/extra-patch-nodoc-contrib
+
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MNLS}
@@ -129,9 +131,6 @@ post-patch:
@${REINPLACE_CMD} -E ${CONFIGURE_SED} \
${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}.ac
.endif
-.if ! ${PORT_OPTIONS:MDOCS}
- ${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-nodoc-contrib
-.endif
post-configure:
@${REINPLACE_CMD} -E "\
diff --git a/lang/smlnj/Makefile b/lang/smlnj/Makefile
index 9e90a2f5675a..18442c8334f1 100644
--- a/lang/smlnj/Makefile
+++ b/lang/smlnj/Makefile
@@ -191,7 +191,7 @@ MLSOURCEPATCHES_CMD= ${TRUE}
do-build:
cd ${WRKSRC} && unset PWD && \
- FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="${PATCH_ARGS}" \
+ FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="-d ${PATCH_WRKSRC} ${PATCH_ARGS}" \
MLNORUNTIMECLEAN=yes \
MLRUNTIMEPATCHES=`${MLRUNTIMEPATCHES_CMD}` \
MLSTANDARDPATCHES=`${MLSTANDARDPATCHES_CMD}` \
@@ -220,7 +220,7 @@ do-build:
./installml
@${ECHO} '(* Building requested targets: *)'
cd ${WRKSRC} && unset PWD && \
- FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="${PATCH_ARGS}" \
+ FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="-d ${PATCH_WRKSRC} ${PATCH_ARGS}" \
MLNORUNTIMECLEAN=yes RECOMPILEDIR="${RECOMPILEDIR}" \
CFLAGS='${CFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \
./config/install.sh
@@ -320,7 +320,7 @@ do-install:
${MKDIR} "${STAGEDIR}${MLROOT}"
.if ! defined(ML_RECOMPILE)
cd ${WRKSRC} && unset PWD && \
- FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="${PATCH_ARGS}" \
+ FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="-d ${PATCH_WRKSRC} ${PATCH_ARGS}" \
STAGEDIR="${STAGEDIR}" MLLIB="${MLLIB}" \
INSTALLDIR="${STAGEDIR}${MLROOT}" \
CFLAGS='${CFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \
@@ -337,7 +337,7 @@ do-install:
./makeml
@${ECHO} '(* Installing into ${MLROOT}: *)'
cd ${WRKSRC} && unset PWD && \
- FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="${PATCH_ARGS}" \
+ FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="-d ${PATCH_WRKSRC} ${PATCH_ARGS}" \
STAGEDIR="${STAGEDIR}" MLLIB="${MLLIB}" \
INSTALLDIR="${STAGEDIR}${MLROOT}" RECOMPILEDIR="${RECOMPILEDIR}" \
CFLAGS='${CFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \
diff --git a/mail/mutt/Makefile b/mail/mutt/Makefile
index 3a038ff6f137..d68f40ddf801 100644
--- a/mail/mutt/Makefile
+++ b/mail/mutt/Makefile
@@ -247,34 +247,34 @@ CFLAGS+= ${CFLAGS_ADD}
LDFLAGS+= ${LDFLAGS_ADD}
pre-patch-PARENT_CHILD_MATCH_PATCH-on:
- @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-parent-child-match
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-parent-child-match
pre-patch-COMPRESSED_FOLDERS-on:
@${GUNZIP_CMD} -c ${DISTDIR}/${DIST_SUBDIR}/patch-${RR_PATCH_VERSION}.rr.compressed.gz > ${WRKDIR}/patch-compressed
@${REINPLACE_CMD} -E '/^diff.*\/doc\/manual.txt$$/,/^diff/d' \
${WRKDIR}/patch-compressed
- @${PATCH} ${PATCH_ARGS} -p1 < ${WRKDIR}/patch-compressed
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} -p1 < ${WRKDIR}/patch-compressed
pre-patch-NNTP-on:
@${GUNZIP_CMD} -c ${DISTDIR}/${DIST_SUBDIR}/patch-${VVV_PATCH_VERSION}.vvv.nntp.gz > ${WRKDIR}/patch-nntp
@${REINPLACE_CMD} -E '/^diff.*\/doc\/manual.txt$$/,/^diff/d' \
${WRKDIR}/patch-nntp
- @${PATCH} ${PATCH_ARGS} -p1 < ${WRKDIR}/patch-nntp
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} -p1 < ${WRKDIR}/patch-nntp
post-patch-NNTP-on:
.if ${PORT_OPTIONS:MMAILDIR_MTIME_PATCH}
- @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-maildir-mtime-nntp
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-maildir-mtime-nntp
.endif
.if ${PORT_OPTIONS:MFORCEBASE64}
- @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-forcebase64-nntp
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-forcebase64-nntp
.endif
post-patch-NNTP-off:
.if ${PORT_OPTIONS:MMAILDIR_MTIME_PATCH}
- @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-maildir-mtime
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-maildir-mtime
.endif
.if ${PORT_OPTIONS:MFORCEBASE64}
- @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-forcebase64
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-forcebase64
.endif
post-install:
@@ -284,7 +284,7 @@ post-install-NNTP-on:
${INSTALL_DATA} ${WRKSRC}/ChangeLog.nntp ${STAGEDIR}${DOCSDIR}
post-patch-IFDEF_PATCH-on:
- @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-ifdef
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-ifdef
WRKSRC= ${WRKDIR}/${DISTNAME:S/i$//}
diff --git a/mail/mutt14/Makefile b/mail/mutt14/Makefile
index ce45594ce281..72271c7f3fd0 100644
--- a/mail/mutt14/Makefile
+++ b/mail/mutt14/Makefile
@@ -153,7 +153,7 @@ post-patch:
.if ${PORT_OPTIONS:MDOCS}
post-build:
@${TOUCH} ${WRKSRC}/doc/mutt.man ${WRKSRC}/doc/manual.sgml
- @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-doc-ref
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-doc-ref
@${REINPLACE_CMD} -E -e 's|\$$\{PREFIX\}|${PREFIX}|g' \
-e 's|\$$\{DOCSDIR\}|${DOCSDIR}|g' \
-e 's|\$$\{EXAMPLESDIR\}|${EXAMPLESDIR}|g' \
diff --git a/russian/napster/Makefile b/russian/napster/Makefile
index 72946d86a849..568249a068af 100644
--- a/russian/napster/Makefile
+++ b/russian/napster/Makefile
@@ -14,7 +14,6 @@ CONFLICTS= nap-[0-9]*
USES= ncurses
WITH_ENCODING_PATCH= yes
-pre-configure:
- @${PATCH} ${PATCH_ARGS} < ${.CURDIR}/files/extra-win2koi
+EXTRA_PATCHES= ${.CURDIR}/files/extra-win2koi
.include "${MASTERDIR}/Makefile"
diff --git a/sysutils/pftop/Makefile b/sysutils/pftop/Makefile
index db4a802e956b..6b11205811e7 100644
--- a/sysutils/pftop/Makefile
+++ b/sysutils/pftop/Makefile
@@ -39,7 +39,7 @@ post-patch:
.if ${OSVERSION} >= 1100000
@${ECHO_MSG} "===> Applying FairQ/Codel patches to ${PORTNAME}."
@${CAT} ${FILESDIR}/extra-patch-fairq_codel.diff | \
- ${PATCH} ${PATCH_ARGS}
+ ${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS}
.endif
@${REINPLACE_CMD} -e 's|<sys/queue.h>|"${FILESDIR}/queue.h"|g' \
${WRKSRC}/engine.c
diff --git a/textproc/miller/Makefile b/textproc/miller/Makefile
index 17aa7445533b..1412541c0127 100644
--- a/textproc/miller/Makefile
+++ b/textproc/miller/Makefile
@@ -21,7 +21,7 @@ PLIST_FILES= bin/mlr man/man1/mlr.1.gz
BROKEN_aarch64= Fails to compile: undefined reference to .mcount
post-configure:
- ${PATCH} ${PATCH_ARGS} < ${FILESDIR}/extra-patch-c_Makefile
- ${PATCH} ${PATCH_ARGS} < ${FILESDIR}/extra-patch-libtool
+ ${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${FILESDIR}/extra-patch-c_Makefile
+ ${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${FILESDIR}/extra-patch-libtool
.include <bsd.port.mk>
diff --git a/www/publicfile/Makefile b/www/publicfile/Makefile
index 01e74be49b83..b8450de36175 100644
--- a/www/publicfile/Makefile
+++ b/www/publicfile/Makefile
@@ -35,23 +35,23 @@ BROKEN= redirect slash and auth patches are currently in conflict
.if ${PORT_OPTIONS:MREDIRECT_SLASH}
pre-configure::
- @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/redirect-slash-patch
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${PATCHDIR}/redirect-slash-patch
.endif
.if ${PORT_OPTIONS:MENV_FILETYPES}
pre-configure::
- @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/publicfile-0.52-filetype-diff
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${PATCHDIR}/publicfile-0.52-filetype-diff
.endif
.if ${PORT_OPTIONS:MSSL}
pre-configure::
- @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/publicfile.sslserver
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${PATCHDIR}/publicfile.sslserver
RUN_DEPENDS+= sslserver:sysutils/ucspi-ssl
.endif
.if ${PORT_OPTIONS:MBASICAUTH}
pre-configure::
- @${PATCH} ${PATCH_ARGS} -p1 < \
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} -p1 < \
${PATCHDIR}/publicfile-0.52_basicauth.patch
PATCH_DEPENDS+= ${NONEXISTENT}:databases/cdb:extract
PLIST_SUB+= BASICAUTH=""
@@ -61,7 +61,7 @@ PLIST_SUB+= BASICAUTH="@comment "
.if ${PORT_OPTIONS:MCOMMONLOG}
pre-configure::
- @${PATCH} ${PATCH_ARGS} -p1 < \
+ @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} -p1 < \
${PATCHDIR}/publicfile-0.52-commonlog-2.patch
.endif
diff --git a/x11/rxvt-unicode/Makefile b/x11/rxvt-unicode/Makefile
index bd04cb7d59c1..7246bd4b2a08 100644
--- a/x11/rxvt-unicode/Makefile
+++ b/x11/rxvt-unicode/Makefile
@@ -193,7 +193,7 @@ pre-everything::
.if ${PORT_OPTIONS:MIMLOCALE_FIX}
post-patch:
- ${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-imlocale
+ ${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-imlocale
cd ${WRKSRC}/src && ./gentables
.endif