commit:     a8ca9a0a204936a5a2b0479067d36787660985a4
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  4 04:27:06 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jan  4 04:32:01 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8ca9a0a

app-misc/gcal: fix configure w/ clang 16

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../gcal/files/gcal-4.1-configure-clang16.patch    | 31 ++++++++++++++++++++++
 .../gcal/{gcal-4.1.ebuild => gcal-4.1-r1.ebuild}   | 20 +++++++++++---
 2 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/app-misc/gcal/files/gcal-4.1-configure-clang16.patch 
b/app-misc/gcal/files/gcal-4.1-configure-clang16.patch
new file mode 100644
index 000000000000..077a1f5e5105
--- /dev/null
+++ b/app-misc/gcal/files/gcal-4.1-configure-clang16.patch
@@ -0,0 +1,31 @@
+https://src.fedoraproject.org/rpms/barcode/c/80372a75c7ee2a448913350f19f9e3f7c8495b8c?branch=rawhide
+
+Include <term.h> during the terminal library check for function
+prototypes.  Otherwise this configure check always fails if the
+compiler does not accept implicit function declarations.
+
+Submitted upstream:
+
+  <https://lists.gnu.org/archive/html/bug-gcal/2022-12/msg00000.html>
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -319,7 +319,7 @@ if test "$gcal_cv_use_term" = yes; then
+   AC_MSG_CHECKING(for working terminal libraries)
+   SAVE_LIBS=$LIBS
+   LIBS="$LIBS $TTYLIBS"
+-  AC_TRY_LINK(,
++  AC_TRY_LINK([#include <term.h>],
+     [tgetent(0); tgetflag(0); tgetnum(0); tgetstr(0);],
+     [gcal_ttylibs_ok=yes])
+   if test "$gcal_ttylibs_ok" = yes; then
+@@ -334,7 +334,7 @@ if test "$gcal_cv_use_term" = yes; then
+         [TTYLIBS="-ltermcap"])
+       AC_MSG_CHECKING(for working terminal libraries again)
+       LIBS="$LIBS $TTYLIBS"
+-      AC_TRY_LINK(,
++      AC_TRY_LINK([#include <term.h>],
+         [tgetent(0); tgetflag(0); tgetnum(0); tgetstr(0);],
+         [gcal_ttylibs_ok=yes])
+       if test "$gcal_ttylibs_ok" = yes; then
+

diff --git a/app-misc/gcal/gcal-4.1.ebuild b/app-misc/gcal/gcal-4.1-r1.ebuild
similarity index 72%
rename from app-misc/gcal/gcal-4.1.ebuild
rename to app-misc/gcal/gcal-4.1-r1.ebuild
index ee18f98e3850..39a20a9fc729 100644
--- a/app-misc/gcal/gcal-4.1.ebuild
+++ b/app-misc/gcal/gcal-4.1-r1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-inherit flag-o-matic toolchain-funcs
+inherit autotools flag-o-matic toolchain-funcs
 
 DESCRIPTION="The GNU Calendar - a replacement for cal"
 HOMEPAGE="https://www.gnu.org/software/gcal/";
@@ -24,12 +24,24 @@ BDEPEND="
 
 DOCS=( BUGS LIMITATIONS NEWS README THANKS TODO )
 
-PATCHES=( "${FILESDIR}/${P}-glibc228.patch" )
+PATCHES=(
+       "${FILESDIR}/${P}-glibc228.patch"
+       "${FILESDIR}/${PN}-4.1-configure-clang16.patch"
+)
+
+src_prepare() {
+       default
+
+       # Drop once ${PN}-4.1-configure-clang16.patch merged
+       eautoreconf
+}
 
 src_configure() {
        tc-export CC
        append-cppflags -D_GNU_SOURCE
+
        use unicode && append-libs -lunistring
+
        econf \
                --disable-rpath \
                $(use_enable nls) \

Reply via email to