| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 |
|
| 23 | (define-module (gnu packages plotutils)
|
| 24 | #:use-module ((guix licenses) #:prefix license:)
|
| 25 | #:use-module (guix packages)
|
| 26 | #:use-module (guix download)
|
| 27 | #:use-module (guix build-system gnu)
|
| 28 | #:use-module (gnu packages algebra)
|
| 29 | #:use-module (gnu packages bdw-gc)
|
| 30 | #:use-module (gnu packages emacs)
|
| 31 | #:use-module (gnu packages xorg)
|
| 32 | #:use-module (gnu packages image)
|
| 33 | #:use-module (gnu packages ghostscript)
|
| 34 | #:use-module (gnu packages guile)
|
| 35 | #:use-module (gnu packages gl)
|
| 36 | #:use-module (gnu packages gtk)
|
| 37 | #:use-module (gnu packages maths)
|
| 38 | #:use-module (gnu packages perl)
|
| 39 | #:use-module (gnu packages pkg-config)
|
| 40 | #:use-module (gnu packages python)
|
| 41 | #:use-module (gnu packages python-xyz)
|
| 42 | #:use-module (gnu packages readline)
|
| 43 | #:use-module (gnu packages qt)
|
| 44 | #:use-module (gnu packages texinfo)
|
| 45 | #:use-module (gnu packages tex)
|
| 46 | #:use-module (gnu packages compression)
|
| 47 | #:use-module (gnu packages))
|
| 48 |
|
| 49 | (define-public plotutils
|
| 50 | (package
|
| 51 | (name "plotutils")
|
| 52 | (version "2.6")
|
| 53 | (source (origin
|
| 54 | (method url-fetch)
|
| 55 | (uri (string-append "mirror://gnu/plotutils/plotutils-"
|
| 56 | version ".tar.gz"))
|
| 57 | (sha256
|
| 58 | (base32
|
| 59 | "1arkyizn5wbgvbh53aziv3s6lmd3wm9lqzkhxb3hijlp1y124hjg"))
|
| 60 | (modules '((guix build utils)))
|
| 61 | (snippet
|
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | '(begin
|
| 67 | (substitute* "configure"
|
| 68 | (("-lXaw")
|
| 69 | "-lXaw7"))
|
| 70 | |
| 71 | |
| 72 | |
| 73 | (substitute* "libplot/z_write.c"
|
| 74 | (("png_ptr->jmpbuf")
|
| 75 | "png_jmpbuf (png_ptr)"))
|
| 76 | #t))
|
| 77 | (patches
|
| 78 | |
| 79 | |
| 80 | |
| 81 | (search-patches "plotutils-spline-test.patch"))))
|
| 82 | (build-system gnu-build-system)
|
| 83 | (arguments
|
| 84 | `(#:configure-flags (list "--enable-libplotter")))
|
| 85 | (inputs `(("libpng" ,libpng)
|
| 86 | ("libx11" ,libx11)
|
| 87 | ("libxt" ,libxt)
|
| 88 | ("libxaw" ,libxaw)))
|
| 89 | (home-page "https://www.gnu.org/software/plotutils/")
|
| 90 | (synopsis "Plotting utilities and library")
|
| 91 | (description
|
| 92 | "GNU Plotutils is a package for plotting and working with 2D graphics.
|
| 93 | It includes the C library @code{libplot} and the C++ @code{libplotter} library
|
| 94 | for exporting 2D vector graphics in many file formats. It also has support
|
| 95 | for 2D vector graphics animations. The package also contains command-line
|
| 96 | programs for plotting scientific data.")
|
| 97 | (license license:gpl2+)))
|
| 98 |
|
| 99 | (define-public guile-charting
|
| 100 | (package
|
| 101 | (name "guile-charting")
|
| 102 | (version "0.2.0")
|
| 103 | (source (origin
|
| 104 | (method url-fetch)
|
| 105 | (uri (string-append "http://wingolog.org/pub/guile-charting/"
|
| 106 | "guile-charting-" version ".tar.gz"))
|
| 107 | (sha256
|
| 108 | (base32
|
| 109 | "0w5qiyv9v0ip5li22x762bm48g8xnw281w66iyw094zdw611pb2m"))
|
| 110 | (modules '((guix build utils)))
|
| 111 | (snippet
|
| 112 | '(begin
|
| 113 | |
| 114 | (substitute* "configure"
|
| 115 | (("2\\.2 2\\.0")
|
| 116 | "3.0 2.2 2.0"))
|
| 117 |
|
| 118 | |
| 119 | |
| 120 | |
| 121 | (substitute* (find-files "." "^Makefile\\.in$")
|
| 122 | (("/ccache") "/site-ccache"))
|
| 123 | #t))))
|
| 124 | (build-system gnu-build-system)
|
| 125 | (native-inputs `(("pkg-config" ,pkg-config)))
|
| 126 | (inputs `(("guile" ,guile-3.0)))
|
| 127 | (propagated-inputs `(("guile-cairo" ,guile-cairo)))
|
| 128 | (home-page "http://wingolog.org/software/guile-charting/")
|
| 129 | (synopsis "Create charts and graphs in Guile")
|
| 130 | (description
|
| 131 | "Guile-Charting is a Guile Scheme library to create bar charts and graphs
|
| 132 | using the Cairo drawing library.")
|
| 133 | (license license:lgpl2.1+)))
|
| 134 |
|
| 135 | (define-public guile2.2-charting
|
| 136 | (package
|
| 137 | (inherit guile-charting)
|
| 138 | (name "guile2.2-charting")
|
| 139 | (inputs `(("guile" ,guile-2.2)))
|
| 140 | (propagated-inputs `(("guile-cairo" ,guile2.2-cairo)))))
|
| 141 |
|
| 142 | (define-public guile3.0-charting
|
| 143 | (deprecated-package "guile3.0-charting" guile-charting))
|
| 144 |
|
| 145 | (define-public ploticus
|
| 146 | (package
|
| 147 | (name "ploticus")
|
| 148 | (version "2.42")
|
| 149 | (source (origin
|
| 150 | (method url-fetch)
|
| 151 | (uri (string-append "mirror://sourceforge/ploticus/ploticus/"
|
| 152 | version "/ploticus242_src.tar.gz"))
|
| 153 | (sha256
|
| 154 | (base32
|
| 155 | "1c70cvfvgjh83hj1x21130wb9qfr2rc0x47cxy9kl805yjwy8a9z"))
|
| 156 | (modules '((guix build utils)))
|
| 157 | (snippet
|
| 158 | |
| 159 | '(begin
|
| 160 | (substitute* "src/Makefile"
|
| 161 | (("INSTALLBIN =.*$")
|
| 162 | (string-append "INSTALLBIN = $(out)/bin")))
|
| 163 | #t))))
|
| 164 | (build-system gnu-build-system)
|
| 165 | (arguments
|
| 166 | '(#:tests? #f
|
| 167 | #:phases
|
| 168 | (modify-phases %standard-phases
|
| 169 | (replace 'configure (lambda _ (chdir "src")))
|
| 170 | (add-before 'install 'make-target-directories
|
| 171 | (lambda* (#:key outputs #:allow-other-keys)
|
| 172 | (let ((out (assoc-ref outputs "out")))
|
| 173 | (mkdir-p (string-append out "/bin"))
|
| 174 | #t)))
|
| 175 | (add-after 'install 'install-prefabs
|
| 176 | (lambda* (#:key outputs #:allow-other-keys)
|
| 177 | (let* ((out (assoc-ref outputs "out"))
|
| 178 | (dir (string-append out
|
| 179 | "/share/ploticus/prefabs"))
|
| 180 | (bin (string-append out "/bin")))
|
| 181 | (mkdir-p dir)
|
| 182 |
|
| 183 | |
| 184 | (for-each (lambda (file)
|
| 185 | (let ((target
|
| 186 | (string-append dir "/"
|
| 187 | (basename file))))
|
| 188 | (copy-file file target)))
|
| 189 | (find-files "../prefabs" "."))
|
| 190 |
|
| 191 | |
| 192 | (wrap-program (string-append bin "/pl")
|
| 193 | `("PLOTICUS_PREFABS" ":" = (,dir)))))))))
|
| 194 | (inputs
|
| 195 | `(("libpng" ,libpng)
|
| 196 | ("libx11" ,libx11)
|
| 197 | ("zlib" ,zlib)))
|
| 198 | (home-page "http://ploticus.sourceforge.net/")
|
| 199 | (synopsis "Command-line tool for producing plots and charts")
|
| 200 | (description
|
| 201 | "Ploticus is a non-interactive software package for producing plots,
|
| 202 | charts, and graphics from data. Ploticus is good for automated or
|
| 203 | just-in-time graph generation, handles date and time data nicely, and has
|
| 204 | basic statistical capabilities. It allows significant user control over
|
| 205 | colors, styles, options and details.")
|
| 206 | (license license:gpl2+)))
|
| 207 |
|
| 208 | (define-public asymptote
|
| 209 | (package
|
| 210 | (name "asymptote")
|
| 211 | (version "2.67")
|
| 212 | (source
|
| 213 | (origin
|
| 214 | (method url-fetch)
|
| 215 | (uri (string-append "mirror://sourceforge/asymptote/"
|
| 216 | version "/asymptote-" version ".src.tgz"))
|
| 217 | (sha256
|
| 218 | (base32 "16rdwxal27fikzfqsm2sb8ji78whpxl98rdyyp0ky2qlh55mf7la"))))
|
| 219 | (build-system gnu-build-system)
|
| 220 | |
| 221 | |
| 222 | |
| 223 | (native-inputs
|
| 224 | `(("emacs" ,emacs-minimal)
|
| 225 | ("gs" ,ghostscript) |
| 226 | ("perl" ,perl)
|
| 227 | ("texinfo" ,texinfo) |
| 228 | |
| 229 | ("texlive" ,(texlive-union (list texlive-amsfonts
|
| 230 | texlive-epsf
|
| 231 | texlive-etoolbox
|
| 232 | texlive-latex-base
|
| 233 | texlive-latex-geometry
|
| 234 | texlive-latex-graphics
|
| 235 | texlive-latex-oberdiek |
| 236 | texlive-latex-parskip
|
| 237 | texlive-tex-texinfo)))))
|
| 238 | (inputs
|
| 239 | `(("fftw" ,fftw)
|
| 240 | ("freeglut" ,freeglut)
|
| 241 | ("glew" ,glew)
|
| 242 | ("glm" ,glm)
|
| 243 | ("gsl" ,gsl)
|
| 244 | ("libgc" ,libgc)
|
| 245 | ("python" ,python)
|
| 246 | ("python-cson" ,python-cson)
|
| 247 | ("python-numpy" ,python-numpy)
|
| 248 | ("python-pyqt" ,python-pyqt)
|
| 249 | ("readline" ,readline)
|
| 250 | ("zlib" ,zlib)))
|
| 251 | (arguments
|
| 252 | `(#:modules ((guix build emacs-utils)
|
| 253 | (guix build gnu-build-system)
|
| 254 | (guix build utils)
|
| 255 | (srfi srfi-26))
|
| 256 | #:imported-modules (,@%gnu-build-system-modules
|
| 257 | (guix build emacs-utils))
|
| 258 | #:configure-flags
|
| 259 | (list (string-append "--enable-gc=" (assoc-ref %build-inputs "libgc"))
|
| 260 | (string-append "--with-latex="
|
| 261 | (assoc-ref %outputs "out")
|
| 262 | "/share/texmf/tex/latex")
|
| 263 | (string-append "--with-context="
|
| 264 | (assoc-ref %outputs "out")
|
| 265 | "/share/texmf/tex/context/third"))
|
| 266 | #:phases
|
| 267 | (modify-phases %standard-phases
|
| 268 | (add-after 'unpack 'fix-build
|
| 269 | |
| 270 | |
| 271 | (lambda _
|
| 272 | (substitute* (find-files "." "\\.in$")
|
| 273 | (("#include <primitives.h>") "#include \"primitives.h\""))
|
| 274 | (invoke "touch" "prc/config.h")))
|
| 275 | (add-after 'unpack 'move-info-location
|
| 276 | |
| 277 | |
| 278 | |
| 279 | (lambda _
|
| 280 | (substitute* "doc/png/Makefile.in"
|
| 281 | (("(\\$\\(infodir\\))/asymptote" _ infodir) infodir))
|
| 282 | (substitute* "doc/asymptote.texi"
|
| 283 | (("asymptote/asymptote") "asymptote"))
|
| 284 | #t))
|
| 285 | (add-before 'build 'patch-pdf-viewer
|
| 286 | (lambda _
|
| 287 | |
| 288 | (substitute* "settings.cc"
|
| 289 | (("defaultPDFViewer=\"acroread\"")
|
| 290 | "defaultPDFViewer=\"gv\""))
|
| 291 | #t))
|
| 292 | (add-before 'check 'set-HOME
|
| 293 | |
| 294 | |
| 295 | (lambda _
|
| 296 | (setenv "HOME" "/tmp")
|
| 297 | #t))
|
| 298 | (add-after 'install 'install-Emacs-data
|
| 299 | (lambda* (#:key outputs #:allow-other-keys)
|
| 300 | |
| 301 | (let* ((out (assoc-ref outputs "out"))
|
| 302 | (lisp-dir (string-append out "/share/emacs/site-lisp")))
|
| 303 | (for-each (cut install-file <> lisp-dir)
|
| 304 | (find-files "." "\\.el$"))
|
| 305 | (emacs-generate-autoloads ,name lisp-dir))
|
| 306 | #t))
|
| 307 | (add-after 'install-Emacs-data 'wrap-python-script
|
| 308 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 309 | |
| 310 | (let* ((out (assoc-ref outputs "out"))
|
| 311 | (path (getenv "PYTHONPATH")))
|
| 312 | (wrap-program (string-append out "/share/asymptote/GUI/xasy.py")
|
| 313 | `("PYTHONPATH" ":" prefix (,path))))
|
| 314 | #t)))))
|
| 315 | (home-page "http://asymptote.sourceforge.net")
|
| 316 | (synopsis "Script-based vector graphics language")
|
| 317 | (description
|
| 318 | "Asymptote is a powerful descriptive vector graphics language for
|
| 319 | technical drawing, inspired by MetaPost but with an improved C++-like syntax.
|
| 320 | Asymptote provides for figures the same high-quality level of typesetting that
|
| 321 | LaTeX does for scientific text.")
|
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | (license license:lgpl3+)))
|