git: ac99b5799499 - main - textproc/wordnet: fix build, address possible Tk-absence, pet `port test'

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Sun, 19 Oct 2025 08:05:19 UTC
The branch main has been updated by fuz:

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

commit ac99b5799499c082a517bdf58a7e75ac4423d911
Author:     Mikhail Teterin <mi@FreeBSD.org>
AuthorDate: 2025-09-01 22:29:23 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-10-19 08:03:25 +0000

    textproc/wordnet: fix build, address possible Tk-absence, pet `port test'
    
    PR:             256218
    MFH:            2025Q4
---
 textproc/wordnet/Makefile               | 10 +++++++---
 textproc/wordnet/files/src.wnb.Makefile |  5 ++---
 textproc/wordnet/scripts/configure      |  8 ++++++--
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/textproc/wordnet/Makefile b/textproc/wordnet/Makefile
index 3afeeb1d2478..8f338b15d636 100644
--- a/textproc/wordnet/Makefile
+++ b/textproc/wordnet/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	WordNet
 PORTVERSION=	3.0
-PORTREVISION=	6
+PORTREVISION=	7
 CATEGORIES=	textproc
 MASTER_SITES=	http://wordnetcode.princeton.edu/${PORTVERSION}/:code \
 		http://wordnetcode.princeton.edu/:dict
@@ -10,11 +10,15 @@ MAINTAINER=	ports@virtual-estates.net
 COMMENT=	Dictionaries and thesauri with devel. libraries (C, TCL) and browsers
 WWW=		https://wordnet.princeton.edu/
 
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
 EXTRACT_ONLY=	${DISTFILES:M*code:S/:code//}
 EXTRACT_AFTER_ARGS=--exclude dict
 USES=		tcl uidfix tar:bzip2
 SCRIPTS_ENV+=	TCL_DVER=${TCL_VER} VER=${PORTVERSION}
 MAKE_ENV+=	TCL_DVER=${TCL_VER} VER=${PORTVERSION} STAGEDIR="${STAGEDIR}"
+MAKE_ENV+=	LOCALBASE="${LOCALBASE}" TCL_INCLUDEDIR="${TCL_INCLUDEDIR}"
 PLIST_SUB+=	TCL_DVER=${TCL_VER} VER=${PORTVERSION}
 REINPLACE_ARGS=	-i ""
 USE_LDCONFIG=	yes
@@ -22,7 +26,7 @@ SUB_FILES=	pkg-message
 SUB_LIST+=	TCL_VER=${TCL_VER}
 
 # Fix build on recent current
-CFLAGS+=	-fcommon
+CFLAGS+=	-fcommon -Wno-parentheses
 
 post-patch:
 	${REINPLACE_CMD} -e 's,/usr/local,${PREFIX},g' \
@@ -33,7 +37,7 @@ post-install:
 	${MKDIR} ${STAGEDIR}${DATADIR}
 	${TAR} -C ${STAGEDIR}${DATADIR} -x --no-same-owner	\
 	    --strip-components 1	\
-	    -f ${_DISTDIR}${DISTFILES:M*dict:S/:dict//}	\
+	    -f ${_DISTDIR}/${DISTFILES:M*dict:S/:dict//}	\
 	    `${SED} -n -e '/\.xbm/d' -e 's,^%%DATADIR%%/,dict/,p' ${PLIST}`
 
 .include <bsd.port.mk>
diff --git a/textproc/wordnet/files/src.wnb.Makefile b/textproc/wordnet/files/src.wnb.Makefile
index 63998a4d0456..df28cd2f4f70 100644
--- a/textproc/wordnet/files/src.wnb.Makefile
+++ b/textproc/wordnet/files/src.wnb.Makefile
@@ -1,14 +1,13 @@
 PREFIX?=	/usr/local
 TCL_DVER?=	8.4
 TCL_VER=	${TCL_DVER:S/.//g}
-TCL_INCDIR?=	${PREFIX}/include/tcl${TCL_DVER}
 
 CFLAGS+=	-DUNIX -DDEFAULTPATH="\"${PREFIX}/share/WordNet\"" \
 		-DDEFAULTBIN="\"${PREFIX}/bin\"" -DHAVE_LANGINFO_CODESET
 
-CFLAGS+=	-I${.CURDIR}/../../include -I$(TCL_INCDIR)
+CFLAGS+=	-I${.CURDIR}/../../include -I${TCL_INCLUDEDIR}
 
-LDADD=		-L.. -lWN -L${PREFIX}/lib -ltcl${TCL_VER} # -ltk${TCL_VER}
+LDADD=		-L.. -lWN -L${LOCALBASE}/lib -ltcl${TCL_VER} # -ltk${TCL_VER}
 
 SHLIB_NAME=	libtclwn2.so.0
 SRCS=		stubs.c
diff --git a/textproc/wordnet/scripts/configure b/textproc/wordnet/scripts/configure
index 027ae612d290..bc7a5198a6cb 100644
--- a/textproc/wordnet/scripts/configure
+++ b/textproc/wordnet/scripts/configure
@@ -25,14 +25,18 @@ patch -d ${WRKSRC}/src -p0 << EOPATCH
 Configuring the wnb script to call the right wish-binary directly
 --- wnb	Sun Feb 22 12:49:56 1998
 +++ wnb	Sat Feb 26 17:41:06 2000
-@@ -1,6 +1,3 @@
+@@ -1,6 +1,7 @@
 -#!/bin/sh 
 -# the following line is evaluated by sh but ignored by tcl \\
 -wishwn "\$0" "\$@" &
 -# the following line is evaluated by sh but ignored by tcl \\
 -exec true
 -# the preceding lines make this script self-executing on unix systems
-+#!${PREFIX}/bin/wish${TCL_DVER}
++#!${PREFIX}/bin/tclsh${TCL_DVER}
 +
++if {[catch {package require Tk} e]} {
++	puts stderr "The x11-toolkits/tk${TCL_DVER} must be installed for wnb to work"
++	exit 1
++}
 +package require Wordnet
 EOPATCH