Gentoo Archives: gentoo-commits

From: Sebastien Fabbro <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/bicatali:master commit in: sci-libs/lapacke-reference/
Date: Tue, 31 May 2011 20:13:06
Message-Id: 0f0973840ef1eb51f31d00a34e1cd547db2a5832.bicatali@gentoo
1 commit: 0f0973840ef1eb51f31d00a34e1cd547db2a5832
2 Author: Sébastien Fabbro <bicatali <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 30 20:04:13 2011 +0000
4 Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
5 CommitDate: Mon May 30 20:04:13 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/bicatali.git;a=commit;h=0f097384
7
8 moved to eapi4
9
10 ---
11 .../lapacke-reference-1.0.0.009.ebuild | 31 +++++++++-----------
12 1 files changed, 14 insertions(+), 17 deletions(-)
13
14 diff --git a/sci-libs/lapacke-reference/lapacke-reference-1.0.0.009.ebuild b/sci-libs/lapacke-reference/lapacke-reference-1.0.0.009.ebuild
15 index 6e95644..876db34 100644
16 --- a/sci-libs/lapacke-reference/lapacke-reference-1.0.0.009.ebuild
17 +++ b/sci-libs/lapacke-reference/lapacke-reference-1.0.0.009.ebuild
18 @@ -2,7 +2,7 @@
19 # Distributed under the terms of the GNU General Public License v2
20 # $Header: $
21
22 -EAPI="3"
23 +EAPI=4
24 inherit eutils toolchain-funcs versionator alternatives-2
25
26 MYP=lapacke-${PV}
27 @@ -19,17 +19,19 @@ IUSE="static-libs"
28 RDEPEND=""
29 DEPEND="test? ( virtual/lapack dev-util/pkgconfig )"
30
31 -LIBNAME=reflapacke
32 -
33 S="${WORKDIR}/lapacke"
34
35 +LIBNAME=reflapacke
36 +
37 make_shared_lib() {
38 + local libstatic=${1}
39 local soname=$(basename "${1%.a}").so.$(get_major_version)
40 + shift
41 einfo "Making ${soname}"
42 - ${2:-$(tc-getCC)} ${LDFLAGS} \
43 + ${LINK:-$(tc-getCC)} ${LDFLAGS} \
44 -shared -Wl,-soname="${soname}" \
45 - -Wl,--whole-archive "${1}" -Wl,--no-whole-archive \
46 - -o $(dirname "${1}")/"${soname}" || return 1
47 + -Wl,--whole-archive "${libstatic}" -Wl,--no-whole-archive \
48 + "$@" -o $(dirname "${libstatic}")/"${soname}" || die "${soname} failed"
49 }
50
51 src_prepare() {
52 @@ -46,26 +48,22 @@ src_prepare() {
53 }
54
55 src_compile() {
56 - emake CFLAGS="${CFLAGS} -fPIC" lapacke || die "pic compilation failed"
57 - make_shared_lib lib${LIBNAME}.a || die "doing shared lib failed"
58 + emake CFLAGS="${CFLAGS} -fPIC" lapacke
59 + make_shared_lib lib${LIBNAME}.a
60 if use static-libs; then
61 emake clean && rm -f lib${LIBNAME}.a
62 - emake lapacke || die "static compilation failed"
63 + emake lapacke
64 fi
65 }
66
67 src_test() {
68 - emake \
69 - LIBS="$(pkg-config --libs lapack)" \
70 - lapacke_testing || die "tests failed"
71 + emake LIBS="$(pkg-config --libs lapack)" lapacke_testing
72 }
73
74 src_install() {
75 - dolib.so lib${LIBNAME}.so.* || die
76 + dolib.so lib${LIBNAME}.so.*
77 dosym lib${LIBNAME}.so.* /usr/$(get_libdir)/lib${LIBNAME}.so
78 - if use static-libs; then
79 - dolib.a lib${LIBNAME}.a || die
80 - fi
81 + use static-libs && dolib.a lib${LIBNAME}.a
82 insinto /usr/include
83 doins include/lapacke*h || die
84 cat <<-EOF > ${LIBNAME}.pc
85 @@ -84,5 +82,4 @@ src_install() {
86 doins ${LIBNAME}.pc || die
87 alternatives_for lapacke reference 0 \
88 "/usr/$(get_libdir)/pkgconfig/lapacke.pc" "${LIBNAME}.pc"
89 -
90 }