dev-libs/qqwing: [QA] inherit ltprune.eclass directly
[gentoo.git] / sci-libs / libsc / libsc-9999.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools toolchain-funcs eutils
7
8 DESCRIPTION="Support for parallel scientific applications"
9 HOMEPAGE="http://www.p4est.org/"
10
11 if [[ ${PV} = *9999* ]]; then
12         inherit git-r3
13         EGIT_REPO_URI="https://github.com/cburstedde/${PN}.git"
14         EGIT_BRANCH="develop"
15         SRC_URI=""
16         KEYWORDS=""
17 else
18         SRC_URI="https://github.com/cburstedde/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
19         KEYWORDS="~amd64 ~x86"
20 fi
21
22 LICENSE="LGPL-2.1+"
23 SLOT="0"
24 IUSE="debug examples mpi openmp romio static-libs threads"
25
26 REQUIRED_USE="romio? ( mpi )"
27
28 RDEPEND="
29         dev-lang/lua:*
30         sys-apps/util-linux
31         virtual/blas
32         virtual/lapack
33         mpi? ( virtual/mpi[romio?] )"
34
35 DEPEND="
36         ${RDEPEND}
37         virtual/pkgconfig"
38
39 DOCS=( AUTHORS NEWS README )
40
41 AUTOTOOLS_AUTORECONF=true
42
43 pkg_pretend() {
44         if [[ ${MERGE_TYPE} != "binary" ]] && use openmp; then
45                 tc-has-openmp || \
46                         die "Please select an openmp capable compiler like gcc[openmp]"
47         fi
48 }
49
50 src_prepare() {
51         default
52
53         # Inject a version number into the build system
54         echo "${PV}" > ${S}/.tarball-version
55         eautoreconf
56 }
57
58 src_configure() {
59         local myeconfargs=(
60                 $(use_enable debug)
61                 $(use_enable mpi)
62                 $(use_enable openmp openmp)
63                 $(use_enable romio mpiio)
64                 $(use_enable static-libs static)
65                 $(use_enable threads pthread)
66                 --with-blas="$($(tc-getPKG_CONFIG) --libs blas)"
67                 --with-lapack="$($(tc-getPKG_CONFIG) --libs lapack)"
68         )
69         econf "${myeconfargs[@]}"
70 }
71
72 src_install() {
73         default
74
75         if use examples; then
76                 docinto examples
77                 dodoc -r example/*
78                 docompress -x /usr/share/doc/${PF}/examples
79         else
80                 # Remove compiled example binaries in case of -examples:
81                 rm -r "${ED}"/usr/bin || die "rm failed"
82         fi
83
84         # Remove ac files, bug #619806
85         rm -r "${ED}"/usr/share/aclocal || die "rm failed"
86
87         # Fix wrong installation paths:
88         dodir /usr/share/libsc
89         mv "${ED}"/etc/* "${ED}"/usr/share/libsc || die "mv failed"
90         rmdir "${ED}"/etc/ || die "rmdir failed"
91         mv "${ED}"/usr/share/ini/* "${ED}"/usr/share/libsc || die "mv failed"
92         rmdir "${ED}"/usr/share/ini || die "rmdir failed"
93 }