/[gentoo-x86]/media-gfx/asymptote/asymptote-2.13.ebuild
Gentoo

Contents of /media-gfx/asymptote/asymptote-2.13.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Mon Nov 14 11:23:37 2011 UTC (2 years, 10 months ago) by flameeyes
Branch: MAIN
Changes since 1.5: +2 -2 lines
QA: cxx conditional was broken, fix it.

(Portage version: 2.2.0_alpha74/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-gfx/asymptote/asymptote-2.13.ebuild,v 1.5 2011/11/13 19:07:27 vapier Exp $
4
5 EAPI=3
6 SUPPORT_PYTHON_ABIS=1
7 PYTHON_DEPEND="python? 2"
8 RESTRICT_PYTHON_ABIS="3.*"
9 inherit eutils autotools elisp-common latex-package multilib python
10
11 DESCRIPTION="A vector graphics language that provides a framework for technical drawing"
12 HOMEPAGE="http://asymptote.sourceforge.net/"
13 SRC_URI="mirror://sourceforge/asymptote/${P}.src.tgz"
14 LICENSE="GPL-3"
15 SLOT="0"
16 KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
17 IUSE="+boehm-gc doc emacs examples fftw gsl +imagemagick latex python sigsegv vim-syntax X"
18
19 RDEPEND=">=sys-libs/readline-4.3-r5
20 >=sys-libs/ncurses-5.4-r5
21 imagemagick? ( media-gfx/imagemagick[png] )
22 sigsegv? ( dev-libs/libsigsegv )
23 boehm-gc? ( >=dev-libs/boehm-gc-7.0[cxx,threads] )
24 fftw? ( >=sci-libs/fftw-3.0.1 )
25 gsl? ( sci-libs/gsl )
26 X? ( x11-misc/xdg-utils dev-lang/python dev-python/imaging[tk] )
27 latex? ( virtual/latex-base dev-texlive/texlive-latexextra )
28 emacs? ( virtual/emacs )
29 vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
30 DEPEND="${RDEPEND}
31 doc? ( dev-lang/perl virtual/texi2dvi virtual/latex-base media-gfx/imagemagick[png] )"
32
33 TEXMF=/usr/share/texmf-site
34
35 src_prepare() {
36 # Fixing sigsegv enabling
37 epatch "${FILESDIR}/${P}-configure-ac.patch"
38 einfo "Patching configure.ac"
39 sed -e "s:Datadir/doc/asymptote:Datadir/doc/${PF}:" \
40 -i configure.ac \
41 || die "sed configure.ac failed"
42
43 # Changing pdf, ps, image viewers to xdg-open
44 epatch "${FILESDIR}/${P}-xdg-utils.patch"
45
46 # Bug #322473
47 epatch "${FILESDIR}/${P}-info.patch"
48
49 eautoreconf
50 }
51
52 src_configure() {
53 # for the CPPFLAGS see
54 # http://sourceforge.net/forum/forum.php?thread_id=1683277&forum_id=409349
55 econf CPPFLAGS=-DHAVE_SYS_TYPES_H \
56 CFLAGS="${CXXFLAGS}" \
57 --disable-gc-debug \
58 $(use_enable boehm-gc gc system) \
59 $(use_enable fftw) \
60 $(use_enable gsl) \
61 $(use_with sigsegv)
62 }
63
64 src_compile() {
65 emake || die "emake failed"
66
67 cd doc
68 emake asy.1 || die "emake asy.1 failed"
69 if use doc; then
70 # info
71 einfo "Making info"
72 emake ${PN}.info || die "emake ${PN}.info failed"
73 cd FAQ
74 emake || die "emake FAQ failed"
75 cd ..
76 # pdf
77 einfo "Making pdf docs"
78 export VARTEXFONTS="${T}"/fonts
79 # see bug #260606
80 emake -j1 asymptote.pdf || die "emake asymptote.pdf failed"
81 emake CAD.pdf || die "emake CAD.pdf failed"
82 fi
83 cd ..
84
85 if use emacs; then
86 einfo "Compiling emacs lisp files"
87 elisp-compile base/*.el || die "elisp-compile failed"
88 fi
89 }
90
91 src_install() {
92 # the program
93 exeinto /usr/bin
94 doexe asy
95
96 # .asy files
97 insinto /usr/share/${PN}
98 doins base/*.asy
99
100 # documentation
101 dodoc BUGS ChangeLog README ReleaseNotes TODO
102 doman doc/asy.1
103
104 # X GUI
105 if use X; then
106 exeinto /usr/share/${PN}/GUI
107 doexe GUI/xasy.py
108 rm GUI/xasy.py
109 insinto /usr/share/${PN}/GUI
110 doins GUI/*.py
111 dosym /usr/share/${PN}/GUI/xasy.py /usr/bin/xasy
112 doman doc/xasy.1x
113 fi
114
115 # examples
116 if use examples; then
117 insinto /usr/share/${PN}/examples
118 doins examples/*.asy \
119 examples/*.eps \
120 doc/*.asy \
121 doc/*.csv \
122 doc/*.dat \
123 doc/extra/*.asy
124 if use X; then
125 doins GUI/*.asy
126 fi
127 insinto /usr/share/${PN}/examples/animations
128 doins examples/animations/*.asy
129 fi
130
131 # LaTeX style
132 if use latex; then
133 cd doc
134 insinto "${TEXMF}"/tex/latex/${PN}
135 doins ${PN}.sty asycolors.sty
136 if use examples; then
137 insinto /usr/share/${PN}/examples
138 doins latexusage.tex
139 fi
140 cd ..
141 fi
142
143 # asymptote.py
144 if use python; then
145 python_install() {
146 insinto "$(python_get_sitedir)"
147 doins base/${PN}.py
148 }
149 python_execute_function python_install
150 fi
151
152 # emacs mode
153 if use emacs; then
154 elisp-install ${PN} base/*.el base/*.elc
155 elisp-site-file-install "${FILESDIR}"/64${PN}-gentoo.el
156 fi
157
158 # vim syntax
159 if use vim-syntax; then
160 insinto /usr/share/vim/vimfiles/syntax
161 doins base/asy.vim
162 insinto /usr/share/vim/vimfiles/ftdetect
163 doins "${FILESDIR}"/asy-ftd.vim
164 fi
165
166 # extra documentation
167 if use doc; then
168 cd doc
169 doinfo ${PN}.info*
170 cd FAQ
171 dodoc asy-faq.ascii
172 doinfo asy-faq.info
173 insinto /usr/share/doc/${PF}/html/FAQ
174 doins asy-faq.html/*
175 cd ..
176 insinto /usr/share/doc/${PF}
177 doins ${PN}.pdf CAD.pdf
178 fi
179 }
180
181 pkg_postinst() {
182 use python && python_mod_optimize ${PN}.py
183 use latex && latex-package_rehash
184 use emacs && elisp-site-regen
185
186 elog 'Use the variable ASYMPTOTE_PSVIEWER to set the postscript viewer'
187 elog 'Use the variable ASYMPTOTE_PDFVIEWER to set the PDF viewer'
188 }
189
190 pkg_postrm() {
191 use python && python_mod_cleanup ${PN}.py
192 use latex && latex-package_rehash
193 use emacs && elisp-site-regen
194 }

  ViewVC Help
Powered by ViewVC 1.1.20