1 |
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=7
|
|
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
PYTHON_COMPAT=( python3_{9..10} )
|
|
6 |
PYTHON_COMPAT=( python3_{9..11} )
|
7 |
7 |
|
8 |
|
inherit flag-o-matic python-any-r1 toolchain-funcs
|
|
8 |
inherit python-any-r1
|
9 |
9 |
|
10 |
10 |
DESCRIPTION="Scalable Library for Eigenvalue Problem Computations"
|
11 |
11 |
HOMEPAGE="https://slepc.upv.es/"
|
... | ... | |
14 |
14 |
LICENSE="LGPL-3"
|
15 |
15 |
SLOT="0"
|
16 |
16 |
KEYWORDS="~amd64 ~x86"
|
17 |
|
IUSE="complex-scalars doc mpi"
|
|
17 |
IUSE="arpack complex-scalars doc +examples mpi"
|
|
18 |
|
|
19 |
REQUIRED_USE="arpack? ( mpi )"
|
18 |
20 |
|
19 |
21 |
RDEPEND="
|
20 |
|
=sci-mathematics/petsc-$(ver_cut 1-2)*:=[mpi=,complex-scalars=]
|
21 |
|
sci-libs/arpack[mpi=]
|
|
22 |
=sci-mathematics/petsc-$(ver_cut 1-2)*:=[examples,mpi=,complex-scalars=]
|
|
23 |
arpack? ( sci-libs/arpack[mpi=] )
|
22 |
24 |
mpi? ( virtual/mpi )
|
23 |
25 |
"
|
24 |
26 |
|
... | ... | |
44 |
46 |
|
45 |
47 |
# configure is a custom python script and doesn't want to have default
|
46 |
48 |
# configure arguments that we set with econf
|
47 |
|
./configure \
|
48 |
|
--prefix="${EPREFIX}/usr/$(get_libdir)/slepc" \
|
49 |
|
--with-arpack=1 \
|
50 |
|
--with-arpack-lib="$(usex mpi "-lparpack,-larpack" "-larpack")"
|
|
49 |
if use arpack; then
|
|
50 |
./configure \
|
|
51 |
--prefix="${EPREFIX}/usr/$(get_libdir)/slepcdir" \
|
|
52 |
--with-arpack=1 \
|
|
53 |
--with-arpack-lib="$(usex mpi "-lparpack -larpack" "-larpack")"
|
|
54 |
else
|
|
55 |
./configure \
|
|
56 |
--prefix="${EPREFIX}/usr/$(get_libdir)/slepcdir" \
|
|
57 |
--with-arpack=0
|
|
58 |
fi
|
51 |
59 |
}
|
52 |
60 |
|
53 |
61 |
src_install() {
|
54 |
62 |
emake DESTDIR="${ED}" install
|
55 |
63 |
|
56 |
|
# add PETSC_DIR to environmental variables
|
57 |
|
cat >> 99slepc <<- EOF
|
58 |
|
SLEPC_DIR=${EPREFIX}/usr/$(get_libdir)/slepc
|
59 |
|
LDPATH=${EPREFIX}/usr/$(get_libdir)/slepc/lib
|
60 |
|
EOF
|
61 |
|
doenvd 99slepc
|
|
64 |
#
|
|
65 |
# Clean up the mess:
|
|
66 |
#
|
|
67 |
|
|
68 |
# put all include directories under a proper subdirectory
|
|
69 |
mkdir "${ED}"/usr/include || die "mkdir failed (include)"
|
|
70 |
mv "${ED}"/usr/{$(get_libdir)/slepcdir/include,include/slepc} || die "mv failed (include)"
|
|
71 |
|
|
72 |
# put libraries and pkconfig file into proper place
|
|
73 |
mv "${ED}"/usr/$(get_libdir)/slepcdir/lib/{libslepc*,pkgconfig} \
|
|
74 |
"${ED}/usr/$(get_libdir)" || die "mv failed (lib)"
|
|
75 |
|
|
76 |
# move share to proper location
|
|
77 |
mv "${ED}"/usr/{$(get_libdir)/slepcdir/share,share} || die "mv failed (share)"
|
|
78 |
|
|
79 |
# fix pc files:
|
|
80 |
sed -i \
|
|
81 |
-e 's#include$#include/slepc#' \
|
|
82 |
-e "s#lib\$#$(get_libdir)#" \
|
|
83 |
-e "s#^prefix=.*slepcdir\$#prefix=${EPREFIX}/usr#" \
|
|
84 |
"${ED}"/usr/$(get_libdir)/pkgconfig/*.pc || die "sed failed (pkgconfig)"
|
|
85 |
|
|
86 |
# recreate a "valid" slepcdir:
|
|
87 |
for i in "${ED}"/usr/$(get_libdir)/*; do
|
|
88 |
[ $(basename $i) = slepcdir ] && continue
|
|
89 |
ln -s "${EPREFIX}/usr/$(get_libdir)/$(basename $i)" \
|
|
90 |
"${ED}/usr/$(get_libdir)/slepcdir/lib/$(basename $i)" || die "ln failed (slepcdir)"
|
|
91 |
done
|
|
92 |
ln -s "${EPREFIX}"/usr/include/slepc/ \
|
|
93 |
"${ED}/usr/$(get_libdir)/slepcdir/include" || die "ln failed (slepcdir)"
|
|
94 |
mkdir "${ED}/usr/$(get_libdir)/slepcdir/share" || die "mkdir fialed (slepcdir)"
|
|
95 |
ln -s "${EPREFIX}"/usr/share/slepc/ \
|
|
96 |
"${ED}/usr/$(get_libdir)/slepcdir/share/slepc" || die "ln failed (slepcdir)"
|
|
97 |
|
|
98 |
if use examples; then
|
|
99 |
mkdir -p "${ED}"/usr/share/doc/${PF} || die "mkdir failed (examples)"
|
|
100 |
mv "${ED}"/usr/share/slepc/examples "${ED}"/usr/share/doc/${PF} || die "mv failed (examples)"
|
|
101 |
ln -s "${EPREFIX}"/usr/share/doc/${PF}/examples "${ED}"/usr/share/slepc/examples || die "ln failed (examples)"
|
|
102 |
docompress -x /usr/share/doc/${PF}/examples
|
|
103 |
else
|
|
104 |
rm -r "${ED}"/usr/share/slepc/examples || die "rm failed (examples)"
|
|
105 |
fi
|
62 |
106 |
|
63 |
107 |
if use doc ; then
|
64 |
108 |
dodoc docs/slepc.pdf
|
65 |
109 |
docinto html
|
66 |
110 |
dodoc -r docs/*.html docs/manualpages
|
67 |
111 |
fi
|
|
112 |
|
|
113 |
# add PETSC_DIR to environmental variables
|
|
114 |
cat >> 99slepc <<- EOF
|
|
115 |
SLEPC_DIR=${EPREFIX}/usr/$(get_libdir)/slepcdir
|
|
116 |
EOF
|
|
117 |
doenvd 99slepc
|
68 |
118 |
}
|