pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/x11/blt Patch up x11/blt some.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/037f35644494
branches:  trunk
changeset: 380395:037f35644494
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Mon Jun 06 04:27:14 2022 +0000

description:
Patch up x11/blt some.

Most importantly, fix up what it passes to the TCL package handling
functions, since as it was the library won't initialize. I can't
remember when this changed in TCL but I've seen the same issue
before... years ago. This library has likely been inoperable all that
time.

Patch up a whole bunch of build warnings, some significant.

However, it probably still doesn't work and in addition to a lot more
routine build issues it needs attention from someone who knows more
tcl than me.

Bump PKGREVISION (to 13). I'm not going to bump the handful of
dependent packages since I don't think I've done anything to change
the interface, plus they're all likely inoperable anyway given how
broken this thing looks.

Prerequisite for checking PR 32807 for currency, since it depends on
blt and blt won't load. But I rather imagine the problem seen at the
time was blt dumping core.

diffstat:

 x11/blt/Makefile                         |   6 +-
 x11/blt/distinfo                         |  20 +++++-
 x11/blt/patches/patch-ae                 |   8 +-
 x11/blt/patches/patch-src_bltArrayObj.c  |  15 +++++
 x11/blt/patches/patch-src_bltBgexec.c    |  94 ++++++++++++++++++++++++++++++++
 x11/blt/patches/patch-src_bltConfig.c    |  15 +++++
 x11/blt/patches/patch-src_bltInit.c      |  53 ++++++++++++++++++
 x11/blt/patches/patch-src_bltList.c      |  24 ++++++++
 x11/blt/patches/patch-src_bltList.h      |  22 +++++++
 x11/blt/patches/patch-src_bltNsUtil.h    |  26 ++++++++-
 x11/blt/patches/patch-src_bltObjConfig.c |  15 +++++
 x11/blt/patches/patch-src_bltScrollbar.c |  35 +++++++++++
 x11/blt/patches/patch-src_bltSwitch.c    |  15 +++++
 x11/blt/patches/patch-src_bltTable.c     |  51 +++++++++++++++++
 x11/blt/patches/patch-src_bltTree.c      |  70 +++++++++++++++++++++++
 x11/blt/patches/patch-src_bltTreeCmd.c   |  54 ++++++++++++++++++
 x11/blt/patches/patch-src_bltUnixPipe.c  |  16 +++++
 x11/blt/patches/patch-src_bltVecObjCmd.c |  15 +++++
 18 files changed, 543 insertions(+), 11 deletions(-)

diffs (truncated from 676 to 300 lines):

diff -r 413c597db298 -r 037f35644494 x11/blt/Makefile
--- a/x11/blt/Makefile  Mon Jun 06 01:24:11 2022 +0000
+++ b/x11/blt/Makefile  Mon Jun 06 04:27:14 2022 +0000
@@ -1,13 +1,13 @@
-# $NetBSD: Makefile,v 1.37 2022/01/01 15:21:14 wiz Exp $
+# $NetBSD: Makefile,v 1.38 2022/06/06 04:27:14 dholland Exp $
 
 DISTNAME=      BLT2.4z
 PKGNAME=       blt-2.4z
-PKGREVISION=   12
+PKGREVISION=   13
 CATEGORIES=    x11
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=blt/}
 
+PATCH_SITES=           ${MASTER_SITES}
 PATCHFILES=            blt2.4z-patch-2
-PATCH_SITES=           ${MASTER_SITES}
 PATCH_DIST_STRIP=      -p1
 
 MAINTAINER=    brook%nmsu.edu@localhost
diff -r 413c597db298 -r 037f35644494 x11/blt/distinfo
--- a/x11/blt/distinfo  Mon Jun 06 01:24:11 2022 +0000
+++ b/x11/blt/distinfo  Mon Jun 06 04:27:14 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.18 2022/01/01 15:21:14 wiz Exp $
+$NetBSD: distinfo,v 1.19 2022/06/06 04:27:14 dholland Exp $
 
 BLAKE2s (BLT2.4z.tar.gz) = 21ffc805b1d2d90331a5a6ca37ae63bb09b7a79104fb579196e8f000646756c4
 SHA512 (BLT2.4z.tar.gz) = 6e59cc03c92b452ec3114675124c2095ed4206e7b9750452764f2b21b8c82dfc376a376f0fbc721c5d0e4b56734866cdc653f3d9888a5b36b0a7500da5f8942a
@@ -10,7 +10,21 @@
 SHA1 (patch-ab) = da9479d5de1053c45753eef611eae2764909f0ec
 SHA1 (patch-ac) = 696f90010831522f46d67052abc0c6068197cfd9
 SHA1 (patch-ad) = cc2579223a5a8a764d797fa16a146999cd4a796d
-SHA1 (patch-ae) = 279b10615ec55c4e403b9d998b4b3904c01173c0
+SHA1 (patch-ae) = c1c2dc9f319f9e0da7af42f2b5d24639b1b5afdf
 SHA1 (patch-af) = b82641d4aad426fbe9a6781fa828d8aa81f71253
-SHA1 (patch-src_bltNsUtil.h) = 949647e6ca4a4890a51917c268289384da98b7ca
+SHA1 (patch-src_bltArrayObj.c) = 1f6d86f7be49f72b06bf053d5321608c9efa3410
+SHA1 (patch-src_bltBgexec.c) = ba01243277c4272d6a86ca2b85e167f40beb93e8
+SHA1 (patch-src_bltConfig.c) = 573942b97bbb8b607651c80e46c04314ba57c9f7
+SHA1 (patch-src_bltInit.c) = a85c7bcdb6a6eb7b5844f1770eefd10aea2d60ca
+SHA1 (patch-src_bltList.c) = e5280bdcc7b90d55923467c828d1ff3bd8669460
+SHA1 (patch-src_bltList.h) = fe0f21675b9504b16958526bb3f78d2d930501d9
+SHA1 (patch-src_bltNsUtil.h) = 31b62c5e12486195cfb2eea74bd1304acedaa342
+SHA1 (patch-src_bltObjConfig.c) = b4fabf9e9439a9f2ee24623f07e2ac72f0d0d4b2
+SHA1 (patch-src_bltScrollbar.c) = 66e2736a5dd7fc4bd7be4176f35a6a2208ace53e
+SHA1 (patch-src_bltSwitch.c) = 18962bb1dc3aa14d7c5fa773eb05908ec1638332
+SHA1 (patch-src_bltTable.c) = 7a2561eaf23378ea3aee6c6b81a1d5786f0b8659
+SHA1 (patch-src_bltTree.c) = 1402687b1496d82a6b9b6602926cb023285b9a96
+SHA1 (patch-src_bltTreeCmd.c) = 6ae6ad1f239c632d42607e7a23fb31d15281ff9a
+SHA1 (patch-src_bltUnixPipe.c) = 6311e9c17e6327b96fd3dd507f47aebe9b26dcef
+SHA1 (patch-src_bltVecObjCmd.c) = d7c63f88cba0d7dbd5691d9df5a6e2e84692f300
 SHA1 (patch-src_tkButton.c) = 39132933914ee8d52389f5be72cbc02b21e7216e
diff -r 413c597db298 -r 037f35644494 x11/blt/patches/patch-ae
--- a/x11/blt/patches/patch-ae  Mon Jun 06 01:24:11 2022 +0000
+++ b/x11/blt/patches/patch-ae  Mon Jun 06 04:27:14 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-ae,v 1.8 2022/01/01 15:21:14 wiz Exp $
+$NetBSD: patch-ae,v 1.9 2022/06/06 04:27:14 dholland Exp $
 
 --- configure.orig     2002-10-04 05:33:59.000000000 +0000
 +++ configure
@@ -13,7 +13,7 @@
      ;;
  esac
  
-@@ -4072,7 +4071,8 @@ fi
+@@ -4072,7 +4072,8 @@ fi
      EXTRA_LIB_SPECS="-ldl"
      ;;
  
@@ -23,7 +23,7 @@
      # Not available on all versions:  check for include file.
      ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
-@@ -4109,9 +4109,10 @@ test_ok=no
+@@ -4109,9 +4110,10 @@ test_ok=no
  fi
  
      if test "$test_ok" = yes; then
@@ -35,7 +35,7 @@
      fi
      ;;
  
-@@ -4181,9 +4182,9 @@ fi
+@@ -4181,9 +4183,9 @@ fi
    *-solaris2*)
  
      SHLIB_CFLAGS="-KPIC"
diff -r 413c597db298 -r 037f35644494 x11/blt/patches/patch-src_bltArrayObj.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/blt/patches/patch-src_bltArrayObj.c   Mon Jun 06 04:27:14 2022 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_bltArrayObj.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Silence const warning.
+
+--- src/bltArrayObj.c~ 2002-07-12 18:38:47.000000000 +0000
++++ src/bltArrayObj.c
+@@ -54,7 +54,7 @@ SetArrayFromAny(interp, objPtr)
+     Blt_HashEntry *hPtr;
+     Blt_HashTable *tablePtr;
+     Tcl_Obj *elemObjPtr;
+-    Tcl_ObjType *oldTypePtr = objPtr->typePtr;
++    const Tcl_ObjType *oldTypePtr = objPtr->typePtr;
+     char **elemArr;
+     char *string;
+     int isNew;
diff -r 413c597db298 -r 037f35644494 x11/blt/patches/patch-src_bltBgexec.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/blt/patches/patch-src_bltBgexec.c     Mon Jun 06 04:27:14 2022 +0000
@@ -0,0 +1,94 @@
+$NetBSD: patch-src_bltBgexec.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+- For Tcl_File, which is unused in tcl 8.x, use a dummy type that
+doesn't cause warnings.
+
+- For Process on non-Windows, use the type that tcl itself expects,
+which is a pointer to an incomplete type. It is actually an int value
+in that pointer inside tcl, not a pointer, and casting pointers to int
+to pointers to pointers causes real problems on LP64 targets.
+
+- Relatedly, when calling Tcl_DetachPids, pass the right thing (a
+pointer to the Tcl_Pid) and not the Tcl_Pid's value itself.
+
+- Fix a null dereference calling NotifyOnUpdate, found by gcc10
+-Wuninitialized.
+
+- Don't use sprintf.
+
+--- src/bltBgexec.c.orig       2002-09-18 22:30:50.000000000 +0000
++++ src/bltBgexec.c
+@@ -44,7 +44,7 @@
+ #if (TCL_MAJOR_VERSION == 7)
+ #define FILEHANDLER_USES_TCLFILES 1
+ #else
+-typedef int Tcl_File;
++typedef void *Tcl_File;
+ #endif
+ 
+ static Tcl_CmdProc BgexecCmd;
+@@ -55,7 +55,7 @@ typedef struct {
+     HANDLE hProcess;
+ } Process;
+ #else
+-typedef int Process;
++typedef Tcl_Pid Process;
+ #endif
+ 
+ #if (TCL_VERSION_NUMBER <  _VERSION(8,1,0)) 
+@@ -1319,7 +1319,9 @@ CollectData(bgPtr, sinkPtr)
+           }
+       } else {
+           data = NextBlock(sinkPtr, &length);
+-          NotifyOnUpdate(bgPtr->interp, sinkPtr, data, length);
++          if (data != NULL) {
++              NotifyOnUpdate(bgPtr->interp, sinkPtr, data, length);
++          }
+       }
+     }
+     if (sinkPtr->status >= 0) {
+@@ -1463,7 +1465,7 @@ DestroyBackgroundInfo(bgPtr)
+ 
+       for (i = 0; i < bgPtr->nProcs; i++) {
+           if (bgPtr->signalNum > 0) {
+-              kill(bgPtr->procArr[i], bgPtr->signalNum);
++              kill((pid_t)(intptr_t)bgPtr->procArr[i], bgPtr->signalNum);
+           }
+ #ifdef WIN32
+           Tcl_DetachPids(1, (Tcl_Pid *)&bgPtr->procArr[i].pid);
+@@ -1471,7 +1473,7 @@ DestroyBackgroundInfo(bgPtr)
+ #if (TCL_MAJOR_VERSION == 7)
+           Tcl_DetachPids(1, &bgPtr->procArr[i]);
+ #else
+-          Tcl_DetachPids(1, (Tcl_Pid *)bgPtr->procArr[i]);
++          Tcl_DetachPids(1, &bgPtr->procArr[i]);
+ #endif /* TCL_MAJOR_VERSION == 7 */
+ #endif /* WIN32 */
+       }
+@@ -1516,7 +1518,7 @@ VariableProc(
+           register int i;
+ 
+           for (i = 0; i < bgPtr->nProcs; i++) {
+-              kill(bgPtr->procArr[i], bgPtr->signalNum);
++              kill((pid_t)(intptr_t)bgPtr->procArr[i], bgPtr->signalNum);
+           }
+       }
+     }
+@@ -1577,7 +1579,7 @@ TimerProc(clientData)
+ #ifdef WIN32
+       pid = WaitProcess(bgPtr->procArr[i], (int *)&waitStatus, WNOHANG);
+ #else
+-      pid = waitpid(bgPtr->procArr[i], (int *)&waitStatus, WNOHANG);
++      pid = waitpid((pid_t)(intptr_t)bgPtr->procArr[i], (int *)&waitStatus, WNOHANG);
+ #endif
+       if (pid == 0) {         /*  Process has not terminated yet */
+           if (nLeft < i) {
+@@ -1928,7 +1930,7 @@ BgexecCmd(clientData, interp, argc, argv
+ #ifdef WIN32
+           sprintf(string, "%u", (unsigned int)bgPtr->procArr[i].pid);
+ #else 
+-          sprintf(string, "%d", bgPtr->procArr[i]);
++          snprintf(string, sizeof(string), "%d", (int)(intptr_t)bgPtr->procArr[i]);
+ #endif
+           Tcl_AppendElement(interp, string);
+       }
diff -r 413c597db298 -r 037f35644494 x11/blt/patches/patch-src_bltConfig.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/blt/patches/patch-src_bltConfig.c     Mon Jun 06 04:27:14 2022 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_bltConfig.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Fix ctype abuse.
+
+--- src/bltConfig.c~   2002-09-18 22:30:51.000000000 +0000
++++ src/bltConfig.c
+@@ -1255,7 +1255,7 @@ Blt_ConfigureWidgetComponent(interp, par
+     tempName = Blt_Strdup(resName);
+ 
+     /* Window name can't start with an upper case letter */
+-    tempName[0] = tolower(resName[0]);
++    tempName[0] = tolower((unsigned char)resName[0]);
+ 
+     /*
+      * Create component if a child window by the component's name
diff -r 413c597db298 -r 037f35644494 x11/blt/patches/patch-src_bltInit.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/blt/patches/patch-src_bltInit.c       Mon Jun 06 04:27:14 2022 +0000
@@ -0,0 +1,53 @@
+$NetBSD: patch-src_bltInit.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Pass the right version string to the TCL package calls.
+Otherwise, the library fails to initialize.
+
+--- src/bltInit.c~     2022-06-06 01:11:32.563344735 +0000
++++ src/bltInit.c
+@@ -415,7 +415,7 @@ Blt_Init(interp)
+        * Check that the versions of Tcl that have been loaded are
+        * the same ones that BLT was compiled against.
+        */
+-      if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, EXACT) == NULL) {
++      if (Tcl_PkgRequire(interp, "Tcl", TCL_PATCH_LEVEL, EXACT) == NULL) {
+           return TCL_ERROR;
+       }
+       /* Set the "blt_version", "blt_patchLevel", and "blt_libPath" Tcl
+@@ -462,11 +462,11 @@ Blt_Init(interp)
+       Tcl_Namespace *nsPtr;
+ 
+ #if (TCL_VERSION_NUMBER >= _VERSION(8,1,0)) 
+-      if (Tcl_PkgPresent(interp, "Tk", TK_VERSION, EXACT) == NULL) {
++      if (Tcl_PkgPresent(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
+           return TCL_OK;
+       } 
+ #else
+-      if (Tcl_PkgRequire(interp, "Tk", TK_VERSION, EXACT) == NULL) {
++      if (Tcl_PkgRequire(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
+           Tcl_ResetResult(interp);
+           return TCL_OK;
+       } 
+@@ -514,7 +514,7 @@ Blt_Init(interp)
+        * Check that the versions of Tcl that have been loaded are
+        * the same ones that BLT was compiled against.
+        */
+-      if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, EXACT) == NULL) {
++      if (Tcl_PkgRequire(interp, "Tcl", TCL_PATCH_LEVEL, EXACT) == NULL) {
+           return TCL_ERROR;
+       }
+       /* Set the "blt_version", "blt_patchLevel", and "blt_libPath" Tcl
+@@ -552,11 +552,11 @@ Blt_Init(interp)
+       register Tcl_AppInitProc **p;
+ 
+ #if (TCL_VERSION_NUMBER >= _VERSION(8,1,0)) 
+-      if (Tcl_PkgPresent(interp, "Tk", TK_VERSION, EXACT) == NULL) {
++      if (Tcl_PkgPresent(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
+           return TCL_OK;
+       } 
+ #else
+-      if (Tcl_PkgRequire(interp, "Tk", TK_VERSION, EXACT) == NULL) {
++      if (Tcl_PkgRequire(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
+           Tcl_ResetResult(interp);
+           return TCL_OK;
+       } 
diff -r 413c597db298 -r 037f35644494 x11/blt/patches/patch-src_bltList.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/blt/patches/patch-src_bltList.c       Mon Jun 06 04:27:14 2022 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_bltList.c,v 1.1 2022/06/06 04:27:14 dholland Exp $
+
+Make the node type stuff consistent with bltHash to silence compiler warnings.
+
+--- src/bltList.c~     2002-09-18 22:30:51.000000000 +0000
++++ src/bltList.c
+@@ -114,7 +114,7 @@ FreeNode(nodePtr)
+ /*LINTLIBRARY*/
+ Blt_List 
+ Blt_ListCreate(type)
+-    int type;
++    size_t type;
+ {
+     struct Blt_ListStruct *listPtr;



Home | Main Index | Thread Index | Old Index