aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Shelton <stuart@shelton.me>2017-10-02 07:06:50 +0100
committerStuart Shelton <stuart@shelton.me>2017-10-03 23:04:20 +0100
commitb55e0c2371cab2af0b9258a847cdca78937567e4 (patch)
treef4fd63f1cb70a0c078e91875f11849a5cc20c6fe /local/etc/portage
parentAdd sys-libs/db-5.3.28-r3, sys-libs/db-6.0.35-r1, update sys-libs/db-5.1.29-r... (diff)
downloadsrcshelton-b55e0c2371cab2af0b9258a847cdca78937567e4.tar.gz
srcshelton-b55e0c2371cab2af0b9258a847cdca78937567e4.tar.bz2
srcshelton-b55e0c2371cab2af0b9258a847cdca78937567e4.zip
Add dev-util/pkgconfig-0.29.1, dev-vcs/cvs-1.12.13.1-r2, update README.md with details of macOS 10.13 printf() fixes
Diffstat (limited to 'local/etc/portage')
-rw-r--r--local/etc/portage/bashrc73
-rw-r--r--local/etc/portage/patches/All/vasnprintf.patch15
2 files changed, 88 insertions, 0 deletions
diff --git a/local/etc/portage/bashrc b/local/etc/portage/bashrc
new file mode 100644
index 00000000..1005abba
--- /dev/null
+++ b/local/etc/portage/bashrc
@@ -0,0 +1,73 @@
+
+# portage overrides
+
+universal_epatch_user() {
+ # See https://wiki.gentoo.org/wiki//etc/portage/patches - ensure that
+ # epatch_user is run for all ebuilds, regardless of whether they import
+ # eutils or not...
+
+ [[ ${EAPI:-0} == [012345] ]] || return
+ if ! type estack_push > /dev/null 2>&1; then
+ local estack_names="eshopts_push eshopts_pop evar_push evar_push_set evar_pop estack_push estack_pop"
+ source <(awk "/^# @(FUNCTION|VARIABLE): / { p = 0 } /^# @(FUNCTION|VARIABLE): (${estack_names// /|})\$/ { p = 1 } p { print }" ${PORTDIR}/eclass/estack.eclass)
+ fi
+ if ! type epatch_user > /dev/null 2>&1; then
+ local epatch_names="EPATCH_SOURCE EPATCH_USER_SOURCE epatch_user_death_notice epatch_user epatch"
+ source <(awk "/^# @(FUNCTION|VARIABLE): / { p = 0 } /^# @(FUNCTION|VARIABLE): (${epatch_names// /|})\$/ { p = 1 } p { print }" ${PORTDIR}/eclass/epatch.eclass)
+ fi
+
+ epatch_user
+
+ for name in $epatch_names; do
+ unset $name
+ done
+ for name in $estack_names; do
+ unset $name
+ done
+} # universal_epatch_user
+
+darwin_epatch_vasnprintf() {
+ if [[ ! "${CHOST}" =~ ^x86_64-apple-darwin ]] || [[ "${CHOST}" < 'x86_64-apple-darwin17' ]]; then
+ return
+ fi
+
+ # Try to fix the intentional runtime failure of *printf functions when
+ # the '%n' format is used...
+ if [[ "${PWD}" =~ /(dev-util/pkgconfig|dev-vcs/cvs)- ]]; then
+ einfo "Skipping vasnprintf() patching for specifically patched package ${CATEGORY}/${PN}"
+
+ elif type -pf patch >/dev/null 2>&1 && [[ -r "${EPREFIX:-}"/etc/portage/patches/all/vasnprintf.patch ]]; then
+ ebegin "Checking source for 'vasnprintf()' source"
+
+ local d f
+ while read -r d; do
+ if [[ -e "${d}"/vasnprintf.c ]]; then
+ eend 1 "vasnprintf source found"
+ ewarn "Found vasnprintf.c in directory '$( readlink -e "${d}" 2>/dev/null || echo "${d}" )'"
+ if pushd "${d}" >/dev/null 2>&1; then
+ if patch -stNp2 --dry-run -i "${EPREFIX:-}"/etc/portage/patches/all/vasnprintf.patch; then
+ ebegin "Applying 'vasnprintf()' patch for macOS High Sierra"
+ patch -stNp2 --backup-if-mismatch -i "${EPREFIX:-}"/etc/portage/patches/all/vasnprintf.patch
+ eend ${?} "'vasnprintf()' patch failed to apply in directory '$( pwd )'" # &&
+ #echo "${CATEGORY}/${PVR} patched" >> "${EPREFIX:-}"/etc/portage/patches/vasnprintf.log
+ else
+ eerror "'vasnprintf()' patch for macOS High Sierra at '${EPREFIX:-}/etc/portage/patches/all/vasnprintf.patch' is not compatible with code in directory '$( pwd )'"
+ #echo "${CATEGORY}/${PVR} incompatible" >> "${EPREFIX:-}"/etc/portage/patches/vasnprintf.log
+ fi
+ popd >/dev/null 2>&1 || die "Could not store original directory"
+ else
+ eerror "Cannot chdir() to '${d}': ${?}"
+ fi
+ else
+ eend 0 "No instance of 'vasnprintf.c' found"
+ fi
+ done < <( find . -type d -name lib -print )
+ else
+ eerror "Cannot find pre-requisites required to patch 'vasnprintf()' source for macOS High Sierra"
+ fi
+} # darwin_epatch_vasnprintf
+
+pre_src_prepare() {
+ #universal_epatch_user
+ darwin_epatch_vasnprintf
+}
diff --git a/local/etc/portage/patches/All/vasnprintf.patch b/local/etc/portage/patches/All/vasnprintf.patch
new file mode 100644
index 00000000..8347c1a4
--- /dev/null
+++ b/local/etc/portage/patches/All/vasnprintf.patch
@@ -0,0 +1,15 @@
+# With format string strictness, High Sierra also enforces that %n isn't used
+# in dynamic format strings, but we should just disable its use on darwin in
+# general.
+
+--- a/lib/vasnprintf.c
++++ b/lib/vasnprintf.c
+@@ -4858,7 +4858,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
+ #endif
+ *fbp = dp->conversion;
+ #if USE_SNPRINTF
+-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
++# if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+ fbp[1] = '%';
+ fbp[2] = 'n';
+ fbp[3] = '\0';