Framework: partially sync with upstream

Taken from: HardenedBSD
This commit is contained in:
Franco Fichtner 2020-05-15 03:51:50 +02:00
parent c0aba4e90a
commit 9819bc73de
7 changed files with 58 additions and 37 deletions

10
CHANGES
View File

@ -10,6 +10,16 @@ in the release notes and/or placed into UPDATING.
All ports committers are allowed to commit to this file.
20200514:
AUTHOR: mat@FreeBSD.org
Add PATCH_CONTINUE_ON_FAIL to allow patching to go through all the patches
even if one fail.
This helps when upgrading ports with a large number of patches, like
www/chromium where having to fix one patch, re-do the patching, fix the
fallout, 800 times, is really painful.
20200414:
AUTHOR: bapt@FreeBSD.org

View File

@ -55,7 +55,7 @@ pre-deinstall: <<EOD
esac
if cmp -s "${target_file}" "${sample_file}"; then
rm -f "${target_file}"
else
elif [ -e "${target_file}" ] ; then
echo "You may need to manually remove ${target_file} if it is no longer needed."
fi
EOD

View File

@ -39,10 +39,22 @@ cat_file() {
esac
}
# If we want to continue when one patch fails, set the flag, otherwise, abort.
if [ -n "${dp_PATCH_CONTINUE_ON_FAIL}" ]; then
failure_fatal() {
has_failed=1
}
else
failure_fatal() {
false
}
fi
apply_one_patch() {
local file="$1"
local msg="$2"
shift 2
local verbose="$3"
shift 3
local patch_strip=""
case ${file} in
@ -52,13 +64,13 @@ apply_one_patch() {
;;
esac
if [ -n "${msg}" ]; then
if [ -n "${verbose}" -o -n "${dp_PATCH_DEBUG_TMP}" ]; then
${dp_ECHO_MSG} "===> Applying ${msg} ${file}${patch_strip:+ with ${patch_strip}}"
fi
if ! cat_file "$file" | do_patch "$@" ${patch_strip}; then
${dp_ECHO_MSG} "===> FAILED Applying ${msg} ${file}${patch_strip:+ with ${patch_strip}}"
has_failed=1
false
fi
}
@ -77,7 +89,7 @@ patch_from_directory() {
if [ "$(echo patch-*)" != "patch-*" ]; then
${dp_ECHO_MSG} "===> Applying ${msg} patches for ${dp_PKGNAME}"
${dp_ECHO_MSG} "===> Applying ${msg} patches for ${dp_PKGNAME} from ${dir}"
for i in patch-*; do
@ -86,25 +98,26 @@ patch_from_directory() {
${dp_ECHO_MSG} "====> IGNORING patchfile ${i}"
;;
*)
if [ -n "${dp_PATCH_DEBUG_TMP}" ]; then
${dp_ECHO_MSG} "====> Applying ${msg} patch ${i}"
fi
if cat_file "$i" | do_patch ${dp_PATCH_ARGS}; then
if apply_one_patch "${i}" "${msg}" "" ${dp_PATCH_ARGS}; then
patches_applied="${patches_applied} ${i}"
else
${dp_ECHO_MSG} "====> FAILED Applying ${msg} patch ${i}"
patches_failed="${patches_failed} ${i}"
if ! failure_fatal; then
break
fi
fi
;;
esac
done
if [ -n "${patches_applied}" -a "${dp_PATCH_SILENT}" != "yes" ]; then
${dp_ECHO_MSG} "===> Cleanly applied ${msg} patch(es) ${patches_applied}"
fi
if [ -n "${patches_failed}" -a "${dp_PATCH_SILENT}" != "yes" ]; then
if [ -n "${patches_applied}" ]; then
${dp_ECHO_MSG} "===> Cleanly applied ${msg} patch(es) ${patches_applied}"
fi
${dp_ECHO_MSG} "===> FAILED to apply cleanly ${msg} patch(es) ${patches_failed}"
has_failed=1
# If we want to stop after the first failure, this returns false,
# let its return value bubble up here and stop everything.
failure_fatal
fi
fi
fi
@ -114,9 +127,12 @@ 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:+ distribution patch}" \
${dp_PATCH_DIST_ARGS}
if ! apply_one_patch "${i}" \
"distribution patch" \
"" \
${dp_PATCH_DIST_ARGS}; then
failure_fatal
fi
done
fi
@ -126,9 +142,12 @@ if [ -n "${dp_EXTRA_PATCHES}" ]; then
patch_from_directory "${i}" \
"extra patch"
else
apply_one_patch "${i}" \
if ! apply_one_patch "${i}" \
"extra patch" \
${dp_PATCH_ARGS}
"verbose" \
${dp_PATCH_ARGS}; then
failure_fatal
fi
fi
done
fi
@ -140,8 +159,10 @@ if [ -n "${dp_EXTRA_PATCH_TREE}" ]; then
fi
if [ -n "$has_failed" ]; then
${dp_ECHO_MSG} "==> SOME PATCHES FAILED TO APPLY CLEANLY."
${dp_ECHO_MSG} "==> Look for FAILED messages above."
if [ -n "${dp_PATCH_DEBUG_TMP}" ]; then
${dp_ECHO_MSG} "==> Some patches failed to apply cleanly."
${dp_ECHO_MSG} "==> Look for FAILED messages above."
fi
false
fi

View File

@ -45,7 +45,7 @@ DISTFILES+= ${CARGO_DIST_SUBDIR}/${_crate}.tar.gz:cargo_${_crate:C/[^a-zA-Z0-9_]
CARGO_BUILDDEP?= yes
.if ${CARGO_BUILDDEP:tl} == "yes"
BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.40.0:lang/${RUST_DEFAULT}
BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.43.0:lang/${RUST_DEFAULT}
.endif
# Location of cargo binary (default to lang/rust's Cargo binary)

View File

@ -55,8 +55,8 @@ GHOSTSCRIPT_DEFAULT?= agpl
JAVA_DEFAULT?= 8
# Possible values: 0.6, 0.7, 1.0, 1.1
JULIA_DEFAULT?= 1.0
# Possible values: 2.0.6
LAZARUS_DEFAULT?= 2.0.6
# Possible values: 2.0.8
LAZARUS_DEFAULT?= 2.0.8
# Possible values: c7
LINUX_DEFAULT?= c7
# Possible values: 60, 70, 80, 90, -devel (to be used when non-base compiler is required)

View File

@ -184,8 +184,7 @@ BUILD_DEPENDS+= ${-${dep}_BUILD_DEPENDS}
MOZ_OPTIONS+= \
--enable-update-channel=${PKGNAMESUFFIX:Urelease:S/^-//} \
--disable-updater \
--with-system-zlib \
--with-system-bz2
--with-system-zlib
# API keys from www/chromium
# http://www.chromium.org/developers/how-tos/api-keys
@ -214,9 +213,7 @@ RUN_DEPENDS+= libcanberra>0:audio/libcanberra
.if ${PORT_OPTIONS:MDBUS}
BUILD_DEPENDS+= libnotify>0:devel/libnotify
LIB_DEPENDS+= libdbus-1.so:devel/dbus \
libdbus-glib-1.so:devel/dbus-glib \
libstartup-notification-1.so:x11/startup-notification
MOZ_OPTIONS+= --enable-startup-notification
libdbus-glib-1.so:devel/dbus-glib
.else
MOZ_OPTIONS+= --disable-dbus
.endif
@ -226,14 +223,6 @@ MOZ_OPTIONS+= --disable-dbus
RUN_DEPENDS+= ffmpeg>=0.8,1:multimedia/ffmpeg
.endif
.if ${PORT_OPTIONS:MGCONF}
# XXX USE_GNOME+=gconf2:build is not supported
BUILD_DEPENDS+= ${LOCALBASE}/lib/libgconf-2.so:devel/gconf2
MOZ_OPTIONS+= --enable-gconf
.else
MOZ_OPTIONS+= --disable-gconf
.endif
.if ${PORT_OPTIONS:MLIBPROXY}
LIB_DEPENDS+= libproxy.so:net/libproxy
MOZ_OPTIONS+= --enable-libproxy

View File

@ -3262,6 +3262,7 @@ do-patch:
dp_PATCH_ARGS=${PATCH_ARGS:Q} \
dp_PATCH_DEBUG_TMP="${PATCH_DEBUG_TMP}" \
dp_PATCH_DIST_ARGS="${PATCH_DIST_ARGS}" \
dp_PATCH_CONTINUE_ON_FAIL=${PATCH_CONTINUE_ON_FAIL:Dyes} \
dp_PATCH_SILENT="${PATCH_SILENT}" \
dp_PATCH_WRKSRC=${PATCH_WRKSRC} \
dp_PKGNAME="${PKGNAME}" \