[packages/newt] - patched for TCL 9, builds, not tested

hawk hawk at pld-linux.org
Fri May 22 16:43:53 CEST 2026


commit a5e91bcdf65a547dc1c50c634bece9a3c89cab50
Author: Marcin Krol <hawk at tld-linux.org>
Date:   Thu May 21 20:53:27 2026 +0200

    - patched for TCL 9, builds, not tested

 newt.spec  |   4 +-
 tcl9.patch | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 142 insertions(+), 1 deletion(-)
---
diff --git a/newt.spec b/newt.spec
index 6d309f2..dfd442f 100644
--- a/newt.spec
+++ b/newt.spec
@@ -25,6 +25,7 @@ Source0:	https://releases.pagure.org/newt/%{name}-%{version}.tar.gz
 Patch0:		%{name}-0.51.6-if1close.patch
 Patch1:		%{name}-nopython.patch
 Patch2:		%{name}-make.patch
+Patch3:		tcl9.patch
 URL:		https://pagure.io/newt
 BuildRequires:	autoconf >= 2.50
 %if %{with doc}
@@ -40,7 +41,7 @@ BuildRequires:	popt-devel
 %{?with_python3:BuildRequires:	python3-modules >= 1:3.2}
 BuildRequires:	rpm-pythonprov
 BuildRequires:	slang-devel >= 2.0.0
-%{?with_tcl:BuildRequires:	tcl-devel >= 8.5}
+%{?with_tcl:BuildRequires:	tcl-devel >= 9.0}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -184,6 +185,7 @@ przyjazny.
 %patch -P 0 -p1
 %patch -P 1 -p1
 %patch -P 2 -p1
+%patch -P 3 -p1
 
 %build
 %{__autoconf}
diff --git a/tcl9.patch b/tcl9.patch
new file mode 100644
index 0000000..6f6b40b
--- /dev/null
+++ b/tcl9.patch
@@ -0,0 +1,139 @@
+--- newt-0.52.25/whiptcl.c.orig	2025-03-10 14:29:06.000000000 +0100
++++ newt-0.52.25/whiptcl.c	2026-05-21 20:50:23.363286571 +0200
+@@ -137,46 +137,44 @@
+     }
+     
+     if (arg < -1) {
+-	/* this could buffer oveflow, bug we're not setuid so I don't care */
+-	interp->result = malloc(200);
+-	interp->freeProc = TCL_DYNAMIC;
+-	sprintf(interp->result, "%s: %s\n", 
+-		poptBadOption(optCon, POPT_BADOPTION_NOALIAS), 
++	char buf[200];
++	snprintf(buf, sizeof(buf), "%s: %s\n",
++		poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
+ 		poptStrerror(arg));
+-
++	Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1));
+ 	return TCL_ERROR;
+     }
+ 
+     if (mode == MODE_NONE) {
+-	interp->result = "no dialog mode was specified";
++	Tcl_SetResult(interp, "no dialog mode was specified", TCL_STATIC);
+ 	return TCL_ERROR;
+     } else if (rc) {
+-	interp->result = "multiple modes were specified";
++	Tcl_SetResult(interp, "multiple modes were specified", TCL_STATIC);
+ 	return TCL_ERROR;
+     }
+ 
+     if (!(text = poptGetArg(optCon))) {
+-	interp->result = "missing text parameter";
++	Tcl_SetResult(interp, "missing text parameter", TCL_STATIC);
+ 	return TCL_ERROR;
+     }
+ 
+     if (!(nextArg = poptGetArg(optCon))) {
+-	interp->result = "height missing";
++	Tcl_SetResult(interp, "height missing", TCL_STATIC);
+ 	return TCL_ERROR;
+     }
+     height = strtoul(nextArg, &end, 10);
+     if (*end) {
+-	interp->result = "height is not a number";
++	Tcl_SetResult(interp, "height is not a number", TCL_STATIC);
+ 	return TCL_ERROR;
+     }
+ 
+     if (!(nextArg = poptGetArg(optCon))) {
+-	interp->result = "width missing";
++	Tcl_SetResult(interp, "width missing", TCL_STATIC);
+ 	return TCL_ERROR;
+     }
+     width = strtoul(nextArg, &end, 10);
+     if (*end) {
+-	interp->result = "width is not a number";
++	Tcl_SetResult(interp, "width is not a number", TCL_STATIC);
+ 	return TCL_ERROR;
+     }
+ 
+@@ -185,12 +183,12 @@
+       case MODE_RADIOLIST:
+       case MODE_CHECKLIST:
+ 	if (!(nextArg = poptGetArg(optCon))) {
+-	    interp->result = "list-height missing";
++	    Tcl_SetResult(interp, "list-height missing", TCL_STATIC);
+ 	    return TCL_ERROR;
+ 	}
+ 	listHeight = strtoul(nextArg, &end, 10);
+ 	if (*end) {
+-	    interp->result = "list-height is not a number";
++	    Tcl_SetResult(interp, "list-height is not a number", TCL_STATIC);
+ 	    return TCL_ERROR;
+ 	}
+ 	break;
+@@ -213,35 +211,31 @@
+       case MODE_YESNO:
+ 	rc = messageBox(text, height, width, MSGBOX_YESNO, flags);
+ 	if (rc == DLG_OKAY)
+-	    interp->result = "yes";
+-	else 
+-	    interp->result = "no";
++	    Tcl_SetResult(interp, "yes", TCL_STATIC);
++	else
++	    Tcl_SetResult(interp, "no", TCL_STATIC);
+ 	if (rc == DLG_ERROR) rc = 0;
+ 	break;
+ 
+       case MODE_INPUTBOX:
+ 	rc = inputBox(text, height, width, optCon, flags, &result);
+ 	if (rc ==DLG_OKAY) {
+-	    interp->result = result;
+-	    interp->freeProc = TCL_DYNAMIC;
++	    Tcl_SetResult(interp, result, TCL_DYNAMIC);
+ 	}
+ 	break;
+ 
+       case MODE_MENU:
+ 	rc = listBox(text, height, width, listHeight, optCon, flags, default_item,
+ 		     &result);
+-	if (rc==DLG_OKAY) {
+-	    interp->result = result;
+-	    interp->freeProc = TCL_DYNAMIC;
+-	}
++	if (rc==DLG_OKAY)
++	    Tcl_SetResult(interp, result, TCL_DYNAMIC);
+ 	break;
+ 
+       case MODE_RADIOLIST:
+ 	rc = checkList(text, height, width, listHeight, optCon, 1, flags,
+ 		       &selections);
+ 	if (rc==DLG_OKAY) {
+-	    interp->result = selections[0];
+-	    interp->freeProc = TCL_DYNAMIC;
++	    Tcl_SetResult(interp, selections[0], TCL_DYNAMIC);
+ 
+ 	    free(selections);
+ 	}
+@@ -267,7 +261,7 @@
+     newtPopWindow();
+ 
+     if (rc == DLG_ERROR) {
+-	interp->result = "bad paramter for whiptcl dialog box";
++	Tcl_SetResult(interp, "bad paramter for whiptcl dialog box", TCL_STATIC);
+ 	return TCL_ERROR;
+     } 
+ 
+@@ -312,10 +306,8 @@
+     int rc;
+     int state;
+     
+-    if ((rc = Tcl_ExprBoolean(interp, val, &state))) {
+-	Tcl_FreeResult(interp);
++    if ((rc = Tcl_ExprBoolean(interp, val, &state)))
+ 	return "whiptcl_fullbuttons may only contain a boolean value";
+-    }
+ 
+     useFullButtons(state);
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/newt.git/commitdiff/a5e91bcdf65a547dc1c50c634bece9a3c89cab50



More information about the pld-cvs-commit mailing list