Index | Thread | Search

From:
Stuart Cassoff <exokoide@yahoo.ca>
Subject:
Re: [llvm22] update x11/tkhtml to Alpha17 and fix build
To:
Stuart Henderson <stu@spacehopper.org>
Cc:
Matthieu Herrb <matthieu@openbsd.org>, ports@openbsd.org
Date:
Tue, 16 Jun 2026 08:33:03 -0400

Download raw body.

Thread
On Tue, 16 Jun 2026, Stuart Henderson wrote:

> On 2026/06/08 22:57, Matthieu Herrb wrote:
> > +SITES =		https://github.com/Geballin/tkhtml3/archive/
> ..
> > +WRKDIST =		${WRKDIR}/tkhtml3-${DISTNAME}
> 
> these should use GH_* instead, it also gives a better filename for the
> downloaded file. replacement Makefile/distinfo diffs below with thia
> and a few other small tweaks
> 
[snip]


Putting everything thogether,
plus whitespace and consistency tweaks.

Thanks for help,


Stu



Update to a17.
MODTK_VERSION=8.6
Tcllib and combobox.tcl are needed for "hv".
Take maintainer.



diff -Nurp /usr/ports/x11/tkhtml/Makefile ./Makefile
--- /usr/ports/x11/tkhtml/Makefile	Wed May 20 04:57:04 2026
+++ ./Makefile	Tue Jun 16 08:21:20 2026
@@ -1,24 +1,34 @@
 COMMENT =	Tk widget to display HTML/CSS formatted contents
 
-REVISION =	2
-DISTNAME =	tkhtml3-alpha-16
-PKGNAME =	${DISTNAME:S/3-alpha-/-3a/}
+V =		17
+GH_ACCOUNT =	Geballin
+GH_PROJECT =	tkhtml3
+GH_TAGNAME =	Alpha-$V
+PKGNAME =	tkhtml-3a$V
+
 CATEGORIES =	x11
-HOMEPAGE = 	http://tkhtml.tcl.tk/
-SITES =		${HOMEPAGE}
+HOMEPAGE = 	https://github.com/Geballin/tkhtml3/
+MAINTAINER =	Stuart Cassoff <stwo@users.sourceforge.net>
 
 # BSD
-PERMIT_PACKAGE =		Yes
+PERMIT_PACKAGE =	Yes
 
+WANTLIB +=		X11
+
 MODULES =		x11/tk
+MODTK_VERSION =		8.6
 BUILD_DEPENDS =		${MODTK_BUILD_DEPENDS}
-RUN_DEPENDS =		${MODTK_RUN_DEPENDS}
-WANTLIB +=		X11
 
-WRKDIST =		${WRKDIR}/htmlwidget
-USE_GMAKE =		Yes
+RUN_DEPENDS =		${MODTK_RUN_DEPENDS} \
+			devel/tcllib
+
+FAKE_FLAGS =		PKG_DIR=tkhtml \
+			INSTALL_PROGRAM='$$(INSTALL_DATA)'
+
 SEPARATE_BUILD =	Yes
+USE_GMAKE =		Yes
 CONFIGURE_STYLE =	gnu
+
 CONFIGURE_ARGS =	--libdir=${MODTCL_TCLDIR} \
 			--with-tcl=${MODTCL_LIBDIR} \
 			--with-tclinclude=${MODTCL_INCDIR} \
@@ -26,11 +36,14 @@ CONFIGURE_ARGS =	--libdir=${MODTCL_TCLDIR} \
 			--with-tkinclude=${MODTK_INCDIR} \
 			--datadir=${PREFIX}/share/examples
 
-FAKE_FLAGS =		PKG_DIR=tkhtml INSTALL_PROGRAM='$$(INSTALL_DATA)'
-TEST_TARGET =	test
-TEST_IS_INTERACTIVE = X11
-SUBST_VARS =	VER
+TEST_TARGET =		test
+TEST_IS_INTERACTIVE =	X11
 
-VER =		30
+SUBST_VARS =		VER
+VER =			30
+
+post-install:
+	${INSTALL_DATA} ${WRKSRC}/hv/combobox.tcl \
+	    ${DESTDIR}${MODTCL_TCLDIR}/tkhtml/
 
 .include <bsd.port.mk>
diff -Nurp /usr/ports/x11/tkhtml/distinfo ./distinfo
--- /usr/ports/x11/tkhtml/distinfo	Sat Jan 17 22:16:02 2015
+++ ./distinfo	Tue Jun 16 05:39:54 2026
@@ -1,2 +1,2 @@
-SHA256 (tkhtml3-alpha-16.tar.gz) = 1d8FxT7TIFZbxB5mUFVN+lhU+zfRhgCxEDF+qoJVY6g=
-SIZE (tkhtml3-alpha-16.tar.gz) = 838580
+SHA256 (tkhtml3-Alpha-17.tar.gz) = 0t0knDQwb2hl7iVwlWByw2ghIs/FNqxVlc6l3v+aAKA=
+SIZE (tkhtml3-Alpha-17.tar.gz) = 1238570
diff -Nurp /usr/ports/x11/tkhtml/patches/patch-configure ./patches/patch-configure
--- /usr/ports/x11/tkhtml/patches/patch-configure	Fri Mar 11 15:17:28 2022
+++ ./patches/patch-configure	Mon Jun 15 09:17:10 2026
@@ -1,7 +1,7 @@
 Index: configure
 --- configure.orig
 +++ configure
-@@ -9545,7 +9545,7 @@ echo "${ECHO_T}$tcl_cv_ld_elf" >&6
+@@ -9579,7 +9579,7 @@ echo "${ECHO_T}$tcl_cv_ld_elf" >&6
  	    DL_LIBS=""
  	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
diff -Nurp /usr/ports/x11/tkhtml/patches/patch-src_htmlprop_c ./patches/patch-src_htmlprop_c
--- /usr/ports/x11/tkhtml/patches/patch-src_htmlprop_c	Wed Dec 31 19:00:00 1969
+++ ./patches/patch-src_htmlprop_c	Tue Jun 16 06:43:16 2026
@@ -0,0 +1,23 @@
+Fix build with llvm22
+
+Index: src/htmlprop.c
+--- src/htmlprop.c.orig
++++ src/htmlprop.c
+@@ -1232,7 +1232,7 @@ propertyValuesSetColor(p, pCVar, pProp)
+     HtmlTree *pTree = p->pTree;
+ 
+     if (pProp->eType == CSS_CONST_INHERIT) {
+-        HtmlColor **pInherit = (HtmlColor **)getInheritPointer(p, pCVar);
++        HtmlColor **pInherit = (HtmlColor **)getInheritPointer(p, (unsigned char *)pCVar);
+         assert(pInherit);
+         cVal = *pInherit;
+         goto setcolor_out;
+@@ -1757,7 +1757,7 @@ propertyValuesSetSize(p, pIVal, p_mask, pProp, allow_m
+         case CSS_CONST_INHERIT:
+             if (allow_mask & SZ_INHERIT) {
+                 HtmlNode *pParent = p->pParent;
+-                int *pInherit = (int *)getInheritPointer(p, pIVal);
++                int *pInherit = (int *)getInheritPointer(p, (unsigned char *)pIVal);
+                 assert(pInherit);
+                 assert(pParent);
+ 
diff -Nurp /usr/ports/x11/tkhtml/patches/patch-src_htmltable_c ./patches/patch-src_htmltable_c
--- /usr/ports/x11/tkhtml/patches/patch-src_htmltable_c	Wed Dec 31 19:00:00 1969
+++ ./patches/patch-src_htmltable_c	Mon Jun 15 09:17:10 2026
@@ -0,0 +1,23 @@
+Fix build with llvm22
+
+Index: src/htmltable.c
+--- src/htmltable.c.orig
++++ src/htmltable.c
+@@ -1206,7 +1206,7 @@ rowGroupIterate(pTree, pNode, p)
+             sRow.node.iNode = -1;
+             sRow.nChild = jj - ii;
+             sRow.apChildren = &((HtmlElementNode *)pNode)->apChildren[ii];
+-            rowIterate(pTree, &sRow, p);
++            rowIterate(pTree, (HtmlNode *)&sRow, p);
+             assert(!sRow.pLayoutCache);
+             ii = jj - 1;
+         }
+@@ -1331,7 +1331,7 @@ tableIterate(pTree, pNode, xCallback, xRowCallback, pC
+             sRowGroup.node.iNode = -1;
+             sRowGroup.nChild = jj - ii;
+             sRowGroup.apChildren = &((HtmlElementNode *)pNode)->apChildren[ii];
+-            rowGroupIterate(pTree, &sRowGroup, &sRowContext);
++            rowGroupIterate(pTree, (HtmlNode *)&sRowGroup, &sRowContext);
+             assert(!sRowGroup.pLayoutCache);
+             ii = jj - 1;
+         }
diff -Nurp /usr/ports/x11/tkhtml/patches/patch-src_htmltcl_c ./patches/patch-src_htmltcl_c
--- /usr/ports/x11/tkhtml/patches/patch-src_htmltcl_c	Fri Mar 11 15:17:28 2022
+++ ./patches/patch-src_htmltcl_c	Mon Jun 15 09:17:10 2026
@@ -1,10 +1,11 @@
 fix implicit declaration compilation warning
 
---- src/htmltcl.c.orig	Sun Dec 12 10:19:53 2010
-+++ src/htmltcl.c	Sun Dec 12 10:20:10 2010
-@@ -41,6 +41,7 @@ static char const rcsid[] = "@(#) $Id: htmltcl.c,v 1.1
- #include <assert.h>
+Index: src/htmltcl.c
+--- src/htmltcl.c.orig
++++ src/htmltcl.c
+@@ -42,6 +42,7 @@ static char const rcsid[] = "@(#) $Id: htmltcl.c,v 1.2
  #include "html.h"
+ #include "restrack.h"
  #include "swproc.h"
 +#include "restrack.h"
  
diff -Nurp /usr/ports/x11/tkhtml/patches/patch-src_htmltree_c ./patches/patch-src_htmltree_c
--- /usr/ports/x11/tkhtml/patches/patch-src_htmltree_c	Wed Dec 31 19:00:00 1969
+++ ./patches/patch-src_htmltree_c	Tue Jun 16 07:00:52 2026
@@ -0,0 +1,45 @@
+Fix build with llvm22
+
+Index: src/htmltree.c
+--- src/htmltree.c.orig
++++ src/htmltree.c
+@@ -3169,7 +3169,7 @@ fragmentAddElement(pTree, eType, zType, pAttributes, i
+             return;
+     }
+ 
+-    implicitCloseCount(pTree, pFragment->pCurrent, eType, &nClose);
++    implicitCloseCount(pTree, (HtmlNode *)pFragment->pCurrent, eType, &nClose);
+     for (ii = 0; ii < nClose; ii++) {
+         HtmlNode *pC = &pFragment->pCurrent->node;
+         HtmlNode *pParentC = HtmlNodeParent(pC);
+@@ -3199,7 +3199,7 @@ fragmentAddElement(pTree, eType, zType, pAttributes, i
+     pFragment->pCurrent = pElem;
+ 
+     if (HtmlMarkup(eType)->flags & HTMLTAG_EMPTY) {
+-        nodeHandlerCallbacks(pTree, pFragment->pCurrent);
++        nodeHandlerCallbacks(pTree, (HtmlNode *)pFragment->pCurrent);
+         pFragment->pCurrent = (HtmlElementNode *)HtmlNodeParent(pElem);
+     }
+     if (!pFragment->pCurrent) {
+@@ -3217,10 +3217,10 @@ fragmentAddClosingTag(pTree, eType, zType, iOffset)
+     int nClose;
+     int ii;
+     HtmlFragmentContext *p = pTree->pFragment;
+-    explicitCloseCount(p->pCurrent, eType, zType, &nClose);
++    explicitCloseCount((HtmlNode *)p->pCurrent, eType, zType, &nClose);
+     for (ii = 0; ii < nClose; ii++) {
+         assert(p->pCurrent);
+-        nodeHandlerCallbacks(pTree, p->pCurrent);
++        nodeHandlerCallbacks(pTree, (HtmlNode *)p->pCurrent);
+         p->pCurrent = (HtmlElementNode *)HtmlNodeParent(p->pCurrent);
+     }
+     if (!p->pCurrent) {
+@@ -3247,7 +3247,7 @@ HtmlParseFragment(pTree, zHtml)
+ 
+     while (sContext.pCurrent) {
+         HtmlNode *pParent = HtmlNodeParent(sContext.pCurrent); 
+-        nodeHandlerCallbacks(pTree, sContext.pCurrent);
++        nodeHandlerCallbacks(pTree, (HtmlNode *)sContext.pCurrent);
+         sContext.pCurrent = (HtmlElementNode *)pParent;
+     }
+ 
diff -Nurp /usr/ports/x11/tkhtml/pkg/PLIST ./pkg/PLIST
--- /usr/ports/x11/tkhtml/pkg/PLIST	Fri Mar 11 15:17:28 2022
+++ ./pkg/PLIST	Tue Jun 16 07:14:13 2026
@@ -1,4 +1,6 @@
 lib/tcl/tkhtml/
-lib/tcl/tkhtml/libTkhtml${VER}.so
+lib/tcl/tkhtml/combobox.tcl
+lib/tcl/tkhtml/hv3-0.1.tm
+@so lib/tcl/tkhtml/libTkhtml${VER}.so
 lib/tcl/tkhtml/pkgIndex.tcl
 @man man/mann/tkhtml.n