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 eutils
11 DESCRIPTION="Scalable Algorithms for Parallel Adaptive Mesh Refinement on Forests of Octrees"
12 HOMEPAGE="http://www.p4est.org/"
14 https://github.com/cburstedde/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
15 https://github.com/cburstedde/libsc/archive/v${PV}.tar.gz -> libsc-${PV}.tar.gz"
17 KEYWORDS="~amd64 ~x86"
22 IUSE="debug doc examples mpi romio static-libs +vtk-binary"
23 REQUIRED_USE="romio? ( mpi )"
26 ~sci-libs/libsc-${PV}[mpi=,romio=,static-libs=]
31 mpi? ( virtual/mpi[romio=] )"
35 sys-devel/automake:1.11
38 DOCS=( AUTHORS NEWS README )
43 # Inject libsc to get all parts of the build system...
44 rmdir "${S}/sc" || die "rmdir failed"
45 mv "${WORKDIR}/libsc-${PV}" "${S}/sc" || die "mv failed"
47 # Inject a version number into the build system
48 echo "${PV}" > ${S}/.tarball-version
50 AT_M4DIR="${WORKDIR}/${P}/config ${WORKDIR}/${P}/sc/config"
54 "s/P4EST_SC_DIR\/etc/P4EST_SC_DIR\/share\/libsc/" \
55 "${S}"/configure || die "sed failed"
58 "s/libsc\.la/libsc\.so/" \
59 "${S}"/configure || die "sed failed"
64 LDFLAGS="${LDFLAGS} -lsc"
69 $(use_enable romio mpiio)
70 $(use_enable static-libs static)
71 $(use_enable vtk-binary)
72 --with-blas="$($(tc-getPKG_CONFIG) --libs blas)"
73 --with-lapack="$($(tc-getPKG_CONFIG) --libs lapack)"
74 --with-sc="${EPREFIX}/usr"
76 econf "${myeconfargs[@]}"
82 use doc && dodoc -r doc/*
88 docompress -x /usr/share/doc/${PF}/examples
90 # Remove compiled example binaries in case of -examples:
91 rm -r "${ED}"/usr/bin || die "rm failed"
94 # Fix wrong installation paths:
95 dodir /usr/share/p4est
96 mv "${ED}"/usr/share/data "${ED}"/usr/share/p4est/data || die "mv failed"
97 mv "${ED}"/etc/* "${ED}"/usr/share/p4est || die "mv failed"
98 rmdir "${ED}"/etc/ || die "rmdir failed"