commit:     42c15a2f99997bf8fa6197519c28cb1a3e470232
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Tue Mar 11 18:34:46 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 14 20:59:53 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42c15a2f

dev-util/btyacc: update EAPI 7 -> 8, port to C99, wire tests

Closes: https://bugs.gentoo.org/880971
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/41023
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/btyacc/btyacc-3.0-r5.ebuild       | 39 ++++++++++++++++++++++++++
 dev-util/btyacc/files/btyacc-3.0-c99.patch | 45 ++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+)

diff --git a/dev-util/btyacc/btyacc-3.0-r5.ebuild 
b/dev-util/btyacc/btyacc-3.0-r5.ebuild
new file mode 100644
index 000000000000..c211b39e8295
--- /dev/null
+++ b/dev-util/btyacc/btyacc-3.0-r5.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+MY_P="${PN}-3-0"
+DESCRIPTION="Backtracking YACC - modified from Berkeley YACC"
+HOMEPAGE="https://www.siber.com/btyacc";
+SRC_URI="https://www.siber.com/btyacc/${MY_P}.tar.gz";
+S="${WORKDIR}"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~x86-linux ~ppc-macos"
+
+PATCHES=(
+       "${FILESDIR}/${P}-includes.patch"
+       "${FILESDIR}/${P}-makefile.patch"
+       "${FILESDIR}/${P}-c99.patch"
+)
+
+src_compile() {
+       emake CC="$(tc-getCC)"
+}
+
+src_test() {
+       for file in "${S}"/test/*.y;
+               do "${S}"/btyacc "${file}" || die
+               rm y_tab.c || die
+       done
+}
+
+src_install() {
+       dobin btyacc
+       dodoc README README.BYACC
+       newman manpage btyacc.1
+}

diff --git a/dev-util/btyacc/files/btyacc-3.0-c99.patch 
b/dev-util/btyacc/files/btyacc-3.0-c99.patch
new file mode 100644
index 000000000000..f34a78949e96
--- /dev/null
+++ b/dev-util/btyacc/files/btyacc-3.0-c99.patch
@@ -0,0 +1,45 @@
+Fold sed that fixed https://bugs.gentoo.org/361013 into patch
+Correct type for signal handler that ignores argument.
+https://bugs.gentoo.org/880971
+--- a/defs.h
++++ b/defs.h
+@@ -391,7 +391,7 @@
+ 
+ /* main.c */
+ void done(int);
+-void onintr(void);
++void onintr(int);
+ void set_signals(void);
+ void usage(void);
+ void getargs(int, char **);
+--- a/main.c
++++ b/main.c
+@@ -76,7 +76,7 @@
+ }
+ 
+ 
+-void onintr()
++void onintr(int ignored) //signal handler
+ {
+     done(1);
+ }
+@@ -264,7 +264,7 @@
+     if (tmpdir == 0) tmpdir = DEFAULT_TMPDIR;
+ 
+     len = strlen(tmpdir);
+-    i = len + 13;
++    i = len + 14;
+     if (len && tmpdir[len-1] != DIR_CHAR)
+       ++i;
+ 
+--- a/reader.c
++++ b/reader.c
+@@ -291,7 +291,7 @@
+     cachec(NUL);
+     
+     if ((key = bsearch(cache, keywords, sizeof(keywords)/sizeof(*key),
+-                     sizeof(*key), strcmp)))
++                     sizeof(*key), (int (*)(const void*, const 
void*))strcmp)))
+       return key->token; 
+   } else {
+     ++cptr;

Reply via email to