blob: 9de0ad28e8fa5e27a7a8a5b089646c5636a45044 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
# TODO
# utilities.c:20:1: warning: ‘MPI_Attr_get’ is deprecated:
# MPI_Attr_get was deprecated in MPI-2.0; use MPI_Comm_get_attr instead [-Wdeprecated-declarations]
inherit toolchain-funcs flag-o-matic
MY_P="${PN}.${PV}"
DESCRIPTION="SParse Object Oriented Linear Equations Solver"
HOMEPAGE="http://www.netlib.org/linalg/spooles"
SRC_URI="http://www.netlib.org/linalg/${PN}/${MY_P}.tgz"
S="${WORKDIR}"
LICENSE="public-domain"
SLOT="0"
KEYWORDS="~amd64"
IUSE="mpi static-libs threads"
RESTRICT="test"
RDEPEND="
mpi? (
virtual/mpi
)
"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}/${P}-I2Ohash-64bit.patch"
"${FILESDIR}/${P}-makefiles.patch"
"${FILESDIR}/${P}-formats.patch"
"${FILESDIR}/${P}-NULL-is-not-int.patch"
"${FILESDIR}/${P}-printf-long.patch"
"${FILESDIR}/${P}-include-stdio.h.patch"
)
make_shared_lib() {
local soname="$(basename "${1%.a}").so.$(ver_cut 1)"
einfo "Making ${soname}"
${2:-$(tc-getCC)} ${LDFLAGS} \
-shared -Wl,-soname="${soname}" \
-Wl,--whole-archive "${1}" -Wl,--no-whole-archive \
-o $(dirname "${1}")/"${soname}" || return 1
}
src_prepare() {
default_src_prepare
find . -name makefile -exec \
sed -i -e 's:make:$(MAKE):g' '{}' \;
sed \
-e "s/@CC@/$(tc-getCC)/" \
-e "s/@AR@/$(tc-getAR)/" \
-e "s/@RANLIB@/$(tc-getRANLIB)/" \
"${FILESDIR}"/Make.inc.in > Make.inc || die
}
src_compile() {
append-flags -fPIC
emake lib
if use threads; then
emake -C MT lib
fi
if use mpi; then
emake -C MPI CC="mpicc" lib
fi
make_shared_lib libspooles.a $(usev mpi "mpicc") || die "shared lib failed"
if use static-libs; then
filter-flags -fPIC
emake clean
emake lib
if use threads; then
emake -C MT lib
fi
if use mpi; then
emake -C MPI CC="mpicc" lib
fi
fi
}
src_install() {
dolib.so libspooles.so.2
dosym libspooles.so.2 /usr/$(get_libdir)/libspooles.so
if use static-libs; then
dolib.a libspooles.a
fi
find . -name '*.h' -print0 | \
xargs -0 -n1 --replace=headerfile install -D headerfile tmp/headerfile
insinto /usr/include/${PN}
doins -r tmp/*
}
|