guix_mirror_bot pushed a commit to branch add-compress-debug-symbols-phase
in repository guix.

commit 7c1b19c3331f79bcabbf357e7d9412157126d673
Author: Maxim Cournoyer <[email protected]>
AuthorDate: Tue Nov 4 11:25:34 2025 +0900

    gnu: plotutils: Unbundle libxmi and apply other Gentoo patches.
    
    * gnu/packages/patches/plotutils-c23.patch
    * gnu/packages/patches/plotutils-configure-c99.patch
    * gnu/packages/patches/plotutils-cxx17-fix.patch
    * gnu/packages/patches/plotutils-format-security.patch
    * gnu/packages/patches/plotutils-libxmi.patch
    * gnu/packages/patches/plotutils-makefile.patch
    * gnu/packages/patches/plotutils-rangecheck.patch: New files.
    * gnu/local.mk (dist_patch_DATA): Register them.
    * gnu/packages/plotutils.scm (plotutils) [source]: Delete bundled libxmi and
    apply patches.
    [#:configure-flags]: Add --disable-static.
    [#:phases]: Add force-bootstrap phase.
    [native-inputs]: Add autoconf, automake and libtool.
    [inputs]: Add libxmi.
    
    Change-Id: Ib6c5e6a1e3d70222c94a97ebe19e9d75e7b7b64d
---
 gnu/local.mk                                       |   7 ++
 gnu/packages/patches/plotutils-c23.patch           |  27 +++++
 gnu/packages/patches/plotutils-configure-c99.patch |  56 ++++++++++
 gnu/packages/patches/plotutils-cxx17-fix.patch     |  46 ++++++++
 .../patches/plotutils-format-security.patch        |  18 ++++
 gnu/packages/patches/plotutils-libxmi.patch        | 118 +++++++++++++++++++++
 gnu/packages/patches/plotutils-makefile.patch      |  75 +++++++++++++
 gnu/packages/patches/plotutils-rangecheck.patch    |  16 +++
 gnu/packages/plotutils.scm                         |  50 ++++++---
 9 files changed, 396 insertions(+), 17 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index edd9f30ed8..dbc76f5bd4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1764,6 +1764,13 @@ dist_patch_DATA =                                        
        \
   %D%/packages/patches/libmpeg2-global-symbol-test.patch       \
   %D%/packages/patches/liblinphone-jsoncpp.patch               \
   %D%/packages/patches/libphonenumber-reproducible-build.patch \
+  %D%/packages/patches/plotutils-c23.patch                      \
+  %D%/packages/patches/plotutils-configure-c99.patch            \
+  %D%/packages/patches/plotutils-cxx17-fix.patch                \
+  %D%/packages/patches/plotutils-format-security.patch          \
+  %D%/packages/patches/plotutils-libxmi.patch                   \
+  %D%/packages/patches/plotutils-makefile.patch                 \
+  %D%/packages/patches/plotutils-rangecheck.patch               \
   %D%/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch        \
   %D%/packages/patches/libquicktime-ffmpeg.patch               \
   %D%/packages/patches/libsecret-fix-test-paths.patch          \
diff --git a/gnu/packages/patches/plotutils-c23.patch 
b/gnu/packages/patches/plotutils-c23.patch
new file mode 100644
index 0000000000..df74621e41
--- /dev/null
+++ b/gnu/packages/patches/plotutils-c23.patch
@@ -0,0 +1,27 @@
+Retrieved from 
https://raw.githubusercontent.com/gentoo/gentoo/refs/heads/master/media-libs/plotutils/files/plotutils-2.6-c23.patch
+
+https://bugs.gentoo.org/946332
+https://build.opensuse.org/projects/openSUSE:Factory/packages/plotutils/files/plotutils-gcc15.patch?expand=1
+--- a/include/sys-defines.h
++++ b/include/sys-defines.h
+@@ -255,7 +255,7 @@ extern __C_LINKAGE void free (void * ptr
+ 
+ #ifndef __cplusplus
+ #ifdef __STDC__
+-typedef enum { false = 0, true = 1 } bool;
++# include <stdbool.h>
+ #else  /* not __STDC__, do things the old-fashioned way */
+ typedef int bool;
+ #define false 0
+--- a/libxmi/sys-defines.h
++++ b/libxmi/sys-defines.h
+@@ -169,7 +169,7 @@ extern __C_LINKAGE void free (void * ptr
+ #ifndef __cplusplus
+ #ifndef HAVE_BOOL_IN_CC
+ #ifdef __STDC__
+-typedef enum { false = 0, true = 1 } bool;
++# include <stdbool.h>
+ #else  /* not __STDC__, do things the old-fashioned way */
+ typedef int bool;
+ #define false 0
+
diff --git a/gnu/packages/patches/plotutils-configure-c99.patch 
b/gnu/packages/patches/plotutils-configure-c99.patch
new file mode 100644
index 0000000000..630585aff1
--- /dev/null
+++ b/gnu/packages/patches/plotutils-configure-c99.patch
@@ -0,0 +1,56 @@
+Retrieved from: 
https://raw.githubusercontent.com/gentoo/gentoo/refs/heads/master/media-libs/plotutils/files/plotutils-2.6-configure-c99.patch
+
+Do not call the undeclared exit function.  This avoids build problems
+with future compilers which do not support implicit function
+declarations.
+
+diff --git a/configure b/configure
+index 229ccd453ae4487f..fdf3785ad4c5175f 100755
+--- a/configure
++++ b/configure
+@@ -19537,9 +19537,9 @@ int main()
+       || fflush ((FILE *)0) < 0
+       || (fpr = fopen ("conftest0", "r")) == (FILE *)0
+       || fread (test_array, 1, 7, fpr) != 7)
+-    exit (1);
++    return 1;
+   else
+-    exit(0); }
++    return 0; }
+ _ACEOF
+ rm -f conftest$ac_exeext
+ if { (ac_try="$ac_link"
+@@ -24022,7 +24022,7 @@ int main()
+   int i;
+   for (i=0; i < B; i++)
+     Array[i] = i - 3;
+-  exit (Array[1] != -2);
++  return Array[1] != -2;
+ }
+ _ACEOF
+ rm -f conftest$ac_exeext
+diff --git a/configure.ac b/configure.ac
+index 8fb7b640864eb4a8..d1f6d7e08c6946d4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -88,9 +88,9 @@ int main()
+       || fflush ((FILE *)0) < 0
+       || (fpr = fopen ("conftest0", "r")) == (FILE *)0
+       || fread (test_array, 1, 7, fpr) != 7)
+-    exit (1);
++    return 1;
+   else
+-    exit(0); }]])],[AC_MSG_RESULT(yes); 
AC_DEFINE(HAVE_NULL_FLUSH)],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
++    return 0; }]])],[AC_MSG_RESULT(yes); 
AC_DEFINE(HAVE_NULL_FLUSH)],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
+ 
+ # Checks for header files: ANSI C, POSIX, and nonstandard Unix headers.
+ AC_HEADER_STDC
+@@ -383,7 +383,7 @@ int main()
+   int i;
+   for (i=0; i < B; i++)
+     Array[[i]] = i - 3;
+-  exit (Array[[1]] != -2);
++  return Array[[1]] != -2;
+ }]])],
+ 
[ac_cv_c_gcc_strength_bug="no"],[ac_cv_c_gcc_strength_bug="yes"],[ac_cv_c_gcc_strength_bug="yes"])
 )
+   if test "$ac_cv_c_gcc_strength_bug" = "yes"
diff --git a/gnu/packages/patches/plotutils-cxx17-fix.patch 
b/gnu/packages/patches/plotutils-cxx17-fix.patch
new file mode 100644
index 0000000000..a14336a580
--- /dev/null
+++ b/gnu/packages/patches/plotutils-cxx17-fix.patch
@@ -0,0 +1,46 @@
+https://github.com/NixOS/nixpkgs/commit/92d99c521b2c02fa645b3b993ac4bbaf49e43ddd
+
+diff -ur a/pic2plot/gram.cc b/pic2plot/gram.cc
+--- a/pic2plot/gram.cc 2000-06-28 00:23:21.000000000 -0400
++++ b/pic2plot/gram.cc 2023-09-07 22:59:47.004460065 -0400
+@@ -1229,9 +1229,9 @@
+      char *from;
+      unsigned int count;
+ {
+-  register char *f = from;
+-  register char *t = to;
+-  register int i = count;
++  char *f = from;
++  char *t = to;
++  int i = count;
+
+   while (i-- > 0)
+     *t++ = *f++;
+@@ -1244,9 +1244,9 @@
+ static void
+ __yy_memcpy (char *to, char *from, unsigned int count)
+ {
+-  register char *t = to;
+-  register char *f = from;
+-  register int i = count;
++  char *t = to;
++  char *f = from;
++  int i = count;
+
+   while (i-- > 0)
+     *t++ = *f++;
+@@ -1289,10 +1289,10 @@
+ yyparse(YYPARSE_PARAM_ARG)
+      YYPARSE_PARAM_DECL
+ {
+-  register int yystate;
+-  register int yyn;
+-  register short *yyssp;
+-  register YYSTYPE *yyvsp;
++  int yystate;
++  int yyn;
++  short *yyssp;
++  YYSTYPE *yyvsp;
+   int yyerrstatus;    /*  number of tokens to shift before error messages 
enabled */
+   int yychar1 = 0;            /*  lookahead token as an internal (translated) 
token number */
+ 
diff --git a/gnu/packages/patches/plotutils-format-security.patch 
b/gnu/packages/patches/plotutils-format-security.patch
new file mode 100644
index 0000000000..c1cbecfc79
--- /dev/null
+++ b/gnu/packages/patches/plotutils-format-security.patch
@@ -0,0 +1,18 @@
+Description: Fix build error with -Werror=format-security.
+Forwarded: 
https://lists.gnu.org/archive/html/bug-plotutils/2016-01/msg00000.html 
+Author: Stanislav Ochotnicky <[email protected]>
+Origin: http://pkgs.fedoraproject.org/cgit/plotutils.git
+
+diff --git a/pic2plot/gram.yy b/pic2plot/gram.yy
+index d11320b..1bcce46 100644
+--- a/pic2plot/gram.yy
++++ b/pic2plot/gram.yy
+@@ -1833,7 +1833,7 @@ do_sprintf(const char *form, const double *v, int nv)
+           {
+             one_format += *form++;
+             one_format += '\0';
+-            sprintf(sprintf_buf, one_format.contents());
++            sprintf(sprintf_buf, "%s", one_format.contents());
+           }
+         else 
+           {
diff --git a/gnu/packages/patches/plotutils-libxmi.patch 
b/gnu/packages/patches/plotutils-libxmi.patch
new file mode 100644
index 0000000000..e3e599629f
--- /dev/null
+++ b/gnu/packages/patches/plotutils-libxmi.patch
@@ -0,0 +1,118 @@
+Gentoo patch to unbundle libxmi.
+
+Retrieved from: 
https://raw.githubusercontent.com/gentoo/gentoo/refs/heads/master/media-libs/plotutils/files/plotutils-2.6-libxmi.patch
+
+Makefile.am            | 2 +-
+ configure.ac           | 2 +-
+ libplot/Makefile.am    | 5 +++--
+ libplot/extern.h       | 4 ++--
+ libplotter/Makefile.am | 6 ++++--
+ 5 files changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index b506d17..09d3eda 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -22,7 +22,7 @@ endif
+ if NO_LIBXMI
+ ADD_LIBXMI =
+ else
+-ADD_LIBXMI = libxmi
++ADD_LIBXMI = 
+ endif
+ 
+ SUBDIRS = lib spline double ode ode-examples libplot $(ADD_LIBXMI) plot 
tek2plot plotfont graph hersheydemo $(ADD_LIBPLOTTER) include info doc fonts 
test
+diff --git a/configure.ac b/configure.ac
+index 8fb7b64..4ea0fc4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -392,5 +392,5 @@ int main()
+   fi
+ fi
+ 
+-AC_CONFIG_FILES([Makefile double/Makefile graph/Makefile hersheydemo/Makefile 
pic2plot/Makefile pic2plot/doc/Makefile pic2plot/libgroff/Makefile 
pic2plot/include/Makefile info/Makefile lib/Makefile libplot/Makefile 
libplotter/Makefile libxmi/Makefile libxmi/info/Makefile plot/Makefile 
tek2plot/Makefile tek2plot/teksamples/Makefile plotfont/Makefile 
spline/Makefile ode/Makefile ode-examples/Makefile include/Makefile 
doc/Makefile fonts/Makefile fonts/bdf/Makefile fonts/pcf/Makefile fonts/ [...]
++AC_CONFIG_FILES([Makefile double/Makefile graph/Makefile hersheydemo/Makefile 
pic2plot/Makefile pic2plot/doc/Makefile pic2plot/libgroff/Makefile 
pic2plot/include/Makefile info/Makefile lib/Makefile libplot/Makefile 
libplotter/Makefile plot/Makefile tek2plot/Makefile 
tek2plot/teksamples/Makefile plotfont/Makefile spline/Makefile ode/Makefile 
ode-examples/Makefile include/Makefile doc/Makefile fonts/Makefile 
fonts/bdf/Makefile fonts/pcf/Makefile fonts/pfb/Makefile test/Makefile])
+ AC_OUTPUT
+diff --git a/libplot/Makefile.am b/libplot/Makefile.am
+index 356cbef..a0cb2ff 100644
+--- a/libplot/Makefile.am
++++ b/libplot/Makefile.am
+@@ -8,7 +8,7 @@ libplot_la_LDFLAGS = -version-info 4:4:2
+ 
+ INCLUDES = $(X_CFLAGS) -I$(srcdir)/../include -DLIBPLOT
+ 
+-MISRC = mi_alloc.c mi_api.c mi_arc.c mi_canvas.c mi_fllarc.c mi_fllrct.c \
++_MISRC = mi_alloc.c mi_api.c mi_arc.c mi_canvas.c mi_fllarc.c mi_fllrct.c \
+ mi_fplycon.c mi_gc.c mi_ply.c mi_plycon.c mi_plygen.c mi_plypnt.c      \
+ mi_plyutil.c mi_spans.c mi_widelin.c mi_zerarc.c mi_zerolin.c mi_version.c
+ 
+@@ -87,7 +87,7 @@ x_savestate.c x_text.c y_closepl.c y_defplot.c y_erase.c 
y_openpl.c
+ 
+ libplot_la_SOURCES = apinewc.c apioldc.c apioldcc.c $(ALLSRC)
+ 
+-MIHEADERS = xmi.h mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h \
++_MIHEADERS = xmi.h mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h \
+ mi_ply.h mi_scanfill.h mi_spans.h mi_widelin.h mi_zerarc.h
+ 
+ noinst_HEADERS = extern.h g_arc.h g_colorname.h g_control.h g_cntrlify.h \
+@@ -110,6 +110,7 @@ libplot_la_LIBADD = $(X_LIBS) $(X_TOOLKIT_LIBS) 
$(X_PRE_LIBS) $(X_BASIC_LIBS) $(
+ endif
+ endif
+ 
++libplot_la_LIBADD += -lxmi
+ 
+ ## execute the following command in ../libxmi to produce the commands
+ ## that follow
+diff --git a/libplot/extern.h b/libplot/extern.h
+index 39a6f8c..87a05f1 100644
+--- a/libplot/extern.h
++++ b/libplot/extern.h
+@@ -1262,7 +1262,7 @@ extern void _delete_color_name_cache (plColorNameCache 
*color_cache);
+    and a separate version of libxmi. */
+ 
+ /* libxmi API functions */
+-
++/*
+ #define miClearPaintedSet _pl_miClearPaintedSet
+ #define miCopyCanvas _pl_miCopyCanvas
+ #define miCopyGC _pl_miCopyGC
+@@ -1291,7 +1291,7 @@ extern void _delete_color_name_cache (plColorNameCache 
*color_cache);
+ #define miSetGCPixels _pl_miSetGCPixels
+ #define miSetPixelMerge2 _pl_miSetPixelMerge2
+ #define miSetPixelMerge3 _pl_miSetPixelMerge3
+-
++*/
+ /* an external libxmi symbol */
+ #define mi_libxmi_ver _pl_mi_libxmi_ver
+ 
+diff --git a/libplotter/Makefile.am b/libplotter/Makefile.am
+index 9b478d6..11466ad 100644
+--- a/libplotter/Makefile.am
++++ b/libplotter/Makefile.am
+@@ -6,7 +6,7 @@ libplotter_la_LDFLAGS = -version-info 4:4:2
+ 
+ INCLUDES = $(X_CFLAGS) -I$(srcdir)/../include -DLIBPLOT -DLIBPLOTTER
+ 
+-MISRC = mi_alloc.cc mi_api.cc mi_arc.cc mi_canvas.cc mi_fllarc.cc     \
++_MISRC = mi_alloc.cc mi_api.cc mi_arc.cc mi_canvas.cc mi_fllarc.cc    \
+ mi_fllrct.cc mi_fplycon.cc mi_gc.cc mi_ply.cc mi_plycon.cc mi_plygen.cc       
\
+ mi_plypnt.cc mi_plyutil.cc mi_spans.cc mi_widelin.cc mi_zerarc.cc     \
+ mi_zerolin.cc mi_version.cc
+@@ -84,7 +84,7 @@ endif
+ endif
+ 
+ 
+-MIHEADERS = xmi.h mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h \
++_MIHEADERS = xmi.h mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h \
+ mi_ply.h mi_scanfill.h mi_spans.h mi_widelin.h mi_zerarc.h
+ 
+ ALLHEADERS = extern.h g_arc.h g_colorname.h g_control.h g_cntrlify.h \
+@@ -111,6 +111,8 @@ libplotter_la_LIBADD = $(X_LIBS) $(X_TOOLKIT_LIBS) 
$(X_PRE_LIBS) $(X_BASIC_LIBS)
+ endif
+ endif
+ 
++libplotter_la_LIBADD += -lxmi
++
+ ## execute the following command in ../libplot to produce the commands
+ ## that follow
+ ## (for i in ?_*.c; do echo "$i"c: "\$(top_srcdir)/libplot/$i"; echo "        
rm -f $i"c" ; if \$(LN_S) \$(top_srcdir)/libplot/$i $i"c" ; then true ; else cp 
-p \$(top_srcdir)/libplot/$i $i"c" ; fi"; echo; done)
diff --git a/gnu/packages/patches/plotutils-makefile.patch 
b/gnu/packages/patches/plotutils-makefile.patch
new file mode 100644
index 0000000000..53c2e60cc1
--- /dev/null
+++ b/gnu/packages/patches/plotutils-makefile.patch
@@ -0,0 +1,75 @@
+Retrieved from: 
https://raw.githubusercontent.com/gentoo/gentoo/refs/heads/master/media-libs/plotutils/files/plotutils-2.6-makefile.patch
+
+--- plotutils-2.6.orig/configure.ac    2009-07-29 20:14:09.000000000 -0700
++++ plotutils-2.6/configure.ac 2010-10-18 01:46:57.328444564 -0700
+@@ -65,6 +65,8 @@
+ # SCO OpenServer 5 (i.e. *-*-sco3.2v5*), "-belf" is added.
+ AC_PROG_LIBTOOL
+ 
++AC_PROG_CXX
++
+ # Determine extension (e.g. ".exe") on executables, if any.
+ AC_EXEEXT
+ 
+--- plotutils-2.6.orig/doc/Makefile.am 2009-07-30 08:49:46.000000000 -0700
++++ plotutils-2.6/doc/Makefile.am      2010-10-18 01:57:50.525852285 -0700
+@@ -3,11 +3,3 @@
+ 
+ # files with nonstandard names in this directory
+ EXTRA_DIST = colors.txt h-fonts.txt h-glyphs.txt hershey.bib kana.txt 
kanji.txt
+-
+-# remove documentation files installed by previous versions of the package,
+-# with obsolete names
+-
+-OBSOLETEDOC = hershey-demo.c hershey-fonts hershey-number hershey.doc 
h-fonts.doc h-glyphs.doc kana.doc kanji.doc demo-page h-demo.c
+-
+-install-data-hook:
+-      -for f in $(OBSOLETEDOC) ; do rm -f $(datadir)/libplot/$$f; done
+--- plotutils-2.6.orig/graph/Makefile.am       2005-11-25 20:40:13.000000000 
-0800
++++ plotutils-2.6/graph/Makefile.am    2010-10-18 01:23:07.194720342 -0700
+@@ -10,15 +10,5 @@
+ 
+ CLEANFILES = fontlist.c
+ 
+-# remove executables installed by previous versions of the package, and
+-# remove obsolete library versions too
+-
+-OBSOLETEBINS = graph-tek graph-hpgl graph-fig graph-ps graph-X
+-OBSOLETELIBS = libplottek.a libplothpgl.a libplotfig.a libplotps.a libplotX.a
+-
+-install-exec-hook:
+-      -for f in $(OBSOLETEBINS) ; do rm -f $(bindir)/$$f; done
+-      -for f in $(OBSOLETELIBS) ; do rm -f $(libdir)/$$f; done
+-
+ fontlist.c: $(top_srcdir)/lib/fontlist.c
+       @rm -f fontlist.c ; if $(LN_S) $(top_srcdir)/lib/fontlist.c fontlist.c 
; then true ; else cp -p $(top_srcdir)/lib/fontlist.c fontlist.c ; fi
+--- plotutils-2.6.orig/plot/Makefile.am        2005-11-25 20:40:13.000000000 
-0800
++++ plotutils-2.6/plot/Makefile.am     2010-10-18 01:23:37.714971379 -0700
+@@ -9,12 +9,5 @@
+ 
+ CLEANFILES = fontlist.c
+ 
+-# remove executables installed by previous versions of the package
+-
+-OBSOLETEBINS = plot2plot plot2tek plot2hpgl plot2fig plot2ps plot2X
+-
+-install-exec-hook:
+-      -for f in $(OBSOLETEBINS) ; do rm -f $(bindir)/$$f; done
+-
+ fontlist.c: $(top_srcdir)/lib/fontlist.c
+       @rm -f fontlist.c ; if $(LN_S) $(top_srcdir)/lib/fontlist.c fontlist.c 
; then true ; else cp -p $(top_srcdir)/lib/fontlist.c fontlist.c ; fi
+--- plotutils-2.6.orig/tek2plot/Makefile.am    2005-11-25 20:40:13.000000000 
-0800
++++ plotutils-2.6/tek2plot/Makefile.am 2010-10-18 01:23:48.011056089 -0700
+@@ -12,12 +12,5 @@
+ 
+ SUBDIRS = teksamples
+ 
+-# remove executables installed by previous versions of the package
+-
+-OBSOLETEBINS = tek2tek tek2hpgl tek2fig tek2ps tek2X
+-
+-install-exec-hook:
+-      -for f in $(OBSOLETEBINS) ; do rm -f $(bindir)/$$f; done
+-
+ fontlist.c: $(top_srcdir)/lib/fontlist.c
+       @rm -f fontlist.c ; if $(LN_S) $(top_srcdir)/lib/fontlist.c fontlist.c 
; then true ; else cp -p $(top_srcdir)/lib/fontlist.c fontlist.c ; fi
diff --git a/gnu/packages/patches/plotutils-rangecheck.patch 
b/gnu/packages/patches/plotutils-rangecheck.patch
new file mode 100644
index 0000000000..258e463f66
--- /dev/null
+++ b/gnu/packages/patches/plotutils-rangecheck.patch
@@ -0,0 +1,16 @@
+Retrieved from 
https://raw.githubusercontent.com/gentoo/gentoo/refs/heads/master/media-libs/plotutils/files/plotutils-2.5.1-rangecheck.patch
+
+Source: Steve Tell 
(http://lists.gnu.org/archive/html/bug-gnu-utils/2003-12/msg00023.html)
+Upstream: Sent in 2003, not applied yet.
+Reason: Gentoo bug #47688
+--- plotutils-2.5.1.orig/graph/plotter.c       2008-09-26 23:48:15.000000000 
+0200
++++ plotutils-2.5.1/graph/plotter.c    2008-11-08 13:10:14.000000000 +0100
+@@ -1011,7 +1011,7 @@
+   multigrapher->x_trans.output_min = 0.0;
+   multigrapher->x_trans.output_max = (double)PLOT_SIZE;
+   multigrapher->x_trans.output_range = multigrapher->x_trans.output_max - 
multigrapher->x_trans.output_min;
+-  multigrapher->x_trans.output_min = 0.0;
++  multigrapher->y_trans.output_min = 0.0;
+   multigrapher->y_trans.output_max = (double)PLOT_SIZE;
+   multigrapher->y_trans.output_range = multigrapher->y_trans.output_max - 
multigrapher->y_trans.output_min;
+ 
diff --git a/gnu/packages/plotutils.scm b/gnu/packages/plotutils.scm
index 4968cebb50..397709c8e4 100644
--- a/gnu/packages/plotutils.scm
+++ b/gnu/packages/plotutils.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2015 Eric Bavier <[email protected]>
 ;;; Copyright © 2016-2025 Nicolas Goaziou <[email protected]>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
-;;; Copyright © 2020 Maxim Cournoyer <[email protected]>
+;;; Copyright © 2020, 2025 Maxim Cournoyer <[email protected]>
 ;;; Copyright © 2022 Antero Mejr <[email protected]>
 ;;; Copyright © 2023 gemmaro <[email protected]>
 ;;;
@@ -45,6 +45,7 @@
   #:use-module (gnu packages flex)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
+  #:use-module (gnu packages graphics)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages image)
@@ -375,17 +376,27 @@ colors, styles, options and details.")
                   (substitute* "libplot/z_write.c"
                     (("png_ptr->jmpbuf")
                      "png_jmpbuf (png_ptr)"))
-                  #t))
+                  ;; Unbundle libxmi.
+                  (delete-file-recursively "libxmi")))
               (patches
-               ;; The test suite fails on some architectures such as i686 (see:
-               ;; 
https://lists.gnu.org/archive/html/bug-plotutils/2016-04/msg00002.html).
-               ;; The following Debian patch works around it.
-               (search-patches "plotutils-spline-test.patch"))))
+               (search-patches
+                "plotutils-c23.patch"
+                "plotutils-configure-c99.patch"
+                "plotutils-cxx17-fix.patch"
+                "plotutils-format-security.patch"
+                "plotutils-libxmi.patch"
+                "plotutils-makefile.patch"
+                "plotutils-rangecheck.patch"
+                ;; The test suite fails on some architectures such as i686
+                ;; (see:
+                ;; 
https://lists.gnu.org/archive/html/bug-plotutils/2016-04/msg00002.html).
+                ;; The following Debian patch works around it.
+                "plotutils-spline-test.patch"))))
     (build-system gnu-build-system)
     (arguments
      (list #:configure-flags
            #~(list "--enable-libplotter"
-
+                   "--disable-static"
                    ;; On i686 some tests fail due to excess floating point
                    ;; precision; work around it.  However, libplotter is C++
                    ;; and thus unaffected by CFLAGS, but '-fexcess-precision'
@@ -395,16 +406,21 @@ colors, styles, options and details.")
                           #~()))
 
            #:phases
-           (if (target-x86-32?)
-               #~(modify-phases %standard-phases
-                   (add-before 'check 'skip-sloppy-test
-                     (lambda _
-                       ;; This test reveals a slight difference in the SVG
-                       ;; output due to floating point inequalities.  Skip it.
-                       (substitute* "test/plot2svg.test"
-                         (("^exit .*") "exit 77")))))
-               #~%standard-phases)))
-    (inputs (list libpng libx11 libxt libxaw))
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'force-bootstrap
+                 (lambda _
+                   (delete-file "configure")))
+               #$@(if (target-x86-32?)
+                      #~((add-before 'check 'skip-sloppy-test
+                           (lambda _
+                             ;; This test reveals a slight difference in the
+                             ;; SVG output due to floating point inequalities.
+                             ;; Skip it.
+                             (substitute* "test/plot2svg.test"
+                               (("^exit .*") "exit 77")))))
+                      #~()))))
+    (native-inputs (list autoconf automake libtool))
+    (inputs (list libpng libx11 libxaw libxmi libxt))
     (home-page "https://www.gnu.org/software/plotutils/";)
     (synopsis "Plotting utilities and library")
     (description

Reply via email to