Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net-mail/mess822: Fix call to undeclared function str_len #32272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
219 changes: 219 additions & 0 deletions 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 <sys/types.h>
#include <errno.h>
+#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 <fcntl.h>
+#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 <errno.h>
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 <unistd.h>

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 <sys/stat.h>
+#include <stdio.h>

#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 <unistd.h>
#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 <sys/types.h>
+#include "readwrite.h"
#include "seek.h"

#define SET 0 /* sigh */
--- a/subfderr.c
+++ b/subfderr.c
@@ -1,7 +1,7 @@
-#include "readwrite.h"
+#include <unistd.h>
#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 = &it;
--- a/subfdin.c
+++ b/subfdin.c
@@ -1,4 +1,4 @@
-#include "readwrite.h"
+#include <unistd.h>
#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 = &it;
--- 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 = &it;
57 changes: 57 additions & 0 deletions 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 <errno.h>/' 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
}