app-misc/gcal: Add build fix for glibc-2.28, bug 669334
authorAndreas K. Hüttel <dilfridge@gentoo.org>
Sat, 27 Oct 2018 20:05:06 +0000 (22:05 +0200)
committerAndreas K. Hüttel <dilfridge@gentoo.org>
Sat, 27 Oct 2018 20:05:32 +0000 (22:05 +0200)
Closes: https://bugs.gentoo.org/669334
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

app-misc/gcal/files/gcal-4.1-glibc228.patch [new file with mode: 0644]
app-misc/gcal/gcal-4.1.ebuild

diff --git a/app-misc/gcal/files/gcal-4.1-glibc228.patch b/app-misc/gcal/files/gcal-4.1-glibc228.patch
new file mode 100644 (file)
index 0000000..6e9b7c2
--- /dev/null
@@ -0,0 +1,74 @@
+diff -ruN gcal-4.1.orig/lib/fseeko.c gcal-4.1/lib/fseeko.c
+--- gcal-4.1.orig/lib/fseeko.c 2017-01-22 18:09:38.000000000 +0100
++++ gcal-4.1/lib/fseeko.c      2018-10-27 21:56:46.232442299 +0200
+@@ -1,9 +1,9 @@
+ /* An fseeko() function that, together with fflush(), is POSIX compliant.
+-   Copyright (C) 2007-2017 Free Software Foundation, Inc.
++   Copyright (C) 2007-2018 Free Software Foundation, Inc.
+ 
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 3, or (at your option)
++   the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that it will be useful,
+@@ -12,7 +12,7 @@
+    GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public License along
+-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
++   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+ 
+ #include <config.h>
+ 
+@@ -33,9 +33,9 @@
+ #endif
+ #if _GL_WINDOWS_64_BIT_OFF_T
+ # undef fseeko
+-# if HAVE__FSEEKI64 /* msvc, mingw64 */
++# if HAVE__FSEEKI64 && HAVE_DECL__FSEEKI64 /* msvc, mingw since msvcrt8.0, mingw64 */
+ #  define fseeko _fseeki64
+-# else /* mingw */
++# else /* mingw before msvcrt8.0 */
+ #  define fseeko fseeko64
+ # endif
+ #endif
+@@ -47,7 +47,8 @@
+ #endif
+ 
+   /* These tests are based on fpurge.c.  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
++  /* GNU libc, BeOS, Haiku, Linux libc5 */
+   if (fp->_IO_read_end == fp->_IO_read_ptr
+       && fp->_IO_write_ptr == fp->_IO_write_base
+       && fp->_IO_save_base == NULL)
+@@ -80,7 +81,7 @@
+ #elif defined __minix               /* Minix */
+   if (fp_->_ptr == fp_->_buf
+       && (fp_->_ptr == NULL || fp_->_count == 0))
+-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */
++#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */
+   if (fp_->_ptr == fp_->_base
+       && (fp_->_ptr == NULL || fp_->_cnt == 0))
+ #elif defined __UCLIBC__            /* uClibc */
+@@ -123,7 +124,8 @@
+           return -1;
+         }
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
++      /* GNU libc, BeOS, Haiku, Linux libc5 */
+       fp->_flags &= ~_IO_EOF_SEEN;
+       fp->_offset = pos;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+@@ -150,7 +152,7 @@
+       fp_->_flags &= ~__SEOF;
+ #elif defined __EMX__               /* emx+gcc */
+       fp->_flags &= ~_IOEOF;
+-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */
++#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */
+       fp_->_flag &= ~_IOEOF;
+ #elif defined __MINT__              /* Atari FreeMiNT */
+       fp->__offset = pos;
index 7f56acee8cae66ae670a38b19b1e7a230e2890b2..cd7e657da4f9f909b51369472aa4b809f8908476 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -24,6 +24,8 @@ RDEPEND="nls? ( virtual/libintl )
 
 DOCS=( BUGS LIMITATIONS NEWS README THANKS TODO )
 
+PATCHES=( "${FILESDIR}/${P}-glibc228.patch" )
+
 src_configure() {
        tc-export CC
        append-cppflags -D_GNU_SOURCE