gnu: packages: Use 'search-patches' everywhere.
[jackhill/guix/guix.git] / gnu / packages / plotutils.scm
CommitLineData
bb3fe7fc 1;;; GNU Guix --- Functional package management for GNU
8c986ab1 2;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
20977871 3;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
bb3fe7fc
LC
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages plotutils)
40e9de2a 21 #:use-module ((guix licenses) #:prefix license:)
bb3fe7fc
LC
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
20977871
EB
25 #:use-module (gnu packages algebra)
26 #:use-module (gnu packages bdw-gc)
fa6141ec 27 #:use-module (gnu packages xorg)
e55354b8 28 #:use-module (gnu packages image)
20977871 29 #:use-module (gnu packages ghostscript)
00ebe474 30 #:use-module (gnu packages guile)
20977871 31 #:use-module (gnu packages gl)
00ebe474 32 #:use-module (gnu packages gtk)
20977871
EB
33 #:use-module (gnu packages maths)
34 #:use-module (gnu packages perl)
00ebe474 35 #:use-module (gnu packages pkg-config)
20977871
EB
36 #:use-module (gnu packages python)
37 #:use-module (gnu packages readline)
38 #:use-module (gnu packages texinfo)
39 #:use-module (gnu packages texlive)
40e9de2a 40 #:use-module (gnu packages compression)
8e5e7299 41 #:use-module (gnu packages))
bb3fe7fc
LC
42
43(define-public plotutils
44 (package
45 (name "plotutils")
46 (version "2.6")
47 (source (origin
48 (method url-fetch)
49 (uri (string-append "mirror://gnu/plotutils/plotutils-"
50 version ".tar.gz"))
51 (sha256
52 (base32
01eafd38 53 "1arkyizn5wbgvbh53aziv3s6lmd3wm9lqzkhxb3hijlp1y124hjg"))
fc1adab1 54 (patches (search-patches "plotutils-libpng-jmpbuf.patch"))
ceae3fef
LC
55 (modules '((guix build utils)))
56 (snippet
57 ;; Force the use of libXaw7 instead of libXaw. When not doing
58 ;; that, libplot.la ends up containing just "-lXaw" (without
59 ;; "-L/path/to/Xaw"), due to the fact that there is no
60 ;; libXaw.la, which forces us to propagate libXaw.
61 '(substitute* "configure"
62 (("-lXaw")
63 "-lXaw7")))))
bb3fe7fc 64 (build-system gnu-build-system)
fa6141ec
LC
65 (inputs `(("libpng" ,libpng)
66 ("libx11" ,libx11)
ceae3fef
LC
67 ("libxt" ,libxt)
68 ("libxaw" ,libxaw)))
a6eb1a95 69
bb3fe7fc
LC
70 (home-page
71 "http://www.gnu.org/software/plotutils/")
72 (synopsis "Plotting utilities and library")
73 (description
79c311b8
LC
74 "GNU Plotutils is a package for plotting and working with 2D graphics.
75It includes a library, \"libplot\", for C and C++ for exporting 2D vector
76graphics in many file formats. It also has support for 2D vector graphics
77animations. The package also contains command-line programs for plotting
78scientific data.")
40e9de2a 79 (license license:gpl2+)))
00ebe474
LC
80
81(define-public guile-charting
82 (package
83 (name "guile-charting")
84 (version "0.2.0")
85 (source (origin
86 (method url-fetch)
87 (uri (string-append "http://wingolog.org/pub/guile-charting/"
88 "guile-charting-" version ".tar.gz"))
89 (sha256
90 (base32
91 "0w5qiyv9v0ip5li22x762bm48g8xnw281w66iyw094zdw611pb2m"))
92 (modules '((guix build utils)))
93 (snippet
94 '(begin
95 ;; Use the standard location for modules.
96 (substitute* "Makefile.in"
97 (("godir = .*$")
98 "godir = $(moddir)\n"))))))
99 (build-system gnu-build-system)
100 (native-inputs `(("pkg-config" ,pkg-config)))
101 (inputs `(("guile" ,guile-2.0)))
102 (propagated-inputs `(("guile-cairo" ,guile-cairo)))
103 (home-page "http://wingolog.org/software/guile-charting/")
104 (synopsis "Create charts and graphs in Guile")
105 (description
106 "Guile-Charting is a Guile Scheme library to create bar charts and graphs
107using the Cairo drawing library.")
40e9de2a
LC
108 (license license:lgpl2.1+)))
109
110(define-public ploticus
111 (package
112 (name "ploticus")
113 (version "2.42")
114 (source (origin
115 (method url-fetch)
116 (uri (string-append "mirror://sourceforge/ploticus/ploticus/"
117 version "/ploticus242_src.tar.gz"))
118 (sha256
119 (base32
120 "1c70cvfvgjh83hj1x21130wb9qfr2rc0x47cxy9kl805yjwy8a9z"))
121 (modules '((guix build utils)))
122 (snippet
123 ;; Install binaries in the right place.
124 '(substitute* "src/Makefile"
125 (("INSTALLBIN =.*$")
126 (string-append "INSTALLBIN = $(out)/bin"))))))
127 (build-system gnu-build-system)
128 (arguments
129 '(#:tests? #f
130 #:phases
131 (modify-phases %standard-phases
f8503e2b
LC
132 (replace 'configure (lambda _ (chdir "src")))
133 (add-before 'install 'make-target-directories
40e9de2a
LC
134 (lambda* (#:key outputs #:allow-other-keys)
135 (let ((out (assoc-ref outputs "out")))
136 (mkdir-p (string-append out "/bin"))
137 #t)))
f8503e2b 138 (add-after 'install 'install-prefabs
40e9de2a
LC
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,
165charts, and graphics from data. Ploticus is good for automated or
166just-in-time graph generation, handles date and time data nicely, and has
167basic statistical capabilities. It allows significant user control over
168colors, styles, options and details.")
169 (license license:gpl2+)))
20977871
EB
170
171(define-public asymptote
172 (package
173 (name "asymptote")
174 (version "2.35")
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 "11f28vxw0ybhvl7vxmqcdwvw7y6gz55ykw9ybgzb2px6lsvgag7z"))
fc1adab1 182 (patches (search-patches "asymptote-gsl2.patch"))))
20977871
EB
183 (build-system gnu-build-system)
184 ;; Note: The 'asy' binary retains a reference to docdir for use with its
185 ;; "help" command in interactive mode, so adding a "doc" output is not
186 ;; currently useful.
187 (native-inputs
188 `(("gs" ,ghostscript) ;For tests
189 ("texinfo" ,texinfo) ;For generating documentation
190 ("texlive" ,texlive) ;For tests and documentation
191 ("perl" ,perl)))
192 (inputs
193 `(("fftw" ,fftw)
194 ("freeglut" ,freeglut)
195 ("gsl" ,gsl)
8c986ab1 196 ("libgc" ,libgc)
20977871
EB
197 ("python" ,python-2)
198 ("readline" ,readline)
199 ("zlib" ,zlib)))
200 (arguments
201 `(#:configure-flags
202 (list (string-append "--enable-gc=" (assoc-ref %build-inputs "libgc"))
203 (string-append "--with-latex="
204 (assoc-ref %outputs "out")
205 "/share/texmf/tex/latex")
206 (string-append "--with-context="
207 (assoc-ref %outputs "out")
208 "/share/texmf/tex/context/third"))
209 #:phases (modify-phases %standard-phases
210 (add-before 'build 'patch-pdf-viewer
211 (lambda _
212 ;; Default to a free pdf viewer
213 (substitute* "settings.cc"
214 (("defaultPDFViewer=\"acroread\"")
215 "defaultPDFViewer=\"gv\"")))))))
216 (home-page "http://asymptote.sourceforge.net")
217 (synopsis "Script-based vector graphics language")
218 (description
219 "Asymptote is a powerful descriptive vector graphics language for
220technical drawing, inspired by MetaPost but with an improved C++-like syntax.
221Asymptote provides for figures the same high-quality level of typesetting that
222LaTeX does for scientific text.")
223 ;; Most source files do not contain license statements, but the README
224 ;; contains: "All source files in the Asymptote project, unless explicitly
225 ;; noted otherwise, are released under version 3 (or later) of the GNU
226 ;; Lesser General Public License"
227 (license license:lgpl3+)))