From 449ae140f505862e5d612baae23361eb4a4c2ff1 Mon Sep 17 00:00:00 2001 From: Alexei Colin Date: Wed, 23 Dec 2020 01:18:44 -0500 Subject: [PATCH] bootstrap-prefix: bump tar to 1.32, apply ioctl patch On macOS 11 Big Sur, stage 1 needs to bootstrap tar but fails to build it (both 1.26 and 1.32) because sys/ioctl.h does not end up included: compare.c:550:3: error: implicit declaration of function 'ioctl' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ioctl (archive, FDFLUSH); Upstream bug report: https://savannah.gnu.org/bugs/index.php?59755 Signed-off-by: Alexei Colin --- scripts/bootstrap-prefix.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index c085472a23..3f96bc5e33 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -862,6 +862,22 @@ bootstrap_gnu() { [[ -d ${S} ]] || return 1 cd "${S}" || return 1 + # Tar upstream bug #59755 for broken build on macOS: + # https://savannah.gnu.org/bugs/index.php?59755 + if [[ ${PN}-${PV} == "tar-1.32" ]] ; then + local tar_patch_file="tar-1.32-check-sys-ioctl-header-configure.patch" + local tar_patch_id="file_id=50554" + local tar_patch_url="https://file.savannah.gnu.org/file/${tar_patch_file}?${tar_patch_id}" + efetch "${tar_patch_url}" || return 1 + # If fetched from upstream url instead of mirror, filename will + # have a suffix. Remove suffix by copy, not move, to not + # trigger refetch on repeated invocations of this script. + if [[ -f "${DISTDIR}/${tar_patch_file}?${tar_patch_id}" ]]; then + cp ${DISTDIR}/${tar_patch_file}{?${tar_patch_id},} || return 1 + fi + patch -p1 < ${DISTDIR}/${tar_patch_file} || return 1 + fi + if [[ ${PN}-${PV} == "bash-4.3" && ${CHOST} == *-cygwin* ]] ; then local p patchopts for p in \ @@ -1309,7 +1325,7 @@ bootstrap_coreutils() { } bootstrap_tar() { - bootstrap_gnu tar 1.26 + bootstrap_gnu tar 1.32 } bootstrap_make() { -- 2.29.2