Re: git: 956aa4e270bf - main - dns/udns: unbreak build on 14-CURRENT

From: Mathieu Arnold <mat_at_freebsd.org>
Date: Fri, 24 Feb 2023 10:36:08 UTC
On Fri, Feb 24, 2023 at 10:22:43AM +0000, Martin Matuska wrote:
> The branch main has been updated by mm:
> 
> URL: https://cgit.FreeBSD.org/ports/commit/?id=956aa4e270bf746d69ee77c8497dae2d28376cb4
> 
> commit 956aa4e270bf746d69ee77c8497dae2d28376cb4
> Author:     Martin Matuska <mm@FreeBSD.org>
> AuthorDate: 2023-02-24 10:09:28 +0000
> Commit:     Martin Matuska <mm@FreeBSD.org>
> CommitDate: 2023-02-24 10:22:36 +0000
> 
>     dns/udns: unbreak build on 14-CURRENT
>     
>     Fix detection of inet_pton() and inet_ntop()
> ---
>  dns/udns/Makefile              |  2 +-
>  dns/udns/files/patch-configure | 27 +++++++++++++++++++++++++++
>  2 files changed, 28 insertions(+), 1 deletion(-)
> 
> diff --git a/dns/udns/Makefile b/dns/udns/Makefile
> index c391036d15bd..ec3bcd299dcc 100644
> --- a/dns/udns/Makefile
> +++ b/dns/udns/Makefile
> @@ -1,6 +1,6 @@
>  PORTNAME=	udns
>  PORTVERSION=	0.4
> -PORTREVISION=	1
> +PORTREVISION=	2

Why bump PORTREVISION?

>  CATEGORIES=	dns
>  MASTER_SITES=	http://www.corpit.ru/mjt/udns/
>  
> diff --git a/dns/udns/files/patch-configure b/dns/udns/files/patch-configure
> new file mode 100644
> index 000000000000..ca6971268eae
> --- /dev/null
> +++ b/dns/udns/files/patch-configure
> @@ -0,0 +1,27 @@
> +--- configure.orig	2023-02-24 09:54:25 UTC
> ++++ configure
> +@@ -83,17 +83,20 @@ else
> + fi
> + 
> + ac_ign \
> +- ac_yesno "for inet_pton() && inet_ntop()" \
> ++ ac_yesno "for working inet_pton() && inet_ntop()" \
> +  ac_have INET_PTON_NTOP \
> +  ac_link <<EOF
> + #include <sys/types.h>
> + #include <sys/socket.h>
> + #include <arpa/inet.h>
> ++#include <string.h>
> + int main() {
> ++  char addr[sizeof(struct in_addr)];
> +   char buf[64];
> +-  long x = 0;
> +-  inet_pton(AF_INET, &x, buf);
> +-  return inet_ntop(AF_INET, &x, buf, sizeof(buf));
> ++  char *localhost = "127.0.0.1";
> ++  inet_pton(AF_INET, localhost, addr);
> ++  inet_ntop(AF_INET, addr, buf, sizeof(buf));
> ++  return strncmp(localhost, buf, sizeof(localhost));
> + } 
> + EOF
> + 
> 

-- 
Mathieu Arnold