projects/guix·blob version-0.15.0 · refs

258 lines · 10.7 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <[email protected]>
3;;; Copyright © 2015 Eric Bavier <[email protected]>
4;;; Copyright © 2016, 2017 Nicolas Goaziou <[email protected]>
5;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
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.
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.")
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 (modules '((guix build utils)))
98 (snippet
99 '(begin
100 ;; Use the standard location for modules.
101 (substitute* "Makefile.in"
102 (("godir = .*$")
103 "godir = $(moddir)\n"))
104 #t))))
105 (build-system gnu-build-system)
106 (native-inputs `(("pkg-config" ,pkg-config)))
107 (inputs `(("guile" ,guile-2.2)))
108 (propagated-inputs `(("guile-cairo" ,guile-cairo)))
109 (home-page "http://wingolog.org/software/guile-charting/")
110 (synopsis "Create charts and graphs in Guile")
111 (description
112 "Guile-Charting is a Guile Scheme library to create bar charts and graphs
113using the Cairo drawing library.")
114 (license license:lgpl2.1+)))
115
116(define-public ploticus
117 (package
118 (name "ploticus")
119 (version "2.42")
120 (source (origin
121 (method url-fetch)
122 (uri (string-append "mirror://sourceforge/ploticus/ploticus/"
123 version "/ploticus242_src.tar.gz"))
124 (sha256
125 (base32
126 "1c70cvfvgjh83hj1x21130wb9qfr2rc0x47cxy9kl805yjwy8a9z"))
127 (modules '((guix build utils)))
128 (snippet
129 ;; Install binaries in the right place.
130 '(begin
131 (substitute* "src/Makefile"
132 (("INSTALLBIN =.*$")
133 (string-append "INSTALLBIN = $(out)/bin")))
134 #t))))
135 (build-system gnu-build-system)
136 (arguments
137 '(#:tests? #f
138 #:phases
139 (modify-phases %standard-phases
140 (replace 'configure (lambda _ (chdir "src")))
141 (add-before 'install 'make-target-directories
142 (lambda* (#:key outputs #:allow-other-keys)
143 (let ((out (assoc-ref outputs "out")))
144 (mkdir-p (string-append out "/bin"))
145 #t)))
146 (add-after 'install 'install-prefabs
147 (lambda* (#:key outputs #:allow-other-keys)
148 (let* ((out (assoc-ref outputs "out"))
149 (dir (string-append out
150 "/share/ploticus/prefabs"))
151 (bin (string-append out "/bin")))
152 (mkdir-p dir)
153
154 ;; Install "prefabs".
155 (for-each (lambda (file)
156 (let ((target
157 (string-append dir "/"
158 (basename file))))
159 (copy-file file target)))
160 (find-files "../prefabs" "."))
161
162 ;; Allow them to be found.
163 (wrap-program (string-append bin "/pl")
164 `("PLOTICUS_PREFABS" ":" = (,dir)))))))))
165 (inputs
166 `(("libpng" ,libpng)
167 ("libx11" ,libx11)
168 ("zlib" ,zlib)))
169 (home-page "http://ploticus.sourceforge.net/")
170 (synopsis "Command-line tool for producing plots and charts")
171 (description
172 "Ploticus is a non-interactive software package for producing plots,
173charts, and graphics from data. Ploticus is good for automated or
174just-in-time graph generation, handles date and time data nicely, and has
175basic statistical capabilities. It allows significant user control over
176colors, styles, options and details.")
177 (license license:gpl2+)))
178
179(define-public asymptote
180 (package
181 (name "asymptote")
182 (version "2.44")
183 (source (origin
184 (method url-fetch)
185 (uri (string-append "mirror://sourceforge/asymptote/"
186 version "/asymptote-" version ".src.tgz"))
187 (sha256
188 (base32
189 "1rs9v95g19ri6ra2m921jf2yr9avqnzfybrqxilsld98xpqx56vg"))))
190 (build-system gnu-build-system)
191 ;; Note: The 'asy' binary retains a reference to docdir for use with its
192 ;; "help" command in interactive mode, so adding a "doc" output is not
193 ;; currently useful.
194 (native-inputs
195 `(("gs" ,ghostscript) ;For tests
196 ("texinfo" ,texinfo) ;For generating documentation
197 ("texlive" ,texlive) ;For tests and documentation
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 #t))
238 (add-after 'install 'install-Emacs-data
239 (lambda* (#:key outputs #:allow-other-keys)
240 ;; Install related Emacs libraries into an appropriate location.
241 (let* ((out (assoc-ref outputs "out"))
242 (lisp-dir (string-append out "/share/emacs/site-lisp")))
243 (for-each (cut install-file <> lisp-dir)
244 (find-files "." "\\.el$"))
245 (emacs-generate-autoloads ,name lisp-dir))
246 #t)))))
247 (home-page "http://asymptote.sourceforge.net")
248 (synopsis "Script-based vector graphics language")
249 (description
250 "Asymptote is a powerful descriptive vector graphics language for
251technical drawing, inspired by MetaPost but with an improved C++-like syntax.
252Asymptote provides for figures the same high-quality level of typesetting that
253LaTeX does for scientific text.")
254 ;; Most source files do not contain license statements, but the README
255 ;; contains: "All source files in the Asymptote project, unless explicitly
256 ;; noted otherwise, are released under version 3 (or later) of the GNU
257 ;; Lesser General Public License"
258 (license license:lgpl3+)))