Changeset View
Changeset View
Standalone View
Standalone View
Mk/bsd.port.mk
Show First 20 Lines • Show All 743 Lines • ▼ Show 20 Lines | |||||
# ${PATCHDIR}. This usually happens when you need to | # ${PATCHDIR}. This usually happens when you need to | ||||
# do some pre-processing before some distribution | # do some pre-processing before some distribution | ||||
# patches can be applied. In that case, fetch them as | # patches can be applied. In that case, fetch them as | ||||
# extra distfiles, put the processed results in | # extra distfiles, put the processed results in | ||||
# ${WRKDIR}, then point EXTRA_PATCHES to them. | # ${WRKDIR}, then point EXTRA_PATCHES to them. | ||||
# The patches specified by this variable will be | # The patches specified by this variable will be | ||||
# applied after the normal distribution patches but | # applied after the normal distribution patches but | ||||
# before those in ${PATCHDIR}. | # before those in ${PATCHDIR}. | ||||
# 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. | |||||
# This allows a third party to keep their patches in | |||||
# some other source control system if needed. | |||||
# PATCH_WRKSRC - Directory to apply patches in. | # PATCH_WRKSRC - Directory to apply patches in. | ||||
# Default: ${WRKSRC} | # Default: ${WRKSRC} | ||||
# | # | ||||
# For configure: | # For configure: | ||||
# | # | ||||
# HAS_CONFIGURE - If set, this port has its own configure script. The | # HAS_CONFIGURE - If set, this port has its own configure script. The | ||||
# configure stage will not do anything if this is not set. | # configure stage will not do anything if this is not set. | ||||
# GNU_CONFIGURE - If set, you are using GNU configure (optional). Implies | # GNU_CONFIGURE - If set, you are using GNU configure (optional). Implies | ||||
▲ Show 20 Lines • Show All 1,228 Lines • ▼ Show 20 Lines | |||||
TOUCH_FLAGS?= -f | TOUCH_FLAGS?= -f | ||||
DISTORIG?= .bak.orig | DISTORIG?= .bak.orig | ||||
PATCH?= /usr/bin/patch | PATCH?= /usr/bin/patch | ||||
PATCH_STRIP?= -p0 | PATCH_STRIP?= -p0 | ||||
PATCH_DIST_STRIP?= -p0 | PATCH_DIST_STRIP?= -p0 | ||||
.if defined(PATCH_DEBUG) | .if defined(PATCH_DEBUG) | ||||
PATCH_DEBUG_TMP= yes | PATCH_DEBUG_TMP= yes | ||||
PATCH_ARGS?= -d ${PATCH_WRKSRC} -E ${PATCH_STRIP} | PATCH_ARGS?= -E ${PATCH_STRIP} | ||||
PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} -E ${PATCH_DIST_STRIP} | PATCH_DIST_ARGS?= --suffix ${DISTORIG} -E ${PATCH_DIST_STRIP} | ||||
.else | .else | ||||
PATCH_DEBUG_TMP= no | PATCH_ARGS?= --forward --quiet -E ${PATCH_STRIP} | ||||
PATCH_ARGS?= -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_STRIP} | PATCH_DIST_ARGS?= --suffix ${DISTORIG} --forward --quiet -E ${PATCH_DIST_STRIP} | ||||
PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP} | |||||
.endif | .endif | ||||
.if !defined(QUIET) | .if !defined(QUIET) | ||||
PATCH_SILENT= PATCH_SILENT=yes | PATCH_SILENT= PATCH_SILENT=yes | ||||
.endif | .endif | ||||
.if defined(BATCH) | .if defined(BATCH) | ||||
PATCH_ARGS+= --batch | PATCH_ARGS+= --batch | ||||
PATCH_DIST_ARGS+= --batch | PATCH_DIST_ARGS+= --batch | ||||
.endif | .endif | ||||
# Prevent breakage with VERSION_CONTROL=numbered | # Prevent breakage with VERSION_CONTROL=numbered | ||||
PATCH_ARGS+= -V simple | PATCH_ARGS+= -V simple | ||||
PATCH_DIST_ARGS+= -V simple | |||||
.if defined(PATCH_CHECK_ONLY) | .if defined(PATCH_CHECK_ONLY) | ||||
PATCH_ARGS+= -C | PATCH_ARGS+= -C | ||||
PATCH_DIST_ARGS+= -C | PATCH_DIST_ARGS+= -C | ||||
.endif | .endif | ||||
.if ${PATCH} == "/usr/bin/patch" | .if ${PATCH} == "/usr/bin/patch" | ||||
PATCH_ARGS+= --suffix .orig | PATCH_ARGS+= --suffix .orig | ||||
▲ Show 20 Lines • Show All 346 Lines • ▼ Show 20 Lines | |||||
. if empty(_G_TEMP_TEMP) | . if empty(_G_TEMP_TEMP) | ||||
_G_TEMP+= ${_group} | _G_TEMP+= ${_group} | ||||
_PATCH_SITES_ALL+= ${_PATCH_SITES_${_group}} | _PATCH_SITES_ALL+= ${_PATCH_SITES_${_group}} | ||||
. endif | . endif | ||||
. endif | . endif | ||||
. endfor | . endfor | ||||
. endif | . endif | ||||
_PATCHFILES:= ${_PATCHFILES} ${_P_file} | _PATCHFILES:= ${_PATCHFILES} ${_P_file} | ||||
. if !empty(_P_strip) | . if empty(_P_strip) | ||||
_PATCH_DIST_STRIP_CASES:= ${_PATCH_DIST_STRIP_CASES} ("${_P_file}") printf %s "${_P_strip}" ;; | _PATCHFILES2:= ${_PATCHFILES2} ${_P_file} | ||||
. else | |||||
_PATCHFILES2:= ${_PATCHFILES2} ${_P_file}:${_P_strip} | |||||
. endif | . endif | ||||
.endfor | .endfor | ||||
_P_groups= | _P_groups= | ||||
_P_file= | _P_file= | ||||
_P_strip= | _P_strip= | ||||
_G_TEMP= | _G_TEMP= | ||||
_G_TEMP_TEMP= | _G_TEMP_TEMP= | ||||
ALLFILES?= ${_DISTFILES} ${_PATCHFILES} | ALLFILES?= ${_DISTFILES} ${_PATCHFILES} | ||||
▲ Show 20 Lines • Show All 686 Lines • ▼ Show 20 Lines | @if [ ${UID} = 0 ]; then \ | ||||
${CHOWN} -R 0:0 ${WRKDIR}; \ | ${CHOWN} -R 0:0 ${WRKDIR}; \ | ||||
fi | fi | ||||
.endif | .endif | ||||
# Patch | # Patch | ||||
.if !target(do-patch) | .if !target(do-patch) | ||||
do-patch: | do-patch: | ||||
.if defined(PATCHFILES) | @${SETENV} \ | ||||
@${ECHO_MSG} "===> Applying distribution patches for ${PKGNAME}" | dp_BZCAT="${BZCAT}" \ | ||||
@(set -e; \ | dp_CAT="${CAT}" \ | ||||
cd ${_DISTDIR}; \ | dp_DISTDIR="${_DISTDIR}" \ | ||||
patch_dist_strip () { \ | dp_ECHO_MSG="${ECHO_MSG}" \ | ||||
case "$$1" in \ | dp_EXTRA_PATCHES="${EXTRA_PATCHES}" \ | ||||
${_PATCH_DIST_STRIP_CASES} \ | dp_EXTRA_PATCH_TREE="${EXTRA_PATCH_TREE}" \ | ||||
esac; \ | dp_GZCAT="${GZCAT}" \ | ||||
}; \ | dp_OPSYS="${OPSYS}" \ | ||||
for i in ${_PATCHFILES}; do \ | dp_PATCH="${PATCH}" \ | ||||
if [ ${PATCH_DEBUG_TMP} = yes ]; then \ | dp_PATCHDIR="${PATCHDIR}" \ | ||||
${ECHO_MSG} "===> Applying distribution patch $$i" ; \ | dp_PATCHFILES="${_PATCHFILES2}" \ | ||||
fi ; \ | dp_PATCH_ARGS=${PATCH_ARGS:Q} \ | ||||
case $$i in \ | dp_PATCH_DEBUG_TMP="${PATCH_DEBUG_TMP}" \ | ||||
*.Z|*.gz) ${GZCAT} $$i ;; \ | dp_PATCH_DIST_ARGS="${PATCH_DIST_ARGS}" \ | ||||
*.bz2) ${BZCAT} $$i ;; \ | dp_PATCH_SILENT="${PATCH_SILENT}" \ | ||||
*.xz) ${XZCAT} $$i ;; \ | dp_PATCH_WRKSRC=${PATCH_WRKSRC} \ | ||||
*.zip) ${UNZIP_NATIVE_CMD} -p $$i ;; \ | dp_PKGNAME="${PKGNAME}" \ | ||||
*) ${CAT} $$i ;; \ | dp_PKGORIGIN="${PKGORIGIN}" \ | ||||
esac | ${PATCH} ${PATCH_DIST_ARGS} `patch_dist_strip $$i` ; \ | dp_SCRIPTSDIR="${SCRIPTSDIR}" \ | ||||
done ) | dp_UNZIP_NATIVE_CMD="${UNZIP_NATIVE_CMD}" \ | ||||
.endif | dp_XZCAT="${XZCAT}" \ | ||||
.if defined(EXTRA_PATCHES) | ${SH} ${SCRIPTSDIR}/do-patch.sh | ||||
@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 | |||||
.endif | .endif | ||||
.if !target(run-autotools-fixup) | .if !target(run-autotools-fixup) | ||||
run-autotools-fixup: | run-autotools-fixup: | ||||
# Work around an issue where FreeBSD 10.0 is detected as FreeBSD 1.x. | # Work around an issue where FreeBSD 10.0 is detected as FreeBSD 1.x. | ||||
.if !defined(WITHOUT_FBSD10_FIX) | .if !defined(WITHOUT_FBSD10_FIX) | ||||
-@for f in `${FIND} ${WRKDIR} -type f \( -name config.libpath -o \ | -@for f in `${FIND} ${WRKDIR} -type f \( -name config.libpath -o \ | ||||
-name config.rpath -o -name configure -o -name libtool.m4 -o \ | -name config.rpath -o -name configure -o -name libtool.m4 -o \ | ||||
▲ Show 20 Lines • Show All 2,242 Lines • Show Last 20 Lines |