gnu: asymptote: Update to 2.74.

* gnu/packages/plotutils.scm (asymptote): Update to 2.74.
[native-inputs]: Add autoconf, automake, boost, rapidjson, texlive-hyperref,
texlive-latex-media9, texlive-latex-ocgx2.
[inputs]: Add libtirpc.
[arguments]<#:configure-flags>: Use gexps.
<#:phases>: Fix more include statements.  Add phase to prevent
hard-coding tirpc include directory.  Also force boostrapping.  Remove
trailing #T.
This commit is contained in:
Nicolas Goaziou 2022-01-04 15:52:21 +01:00
parent 9235dd136e
commit b80b55e76d
No known key found for this signature in database
GPG key ID: DA00B4F048E92F2D

View file

@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org> ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2016, 2017, 2019, 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr> ;;; Copyright © 20162022 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; ;;;
@ -31,6 +31,7 @@ (define-module (gnu packages plotutils)
#:use-module (gnu packages algebra) #:use-module (gnu packages algebra)
#:use-module (gnu packages autotools) #:use-module (gnu packages autotools)
#:use-module (gnu packages bdw-gc) #:use-module (gnu packages bdw-gc)
#:use-module (gnu packages boost)
#:use-module (gnu packages emacs) #:use-module (gnu packages emacs)
#:use-module (gnu packages xorg) #:use-module (gnu packages xorg)
#:use-module (gnu packages image) #:use-module (gnu packages image)
@ -39,6 +40,7 @@ (define-module (gnu packages plotutils)
#:use-module (gnu packages gl) #:use-module (gnu packages gl)
#:use-module (gnu packages gtk) #:use-module (gnu packages gtk)
#:use-module (gnu packages maths) #:use-module (gnu packages maths)
#:use-module (gnu packages onc-rpc)
#:use-module (gnu packages perl) #:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config) #:use-module (gnu packages pkg-config)
#:use-module (gnu packages python) #:use-module (gnu packages python)
@ -47,6 +49,7 @@ (define-module (gnu packages plotutils)
#:use-module (gnu packages qt) #:use-module (gnu packages qt)
#:use-module (gnu packages texinfo) #:use-module (gnu packages texinfo)
#:use-module (gnu packages tex) #:use-module (gnu packages tex)
#:use-module (gnu packages web)
#:use-module (gnu packages compression) #:use-module (gnu packages compression)
#:use-module (gnu packages)) #:use-module (gnu packages))
@ -265,41 +268,47 @@ (define-public ploticus
(define-public asymptote (define-public asymptote
(package (package
(name "asymptote") (name "asymptote")
(version "2.70") (version "2.74")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (string-append "mirror://sourceforge/asymptote/" (uri (string-append "mirror://sourceforge/asymptote/"
version "/asymptote-" version ".src.tgz")) version "/asymptote-" version ".src.tgz"))
(sha256 (sha256
(base32 "0gqcm0m916kjzyfswlplhyyvmqhg9hsishmbg4pyjcwchlx93k7m")))) (base32 "1fmkxgxaxgngbc079sdrba00rdkq7v076pl43zd03br9j1d8m3nl"))))
(build-system gnu-build-system) (build-system gnu-build-system)
;; Note: The 'asy' binary retains a reference to docdir for use with its ;; Note: The 'asy' binary retains a reference to docdir for use with its
;; "help" command in interactive mode, so adding a "doc" output is not ;; "help" command in interactive mode, so adding a "doc" output is not
;; currently useful. ;; currently useful.
(native-inputs (native-inputs
`(("emacs" ,emacs-minimal) (list autoconf
("gs" ,ghostscript) ;For tests automake
("perl" ,perl) boost
("texinfo" ,texinfo) ;For generating documentation emacs-minimal
;; For the manual and the tests. ghostscript ;for tests
("texlive" ,(texlive-updmap.cfg perl
(list texlive-amsfonts rapidjson
texlive-dvips-l3backend texinfo ;for generating documentation
texlive-epsf (texlive-updmap.cfg
texlive-etoolbox (list texlive-amsfonts
texlive-fonts-ec texlive-dvips-l3backend
texlive-generic-infwarerr texlive-epsf
texlive-generic-kvdefinekeys texlive-etoolbox
texlive-grfext texlive-fonts-ec
texlive-latex-base texlive-generic-infwarerr
texlive-latex-geometry texlive-generic-kvdefinekeys
texlive-latex-graphics texlive-grfext
texlive-latex-kvoptions texlive-hyperref
texlive-latex-pdftexcmds texlive-latex-base
texlive-oberdiek ;for ifluatex texlive-latex-geometry
texlive-latex-parskip texlive-latex-graphics
texlive-tex-texinfo))))) texlive-latex-kvoptions
texlive-latex-media9
texlive-latex-ocgx2
texlive-latex-pdftexcmds
texlive-oberdiek ;for ifluatex
texlive-latex-parskip
texlive-tex-texinfo))))
(inputs (inputs
(list fftw (list fftw
freeglut freeglut
@ -307,6 +316,7 @@ (define-public asymptote
glm glm
gsl gsl
libgc libgc
libtirpc
python python
python-cson python-cson
python-numpy python-numpy
@ -314,29 +324,42 @@ (define-public asymptote
readline readline
zlib)) zlib))
(arguments (arguments
`(#:modules ((guix build emacs-utils) (list
#:modules '((guix build emacs-utils)
(guix build gnu-build-system) (guix build gnu-build-system)
(guix build utils) (guix build utils)
(srfi srfi-26)) (srfi srfi-26))
#:imported-modules (,@%gnu-build-system-modules #:imported-modules `(,@%gnu-build-system-modules
(guix build emacs-utils)) (guix build emacs-utils))
#:configure-flags #:configure-flags
(list (string-append "--enable-gc=" (assoc-ref %build-inputs "libgc")) #~(list (string-append "--enable-gc=" #$(this-package-input "libgc"))
(string-append "--with-latex=" (string-append "--with-latex=" #$output "/share/texmf/tex/latex")
(assoc-ref %outputs "out") (string-append "--with-context="
"/share/texmf/tex/latex") #$output
(string-append "--with-context=" "/share/texmf/tex/context/third"))
(assoc-ref %outputs "out") #:phases
"/share/texmf/tex/context/third")) `(modify-phases %standard-phases
#:phases (add-after 'unpack 'locate-tirpc
(modify-phases %standard-phases (lambda* (#:key inputs #:allow-other-keys)
(add-after 'unpack 'fix-build (substitute* (list "configure.ac")
;; XXX: Build process complains about missing "config.h" (("/usr/include/tirpc")
;; and "primitives.h" files. (search-input-directory inputs "include/tirpc")))))
(add-after 'unpack 'fix-includes
(lambda _ (lambda _
(substitute* (find-files "." "\\.in$") (substitute* (find-files "." "\\.in$")
(("#include <primitives.h>") "#include \"primitives.h\"")) (("#include <primitives.h>") "#include \"primitives.h\""))
(invoke "touch" "prc/config.h"))) (substitute* (find-files "prc" "\\.h$")
(("#include \"config.h\"") "#include \"../config.h\""))
(substitute* "prc/oPRCFile.h"
(("#include \"xstream.h\"") "#include \"../xstream.h\""))
(substitute* "v3dfile.h"
(("#include <prc/oPRCFile.h>") "#include \"prc/oPRCFile.h\""))
(substitute* "LspCpp/LibLsp/lsp/ParentProcessWatcher.cpp"
(("#include <boost/process.hpp>" all)
(string-append "#include <algorithm>\n" all)))))
(replace 'bootstrap
(lambda _
(invoke "autoreconf" "-vfi")))
(add-after 'unpack 'move-info-location (add-after 'unpack 'move-info-location
;; Build process installs info file in the unusual ;; Build process installs info file in the unusual
;; "%out/share/info/asymptote/" location. Move it to ;; "%out/share/info/asymptote/" location. Move it to
@ -345,21 +368,18 @@ (define-public asymptote
(substitute* "doc/png/Makefile.in" (substitute* "doc/png/Makefile.in"
(("(\\$\\(infodir\\))/asymptote" _ infodir) infodir)) (("(\\$\\(infodir\\))/asymptote" _ infodir) infodir))
(substitute* "doc/asymptote.texi" (substitute* "doc/asymptote.texi"
(("asymptote/asymptote") "asymptote")) (("asymptote/asymptote") "asymptote"))))
#t))
(add-before 'build 'patch-pdf-viewer (add-before 'build 'patch-pdf-viewer
(lambda _ (lambda _
;; Default to a free pdf viewer. ;; Default to a free pdf viewer.
(substitute* "settings.cc" (substitute* "settings.cc"
(("defaultPDFViewer=\"acroread\"") (("defaultPDFViewer=\"acroread\"")
"defaultPDFViewer=\"gv\"")) "defaultPDFViewer=\"gv\""))))
#t))
(add-before 'check 'set-HOME (add-before 'check 'set-HOME
;; Some tests require write access to $HOME, otherwise leading to ;; Some tests require write access to $HOME, otherwise leading to
;; "failed to create directory /homeless-shelter/.asy" error. ;; "failed to create directory /homeless-shelter/.asy" error.
(lambda _ (lambda _
(setenv "HOME" "/tmp") (setenv "HOME" "/tmp")))
#t))
(add-after 'install 'install-Emacs-data (add-after 'install 'install-Emacs-data
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
;; Install related Emacs libraries into an appropriate location. ;; Install related Emacs libraries into an appropriate location.
@ -367,16 +387,14 @@ (define-public asymptote
(lisp-dir (string-append out "/share/emacs/site-lisp"))) (lisp-dir (string-append out "/share/emacs/site-lisp")))
(for-each (cut install-file <> lisp-dir) (for-each (cut install-file <> lisp-dir)
(find-files "." "\\.el$")) (find-files "." "\\.el$"))
(emacs-generate-autoloads ,name lisp-dir)) (emacs-generate-autoloads ,name lisp-dir))))
#t))
(add-after 'install-Emacs-data 'wrap-python-script (add-after 'install-Emacs-data 'wrap-python-script
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
;; Make sure 'xasy' runs with the correct PYTHONPATH. ;; Make sure 'xasy' runs with the correct PYTHONPATH.
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
(path (getenv "GUIX_PYTHONPATH"))) (path (getenv "GUIX_PYTHONPATH")))
(wrap-program (string-append out "/share/asymptote/GUI/xasy.py") (wrap-program (string-append out "/share/asymptote/GUI/xasy.py")
`("GUIX_PYTHONPATH" ":" prefix (,path)))) `("GUIX_PYTHONPATH" ":" prefix (,path)))))))))
#t)))))
(home-page "http://asymptote.sourceforge.net") (home-page "http://asymptote.sourceforge.net")
(synopsis "Script-based vector graphics language") (synopsis "Script-based vector graphics language")
(description (description