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