summaryrefslogtreecommitdiff
blob: b1c3e9dcb13c676a9463ddcf66a91f79816a7c04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

FORTRAN_STANDARD=77

inherit cmake-utils fortran-2

MY_PN=SuperLU

if [[ ${PV} != *9999* ]]; then
	inherit versionator
	SRC_URI="http://crd.lbl.gov/~xiaoye/SuperLU//${PN}_${PV}.tar.gz"
	KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
	SLOT="0/$(get_major_version)"
	S="${WORKDIR}/SuperLU_${PV}"
else
	inherit git-r3
	GIT_ECLASS="git-r3"
	EGIT_REPO_URI=( "git://github.com/xiaoyeli/superlu" )
	SLOT="0/9999"
	KEYWORDS=""
fi

DESCRIPTION="Sparse LU factorization library"
HOMEPAGE="http://crd.lbl.gov/~xiaoye/SuperLU/"
LICENSE="BSD"

IUSE="doc examples test"

RDEPEND="virtual/blas"
DEPEND="${RDEPEND}
	virtual/pkgconfig
	test? ( app-shells/tcsh )"

PATCHES=(
	"${FILESDIR}"/${P}-no-implicits.patch
	"${FILESDIR}"/${P}-pkgconfig.patch
)

S="${WORKDIR}/${MY_PN}_${PV}"

src_prepare() {
	default
	# respect user's CFLAGS
	sed -i -e 's/O3//' CMakeLists.txt || die
}

src_configure() {
	local mycmakeargs+=(
		-DCMAKE_INSTALL_INCLUDEDIR="include/superlu"
		-DBUILD_SHARED_LIBS=ON
		-Denable_blaslib=OFF
		-Denable_tests=$(usex test)
	)
	cmake-utils_src_configure
}

src_install() {
	cmake-utils_src_install
	use doc && dodoc -r DOC/html
	if use examples; then
		insinto /usr/share/doc/${PF}/examples
		doins -r EXAMPLE FORTRAN
		docompress -x /usr/share/doc/${PF}/examples
	fi
}