summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim@guixotic.coop>2025-11-04 11:25:34 +0900
committerMaxim Cournoyer <maxim@guixotic.coop>2025-11-19 09:42:12 +0900
commit1766f0a40c7fdceb0aaf3457ea832caf50f16d7b (patch)
treec8ed062ac17342fc12b036ebeb76b4939e21d3b9 /gnu/packages
parent90ce7d84e6577f7d36ab70d5d66e26758c2feb5d (diff)
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
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/patches/plotutils-c23.patch27
-rw-r--r--gnu/packages/patches/plotutils-configure-c99.patch56
-rw-r--r--gnu/packages/patches/plotutils-cxx17-fix.patch46
-rw-r--r--gnu/packages/patches/plotutils-format-security.patch18
-rw-r--r--gnu/packages/patches/plotutils-libxmi.patch118
-rw-r--r--gnu/packages/patches/plotutils-makefile.patch75
-rw-r--r--gnu/packages/patches/plotutils-rangecheck.patch16
-rw-r--r--gnu/packages/plotutils.scm50
8 files changed, 389 insertions, 17 deletions
diff --git a/gnu/packages/patches/plotutils-c23.patch b/gnu/packages/patches/plotutils-c23.patch
new file mode 100644
index 00000000000..df74621e418
--- /dev/null
+++ b/gnu/packages/patches/plotutils-c23.patch
@@ -0,0 +1,27 @@
1Retrieved from https://raw.githubusercontent.com/gentoo/gentoo/refs/heads/master/media-libs/plotutils/files/plotutils-2.6-c23.patch
2
3https://bugs.gentoo.org/946332
4https://build.opensuse.org/projects/openSUSE:Factory/packages/plotutils/files/plotutils-gcc15.patch?expand=1
5--- a/include/sys-defines.h
6+++ b/include/sys-defines.h
7@@ -255,7 +255,7 @@ extern __C_LINKAGE void free (void * ptr
8
9 #ifndef __cplusplus
10 #ifdef __STDC__
11-typedef enum { false = 0, true = 1 } bool;
12+# include <stdbool.h>
13 #else /* not __STDC__, do things the old-fashioned way */
14 typedef int bool;
15 #define false 0
16--- a/libxmi/sys-defines.h
17+++ b/libxmi/sys-defines.h
18@@ -169,7 +169,7 @@ extern __C_LINKAGE void free (void * ptr
19 #ifndef __cplusplus
20 #ifndef HAVE_BOOL_IN_CC
21 #ifdef __STDC__
22-typedef enum { false = 0, true = 1 } bool;
23+# include <stdbool.h>
24 #else /* not __STDC__, do things the old-fashioned way */
25 typedef int bool;
26 #define false 0
27
diff --git a/gnu/packages/patches/plotutils-configure-c99.patch b/gnu/packages/patches/plotutils-configure-c99.patch
new file mode 100644
index 00000000000..630585aff14
--- /dev/null
+++ b/gnu/packages/patches/plotutils-configure-c99.patch
@@ -0,0 +1,56 @@
1Retrieved from: https://raw.githubusercontent.com/gentoo/gentoo/refs/heads/master/media-libs/plotutils/files/plotutils-2.6-configure-c99.patch
2
3Do not call the undeclared exit function. This avoids build problems
4with future compilers which do not support implicit function
5declarations.
6
7diff --git a/configure b/configure
8index 229ccd453ae4487f..fdf3785ad4c5175f 100755
9--- a/configure
10+++ b/configure
11@@ -19537,9 +19537,9 @@ int main()
12 || fflush ((FILE *)0) < 0
13 || (fpr = fopen ("conftest0", "r")) == (FILE *)0
14 || fread (test_array, 1, 7, fpr) != 7)
15- exit (1);
16+ return 1;
17 else
18- exit(0); }
19+ return 0; }
20 _ACEOF
21 rm -f conftest$ac_exeext
22 if { (ac_try="$ac_link"
23@@ -24022,7 +24022,7 @@ int main()
24 int i;
25 for (i=0; i < B; i++)
26 Array[i] = i - 3;
27- exit (Array[1] != -2);
28+ return Array[1] != -2;
29 }
30 _ACEOF
31 rm -f conftest$ac_exeext
32diff --git a/configure.ac b/configure.ac
33index 8fb7b640864eb4a8..d1f6d7e08c6946d4 100644
34--- a/configure.ac
35+++ b/configure.ac
36@@ -88,9 +88,9 @@ int main()
37 || fflush ((FILE *)0) < 0
38 || (fpr = fopen ("conftest0", "r")) == (FILE *)0
39 || fread (test_array, 1, 7, fpr) != 7)
40- exit (1);
41+ return 1;
42 else
43- exit(0); }]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NULL_FLUSH)],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
44+ return 0; }]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NULL_FLUSH)],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
45
46 # Checks for header files: ANSI C, POSIX, and nonstandard Unix headers.
47 AC_HEADER_STDC
48@@ -383,7 +383,7 @@ int main()
49 int i;
50 for (i=0; i < B; i++)
51 Array[[i]] = i - 3;
52- exit (Array[[1]] != -2);
53+ return Array[[1]] != -2;
54 }]])],
55 [ac_cv_c_gcc_strength_bug="no"],[ac_cv_c_gcc_strength_bug="yes"],[ac_cv_c_gcc_strength_bug="yes"]) )
56 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 00000000000..a14336a580d
--- /dev/null
+++ b/gnu/packages/patches/plotutils-cxx17-fix.patch
@@ -0,0 +1,46 @@
1https://github.com/NixOS/nixpkgs/commit/92d99c521b2c02fa645b3b993ac4bbaf49e43ddd
2
3diff -ur a/pic2plot/gram.cc b/pic2plot/gram.cc
4--- a/pic2plot/gram.cc 2000-06-28 00:23:21.000000000 -0400
5+++ b/pic2plot/gram.cc 2023-09-07 22:59:47.004460065 -0400
6@@ -1229,9 +1229,9 @@
7 char *from;
8 unsigned int count;
9 {
10- register char *f = from;
11- register char *t = to;
12- register int i = count;
13+ char *f = from;
14+ char *t = to;
15+ int i = count;
16
17 while (i-- > 0)
18 *t++ = *f++;
19@@ -1244,9 +1244,9 @@
20 static void
21 __yy_memcpy (char *to, char *from, unsigned int count)
22 {
23- register char *t = to;
24- register char *f = from;
25- register int i = count;
26+ char *t = to;
27+ char *f = from;
28+ int i = count;
29
30 while (i-- > 0)
31 *t++ = *f++;
32@@ -1289,10 +1289,10 @@
33 yyparse(YYPARSE_PARAM_ARG)
34 YYPARSE_PARAM_DECL
35 {
36- register int yystate;
37- register int yyn;
38- register short *yyssp;
39- register YYSTYPE *yyvsp;
40+ int yystate;
41+ int yyn;
42+ short *yyssp;
43+ YYSTYPE *yyvsp;
44 int yyerrstatus; /* number of tokens to shift before error messages enabled */
45 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
46
diff --git a/gnu/packages/patches/plotutils-format-security.patch b/gnu/packages/patches/plotutils-format-security.patch
new file mode 100644
index 00000000000..c1cbecfc796
--- /dev/null
+++ b/gnu/packages/patches/plotutils-format-security.patch
@@ -0,0 +1,18 @@
1Description: Fix build error with -Werror=format-security.
2Forwarded: https://lists.gnu.org/archive/html/bug-plotutils/2016-01/msg00000.html
3Author: Stanislav Ochotnicky <sochotnicky@redhat.com>
4Origin: http://pkgs.fedoraproject.org/cgit/plotutils.git
5
6diff --git a/pic2plot/gram.yy b/pic2plot/gram.yy
7index d11320b..1bcce46 100644
8--- a/pic2plot/gram.yy
9+++ b/pic2plot/gram.yy
10@@ -1833,7 +1833,7 @@ do_sprintf(const char *form, const double *v, int nv)
11 {
12 one_format += *form++;
13 one_format += '\0';
14- sprintf(sprintf_buf, one_format.contents());
15+ sprintf(sprintf_buf, "%s", one_format.contents());
16 }
17 else
18 {
diff --git a/gnu/packages/patches/plotutils-libxmi.patch b/gnu/packages/patches/plotutils-libxmi.patch
new file mode 100644
index 00000000000..e3e599629f0
--- /dev/null
+++ b/gnu/packages/patches/plotutils-libxmi.patch
@@ -0,0 +1,118 @@
1Gentoo patch to unbundle libxmi.
2
3Retrieved from: https://raw.githubusercontent.com/gentoo/gentoo/refs/heads/master/media-libs/plotutils/files/plotutils-2.6-libxmi.patch
4
5Makefile.am | 2 +-
6 configure.ac | 2 +-
7 libplot/Makefile.am | 5 +++--
8 libplot/extern.h | 4 ++--
9 libplotter/Makefile.am | 6 ++++--
10 5 files changed, 11 insertions(+), 8 deletions(-)
11
12diff --git a/Makefile.am b/Makefile.am
13index b506d17..09d3eda 100644
14--- a/Makefile.am
15+++ b/Makefile.am
16@@ -22,7 +22,7 @@ endif
17 if NO_LIBXMI
18 ADD_LIBXMI =
19 else
20-ADD_LIBXMI = libxmi
21+ADD_LIBXMI =
22 endif
23
24 SUBDIRS = lib spline double ode ode-examples libplot $(ADD_LIBXMI) plot tek2plot plotfont graph hersheydemo $(ADD_LIBPLOTTER) include info doc fonts test
25diff --git a/configure.ac b/configure.ac
26index 8fb7b64..4ea0fc4 100644
27--- a/configure.ac
28+++ b/configure.ac
29@@ -392,5 +392,5 @@ int main()
30 fi
31 fi
32
33-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/pfb/Makefile test/Makefile])
34+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])
35 AC_OUTPUT
36diff --git a/libplot/Makefile.am b/libplot/Makefile.am
37index 356cbef..a0cb2ff 100644
38--- a/libplot/Makefile.am
39+++ b/libplot/Makefile.am
40@@ -8,7 +8,7 @@ libplot_la_LDFLAGS = -version-info 4:4:2
41
42 INCLUDES = $(X_CFLAGS) -I$(srcdir)/../include -DLIBPLOT
43
44-MISRC = mi_alloc.c mi_api.c mi_arc.c mi_canvas.c mi_fllarc.c mi_fllrct.c \
45+_MISRC = mi_alloc.c mi_api.c mi_arc.c mi_canvas.c mi_fllarc.c mi_fllrct.c \
46 mi_fplycon.c mi_gc.c mi_ply.c mi_plycon.c mi_plygen.c mi_plypnt.c \
47 mi_plyutil.c mi_spans.c mi_widelin.c mi_zerarc.c mi_zerolin.c mi_version.c
48
49@@ -87,7 +87,7 @@ x_savestate.c x_text.c y_closepl.c y_defplot.c y_erase.c y_openpl.c
50
51 libplot_la_SOURCES = apinewc.c apioldc.c apioldcc.c $(ALLSRC)
52
53-MIHEADERS = xmi.h mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h \
54+_MIHEADERS = xmi.h mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h \
55 mi_ply.h mi_scanfill.h mi_spans.h mi_widelin.h mi_zerarc.h
56
57 noinst_HEADERS = extern.h g_arc.h g_colorname.h g_control.h g_cntrlify.h \
58@@ -110,6 +110,7 @@ libplot_la_LIBADD = $(X_LIBS) $(X_TOOLKIT_LIBS) $(X_PRE_LIBS) $(X_BASIC_LIBS) $(
59 endif
60 endif
61
62+libplot_la_LIBADD += -lxmi
63
64 ## execute the following command in ../libxmi to produce the commands
65 ## that follow
66diff --git a/libplot/extern.h b/libplot/extern.h
67index 39a6f8c..87a05f1 100644
68--- a/libplot/extern.h
69+++ b/libplot/extern.h
70@@ -1262,7 +1262,7 @@ extern void _delete_color_name_cache (plColorNameCache *color_cache);
71 and a separate version of libxmi. */
72
73 /* libxmi API functions */
74-
75+/*
76 #define miClearPaintedSet _pl_miClearPaintedSet
77 #define miCopyCanvas _pl_miCopyCanvas
78 #define miCopyGC _pl_miCopyGC
79@@ -1291,7 +1291,7 @@ extern void _delete_color_name_cache (plColorNameCache *color_cache);
80 #define miSetGCPixels _pl_miSetGCPixels
81 #define miSetPixelMerge2 _pl_miSetPixelMerge2
82 #define miSetPixelMerge3 _pl_miSetPixelMerge3
83-
84+*/
85 /* an external libxmi symbol */
86 #define mi_libxmi_ver _pl_mi_libxmi_ver
87
88diff --git a/libplotter/Makefile.am b/libplotter/Makefile.am
89index 9b478d6..11466ad 100644
90--- a/libplotter/Makefile.am
91+++ b/libplotter/Makefile.am
92@@ -6,7 +6,7 @@ libplotter_la_LDFLAGS = -version-info 4:4:2
93
94 INCLUDES = $(X_CFLAGS) -I$(srcdir)/../include -DLIBPLOT -DLIBPLOTTER
95
96-MISRC = mi_alloc.cc mi_api.cc mi_arc.cc mi_canvas.cc mi_fllarc.cc \
97+_MISRC = mi_alloc.cc mi_api.cc mi_arc.cc mi_canvas.cc mi_fllarc.cc \
98 mi_fllrct.cc mi_fplycon.cc mi_gc.cc mi_ply.cc mi_plycon.cc mi_plygen.cc \
99 mi_plypnt.cc mi_plyutil.cc mi_spans.cc mi_widelin.cc mi_zerarc.cc \
100 mi_zerolin.cc mi_version.cc
101@@ -84,7 +84,7 @@ endif
102 endif
103
104
105-MIHEADERS = xmi.h mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h \
106+_MIHEADERS = xmi.h mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h \
107 mi_ply.h mi_scanfill.h mi_spans.h mi_widelin.h mi_zerarc.h
108
109 ALLHEADERS = extern.h g_arc.h g_colorname.h g_control.h g_cntrlify.h \
110@@ -111,6 +111,8 @@ libplotter_la_LIBADD = $(X_LIBS) $(X_TOOLKIT_LIBS) $(X_PRE_LIBS) $(X_BASIC_LIBS)
111 endif
112 endif
113
114+libplotter_la_LIBADD += -lxmi
115+
116 ## execute the following command in ../libplot to produce the commands
117 ## that follow
118 ## (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 00000000000..53c2e60cc1d
--- /dev/null
+++ b/gnu/packages/patches/plotutils-makefile.patch
@@ -0,0 +1,75 @@
1Retrieved from: https://raw.githubusercontent.com/gentoo/gentoo/refs/heads/master/media-libs/plotutils/files/plotutils-2.6-makefile.patch
2
3--- plotutils-2.6.orig/configure.ac 2009-07-29 20:14:09.000000000 -0700
4+++ plotutils-2.6/configure.ac 2010-10-18 01:46:57.328444564 -0700
5@@ -65,6 +65,8 @@
6 # SCO OpenServer 5 (i.e. *-*-sco3.2v5*), "-belf" is added.
7 AC_PROG_LIBTOOL
8
9+AC_PROG_CXX
10+
11 # Determine extension (e.g. ".exe") on executables, if any.
12 AC_EXEEXT
13
14--- plotutils-2.6.orig/doc/Makefile.am 2009-07-30 08:49:46.000000000 -0700
15+++ plotutils-2.6/doc/Makefile.am 2010-10-18 01:57:50.525852285 -0700
16@@ -3,11 +3,3 @@
17
18 # files with nonstandard names in this directory
19 EXTRA_DIST = colors.txt h-fonts.txt h-glyphs.txt hershey.bib kana.txt kanji.txt
20-
21-# remove documentation files installed by previous versions of the package,
22-# with obsolete names
23-
24-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
25-
26-install-data-hook:
27- -for f in $(OBSOLETEDOC) ; do rm -f $(datadir)/libplot/$$f; done
28--- plotutils-2.6.orig/graph/Makefile.am 2005-11-25 20:40:13.000000000 -0800
29+++ plotutils-2.6/graph/Makefile.am 2010-10-18 01:23:07.194720342 -0700
30@@ -10,15 +10,5 @@
31
32 CLEANFILES = fontlist.c
33
34-# remove executables installed by previous versions of the package, and
35-# remove obsolete library versions too
36-
37-OBSOLETEBINS = graph-tek graph-hpgl graph-fig graph-ps graph-X
38-OBSOLETELIBS = libplottek.a libplothpgl.a libplotfig.a libplotps.a libplotX.a
39-
40-install-exec-hook:
41- -for f in $(OBSOLETEBINS) ; do rm -f $(bindir)/$$f; done
42- -for f in $(OBSOLETELIBS) ; do rm -f $(libdir)/$$f; done
43-
44 fontlist.c: $(top_srcdir)/lib/fontlist.c
45 @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
46--- plotutils-2.6.orig/plot/Makefile.am 2005-11-25 20:40:13.000000000 -0800
47+++ plotutils-2.6/plot/Makefile.am 2010-10-18 01:23:37.714971379 -0700
48@@ -9,12 +9,5 @@
49
50 CLEANFILES = fontlist.c
51
52-# remove executables installed by previous versions of the package
53-
54-OBSOLETEBINS = plot2plot plot2tek plot2hpgl plot2fig plot2ps plot2X
55-
56-install-exec-hook:
57- -for f in $(OBSOLETEBINS) ; do rm -f $(bindir)/$$f; done
58-
59 fontlist.c: $(top_srcdir)/lib/fontlist.c
60 @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
61--- plotutils-2.6.orig/tek2plot/Makefile.am 2005-11-25 20:40:13.000000000 -0800
62+++ plotutils-2.6/tek2plot/Makefile.am 2010-10-18 01:23:48.011056089 -0700
63@@ -12,12 +12,5 @@
64
65 SUBDIRS = teksamples
66
67-# remove executables installed by previous versions of the package
68-
69-OBSOLETEBINS = tek2tek tek2hpgl tek2fig tek2ps tek2X
70-
71-install-exec-hook:
72- -for f in $(OBSOLETEBINS) ; do rm -f $(bindir)/$$f; done
73-
74 fontlist.c: $(top_srcdir)/lib/fontlist.c
75 @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 00000000000..258e463f660
--- /dev/null
+++ b/gnu/packages/patches/plotutils-rangecheck.patch
@@ -0,0 +1,16 @@
1Retrieved from https://raw.githubusercontent.com/gentoo/gentoo/refs/heads/master/media-libs/plotutils/files/plotutils-2.5.1-rangecheck.patch
2
3Source: Steve Tell (http://lists.gnu.org/archive/html/bug-gnu-utils/2003-12/msg00023.html)
4Upstream: Sent in 2003, not applied yet.
5Reason: Gentoo bug #47688
6--- plotutils-2.5.1.orig/graph/plotter.c 2008-09-26 23:48:15.000000000 +0200
7+++ plotutils-2.5.1/graph/plotter.c 2008-11-08 13:10:14.000000000 +0100
8@@ -1011,7 +1011,7 @@
9 multigrapher->x_trans.output_min = 0.0;
10 multigrapher->x_trans.output_max = (double)PLOT_SIZE;
11 multigrapher->x_trans.output_range = multigrapher->x_trans.output_max - multigrapher->x_trans.output_min;
12- multigrapher->x_trans.output_min = 0.0;
13+ multigrapher->y_trans.output_min = 0.0;
14 multigrapher->y_trans.output_max = (double)PLOT_SIZE;
15 multigrapher->y_trans.output_range = multigrapher->y_trans.output_max - multigrapher->y_trans.output_min;
16
diff --git a/gnu/packages/plotutils.scm b/gnu/packages/plotutils.scm
index 4968cebb50e..397709c8e40 100644
--- a/gnu/packages/plotutils.scm
+++ b/gnu/packages/plotutils.scm
@@ -3,7 +3,7 @@
3;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org> 3;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
4;;; Copyright © 2016-2025 Nicolas Goaziou <mail@nicolasgoaziou.fr> 4;;; Copyright © 2016-2025 Nicolas Goaziou <mail@nicolasgoaziou.fr>
5;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> 5;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
6;;; Copyright © 2020 Maxim Cournoyer <maxim@guixotic.coop> 6;;; Copyright © 2020, 2025 Maxim Cournoyer <maxim@guixotic.coop>
7;;; Copyright © 2022 Antero Mejr <antero@mailbox.org> 7;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
8;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com> 8;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com>
9;;; 9;;;
@@ -45,6 +45,7 @@
45 #:use-module (gnu packages flex) 45 #:use-module (gnu packages flex)
46 #:use-module (gnu packages ghostscript) 46 #:use-module (gnu packages ghostscript)
47 #:use-module (gnu packages gl) 47 #:use-module (gnu packages gl)
48 #:use-module (gnu packages graphics)
48 #:use-module (gnu packages gtk) 49 #:use-module (gnu packages gtk)
49 #:use-module (gnu packages guile) 50 #:use-module (gnu packages guile)
50 #:use-module (gnu packages image) 51 #:use-module (gnu packages image)
@@ -375,17 +376,27 @@ colors, styles, options and details.")
375 (substitute* "libplot/z_write.c" 376 (substitute* "libplot/z_write.c"
376 (("png_ptr->jmpbuf") 377 (("png_ptr->jmpbuf")
377 "png_jmpbuf (png_ptr)")) 378 "png_jmpbuf (png_ptr)"))
378 #t)) 379 ;; Unbundle libxmi.
380 (delete-file-recursively "libxmi")))
379 (patches 381 (patches
380 ;; The test suite fails on some architectures such as i686 (see: 382 (search-patches
381 ;; https://lists.gnu.org/archive/html/bug-plotutils/2016-04/msg00002.html). 383 "plotutils-c23.patch"
382 ;; The following Debian patch works around it. 384 "plotutils-configure-c99.patch"
383 (search-patches "plotutils-spline-test.patch")))) 385 "plotutils-cxx17-fix.patch"
386 "plotutils-format-security.patch"
387 "plotutils-libxmi.patch"
388 "plotutils-makefile.patch"
389 "plotutils-rangecheck.patch"
390 ;; The test suite fails on some architectures such as i686
391 ;; (see:
392 ;; https://lists.gnu.org/archive/html/bug-plotutils/2016-04/msg00002.html).
393 ;; The following Debian patch works around it.
394 "plotutils-spline-test.patch"))))
384 (build-system gnu-build-system) 395 (build-system gnu-build-system)
385 (arguments 396 (arguments
386 (list #:configure-flags 397 (list #:configure-flags
387 #~(list "--enable-libplotter" 398 #~(list "--enable-libplotter"
388 399 "--disable-static"
389 ;; On i686 some tests fail due to excess floating point 400 ;; On i686 some tests fail due to excess floating point
390 ;; precision; work around it. However, libplotter is C++ 401 ;; precision; work around it. However, libplotter is C++
391 ;; and thus unaffected by CFLAGS, but '-fexcess-precision' 402 ;; and thus unaffected by CFLAGS, but '-fexcess-precision'
@@ -395,16 +406,21 @@ colors, styles, options and details.")
395 #~())) 406 #~()))
396 407
397 #:phases 408 #:phases
398 (if (target-x86-32?) 409 #~(modify-phases %standard-phases
399 #~(modify-phases %standard-phases 410 (add-after 'unpack 'force-bootstrap
400 (add-before 'check 'skip-sloppy-test 411 (lambda _
401 (lambda _ 412 (delete-file "configure")))
402 ;; This test reveals a slight difference in the SVG 413 #$@(if (target-x86-32?)
403 ;; output due to floating point inequalities. Skip it. 414 #~((add-before 'check 'skip-sloppy-test
404 (substitute* "test/plot2svg.test" 415 (lambda _
405 (("^exit .*") "exit 77"))))) 416 ;; This test reveals a slight difference in the
406 #~%standard-phases))) 417 ;; SVG output due to floating point inequalities.
407 (inputs (list libpng libx11 libxt libxaw)) 418 ;; Skip it.
419 (substitute* "test/plot2svg.test"
420 (("^exit .*") "exit 77")))))
421 #~()))))
422 (native-inputs (list autoconf automake libtool))
423 (inputs (list libpng libx11 libxaw libxmi libxt))
408 (home-page "https://www.gnu.org/software/plotutils/") 424 (home-page "https://www.gnu.org/software/plotutils/")
409 (synopsis "Plotting utilities and library") 425 (synopsis "Plotting utilities and library")
410 (description 426 (description