1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 PYTHON_DEPEND="python? 2"
9 RESTRICT_PYTHON_ABIS="3.*"
11 inherit eutils autotools elisp-common latex-package multilib python
13 DESCRIPTION="A vector graphics language that provides a framework for technical drawing"
14 HOMEPAGE="http://asymptote.sourceforge.net/"
15 SRC_URI="mirror://sourceforge/asymptote/${P}.src.tgz"
19 KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
20 IUSE="+boehm-gc doc emacs examples fftw gsl +imagemagick latex offscreen +opengl python sigsegv svg vim-syntax X"
22 REQUIRED_USE="offscreen? ( opengl )"
25 >=sys-libs/readline-4.3-r5:0
26 >=sys-libs/ncurses-5.4-r5
27 imagemagick? ( media-gfx/imagemagick[png] )
28 opengl? ( >=media-libs/mesa-8 )
29 offscreen? ( media-libs/mesa[osmesa] )
30 svg? ( app-text/dvisvgm )
31 sigsegv? ( dev-libs/libsigsegv )
32 boehm-gc? ( >=dev-libs/boehm-gc-7.0[cxx,threads] )
33 fftw? ( >=sci-libs/fftw-3.0.1 )
35 X? ( x11-misc/xdg-utils dev-lang/python dev-python/imaging[tk] )
36 latex? ( virtual/latex-base dev-texlive/texlive-latexextra )
37 emacs? ( virtual/emacs )
38 vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
40 doc? ( dev-lang/perl virtual/texi2dvi virtual/latex-base media-gfx/imagemagick[png] )"
42 TEXMF=/usr/share/texmf-site
45 # Fixing sigsegv enabling
46 epatch "${FILESDIR}/${P}-configure-ac.patch"
47 einfo "Patching configure.ac"
48 sed -e "s:Datadir/doc/asymptote:Datadir/doc/${PF}:" \
50 || die "sed configure.ac failed"
52 # Changing pdf, ps, image viewers to xdg-open
53 epatch "${FILESDIR}/${P}-xdg-utils.patch"
56 epatch "${FILESDIR}/${P}-info.patch"
62 # for the CPPFLAGS see
63 # http://sourceforge.net/forum/forum.php?thread_id=1683277&forum_id=409349
65 CPPFLAGS=-DHAVE_SYS_TYPES_H \
66 CFLAGS="${CXXFLAGS}" \
68 $(use_enable boehm-gc gc system) \
71 $(use_enable opengl gl) \
72 $(use_enable offscreen) \
89 einfo "Making pdf docs"
90 export VARTEXFONTS="${T}"/fonts
92 emake -j1 asymptote.pdf
98 einfo "Compiling emacs lisp files"
99 elisp-compile base/*.el
108 insinto /usr/share/${PN}
112 dodoc BUGS ChangeLog README ReleaseNotes TODO
117 exeinto /usr/share/${PN}/GUI
119 rm GUI/xasy.py || die
120 insinto /usr/share/${PN}/GUI
122 dosym /usr/share/${PN}/GUI/xasy.py /usr/bin/xasy
127 if use examples; then
128 insinto /usr/share/${PN}/examples
136 use X && doins GUI/*.asy
138 insinto /usr/share/${PN}/examples/animations
139 doins examples/animations/*.asy
145 insinto "${TEXMF}"/tex/latex/${PN}
146 doins ${PN}.sty asycolors.sty
147 if use examples; then
148 insinto /usr/share/${PN}/examples
157 insinto "$(python_get_sitedir)"
160 python_execute_function python_install
165 elisp-install ${PN} base/*.el base/*.elc
166 elisp-site-file-install "${FILESDIR}"/64${PN}-gentoo.el
170 if use vim-syntax; then
171 insinto /usr/share/vim/vimfiles/syntax
173 insinto /usr/share/vim/vimfiles/ftdetect
174 doins "${FILESDIR}"/asy-ftd.vim
177 # extra documentation
184 insinto /usr/share/doc/${PF}/html/FAQ
187 insinto /usr/share/doc/${PF}
188 doins ${PN}.pdf CAD.pdf
193 use python && python_mod_optimize ${PN}.py
194 use latex && latex-package_rehash
195 use emacs && elisp-site-regen
197 elog 'Use the variable ASYMPTOTE_PSVIEWER to set the postscript viewer'
198 elog 'Use the variable ASYMPTOTE_PDFVIEWER to set the PDF viewer'
202 use python && python_mod_cleanup ${PN}.py
203 use latex && latex-package_rehash
204 use emacs && elisp-site-regen