From 4956a37ab3b4b084c59c0e6753e2274efe24f3a2 Mon Sep 17 00:00:00 2001 From: Brahmajit Das Date: Sat, 12 Aug 2023 13:47:24 +0000 Subject: [PATCH] net-mail/mess822: Fix call to undeclared function str_len along with other build errors on musl llvm (or just llvm) profile Closes: https://bugs.gentoo.org/883265 Signed-off-by: Brahmajit Das --- .../mess822-0.58-clang16-build-fix.patch | 219 ++++++++++++++++++ net-mail/mess822/mess822-0.58-r3.ebuild | 57 +++++ 2 files changed, 276 insertions(+) create mode 100644 net-mail/mess822/files/mess822-0.58-clang16-build-fix.patch create mode 100644 net-mail/mess822/mess822-0.58-r3.ebuild diff --git a/net-mail/mess822/files/mess822-0.58-clang16-build-fix.patch b/net-mail/mess822/files/mess822-0.58-clang16-build-fix.patch new file mode 100644 index 0000000000000..9a00ac577415b --- /dev/null +++ b/net-mail/mess822/files/mess822-0.58-clang16-build-fix.patch @@ -0,0 +1,219 @@ +Bug: https://bugs.gentoo.org/883265 +--- a/822print.c ++++ b/822print.c +@@ -10,6 +10,8 @@ + #include "leapsecs.h" + #include "caltime.h" + #include "tai.h" ++#include "str.h" ++#include "byte.h" + + #define FATAL "822print: fatal: " + +--- a/822received.c ++++ b/822received.c +@@ -9,6 +9,7 @@ + #include "leapsecs.h" + #include "caltime.h" + #include "tai.h" ++#include "case.h" + + #define FATAL "822received: fatal: " + +--- a/auto-str.c ++++ b/auto-str.c +@@ -3,7 +3,7 @@ + #include "exit.h" + + char buf1[256]; +-substdio ss1 = SUBSTDIO_FDBUF(write,1,buf1,sizeof(buf1)); ++substdio ss1 = SUBSTDIO_FDBUF((int *)write,1,buf1,sizeof(buf1)); + + void puts(s) + char *s; +--- a/cdb_seek.c ++++ b/cdb_seek.c +@@ -1,5 +1,6 @@ + #include + #include ++#include "readwrite.h" + extern int errno; + #include "cdb.h" + +--- a/cdbmss.h ++++ b/cdbmss.h +@@ -13,4 +13,13 @@ struct cdbmss { + int fd; + } ; + ++int cdbmss_start(struct cdbmss *c, int fd); ++int cdbmss_add( ++struct cdbmss *c, ++unsigned char *key, ++unsigned int keylen, ++unsigned char *data, ++unsigned int datalen); ++int cdbmss_finish(struct cdbmss *c); ++ + #endif +--- a/fd_copy.c ++++ b/fd_copy.c +@@ -1,4 +1,5 @@ + #include ++#include "readwrite.h" + #include "fd.h" + + int fd_copy(to,from) +--- a/fd_move.c ++++ b/fd_move.c +@@ -1,3 +1,4 @@ ++#include "readwrite.h" + #include "fd.h" + + int fd_move(to,from) +--- a/leapsecs_read.c ++++ b/leapsecs_read.c +@@ -5,6 +5,7 @@ + #include + extern int errno; + #include "tai.h" ++#include "readwrite.h" + #include "leapsecs.h" + + struct tai *leapsecs = 0; +--- a/mess822_line.c ++++ b/mess822_line.c +@@ -1,4 +1,5 @@ + #include "mess822.h" ++#include "case.h" + + int mess822_begin(h,a) + mess822_header *h; +--- a/mess822_when.c ++++ b/mess822_when.c +@@ -1,5 +1,7 @@ + #include "mess822.h" + #include "scan.h" ++#include "case.h" ++#include "str.h" + + static stralloc tokens = {0}; + static struct caltime ct; +--- a/new-inject.c ++++ b/new-inject.c +@@ -17,6 +17,8 @@ + #include "sig.h" + #include "rewritehost.h" + #include "rwhconfig.h" ++#include "readwrite.h" ++#include "str.h" + + #define FATAL "new-inject: fatal: " + +--- a/ofmipd.c ++++ b/ofmipd.c +@@ -16,6 +16,13 @@ + #include "tai.h" + #include "caltime.h" + #include "cdb.h" ++#include "rwhconfig.h" ++#include "open.h" ++#include "getln.h" ++#include "leapsecs.h" ++#include "rewritehost.h" ++#include "byte.h" ++#include + + int timeout = 1200; + +--- a/ofmipname.c ++++ b/ofmipname.c +@@ -6,6 +6,11 @@ + #include "stralloc.h" + #include "getln.h" + #include "exit.h" ++#include "readwrite.h" ++#include "cdb.h" ++#include "byte.h" ++#include ++#include + + #define FATAL "ofmipname: fatal: " + +--- a/readwrite.h ++++ b/readwrite.h +@@ -1,7 +1,4 @@ + #ifndef READWRITE_H + #define READWRITE_H +- +-extern int read(); +-extern int write(); +- ++#include + #endif +--- a/rewritehost.c ++++ b/rewritehost.c +@@ -2,6 +2,7 @@ + #include "str.h" + #include "case.h" + #include "rewritehost.h" ++#include "byte.h" + + static stralloc work = {0}; + +--- a/rwhconfig.c ++++ b/rwhconfig.c +@@ -4,6 +4,7 @@ + #include "strerr.h" + #include "rwhconfig.h" + #include "auto_qmail.h" ++#include "readwrite.h" + + struct strerr rwhconfig_err; + +--- a/seek_set.c ++++ b/seek_set.c +@@ -1,4 +1,5 @@ + #include ++#include "readwrite.h" + #include "seek.h" + + #define SET 0 /* sigh */ +--- a/subfderr.c ++++ b/subfderr.c +@@ -1,7 +1,7 @@ +-#include "readwrite.h" ++#include + #include "substdio.h" + #include "subfd.h" + + char subfd_errbuf[256]; +-static substdio it = SUBSTDIO_FDBUF(write,2,subfd_errbuf,256); ++static substdio it = SUBSTDIO_FDBUF((int *)write,2,subfd_errbuf,256); + substdio *subfderr = ⁢ +--- a/subfdin.c ++++ b/subfdin.c +@@ -1,4 +1,4 @@ +-#include "readwrite.h" ++#include + #include "substdio.h" + #include "subfd.h" + +--- a/subfdout.c ++++ b/subfdout.c +@@ -3,5 +3,5 @@ + #include "subfd.h" + + char subfd_outbuf[SUBSTDIO_OUTSIZE]; +-static substdio it = SUBSTDIO_FDBUF(write,1,subfd_outbuf,SUBSTDIO_OUTSIZE); ++static substdio it = SUBSTDIO_FDBUF((int *)write,1,subfd_outbuf,SUBSTDIO_OUTSIZE); + substdio *subfdout = ⁢ +--- a/subfdouts.c ++++ b/subfdouts.c +@@ -3,5 +3,5 @@ + #include "subfd.h" + + char subfd_outbufsmall[256]; +-static substdio it = SUBSTDIO_FDBUF(write,1,subfd_outbufsmall,256); ++static substdio it = SUBSTDIO_FDBUF((int *)write,1,subfd_outbufsmall,256); + substdio *subfdoutsmall = ⁢ diff --git a/net-mail/mess822/mess822-0.58-r3.ebuild b/net-mail/mess822/mess822-0.58-r3.ebuild new file mode 100644 index 0000000000000..de3260016bb3e --- /dev/null +++ b/net-mail/mess822/mess822-0.58-r3.ebuild @@ -0,0 +1,57 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs + +DESCRIPTION="Collection of utilities for parsing Internet mail messages" +SRC_URI="http://cr.yp.to/software/${P}.tar.gz" +HOMEPAGE="http://cr.yp.to/mess822.html" + +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="" +LICENSE="public-domain" +RESTRICT="test" + +RDEPEND="sys-apps/sed" + +PATCHES=( + "${FILESDIR}"/${P}-implicit.patch + "${FILESDIR}"/${P}-clang16-build-fix.patch +) + +src_prepare() { + default + + echo "$(tc-getCC) ${CFLAGS}" > conf-cc || die + echo "$(tc-getCC) ${LDFLAGS}" > conf-ld || die + echo "/usr" > conf-home || die + + # fix errno.h problem; bug #26165 + sed -i 's/^extern int errno;/#include /' error.h || die + + sed -i -e "s/ar/$(tc-getAR)/" make-makelib.sh || die + sed -i -e "s/ranlib/$(tc-getRANLIB)/" make-makelib.sh || die +} + +src_install() { + dodir /etc + dodir /usr/share + + # Now that the commands are compiled, update the conf-home file to point + # to the installation image directory. + echo "${ED}/usr/" > conf-home || die + sed -i -e "s:\"/etc\":\"${ED}/etc\":" hier.c || die "sed hier.c failed" + + emake setup + + # Move the man pages into /usr/share/man + mv "${ED}/usr/man" "${ED}/usr/share/" || die + + dodir /usr/$(get_libdir) + mv "${ED}/usr/lib/${PN}.a" "${ED}/usr/$(get_libdir)/${PN}.a" || die + rmdir "${ED}/usr/lib" || die + dodoc BLURB CHANGES INSTALL README THANKS TODO VERSION +}