1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{6,7} )
8 inherit autotools elisp-common latex-package python-r1
10 DESCRIPTION="A vector graphics language that provides a framework for technical drawing"
11 HOMEPAGE="http://asymptote.sourceforge.net/"
12 SRC_URI="mirror://sourceforge/asymptote/${P}.src.tgz"
16 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
17 IUSE="+boehm-gc doc emacs examples fftw gsl +imagemagick latex offscreen +opengl python sigsegv svg test vim-syntax X"
18 RESTRICT="!test? ( test )"
21 ${PYTHON_REQUIRED_USE}
26 >=sys-libs/ncurses-5.4-r5:0=
27 >=sys-libs/readline-4.3-r5:0=
28 imagemagick? ( media-gfx/imagemagick[png] )
29 opengl? ( media-libs/mesa[X(+)] media-libs/freeglut media-libs/glew:0 media-libs/glm )
30 offscreen? ( media-libs/mesa[osmesa] )
31 svg? ( app-text/dvisvgm )
32 sigsegv? ( dev-libs/libsigsegv )
33 boehm-gc? ( >=dev-libs/boehm-gc-7.0[cxx,threads] )
34 fftw? ( >=sci-libs/fftw-3.0.1 )
36 python? ( ${PYTHON_DEPS} )
39 dev-python/PyQt5[${PYTHON_USEDEP},gui,widgets,svg]
42 >=gnome-base/librsvg-2.40
46 >=dev-texlive/texlive-latexextra-2013
48 emacs? ( >=app-editors/emacs-23.1:* )
49 vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
53 media-gfx/imagemagick[png]
56 app-text/ghostscript-gpl )
57 test? ( app-text/ghostscript-gpl )"
59 TEXMF=/usr/share/texmf-site
62 # Changing pdf, ps, image viewers to xdg-open
63 "${FILESDIR}/${P}-xdg-utils.patch"
66 "${FILESDIR}/${P}-info.patch"
70 sed -e "s:Datadir/doc/asymptote:Datadir/doc/${PF}:" \
72 || die "sed configure.ac failed"
79 # for the CPPFLAGS see
80 # https://sourceforge.net/forum/forum.php?thread_id=1683277&forum_id=409349
82 CPPFLAGS=-DHAVE_SYS_TYPES_H \
83 CFLAGS="${CXXFLAGS}" \
85 $(use_enable boehm-gc gc system) \
88 $(use_enable opengl gl) \
89 $(use_enable offscreen) \
106 einfo "Making pdf docs"
107 export VARTEXFONTS="${T}"/fonts
109 emake -j1 asymptote.pdf
115 einfo "Compiling emacs lisp files"
116 elisp-compile base/*.el
125 insinto /usr/share/${PN}
129 dodoc BUGS ChangeLog README ReleaseNotes TODO
134 insinto /usr/share/${PN}
136 chmod +x "${D}"/usr/share/${PN}/GUI/xasy.py
137 dosym ../share/${PN}/GUI/xasy.py /usr/bin/xasy
142 if use examples; then
143 insinto /usr/share/${PN}/examples
150 insinto /usr/share/${PN}/examples/animations
151 doins examples/animations/*.asy
157 insinto "${TEXMF}"/tex/latex/${PN}
158 doins ${PN}.sty asycolors.sty
159 if use examples; then
160 insinto /usr/share/${PN}/examples
162 insinto /usr/share/${PN}/examples/animations
163 doins ../examples/animations/*.tex
170 python_foreach_impl python_domodule base/${PN}.py
175 elisp-install ${PN} base/*.el base/*.elc
176 elisp-site-file-install "${FILESDIR}"/64${PN}-gentoo.el
180 if use vim-syntax; then
181 insinto /usr/share/vim/vimfiles/syntax
183 insinto /usr/share/vim/vimfiles/ftdetect
184 doins "${FILESDIR}"/asy-ftd.vim
187 # extra documentation
191 dodoc ${PN}.pdf CAD.pdf
201 use latex && latex-package_rehash
202 use emacs && elisp-site-regen
204 elog 'Use the variable ASYMPTOTE_PSVIEWER to set the postscript viewer'
205 elog 'Use the variable ASYMPTOTE_PDFVIEWER to set the PDF viewer'
209 use latex && latex-package_rehash
210 use emacs && elisp-site-regen