public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Justin Lecher" <jlec@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/lapack-reference/
Date: Mon,  6 Oct 2014 05:56:38 +0000 (UTC)	[thread overview]
Message-ID: <1411816207.96347461e8152e8fbb26ba0b43c72646ad3e2c6a.jlec@gentoo> (raw)

commit:     96347461e8152e8fbb26ba0b43c72646ad3e2c6a
Author:     gienah <gienah <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 25 13:45:45 2014 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Sat Sep 27 11:10:07 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=96347461

multilib as well for lapack-reference

---
 .../lapack-reference/lapack-reference-9999.ebuild  | 64 +++++++++++++++-------
 1 file changed, 45 insertions(+), 19 deletions(-)

diff --git a/sci-libs/lapack-reference/lapack-reference-9999.ebuild b/sci-libs/lapack-reference/lapack-reference-9999.ebuild
index 9b14bf0..57d64e5 100644
--- a/sci-libs/lapack-reference/lapack-reference-9999.ebuild
+++ b/sci-libs/lapack-reference/lapack-reference-9999.ebuild
@@ -3,7 +3,7 @@
 # $Header: $
 
 EAPI=5
-inherit fortran-2 cmake-utils multibuild alternatives-2 toolchain-funcs
+inherit fortran-2 cmake-utils multibuild alternatives-2 multilib-build toolchain-funcs
 
 if [[ ${PV} == "9999" ]] ; then
 	# The master ESVN_REPO_URI is difficult to access, the git mirror is easier
@@ -59,6 +59,7 @@ get_variant_suffix() {
 get_blas_profname() {
 	local profname="${1:-$(get_profname)}"
 	local variant_suffix=$(get_variant_suffix "${profname}")
+	local blas_profile=$(eselect blas show)
 	local selected_blas_profile="${blas_profile}"
 	local blas_no_int64="${selected_blas_profile/-int64/}"
 	local blas_base="${blas_no_int64%-*}"
@@ -66,18 +67,40 @@ get_blas_profname() {
 	echo "${blas_name}"
 }
 
-pkg_setup() {
-	blas_profile=$(eselect blas show)
-	MULTIBUILD_VARIANTS=( )
-	use static-libs && MULTIBUILD_VARIANTS+=( ${BASE_PROFNAME}_${STATIC_SUFFIX} )
-	if use int64; then
-		MULTIBUILD_VARIANTS+=( ${BASE_PROFNAME}_${INT64_SUFFIX} )
-		use static-libs && MULTIBUILD_VARIANTS+=( ${BASE_PROFNAME}_${INT64_SUFFIX}_${STATIC_SUFFIX} )
-	fi
-	MULTIBUILD_VARIANTS+=( ${BASE_PROFNAME} )
+int64_multilib_get_enabled_abis() {
+	local MULTILIB_VARIANTS=( $(multilib_get_enabled_abis) )
+	local MULTILIB_INT64_VARIANTS=()
+	for i in "${MULTILIB_VARIANTS[@]}"; do
+		if use int64 && [[ "${i}" =~ 64$ ]]; then
+			MULTILIB_INT64_VARIANTS+=( "${i}_${INT64_SUFFIX}" )
+		fi
+		MULTILIB_INT64_VARIANTS+=( "${i}" )
+	done
+	local MULTIBUILD_VARIANTS=()
+	for j in "${MULTILIB_INT64_VARIANTS[@]}"; do
+		use static-libs && MULTIBUILD_VARIANTS+=( "${j}_${STATIC_SUFFIX}" )
+		MULTIBUILD_VARIANTS+=( "${j}" )
+	done
+	echo "${MULTIBUILD_VARIANTS[@]}"
+}
+
+# @FUNCTION: _int64_multilib_multibuild_wrapper
+# @USAGE: <argv>...
+# @INTERNAL
+# @DESCRIPTION:
+# Initialize the environment for ABI selected for multibuild.
+_int64_multilib_multibuild_wrapper() {
+	debug-print-function ${FUNCNAME} "${@}"
+	local v="${MULTIBUILD_VARIANT/_${INT64_SUFFIX}/}"
+	local ABI="${v/_${STATIC_SUFFIX}/}"
+	multilib_toolchain_setup "${ABI}"
+	export FC="$(tc-getFC) $(get_abi_CFLAGS)"
+	export F77="$(tc-getF77) $(get_abi_CFLAGS)"
+	"${@}"
 }
 
 src_prepare() {
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
 	if use int64; then
 		local blas_int64_profname=$(get_blas_profname "${BASE_PROFNAME}-${INT64_SUFFIX}")
 		pkg-config --exists "${blas_int64_profname}" || die "Use int64 requires ${blas_int64_profname}"
@@ -115,11 +138,11 @@ src_prepare() {
 }
 
 src_configure() {
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
 	my_src_configure() {
 		local profname=$(get_profname)
 		local libname="${profname//-/_}"
 		local blas_profname=$(get_blas_profname)
-		echo "profname: ${profname}, blas_profname: ${blas_profname}"
 		local mycmakeargs=(
 			-DPROFNAME="${profname}"
 			-DBLAS_PROFNAME="${blas_profname}"
@@ -141,10 +164,6 @@ src_configure() {
 				-DLAPACK_PKGCONFIG_FFLAGS=""
 			)
 		fi
-		mycmakeargs+=(
-			-DCMAKE_C_FLAGS="$($(tc-getPKG_CONFIG) --cflags ${blas_profname}) ${CFLAGS}"
-			-DCMAKE_CXX_FLAGS="$($(tc-getPKG_CONFIG) --cflags ${blas_profname}) ${CXXFLAGS}"
-		)
 		if [[ "${MULTIBUILD_ID}" =~ "_${STATIC_SUFFIX}" ]]; then
 			mycmakeargs+=(
 				-DBUILD_SHARED_LIBS=OFF
@@ -156,20 +175,27 @@ src_configure() {
 				-DBUILD_STATIC_LIBS=OFF
 			)
 		fi
+		mycmakeargs+=(
+			-DCMAKE_C_FLAGS="$($(tc-getPKG_CONFIG) --cflags ${blas_profname}) ${CFLAGS}"
+			-DCMAKE_CXX_FLAGS="$($(tc-getPKG_CONFIG) --cflags ${blas_profname}) ${CXXFLAGS}"
+		)
 		cmake-utils_src_configure
 	}
-	multibuild_foreach_variant my_src_configure
+	multibuild_foreach_variant _int64_multilib_multibuild_wrapper my_src_configure
 }
 
 src_compile() {
-	multibuild_foreach_variant cmake-utils_src_compile
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
+	multibuild_foreach_variant _int64_multilib_multibuild_wrapper cmake-utils_src_compile
 }
 
 src_test() {
-	multibuild_foreach_variant cmake-utils_src_test
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
+	multibuild_foreach_variant _int64_multilib_multibuild_wrapper cmake-utils_src_test
 }
 
 src_install() {
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
 	my_src_install()  {
 		cmake-utils_src_install
 		if [[ ! "${MULTIBUILD_ID}" =~ "_${STATIC_SUFFIX}" ]]; then
@@ -178,5 +204,5 @@ src_install() {
 				/usr/$(get_libdir)/pkgconfig/lapack.pc ${profname}.pc
 		fi
 	}
-	multibuild_foreach_variant my_src_install
+	multibuild_foreach_variant _int64_multilib_multibuild_wrapper my_src_install
 }


             reply	other threads:[~2014-10-06  5:56 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06  5:56 Justin Lecher [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-06-21 19:47 [gentoo-commits] proj/sci:master commit in: sci-libs/lapack-reference/ Justin Lecher
2018-06-21 18:43 Justin Lecher
2018-06-21 18:43 Justin Lecher
2018-06-21 18:43 Justin Lecher
2016-10-12  6:30 Marius Brehler
2015-12-03  9:55 Justin Lecher
2015-12-03  9:54 Justin Lecher
2015-12-01  6:52 Justin Lecher
2015-11-30 18:33 Justin Lecher
2015-11-30 18:33 Justin Lecher
2014-10-13  9:19 Francois Bissey
2014-10-08 14:16 Honza Macháček
2014-10-06  6:53 Justin Lecher
2014-10-06  5:56 Justin Lecher
2014-10-06  5:56 Justin Lecher
2014-10-06  5:56 Justin Lecher
2014-09-25 21:21 Francois Bissey
2014-09-25 10:45 Francois Bissey
2014-01-28 19:01 Sebastien Fabbro
2013-05-23  5:13 Sebastien Fabbro
2013-03-03 17:52 Justin Lecher
2012-11-29  0:06 Sebastien Fabbro
2012-11-29  0:06 Sebastien Fabbro
2012-11-29  0:06 Sebastien Fabbro
2012-10-26 16:53 Sebastien Fabbro
2012-04-25 15:10 Justin Lecher
2012-04-25  6:47 Justin Lecher
2012-02-23  9:18 Justin Lecher
2012-02-17 16:26 Sebastien Fabbro
2012-02-16  0:38 Sebastien Fabbro
2012-01-26 17:41 Sebastien Fabbro
2011-08-19 15:26 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=1411816207.96347461e8152e8fbb26ba0b43c72646ad3e2c6a.jlec@gentoo \
    --to=jlec@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