Commit | Line | Data |
---|---|---|
bb3fe7fc | 1 | ;;; GNU Guix --- Functional package management for GNU |
2d3a622d | 2 | ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org> |
20977871 | 3 | ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org> |
49181f84 | 4 | ;;; Copyright © 2016, 2017, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
fb5f8f01 | 5 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
f977fe92 | 6 | ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
bb3fe7fc LC |
7 | ;;; |
8 | ;;; This file is part of GNU Guix. | |
9 | ;;; | |
10 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
11 | ;;; under the terms of the GNU General Public License as published by | |
12 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
13 | ;;; your option) any later version. | |
14 | ;;; | |
15 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
16 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;;; GNU General Public License for more details. | |
19 | ;;; | |
20 | ;;; You should have received a copy of the GNU General Public License | |
21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
22 | ||
23 | (define-module (gnu packages plotutils) | |
40e9de2a | 24 | #:use-module ((guix licenses) #:prefix license:) |
bb3fe7fc LC |
25 | #:use-module (guix packages) |
26 | #:use-module (guix download) | |
27 | #:use-module (guix build-system gnu) | |
20977871 EB |
28 | #:use-module (gnu packages algebra) |
29 | #:use-module (gnu packages bdw-gc) | |
80ed14d3 | 30 | #:use-module (gnu packages emacs) |
fa6141ec | 31 | #:use-module (gnu packages xorg) |
e55354b8 | 32 | #:use-module (gnu packages image) |
20977871 | 33 | #:use-module (gnu packages ghostscript) |
00ebe474 | 34 | #:use-module (gnu packages guile) |
20977871 | 35 | #:use-module (gnu packages gl) |
00ebe474 | 36 | #:use-module (gnu packages gtk) |
20977871 EB |
37 | #:use-module (gnu packages maths) |
38 | #:use-module (gnu packages perl) | |
00ebe474 | 39 | #:use-module (gnu packages pkg-config) |
20977871 | 40 | #:use-module (gnu packages python) |
1b4c5af2 | 41 | #:use-module (gnu packages python-xyz) |
20977871 | 42 | #:use-module (gnu packages readline) |
1b4c5af2 | 43 | #:use-module (gnu packages qt) |
20977871 | 44 | #:use-module (gnu packages texinfo) |
8f9ac901 | 45 | #:use-module (gnu packages tex) |
40e9de2a | 46 | #:use-module (gnu packages compression) |
8e5e7299 | 47 | #:use-module (gnu packages)) |
bb3fe7fc LC |
48 | |
49 | (define-public plotutils | |
50 | (package | |
51 | (name "plotutils") | |
52 | (version "2.6") | |
53 | (source (origin | |
54 | (method url-fetch) | |
55 | (uri (string-append "mirror://gnu/plotutils/plotutils-" | |
56 | version ".tar.gz")) | |
57 | (sha256 | |
58 | (base32 | |
01eafd38 | 59 | "1arkyizn5wbgvbh53aziv3s6lmd3wm9lqzkhxb3hijlp1y124hjg")) |
ceae3fef LC |
60 | (modules '((guix build utils))) |
61 | (snippet | |
62 | ;; Force the use of libXaw7 instead of libXaw. When not doing | |
63 | ;; that, libplot.la ends up containing just "-lXaw" (without | |
64 | ;; "-L/path/to/Xaw"), due to the fact that there is no | |
65 | ;; libXaw.la, which forces us to propagate libXaw. | |
6cbee49d MW |
66 | '(begin |
67 | (substitute* "configure" | |
68 | (("-lXaw") | |
69 | "-lXaw7")) | |
f977fe92 MC |
70 | ;; Use the `png_jmpbuf' accessor, as recommended since libpng |
71 | ;; 1.4.0 (see: | |
72 | ;; http://www.libpng.org/pub/png/src/libpng-1.2.x-to-1.4.x-summary.txt). | |
73 | (substitute* "libplot/z_write.c" | |
74 | (("png_ptr->jmpbuf") | |
75 | "png_jmpbuf (png_ptr)")) | |
2bd84c50 MC |
76 | #t)) |
77 | (patches | |
78 | ;; The test suite fails on some architectures such as i686 (see: | |
79 | ;; https://lists.gnu.org/archive/html/bug-plotutils/2016-04/msg00002.html). | |
80 | ;; The following Debian patch works around it. | |
81 | (search-patches "plotutils-spline-test.patch")))) | |
bb3fe7fc | 82 | (build-system gnu-build-system) |
f977fe92 MC |
83 | (arguments |
84 | `(#:configure-flags (list "--enable-libplotter"))) | |
fa6141ec LC |
85 | (inputs `(("libpng" ,libpng) |
86 | ("libx11" ,libx11) | |
ceae3fef LC |
87 | ("libxt" ,libxt) |
88 | ("libxaw" ,libxaw))) | |
f977fe92 | 89 | (home-page "https://www.gnu.org/software/plotutils/") |
bb3fe7fc LC |
90 | (synopsis "Plotting utilities and library") |
91 | (description | |
f977fe92 MC |
92 | "GNU Plotutils is a package for plotting and working with 2D graphics. |
93 | It includes the C library @code{libplot} and the C++ @code{libplotter} library | |
94 | for exporting 2D vector graphics in many file formats. It also has support | |
95 | for 2D vector graphics animations. The package also contains command-line | |
96 | programs for plotting scientific data.") | |
40e9de2a | 97 | (license license:gpl2+))) |
00ebe474 LC |
98 | |
99 | (define-public guile-charting | |
100 | (package | |
101 | (name "guile-charting") | |
102 | (version "0.2.0") | |
103 | (source (origin | |
104 | (method url-fetch) | |
105 | (uri (string-append "http://wingolog.org/pub/guile-charting/" | |
106 | "guile-charting-" version ".tar.gz")) | |
107 | (sha256 | |
108 | (base32 | |
ece7731e LC |
109 | "0w5qiyv9v0ip5li22x762bm48g8xnw281w66iyw094zdw611pb2m")) |
110 | (modules '((guix build utils))) | |
111 | (snippet | |
112 | '(begin | |
2d3a622d LC |
113 | ;; Allow builds with Guile 3.0. |
114 | (substitute* "configure" | |
115 | (("2\\.2 2\\.0") | |
116 | "3.0 2.2 2.0")) | |
117 | ||
ece7731e LC |
118 | ;; By default, .go files would be installed to |
119 | ;; $libdir/…/ccache instead of $libdir/…/site-ccache. Fix | |
120 | ;; that. | |
121 | (substitute* (find-files "." "^Makefile\\.in$") | |
122 | (("/ccache") "/site-ccache")) | |
123 | #t)))) | |
00ebe474 LC |
124 | (build-system gnu-build-system) |
125 | (native-inputs `(("pkg-config" ,pkg-config))) | |
b6bee63b | 126 | (inputs `(("guile" ,guile-3.0))) |
00ebe474 LC |
127 | (propagated-inputs `(("guile-cairo" ,guile-cairo))) |
128 | (home-page "http://wingolog.org/software/guile-charting/") | |
129 | (synopsis "Create charts and graphs in Guile") | |
130 | (description | |
131 | "Guile-Charting is a Guile Scheme library to create bar charts and graphs | |
132 | using the Cairo drawing library.") | |
40e9de2a LC |
133 | (license license:lgpl2.1+))) |
134 | ||
b6bee63b | 135 | (define-public guile2.2-charting |
2d3a622d LC |
136 | (package |
137 | (inherit guile-charting) | |
b6bee63b LC |
138 | (name "guile2.2-charting") |
139 | (inputs `(("guile" ,guile-2.2))) | |
140 | (propagated-inputs `(("guile-cairo" ,guile2.2-cairo))))) | |
141 | ||
142 | (define-public guile3.0-charting | |
143 | (deprecated-package "guile3.0-charting" guile-charting)) | |
2d3a622d | 144 | |
40e9de2a LC |
145 | (define-public ploticus |
146 | (package | |
147 | (name "ploticus") | |
148 | (version "2.42") | |
149 | (source (origin | |
150 | (method url-fetch) | |
151 | (uri (string-append "mirror://sourceforge/ploticus/ploticus/" | |
152 | version "/ploticus242_src.tar.gz")) | |
153 | (sha256 | |
154 | (base32 | |
155 | "1c70cvfvgjh83hj1x21130wb9qfr2rc0x47cxy9kl805yjwy8a9z")) | |
156 | (modules '((guix build utils))) | |
157 | (snippet | |
158 | ;; Install binaries in the right place. | |
6cbee49d MW |
159 | '(begin |
160 | (substitute* "src/Makefile" | |
161 | (("INSTALLBIN =.*$") | |
162 | (string-append "INSTALLBIN = $(out)/bin"))) | |
163 | #t)))) | |
40e9de2a LC |
164 | (build-system gnu-build-system) |
165 | (arguments | |
166 | '(#:tests? #f | |
167 | #:phases | |
168 | (modify-phases %standard-phases | |
f8503e2b LC |
169 | (replace 'configure (lambda _ (chdir "src"))) |
170 | (add-before 'install 'make-target-directories | |
40e9de2a LC |
171 | (lambda* (#:key outputs #:allow-other-keys) |
172 | (let ((out (assoc-ref outputs "out"))) | |
173 | (mkdir-p (string-append out "/bin")) | |
174 | #t))) | |
f8503e2b | 175 | (add-after 'install 'install-prefabs |
40e9de2a LC |
176 | (lambda* (#:key outputs #:allow-other-keys) |
177 | (let* ((out (assoc-ref outputs "out")) | |
178 | (dir (string-append out | |
179 | "/share/ploticus/prefabs")) | |
180 | (bin (string-append out "/bin"))) | |
181 | (mkdir-p dir) | |
182 | ||
183 | ;; Install "prefabs". | |
184 | (for-each (lambda (file) | |
185 | (let ((target | |
186 | (string-append dir "/" | |
187 | (basename file)))) | |
188 | (copy-file file target))) | |
189 | (find-files "../prefabs" ".")) | |
190 | ||
191 | ;; Allow them to be found. | |
192 | (wrap-program (string-append bin "/pl") | |
193 | `("PLOTICUS_PREFABS" ":" = (,dir))))))))) | |
194 | (inputs | |
195 | `(("libpng" ,libpng) | |
196 | ("libx11" ,libx11) | |
197 | ("zlib" ,zlib))) | |
198 | (home-page "http://ploticus.sourceforge.net/") | |
199 | (synopsis "Command-line tool for producing plots and charts") | |
200 | (description | |
201 | "Ploticus is a non-interactive software package for producing plots, | |
202 | charts, and graphics from data. Ploticus is good for automated or | |
203 | just-in-time graph generation, handles date and time data nicely, and has | |
204 | basic statistical capabilities. It allows significant user control over | |
205 | colors, styles, options and details.") | |
206 | (license license:gpl2+))) | |
20977871 EB |
207 | |
208 | (define-public asymptote | |
209 | (package | |
210 | (name "asymptote") | |
64a0edf3 | 211 | (version "2.67") |
c3945380 NG |
212 | (source |
213 | (origin | |
214 | (method url-fetch) | |
215 | (uri (string-append "mirror://sourceforge/asymptote/" | |
216 | version "/asymptote-" version ".src.tgz")) | |
217 | (sha256 | |
64a0edf3 | 218 | (base32 "16rdwxal27fikzfqsm2sb8ji78whpxl98rdyyp0ky2qlh55mf7la")))) |
20977871 EB |
219 | (build-system gnu-build-system) |
220 | ;; Note: The 'asy' binary retains a reference to docdir for use with its | |
221 | ;; "help" command in interactive mode, so adding a "doc" output is not | |
222 | ;; currently useful. | |
223 | (native-inputs | |
4906a0b2 NG |
224 | `(("emacs" ,emacs-minimal) |
225 | ("gs" ,ghostscript) ;For tests | |
226 | ("perl" ,perl) | |
1b4c5af2 | 227 | ("texinfo" ,texinfo) ;For generating documentation |
15e57838 | 228 | ;; For the manual and the tests. |
f75aa97f | 229 | ("texlive" ,(texlive-union (list texlive-amsfonts |
d9de8fbb | 230 | texlive-epsf |
36cf1ee7 | 231 | texlive-etoolbox |
d9de8fbb | 232 | texlive-latex-base |
15e57838 PN |
233 | texlive-latex-geometry |
234 | texlive-latex-graphics | |
8983a52c | 235 | texlive-latex-oberdiek ; for ifluatex |
15e57838 | 236 | texlive-latex-parskip |
4906a0b2 | 237 | texlive-tex-texinfo))))) |
20977871 EB |
238 | (inputs |
239 | `(("fftw" ,fftw) | |
240 | ("freeglut" ,freeglut) | |
4906a0b2 NG |
241 | ("glew" ,glew) |
242 | ("glm" ,glm) | |
20977871 | 243 | ("gsl" ,gsl) |
8c986ab1 | 244 | ("libgc" ,libgc) |
4906a0b2 | 245 | ("python" ,python) |
1b4c5af2 | 246 | ("python-cson" ,python-cson) |
584e46b1 | 247 | ("python-numpy" ,python-numpy) |
1b4c5af2 | 248 | ("python-pyqt" ,python-pyqt) |
20977871 EB |
249 | ("readline" ,readline) |
250 | ("zlib" ,zlib))) | |
251 | (arguments | |
80ed14d3 NG |
252 | `(#:modules ((guix build emacs-utils) |
253 | (guix build gnu-build-system) | |
254 | (guix build utils) | |
255 | (srfi srfi-26)) | |
256 | #:imported-modules (,@%gnu-build-system-modules | |
257 | (guix build emacs-utils)) | |
258 | #:configure-flags | |
20977871 EB |
259 | (list (string-append "--enable-gc=" (assoc-ref %build-inputs "libgc")) |
260 | (string-append "--with-latex=" | |
261 | (assoc-ref %outputs "out") | |
262 | "/share/texmf/tex/latex") | |
263 | (string-append "--with-context=" | |
264 | (assoc-ref %outputs "out") | |
265 | "/share/texmf/tex/context/third")) | |
acb31b5d NG |
266 | #:phases |
267 | (modify-phases %standard-phases | |
4906a0b2 NG |
268 | (add-after 'unpack 'fix-build |
269 | ;; XXX: Build process complains about missing "config.h" | |
270 | ;; and "primitives.h" files. | |
271 | (lambda _ | |
272 | (substitute* (find-files "." "\\.in$") | |
273 | (("#include <primitives.h>") "#include \"primitives.h\"")) | |
274 | (invoke "touch" "prc/config.h"))) | |
55a604db | 275 | (add-after 'unpack 'move-info-location |
530b3a19 | 276 | ;; Build process installs info file in the unusual |
55a604db NG |
277 | ;; "%out/share/info/asymptote/" location. Move it to |
278 | ;; "%out/share/info/" so it appears in the top-level directory. | |
279 | (lambda _ | |
280 | (substitute* "doc/png/Makefile.in" | |
281 | (("(\\$\\(infodir\\))/asymptote" _ infodir) infodir)) | |
325a2e35 NG |
282 | (substitute* "doc/asymptote.texi" |
283 | (("asymptote/asymptote") "asymptote")) | |
55a604db | 284 | #t)) |
acb31b5d NG |
285 | (add-before 'build 'patch-pdf-viewer |
286 | (lambda _ | |
80ed14d3 | 287 | ;; Default to a free pdf viewer. |
acb31b5d NG |
288 | (substitute* "settings.cc" |
289 | (("defaultPDFViewer=\"acroread\"") | |
80ed14d3 NG |
290 | "defaultPDFViewer=\"gv\"")) |
291 | #t)) | |
acb31b5d NG |
292 | (add-before 'check 'set-HOME |
293 | ;; Some tests require write access to $HOME, otherwise leading to | |
294 | ;; "failed to create directory /homeless-shelter/.asy" error. | |
295 | (lambda _ | |
80ed14d3 NG |
296 | (setenv "HOME" "/tmp") |
297 | #t)) | |
298 | (add-after 'install 'install-Emacs-data | |
299 | (lambda* (#:key outputs #:allow-other-keys) | |
300 | ;; Install related Emacs libraries into an appropriate location. | |
301 | (let* ((out (assoc-ref outputs "out")) | |
302 | (lisp-dir (string-append out "/share/emacs/site-lisp"))) | |
303 | (for-each (cut install-file <> lisp-dir) | |
304 | (find-files "." "\\.el$")) | |
305 | (emacs-generate-autoloads ,name lisp-dir)) | |
1b4c5af2 NG |
306 | #t)) |
307 | (add-after 'install-Emacs-data 'wrap-python-script | |
308 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
309 | ;; Make sure 'xasy' runs with the correct PYTHONPATH. | |
310 | (let* ((out (assoc-ref outputs "out")) | |
311 | (path (getenv "PYTHONPATH"))) | |
312 | (wrap-program (string-append out "/share/asymptote/GUI/xasy.py") | |
313 | `("PYTHONPATH" ":" prefix (,path)))) | |
80ed14d3 | 314 | #t))))) |
20977871 EB |
315 | (home-page "http://asymptote.sourceforge.net") |
316 | (synopsis "Script-based vector graphics language") | |
317 | (description | |
318 | "Asymptote is a powerful descriptive vector graphics language for | |
319 | technical drawing, inspired by MetaPost but with an improved C++-like syntax. | |
320 | Asymptote provides for figures the same high-quality level of typesetting that | |
321 | LaTeX does for scientific text.") | |
322 | ;; Most source files do not contain license statements, but the README | |
323 | ;; contains: "All source files in the Asymptote project, unless explicitly | |
324 | ;; noted otherwise, are released under version 3 (or later) of the GNU | |
325 | ;; Lesser General Public License" | |
326 | (license license:lgpl3+))) |