Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/lapack-reference/
Date: Mon, 28 Dec 2015 19:20:08
Message-Id: 1451330399.09bb153b2560f26a605ff3c06b3e97c6e089a642.jlec@gentoo
1 commit: 09bb153b2560f26a605ff3c06b3e97c6e089a642
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 28 16:53:43 2015 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 28 19:19:59 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09bb153b
7
8 sci-libs/lapack-reference: Bump to EAPI=5
9
10 Package-Manager: portage-2.2.26
11 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
12
13 .../lapack-reference-3.2.1-r4.ebuild | 101 +++++++++++++++++++++
14 1 file changed, 101 insertions(+)
15
16 diff --git a/sci-libs/lapack-reference/lapack-reference-3.2.1-r4.ebuild b/sci-libs/lapack-reference/lapack-reference-3.2.1-r4.ebuild
17 new file mode 100644
18 index 0000000..6f7fb7d
19 --- /dev/null
20 +++ b/sci-libs/lapack-reference/lapack-reference-3.2.1-r4.ebuild
21 @@ -0,0 +1,101 @@
22 +# Copyright 1999-2015 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +# $Id$
25 +
26 +EAPI=5
27 +
28 +inherit autotools eutils fortran-2 flag-o-matic multilib toolchain-funcs
29 +
30 +MyPN="${PN/-reference/}"
31 +PATCH_V="3.2.1"
32 +
33 +DESCRIPTION="FORTRAN reference implementation of LAPACK Linear Algebra PACKage"
34 +HOMEPAGE="http://www.netlib.org/lapack/index.html"
35 +SRC_URI="
36 + mirror://gentoo/${MyPN}-${PV}.tgz
37 + mirror://gentoo/${PN}-${PATCH_V}-autotools.patch.bz2"
38 +
39 +LICENSE="BSD"
40 +SLOT="0"
41 +KEYWORDS=""
42 +IUSE="doc"
43 +
44 +RDEPEND="
45 + app-eselect/eselect-lapack
46 + virtual/blas"
47 +DEPEND="
48 + ${RDEPEND}
49 + virtual/pkgconfig
50 + doc? ( app-doc/lapack-docs )"
51 +
52 +S="${WORKDIR}/${MyPN}-${PV}"
53 +
54 +pkg_setup() {
55 + fortran-2_pkg_setup
56 + if [[ $(tc-getFC) =~ if ]]; then
57 + ewarn "Using Intel Fortran at your own risk"
58 + export LDFLAGS="$(raw-ldflags)"
59 + export NOOPT_FFLAGS=-O
60 + fi
61 + ESELECT_PROF=reference
62 +}
63 +
64 +src_prepare() {
65 + epatch \
66 + "${WORKDIR}"/${PN}-${PATCH_V}-autotools.patch \
67 + "${FILESDIR}"/${P}-parallel-make.patch
68 + eautoreconf
69 +
70 + # set up the testing routines
71 + sed \
72 + -e "s:g77:$(tc-getFC):" \
73 + -e "s:-funroll-all-loops -O3:${FFLAGS} $($(tc-getPKG_CONFIG) --cflags blas):" \
74 + -e "s:LOADOPTS =:LOADOPTS = ${LDFLAGS} $($(tc-getPKG_CONFIG) --cflags blas):" \
75 + -e "s:../../blas\$(PLAT).a:$($(tc-getPKG_CONFIG) --libs blas):" \
76 + -e "s:lapack\$(PLAT).a:SRC/.libs/liblapack.a:" \
77 + make.inc.example > make.inc \
78 + || die "Failed to set up make.inc"
79 +
80 + cp "${FILESDIR}"/eselect.lapack.reference-ng "${T}"/eselect.lapack.reference || die
81 + sed -i -e "s:/usr:${EPREFIX}/usr:" "${T}"/eselect.lapack.reference || die
82 + if [[ ${CHOST} == *-darwin* ]] ; then
83 + sed -i -e 's/\.so\([\.0-9]\+\)\?/\1.dylib/g' \
84 + "${T}"/eselect.lapack.reference || die
85 + fi
86 + sed \
87 + -e '/Libs:/s|: |: -L${libdir} |g' \
88 + -i lapack.pc.in || die
89 +}
90 +
91 +src_configure() {
92 + econf \
93 + --libdir="${EPREFIX}/usr/$(get_libdir)/lapack/reference" \
94 + --with-blas="$($(tc-getPKG_CONFIG) --libs blas)"
95 +}
96 +
97 +src_install() {
98 + default
99 + eselect lapack add $(get_libdir) "${T}"/eselect.lapack.reference ${ESELECT_PROF}
100 +}
101 +
102 +src_test() {
103 + MAKEOPTS+=" -j1"
104 + cd "${S}"/TESTING/MATGEN && emake || die
105 + cd "${S}"/TESTING && emake || die
106 +}
107 +
108 +pkg_postinst() {
109 + local p=lapack
110 + local current_lib=$(eselect ${p} show | cut -d' ' -f2)
111 + if [[ ${current_lib} == ${ESELECT_PROF} || -z ${current_lib} ]]; then
112 + # work around eselect bug #189942
113 + local configfile="${EROOT}"/etc/env.d/${p}/$(get_libdir)/config
114 + [[ -e ${configfile} ]] && rm -f ${configfile}
115 + eselect ${p} set ${ESELECT_PROF}
116 + elog "${p} has been eselected to ${ESELECT_PROF}"
117 + else
118 + elog "Current eselected ${p} is ${current_lib}"
119 + elog "To use ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
120 + elog "\t eselect ${p} set ${ESELECT_PROF}"
121 + fi
122 +}