sci-libs/linux-gpib-modules: Version bump
[gentoo.git] / sci-libs / superlu / superlu-4.3-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 AUTOTOOLS_AUTORECONF=true
7 AUTOTOOLS_IN_SOURCE_BUILD=1
8
9 inherit autotools-utils fortran-2 toolchain-funcs multilib
10
11 MY_PN=SuperLU
12
13 DESCRIPTION="Sparse LU factorization library"
14 HOMEPAGE="https://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
15 SRC_URI="https://crd-legacy.lbl.gov/~xiaoye/SuperLU/${PN}_${PV}.tar.gz"
16
17 LICENSE="BSD"
18 SLOT="0"
19 KEYWORDS="~alpha amd64 ~arm ~hppa ppc ppc64 x86 ~amd64-linux ~x86-linux"
20 IUSE="doc examples static-libs test"
21 RESTRICT="!test? ( test )"
22
23 RDEPEND="
24         virtual/blas"
25 DEPEND="${RDEPEND}
26         virtual/pkgconfig
27         test? ( app-shells/tcsh )"
28
29 S="${WORKDIR}/${MY_PN}_${PV}"
30
31 PATCHES=(
32         "${FILESDIR}"/${P}-autotools.patch
33         "${FILESDIR}"/${P}-format-security.patch
34         )
35
36 src_prepare() {
37         unset VERBOSE
38         sed \
39                 -e "s:= ar:= $(tc-getAR):g" \
40                 -e "s:= ranlib:= $(tc-getRANLIB):g" \
41                 -i make.inc || die
42
43         autotools-utils_src_prepare
44 }
45
46 src_configure() {
47         local myeconfargs=( --with-blas="$($(tc-getPKG_CONFIG) --libs blas)" )
48         autotools-utils_src_configure
49         rm EXAMPLE/*itersol1 || die
50 }
51
52 src_test() {
53         cd "${BUILD_DIR}"/TESTING
54         emake -j1 \
55                 CC="$(tc-getCC)" \
56                 FORTRAN="$(tc-getFC)" \
57                 LOADER="$(tc-getCC)" \
58                 CFLAGS="${CFLAGS}" \
59                 FFLAGS="${FFLAGS}" \
60                 LOADOPTS="${LDFLAGS}" \
61                 BLASLIB="$($(tc-getPKG_CONFIG) --libs blas)" \
62                 SUPERLULIB="${S}/SRC/.libs/libsuperlu$(get_libname)" \
63                 LD_LIBRARY_PATH="${S}/SRC/.libs" \
64                 DYLD_LIBRARY_PATH="${S}/SRC/.libs"
65 }
66
67 src_install() {
68         autotools-utils_src_install
69         use doc && dodoc DOC/ug.pdf && dohtml DOC/html/*
70         if use examples; then
71                 insinto /usr/share/doc/${PF}/examples
72                 doins -r EXAMPLE FORTRAN
73         fi
74 }