gnu: Add wl-clipboard.
[jackhill/guix/guix.git] / gnu / packages / plotutils.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
4 ;;; Copyright © 2016, 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
5 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
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)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages algebra)
28 #:use-module (gnu packages bdw-gc)
29 #:use-module (gnu packages emacs)
30 #:use-module (gnu packages xorg)
31 #:use-module (gnu packages image)
32 #:use-module (gnu packages ghostscript)
33 #:use-module (gnu packages guile)
34 #:use-module (gnu packages gl)
35 #:use-module (gnu packages gtk)
36 #:use-module (gnu packages maths)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages readline)
41 #:use-module (gnu packages texinfo)
42 #:use-module (gnu packages tex)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages))
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
56 "1arkyizn5wbgvbh53aziv3s6lmd3wm9lqzkhxb3hijlp1y124hjg"))
57 (patches (search-patches "plotutils-libpng-jmpbuf.patch"))
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.
64 '(begin
65 (substitute* "configure"
66 (("-lXaw")
67 "-lXaw7"))
68 #t))))
69 (build-system gnu-build-system)
70 (inputs `(("libpng" ,libpng)
71 ("libx11" ,libx11)
72 ("libxt" ,libxt)
73 ("libxaw" ,libxaw)))
74
75 (home-page
76 "http://www.gnu.org/software/plotutils/")
77 (synopsis "Plotting utilities and library")
78 (description
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.")
84 (license license:gpl2+)))
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
96 "0w5qiyv9v0ip5li22x762bm48g8xnw281w66iyw094zdw611pb2m"))))
97 (build-system gnu-build-system)
98 (native-inputs `(("pkg-config" ,pkg-config)))
99 (inputs `(("guile" ,guile-2.2)))
100 (propagated-inputs `(("guile-cairo" ,guile-cairo)))
101 (home-page "http://wingolog.org/software/guile-charting/")
102 (synopsis "Create charts and graphs in Guile")
103 (description
104 "Guile-Charting is a Guile Scheme library to create bar charts and graphs
105 using the Cairo drawing library.")
106 (license license:lgpl2.1+)))
107
108 (define-public ploticus
109 (package
110 (name "ploticus")
111 (version "2.42")
112 (source (origin
113 (method url-fetch)
114 (uri (string-append "mirror://sourceforge/ploticus/ploticus/"
115 version "/ploticus242_src.tar.gz"))
116 (sha256
117 (base32
118 "1c70cvfvgjh83hj1x21130wb9qfr2rc0x47cxy9kl805yjwy8a9z"))
119 (modules '((guix build utils)))
120 (snippet
121 ;; Install binaries in the right place.
122 '(begin
123 (substitute* "src/Makefile"
124 (("INSTALLBIN =.*$")
125 (string-append "INSTALLBIN = $(out)/bin")))
126 #t))))
127 (build-system gnu-build-system)
128 (arguments
129 '(#:tests? #f
130 #:phases
131 (modify-phases %standard-phases
132 (replace 'configure (lambda _ (chdir "src")))
133 (add-before 'install 'make-target-directories
134 (lambda* (#:key outputs #:allow-other-keys)
135 (let ((out (assoc-ref outputs "out")))
136 (mkdir-p (string-append out "/bin"))
137 #t)))
138 (add-after 'install 'install-prefabs
139 (lambda* (#:key outputs #:allow-other-keys)
140 (let* ((out (assoc-ref outputs "out"))
141 (dir (string-append out
142 "/share/ploticus/prefabs"))
143 (bin (string-append out "/bin")))
144 (mkdir-p dir)
145
146 ;; Install "prefabs".
147 (for-each (lambda (file)
148 (let ((target
149 (string-append dir "/"
150 (basename file))))
151 (copy-file file target)))
152 (find-files "../prefabs" "."))
153
154 ;; Allow them to be found.
155 (wrap-program (string-append bin "/pl")
156 `("PLOTICUS_PREFABS" ":" = (,dir)))))))))
157 (inputs
158 `(("libpng" ,libpng)
159 ("libx11" ,libx11)
160 ("zlib" ,zlib)))
161 (home-page "http://ploticus.sourceforge.net/")
162 (synopsis "Command-line tool for producing plots and charts")
163 (description
164 "Ploticus is a non-interactive software package for producing plots,
165 charts, and graphics from data. Ploticus is good for automated or
166 just-in-time graph generation, handles date and time data nicely, and has
167 basic statistical capabilities. It allows significant user control over
168 colors, styles, options and details.")
169 (license license:gpl2+)))
170
171 (define-public asymptote
172 (package
173 (name "asymptote")
174 (version "2.47")
175 (source (origin
176 (method url-fetch)
177 (uri (string-append "mirror://sourceforge/asymptote/"
178 version "/asymptote-" version ".src.tgz"))
179 (sha256
180 (base32
181 "0zc24n2vwzxdfmcppqfk3fkqlb4jmvswzi3bz232kxl7dyiyb971"))))
182 (build-system gnu-build-system)
183 ;; Note: The 'asy' binary retains a reference to docdir for use with its
184 ;; "help" command in interactive mode, so adding a "doc" output is not
185 ;; currently useful.
186 (native-inputs
187 `(("gs" ,ghostscript) ;For tests
188 ("texinfo" ,texinfo) ;For generating documentation
189 ;; For the manual and the tests.
190 ("texlive" ,(texlive-union (list texlive-fonts-amsfonts
191 texlive-generic-ifxetex
192 texlive-latex-amsfonts
193 texlive-latex-geometry
194 texlive-latex-graphics
195 texlive-latex-oberdiek
196 texlive-latex-parskip
197 texlive-tex-texinfo)))
198 ("emacs" ,emacs-minimal)
199 ("perl" ,perl)))
200 (inputs
201 `(("fftw" ,fftw)
202 ("freeglut" ,freeglut)
203 ("gsl" ,gsl)
204 ("libgc" ,libgc)
205 ("python" ,python-2)
206 ("readline" ,readline)
207 ("zlib" ,zlib)))
208 (arguments
209 `(#:modules ((guix build emacs-utils)
210 (guix build gnu-build-system)
211 (guix build utils)
212 (srfi srfi-26))
213 #:imported-modules (,@%gnu-build-system-modules
214 (guix build emacs-utils))
215 #:configure-flags
216 (list (string-append "--enable-gc=" (assoc-ref %build-inputs "libgc"))
217 (string-append "--with-latex="
218 (assoc-ref %outputs "out")
219 "/share/texmf/tex/latex")
220 (string-append "--with-context="
221 (assoc-ref %outputs "out")
222 "/share/texmf/tex/context/third"))
223 #:phases
224 (modify-phases %standard-phases
225 (add-before 'build 'patch-pdf-viewer
226 (lambda _
227 ;; Default to a free pdf viewer.
228 (substitute* "settings.cc"
229 (("defaultPDFViewer=\"acroread\"")
230 "defaultPDFViewer=\"gv\""))
231 #t))
232 (add-before 'check 'set-HOME
233 ;; Some tests require write access to $HOME, otherwise leading to
234 ;; "failed to create directory /homeless-shelter/.asy" error.
235 (lambda _
236 (setenv "HOME" "/tmp")
237 ;; The "gs" test fails, complaining about an incompatible
238 ;; Ghostscript version. Not sure what's going on... Is this
239 ;; because I've just replaced texlive with texlive-union?
240 (substitute* "tests/Makefile"
241 (("^(TESTDIRS =.*) gs(.*)" begin end)
242 (string-append begin " " end)))
243 #t))
244 (add-after 'install 'install-Emacs-data
245 (lambda* (#:key outputs #:allow-other-keys)
246 ;; Install related Emacs libraries into an appropriate location.
247 (let* ((out (assoc-ref outputs "out"))
248 (lisp-dir (string-append out "/share/emacs/site-lisp")))
249 (for-each (cut install-file <> lisp-dir)
250 (find-files "." "\\.el$"))
251 (emacs-generate-autoloads ,name lisp-dir))
252 #t)))))
253 (home-page "http://asymptote.sourceforge.net")
254 (synopsis "Script-based vector graphics language")
255 (description
256 "Asymptote is a powerful descriptive vector graphics language for
257 technical drawing, inspired by MetaPost but with an improved C++-like syntax.
258 Asymptote provides for figures the same high-quality level of typesetting that
259 LaTeX does for scientific text.")
260 ;; Most source files do not contain license statements, but the README
261 ;; contains: "All source files in the Asymptote project, unless explicitly
262 ;; noted otherwise, are released under version 3 (or later) of the GNU
263 ;; Lesser General Public License"
264 (license license:lgpl3+)))