pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/58978: comms/asterisk build fails if prefix is not /usr/pkg



>Number:         58978
>Category:       pkg
>Synopsis:       comms/asterisk build fails if prefix is not /usr/pkg
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 09 16:00:01 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current, 2024Q4
>Organization:
The NetBSD(*) Foundation
>Environment:
>Description:
From pbulk's configure.log:

checking for uuid_generate_random in -luuid... no
checking for uuid_generate_random in -le2fs-uuid... no
checking for uuid_generate_random... no
configure: error: *** uuid support not found (this typically means the uuid development package is missing)
*** Error code 1

From asterisk's config.log:

configure:15335: checking for uuid_generate_random in -luuid
configure:15358: cc -o conftest -O2 -I/pkg/2024Q4/include -I/usr/include -DLDAP_DEPRECATED -I/usr/include/readline -I/pkg/2024Q4/include/python3.12  -I/usr/pkg/include -L/usr/pkg/lib conftest.c -luuid    >&5
ld: cannot find -luuid

This is obviously bonkers because PREFIX in this case is /pkg/2024Q4, but asterisk has hard-coded /usr/pkg.  asterisk has also cleared out the caller-provided CPPFLAGS and LDFLAGS here and replaced them by /usr/pkg nonsense.
>How-To-Repeat:
build comms/asterisk22 with prefix other than /usr/pkg
>Fix:
From fbeec1cd561b552ae6236de5ada1b2ce5b52e648 Mon Sep 17 00:00:00 2001
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Date: Thu, 9 Jan 2025 15:51:05 +0000
Subject: [PATCH] comms/asterisk22: Fix build with non-/usr/pkg prefix.

---
 comms/asterisk22/distinfo                   |  4 +--
 comms/asterisk22/patches/patch-configure    | 31 ++++++++++++++--
 comms/asterisk22/patches/patch-configure.ac | 39 ++++++++++++++++++---
 3 files changed, 65 insertions(+), 9 deletions(-)

diff --git a/comms/asterisk22/distinfo b/comms/asterisk22/distinfo
index 1ced24547c73..8285af2cf267 100644
--- a/comms/asterisk22/distinfo
+++ b/comms/asterisk22/distinfo
@@ -30,8 +30,8 @@ SHA1 (patch-cel_cel__pgsql.c) = b280efab2b035ce60be268bac9bc8824910b2b8f
 SHA1 (patch-channels_chan__pjsip.c) = efd4cbb82133fc5ddf7de70d01c99e185c585211
 SHA1 (patch-channels_pjsip_cli__commands.c) = 01baa9d242e3af02a1f3540cfb3064ad68c71d67
 SHA1 (patch-channels_pjsip_dialplan__functions.c) = 2cf8199c4ec9d4894eb922c2703d49ecc06188ef
-SHA1 (patch-configure) = 7bb72c26abe5c362bf8e415821534b83f6241473
-SHA1 (patch-configure.ac) = b972730a2be3bf54502116f1f7e03afee76a02cc
+SHA1 (patch-configure) = e8a82dc1f7fd13f9708651e5dfde2131542bc514
+SHA1 (patch-configure.ac) = 36a9ac909dc829901fd1db525b1f7c37cc3e45e2
 SHA1 (patch-contrib_scripts_vmail.cgi) = 7935ce96ea319eb19cc2ce999813eb837d5357c0
 SHA1 (patch-funcs_func__cdr.c) = 79c743df264948e5ea9e1c292012a1f6362d0c1e
 SHA1 (patch-funcs_func__channel.c) = 9d6ed8a2431fbde6879782d8228030467aabe7eb
diff --git a/comms/asterisk22/patches/patch-configure b/comms/asterisk22/patches/patch-configure
index f81926757b1b..68501b5cdb84 100644
--- a/comms/asterisk22/patches/patch-configure
+++ b/comms/asterisk22/patches/patch-configure
@@ -1,8 +1,33 @@
 $NetBSD: patch-configure,v 1.1 2024/10/21 05:12:45 jnemeth Exp $
 
---- configure.orig	2024-03-18 13:25:20.000000000 +0000
+regen from configure.ac
+
+--- configure.orig	2024-10-17 15:52:14.000000000 +0000
 +++ configure
-@@ -10124,12 +10124,12 @@ else $as_nop
+@@ -5082,13 +5082,9 @@ esac
+ case "${host_os}" in
+      netbsd*)
+      ac_default_prefix=/usr/pkg
+-     CPPFLAGS=-I/usr/pkg/include
+-     LDFLAGS=-L/usr/pkg/lib
+      ;;
+      dragonfly*|freebsd*)
+      ac_default_prefix=/usr/local
+-     CPPFLAGS=-I/usr/local/include
+-     LDFLAGS=-L/usr/local/lib
+      ;;
+      openbsd*)
+      ac_default_prefix=/usr/local
+@@ -5100,8 +5096,6 @@ case "${host_os}" in
+            astmandir=/usr/share/man
+         fi
+      fi
+-     CPPFLAGS=-I/usr/local/include
+-     LDFLAGS=-L/usr/local/lib
+      ;;
+      darwin*)
+      ac_default_prefix=/usr/local
+@@ -10124,12 +10118,12 @@ else $as_nop
  
  			{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clang -fblocks" >&5
  printf %s "checking for clang -fblocks... " >&6; }
@@ -17,7 +42,7 @@ $NetBSD: patch-configure,v 1.1 2024/10/21 05:12:45 jnemeth Exp $
  				AST_CLANG_BLOCKS_LIBS="-lBlocksRuntime"
  				AST_CLANG_BLOCKS="-fblocks"
  				{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-@@ -21892,6 +21892,148 @@ rm -f core conftest.err conftest.$ac_obj
+@@ -21892,6 +21886,148 @@ rm -f core conftest.err conftest.$ac_obj
  
  
  
diff --git a/comms/asterisk22/patches/patch-configure.ac b/comms/asterisk22/patches/patch-configure.ac
index eaf838787ab1..b219c0243236 100644
--- a/comms/asterisk22/patches/patch-configure.ac
+++ b/comms/asterisk22/patches/patch-configure.ac
@@ -1,8 +1,39 @@
 $NetBSD: patch-configure.ac,v 1.1 2024/10/21 05:12:45 jnemeth Exp $
 
---- configure.ac.orig	2021-03-04 16:46:08.000000000 +0000
+1. Don't clear CPPFLAGS/LDFLAGS and impose /usr/pkg or /usr/local;
+   pkgsrc will handle its own prefix, which may not be /usr/pkg in
+   which case asterisk should absolutely never look at /usr/pkg.
+2. Ditto.
+3. Standard poll is in <poll.h> -- check for that, not <sys/poll.h>.
+4. Check for strftime_l.
+5. Standard poll is in <poll.h> -- check for that, not <sys/poll.h>.
+
+--- configure.ac.orig	2024-10-17 15:52:14.000000000 +0000
 +++ configure.ac
-@@ -751,7 +751,7 @@ AC_CHECK_HEADERS([xlocale.h])
+@@ -65,13 +65,9 @@ esac
+ case "${host_os}" in
+      netbsd*)
+      ac_default_prefix=/usr/pkg
+-     CPPFLAGS=-I/usr/pkg/include
+-     LDFLAGS=-L/usr/pkg/lib
+      ;;
+      dragonfly*|freebsd*)
+      ac_default_prefix=/usr/local
+-     CPPFLAGS=-I/usr/local/include
+-     LDFLAGS=-L/usr/local/lib
+      ;;
+      openbsd*)
+      ac_default_prefix=/usr/local
+@@ -83,8 +79,6 @@ case "${host_os}" in
+            astmandir=/usr/share/man
+         fi
+      fi
+-     CPPFLAGS=-I/usr/local/include
+-     LDFLAGS=-L/usr/local/lib
+      ;;
+      darwin*)
+      ac_default_prefix=/usr/local
+@@ -808,7 +802,7 @@ AC_CHECK_HEADERS([xlocale.h])
  
  AC_CHECK_HEADERS([winsock.h winsock2.h])
  
@@ -11,7 +42,7 @@ $NetBSD: patch-configure.ac,v 1.1 2024/10/21 05:12:45 jnemeth Exp $
  	 [],
       AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.]))
  
-@@ -803,7 +803,7 @@ AC_FUNC_STRNLEN
+@@ -859,7 +853,7 @@ AC_FUNC_STRNLEN
  AC_FUNC_STRTOD
  AC_FUNC_UTIME_NULL
  AC_FUNC_VPRINTF
@@ -20,7 +51,7 @@ $NetBSD: patch-configure.ac,v 1.1 2024/10/21 05:12:45 jnemeth Exp $
  
  AC_MSG_CHECKING(for htonll)
  AC_LINK_IFELSE(
-@@ -872,9 +872,9 @@ AC_SUBST(PBX_DYNAMIC_LIST)
+@@ -928,9 +922,9 @@ AC_SUBST(PBX_DYNAMIC_LIST)
  LDFLAGS=${old_LDFLAGS}
  rm -f conftest.dynamics
  



Home | Main Index | Thread Index | Old Index