summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-12-19 11:17:29 +0000
committerSam James <sam@gentoo.org>2023-12-19 11:17:29 +0000
commit48da0cfd62e04219063d7dab7cb9e2df7829761d (patch)
treedd2396b23a7c931efe93e3af5afc0d57cd358ed1 /net-dialup
parentnet-fs/autofs: further modern C fixes (diff)
downloadgentoo-48da0cfd62e04219063d7dab7cb9e2df7829761d.tar.gz
gentoo-48da0cfd62e04219063d7dab7cb9e2df7829761d.tar.bz2
gentoo-48da0cfd62e04219063d7dab7cb9e2df7829761d.zip
net-dialup/lrzsz: fix modern C issue
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-dialup')
-rw-r--r--net-dialup/lrzsz/files/lrzsz-0.12.20-c99.patch27
-rw-r--r--net-dialup/lrzsz/lrzsz-0.12.20-r8.ebuild75
2 files changed, 102 insertions, 0 deletions
diff --git a/net-dialup/lrzsz/files/lrzsz-0.12.20-c99.patch b/net-dialup/lrzsz/files/lrzsz-0.12.20-c99.patch
new file mode 100644
index 000000000000..db593179b02e
--- /dev/null
+++ b/net-dialup/lrzsz/files/lrzsz-0.12.20-c99.patch
@@ -0,0 +1,27 @@
+https://src.fedoraproject.org/rpms/lrzsz/blob/c23247c9c7604aec31d49ed1b238622835f575e2/f/lrzsz-socklen.patch
+
+Use socklen_t as the length of the socket address (which is a bit of
+an anachronism, considering the rest of the sources). The previous
+code des not work on 64-bit big-endian architectures.
+
+--- a/src/tcp.c
++++ b/src/tcp.c
+@@ -56,7 +56,7 @@ tcp_server (char *buf)
+ struct sockaddr_in s;
+ struct sockaddr_in t;
+ int on=1;
+- size_t len;
++ socklen_t len;
+
+ if ((sock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
+ error(1,errno,"socket");
+@@ -91,7 +91,7 @@ tcp_accept (int d)
+ {
+ int so;
+ struct sockaddr_in s;
+- size_t namelen;
++ socklen_t namelen;
+ int num=0;
+
+ namelen = sizeof(s);
+
diff --git a/net-dialup/lrzsz/lrzsz-0.12.20-r8.ebuild b/net-dialup/lrzsz/lrzsz-0.12.20-r8.ebuild
new file mode 100644
index 000000000000..0e842edb2981
--- /dev/null
+++ b/net-dialup/lrzsz/lrzsz-0.12.20-r8.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools toolchain-funcs
+
+DESCRIPTION="Communication package providing the X, Y, and ZMODEM file transfer protocols"
+HOMEPAGE="https://www.ohse.de/uwe/software/lrzsz.html"
+SRC_URI="
+ https://www.ohse.de/uwe/releases/${P}.tar.gz
+ https://dev.gentoo.org/~ceamac/${CATEGORY}/${PN}/${PN}-m4-${PV}.tar.bz2
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="nls"
+
+DEPEND="nls? ( virtual/libintl )"
+BDEPEND="nls? ( sys-devel/gettext )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-autotools.patch
+ "${FILESDIR}"/${PN}-implicit-decl.patch
+ "${FILESDIR}"/${P}-automake-1.12.patch
+ "${FILESDIR}"/${P}-automake-1.13.patch
+ "${FILESDIR}"/${P}-gettext-0.20.patch
+ "${FILESDIR}"/${P}-AR.patch
+ "${FILESDIR}"/${P}-configure-clang16.patch
+ "${FILESDIR}"/${P}-gettext-0.22.patch
+ "${FILESDIR}"/${P}-disable-nls.patch
+ "${FILESDIR}"/${P}-c99.patch
+)
+
+DOCS=( AUTHORS COMPATABILITY ChangeLog NEWS \
+ README{,.cvs,.gettext,.isdn4linux,.tests} THANKS TODO )
+
+src_prepare() {
+ default
+
+ # automake is unhappy if this is missing
+ >> config.rpath || die
+ # This is too old. Remove it so automake puts in a newer copy.
+ rm missing || die
+ # Autoheader does not like seeing this file.
+ rm acconfig.h || die
+ # embed default m4 files in case gettext is not installed
+ mv "${WORKDIR}"/m4 . || die
+
+ eautoreconf
+}
+
+src_configure() {
+ tc-export CC
+
+ econf $(use_enable nls)
+}
+
+src_test() {
+ # Don't use check target.
+ # See bug #120748 before changing this function.
+ emake vcheck
+}
+
+src_install() {
+ default
+
+ local x
+ for x in {r,s}{b,x,z} ; do
+ dosym l${x} /usr/bin/${x}
+ dosym l${x:0:1}z.1 /usr/share/man/man1/${x}.1
+ [ "${x:1:1}" = "z" ] || dosym l${x:0:1}z.1 /usr/share/man/man1/l${x}.1
+ done
+}