[Pkg-electronics-devel] Bug#1108620: ngspice: Prospective upgrade of blt to 3.0 affects ngspice

Sergei Golovan sgolovan at debian.org
Tue Jul 1 17:22:07 BST 2025


Package: ngspice
Version: 44.2+ds-1+exp1
Severity: normal
Tags: patch

Dear Maintainer,

I'm planning to upgrade blt to 3.0 shortly after the release of trixie,
and this upgrade will affect ngspice. Specifically, the configure script
will not be able to find new libBlt30.so (now it searches for
libBLT.so), also blt.h will move to /usr/include/blt, and new blt
will require to be initiated by calling Blt_TclInit(). The attached
patch fixes these problems, and also modifies two scripts under
examples/tclspice/:
 1) namespace import blt::* won't work without -force now,
 2) vector create will return error if the vector already exists
 3) blt graphs will not have 'grid' subcommand anymore, grid
    configuration will move to the 'axis' subcommand.

You can do additional testing by using the blt packages from
experimental.

Cheers!
-- 
Sergei Golovan
-------------- next part --------------
--- a/configure.ac
+++ b/configure.ac
@@ -587,8 +587,8 @@
 
  .  $tcl_config_sh
 
-    CFLAGS="$CFLAGS $TCL_INCLUDE_SPEC"
-    CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC"
+    CFLAGS="$CFLAGS $TCL_INCLUDE_SPEC -I/usr/include/blt"
+    CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC -I/usr/include/blt"
 
     AC_CHECK_HEADERS([tcl.h blt.h], [], [AC_MSG_ERROR([Couldn't find Tcl/BLT headers])])
 
@@ -612,7 +612,7 @@
     fi
     rm -f conftest.tcl
 
-    AC_SEARCH_LIBS([Blt_GetVector], [BLT BLT24 BLT25],,
+    AC_SEARCH_LIBS([Blt_GetVector], [BLT BLT24 BLT25 Blt30],,
         [AC_MSG_ERROR([Couldnt find BLT library.])])
 
     AC_CHECK_LIB([pthread], [pthread_create])
--- a/src/tclspice.c
+++ b/src/tclspice.c
@@ -117,6 +117,7 @@
 #undef WIN32
 #endif
 #include <blt.h>
+#include <bltVector.h>
 #include  "ngspice/sim.h"
 
 /* defines for Tcl support
@@ -2465,6 +2466,10 @@
         return TCL_ERROR;
 #endif
 
+    if (Blt_TclInit(interp) == TCL_ERROR) {
+        return TCL_ERROR;
+    }
+
     Tcl_PkgProvide(interp, (char*) TCLSPICE_name, (char*) TCLSPICE_version);
 
     Tcl_Eval(interp, "namespace eval " TCLSPICE_namespace " { }");
--- a/examples/tclspice/tcl-testbench2/tcl-testbench2.sh
+++ b/examples/tclspice/tcl-testbench2/tcl-testbench2.sh
@@ -4,7 +4,7 @@
 
 package require BLT
 load ../../../src/.libs/libspice.so
-namespace import blt::*
+namespace import -force blt::*
 
 wm title . "Vector Test script"
 wm geometry . 800x600+40+40
--- a/examples/tclspice/tcl-testbench4/vspicechart.tcl
+++ b/examples/tclspice/tcl-testbench4/vspicechart.tcl
@@ -12,7 +12,7 @@
 source selectfromlist.tcl
 source bltGraph.tcl
 
-namespace import blt::*
+namespace import -force blt::*
 
 wm title . "vspicechart 0.01"
 wm geometry . 800x450+40+40
@@ -147,7 +147,7 @@
   set i 0
   foreach sig $globals(signals) {
     set nsig [replacechar $sig "\#" "_"]
-    vector create $nsig
+    catch { vector create $nsig }
     spice::spicetoblt $sig $nsig
   
     $globals(chart0) element create $sig -color  [lindex $globals(colors) $i]  -xdata stime -ydata $nsig -symbol none
@@ -214,7 +214,8 @@
 .f2.chart axis configure x -title "Time in s"
 
 
-.f2.chart grid configure -hide no 
+.f2.chart axis configure x -grid yes 
+.f2.chart axis configure y -grid yes 
 Blt_ZoomStack .f2.chart
 Blt_Crosshairs .f2.chart
 Blt_ClosestPoint .f2.chart


More information about the Pkg-electronics-devel mailing list