pkgsrc-Changes archive

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

Re: CVS commit: pkgsrc/comms/asterisk16



On Tue, Aug 20, 2019 at 09:16:20PM +0000, Ryo ONODERA wrote:
> @@ -139,8 +139,11 @@ PLIST.mgcp=      yes
>  .endif
>  
>  PLIST_VARS+= unbound
> -.if exists(/usr/include/unbound.h)
> +# unbound 1.5 or later is required.`
> +.if exists(/usr/include/unbound.h) && !empty(OS_VERSION:M9.*)
>  PLIST.unbound=       yes
> +.else
> +CONFIGURE_ARGS+=     --without-unbound
>  .endif
>  
>  .include "options.mk"
> 

This seems like a hack.

How about the following builtin.mk
# $NetBSD: builtin.mk,v 1.2 2013/06/07 17:43:40 dholland Exp $

BUILTIN_PKG:=   unbound

.include "../../mk/bsd.fast.prefs.mk"

BUILTIN_FIND_HEADERS_VAR:=      H_UNBOUND
BUILTIN_FIND_HEADERS.H_UNBOUND= unbound.h

.include "../../mk/buildlink3/bsd.builtin.mk"

###
### Determine if there is a built-in implementation of the package and
### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
###
.if !defined(IS_BUILTIN.unbound)
.  if empty(H_UNBOUND:M__nonexistent__)
IS_BUILTIN.unbound=     yes
.  else
IS_BUILTIN.unbound=     no
.  endif
.endif
MAKEVARS+=      IS_BUILTIN.unbound

###
### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
### a package name to represent the built-in package.
###
.if !defined(BUILTIN_PKG.unbound) && \
    !empty(IS_BUILTIN.unbound:M[yY][eE][sS]) && \
    empty(H_UNBOUND:M__nonexistent__)
#
# Extract the version number from the header file
#
BUILTIN_VERSION.unbound!=                                               \
        ${AWK} '/\#define[      ]*UNBOUND_VERSION_MAJOR/ { M = $$3 }    \
                /\#define[      ]*UNBOUND_VERSION_MINOR/ { m = "."$$3 } \
                /\#define[      ]*UNBOUND_VERSION_MICOR/ { r = "."$$3 } \
                END { printf "%s%s%s\n", M, m, r }'                     \
                ${H_UNBOUND}
BUILTIN_PKG.unbound=    unbound-${BUILTIN_VERSION.unbound}
.endif
MAKEVARS+=      BUILTIN_PKG.unbound

###
### Determine whether we should use the built-in implementation if it
### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
###

.if !defined(USE_BUILTIN.unbound)
.  if ${PREFER.unbound} == "pkgsrc"
USE_BUILTIN.unbound=    no
.  else
USE_BUILTIN.unbound=    ${IS_BUILTIN.unbound}
.    if defined(BUILTIN_PKG.unbound) && \
        !empty(IS_BUILTIN.unbound:M[yY][eE][sS])
USE_BUILTIN.unbound=    yes
.      for _dep_ in ${BUILDLINK_API_DEPENDS.unbound}
.        if !empty(USE_BUILTIN.unbound:M[yY][eE][sS])
USE_BUILTIN.unbound!=                                                   \
        if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.unbound:Q}; then        \
                ${ECHO} yes;                                            \
        else                                                            \
                ${ECHO} no;                                             \
        fi
.        endif
.      endfor
.    endif
.  endif  # PREFER.unbound
.endif
MAKEVARS+=      USE_BUILTIN.unbound


Home | Main Index | Thread Index | Old Index