sci-libs/linux-gpib-modules: Version bump
[gentoo.git] / sci-libs / superlu / superlu-5.2.1-r1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 FORTRAN_STANDARD=77
7
8 inherit cmake-utils fortran-2
9
10 MY_PN=SuperLU
11
12 if [[ ${PV} != *9999* ]]; then
13         inherit versionator
14         SRC_URI="https://crd-legacy.lbl.gov/~xiaoye/SuperLU//${PN}_${PV}.tar.gz"
15         KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux"
16         SLOT="0/$(get_major_version)"
17         S="${WORKDIR}/SuperLU_${PV}"
18 else
19         inherit git-r3
20         GIT_ECLASS="git-r3"
21         EGIT_REPO_URI="https://github.com/xiaoyeli/${PN}"
22         SLOT="0/9999"
23         KEYWORDS="amd64 ~arm64 ~hppa ~ia64 ppc64 ~sparc x86"
24 fi
25
26 DESCRIPTION="Sparse LU factorization library"
27 HOMEPAGE="https://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
28 LICENSE="BSD"
29
30 IUSE="doc examples test"
31 RESTRICT="!test? ( test )"
32
33 RDEPEND="virtual/blas"
34 DEPEND="${RDEPEND}
35         virtual/pkgconfig
36         test? ( app-shells/tcsh )"
37
38 PATCHES=(
39         "${FILESDIR}"/${P}-no-implicits.patch
40         "${FILESDIR}"/${P}-pkgconfig.patch
41 )
42
43 S="${WORKDIR}/${MY_PN}_${PV}"
44
45 src_prepare() {
46         cmake-utils_src_prepare
47         # respect user's CFLAGS
48         sed -i -e 's/O3//' CMakeLists.txt || die
49 }
50
51 src_configure() {
52         local mycmakeargs+=(
53                 -DCMAKE_INSTALL_INCLUDEDIR="include/superlu"
54                 -DBUILD_SHARED_LIBS=ON
55                 -Denable_blaslib=OFF
56                 -Denable_tests=$(usex test)
57         )
58         cmake-utils_src_configure
59 }
60
61 src_install() {
62         cmake-utils_src_install
63         use doc && dodoc -r DOC/html
64         if use examples; then
65                 insinto /usr/share/doc/${PF}/examples
66                 doins -r EXAMPLE FORTRAN
67                 docompress -x /usr/share/doc/${PF}/examples
68         fi
69 }