sci-mathematics/rstudio: Thanks to tomboy-64 for fixing bug Bug 534152 - sci-mathemat...
[gentoo.git] / dev-cpp / eigen / eigen-2.0.17.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=4
6
7 inherit cmake-utils
8
9 DESCRIPTION="C++ template library for linear algebra"
10 HOMEPAGE="http://eigen.tuxfamily.org/"
11 SRC_URI="https://bitbucket.org/eigen/eigen/get/${PV}.tar.bz2 -> ${P}.tar.bz2"
12
13 LICENSE="GPL-3"
14 KEYWORDS="alpha amd64 ~arm ~hppa ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
15 SLOT="2"
16 IUSE="debug doc examples"
17
18 COMMON_DEPEND="
19         examples? (
20                 dev-qt/qtgui:4
21                 dev-qt/qtopengl:4
22         )"
23 DEPEND="${COMMON_DEPEND}
24         doc? ( app-doc/doxygen )"
25 RDEPEND="${COMMON_DEPEND}
26         !dev-cpp/eigen:0"
27
28 MAKEOPTS+=" -j1"
29
30 # bugs 426236, 455460, 467288
31 RESTRICT="test"
32
33 src_unpack() {
34         unpack ${A}
35         mv ${PN}* ${P} || die
36 }
37
38 src_configure() {
39         # benchmarks (BTL) brings up damn load of external deps including fortran
40         # compiler
41         # library hangs up complete compilation proccess, test later
42         mycmakeargs=(
43                 -DEIGEN_BUILD_LIB=OFF
44                 -DEIGEN_BUILD_BTL=OFF
45                 -DEIGEN_BUILD_PKGCONFIG=ON
46                 $(cmake-utils_use examples EIGEN_BUILD_DEMOS)
47         )
48         cmake-utils_src_configure
49 }
50
51 src_compile() {
52         cmake-utils_src_compile
53         if use doc; then
54                 cd "${CMAKE_BUILD_DIR}"
55                 emake doc
56         fi
57 }
58
59 src_install() {
60         cmake-utils_src_install
61         if use doc; then
62                 cd "${CMAKE_BUILD_DIR}"/doc
63                 dohtml -r html/*
64         fi
65         if use examples; then
66                 cd "${CMAKE_BUILD_DIR}"/demos
67                 dobin mandelbrot/mandelbrot opengl/quaternion_demo
68         fi
69 }
70
71 src_test() {
72         mycmakeargs=(
73                 -DEIGEN_BUILD_TESTS=ON
74                 -DEIGEN_TEST_NO_FORTRAN=ON
75         )
76         cmake-utils_src_configure
77         cmake-utils_src_compile
78         cmake-utils_src_test
79 }