projects/guix·blob wip-node-riscv64 · refs

520 lines · 22.0 KiB

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