aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs/gsl/gsl-2.5.ebuild')
-rw-r--r--sci-libs/gsl/gsl-2.5.ebuild78
1 files changed, 78 insertions, 0 deletions
diff --git a/sci-libs/gsl/gsl-2.5.ebuild b/sci-libs/gsl/gsl-2.5.ebuild
new file mode 100644
index 000000000..3dda7b878
--- /dev/null
+++ b/sci-libs/gsl/gsl-2.5.ebuild
@@ -0,0 +1,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
+}