[Nickle] nickle: Branch 'master' - 5 commits

Keith Packard keithp at keithp.com
Mon Sep 8 13:01:55 PDT 2025


 debian/changelog    |    9 +++++++++
 debian/control      |    3 ++-
 main.c              |    4 ++++
 test/math-tables.sh |   24 ++++++++++++------------
 4 files changed, 27 insertions(+), 13 deletions(-)

New commits:
commit c12e2ade7f445522f15b34906703190297338e2e
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Sep 1 15:30:19 2025 -0500

    Version 2.104
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/debian/changelog b/debian/changelog
index bf26581..2312df0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+nickle (2.104) unstable; urgency=medium
+
+  * Replace #include SYMBOL with conditional includes.
+  * Replace 'fmt --width=500' with 'fmt -w 500' which is more common.
+  * Skip readline signal calls when not using libreadline.
+  * Add Multi-Arch: allowed for cross-building pacakges.
+
+ -- Keith Packard <keithp at keithp.com>  Mon, 01 Sep 2025 15:24:57 -0500
+
 nickle (2.103) unstable; urgency=medium
 
   * Switch 'bool' in %union to 'boolean' for C23 compatibility
commit 3399032de51ec44de1f47637458268449946a26e
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Sep 2 08:20:52 2025 -0700

    debian: Add Multi-Arch: allowed to control
    
    This should help with cross building debian packages
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/debian/control b/debian/control
index 5b8ecc0..50bff2d 100644
--- a/debian/control
+++ b/debian/control
@@ -11,6 +11,7 @@ Standards-Version: 4.7.0
 Package: nickle
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
+Multi-Arch: allowed
 Description: desk calculator language
  Nickle is a language with powerful programming and scripting capabilities.
  Nickle supports a variety of datatypes, especially arbitrary precision
commit 55cd201287940974ed6761096a13e46a80845900
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Sep 1 15:54:07 2025 -0500

    debian: Adjust asciidoctor-pdf dependency
    
    Now that the app is split from the module, depend upon that.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/debian/control b/debian/control
index 729658b..5b8ecc0 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: interpreters
 Priority: optional
 Maintainer: Keith Packard <keithp at keithp.com>
 Homepage: https://nickle.org
-Build-Depends: debhelper-compat (= 13), libreadline-dev, ruby-asciidoctor-pdf,
+Build-Depends: debhelper-compat (= 13), libreadline-dev, asciidoctor-pdf,
  bison, flex, meson, ninja-build, pkgconf, bc, libgmp-dev
 Rules-Requires-Root: no
 Standards-Version: 4.7.0
commit 89e3cfafa3b63e1a7423ddbaaa3aa894587304ec
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Sep 1 15:22:51 2025 -0500

    Check HAVE_LIBREADLINE before using readline signal funcs
    
    Don't try to call rl_echo_signal_char and friends unless
    we're using libreadline.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/main.c b/main.c
index a00d61e..91d6465 100644
--- a/main.c
+++ b/main.c
@@ -186,6 +186,7 @@ stop (int sig)
 {
     sigset_t	set, oset;
 
+#ifdef HAVE_LIBREADLINE
     if (stdin_in_readline) {
 #ifdef HAVE_RL_ECHO_SIGNAL_CHAR
 	rl_echo_signal_char(sig);
@@ -194,6 +195,7 @@ stop (int sig)
 	rl_cleanup_after_signal();
 #endif
     }
+#endif
 
     IoStop ();
     releaseSignal (sig);
@@ -217,6 +219,7 @@ stop (int sig)
 void
 die (int sig)
 {
+#ifdef HAVE_LIBREADLINE
     if (stdin_in_readline) {
 #ifdef HAVE_RL_FREE_LINE_STATE
 	rl_free_line_state();
@@ -225,6 +228,7 @@ die (int sig)
 	rl_cleanup_after_signal();
 #endif
     }
+#endif
     IoStop ();
     _exit (sig);
 }
commit e58e345ac71047e1e8f5898f851c94e04c7af6c0
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Apr 29 22:34:06 2025 -0700

    test: Use fmt -w 500 instead of fmt --width=500
    
    --width appears to be a GNU extension.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/test/math-tables.sh b/test/math-tables.sh
index 7a4837a..4cd8bab 100755
--- a/test/math-tables.sh
+++ b/test/math-tables.sh
@@ -61,10 +61,10 @@ echo "sin_cos_t[] sin_cos_table = {"
 
 a="-800"
 while [ "$a" -le "800" -a $make_sin = "y" ]; do
-    sin=`echo "s($a / 100)" | bc -l "$dir"/math-funcs.bc | fmt --width=500 | tr -d '\\\n ' `
-    cos=`echo "c($a / 100)" | bc -l "$dir"/math-funcs.bc | fmt --width=500 | tr -d '\\\n ' `
-    psin=`echo "s(p * $a / 100)" | bc -l "$dir"/math-funcs.bc | fmt --width=500 | tr -d '\\\n ' `
-    pcos=`echo "c(p * $a / 100)" | bc -l "$dir"/math-funcs.bc | fmt --width=500 | tr -d '\\\n ' `
+    sin=`echo "s($a / 100)" | bc -l "$dir"/math-funcs.bc | fmt -w 500 | tr -d '\\\n ' `
+    cos=`echo "c($a / 100)" | bc -l "$dir"/math-funcs.bc | fmt -w 500 | tr -d '\\\n ' `
+    psin=`echo "s(p * $a / 100)" | bc -l "$dir"/math-funcs.bc | fmt -w 500 | tr -d '\\\n ' `
+    pcos=`echo "c(p * $a / 100)" | bc -l "$dir"/math-funcs.bc | fmt -w 500 | tr -d '\\\n ' `
     echo "    { .angle = $a / 100.0,"
     echo "      .sin = $sin,"
     echo "      .cos = $cos },"
@@ -83,8 +83,8 @@ echo "asin_acos_t[] asin_acos_table = {"
 
 r="-200"
 while [ "$r" -le 200 -a $make_asin = "y" ]; do
-    asin=`echo "b($r / 100)" | bc -l "$dir"/math-funcs.bc | fmt --width=500 | tr -d '\\\n ' `
-    acos=`echo "d($r / 100)" | bc -l "$dir"/math-funcs.bc | fmt --width=500 | tr -d '\\\n ' `
+    asin=`echo "b($r / 100)" | bc -l "$dir"/math-funcs.bc | fmt -w 500 | tr -d '\\\n ' `
+    acos=`echo "d($r / 100)" | bc -l "$dir"/math-funcs.bc | fmt -w 500 | tr -d '\\\n ' `
     echo "    { .ratio = $r / 100,"
     echo "      .asin = $asin,"
     echo "      .acos = $acos },"
@@ -100,8 +100,8 @@ echo "tan_t[] tan_table = {"
 
 a="-800"
 while [ "$a" -le 800 -a $make_tan = "y" ]; do
-    tan=`echo "t($a / 100)" | bc -l "$dir"/math-funcs.bc | fmt --width=500 | tr -d '\\\n ' `
-    ptan=`echo "t(p * $a / 100)" | bc -l "$dir"/math-funcs.bc | fmt --width=500 | tr -d '\\\n ' `
+    tan=`echo "t($a / 100)" | bc -l "$dir"/math-funcs.bc | fmt -w 500 | tr -d '\\\n ' `
+    ptan=`echo "t(p * $a / 100)" | bc -l "$dir"/math-funcs.bc | fmt -w 500 | tr -d '\\\n ' `
     echo "    { .angle = $a / 100.0,"
     echo "      .tan = $tan },"
     echo "    { .angle = π * $a / 100.0,"
@@ -117,7 +117,7 @@ echo "atan_t[] atan_table = {"
 
 r="-1000"
 while [ "$r" -le 1000 -a $make_atan = "y" ]; do
-    atan=`echo "a($r / 100)" | bc -l "$dir"/math-funcs.bc | fmt --width=500 | tr -d '\\\n ' `
+    atan=`echo "a($r / 100)" | bc -l "$dir"/math-funcs.bc | fmt -w 500 | tr -d '\\\n ' `
     echo "    { .ratio = $r / 100,"
     echo "      .atan = $atan },"
     r=`expr "$r" + "$inc"`
@@ -134,7 +134,7 @@ while [ "$y" -le 30 -a "$make_atan" = "y" ]; do
       x="-30"
       while [ "$x" -le 30 ]; do
 	  x=`expr "$x" + "$ainc"`
-	  atan2=`echo "u($y / 100, $x / 100)" | bc -l "$dir"/math-funcs.bc | fmt --width=500 | tr -d '\\\n ' `
+	  atan2=`echo "u($y / 100, $x / 100)" | bc -l "$dir"/math-funcs.bc | fmt -w 500 | tr -d '\\\n ' `
 	  echo "    { .y = $y / 100.0, .x = $x / 100.0,"
 	  echo "      .atan2 = $atan2 },"
       done
@@ -150,7 +150,7 @@ echo "log_t[] log_table = {"
 r="0"
 while [ "$r" -le 66 -a "$make_log" = "y" ]; do
     in=`echo "2 ^ $r" | bc`
-    log=`echo "l($in / 1000000)" | bc -l "$dir"/math-funcs.bc | fmt --width=500 | tr -d '\\\n ' `
+    log=`echo "l($in / 1000000)" | bc -l "$dir"/math-funcs.bc | fmt -w 500 | tr -d '\\\n ' `
     echo "    { .in = $in / 1000000.0,"
     echo "      .log = $log },"
     r=`expr "$r" + "$ainc"`
@@ -164,7 +164,7 @@ echo "exp_t[] exp_table = {"
 
 r="-1000"
 while [ "$r" -le 1000 -a $make_exp = "y" ]; do
-    exp=`echo "e($r / 100)" | bc -l "$dir"/math-funcs.bc | fmt --width=500 | tr -d '\\\n ' `
+    exp=`echo "e($r / 100)" | bc -l "$dir"/math-funcs.bc | fmt -w 500 | tr -d '\\\n ' `
     echo "    { .in = $r / 100.0,"
     echo "      .exp = $exp },"
     r=`expr "$r" + "$inc"`


More information about the Nickle mailing list