/[gentoo-x86]/sci-libs/ceres-solver/ceres-solver-1.4.0.ebuild
Gentoo

Contents of /sci-libs/ceres-solver/ceres-solver-1.4.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Thu Nov 14 01:49:00 2013 UTC (6 years, 2 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Version bump. Separate cxsparse (simpler library) from sparse flag, add lapack flag, adapt changes upstream to be more cmake friendly

(Portage version: 2.2.7-prefix/cvs/Linux x86_64, signed Manifest commit with key 0x13CB1360)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/ceres-solver/ceres-solver-1.4.0.ebuild,v 1.4 2013/03/04 18:28:26 bicatali Exp $
4
5 EAPI=4
6
7 inherit cmake-utils eutils multilib toolchain-funcs
8
9 DESCRIPTION="Nonlinear least-squares minimizer"
10 HOMEPAGE="https://code.google.com/p/ceres-solver/"
11 SRC_URI="https://${PN}.googlecode.com/files/${P}.tar.gz"
12
13 LICENSE="BSD"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
16 IUSE="doc examples gflags metis openmp protobuf +schur +sparse static-libs test"
17 REQUIRED_USE="test? ( gflags )"
18
19 RDEPEND="
20 dev-cpp/eigen:3
21 dev-cpp/glog[gflags?]
22 protobuf? ( dev-libs/protobuf )
23 sparse? (
24 sci-libs/amd
25 sci-libs/camd
26 sci-libs/ccolamd
27 sci-libs/cholmod[metis?]
28 sci-libs/colamd
29 sci-libs/cxsparse
30 virtual/blas
31 virtual/lapack )"
32 DEPEND="${RDEPEND}
33 sparse? ( virtual/pkgconfig )
34 doc? (
35 dev-python/pygments
36 dev-tex/minted
37 dev-texlive/texlive-science
38 virtual/latex-base )"
39
40 src_prepare() {
41 # prefix love
42 # disable blas/lapack forced library names
43 sed -i \
44 -e "s:/usr:${EPREFIX}/usr:g" \
45 -e '/FIND_LIBRARY(BLAS_LIB NAMES blas)/d' \
46 -e '/FIND_LIBRARY(LAPACK_LIB NAMES lapack)/d' \
47 -e 's/EXISTS ${BLAS_LIB}/BLAS_LIB/g' \
48 -e 's/EXISTS ${LAPACK_LIB}/LAPACK_LIB/g' \
49 CMakeLists.txt || die
50
51 # remove downloading minted.sty
52 sed -i \
53 -e '/minted/d' \
54 -e '/SHOW_PROGRES/d' \
55 -e "s:share/ceres/docs:share/doc/${PF}:" \
56 docs/CMakeLists.txt || die
57
58 epatch \
59 "${FILESDIR}"/${P}-test-no-suitesparse.patch \
60 "${FILESDIR}"/${P}-respect-libdir.patch
61 }
62
63 src_configure() {
64 local blibs llibs
65 if use sparse; then
66 blibs=$($(tc-getPKG_CONFIG) --libs blas)
67 llibs=$($(tc-getPKG_CONFIG) --libs lapack)
68 fi
69 local mycmakeargs=(
70 -DBLAS_LIB="${blibs}"
71 -DLAPACK_LIB="${llibs}"
72 $(cmake-utils_use_enable test TESTING)
73 $(cmake-utils_use doc BUILD_DOCUMENTATION)
74 $(cmake-utils_use gflags GFLAGS)
75 $(cmake-utils_use openmp OPENMP)
76 $(cmake-utils_use protobuf PROTOBUF)
77 $(cmake-utils_use schur SCHUR_SPECIALIZATIONS)
78 $(cmake-utils_use sparse CXSPARSE)
79 $(cmake-utils_use sparse SUITESPARSE)
80 )
81 cmake-utils_src_configure
82 }
83
84 src_install() {
85 cmake-utils_src_install
86 dodoc README VERSION
87
88 use static-libs || rm "${ED}"/usr/$(get_libdir)/libceres.a
89 dosym libceres_shared.so /usr/$(get_libdir)/libceres.so
90
91 if use examples; then
92 insinto /usr/share/doc/${PF}
93 doins -r examples
94 fi
95 }

  ViewVC Help
Powered by ViewVC 1.1.20