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)")) | |
6cbee49d | 76 | #t)))) |
bb3fe7fc | 77 | (build-system gnu-build-system) |
f977fe92 MC |
78 | (arguments |
79 | `(#:configure-flags (list "--enable-libplotter"))) | |
fa6141ec LC |
80 | (inputs `(("libpng" ,libpng) |
81 | ("libx11" ,libx11) | |
ceae3fef LC |
82 | ("libxt" ,libxt) |
83 | ("libxaw" ,libxaw))) | |
f977fe92 | 84 | (home-page "https://www.gnu.org/software/plotutils/") |
bb3fe7fc LC |
85 | (synopsis "Plotting utilities and library") |
86 | (description | |
f977fe92 MC |
87 | "GNU Plotutils is a package for plotting and working with 2D graphics. |
88 | It includes the C library @code{libplot} and the C++ @code{libplotter} library | |
89 | for exporting 2D vector graphics in many file formats. It also has support | |
90 | for 2D vector graphics animations. The package also contains command-line | |
91 | programs for plotting scientific data.") | |
40e9de2a | 92 | (license license:gpl2+))) |
00ebe474 LC |
93 | |
94 | (define-public guile-charting | |
95 | (package | |
96 | (name "guile-charting") | |
97 | (version "0.2.0") | |
98 | (source (origin | |
99 | (method url-fetch) | |
100 | (uri (string-append "http://wingolog.org/pub/guile-charting/" | |
101 | "guile-charting-" version ".tar.gz")) | |
102 | (sha256 | |
103 | (base32 | |
ece7731e LC |
104 | "0w5qiyv9v0ip5li22x762bm48g8xnw281w66iyw094zdw611pb2m")) |
105 | (modules '((guix build utils))) | |
106 | (snippet | |
107 | '(begin | |
2d3a622d LC |
108 | ;; Allow builds with Guile 3.0. |
109 | (substitute* "configure" | |
110 | (("2\\.2 2\\.0") | |
111 | "3.0 2.2 2.0")) | |
112 | ||
ece7731e LC |
113 | ;; By default, .go files would be installed to |
114 | ;; $libdir/…/ccache instead of $libdir/…/site-ccache. Fix | |
115 | ;; that. | |
116 | (substitute* (find-files "." "^Makefile\\.in$") | |
117 | (("/ccache") "/site-ccache")) | |
118 | #t)))) | |
00ebe474 LC |
119 | (build-system gnu-build-system) |
120 | (native-inputs `(("pkg-config" ,pkg-config))) | |
b6bee63b | 121 | (inputs `(("guile" ,guile-3.0))) |
00ebe474 LC |
122 | (propagated-inputs `(("guile-cairo" ,guile-cairo))) |
123 | (home-page "http://wingolog.org/software/guile-charting/") | |
124 | (synopsis "Create charts and graphs in Guile") | |
125 | (description | |
126 | "Guile-Charting is a Guile Scheme library to create bar charts and graphs | |
127 | using the Cairo drawing library.") | |
40e9de2a LC |
128 | (license license:lgpl2.1+))) |
129 | ||
b6bee63b | 130 | (define-public guile2.2-charting |
2d3a622d LC |
131 | (package |
132 | (inherit guile-charting) | |
b6bee63b LC |
133 | (name "guile2.2-charting") |
134 | (inputs `(("guile" ,guile-2.2))) | |
135 | (propagated-inputs `(("guile-cairo" ,guile2.2-cairo))))) | |
136 | ||
137 | (define-public guile3.0-charting | |
138 | (deprecated-package "guile3.0-charting" guile-charting)) | |
2d3a622d | 139 | |
40e9de2a LC |
140 | (define-public ploticus |
141 | (package | |
142 | (name "ploticus") | |
143 | (version "2.42") | |
144 | (source (origin | |
145 | (method url-fetch) | |
146 | (uri (string-append "mirror://sourceforge/ploticus/ploticus/" | |
147 | version "/ploticus242_src.tar.gz")) | |
148 | (sha256 | |
149 | (base32 | |
150 | "1c70cvfvgjh83hj1x21130wb9qfr2rc0x47cxy9kl805yjwy8a9z")) | |
151 | (modules '((guix build utils))) | |
152 | (snippet | |
153 | ;; Install binaries in the right place. | |
6cbee49d MW |
154 | '(begin |
155 | (substitute* "src/Makefile" | |
156 | (("INSTALLBIN =.*$") | |
157 | (string-append "INSTALLBIN = $(out)/bin"))) | |
158 | #t)))) | |
40e9de2a LC |
159 | (build-system gnu-build-system) |
160 | (arguments | |
161 | '(#:tests? #f | |
162 | #:phases | |
163 | (modify-phases %standard-phases | |
f8503e2b LC |
164 | (replace 'configure (lambda _ (chdir "src"))) |
165 | (add-before 'install 'make-target-directories | |
40e9de2a LC |
166 | (lambda* (#:key outputs #:allow-other-keys) |
167 | (let ((out (assoc-ref outputs "out"))) | |
168 | (mkdir-p (string-append out "/bin")) | |
169 | #t))) | |
f8503e2b | 170 | (add-after 'install 'install-prefabs |
40e9de2a LC |
171 | (lambda* (#:key outputs #:allow-other-keys) |
172 | (let* ((out (assoc-ref outputs "out")) | |
173 | (dir (string-append out | |
174 | "/share/ploticus/prefabs")) | |
175 | (bin (string-append out "/bin"))) | |
176 | (mkdir-p dir) | |
177 | ||
178 | ;; Install "prefabs". | |
179 | (for-each (lambda (file) | |
180 | (let ((target | |
181 | (string-append dir "/" | |
182 | (basename file)))) | |
183 | (copy-file file target))) | |
184 | (find-files "../prefabs" ".")) | |
185 | ||
186 | ;; Allow them to be found. | |
187 | (wrap-program (string-append bin "/pl") | |
188 | `("PLOTICUS_PREFABS" ":" = (,dir))))))))) | |
189 | (inputs | |
190 | `(("libpng" ,libpng) | |
191 | ("libx11" ,libx11) | |
192 | ("zlib" ,zlib))) | |
193 | (home-page "http://ploticus.sourceforge.net/") | |
194 | (synopsis "Command-line tool for producing plots and charts") | |
195 | (description | |
196 | "Ploticus is a non-interactive software package for producing plots, | |
197 | charts, and graphics from data. Ploticus is good for automated or | |
198 | just-in-time graph generation, handles date and time data nicely, and has | |
199 | basic statistical capabilities. It allows significant user control over | |
200 | colors, styles, options and details.") | |
201 | (license license:gpl2+))) | |
20977871 EB |
202 | |
203 | (define-public asymptote | |
204 | (package | |
205 | (name "asymptote") | |
1a7247c6 | 206 | (version "2.65") |
c3945380 NG |
207 | (source |
208 | (origin | |
209 | (method url-fetch) | |
210 | (uri (string-append "mirror://sourceforge/asymptote/" | |
211 | version "/asymptote-" version ".src.tgz")) | |
212 | (sha256 | |
1a7247c6 | 213 | (base32 "0i4qqlvzz69mhdq6kf689sa9rxfb1cwsg1nx88hryb291hddgqqm")))) |
20977871 EB |
214 | (build-system gnu-build-system) |
215 | ;; Note: The 'asy' binary retains a reference to docdir for use with its | |
216 | ;; "help" command in interactive mode, so adding a "doc" output is not | |
217 | ;; currently useful. | |
218 | (native-inputs | |
4906a0b2 NG |
219 | `(("emacs" ,emacs-minimal) |
220 | ("gs" ,ghostscript) ;For tests | |
221 | ("perl" ,perl) | |
1b4c5af2 | 222 | ("texinfo" ,texinfo) ;For generating documentation |
15e57838 | 223 | ;; For the manual and the tests. |
f75aa97f | 224 | ("texlive" ,(texlive-union (list texlive-amsfonts |
d9de8fbb | 225 | texlive-epsf |
36cf1ee7 | 226 | texlive-etoolbox |
d9de8fbb | 227 | texlive-latex-base |
15e57838 PN |
228 | texlive-latex-geometry |
229 | texlive-latex-graphics | |
8983a52c | 230 | texlive-latex-oberdiek ; for ifluatex |
15e57838 | 231 | texlive-latex-parskip |
4906a0b2 | 232 | texlive-tex-texinfo))))) |
20977871 EB |
233 | (inputs |
234 | `(("fftw" ,fftw) | |
235 | ("freeglut" ,freeglut) | |
4906a0b2 NG |
236 | ("glew" ,glew) |
237 | ("glm" ,glm) | |
20977871 | 238 | ("gsl" ,gsl) |
8c986ab1 | 239 | ("libgc" ,libgc) |
4906a0b2 | 240 | ("python" ,python) |
1b4c5af2 | 241 | ("python-cson" ,python-cson) |
584e46b1 | 242 | ("python-numpy" ,python-numpy) |
1b4c5af2 | 243 | ("python-pyqt" ,python-pyqt) |
20977871 EB |
244 | ("readline" ,readline) |
245 | ("zlib" ,zlib))) | |
246 | (arguments | |
80ed14d3 NG |
247 | `(#:modules ((guix build emacs-utils) |
248 | (guix build gnu-build-system) | |
249 | (guix build utils) | |
250 | (srfi srfi-26)) | |
251 | #:imported-modules (,@%gnu-build-system-modules | |
252 | (guix build emacs-utils)) | |
253 | #:configure-flags | |
20977871 EB |
254 | (list (string-append "--enable-gc=" (assoc-ref %build-inputs "libgc")) |
255 | (string-append "--with-latex=" | |
256 | (assoc-ref %outputs "out") | |
257 | "/share/texmf/tex/latex") | |
258 | (string-append "--with-context=" | |
259 | (assoc-ref %outputs "out") | |
260 | "/share/texmf/tex/context/third")) | |
acb31b5d NG |
261 | #:phases |
262 | (modify-phases %standard-phases | |
4906a0b2 NG |
263 | (add-after 'unpack 'fix-build |
264 | ;; XXX: Build process complains about missing "config.h" | |
265 | ;; and "primitives.h" files. | |
266 | (lambda _ | |
267 | (substitute* (find-files "." "\\.in$") | |
268 | (("#include <primitives.h>") "#include \"primitives.h\"")) | |
269 | (invoke "touch" "prc/config.h"))) | |
55a604db | 270 | (add-after 'unpack 'move-info-location |
530b3a19 | 271 | ;; Build process installs info file in the unusual |
55a604db NG |
272 | ;; "%out/share/info/asymptote/" location. Move it to |
273 | ;; "%out/share/info/" so it appears in the top-level directory. | |
274 | (lambda _ | |
275 | (substitute* "doc/png/Makefile.in" | |
276 | (("(\\$\\(infodir\\))/asymptote" _ infodir) infodir)) | |
325a2e35 NG |
277 | (substitute* "doc/asymptote.texi" |
278 | (("asymptote/asymptote") "asymptote")) | |
55a604db | 279 | #t)) |
acb31b5d NG |
280 | (add-before 'build 'patch-pdf-viewer |
281 | (lambda _ | |
80ed14d3 | 282 | ;; Default to a free pdf viewer. |
acb31b5d NG |
283 | (substitute* "settings.cc" |
284 | (("defaultPDFViewer=\"acroread\"") | |
80ed14d3 NG |
285 | "defaultPDFViewer=\"gv\"")) |
286 | #t)) | |
acb31b5d NG |
287 | (add-before 'check 'set-HOME |
288 | ;; Some tests require write access to $HOME, otherwise leading to | |
289 | ;; "failed to create directory /homeless-shelter/.asy" error. | |
290 | (lambda _ | |
80ed14d3 NG |
291 | (setenv "HOME" "/tmp") |
292 | #t)) | |
293 | (add-after 'install 'install-Emacs-data | |
294 | (lambda* (#:key outputs #:allow-other-keys) | |
295 | ;; Install related Emacs libraries into an appropriate location. | |
296 | (let* ((out (assoc-ref outputs "out")) | |
297 | (lisp-dir (string-append out "/share/emacs/site-lisp"))) | |
298 | (for-each (cut install-file <> lisp-dir) | |
299 | (find-files "." "\\.el$")) | |
300 | (emacs-generate-autoloads ,name lisp-dir)) | |
1b4c5af2 NG |
301 | #t)) |
302 | (add-after 'install-Emacs-data 'wrap-python-script | |
303 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
304 | ;; Make sure 'xasy' runs with the correct PYTHONPATH. | |
305 | (let* ((out (assoc-ref outputs "out")) | |
306 | (path (getenv "PYTHONPATH"))) | |
307 | (wrap-program (string-append out "/share/asymptote/GUI/xasy.py") | |
308 | `("PYTHONPATH" ":" prefix (,path)))) | |
80ed14d3 | 309 | #t))))) |
20977871 EB |
310 | (home-page "http://asymptote.sourceforge.net") |
311 | (synopsis "Script-based vector graphics language") | |
312 | (description | |
313 | "Asymptote is a powerful descriptive vector graphics language for | |
314 | technical drawing, inspired by MetaPost but with an improved C++-like syntax. | |
315 | Asymptote provides for figures the same high-quality level of typesetting that | |
316 | LaTeX does for scientific text.") | |
317 | ;; Most source files do not contain license statements, but the README | |
318 | ;; contains: "All source files in the Asymptote project, unless explicitly | |
319 | ;; noted otherwise, are released under version 3 (or later) of the GNU | |
320 | ;; Lesser General Public License" | |
321 | (license license:lgpl3+))) |