public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sebastien Fabbro" <bicatali@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/mpiblacs/
Date: Thu, 12 Jul 2012 20:43:21 +0000 (UTC)	[thread overview]
Message-ID: <1342118846.b576dfa5b63b501e84f328348c154b6d48b2f071.bicatali@gentoo> (raw)

commit:     b576dfa5b63b501e84f328348c154b6d48b2f071
Author:     Sebastien Fabbro <sfabbro <AT> uvic <DOT> ca>
AuthorDate: Thu Jul 12 18:47:26 2012 +0000
Commit:     Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
CommitDate: Thu Jul 12 18:47:26 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=b576dfa5

sci-libs/mpiblacs: Shared library fixes and prefix love

(Portage version: 2.2.01.20757-prefix/git/Linux x86_64, RepoMan options: --force, unsigned Manifest commit)

---
 sci-libs/mpiblacs/ChangeLog              |    4 ++-
 sci-libs/mpiblacs/mpiblacs-1.1-r1.ebuild |   58 +++++++++++++++++------------
 2 files changed, 37 insertions(+), 25 deletions(-)

diff --git a/sci-libs/mpiblacs/ChangeLog b/sci-libs/mpiblacs/ChangeLog
index 94d7b6e..b4e36f9 100644
--- a/sci-libs/mpiblacs/ChangeLog
+++ b/sci-libs/mpiblacs/ChangeLog
@@ -2,6 +2,9 @@
 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  12 Jul 2012; Sébastien Fabbro <bicatali@gentoo.org> mpiblacs-1.1-r1.ebuild:
+  sci-libs/mpiblacs: Shared library fixes and prefix love
+
   23 Feb 2012; Sébastien Fabbro <bicatali@gentoo.org> -mpiblacs-1.1.ebuild,
   mpiblacs-1.1-r1.ebuild:
   Removed old, blocking scalapack > 2
@@ -25,4 +28,3 @@
   06 Dec 2010; Sébastien Fabbro <bicatali@gentoo.org> +mpiblacs-1.1.ebuild,
   +metadata.xml:
   Initial import
-

diff --git a/sci-libs/mpiblacs/mpiblacs-1.1-r1.ebuild b/sci-libs/mpiblacs/mpiblacs-1.1-r1.ebuild
index c7ff691..55d6d2b 100644
--- a/sci-libs/mpiblacs/mpiblacs-1.1-r1.ebuild
+++ b/sci-libs/mpiblacs/mpiblacs-1.1-r1.ebuild
@@ -3,7 +3,7 @@
 # $Header: $
 
 EAPI=4
-inherit eutils toolchain-funcs versionator alternatives-2
+inherit eutils toolchain-funcs versionator alternatives-2 multilib
 
 DESCRIPTION="Basic Linear Algebra Communication Subprograms with MPI"
 HOMEPAGE="http://www.netlib.org/blacs/"
@@ -13,27 +13,38 @@ SRC_URI="${HOMEPAGE}/${PN}.tgz
 
 LICENSE="BSD"
 SLOT="0"
-KEYWORDS="~amd64 ~x86"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
 IUSE="static-libs test"
 
 RDEPEND="virtual/mpi[fortran]
 	virtual/blas
 	!>sci-libs/scalapack-2"
 DEPEND="${RDEPEND}
-	dev-util/pkgconfig"
+	virtual/pkgconfig"
 
 S="${WORKDIR}/BLACS"
 
-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
 }
 
 src_prepare() {
@@ -67,11 +78,9 @@ src_compile() {
 		F77FLAGS="${FFLAGS} -fPIC" \
 		CCFLAGS="${CFLAGS} -fPIC" \
 		mpi
-	cd LIB
-	LINK=mpif77 make_shared_lib lib${PN}.a
-	LINK=mpicc make_shared_lib lib${PN}Cinit.a -L. -l${PN}
-	LINK=mpif77 make_shared_lib lib${PN}F77init.a -L. -l${PN}
-	cd "${S}"
+	LINK=mpif77 static_to_shared LIB/lib${PN}.a
+	LINK=mpicc static_to_shared LIB/lib${PN}Cinit.a -LLIB -l${PN}
+	LINK=mpif77 static_to_shared LIB/lib${PN}F77init.a -LLIB -l${PN}
 	if use static-libs; then
 		emake clean -C SRC/MPI && rm -f LIB/*.a
 		emake mpi
@@ -91,7 +100,7 @@ src_test() {
 
 src_install() {
 	pushd LIB
-	dolib.so lib*.so*
+	dolib.so lib*$(get_libname)*
 	use static-libs && dolib.a lib*.a
 	cat <<-EOF > ${PN}.pc
 		prefix=${EPREFIX}/usr
@@ -101,18 +110,19 @@ src_install() {
 		Description: ${DESCRIPTION}
 		Version: ${PV}
 		URL: ${HOMEPAGE}
-		Libs: -L\${libdir} -l${PN} -l${PN}Cinit -l${PN}F77init -lm
+		Libs: -L\${libdir} -l${PN} -l${PN}Cinit -l${PN}F77init
+		Private: -lm
 		Cflags: -I\${includedir}/${PN}
 		Requires: blas
 	EOF
 	insinto /usr/$(get_libdir)/pkgconfig
 	doins ${PN}.pc || die
 	alternatives_for blacs ${PN} 0 \
-		"/usr/$(get_libdir)/pkgconfig/blacs.pc" "${PN}.pc"
-	popd
+		/usr/$(get_libdir)/pkgconfig/blacs.pc ${PN}.pc
+	popd > /dev/null
 
-	pushd SRC/MPI
+	pushd SRC/MPI > /dev/null
 	insinto /usr/include/blacs
 	doins Bconfig.h Bdef.h
-	popd
+	popd > /dev/null
 }



             reply	other threads:[~2012-07-12 20:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12 20:43 Sebastien Fabbro [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-01-01 14:33 [gentoo-commits] proj/sci:master commit in: sci-libs/mpiblacs/ Aisha Tammy
2015-01-25 16:39 Justin Lecher
2012-02-23 19:05 Sebastien Fabbro
2012-02-21  1:12 Andrea Arteaga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1342118846.b576dfa5b63b501e84f328348c154b6d48b2f071.bicatali@gentoo \
    --to=bicatali@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox