plotutils.scm 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 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. ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  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. (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. (define-public plotutils
  45. (package
  46. (name "plotutils")
  47. (version "2.6")
  48. (source (origin
  49. (method url-fetch)
  50. (uri (string-append "mirror://gnu/plotutils/plotutils-"
  51. version ".tar.gz"))
  52. (sha256
  53. (base32
  54. "1arkyizn5wbgvbh53aziv3s6lmd3wm9lqzkhxb3hijlp1y124hjg"))
  55. (patches (search-patches "plotutils-libpng-jmpbuf.patch"))
  56. (modules '((guix build utils)))
  57. (snippet
  58. ;; Force the use of libXaw7 instead of libXaw. When not doing
  59. ;; that, libplot.la ends up containing just "-lXaw" (without
  60. ;; "-L/path/to/Xaw"), due to the fact that there is no
  61. ;; libXaw.la, which forces us to propagate libXaw.
  62. '(begin
  63. (substitute* "configure"
  64. (("-lXaw")
  65. "-lXaw7"))
  66. #t))))
  67. (build-system gnu-build-system)
  68. (inputs `(("libpng" ,libpng)
  69. ("libx11" ,libx11)
  70. ("libxt" ,libxt)
  71. ("libxaw" ,libxaw)))
  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. (define-public guile-charting
  83. (package
  84. (name "guile-charting")
  85. (version "0.2.0")
  86. (source (origin
  87. (method url-fetch)
  88. (uri (string-append "http://wingolog.org/pub/guile-charting/"
  89. "guile-charting-" version ".tar.gz"))
  90. (sha256
  91. (base32
  92. "0w5qiyv9v0ip5li22x762bm48g8xnw281w66iyw094zdw611pb2m"))))
  93. (build-system gnu-build-system)
  94. (native-inputs `(("pkg-config" ,pkg-config)))
  95. (inputs `(("guile" ,guile-2.2)))
  96. (propagated-inputs `(("guile-cairo" ,guile-cairo)))
  97. (home-page "http://wingolog.org/software/guile-charting/")
  98. (synopsis "Create charts and graphs in Guile")
  99. (description
  100. "Guile-Charting is a Guile Scheme library to create bar charts and graphs
  101. using the Cairo drawing library.")
  102. (license license:lgpl2.1+)))
  103. (define-public ploticus
  104. (package
  105. (name "ploticus")
  106. (version "2.42")
  107. (source (origin
  108. (method url-fetch)
  109. (uri (string-append "mirror://sourceforge/ploticus/ploticus/"
  110. version "/ploticus242_src.tar.gz"))
  111. (sha256
  112. (base32
  113. "1c70cvfvgjh83hj1x21130wb9qfr2rc0x47cxy9kl805yjwy8a9z"))
  114. (modules '((guix build utils)))
  115. (snippet
  116. ;; Install binaries in the right place.
  117. '(begin
  118. (substitute* "src/Makefile"
  119. (("INSTALLBIN =.*$")
  120. (string-append "INSTALLBIN = $(out)/bin")))
  121. #t))))
  122. (build-system gnu-build-system)
  123. (arguments
  124. '(#:tests? #f
  125. #:phases
  126. (modify-phases %standard-phases
  127. (replace 'configure (lambda _ (chdir "src")))
  128. (add-before 'install 'make-target-directories
  129. (lambda* (#:key outputs #:allow-other-keys)
  130. (let ((out (assoc-ref outputs "out")))
  131. (mkdir-p (string-append out "/bin"))
  132. #t)))
  133. (add-after 'install 'install-prefabs
  134. (lambda* (#:key outputs #:allow-other-keys)
  135. (let* ((out (assoc-ref outputs "out"))
  136. (dir (string-append out
  137. "/share/ploticus/prefabs"))
  138. (bin (string-append out "/bin")))
  139. (mkdir-p dir)
  140. ;; Install "prefabs".
  141. (for-each (lambda (file)
  142. (let ((target
  143. (string-append dir "/"
  144. (basename file))))
  145. (copy-file file target)))
  146. (find-files "../prefabs" "."))
  147. ;; Allow them to be found.
  148. (wrap-program (string-append bin "/pl")
  149. `("PLOTICUS_PREFABS" ":" = (,dir)))))))))
  150. (inputs
  151. `(("libpng" ,libpng)
  152. ("libx11" ,libx11)
  153. ("zlib" ,zlib)))
  154. (home-page "http://ploticus.sourceforge.net/")
  155. (synopsis "Command-line tool for producing plots and charts")
  156. (description
  157. "Ploticus is a non-interactive software package for producing plots,
  158. charts, and graphics from data. Ploticus is good for automated or
  159. just-in-time graph generation, handles date and time data nicely, and has
  160. basic statistical capabilities. It allows significant user control over
  161. colors, styles, options and details.")
  162. (license license:gpl2+)))
  163. (define-public asymptote
  164. (package
  165. (name "asymptote")
  166. (version "2.47")
  167. (source (origin
  168. (method url-fetch)
  169. (uri (string-append "mirror://sourceforge/asymptote/"
  170. version "/asymptote-" version ".src.tgz"))
  171. (sha256
  172. (base32
  173. "0zc24n2vwzxdfmcppqfk3fkqlb4jmvswzi3bz232kxl7dyiyb971"))))
  174. (build-system gnu-build-system)
  175. ;; Note: The 'asy' binary retains a reference to docdir for use with its
  176. ;; "help" command in interactive mode, so adding a "doc" output is not
  177. ;; currently useful.
  178. (native-inputs
  179. `(("gs" ,ghostscript) ;For tests
  180. ("texinfo" ,texinfo) ;For generating documentation
  181. ;; For the manual and the tests.
  182. ("texlive" ,(texlive-union (list texlive-fonts-amsfonts
  183. texlive-generic-ifxetex
  184. texlive-latex-amsfonts
  185. texlive-latex-geometry
  186. texlive-latex-graphics
  187. texlive-latex-oberdiek
  188. texlive-latex-parskip
  189. texlive-tex-texinfo)))
  190. ("emacs" ,emacs-minimal)
  191. ("perl" ,perl)))
  192. (inputs
  193. `(("fftw" ,fftw)
  194. ("freeglut" ,freeglut)
  195. ("gsl" ,gsl)
  196. ("libgc" ,libgc)
  197. ("python" ,python-2)
  198. ("readline" ,readline)
  199. ("zlib" ,zlib)))
  200. (arguments
  201. `(#:modules ((guix build emacs-utils)
  202. (guix build gnu-build-system)
  203. (guix build utils)
  204. (srfi srfi-26))
  205. #:imported-modules (,@%gnu-build-system-modules
  206. (guix build emacs-utils))
  207. #:configure-flags
  208. (list (string-append "--enable-gc=" (assoc-ref %build-inputs "libgc"))
  209. (string-append "--with-latex="
  210. (assoc-ref %outputs "out")
  211. "/share/texmf/tex/latex")
  212. (string-append "--with-context="
  213. (assoc-ref %outputs "out")
  214. "/share/texmf/tex/context/third"))
  215. #:phases
  216. (modify-phases %standard-phases
  217. (add-before 'build 'patch-pdf-viewer
  218. (lambda _
  219. ;; Default to a free pdf viewer.
  220. (substitute* "settings.cc"
  221. (("defaultPDFViewer=\"acroread\"")
  222. "defaultPDFViewer=\"gv\""))
  223. #t))
  224. (add-before 'check 'set-HOME
  225. ;; Some tests require write access to $HOME, otherwise leading to
  226. ;; "failed to create directory /homeless-shelter/.asy" error.
  227. (lambda _
  228. (setenv "HOME" "/tmp")
  229. ;; The "gs" test fails, complaining about an incompatible
  230. ;; Ghostscript version. Not sure what's going on... Is this
  231. ;; because I've just replaced texlive with texlive-union?
  232. (substitute* "tests/Makefile"
  233. (("^(TESTDIRS =.*) gs(.*)" begin end)
  234. (string-append begin " " end)))
  235. #t))
  236. (add-after 'install 'install-Emacs-data
  237. (lambda* (#:key outputs #:allow-other-keys)
  238. ;; Install related Emacs libraries into an appropriate location.
  239. (let* ((out (assoc-ref outputs "out"))
  240. (lisp-dir (string-append out "/share/emacs/site-lisp")))
  241. (for-each (cut install-file <> lisp-dir)
  242. (find-files "." "\\.el$"))
  243. (emacs-generate-autoloads ,name lisp-dir))
  244. #t)))))
  245. (home-page "http://asymptote.sourceforge.net")
  246. (synopsis "Script-based vector graphics language")
  247. (description
  248. "Asymptote is a powerful descriptive vector graphics language for
  249. technical drawing, inspired by MetaPost but with an improved C++-like syntax.
  250. Asymptote provides for figures the same high-quality level of typesetting that
  251. LaTeX does for scientific text.")
  252. ;; Most source files do not contain license statements, but the README
  253. ;; contains: "All source files in the Asymptote project, unless explicitly
  254. ;; noted otherwise, are released under version 3 (or later) of the GNU
  255. ;; Lesser General Public License"
  256. (license license:lgpl3+)))