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