aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Fabbro <sfabbro@uvic.ca>2012-07-12 11:50:03 -0700
committerSebastien Fabbro <sfabbro@uvic.ca>2012-07-12 11:50:03 -0700
commit39188b01c0bc17069ba1c5a1888040de1367c35c (patch)
treee82320c4a44fa6f12915833b29e5cf52cf7d2115 /sci-libs/xblas/xblas-1.0.248.ebuild
parentsci-libs/plasma: Shared library fixes and prefix love (diff)
downloadsci-39188b01c0bc17069ba1c5a1888040de1367c35c.tar.gz
sci-39188b01c0bc17069ba1c5a1888040de1367c35c.tar.bz2
sci-39188b01c0bc17069ba1c5a1888040de1367c35c.zip
sci-libs/xblas: Shared library fixes, prefix love and ebuild cleanup
(Portage version: 2.2.01.20757-prefix/git/Linux x86_64, RepoMan options: --force, unsigned Manifest commit)
Diffstat (limited to 'sci-libs/xblas/xblas-1.0.248.ebuild')
-rw-r--r--sci-libs/xblas/xblas-1.0.248.ebuild53
1 files changed, 34 insertions, 19 deletions
diff --git a/sci-libs/xblas/xblas-1.0.248.ebuild b/sci-libs/xblas/xblas-1.0.248.ebuild
index f9663c467..d65799af8 100644
--- a/sci-libs/xblas/xblas-1.0.248.ebuild
+++ b/sci-libs/xblas/xblas-1.0.248.ebuild
@@ -1,33 +1,48 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
-inherit eutils flag-o-matic toolchain-funcs versionator
+inherit eutils flag-o-matic toolchain-funcs versionator multilib fortran-2
DESCRIPTION="Extra Precise Basic Linear Algebra Subroutines"
-HOMEPAGE="http://www.netlib.org/xblas/"
+HOMEPAGE="http://www.netlib.org/xblas"
SRC_URI="${HOMEPAGE}/${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
-KEYWORDS="~amd64 ~x86"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="doc fortran static-libs"
-DEPEND=""
-RDEPEND=""
+RDEPEND="fortran? ( virtual/fortran )"
+DEPEND="${RDEPEND}"
-make_shared_lib() {
- local libstatic=${1}
- local soname=$(basename "${1%.a}").so.$(get_major_version)
- shift
- einfo "Making ${soname}"
- ${LINK:-$(tc-getCC)} ${LDFLAGS} \
- -shared -Wl,-soname="${soname}" \
- -Wl,--whole-archive "${libstatic}" -Wl,--no-whole-archive \
- "$@" -o $(dirname "${libstatic}")/"${soname}" || die "${soname} failed"
- ln -s "${soname}" $(dirname "${libstatic}")/"${soname%.*}"
+static_to_shared() {
+ local libstatic=${1}; shift
+ local libname=$(basename ${libstatic%.a})
+ local soname=${libname}$(get_libname $(get_version_component_range 1-2))
+ local libdir=$(dirname ${libstatic})
+
+ einfo "Making ${soname} from ${libstatic}"
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ ${LINK:-$(tc-getCC)} ${LDFLAGS} \
+ -dynamiclib -install_name "${EPREFIX}"/usr/lib/"${soname}" \
+ -Wl,-all_load -Wl,${libstatic} \
+ "$@" -o ${libdir}/${soname} || die "${soname} failed"
+ else
+ ${LINK:-$(tc-getCC)} ${LDFLAGS} \
+ -shared -Wl,-soname=${soname} \
+ -Wl,--whole-archive ${libstatic} -Wl,--no-whole-archive \
+ "$@" -o ${libdir}/${soname} || die "${soname} failed"
+ [[ $(get_version_component_count) -gt 1 ]] && \
+ ln -s ${soname} ${libdir}/${libname}$(get_libname $(get_major_version))
+ ln -s ${soname} ${libdir}/${libname}$(get_libname)
+ fi
+}
+
+pkg_setup() {
+ use fortran && fortran-2_pkg_setup
}
src_configure() {
@@ -48,7 +63,7 @@ src_compile() {
make.inc || die
emake makefiles
emake lib
- make_shared_lib lib${PN}.a
+ static_to_shared lib${PN}.a
}
src_test() {
@@ -56,7 +71,7 @@ src_test() {
}
src_install() {
- dolib.so lib${PN}.so*
+ dolib.so lib${PN}$(get_libname)*
use static-libs && newlib.a lib${PN}_nonpic.a lib${PN}.a
dodoc README README.devel
use doc && dodoc doc/report.ps
@@ -74,5 +89,5 @@ src_install() {
Cflags: -I\${includedir}
EOF
insinto /usr/$(get_libdir)/pkgconfig
- doins ${PN}.pc || die
+ doins ${PN}.pc
}