projects/guix·blob perlssl · refs

535 lines · 22.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013-2021, 2025-2026 Ludovic Courtès <[email protected]>
3;;; Copyright © 2015 Eric Bavier <[email protected]>
4;;; Copyright © 2016-2026 Nicolas Goaziou <[email protected]>
5;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
6;;; Copyright © 2020 Maxim Cournoyer <[email protected]>
7;;; Copyright © 2022 Antero Mejr <[email protected]>
8;;; Copyright © 2023 gemmaro <[email protected]>
9;;;
10;;; This file is part of GNU Guix.
11;;;
12;;; GNU Guix is free software; you can redistribute it and/or modify it
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
17;;; GNU Guix is distributed in the hope that it will be useful, but
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25(define-module (gnu packages plotutils)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module ((guix utils) #:select (target-x86-32?))
28 #:use-module (guix build-system cmake)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system ruby)
31 #:use-module (guix download)
32 #:use-module (guix gexp)
33 #:use-module (guix git-download)
34 #:use-module (guix packages)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages algebra)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages bash)
39 #:use-module (gnu packages bdw-gc)
40 #:use-module (gnu packages bison)
41 #:use-module (gnu packages boost)
42 #:use-module (gnu packages cmake)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages emacs)
45 #:use-module (gnu packages compiler-tools)
46 #:use-module (gnu packages ghostscript)
47 #:use-module (gnu packages gl)
48 #:use-module (gnu packages gtk)
49 #:use-module (gnu packages guile)
50 #:use-module (gnu packages image)
51 #:use-module (gnu packages maths)
52 #:use-module (gnu packages ncurses)
53 #:use-module (gnu packages onc-rpc)
54 #:use-module (gnu packages perl)
55 #:use-module (gnu packages pkg-config)
56 #:use-module (gnu packages python)
57 #:use-module (gnu packages python-xyz)
58 #:use-module (gnu packages qt)
59 #:use-module (gnu packages readline)
60 #:use-module (gnu packages ruby-check)
61 #:use-module (gnu packages ruby-xyz)
62 #:use-module (gnu packages statistics)
63 #:use-module (gnu packages tex)
64 #:use-module (gnu packages texinfo)
65 #:use-module (gnu packages vulkan)
66 #:use-module (gnu packages web)
67 #:use-module (gnu packages wxwidgets)
68 #:use-module (gnu packages xorg))
69
70(define-public asymptote
71 (package
72 (name "asymptote")
73 (version "3.12")
74 (source
75 (origin
76 (method url-fetch)
77 (uri (string-append "mirror://sourceforge/asymptote/"
78 version "/asymptote-" version ".src.tgz"))
79 (sha256
80 (base32 "06wgkff6ah0jp5icj0wliy0v0y1llxkd9263jfii7wiy8sbixv7a"))
81 (modules '((guix build utils)))))
82 (build-system gnu-build-system)
83 ;; Note: The 'asy' binary retains a reference to docdir for use with its
84 ;; "help" command in interactive mode, so adding a "doc" output is not
85 ;; currently useful.
86 (native-inputs
87 (list autoconf-2.71
88 automake
89 bison
90 boost-1.83
91 cmake-minimal
92 emacs-minimal
93 flex
94 ghostscript ;for tests
95 libtool
96 perl
97 pkg-config
98 rapidjson
99 texinfo ;for generating documentation
100 (texlive-local-tree
101 (list texlive-dvisvgm
102 texlive-epsf
103 texlive-etoolbox
104 texlive-hypdoc
105 texlive-infwarerr
106 texlive-kvdefinekeys
107 texlive-kvoptions
108 texlive-media9
109 texlive-ocgx2
110 texlive-parskip
111 texlive-pdftexcmds
112 texlive-texinfo
113 texlive-type1cm))
114 vulkan-headers))
115 (inputs
116 (list bash-minimal
117 eigen
118 fftw
119 freeglut
120 glew
121 glfw
122 glm
123 glslang
124 gsl
125 libglvnd
126 libtirpc
127 ncurses
128 python
129 python-cson
130 python-numpy
131 python-pyqt
132 readline
133 spirv-tools
134 vulkan-loader
135 zlib))
136 (arguments
137 (list
138 #:modules '((guix build emacs-utils)
139 (guix build gnu-build-system)
140 (guix build utils)
141 (srfi srfi-26))
142 #:imported-modules `(,@%default-gnu-imported-modules
143 (guix build emacs-utils))
144 #:configure-flags
145 #~(list (string-append "--with-latex=" #$output "/share/texmf-dist/tex/latex")
146 (string-append "--with-context="
147 #$output
148 "/share/texmf-dist/tex/context/third"))
149 #:phases
150 #~(modify-phases %standard-phases
151 (add-after 'unpack 'use-system-rapidjson
152 (lambda* (#:key inputs #:allow-other-keys)
153 (substitute* (list "Makefile.in")
154 (("\\$\\(CMAKE\\)" all)
155 (string-append all " -DUSE_SYSTEM_RAPIDJSON=ON")))))
156 (add-after 'unpack 'move-info-location
157 ;; Build process installs info file in the unusual
158 ;; "%out/share/info/asymptote/" location. Move it to
159 ;; "%out/share/info/" so it appears in the top-level directory.
160 (lambda _
161 (substitute* "doc/png/Makefile.in"
162 (("(\\$\\(infodir\\))/asymptote" _ infodir) infodir))
163 (substitute* "doc/asymptote.texi"
164 (("asymptote/asymptote") "asymptote"))))
165 (add-before 'bootstrap 'prepare-bootstrap
166 ;; Bootstrap happens before /bin/sh is replaced with an
167 ;; appropriate location, so set it. Also clear
168 ;; "-lMachineIndependent -lOSDependent -lGenericCodeGen" from
169 ;; VULKAN_LIBS.
170 (lambda _
171 (setenv "CONFIG_SHELL" (which "bash"))
172 (substitute* (list "autogen.sh" "gc/autogen.sh" "gc/configure")
173 (("/bin/sh") (which "sh")))
174 (substitute* "configure.ac"
175 (("(^[ \t]*VULKAN_LIBS=\").*" _ pre)
176 (string-append pre "\"\n")))))
177 (replace 'bootstrap
178 (lambda _
179 (invoke "./autogen.sh")))
180 (add-before 'build 'patch-pdf-viewer
181 (lambda _
182 ;; Default to a free pdf viewer.
183 (substitute* "settings.cc"
184 (("defaultPDFViewer=\"acroread\"")
185 "defaultPDFViewer=\"gv\""))))
186 (add-before 'build 'setenv
187 (lambda _
188 (setenv "TEXMFVAR" "/tmp"))) ;for font shapes generation
189 (add-before 'check 'set-HOME
190 ;; Some tests require write access to $HOME, otherwise leading to
191 ;; "failed to create directory /homeless-shelter/.asy" error.
192 (lambda _
193 (setenv "HOME" "/tmp")))
194 (add-after 'install 'install-Emacs-data
195 (lambda _
196 ;; Install related Emacs libraries into an appropriate location.
197 (let ((lisp-dir
198 (string-append #$output "/share/emacs/site-lisp")))
199 (for-each (cut install-file <> lisp-dir)
200 (find-files "." "\\.el$"))
201 (emacs-generate-autoloads #$name lisp-dir))))
202 (add-after 'install-Emacs-data 'wrap-python-script
203 (lambda* (#:key inputs outputs #:allow-other-keys)
204 ;; Make sure 'xasy' runs with the correct PYTHONPATH.
205 (let ((path (getenv "GUIX_PYTHONPATH")))
206 (wrap-program
207 (string-append #$output "/share/asymptote/GUI/xasy.py")
208 `("GUIX_PYTHONPATH" ":" prefix (,path)))))))))
209 (home-page "https://asymptote.sourceforge.io")
210 (synopsis "Script-based vector graphics language")
211 (description
212 "Asymptote is a powerful descriptive vector graphics language for
213technical drawing, inspired by MetaPost but with an improved C++-like syntax.
214Asymptote provides for figures the same high-quality level of typesetting that
215LaTeX does for scientific text.")
216 ;; Most source files do not contain license statements, but the README
217 ;; contains: "All source files in the Asymptote project, unless explicitly
218 ;; noted otherwise, are released under version 3 (or later) of the GNU
219 ;; Lesser General Public License"
220 (license license:lgpl3+)))
221
222(define-public guile-charting
223 ;; This commit fixes a few things, including Guile 3 support, not available
224 ;; in the latest release.
225 (let ((commit "75f755b691a9f712f3b956657d01805d6a8a1b98")
226 (revision "1"))
227 (package
228 (name "guile-charting")
229 (version (git-version "0.2.0" revision commit))
230 (source (origin
231 (method git-fetch)
232 (uri (git-reference
233 (url "https://gitlab.com/wingo/guile-charting")
234 (commit commit)))
235 (file-name (git-file-name name version))
236 (sha256
237 (base32
238 "03049g7wnpyfi0r36ij4a46kc9l45jbanx02iklkjwav2n6jqnnk"))))
239 (build-system gnu-build-system)
240 (native-inputs
241 (list autoconf automake texinfo pkg-config))
242 (inputs (list guile-3.0))
243 (propagated-inputs (list guile-cairo))
244 (home-page "https://wingolog.org/projects/guile-charting/")
245 (synopsis "Create charts and graphs in Guile")
246 (description
247 "Guile-Charting is a Guile Scheme library to create bar charts and graphs
248using the Cairo drawing library.")
249 (license license:lgpl2.1+))))
250
251(define-public guile-plotutils
252 (package
253 (name "guile-plotutils")
254 (version "1.0.2")
255 (home-page "https://github.com/spk121/guile-plotutils")
256 (source (origin
257 (method git-fetch)
258 (uri (git-reference (url home-page)
259 (commit (string-append "v" version))))
260 (file-name (git-file-name name version))
261 (sha256
262 (base32
263 "1d0dq3is7j2grg806ql6y105zv3k0md5ndlpn1xgfshq6fi9yngr"))))
264 (build-system gnu-build-system)
265 (arguments
266 (list #:imported-modules `((guix build guile-build-system)
267 ,@%default-gnu-imported-modules)
268 #:modules `(((guix build guile-build-system)
269 #:select (target-guile-effective-version))
270 (guix build gnu-build-system)
271 (guix build utils))
272 #:configure-flags #~(list "--with-gnu-filesystem-hierarchy")
273 #:phases
274 #~(modify-phases %standard-phases
275 (add-before 'install 'set-library-file-name
276 (lambda* (#:key outputs #:allow-other-keys)
277 (let ((out (assoc-ref outputs "out"))
278 (version (target-guile-effective-version)))
279 ;; First install libguile-plotutils.so.
280 (invoke "make" "install-guileextensionLTLIBRARIES"
281 "-C" "src")
282
283 ;; Then change source files to refer to it.
284 (substitute* '("module/plotutils/graph.scm"
285 "module/plotutils/plot.scm")
286 (("\"libguile-plotutils\"")
287 (string-append "\"" out "/lib/guile/" version
288 "/extensions/libguile-plotutils\"")))))))))
289 (native-inputs (list autoconf-2.71 automake libtool pkg-config texinfo))
290 (inputs (list plotutils guile-3.0 zlib))
291 (synopsis "Guile bindings to the GNU Plotutils plotting libraries")
292 (description
293 "Guile-Plotutils is a Guile binding to the venerable GNU Plotutils
294plotting and graphing library. If you want to make graphs that look like you
295went to university in the 1990s, this is the library for you.")
296 (license license:gpl3+)))
297
298(define-public guile2.2-charting
299 (package
300 (inherit guile-charting)
301 (name "guile2.2-charting")
302 (inputs (list guile-2.2))
303 (propagated-inputs (list guile2.2-cairo))))
304
305(define-public ploticus
306 (package
307 (name "ploticus")
308 (version "2.42")
309 (source (origin
310 (method url-fetch)
311 (uri (string-append "mirror://sourceforge/ploticus/ploticus/"
312 version "/ploticus242_src.tar.gz"))
313 (sha256
314 (base32
315 "1c70cvfvgjh83hj1x21130wb9qfr2rc0x47cxy9kl805yjwy8a9z"))
316 (modules '((guix build utils)))
317 (patches (search-patches "ploticus-pointer-types.patch"))
318 (snippet
319 ;; Install binaries in the right place.
320 #~(begin
321 (substitute* "src/Makefile"
322 (("INSTALLBIN =.*$")
323 (string-append "INSTALLBIN = $(out)/bin")))))))
324 (build-system gnu-build-system)
325 (arguments
326 (list
327 #:tests? #f ; no tests
328 #:phases
329 #~(modify-phases %standard-phases
330 (replace 'configure (lambda _ (chdir "src")))
331 (add-before 'install 'make-target-directories
332 (lambda _
333 (mkdir-p (string-append #$output "/bin"))))
334 (add-after 'install 'install-prefabs
335 (lambda _
336 (let* ((out #$output)
337 (dir (string-append out "/share/ploticus/prefabs"))
338 (bin (string-append out "/bin")))
339 (mkdir-p dir)
340 ;; Install "prefabs".
341 (for-each
342 (lambda (file)
343 (let ((target (string-append dir "/" (basename file))))
344 (copy-file file target)))
345 (find-files "../prefabs" "."))
346 ;; Allow them to be found.
347 (wrap-program (string-append bin "/pl")
348 `("PLOTICUS_PREFABS" ":" = (,dir)))))))))
349 (inputs (list bash-minimal libpng libx11 zlib))
350 (home-page "https://ploticus.sourceforge.net/")
351 (synopsis "Command-line tool for producing plots and charts")
352 (description
353 "Ploticus is a non-interactive software package for producing plots,
354charts, and graphics from data. Ploticus is good for automated or
355just-in-time graph generation, handles date and time data nicely, and has
356basic statistical capabilities. It allows significant user control over
357colors, styles, options and details.")
358 (license license:gpl2+)))
359
360(define-public plotutils
361 (package
362 (name "plotutils")
363 (version "2.6")
364 (source (origin
365 (method url-fetch)
366 (uri (string-append "mirror://gnu/plotutils/plotutils-"
367 version ".tar.gz"))
368 (sha256
369 (base32
370 "1arkyizn5wbgvbh53aziv3s6lmd3wm9lqzkhxb3hijlp1y124hjg"))
371 (modules '((guix build utils)))
372 (snippet
373 ;; Force the use of libXaw7 instead of libXaw. When not doing
374 ;; that, libplot.la ends up containing just "-lXaw" (without
375 ;; "-L/path/to/Xaw"), due to the fact that there is no
376 ;; libXaw.la, which forces us to propagate libXaw.
377 '(begin
378 (substitute* "configure"
379 (("-lXaw")
380 "-lXaw7"))
381 ;; Use the `png_jmpbuf' accessor, as recommended since libpng
382 ;; 1.4.0 (see:
383 ;; http://www.libpng.org/pub/png/src/libpng-1.2.x-to-1.4.x-summary.txt).
384 (substitute* "libplot/z_write.c"
385 (("png_ptr->jmpbuf")
386 "png_jmpbuf (png_ptr)"))
387 #t))
388 (patches
389 ;; The test suite fails on some architectures such as i686 (see:
390 ;; https://lists.gnu.org/archive/html/bug-plotutils/2016-04/msg00002.html).
391 ;; The following Debian patch works around it.
392 (search-patches "plotutils-spline-test.patch"))))
393 (build-system gnu-build-system)
394 (arguments
395 (list #:configure-flags
396 #~(list "--enable-libplotter"
397
398 ;; On i686 some tests fail due to excess floating point
399 ;; precision; work around it. However, libplotter is C++
400 ;; and thus unaffected by CFLAGS, but '-fexcess-precision'
401 ;; is not implemented for C++ as of GCC 10.
402 #$@(if (target-x86-32?)
403 #~("CFLAGS=-g -O2 -fexcess-precision=standard")
404 #~()))
405
406 #:phases
407 (if (target-x86-32?)
408 #~(modify-phases %standard-phases
409 (add-before 'check 'skip-sloppy-test
410 (lambda _
411 ;; This test reveals a slight difference in the SVG
412 ;; output due to floating point inequalities. Skip it.
413 (substitute* "test/plot2svg.test"
414 (("^exit .*") "exit 77")))))
415 #~%standard-phases)))
416 (inputs (list libpng libx11 libxt libxaw))
417 (home-page "https://www.gnu.org/software/plotutils/")
418 (synopsis "Plotting utilities and library")
419 (description
420 "GNU Plotutils is a package for plotting and working with 2D graphics.
421It includes the C library @code{libplot} and the C++ @code{libplotter} library
422for exporting 2D vector graphics in many file formats. It also has support
423for 2D vector graphics animations. The package also contains command-line
424programs for plotting scientific data.")
425 (license license:gpl2+)))
426
427(define-public plplot
428 (package
429 (name "plplot")
430 (version "5.15.0")
431 (source (origin
432 (method url-fetch)
433 (uri (string-append "mirror://sourceforge/plplot/plplot/"
434 version "%20Source/plplot-" version
435 ".tar.gz"))
436 (sha256
437 (base32
438 "0ywccb6bs1389zjfmc9zwdvdsvlpm7vg957whh6b5a96yvcf8bdr"))
439 (modules '((guix build utils)))
440 (snippet #~(begin (delete-file-recursively "www")
441 (substitute* "CMakeLists.txt"
442 (("add_subdirectory\\(www\\)") ""))))))
443 (build-system cmake-build-system)
444 ;; TODO: Review all available options and bindings to enable them or split
445 ;; in dedicated packages, see Debian's package for inspirations:
446 ;; <https://salsa.debian.org/science-team/plplot>.
447 (arguments
448 (list
449 #:configure-flags
450 #~(list (string-append "-DLIB_DIR=" #$output "/lib")
451 "-DBUILD_TEST=TRUE"
452 "-DENABLE_wxwidgets=TRUE")))
453 (native-inputs (list pkg-config))
454 (inputs (list wxwidgets))
455 (home-page "http://plplot.org/") ;no HTTPS
456 (synopsis "Scientific plotting library with Unicode support")
457 (description
458 "PLplot is a software package for creating scientific plots which core
459library can be used to create standard x-y plots, semi-log plots, log-log
460plots, contour plots, 3D surface plots, mesh plots, bar charts and pie charts.
461Multiple graphs (of the same or different sizes) may be placed on a single
462page, and multiple pages are allowed for those device formats that support
463them.
464
465PLplot has support for plot symbols and text specified by the user in the
466UTF-8 encoding of Unicode. This means for our many Unicode-aware devices that
467plot symbols and text are only limited by the collection of glyphs normally
468available via installed system fonts. Furthermore, a large subset of our
469Unicode-aware devices also support complex text layout (CTL) languages such as
470Arabic, Hebrew, and Indic and Indic-derived CTL scripts such as Devanagari,
471Thai, Lao, and Tibetan. Thus, for these PLplot devices essentially any
472language that is supported by Unicode and installed system fonts can be used
473to label plots.")
474 (license (list license:lgpl2.0
475 license:gpl2+ ;octave bindings
476 license:bsd-2 ;docbook docs
477 license:ogl-psi1.0 ;files in data/ss
478 license:cc-by-sa3.0 ;examples/Chloe.pgm
479 license:expat)))) ;Cmake files
480
481(define-public ruby-unicode-plot
482 (package
483 (name "ruby-unicode-plot")
484 (version "0.0.5")
485 ;; Source at RubyGems.org doesn't have test fixtures.
486 (source (origin
487 (method git-fetch)
488 (uri (git-reference
489 (url
490 "https://github.com/red-data-tools/unicode_plot.rb")
491 (commit (string-append "v" version))))
492 (file-name (git-file-name name version))
493 (sha256
494 (base32
495 "0g67brnb7zp1xx9cp1x7bmyxwnvi2i8gplw7p1j7cppzin4kr1vj"))))
496 (build-system ruby-build-system)
497 (native-inputs (list bundler ruby-rake ruby-test-unit ruby-yard))
498 (propagated-inputs (list ruby-enumerable-statistics))
499 (synopsis "Library to plot your data by Unicode characters")
500 (description "UnicodePlot provides the feature to make charts with Unicode
501characters. Supported charts are: barplot, boxplot, densityplot,
502histogram, lineplot, and scatterplot.")
503 (home-page "https://github.com/red-data-tools/unicode_plot.rb")
504 (license license:expat)))
505
506(define-public youplot
507 (package
508 (name "youplot")
509 (version "0.4.6")
510 ;; Source at RubyGems.org doesn't have tests.
511 (source (origin
512 (method git-fetch)
513 (uri (git-reference
514 (url "https://github.com/red-data-tools/YouPlot")
515 (commit (string-append "v" version))))
516 (file-name (git-file-name name version))
517 (sha256
518 (base32
519 "1r9s8ls4f8w36fmja9vcl9wqdl9ikf8w7565srcn7i2wyza9bf7j"))))
520 (build-system ruby-build-system)
521 (native-inputs (list ruby-rake ruby-simplecov ruby-test-unit))
522 (propagated-inputs (list ruby-unicode-plot))
523 (synopsis "Command line tool that draw plots on the terminal")
524 (description
525 "YouPlot is a command line tool that draws plots on the terminal,
526powered by UnicodePlot gem. It provides commands @command{youplot}
527and @command{uplot} (shorthand) are provided, and supports chart types
528of barplot, histogram, lineplot, scatter, density, boxplot, and count.")
529 (home-page "https://github.com/red-data-tools/YouPlot")
530 (license license:expat)))
531
532;;;
533;;; Avoid adding new packages to the end of this file. To reduce the chances
534;;; of a merge conflict, place them above in alphabetic order.
535;;;