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