summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-12-16 08:11:10 +0000
committerSam James <sam@gentoo.org>2023-12-16 08:23:54 +0000
commitfdc52315cd216a96a9956991d21f06348ef9de6e (patch)
tree82eddb75b50bebebbf1f10afaf99de83f0b91c80 /net-libs/udns
parentsys-libs/liburing: fix lld 17 build (diff)
downloadgentoo-fdc52315cd216a96a9956991d21f06348ef9de6e.tar.gz
gentoo-fdc52315cd216a96a9956991d21f06348ef9de6e.tar.bz2
gentoo-fdc52315cd216a96a9956991d21f06348ef9de6e.zip
net-libs/udns: fix (another) modern C issue
Bug: https://bugs.gentoo.org/874759 Bug: https://bugs.gentoo.org/883285 Closes: https://bugs.gentoo.org/919260 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-libs/udns')
-rw-r--r--net-libs/udns/files/udns-0.4-configure-c99.patch33
-rw-r--r--net-libs/udns/udns-0.4-r3.ebuild46
2 files changed, 79 insertions, 0 deletions
diff --git a/net-libs/udns/files/udns-0.4-configure-c99.patch b/net-libs/udns/files/udns-0.4-configure-c99.patch
new file mode 100644
index 000000000000..cedf073fe0ff
--- /dev/null
+++ b/net-libs/udns/files/udns-0.4-configure-c99.patch
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/874759
+https://bugs.gentoo.org/883285
+https://bugs.gentoo.org/919260
+https://src.fedoraproject.org/rpms/udns/c/27e7b66faa416c13b113e895c204373596282c37?branch=rawhide
+
+Provide autoconf-style fake prototype for socket to avoid implicit
+function declarations. Otherwise the check will always fail with soem
+C99 compilers.
+
+Avoid incorrect pointer types and a pointer-to-int conversion with
+inet_pton and inet_ntop.
+
+--- a/configure
++++ b/configure
+@@ -75,6 +75,7 @@ int main(int argc, char **argv) {
+ EOF
+
+ if ac_library_find_v 'socket and connect' "" "-lsocket -lnsl" <<EOF
++char socket(void); char connect(void);
+ int main() { socket(); connect(); return 0; }
+ EOF
+ then :
+@@ -92,8 +93,8 @@ ac_ign \
+ int main() {
+ char buf[64];
+ long x = 0;
+- inet_pton(AF_INET, &x, buf);
+- return inet_ntop(AF_INET, &x, buf, sizeof(buf));
++ inet_pton(AF_INET, (void *) &x, buf);
++ return inet_ntop(AF_INET, (void *) &x, buf, sizeof(buf)) != 0;
+ }
+ EOF
+
diff --git a/net-libs/udns/udns-0.4-r3.ebuild b/net-libs/udns/udns-0.4-r3.ebuild
new file mode 100644
index 000000000000..76ee1d6bd4c5
--- /dev/null
+++ b/net-libs/udns/udns-0.4-r3.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit edo toolchain-funcs
+
+DESCRIPTION="Async-capable DNS stub resolver library"
+HOMEPAGE="http://www.corpit.ru/mjt/udns.html"
+SRC_URI="http://www.corpit.ru/mjt/udns/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="ipv6 static +tools"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.4-configure-c99.patch
+)
+
+src_configure() {
+ # Uses non-standard configure script, econf doesn't work
+ CC="$(tc-getCC)" edo ./configure $(use_enable ipv6)
+}
+
+src_compile() {
+ emake $(usex tools shared sharedlib)
+}
+
+src_install() {
+ dolib.so libudns.so.0
+ dosym libudns.so.0 /usr/$(get_libdir)/libudns.so
+
+ if use tools; then
+ newbin dnsget_s dnsget
+ newbin ex-rdns_s ex-rdns
+ newbin rblcheck_s rblcheck
+ fi
+
+ doheader udns.h
+
+ doman udns.3
+ use tools && doman dnsget.1 rblcheck.1
+
+ dodoc NEWS NOTES TODO
+}