summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Fabbro <bicatali@gentoo.org>2011-05-31 21:01:52 +0100
committerSébastien Fabbro <bicatali@gentoo.org>2011-05-31 21:01:52 +0100
commitcd5ae87a0ba33b68669f67f2b567f24d4f59e3d7 (patch)
tree84f6ad8edae8e10c81b052a3bd90594566ed7eaa /sci-libs/gotoblas2/gotoblas2-1.13.ebuild
parentcosmetics (diff)
downloadbicatali-cd5ae87a0ba33b68669f67f2b567f24d4f59e3d7.tar.gz
bicatali-cd5ae87a0ba33b68669f67f2b567f24d4f59e3d7.tar.bz2
bicatali-cd5ae87a0ba33b68669f67f2b567f24d4f59e3d7.zip
fixed shared libs. added a aliasing patch. switched to eapi4.
Diffstat (limited to 'sci-libs/gotoblas2/gotoblas2-1.13.ebuild')
-rw-r--r--sci-libs/gotoblas2/gotoblas2-1.13.ebuild70
1 files changed, 31 insertions, 39 deletions
diff --git a/sci-libs/gotoblas2/gotoblas2-1.13.ebuild b/sci-libs/gotoblas2/gotoblas2-1.13.ebuild
index b623f44..4a777a4 100644
--- a/sci-libs/gotoblas2/gotoblas2-1.13.ebuild
+++ b/sci-libs/gotoblas2/gotoblas2-1.13.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: $
-EAPI=3
+EAPI=4
inherit eutils toolchain-funcs alternatives-2
@@ -26,8 +26,9 @@ DEPEND="${RDEPEND}"
S="${WORKDIR}/${MYPN}"
src_prepare() {
- epatch "${FILESDIR}"/${P}-dynamic.patch
- epatch "${FILESDIR}"/${P}-sharedlibs.patch
+ epatch "${FILESDIR}"/${P}-{dynamic,sharedlibs}.patch
+ # respect LDFLAGS
+ sed -i -e '/^LDFLAGS\s*=/d' Makefile.* || die
if ! use dynamic; then
sed -i \
-e "/^COMMON_OPT/s/-O2/${CFLAGS}/" \
@@ -45,58 +46,51 @@ src_prepare() {
}
src_configure() {
- local bits=32
- if use amd64 || use alpha || use ppc64 || use sparc || use ia64; then
- bits=64
- fi
- GOTO_MAKEFLAGS=(
- CC=$(tc-getCC)
- FC=$(tc-getFC)
- LDFLAGS="${LDFLAGS}"
- FLDFLAGS="${LDFLAGS}"
- BINARY=${bits}
- USE_THREAD=$(use threads && echo 1 || echo 0)
- USE_OPENMP=$(use openmp && echo 1)
- DYNAMIC_ARCH=$(use dynamic && echo 1)
- INTERFACE64=$(use int64 && echo 1)
- NO_CBLAS=$(use incblas || echo 1)
- )
+ local use_openmp=$(use openmp && echo 1)
+ use threads && use openmp && use_openmp="" && \
+ einfo "openmp and threads enabled: using threads"
+ sed -i \
+ -e "s:^#\s*\(NO_LAPACK\)\s*=.*:\1=1:" \
+ -e "s:^#\s*\(CC\)\s*=.*:\1=$(tc-getCC):" \
+ -e "s:^#\s*\(FC\)\s*=.*:\1=$(tc-getFC):" \
+ -e "s:^#\s*\(USE_THREAD\)\s*=.*:\1=$(use threads && echo 1 || echo 0):" \
+ -e "s:^#\s*\(USE_OPENMP\)\s*=.*:\1=${use_openmp}:" \
+ -e "s:^#\s*\(DYNAMIC_ARCH\)\s*=.*:\1=$(use dynamic && echo 1):" \
+ -e "s:^#\s*\(INTERFACE64\)\s*=.*:\1=$(use int64 && echo 1):" \
+ -e "s:^#\s*\(NO_CBLAS\)\s*=.*:\1=$(use incblas || echo 1):" \
+ Makefile.rule || die
}
src_compile() {
- emake libs shared "${GOTO_MAKEFLAGS[@]}" || die "emake failed"
- if use static-libs; then
- rename so so_sav *.so && emake clean
- emake libs "${GOTO_MAKEFLAGS[@]}" NEED_PIC= || die "emake static failed"
- rename so_sav so *.so_sav
- fi
+ mkdir solibs
+ emake libs shared && mv *.so solibs/
+ use static-libs && emake clean && emake libs NEED_PIC=
}
src_test() {
- emake tests "${GOTO_MAKEFLAGS[@]}" || die "emake tests failed"
+ emake tests
}
src_install() {
- local libname=goto2
- mv $(readlink lib${libname}.so) lib${libname}.so
- dolib.so lib${libname}.so || die "installing shared ${libname} failed"
- if use static-libs; then
- mv $(readlink lib${libname}.a) lib${libname}.a
- dolib.a lib${libname}.a || die "installing static ${libname} failed"
- fi
+ local libname=goto2 threads
+ use threads && threads="-pthread"
+ dolib.so solibs/lib*.so
+ use static-libs && dolib.a lib*.a
+
# create pkg-config file and associated eselect file
cat <<-EOF > ${libname}.pc
- prefix="${EPREFIX}"/usr
+ prefix=${EPREFIX}/usr
libdir=\${prefix}/$(get_libdir)
includedir=\${prefix}/include
-
Name: ${MYPN}
Description: ${DESCRIPTION}
Version: ${PV}
URL: ${HOMEPAGE}
- Libs: -L\${libdir} -l${libname}
- Libs.private: -lm
+ Libs: -L\${libdir} -l${libname} -lm ${threads}
EOF
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins ${libname}.pc
+
alternatives_for blas goto2 0 \
"/usr/$(get_libdir)/pkgconfig/blas.pc" "${libname}.pc"
@@ -108,7 +102,5 @@ src_install() {
"/usr/$(get_libdir)/pkgconfig/cblas.pc" "${libname}.pc" \
"/usr/include/cblas.h" "${PN}/cblas.h"
fi
- insinto /usr/$(get_libdir)/pkgconfig
- doins ${libname}.pc
dodoc 01Readme.txt 03FAQ.txt 05LargePage 06WeirdPerformance
}