blob: d7338c2f97d91c6cc6c8fe62eda205962100cc44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit versionator eutils autotools
DESCRIPTION="Math Graphics Library"
IUSE="fltk glut jpeg tiff hdf5 doc linguas_ru"
HOMEPAGE="http://mathgl.sourceforge.net/"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
DOC=${PN}-$(get_version_component_range 1-2 )
SRC_URI="mirror://sourceforge/${PN}/${P}.tgz
mirror://sourceforge/${PN}/STIX_font.tgz
doc? ( mirror://sourceforge/${PN}/${DOC}-eng.pdf
linguas_ru? ( mirror://sourceforge/${PN}/${DOC}-rus.pdf ) )"
DEPEND="sci-libs/gsl
virtual/glu
fltk? ( x11-libs/fltk )
glut? ( virtual/glut )
jpeg? ( media-libs/jpeg )
tiff? ( media-libs/tiff )
hdf5? ( sci-libs/hdf5 )"
#### Remove the following line when moving this ebuild to the main tree!
RESTRICT=mirror
src_unpack() {
local FLTK_FLAGS,FLTK_LIBS,FLTK_H
unpack ${A}
cd "${S}"
mv ../*.vfm fonts/
# Remove ru_RU.cp1251
epatch "${FILESDIR}"/${PN}-no-cp1251.patch
if use fltk; then
FLTK_FLAGS=`fltk-config --cxxflags`
FLTK_LIBS=`fltk-config --use-images --ldflags`
FLTK_H=`echo ${FLTK_FLAGS} | sed -e 's:-I/usr/include/::'`
[ -n "${FLTK_H}" ] && FLTK_H="${FLTK_H}"/
epatch "${FILESDIR}"/${PN}-fltk.patch
sed -e "s:@FLTK_H@:${FLTK_H}:g" \
-e "s:@FLTK_FLAGS@:${FLTK_FLAGS}:g" \
-e "s:@FLTK_LIBS@:${FLTK_LIBS}:g" \
-i configure.ac
sed -e "s:@FLTK_FLAGS@:${FLTK_FLAGS}:g" \
-i examples/Makefile.am
fi
sed -e "s:-O2:${CPPFLAGS}:g" -i mgl/Makefile.am
sed -e "s:-O2:${CPPFLAGS}:g" -i examples/Makefile.am
eautoreconf
}
src_compile() {
econf $(use_enable fltk ) \
$(use_enable glut ) \
$(use_enable jpeg ) \
$(use_enable tiff ) \
$(use_enable hdf5 ) \
|| die "econf failed"
emake || die "emake failed"
}
src_install() {
emake DESTDIR="${D}" install || die "emake install failed"
dodoc README AUTHORS || die "dodoc failed"
if use doc; then
insinto /usr/share/doc/${P}
doins "${DISTDIR}"/${DOC}-eng.pdf
use linguas_ru && doins "${DISTDIR}"/${DOC}-rus.pdf
fi
}
|