1 |
|
# Copyright 1999-2022 Gentoo Authors
|
|
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
LUA_COMPAT=( lua5-{1..3} )
|
7 |
|
|
8 |
|
inherit autotools flag-o-matic lua-single toolchain-funcs
|
|
6 |
inherit cmake toolchain-funcs
|
9 |
7 |
|
10 |
8 |
DESCRIPTION="Scalable Algorithms for Parallel Adaptive Mesh Refinement on Forests of Octrees"
|
11 |
9 |
HOMEPAGE="http://www.p4est.org/"
|
12 |
10 |
|
|
11 |
LIBSC_VERSION="${PV}"
|
|
12 |
|
13 |
13 |
if [[ ${PV} = *9999* ]]; then
|
14 |
14 |
inherit git-r3
|
15 |
15 |
EGIT_REPO_URI="https://github.com/cburstedde/${PN}.git"
|
16 |
16 |
EGIT_BRANCH="develop"
|
17 |
17 |
SRC_URI=""
|
18 |
18 |
else
|
19 |
|
SRC_URI="
|
20 |
|
https://github.com/cburstedde/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
|
21 |
|
https://github.com/cburstedde/libsc/archive/v${PV}.tar.gz -> libsc-${PV}.tar.gz"
|
|
19 |
SRC_URI="https://github.com/cburstedde/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
22 |
20 |
KEYWORDS="~amd64 ~x86"
|
23 |
21 |
fi
|
24 |
22 |
|
... | ... | |
26 |
24 |
SLOT="0"
|
27 |
25 |
|
28 |
26 |
# TODO petsc
|
29 |
|
IUSE="debug doc examples mpi openmp romio threads +vtk-binary"
|
30 |
|
REQUIRED_USE="${LUA_REQUIRED_USE}
|
31 |
|
romio? ( mpi )"
|
|
27 |
IUSE="debug doc examples mpi openmp threads +vtk-binary"
|
32 |
28 |
|
33 |
|
RDEPEND="${LUA_DEPS}
|
34 |
|
~sci-libs/libsc-${PV}[${LUA_SINGLE_USEDEP},mpi=,openmp=,romio=,threads=]
|
|
29 |
RDEPEND="
|
|
30 |
~sci-libs/libsc-${LIBSC_VERSION}[mpi=,openmp=,threads=]
|
35 |
31 |
sys-apps/util-linux
|
36 |
32 |
virtual/blas
|
37 |
33 |
virtual/lapack
|
38 |
|
mpi? ( virtual/mpi[romio=] )"
|
|
34 |
mpi? ( virtual/mpi[romio] )"
|
39 |
35 |
DEPEND="${RDEPEND}"
|
40 |
36 |
BDEPEND="virtual/pkgconfig"
|
41 |
37 |
|
42 |
38 |
PATCHES=(
|
43 |
|
"${FILESDIR}"/${PN}-2.3-fix_aclocal.patch
|
44 |
|
"${FILESDIR}"/${PN}-2.3.6-override_soname.patch
|
|
39 |
"${FILESDIR}"/${P}-fix_build_system.patch
|
|
40 |
"${FILESDIR}"/${P}-set_version.patch
|
|
41 |
"${FILESDIR}"/${P}-fix_cmake_path.patch
|
45 |
42 |
)
|
46 |
43 |
|
47 |
44 |
pkg_pretend() {
|
... | ... | |
50 |
47 |
|
51 |
48 |
pkg_setup() {
|
52 |
49 |
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
|
53 |
|
lua-single_pkg_setup
|
54 |
|
}
|
55 |
|
|
56 |
|
src_prepare() {
|
57 |
|
default
|
58 |
|
|
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"
|
63 |
|
fi
|
64 |
|
|
65 |
|
# Inject a version number into the build system
|
66 |
|
echo "${PV}" > "${S}"/.tarball-version
|
67 |
|
|
68 |
|
AT_M4DIR="${WORKDIR}/${P}/config ${WORKDIR}/${P}/sc/config"
|
69 |
|
eautoreconf
|
70 |
|
|
71 |
|
sed -i \
|
72 |
|
"s/P4EST_SC_DIR\/etc/P4EST_SC_DIR\/share\/libsc/" \
|
73 |
|
"${S}"/configure || die "sed failed"
|
74 |
|
|
75 |
|
sed -i \
|
76 |
|
"s#lib/libsc\.la#$(get_libdir)/libsc\.so#" \
|
77 |
|
"${S}"/configure || die "sed failed"
|
78 |
50 |
}
|
79 |
51 |
|
80 |
52 |
src_configure() {
|
81 |
|
# avoid underlinkage
|
82 |
|
append-libs -lsc
|
83 |
|
|
84 |
|
local myeconfargs=(
|
85 |
|
--disable-static
|
86 |
|
$(use_enable debug)
|
87 |
|
$(use_enable mpi)
|
88 |
|
$(use_enable openmp)
|
89 |
|
$(use_enable romio mpiio)
|
90 |
|
$(use_enable threads pthread)
|
91 |
|
$(use_enable vtk-binary)
|
92 |
|
--with-blas="$($(tc-getPKG_CONFIG) --libs blas)"
|
93 |
|
--with-lapack="$($(tc-getPKG_CONFIG) --libs lapack)"
|
94 |
|
--with-sc="${ESYSROOT}/usr"
|
|
53 |
# avoid using debug codepaths that are manually enabled with the
|
|
54 |
# RelWithDebInfo build type
|
|
55 |
local CMAKE_BUILD_TYPE="Release"
|
|
56 |
|
|
57 |
local mycmakeargs=(
|
|
58 |
-Dmpi="$(usex mpi)"
|
|
59 |
-Dopenmp="$(usex openmp)"
|
|
60 |
-Dlibrary_reldir="$(get_libdir)"
|
95 |
61 |
)
|
96 |
|
econf "${myeconfargs[@]}"
|
|
62 |
|
|
63 |
cmake_src_configure
|
97 |
64 |
}
|
98 |
65 |
|
99 |
66 |
src_install() {
|
100 |
|
default
|
101 |
|
|
102 |
|
use doc && dodoc -r doc/*
|
|
67 |
cmake_src_install
|
103 |
68 |
|
104 |
|
if use examples
|
105 |
|
then
|
106 |
|
docinto examples
|
107 |
|
dodoc -r example/*
|
108 |
|
docompress -x /usr/share/doc/${PF}/examples
|
109 |
|
else
|
110 |
|
# Remove compiled example binaries in case of -examples:
|
111 |
|
rm -r "${ED}"/usr/bin || die "rm failed"
|
112 |
|
fi
|
113 |
|
|
114 |
|
# Fix wrong installation paths:
|
115 |
|
dodir /usr/share/p4est
|
116 |
|
mv "${ED}"/usr/share/data "${ED}"/usr/share/p4est/data || die "mv failed"
|
117 |
|
mv "${ED}"/etc/* "${ED}"/usr/share/p4est || die "mv failed"
|
118 |
|
rmdir "${ED}"/etc/ || die "rmdir failed"
|
|
69 |
[ ! "$(get_libdir)" = "lib" ] && mv "${ED}"/usr/{lib,$(get_libdir)}/pkgconfig || die "mv failed"
|
119 |
70 |
|
120 |
|
# no static archives
|
121 |
|
find "${ED}" -name '*.la' -delete || die
|
|
71 |
mkdir -p "${ED}"/usr/share/doc/${PF}
|
|
72 |
mv "${ED}"/usr/share/docs/P4EST/* "${ED}"/usr/share/doc/${PF}/ || die "mv failed"
|
|
73 |
rm -r "${ED}"/usr/share/docs || die "rm failed"
|
122 |
74 |
}
|