Gentoo Archives: gentoo-commits

From: Sebastien Fabbro <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/armadillo/, sci-libs/armadillo/files/
Date: Mon, 10 Feb 2014 04:14:26
Message-Id: 1391973937.36897fb005324e6cb1abb63c9257766987313576.bicatali@gentoo
1 commit: 36897fb005324e6cb1abb63c9257766987313576
2 Author: Sébastien Fabbro <bicatali <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 9 19:25:37 2014 +0000
4 Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 9 19:25:37 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=36897fb0
7
8 sci-libs/armadillo: Version bump
9
10 Package-Manager: portage-2.2.8-prefix
11
12 ---
13 sci-libs/armadillo/ChangeLog | 6 ++
14 sci-libs/armadillo/armadillo-4.000.3.ebuild | 109 +++++++++++++++++++++
15 .../armadillo/files/armadillo-4.000.3-hdf5.patch | 19 ++++
16 3 files changed, 134 insertions(+)
17
18 diff --git a/sci-libs/armadillo/ChangeLog b/sci-libs/armadillo/ChangeLog
19 index 98a692c..721a0a1 100644
20 --- a/sci-libs/armadillo/ChangeLog
21 +++ b/sci-libs/armadillo/ChangeLog
22 @@ -2,6 +2,12 @@
23 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
24 # $Header: $
25
26 +*armadillo-4.000.3 (09 Feb 2014)
27 +
28 + 09 Feb 2014; Sébastien Fabbro <bicatali@g.o> +armadillo-4.000.3.ebuild,
29 + +files/armadillo-4.000.3-hdf5.patch:
30 + sci-libs/armadillo: Version bump
31 +
32 08 Feb 2014; Reinis Danne <rei4dan@×××××.com> armadillo-3.930.0.ebuild:
33 Fix cblas, clapack include dir.
34
35
36 diff --git a/sci-libs/armadillo/armadillo-4.000.3.ebuild b/sci-libs/armadillo/armadillo-4.000.3.ebuild
37 new file mode 100644
38 index 0000000..7b82540
39 --- /dev/null
40 +++ b/sci-libs/armadillo/armadillo-4.000.3.ebuild
41 @@ -0,0 +1,109 @@
42 +# Copyright 1999-2014 Gentoo Foundation
43 +# Distributed under the terms of the GNU General Public License v2
44 +# $Header: $
45 +
46 +EAPI=5
47 +
48 +CMAKE_IN_SOURCE_BUILD=1
49 +
50 +inherit cmake-utils toolchain-funcs multilib eutils
51 +
52 +DESCRIPTION="Streamlined C++ linear algebra library"
53 +HOMEPAGE="http://arma.sourceforge.net/"
54 +SRC_URI="mirror://sourceforge/arma/${P}.tar.gz"
55 +
56 +LICENSE="MPL-2.0"
57 +SLOT="0/4"
58 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
59 +IUSE="arpack atlas blas debug doc examples hdf5 int64 lapack mkl tbb test"
60 +REQUIRED_USE="test? ( lapack )"
61 +
62 +RDEPEND="
63 + dev-libs/boost
64 + arpack? ( sci-libs/arpack )
65 + atlas? ( sci-libs/atlas[lapack] )
66 + blas? ( virtual/blas )
67 + lapack? ( virtual/lapack )"
68 +DEPEND="${RDEPEND}
69 + arpack? ( virtual/pkgconfig )
70 + atlas? ( virtual/pkgconfig )
71 + blas? ( virtual/pkgconfig )
72 + hdf5? ( sci-libs/hdf5 )
73 + lapack? ( virtual/pkgconfig )
74 + mkl? ( sci-libs/mkl )
75 + tbb? ( dev-cpp/tbb )"
76 +PDEPEND="${RDEPEND}
77 + hdf5? ( sci-libs/hdf5 )
78 + mkl? ( sci-libs/mkl )
79 + tbb? ( dev-cpp/tbb )"
80 +
81 +src_prepare() {
82 + epatch \
83 + "${FILESDIR}"/${PN}-4.000.3-hdf5.patch \
84 + "${FILESDIR}"/${PN}-3.820.1-example-makefile.patch
85 + # avoid the automagic cmake macros
86 + sed -i -e '/ARMA_Find/d' CMakeLists.txt || die
87 +}
88 +
89 +src_configure() {
90 + local mycmakeargs=(
91 + -DINSTALL_LIB_DIR="${EPREFIX}/usr/$(get_libdir)"
92 + $(cmake-utils_use debug ARMA_EXTRA_DEBUG)
93 + $(cmake-utils_use int64 ARMA_64BIT_WORD)
94 + $(cmake-utils_use mkl ARMA_USE_MKL_ALLOC)
95 + $(cmake-utils_use tbb ARMA_USE_TBB_ALLOC)
96 + )
97 + if use arpack; then
98 + mycmakeargs+=(
99 + -DARPACK_FOUND=ON
100 + -DARPACK_LIBRARY="$($(tc-getPKG_CONFIG) --libs arpack)"
101 + )
102 + fi
103 + if use blas; then
104 + mycmakeargs+=(
105 + -DBLAS_FOUND=ON
106 + -DBLAS_LIBRARIES="$($(tc-getPKG_CONFIG) --libs blas)"
107 + )
108 + fi
109 + if use lapack; then
110 + mycmakeargs+=(
111 + -DLAPACK_FOUND=ON
112 + -DLAPACK_LIBRARIES="$($(tc-getPKG_CONFIG) --libs lapack)"
113 + )
114 + fi
115 + if use atlas; then
116 + local c=atlas-cblas l=atlas-clapack
117 + $(tc-getPKG_CONFIG) --exists ${c}-threads && c+=-threads
118 + $(tc-getPKG_CONFIG) --exists ${l}-threads && l+=-threads
119 + mycmakeargs+=(
120 + -DCBLAS_FOUND=ON
121 + -DCBLAS_INCLUDE_DIR="$($(tc-getPKG_CONFIG) --cflags-only-I ${c} | sed 's/-I//')"
122 + -DCBLAS_LIBRARIES="$($(tc-getPKG_CONFIG) --libs ${c})"
123 + -DCLAPACK_FOUND=ON
124 + -DCLAPACK_INCLUDE_DIR="$($(tc-getPKG_CONFIG) --cflags-only-I ${l} | sed 's/-I//')"
125 + -DCLAPACK_LIBRARIES="$($(tc-getPKG_CONFIG) --libs ${l})"
126 + )
127 + fi
128 + cmake-utils_src_configure
129 +}
130 +
131 +src_test() {
132 + pushd examples > /dev/null
133 + emake \
134 + CXXFLAGS="-I../include ${CXXFLAGS} -DARMA_USE_BLAS -DARMA_USE_LAPACK" \
135 + EXTRA_LIB_FLAGS="-L.. $($(tc-getPKG_CONFIG) --libs blas lapack)"
136 + LD_LIBRARY_PATH="..:${LD_LIBRARY_PATH}" ./example1 || die
137 + LD_LIBRARY_PATH="..:${LD_LIBRARY_PATH}" ./example2 || die
138 + emake clean
139 + popd > /dev/null
140 +}
141 +
142 +src_install() {
143 + cmake-utils_src_install
144 + dodoc README.txt
145 + use doc && dodoc *pdf && dohtml *html
146 + if use examples; then
147 + insinto /usr/share/doc/${PF}
148 + doins -r examples
149 + fi
150 +}
151
152 diff --git a/sci-libs/armadillo/files/armadillo-4.000.3-hdf5.patch b/sci-libs/armadillo/files/armadillo-4.000.3-hdf5.patch
153 new file mode 100644
154 index 0000000..4510cd8
155 --- /dev/null
156 +++ b/sci-libs/armadillo/files/armadillo-4.000.3-hdf5.patch
157 @@ -0,0 +1,19 @@
158 +--- armadillo-4.000.2/CMakeLists.txt.orig 2014-02-03 14:47:35.023255183 -0800
159 ++++ armadillo-4.000.2/CMakeLists.txt 2014-02-03 21:19:47.567376544 -0800
160 +@@ -227,11 +227,11 @@
161 + # find_package(HDF5)
162 + # message(STATUS "HDF5_FOUND = ${HDF5_FOUND}")
163 + #
164 +-# if(HDF5_FOUND)
165 +-# set(ARMA_USE_HDF5 true)
166 +-# set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${HDF5_INCLUDE_DIRS})
167 +-# set(ARMA_LIBS ${ARMA_LIBS} ${HDF5_LIBRARIES})
168 +-# endif()
169 ++if(HDF5_FOUND)
170 ++ set(ARMA_USE_HDF5 true)
171 ++ set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${HDF5_INCLUDE_DIRS})
172 ++ set(ARMA_LIBS ${ARMA_LIBS} ${HDF5_LIBRARIES})
173 ++ endif()
174 +
175 +
176 + include(ARMA_FindARPACK)