1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 # The build system currently fails with everything newer than 1.11.
9 inherit autotools toolchain-funcs eutils
11 DESCRIPTION="Scalable Algorithms for Parallel Adaptive Mesh Refinement on Forests of Octrees"
12 HOMEPAGE="http://www.p4est.org/"
14 if [[ ${PV} = *9999* ]]; then
16 EGIT_REPO_URI="https://github.com/cburstedde/${PN}.git"
22 https://github.com/cburstedde/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
23 https://github.com/cburstedde/libsc/archive/v${PV}.tar.gz -> libsc-${PV}.tar.gz"
24 KEYWORDS="~amd64 ~x86"
31 IUSE="debug doc examples mpi openmp romio static-libs threads +vtk-binary"
32 REQUIRED_USE="romio? ( mpi )"
35 ~sci-libs/libsc-${PV}[mpi=,openmp=,romio=,static-libs=,threads=]
40 mpi? ( virtual/mpi[romio=] )"
44 sys-devel/automake:1.11
47 DOCS=( AUTHORS NEWS README )
50 if [[ ${MERGE_TYPE} != "binary" ]] && use openmp; then
52 die "Please select an openmp capable compiler like gcc[openmp]"
59 # Inject libsc to get all parts of the build system...
60 if ! [[ ${PV} = *9999* ]]; then
61 rmdir "${S}/sc" || die "rmdir failed"
62 mv "${WORKDIR}/libsc-${PV}" "${S}/sc" || die "mv failed"
65 # Inject a version number into the build system
66 echo "${PV}" > ${S}/.tarball-version
68 AT_M4DIR="${WORKDIR}/${P}/config ${WORKDIR}/${P}/sc/config"
72 "s/P4EST_SC_DIR\/etc/P4EST_SC_DIR\/share\/libsc/" \
73 "${S}"/configure || die "sed failed"
76 "s/libsc\.la/libsc\.so/" \
77 "${S}"/configure || die "sed failed"
83 LDFLAGS="${LDFLAGS} -lsc"
89 $(use_enable romio mpiio)
90 $(use_enable static-libs static)
91 $(use_enable threads pthread)
92 $(use_enable vtk-binary)
93 --with-blas="$($(tc-getPKG_CONFIG) --libs blas)"
94 --with-lapack="$($(tc-getPKG_CONFIG) --libs lapack)"
95 --with-sc="${EPREFIX}/usr"
97 econf "${myeconfargs[@]}"
103 use doc && dodoc -r doc/*
109 docompress -x /usr/share/doc/${PF}/examples
111 # Remove compiled example binaries in case of -examples:
112 rm -r "${ED}"/usr/bin || die "rm failed"
115 # Fix wrong installation paths:
116 dodir /usr/share/p4est
117 mv "${ED}"/usr/share/data "${ED}"/usr/share/p4est/data || die "mv failed"
118 mv "${ED}"/etc/* "${ED}"/usr/share/p4est || die "mv failed"
119 rmdir "${ED}"/etc/ || die "rmdir failed"