gnu: sdl-mixer: Enable fluidsynth MIDI backend.
[jackhill/guix/guix.git] / gnu / packages / plotutils.scm
CommitLineData
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.
80It includes a library, \"libplot\", for C and C++ for exporting 2D vector
81graphics in many file formats. It also has support for 2D vector graphics
82animations. The package also contains command-line programs for plotting
83scientific 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
114using 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,
174charts, and graphics from data. Ploticus is good for automated or
175just-in-time graph generation, handles date and time data nicely, and has
176basic statistical capabilities. It allows significant user control over
177colors, styles, options and details.")
178 (license license:gpl2+)))
20977871
EB
179
180(define-public asymptote
181 (package
182 (name "asymptote")
d7d23c86 183 (version "2.61")
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
d7d23c86 190 "0gcd75yixn67lpiky70yhaa0ylr8g1cn65bpr9zx78h2vrpsmk7k"))))
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 200 ;; For the manual and the tests.
f75aa97f 201 ("texlive" ,(texlive-union (list texlive-amsfonts
d9de8fbb
NG
202 texlive-epsf
203 texlive-latex-base
15e57838
PN
204 texlive-latex-geometry
205 texlive-latex-graphics
8983a52c 206 texlive-latex-oberdiek ; for ifluatex
15e57838 207 texlive-latex-parskip
4906a0b2 208 texlive-tex-texinfo)))))
20977871
EB
209 (inputs
210 `(("fftw" ,fftw)
211 ("freeglut" ,freeglut)
4906a0b2
NG
212 ("glew" ,glew)
213 ("glm" ,glm)
20977871 214 ("gsl" ,gsl)
8c986ab1 215 ("libgc" ,libgc)
4906a0b2 216 ("python" ,python)
20977871
EB
217 ("readline" ,readline)
218 ("zlib" ,zlib)))
219 (arguments
80ed14d3
NG
220 `(#:modules ((guix build emacs-utils)
221 (guix build gnu-build-system)
222 (guix build utils)
223 (srfi srfi-26))
224 #:imported-modules (,@%gnu-build-system-modules
225 (guix build emacs-utils))
226 #:configure-flags
20977871
EB
227 (list (string-append "--enable-gc=" (assoc-ref %build-inputs "libgc"))
228 (string-append "--with-latex="
229 (assoc-ref %outputs "out")
230 "/share/texmf/tex/latex")
231 (string-append "--with-context="
232 (assoc-ref %outputs "out")
233 "/share/texmf/tex/context/third"))
acb31b5d
NG
234 #:phases
235 (modify-phases %standard-phases
4906a0b2
NG
236 (add-after 'unpack 'fix-build
237 ;; XXX: Build process complains about missing "config.h"
238 ;; and "primitives.h" files.
239 (lambda _
240 (substitute* (find-files "." "\\.in$")
241 (("#include <primitives.h>") "#include \"primitives.h\""))
242 (invoke "touch" "prc/config.h")))
55a604db 243 (add-after 'unpack 'move-info-location
530b3a19 244 ;; Build process installs info file in the unusual
55a604db
NG
245 ;; "%out/share/info/asymptote/" location. Move it to
246 ;; "%out/share/info/" so it appears in the top-level directory.
247 (lambda _
248 (substitute* "doc/png/Makefile.in"
249 (("(\\$\\(infodir\\))/asymptote" _ infodir) infodir))
325a2e35
NG
250 (substitute* "doc/asymptote.texi"
251 (("asymptote/asymptote") "asymptote"))
55a604db 252 #t))
acb31b5d
NG
253 (add-before 'build 'patch-pdf-viewer
254 (lambda _
80ed14d3 255 ;; Default to a free pdf viewer.
acb31b5d
NG
256 (substitute* "settings.cc"
257 (("defaultPDFViewer=\"acroread\"")
80ed14d3
NG
258 "defaultPDFViewer=\"gv\""))
259 #t))
acb31b5d
NG
260 (add-before 'check 'set-HOME
261 ;; Some tests require write access to $HOME, otherwise leading to
262 ;; "failed to create directory /homeless-shelter/.asy" error.
263 (lambda _
80ed14d3
NG
264 (setenv "HOME" "/tmp")
265 #t))
266 (add-after 'install 'install-Emacs-data
267 (lambda* (#:key outputs #:allow-other-keys)
268 ;; Install related Emacs libraries into an appropriate location.
269 (let* ((out (assoc-ref outputs "out"))
270 (lisp-dir (string-append out "/share/emacs/site-lisp")))
271 (for-each (cut install-file <> lisp-dir)
272 (find-files "." "\\.el$"))
273 (emacs-generate-autoloads ,name lisp-dir))
274 #t)))))
20977871
EB
275 (home-page "http://asymptote.sourceforge.net")
276 (synopsis "Script-based vector graphics language")
277 (description
278 "Asymptote is a powerful descriptive vector graphics language for
279technical drawing, inspired by MetaPost but with an improved C++-like syntax.
280Asymptote provides for figures the same high-quality level of typesetting that
281LaTeX does for scientific text.")
282 ;; Most source files do not contain license statements, but the README
283 ;; contains: "All source files in the Asymptote project, unless explicitly
284 ;; noted otherwise, are released under version 3 (or later) of the GNU
285 ;; Lesser General Public License"
286 (license license:lgpl3+)))