blob: 3dda7b8788608fa549120b3ad5fea7c44d2d8d4d (
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
|
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit alternatives-2 autotools flag-o-matic multilib-build numeric toolchain-funcs
DESCRIPTION="GNU Scientific Library"
HOMEPAGE="https://www.gnu.org/software/gsl/"
SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
LICENSE="GPL-3"
SLOT="0/23"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="cblas-external static-libs"
RDEPEND="cblas-external? ( >=virtual/cblas-2.0-r3[${MULTILIB_USEDEP}] )"
DEPEND="${RDEPEND}
>=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]"
PATCHES=(
"${FILESDIR}"/${PN}-2.3-cblas-external.patch
)
src_prepare() {
default
eautoreconf
multilib_copy_sources
}
src_configure() {
gsl_configure() {
if use cblas-external; then
export CBLAS_LIBS="$($(tc-getPKG_CONFIG) --libs cblas)"
export CBLAS_CFLAGS="$($(tc-getPKG_CONFIG) --cflags cblas)"
fi
econf $(use_with cblas-external)
}
# fma flags, which can be enabled by -march=native, cause some tests to fail.
# https://github.com/gentoo/sci/pull/815
append-cflags $(test-flags-CC -mno-fma -mno-fma4)
multilib_foreach_abi run_in_build_dir gsl_configure
}
src_compile() {
multilib_foreach_abi run_in_build_dir default
}
src_test() {
multilib_foreach_abi run_in_build_dir default
}
src_install() {
gsl_install() {
local libname=gslcblas
create_pkgconfig \
--name "${libname}" \
--description "${PN} CBLAS implementation" \
--libs "-l${libname}" \
--libs-private "-lm" \
--cflags "-I\${includedir}/${PN}" \
--version "${PV}" \
--url "${HOMEPAGE}" \
"${libname}"
GSL_ALTERNATIVES+=( /usr/$(get_libdir)/pkgconfig/cblas.pc ${libname}.pc )
default
}
multilib_foreach_abi run_in_build_dir gsl_install
# Don't add gsl as a cblas alternative if using cblas-external
use cblas-external || alternatives_for cblas gsl 0 \
${GSL_ALTERNATIVES[@]} \
/usr/include/cblas.h gsl/gsl_cblas.h
}
|