public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-misc/gcal/files/, app-misc/gcal/
@ 2024-02-27  0:58 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2024-02-27  0:58 UTC (permalink / raw
  To: gentoo-commits

commit:     fc29b9c0f71207121cbf9c93b1f5f131de30b078
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 27 00:58:05 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Feb 27 00:58:40 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc29b9c0

app-misc/gcal: fix crash with _F_S=3, add smoke test

* Fix crash with _F_S=3 using upstream patch
* Add smoke test to src_test which would've (and does) catch this

Closes: https://bugs.gentoo.org/925560
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-misc/gcal/files/gcal-4.1-fortify.patch | 21 ++++++++++
 app-misc/gcal/gcal-4.1-r2.ebuild           | 62 ++++++++++++++++++++++++++++++
 2 files changed, 83 insertions(+)

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-4.1-r2.ebuild b/app-misc/gcal/gcal-4.1-r2.ebuild
new file mode 100644
index 000000000000..829867ea2dc9
--- /dev/null
+++ b/app-misc/gcal/gcal-4.1-r2.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools 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 )
+	unicode? ( dev-libs/libunistring:= )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	app-arch/xz-utils
+	nls? ( >=sys-devel/gettext-0.17 )
+"
+
+DOCS=( BUGS LIMITATIONS NEWS README THANKS TODO )
+
+PATCHES=(
+	"${FILESDIR}/${P}-glibc228.patch"
+	"${FILESDIR}/${PN}-4.1-configure-clang16.patch"
+	"${FILESDIR}/${P}-fortify.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) \
+		$(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 bin
+	for bin in gcal2txt tcal txt2gcal gcal ; do
+		src/${bin} || die
+	done
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-misc/gcal/files/, app-misc/gcal/
@ 2024-03-12  2:50 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2024-03-12  2:50 UTC (permalink / raw
  To: gentoo-commits

commit:     4a64470630d064066a66fb31291796c346616a0f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 12 02:49:06 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 12 02:49:06 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a644706

app-misc/gcal: fix ncurses detection w/ split tinfo

This may fix bug #752126 (not betting on it, but still). If it doesn't, perhaps
using ncursesw would...?

Bug: https://bugs.gentoo.org/752126
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-misc/gcal/files/gcal-4.1-fix-ncurses.patch | 38 ++++++++++++++++
 app-misc/gcal/gcal-4.1-r3.ebuild               | 63 ++++++++++++++++++++++++++
 2 files changed, 101 insertions(+)

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/gcal-4.1-r3.ebuild b/app-misc/gcal/gcal-4.1-r3.ebuild
new file mode 100644
index 000000000000..7af1a01b9d17
--- /dev/null
+++ b/app-misc/gcal/gcal-4.1-r3.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools 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 )
+	unicode? ( dev-libs/libunistring:= )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	app-arch/xz-utils
+	nls? ( >=sys-devel/gettext-0.17 )
+"
+
+DOCS=( BUGS LIMITATIONS NEWS README THANKS TODO )
+
+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
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-12  2:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-27  0:58 [gentoo-commits] repo/gentoo:master commit in: app-misc/gcal/files/, app-misc/gcal/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-03-12  2:50 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox