git: 67309bed775a - main - devel/ptlib: Unbreak on HEAD

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sun, 30 Apr 2023 18:35:56 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=67309bed775ac0d512a81737abab104948825542

commit 67309bed775ac0d512a81737abab104948825542
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-04-30 18:14:09 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-04-30 18:33:30 +0000

    devel/ptlib: Unbreak on HEAD
    
    - Convert to OPTIONSNG
    - Pet portclippy
    
    Approved by:    portmgr (blanket)
---
 devel/ptlib/Makefile | 148 ++++++++++++++++-----------------------------------
 1 file changed, 47 insertions(+), 101 deletions(-)

diff --git a/devel/ptlib/Makefile b/devel/ptlib/Makefile
index 63d38fb9a98c..e79dd4a71cfb 100644
--- a/devel/ptlib/Makefile
+++ b/devel/ptlib/Makefile
@@ -12,110 +12,71 @@ LICENSE=	MPL10
 
 LIB_DEPENDS=	libexpat.so:textproc/expat2
 
-CONFLICTS=	pwlib-1.*
-
 USES=		autoreconf:build bison:wrapper compiler:c11 gmake localbase:ldflags \
 		pathfix pkgconfig ssl tar:xz
-GNU_CONFIGURE=	yes
 USE_LDCONFIG=	yes
-CPPFLAGS+=	-I${OPENSSLINC}
-LDFLAGS+=	-L${OPENSSLLIB}
 
-CONFIGURE_ARGS+=--enable-audio \
+GNU_CONFIGURE=	yes
+CONFIGURE_ARGS=--disable-lua \
+		--disable-sasl \
+		--enable-audio \
 		--enable-ipv6 \
 		--enable-exceptions \
 		--enable-oss \
 		--enable-plugins
-
-CONFIGURE_ARGS+=--disable-lua \
-		--disable-sasl
-
 # --with-expat-dir="${LOCALBASE}"
-CONFIGURE_ENV+=	OPENSSL_CFLAGS="-I${OPENSSLINC}" \
+CONFIGURE_ENV=	OPENSSL_CFLAGS="-I${OPENSSLINC}" \
 		OPENSSL_LIBS="-L${OPENSSLLIB} -lssl"
 
-OPTIONS_DEFINE=	DEBUG ODBC ALSA JABBER V4L SDL LDAP PULSEAUDIO
-OPTIONS_DEFAULT=SDL V4L JABBER
-
-BSDVIDEO_DESC=	BSD video support
-DEBUG_DESC=	Install debug library
-
-.include <bsd.port.options.mk>
+ALL_TARGET=	optshared
 
-.if (${OPSYS} == FreeBSD && ${OSVERSION} < 1300082)
-OPTIONS_DEFINE+=	BSDVIDEO
-OPTIONS_DEFAULT+=	BSDVIDEO
-.endif
+CPPFLAGS+=	-I${OPENSSLINC}
+LDFLAGS+=	-L${OPENSSLLIB}
 
-.if (${OPSYS} == FreeBSD && ${SSL_DEFAULT} == base) || ${SSL_DEFAULT} == openssl
-EXTRA_PATCHES+= ${FILESDIR}/extra-patch-src_ptclib_pssl.cxx-openssl111
-.else
-EXTRA_PATCHES+= ${FILESDIR}/extra-patch-src_ptclib_pssl.cxx
-.endif
+CONFLICTS=	pwlib-1.*
 
 PLIST_SUB+=	PORTVERSION=${PORTVERSION} \
 		PVERSION_MAJOR=${PVERSION_MAJOR} \
 		PVERSION_MINOR=${PVERSION_MINOR}
 
-PVERSION_MAJOR=	${PORTVERSION:C/.[0-9]+.[0-9]+.//}
-PVERSION_MINOR=	${PORTVERSION:C/.[0-9]+$//g}
+OPTIONS_DEFINE=	DEBUG BSDVIDEO ODBC ALSA JABBER V4L SDL LDAP PULSEAUDIO
+OPTIONS_DEFAULT=BSDVIDEO SDL V4L JABBER
+OPTIONS_EXCLUDE_FreeBSD_13=	BSDVIDEO
+OPTIONS_EXCLUDE_FreeBSD_14=	BSDVIDEO
+OPTIONS_SUB=	yes
 
-.if ${PORT_OPTIONS:MDEBUG}
-ALL_TARGET=	optshared debugshared
-PLIST_SUB+=	DEBUG=""
-.else
-ALL_TARGET=	optshared
-PLIST_SUB+=	DEBUG="@comment "
-.endif
-
-.if ${PORT_OPTIONS:MPULSEAUDIO}
-LIB_DEPENDS+=	libpulse.so:audio/pulseaudio
-CONFIGURE_ARGS+=--enable-pulse
-PLIST_SUB+=	PULSEAUDIO=""
-.else
-CONFIGURE_ARGS+=--disable-pulse
-PLIST_SUB+=	PULSEAUDIO="@comment "
-.endif
+BSDVIDEO_DESC=	BSD video support
 
-.if ${PORT_OPTIONS:MJABBER}
-CONFIGURE_ARGS+=--enable-jabber
-PLLIB_VIDEO=1
-.endif
+ALSA_LIB_DEPENDS=	libasound.so:audio/alsa-lib
+ALSA_CONFIGURE_ENABLE=alsa
+BSDVIDEO_CONFIGURE_ENABLE=bsdvideo
+BSDVIDEO_VARS=	PTLIB_VIDEO=1
+DEBUG_ALL_TARGET=	debugshared
+JABBER_CONFIGURE_ON=--enable-jabber
+JABBER_VARS=	PLLIB_VIDEO=1
+LDAP_USES=	ldap
+LDAP_CONFIGURE_ENABLE=openldap
+ODBC_LIB_DEPENDS=	libodbc.so:databases/unixODBC
+ODBC_CONFIGURE_ENABLE=	odbc
+PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
+PULSEAUDIO_CONFIGURE_ENABLE=pulse
+SDL_USES=		sdl
+SDL_USE=	SDL=sdl
+SDL_CONFIGURE_ENABLE=sdl
+V4L_BUILD_DEPENDS=	v4l_compat>=0:multimedia/v4l_compat
+V4L_LIB_DEPENDS=	libv4l2.so:multimedia/libv4l
+V4L_CONFIGURE_ENABLE=	v4l v4l2
+V4L_VARS=	PTLIB_VIDEO=1
 
-.if ${PORT_OPTIONS:MODBC}
-LIB_DEPENDS+=	libodbc.so:databases/unixODBC
-CONFIGURE_ARGS+=--enable-odbc
-.else
-CONFIGURE_ARGS+=--disable-odbc
-.endif
-
-.if ${PORT_OPTIONS:MALSA}
-LIB_DEPENDS+=	libasound.so:audio/alsa-lib
-CONFIGURE_ARGS+=--enable-alsa
-PLIST_SUB+=	ALSA=""
-.else
-CONFIGURE_ARGS+=--disable-alsa
-PLIST_SUB+=	ALSA="@comment "
-.endif
+PVERSION_MAJOR=	${PORTVERSION:C/.[0-9]+.[0-9]+.//}
+PVERSION_MINOR=	${PORTVERSION:C/.[0-9]+$//g}
 
-.if ${PORT_OPTIONS:MBSDVIDEO}
-CONFIGURE_ARGS+=--enable-bsdvideo
-PLIST_SUB+=	BSDVIDEO=""
-PTLIB_VIDEO=1
-.else
-CONFIGURE_ARGS+=--disable-bsdvideo
-PLIST_SUB+=	BSDVIDEO="@comment "
-.endif
+.include <bsd.port.options.mk>
 
-.if ${PORT_OPTIONS:MV4L}
-BUILD_DEPENDS+=	v4l_compat>=0:multimedia/v4l_compat
-LIB_DEPENDS+=	libv4l2.so:multimedia/libv4l
-CONFIGURE_ARGS+=--enable-v4l --enable-v4l2
-PLIST_SUB+=	V4L=""
-PTLIB_VIDEO=1
+.if (${OPSYS} == FreeBSD && ${SSL_DEFAULT} == base) || ${SSL_DEFAULT} == openssl
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-src_ptclib_pssl.cxx-openssl111
 .else
-CONFIGURE_ARGS+=--disable-v4l --disable-v4l2
-PLIST_SUB+=	V4L="@comment "
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-src_ptclib_pssl.cxx
 .endif
 
 .if defined(PTLIB_VIDEO)
@@ -126,21 +87,6 @@ CONFIGURE_ARGS+=--disable-video --disable-vidfile
 PLIST_SUB+=	VIDEODIR="@comment "
 .endif
 
-.if ${PORT_OPTIONS:MSDL}
-USES+=		sdl
-USE_SDL+=	sdl
-CONFIGURE_ARGS+=--enable-sdl
-.else
-CONFIGURE_ARGS+=--disable-sdl
-.endif
-
-.if ${PORT_OPTIONS:MLDAP}
-USES+=	ldap
-CONFIGURE_ARGS+=--enable-openldap
-.else
-CONFIGURE_ARGS+=--disable-openldap
-.endif
-
 # ONLY FOR THE BRAVE!
 # If someone owns a firewire(4) video device and wants to use it for
 # video-conferencing purposes, please download the files:
@@ -172,19 +118,19 @@ CONFIGURE_ARGS+=	--disable-dc
 post-patch:
 	@${REINPLACE_CMD} -e 's/RTF_WASCLONED/0x20000/' ${WRKSRC}/src/ptlib/unix/socket.cxx
 
-pre-configure:
-	(cd ${WRKSRC}/plugins/ && ${AUTORECONF} -fi)
+#pre-configure:
+#	(cd ${WRKSRC}/plugins/ && ${AUTORECONF} -fi)
 
 post-install:
 	${LN} -sf libpt.so.${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/libpt.so.${PVERSION_MAJOR}
 	${LN} -sf libpt.so.${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/libpt.so.${PVERSION_MINOR}
-.if ${PORT_OPTIONS:MDEBUG}
-	${LN} -sf libpt_d.so.${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/libpt_d.so.${PVERSION_MAJOR}
-	${LN} -sf libpt_d.so.${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/libpt_d.so.${PVERSION_MINOR}
-.endif
 	@${CHMOD} 0755 ${STAGEDIR}${PREFIX}/lib/libpt.so.${PORTVERSION} \
 		${STAGEDIR}${PREFIX}/lib/ptlib-${PORTVERSION}/devices/*/*.so
 	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libpt.so.${PORTVERSION}
 	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/ptlib-${PORTVERSION}/devices/*/*.so
 
+post-install-DEBUG-on:
+	${LN} -sf libpt_d.so.${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/libpt_d.so.${PVERSION_MAJOR}
+	${LN} -sf libpt_d.so.${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/libpt_d.so.${PVERSION_MINOR}
+
 .include <bsd.port.mk>