commit:     6777c2a8d02373238566c8268c3d3acc5904837b
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon May  8 11:28:01 2017 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon May  8 11:29:07 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6777c2a8

sys-apps/diffutils: Added gcc-7 build fix (bug #617538).

Thanks to lekto for providing a patch in GH PR #4553.

Closes: https://github.com/gentoo/gentoo/pull/4553
Package-Manager: Portage-2.3.5, Repoman-2.3.2

 sys-apps/diffutils/diffutils-3.5.ebuild               | 18 ++++++++++++++----
 .../diffutils/files/diffutils-3.5-fix_macros.patch    | 19 +++++++++++++++++++
 2 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/sys-apps/diffutils/diffutils-3.5.ebuild 
b/sys-apps/diffutils/diffutils-3.5.ebuild
index da215965bb0..426af27f7e9 100644
--- a/sys-apps/diffutils/diffutils-3.5.ebuild
+++ b/sys-apps/diffutils/diffutils-3.5.ebuild
@@ -20,17 +20,27 @@ DEPEND="app-arch/xz-utils
 
 DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO )
 
+PATCHES=(
+       "${FILESDIR}/${P}-fix_macros.patch"
+)
+
+src_prepare() {
+       epatch "${PATCHES[@]}"
+}
+
 src_configure() {
        use static && append-ldflags -static
 
        # Disable automagic dependency over libsigsegv; see bug #312351.
        export ac_cv_libsigsegv=no
 
-       econf \
-               --with-packager="Gentoo" \
-               --with-packager-version="${PVR}" \
-               --with-packager-bug-reports="https://bugs.gentoo.org/"; \
+       local myeconfargs=(
+               --with-packager="Gentoo"
+               --with-packager-version="${PVR}"
+               --with-packager-bug-reports="https://bugs.gentoo.org/";
                $(use_enable nls)
+       )
+       econf "${myeconfargs[@]}"
 }
 
 src_test() {

diff --git a/sys-apps/diffutils/files/diffutils-3.5-fix_macros.patch 
b/sys-apps/diffutils/files/diffutils-3.5-fix_macros.patch
new file mode 100644
index 00000000000..ae820fc372c
--- /dev/null
+++ b/sys-apps/diffutils/files/diffutils-3.5-fix_macros.patch
@@ -0,0 +1,19 @@
+http://git.savannah.gnu.org/cgit/gnulib.git/commit/lib/intprops.h?id=175b4e22f99e00996b72f822f5ae54dca8243d19
+
+--- diffutils-3.5/lib/intprops.h
++++ diffutils-3.5/lib/intprops.h
+@@ -230,11 +230,11 @@
+    (e.g., A and B) have the same type as MIN and MAX.  Instead, they assume
+    that the result (e.g., A + B) has that type.  */
+ #if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+-# define _GL_ADD_OVERFLOW(a, b, min, max)
++# define _GL_ADD_OVERFLOW(a, b, min, max) \
+    __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
+-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
++# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \
+    __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
+-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
++# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \
+    __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
+ #else
+ # define _GL_ADD_OVERFLOW(a, b, min, max)                                \

Reply via email to