commit:     546b5929b0b382b7fc0d66c1a8d51454431f6ab0
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Sat Feb  1 13:50:32 2025 +0000
Commit:     Eray Aslan <eras <AT> gentoo <DOT> org>
CommitDate: Fri Feb  7 12:11:40 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=546b5929

app-crypt/mit-krb5-appl: port to C99 and up to C17

Fails to build with C23 due to very active usage of vararg functions:
Some of function pointers take parameters, some of them take no parameters

Bug: https://bugs.gentoo.org/946064
Closes: https://bugs.gentoo.org/878615
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Signed-off-by: Eray Aslan <eras <AT> gentoo.org>

 .../mit-krb5-appl/files/mit-krb5-appl-c99.patch    | 71 ++++++++++++++++++++++
 .../mit-krb5-appl/mit-krb5-appl-1.0.3-r5.ebuild    | 71 ++++++++++++++++++++++
 2 files changed, 142 insertions(+)

diff --git a/app-crypt/mit-krb5-appl/files/mit-krb5-appl-c99.patch 
b/app-crypt/mit-krb5-appl/files/mit-krb5-appl-c99.patch
new file mode 100644
index 000000000000..d1f22845390d
--- /dev/null
+++ b/app-crypt/mit-krb5-appl/files/mit-krb5-appl-c99.patch
@@ -0,0 +1,71 @@
+Port to C99/ up to C17: declare all implicit ints explicitly
+https://bugs.gentoo.org/878615
+--- a/gssftp/ftp/cmds.c
++++ b/gssftp/ftp/cmds.c
+@@ -312,8 +312,7 @@
+ /*
+  * Set control channel protection level.
+  */
+-void setclevel(argc, argv)
+-      char *argv[];
++void setclevel(int argc, char *argv[])
+ {
+       register struct levels *p;
+       int comret;
+@@ -365,8 +364,7 @@
+  * Set data channel protection level.
+  */
+ void
+-setdlevel(argc, argv)
+-      char *argv[];
++setdlevel(int argc, char *argv[])
+ {
+       register struct levels *p;
+       int comret;
+@@ -845,10 +843,7 @@
+ /*
+  * Receive one file.
+  */
+-static int getit(argc, argv, restartit, rmode)
+-      int argc;
+-      char *argv[];
+-      char *rmode;
++static int getit(int argc, char *argv[], int restartit, char *rmode)
+ {
+       int loc = 0;
+       char *oldargv1, *oldargv2;
+@@ -1164,8 +1159,7 @@
+  * Show status.
+  */
+ /*ARGSUSED*/
+-void status(argc, argv)
+-      char *argv[];
++void status(int argc, char *argv[])
+ {
+       int i;
+ 
+--- a/telnet/telnet/commands.c
++++ b/telnet/telnet/commands.c
+@@ -1890,8 +1890,7 @@
+ }
+ 
+       unsigned char *
+-env_default(init, welldefined)
+-      int init;
++env_default(int init, int welldefined)
+ {
+       static struct env_lst *nep = NULL;
+ 
+--- a/telnet/telnet/sys_bsd.c
++++ b/telnet/telnet/sys_bsd.c
+@@ -976,8 +976,8 @@
+  */
+ 
+     int
+-process_rings(netin, netout, netex, ttyin, ttyout, poll)
+-    int poll;         /* If 0, then block until something to do */
++process_rings(int netin, int netout, int netex, int ttyin,
++      int ttyout, int poll)           /* If 0, then block until something to 
do */
+ {
+     register int c;
+               /* One wants to be a bit careful about setting returnValue

diff --git a/app-crypt/mit-krb5-appl/mit-krb5-appl-1.0.3-r5.ebuild 
b/app-crypt/mit-krb5-appl/mit-krb5-appl-1.0.3-r5.ebuild
new file mode 100644
index 000000000000..39508320026e
--- /dev/null
+++ b/app-crypt/mit-krb5-appl/mit-krb5-appl-1.0.3-r5.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic toolchain-funcs
+
+MY_P=${P/mit-}
+MAJOR_MINOR="$(ver_cut 1-2)"
+DESCRIPTION="Kerberized applications split from the main MIT Kerberos V 
distribution"
+HOMEPAGE="https://web.mit.edu/kerberos/www/";
+SRC_URI="https://web.mit.edu/kerberos/dist/krb5-appl/${MAJOR_MINOR}/${MY_P}-signed.tar";
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="openafs-krb5-a BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+BDEPEND="virtual/pkgconfig"
+RDEPEND=">=app-crypt/mit-krb5-1.8.0
+       sys-fs/e2fsprogs
+       sys-libs/ncurses:=
+       virtual/libcrypt:="
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-tinfo.patch"
+       "${FILESDIR}/${PN}-sig_t.patch"
+       "${FILESDIR}/${PN}-autoconf-2.72.patch"
+       "${FILESDIR}/${PN}-c99.patch"
+)
+
+src_unpack() {
+       unpack ${A}
+       unpack ./"${MY_P}".tar.gz
+}
+
+src_prepare() {
+       default
+
+       sed -i -e "s/-lncurses/$($(tc-getPKG_CONFIG) --libs ncurses)/" 
configure.ac || die
+       eautoreconf
+}
+
+src_configure() {
+       append-cppflags "-I/usr/include/et"
+       append-cppflags -fno-strict-aliasing
+       append-cppflags -fno-strict-overflow
+       # bug https://bugs.gentoo.org/946064 and others
+       append-cflags -std=gnu17
+
+       econf
+}
+
+src_install() {
+       emake DESTDIR="${ED}" install
+       for i in {telnetd,ftpd} ; do
+               mv "${ED}"/usr/share/man/man8/${i}.8 
"${ED}"/usr/share/man/man8/k${i}.8 \
+                       || die "mv failed (man)"
+               mv "${ED}"/usr/sbin/${i} "${ED}"/usr/sbin/k${i} || die "mv 
failed"
+       done
+
+       for i in {rcp,rlogin,rsh,telnet,ftp} ; do
+               mv "${ED}"/usr/share/man/man1/${i}.1 
"${ED}"/usr/share/man/man1/k${i}.1 \
+                       || die "mv failed (man)"
+               mv "${ED}"/usr/bin/${i} "${ED}"/usr/bin/k${i} || die "mv failed"
+       done
+
+       rm "${ED}"/usr/share/man/man1/tmac.doc || die
+       dodoc README
+}

Reply via email to