summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-misc/gcal')
-rw-r--r--app-misc/gcal/Manifest1
-rw-r--r--app-misc/gcal/files/gcal-4.1-configure-clang16.patch31
-rw-r--r--app-misc/gcal/files/gcal-4.1-fix-ncurses.patch38
-rw-r--r--app-misc/gcal/files/gcal-4.1-fortify.patch21
-rw-r--r--app-misc/gcal/gcal-3.6.3.ebuild34
-rw-r--r--app-misc/gcal/gcal-4.1-r3.ebuild (renamed from app-misc/gcal/gcal-4.1.ebuild)33
-rw-r--r--app-misc/gcal/metadata.xml5
7 files changed, 123 insertions, 40 deletions
diff --git a/app-misc/gcal/Manifest b/app-misc/gcal/Manifest
index 6e5c89893fa8..c265ea4149e0 100644
--- a/app-misc/gcal/Manifest
+++ b/app-misc/gcal/Manifest
@@ -1,2 +1 @@
-DIST gcal-3.6.3.tar.xz 1640172 BLAKE2B 322a3bf34a389ab92daa0262b8b36f99b585c7f76e46e5a921a5e23ced74ae98bf09446e02988c98c29ecadf631b6624cb43e76c8da736a185e52ed34441c334 SHA512 9be7d6e58a55fbb7531f91bd2a6fa51e8d62364636c31d8d65f6ac24415ac2de8af5eaab8496e155c2820b7480ecf926c4395114ff4363deb21bd268dec44963
DIST gcal-4.1.tar.xz 1658948 BLAKE2B 980b509923d7e3afbd391f1129a77e647f61e09d68aec29490bc16041260e56082097732f015260515036a4560bee18391c8f6aaa5eaff69740f18a37a44d8f2 SHA512 24b9ee87c3dbfd3231b2017fd0a3030cc5b7c7fde032ea1fcf816b0f10dc40d808c646aa8ece86651da4f3928fecf35f84f4c68c0bfdb8cf63e3ecc189d2074d
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/files/gcal-4.1-fix-ncurses.patch b/app-misc/gcal/files/gcal-4.1-fix-ncurses.patch
new file mode 100644
index 000000000000..f429a0121d39
--- /dev/null
+++ b/app-misc/gcal/files/gcal-4.1-fix-ncurses.patch
@@ -0,0 +1,38 @@
+Without this, it'd silently (well, with a small warning in configure) fall back
+to no fancy tty stuff.
+--- a/configure.ac
++++ b/configure.ac
+@@ -319,6 +319,13 @@ if test "$gcal_cv_use_term" = yes; then
+ AC_MSG_CHECKING(for working terminal libraries)
+ SAVE_LIBS=$LIBS
+ LIBS="$LIBS $TTYLIBS"
++
++ PKG_CHECK_MODULES([NCURSES], [ncurses], [
++ TTYLIBS=$NCURSES_LIBS
++ CPPFLAGS="$NCURSES_CFLAGS $CPPFLAGS"
++ AC_DEFINE([HAVE_TTYLIBS], [1], [Link -lncurses or -ltermcap or -ltermlib to executable.])
++ AC_MSG_RESULT(using $TTYLIBS)
++ ], [
+ AC_TRY_LINK([#include <term.h>],
+ [tgetent(0); tgetflag(0); tgetnum(0); tgetstr(0);],
+ [gcal_ttylibs_ok=yes])
+@@ -385,7 +392,7 @@ if test "$gcal_cv_use_term" = yes; then
+ AC_MSG_WARN(note: $PACKAGE-$VERSION would work more flexible if libncurses.a)
+ AC_MSG_WARN(libtermcap.a or libtermlib.a are installed.)
+ AC_MSG_RESULT()
+- fi
++ fi])
+ fi
+
+ dnl
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -22,7 +22,7 @@ MISC_LIBS = @LIBM@ @LIBS@
+ LIBS = $(MISC_LIBS)
+
+ AM_CFLAGS = -I$(top_srcdir)/lib -I$(srcdir) -I.. $(CPPFLAGS)
+-LDADD = ../lib/libgnu.a $(LIBINTL)
++LDADD = ../lib/libgnu.a $(LIBINTL) $(TTYLIBS) $(NCURSES_LIBS)
+
+ SRCS = \
+ file-io.c \
diff --git a/app-misc/gcal/files/gcal-4.1-fortify.patch b/app-misc/gcal/files/gcal-4.1-fortify.patch
new file mode 100644
index 000000000000..bc3b3a693af9
--- /dev/null
+++ b/app-misc/gcal/files/gcal-4.1-fortify.patch
@@ -0,0 +1,21 @@
+https://bugs.gentoo.org/925560
+https://git.savannah.gnu.org/cgit/gcal.git/commit/?id=a9d49b3e6535ebf2b5a0b4051e95bb5dc0c27fdb
+
+From a9d49b3e6535ebf2b5a0b4051e95bb5dc0c27fdb Mon Sep 17 00:00:00 2001
+From: Oleg Derevenetz <oleg-derevenetz@yandex.ru>
+Date: Sun, 29 Nov 2020 17:42:07 +0100
+Subject: src/utils.c: fix segfault
+
+--- a/src/utils.c
++++ b/src/utils.c
+@@ -1354,7 +1354,7 @@ month_name (month)
+
+
+ len = (int) strlen (s) - 1;
+- mayname = (char *) my_malloc (len,
++ mayname = (char *) my_malloc (len + 2,
+ ERR_NO_MEMORY_AVAILABLE,
+ __FILE__, ((long) __LINE__) - 2L,
+ "mayname", 0);
+--
+cgit v1.1
diff --git a/app-misc/gcal/gcal-3.6.3.ebuild b/app-misc/gcal/gcal-3.6.3.ebuild
deleted file mode 100644
index f872ffb027c7..000000000000
--- a/app-misc/gcal/gcal-3.6.3.ebuild
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit flag-o-matic toolchain-funcs
-
-DESCRIPTION="The GNU Calendar - a replacement for cal"
-HOMEPAGE="https://www.gnu.org/software/gcal/"
-SRC_URI="mirror://gnu/gcal/${P}.tar.xz"
-
-LICENSE="GPL-3+"
-SLOT="0"
-KEYWORDS="amd64 ~arm ppc x86 ~amd64-linux ~x86-linux ~ppc-macos"
-IUSE="ncurses nls unicode"
-
-RDEPEND="nls? ( virtual/libintl )"
-DEPEND="${RDEPEND}"
-BDEPEND="
- app-arch/xz-utils
- nls? ( >=sys-devel/gettext-0.17 )
-"
-
-DOCS=( BUGS LIMITATIONS NEWS README THANKS TODO )
-
-src_configure() {
- tc-export CC
- append-cppflags -D_GNU_SOURCE
- econf \
- --disable-rpath \
- $(use_enable nls) \
- $(use_enable ncurses term) \
- $(use_enable unicode)
-}
diff --git a/app-misc/gcal/gcal-4.1.ebuild b/app-misc/gcal/gcal-4.1-r3.ebuild
index ee18f98e3850..bf8b3d6c95e7 100644
--- a/app-misc/gcal/gcal-4.1.ebuild
+++ b/app-misc/gcal/gcal-4.1-r3.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 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,15 +24,40 @@ 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"
+ "${FILESDIR}/${P}-fortify.patch"
+ "${FILESDIR}/${PN}-4.1-fix-ncurses.patch"
+)
+
+src_prepare() {
+ default
+
+ eautoreconf
+}
src_configure() {
tc-export CC
append-cppflags -D_GNU_SOURCE
+
use unicode && append-libs -lunistring
+
econf \
--disable-rpath \
$(use_enable nls) \
$(use_enable ncurses term) \
$(use_enable unicode)
}
+
+src_test() {
+ default
+
+ # Do basic smoke tests to help catch issues like bug #925560
+ # where trivial 'gcal' invocation crashed w/ _F_S=3.
+ local -x PATH="${S}/src:${S}:${PATH}"
+ local bin
+ for bin in gcal2txt tcal txt2gcal gcal ; do
+ src/${bin} || die
+ done
+}
diff --git a/app-misc/gcal/metadata.xml b/app-misc/gcal/metadata.xml
index f9dc5e6492c8..4ac886b2ffb7 100644
--- a/app-misc/gcal/metadata.xml
+++ b/app-misc/gcal/metadata.xml
@@ -16,5 +16,8 @@
most civil purposes. Gcal supports some other calendar systems, for example
the Chinese and Japanese calendar, the Hebrew calendar and the civil Islamic
calendar, too.
-</longdescription>
+ </longdescription>
+ <upstream>
+ <remote-id type="savannah">gcal</remote-id>
+ </upstream>
</pkgmetadata>