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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (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.1: +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.6.0.ebuild,v 1.1 2013/05/22 21:10:26 bicatali Exp $
4
5 EAPI=5
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? ( dev-python/sphinx )"
35
36 src_prepare() {
37 # prefix love
38 # disable blas/lapack forced library names
39 sed -i \
40 -e "s:/usr:${EPREFIX}/usr:g" \
41 -e '/FIND_LIBRARY(BLAS_LIB NAMES blas)/d' \
42 -e '/FIND_LIBRARY(LAPACK_LIB NAMES lapack)/d' \
43 -e 's/EXISTS ${BLAS_LIB}/BLAS_LIB/g' \
44 -e 's/EXISTS ${LAPACK_LIB}/LAPACK_LIB/g' \
45 -e 's/-Werror//g' \
46 CMakeLists.txt || die
47
48 # respect gentoo doc dir
49 sed -i \
50 -e "s:share/doc/ceres:share/doc/${PF}:" \
51 docs/source/CMakeLists.txt || die
52 }
53
54 src_configure() {
55 local blibs llibs
56 if use sparse; then
57 blibs=$($(tc-getPKG_CONFIG) --libs blas)
58 llibs=$($(tc-getPKG_CONFIG) --libs lapack)
59 fi
60 local mycmakeargs=(
61 -DBLAS_LIB="${blibs}"
62 -DLAPACK_LIB="${llibs}"
63 $(cmake-utils_use_enable test TESTING)
64 $(cmake-utils_use doc BUILD_DOCUMENTATION)
65 $(cmake-utils_use gflags GFLAGS)
66 $(cmake-utils_use openmp OPENMP)
67 $(cmake-utils_use protobuf PROTOBUF)
68 $(cmake-utils_use schur SCHUR_SPECIALIZATIONS)
69 $(cmake-utils_use sparse CXSPARSE)
70 $(cmake-utils_use sparse SUITESPARSE)
71 )
72 cmake-utils_src_configure
73 }
74
75 src_install() {
76 cmake-utils_src_install
77 dodoc README VERSION
78
79 use static-libs || rm "${ED}"/usr/$(get_libdir)/libceres.a
80 dosym libceres_shared.so /usr/$(get_libdir)/libceres.so
81
82 if use examples; then
83 insinto /usr/share/doc/${PF}
84 doins -r examples
85 fi
86 }

  ViewVC Help
Powered by ViewVC 1.1.20