| 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 gexp)
|
| 26 | #:use-module ((guix utils) #:select (target-x86-32?))
|
| 27 | #:use-module (guix packages)
|
| 28 | #:use-module (guix download)
|
| 29 | #:use-module (guix git-download)
|
| 30 | #:use-module (guix build-system gnu)
|
| 31 | #:use-module (gnu packages algebra)
|
| 32 | #:use-module (gnu packages autotools)
|
| 33 | #:use-module (gnu packages bdw-gc)
|
| 34 | #:use-module (gnu packages boost)
|
| 35 | #:use-module (gnu packages cmake)
|
| 36 | #:use-module (gnu packages emacs)
|
| 37 | #:use-module (gnu packages xorg)
|
| 38 | #:use-module (gnu packages image)
|
| 39 | #:use-module (gnu packages ghostscript)
|
| 40 | #:use-module (gnu packages guile)
|
| 41 | #:use-module (gnu packages gl)
|
| 42 | #:use-module (gnu packages gtk)
|
| 43 | #:use-module (gnu packages maths)
|
| 44 | #:use-module (gnu packages onc-rpc)
|
| 45 | #:use-module (gnu packages perl)
|
| 46 | #:use-module (gnu packages pkg-config)
|
| 47 | #:use-module (gnu packages python)
|
| 48 | #:use-module (gnu packages python-xyz)
|
| 49 | #:use-module (gnu packages readline)
|
| 50 | #:use-module (gnu packages qt)
|
| 51 | #:use-module (gnu packages texinfo)
|
| 52 | #:use-module (gnu packages tex)
|
| 53 | #:use-module (gnu packages web)
|
| 54 | #:use-module (gnu packages compression)
|
| 55 | #:use-module (gnu packages))
|
| 56 |
|
| 57 | (define-public plotutils
|
| 58 | (package
|
| 59 | (name "plotutils")
|
| 60 | (version "2.6")
|
| 61 | (source (origin
|
| 62 | (method url-fetch)
|
| 63 | (uri (string-append "mirror://gnu/plotutils/plotutils-"
|
| 64 | version ".tar.gz"))
|
| 65 | (sha256
|
| 66 | (base32
|
| 67 | "1arkyizn5wbgvbh53aziv3s6lmd3wm9lqzkhxb3hijlp1y124hjg"))
|
| 68 | (modules '((guix build utils)))
|
| 69 | (snippet
|
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | '(begin
|
| 75 | (substitute* "configure"
|
| 76 | (("-lXaw")
|
| 77 | "-lXaw7"))
|
| 78 | |
| 79 | |
| 80 | |
| 81 | (substitute* "libplot/z_write.c"
|
| 82 | (("png_ptr->jmpbuf")
|
| 83 | "png_jmpbuf (png_ptr)"))
|
| 84 | #t))
|
| 85 | (patches
|
| 86 | |
| 87 | |
| 88 | |
| 89 | (search-patches "plotutils-spline-test.patch"))))
|
| 90 | (build-system gnu-build-system)
|
| 91 | (arguments
|
| 92 | (list #:configure-flags
|
| 93 | #~(list "--enable-libplotter"
|
| 94 |
|
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | #$@(if (target-x86-32?)
|
| 100 | #~("CFLAGS=-g -O2 -fexcess-precision=standard")
|
| 101 | #~()))
|
| 102 |
|
| 103 | #:phases
|
| 104 | (if (target-x86-32?)
|
| 105 | #~(modify-phases %standard-phases
|
| 106 | (add-before 'check 'skip-sloppy-test
|
| 107 | (lambda _
|
| 108 | |
| 109 | |
| 110 | (substitute* "test/plot2svg.test"
|
| 111 | (("^exit .*") "exit 77")))))
|
| 112 | #~%standard-phases)))
|
| 113 | (inputs (list libpng libx11 libxt libxaw))
|
| 114 | (home-page "https://www.gnu.org/software/plotutils/")
|
| 115 | (synopsis "Plotting utilities and library")
|
| 116 | (description
|
| 117 | "GNU Plotutils is a package for plotting and working with 2D graphics.
|
| 118 | It includes the C library @code{libplot} and the C++ @code{libplotter} library
|
| 119 | for exporting 2D vector graphics in many file formats. It also has support
|
| 120 | for 2D vector graphics animations. The package also contains command-line
|
| 121 | programs for plotting scientific data.")
|
| 122 | (license license:gpl2+)))
|
| 123 |
|
| 124 | (define-public guile-plotutils
|
| 125 | (package
|
| 126 | (name "guile-plotutils")
|
| 127 | (version "1.0.1")
|
| 128 | (source (origin
|
| 129 | (method url-fetch)
|
| 130 | (uri (list (string-append "https://lonelycactus.com/tarball/"
|
| 131 | "guile_plotutils-" version ".tar.gz")
|
| 132 | (string-append
|
| 133 | "https://github.com/spk121/guile-plotutils/releases/download/v"
|
| 134 | version "/guile_plotutils-" version
|
| 135 | ".tar.gz")))
|
| 136 | (sha256
|
| 137 | (base32
|
| 138 | "0r245z75cdzgzi57fpz84mnyrjq44793zzaaxxrszyxm1d06hc6r"))))
|
| 139 | (build-system gnu-build-system)
|
| 140 | (arguments
|
| 141 | `(#:imported-modules ((guix build guile-build-system)
|
| 142 | ,@%gnu-build-system-modules)
|
| 143 | #:modules (((guix build guile-build-system)
|
| 144 | #:select (target-guile-effective-version))
|
| 145 | (guix build gnu-build-system)
|
| 146 | (guix build utils))
|
| 147 | #:phases
|
| 148 | (modify-phases %standard-phases
|
| 149 | (add-before 'install 'set-library-file-name
|
| 150 | (lambda* (#:key outputs #:allow-other-keys)
|
| 151 | (let ((out (assoc-ref outputs "out"))
|
| 152 | (version (target-guile-effective-version)))
|
| 153 | |
| 154 | (invoke "make" "install-guileextensionLTLIBRARIES")
|
| 155 |
|
| 156 | |
| 157 | (substitute* '("module/plotutils/graph.scm"
|
| 158 | "module/plotutils/plot.scm")
|
| 159 | (("\"libguile-plotutils\"")
|
| 160 | (string-append "\"" out "/lib/guile/" version
|
| 161 | "/extensions/libguile-plotutils\"")))))))))
|
| 162 | (native-inputs (list pkg-config texinfo))
|
| 163 | (inputs (list plotutils guile-3.0 zlib))
|
| 164 | (home-page "https://lonelycactus.com/guile-plotutils.html")
|
| 165 | (synopsis "Guile bindings to the GNU Plotutils plotting libraries")
|
| 166 | (description
|
| 167 | "Guile-Plotutils is a Guile binding to the venerable GNU Plotutils
|
| 168 | plotting and graphing library. If you want to make graphs that look like you
|
| 169 | went to university in the 1990s, this is the library for you.")
|
| 170 | (license license:gpl3+)))
|
| 171 |
|
| 172 | (define-public guile-charting
|
| 173 | |
| 174 | |
| 175 | (let ((commit "75f755b691a9f712f3b956657d01805d6a8a1b98")
|
| 176 | (revision "1"))
|
| 177 | (package
|
| 178 | (name "guile-charting")
|
| 179 | (version (git-version "0.2.0" revision commit))
|
| 180 | (source (origin
|
| 181 | (method git-fetch)
|
| 182 | (uri (git-reference
|
| 183 | (url "https://gitlab.com/wingo/guile-charting")
|
| 184 | (commit commit)))
|
| 185 | (file-name (git-file-name name version))
|
| 186 | (sha256
|
| 187 | (base32
|
| 188 | "03049g7wnpyfi0r36ij4a46kc9l45jbanx02iklkjwav2n6jqnnk"))))
|
| 189 | (build-system gnu-build-system)
|
| 190 | (native-inputs
|
| 191 | (list autoconf automake texinfo pkg-config))
|
| 192 | (inputs (list guile-3.0))
|
| 193 | (propagated-inputs (list guile-cairo))
|
| 194 | (home-page "http://wingolog.org/projects/guile-charting/")
|
| 195 | (synopsis "Create charts and graphs in Guile")
|
| 196 | (description
|
| 197 | "Guile-Charting is a Guile Scheme library to create bar charts and graphs
|
| 198 | using the Cairo drawing library.")
|
| 199 | (license license:lgpl2.1+))))
|
| 200 |
|
| 201 | (define-public guile2.2-charting
|
| 202 | (package
|
| 203 | (inherit guile-charting)
|
| 204 | (name "guile2.2-charting")
|
| 205 | (inputs (list guile-2.2))
|
| 206 | (propagated-inputs (list guile2.2-cairo))))
|
| 207 |
|
| 208 | (define-public ploticus
|
| 209 | (package
|
| 210 | (name "ploticus")
|
| 211 | (version "2.42")
|
| 212 | (source (origin
|
| 213 | (method url-fetch)
|
| 214 | (uri (string-append "mirror://sourceforge/ploticus/ploticus/"
|
| 215 | version "/ploticus242_src.tar.gz"))
|
| 216 | (sha256
|
| 217 | (base32
|
| 218 | "1c70cvfvgjh83hj1x21130wb9qfr2rc0x47cxy9kl805yjwy8a9z"))
|
| 219 | (modules '((guix build utils)))
|
| 220 | (snippet
|
| 221 | |
| 222 | '(begin
|
| 223 | (substitute* "src/Makefile"
|
| 224 | (("INSTALLBIN =.*$")
|
| 225 | (string-append "INSTALLBIN = $(out)/bin")))
|
| 226 | #t))))
|
| 227 | (build-system gnu-build-system)
|
| 228 | (arguments
|
| 229 | '(#:tests? #f
|
| 230 | #:phases
|
| 231 | (modify-phases %standard-phases
|
| 232 | (replace 'configure (lambda _ (chdir "src")))
|
| 233 | (add-before 'install 'make-target-directories
|
| 234 | (lambda* (#:key outputs #:allow-other-keys)
|
| 235 | (let ((out (assoc-ref outputs "out")))
|
| 236 | (mkdir-p (string-append out "/bin"))
|
| 237 | #t)))
|
| 238 | (add-after 'install 'install-prefabs
|
| 239 | (lambda* (#:key outputs #:allow-other-keys)
|
| 240 | (let* ((out (assoc-ref outputs "out"))
|
| 241 | (dir (string-append out
|
| 242 | "/share/ploticus/prefabs"))
|
| 243 | (bin (string-append out "/bin")))
|
| 244 | (mkdir-p dir)
|
| 245 |
|
| 246 | |
| 247 | (for-each (lambda (file)
|
| 248 | (let ((target
|
| 249 | (string-append dir "/"
|
| 250 | (basename file))))
|
| 251 | (copy-file file target)))
|
| 252 | (find-files "../prefabs" "."))
|
| 253 |
|
| 254 | |
| 255 | (wrap-program (string-append bin "/pl")
|
| 256 | `("PLOTICUS_PREFABS" ":" = (,dir)))))))))
|
| 257 | (inputs
|
| 258 | (list libpng libx11 zlib))
|
| 259 | (home-page "http://ploticus.sourceforge.net/")
|
| 260 | (synopsis "Command-line tool for producing plots and charts")
|
| 261 | (description
|
| 262 | "Ploticus is a non-interactive software package for producing plots,
|
| 263 | charts, and graphics from data. Ploticus is good for automated or
|
| 264 | just-in-time graph generation, handles date and time data nicely, and has
|
| 265 | basic statistical capabilities. It allows significant user control over
|
| 266 | colors, styles, options and details.")
|
| 267 | (license license:gpl2+)))
|
| 268 |
|
| 269 | (define-public asymptote
|
| 270 | (package
|
| 271 | (name "asymptote")
|
| 272 | (version "2.83")
|
| 273 | (source
|
| 274 | (origin
|
| 275 | (method url-fetch)
|
| 276 | (uri (string-append "mirror://sourceforge/asymptote/"
|
| 277 | version "/asymptote-" version ".src.tgz"))
|
| 278 | (sha256
|
| 279 | (base32 "18w8nf0p1b3h74sk1b7w96kq5gcaq09idi4771ini7p594gsfg7y"))
|
| 280 | (modules '((guix build utils)))
|
| 281 | (snippet
|
| 282 | |
| 283 | #~(begin
|
| 284 | (delete-file-recursively "LspCpp/third_party/rapidjson")))))
|
| 285 | (build-system gnu-build-system)
|
| 286 | |
| 287 | |
| 288 | |
| 289 | (native-inputs
|
| 290 | (list autoconf
|
| 291 | automake
|
| 292 | boost
|
| 293 | cmake
|
| 294 | emacs-minimal
|
| 295 | ghostscript |
| 296 | perl
|
| 297 | rapidjson
|
| 298 | texinfo |
| 299 | (texlive-updmap.cfg
|
| 300 | (list texlive-amsfonts
|
| 301 | texlive-dvips-l3backend
|
| 302 | texlive-epsf
|
| 303 | texlive-etoolbox
|
| 304 | texlive-fonts-ec
|
| 305 | texlive-generic-infwarerr
|
| 306 | texlive-generic-kvdefinekeys
|
| 307 | texlive-grfext
|
| 308 | texlive-hyperref
|
| 309 | texlive-latex-base
|
| 310 | texlive-latex-geometry
|
| 311 | texlive-latex-graphics
|
| 312 | texlive-latex-kvoptions
|
| 313 | texlive-latex-media9
|
| 314 | texlive-latex-ocgx2
|
| 315 | texlive-latex-pdftexcmds
|
| 316 | texlive-oberdiek |
| 317 | texlive-latex-parskip
|
| 318 | texlive-tex-texinfo))))
|
| 319 | (inputs
|
| 320 | (list fftw
|
| 321 | freeglut
|
| 322 | glew
|
| 323 | glm
|
| 324 | gsl
|
| 325 | libgc
|
| 326 | libtirpc
|
| 327 | python
|
| 328 | python-cson
|
| 329 | python-numpy
|
| 330 | python-pyqt
|
| 331 | readline
|
| 332 | zlib))
|
| 333 | (arguments
|
| 334 | (list
|
| 335 | #:modules '((guix build emacs-utils)
|
| 336 | (guix build gnu-build-system)
|
| 337 | (guix build utils)
|
| 338 | (srfi srfi-26))
|
| 339 | #:imported-modules `(,@%gnu-build-system-modules
|
| 340 | (guix build emacs-utils))
|
| 341 | #:configure-flags
|
| 342 | #~(list (string-append "--enable-gc=" #$(this-package-input "libgc"))
|
| 343 | (string-append "--with-latex=" #$output "/share/texmf/tex/latex")
|
| 344 | (string-append "--with-context="
|
| 345 | #$output
|
| 346 | "/share/texmf/tex/context/third"))
|
| 347 | #:phases
|
| 348 | #~(modify-phases %standard-phases
|
| 349 | (add-after 'unpack 'locate-tirpc
|
| 350 | (lambda* (#:key inputs #:allow-other-keys)
|
| 351 | (substitute* (list "configure.ac")
|
| 352 | (("/usr/include/tirpc")
|
| 353 | (search-input-directory inputs "include/tirpc")))))
|
| 354 | (add-after 'unpack 'unbundle-rapidjson
|
| 355 | (lambda* (#:key inputs #:allow-other-keys)
|
| 356 | (substitute* (list "Makefile.in")
|
| 357 | (("\\$\\(CMAKE\\)" all)
|
| 358 | (string-append all " -DUSE_SYSTEM_RAPIDJSON=ON")))))
|
| 359 | (add-after 'unpack 'fix-includes
|
| 360 | (lambda _
|
| 361 | (substitute* (find-files "." "\\.in$")
|
| 362 | (("#include <primitives.h>") "#include \"primitives.h\""))
|
| 363 | (substitute* (find-files "prc" "\\.h$")
|
| 364 | (("#include \"config.h\"") "#include \"../config.h\""))
|
| 365 | (substitute* "prc/oPRCFile.h"
|
| 366 | (("#include \"xstream.h\"") "#include \"../xstream.h\""))
|
| 367 | (substitute* "v3dfile.h"
|
| 368 | (("#include <prc/oPRCFile.h>") "#include \"prc/oPRCFile.h\""))
|
| 369 | (substitute* "LspCpp/src/lsp/ParentProcessWatcher.cpp"
|
| 370 | (("#include <boost/process.hpp>" all)
|
| 371 | (string-append "#include <algorithm>\n" all)))))
|
| 372 | (replace 'bootstrap
|
| 373 | (lambda _
|
| 374 | (invoke "autoreconf" "-vfi")))
|
| 375 | (add-after 'unpack 'move-info-location
|
| 376 | |
| 377 | |
| 378 | |
| 379 | (lambda _
|
| 380 | (substitute* "doc/png/Makefile.in"
|
| 381 | (("(\\$\\(infodir\\))/asymptote" _ infodir) infodir))
|
| 382 | (substitute* "doc/asymptote.texi"
|
| 383 | (("asymptote/asymptote") "asymptote"))))
|
| 384 | (add-before 'build 'patch-pdf-viewer
|
| 385 | (lambda _
|
| 386 | |
| 387 | (substitute* "settings.cc"
|
| 388 | (("defaultPDFViewer=\"acroread\"")
|
| 389 | "defaultPDFViewer=\"gv\""))))
|
| 390 | (add-before 'check 'set-HOME
|
| 391 | |
| 392 | |
| 393 | (lambda _
|
| 394 | (setenv "HOME" "/tmp")))
|
| 395 | (add-after 'install 'install-Emacs-data
|
| 396 | (lambda* (#:key outputs #:allow-other-keys)
|
| 397 | |
| 398 | (let ((lisp-dir
|
| 399 | (string-append #$output "/share/emacs/site-lisp")))
|
| 400 | (for-each (cut install-file <> lisp-dir)
|
| 401 | (find-files "." "\\.el$"))
|
| 402 | (emacs-generate-autoloads #$name lisp-dir))))
|
| 403 | (add-after 'install-Emacs-data 'wrap-python-script
|
| 404 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 405 | |
| 406 | (let ((path (getenv "GUIX_PYTHONPATH")))
|
| 407 | (wrap-program
|
| 408 | (string-append #$output "/share/asymptote/GUI/xasy.py")
|
| 409 | `("GUIX_PYTHONPATH" ":" prefix (,path)))))))))
|
| 410 | (home-page "http://asymptote.sourceforge.net")
|
| 411 | (synopsis "Script-based vector graphics language")
|
| 412 | (description
|
| 413 | "Asymptote is a powerful descriptive vector graphics language for
|
| 414 | technical drawing, inspired by MetaPost but with an improved C++-like syntax.
|
| 415 | Asymptote provides for figures the same high-quality level of typesetting that
|
| 416 | LaTeX does for scientific text.")
|
| 417 | |
| 418 | |
| 419 | |
| 420 | |
| 421 | (license license:lgpl3+)))
|