1 |
commit: 45c85d1da16a1fc6dfd3cec7231c038b09c34208 |
2 |
Author: gienah <gienah <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 25 13:45:45 2014 +0000 |
4 |
Commit: Mark Wright <gienah <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 25 13:45:45 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=45c85d1d |
7 |
|
8 |
multilib as well for lapack-reference |
9 |
|
10 |
--- |
11 |
.../lapack-reference/lapack-reference-9999.ebuild | 64 +++++++++++++++------- |
12 |
1 file changed, 45 insertions(+), 19 deletions(-) |
13 |
|
14 |
diff --git a/sci-libs/lapack-reference/lapack-reference-9999.ebuild b/sci-libs/lapack-reference/lapack-reference-9999.ebuild |
15 |
index 6aa7c61..8a0f436 100644 |
16 |
--- a/sci-libs/lapack-reference/lapack-reference-9999.ebuild |
17 |
+++ b/sci-libs/lapack-reference/lapack-reference-9999.ebuild |
18 |
@@ -3,7 +3,7 @@ |
19 |
# $Header: $ |
20 |
|
21 |
EAPI=5 |
22 |
-inherit fortran-2 cmake-utils multibuild alternatives-2 toolchain-funcs |
23 |
+inherit fortran-2 cmake-utils multibuild alternatives-2 multilib-build toolchain-funcs |
24 |
|
25 |
if [[ ${PV} == "9999" ]] ; then |
26 |
# The master ESVN_REPO_URI is difficult to access, the git mirror is easier |
27 |
@@ -59,6 +59,7 @@ get_variant_suffix() { |
28 |
get_blas_profname() { |
29 |
local profname="${1:-$(get_profname)}" |
30 |
local variant_suffix=$(get_variant_suffix "${profname}") |
31 |
+ local blas_profile=$(eselect blas show) |
32 |
local selected_blas_profile="${blas_profile}" |
33 |
local blas_no_int64="${selected_blas_profile/-int64/}" |
34 |
local blas_base="${blas_no_int64%-*}" |
35 |
@@ -66,18 +67,40 @@ get_blas_profname() { |
36 |
echo "${blas_name}" |
37 |
} |
38 |
|
39 |
-pkg_setup() { |
40 |
- blas_profile=$(eselect blas show) |
41 |
- MULTIBUILD_VARIANTS=( ) |
42 |
- use static-libs && MULTIBUILD_VARIANTS+=( ${BASE_PROFNAME}_${STATIC_SUFFIX} ) |
43 |
- if use int64; then |
44 |
- MULTIBUILD_VARIANTS+=( ${BASE_PROFNAME}_${INT64_SUFFIX} ) |
45 |
- use static-libs && MULTIBUILD_VARIANTS+=( ${BASE_PROFNAME}_${INT64_SUFFIX}_${STATIC_SUFFIX} ) |
46 |
- fi |
47 |
- MULTIBUILD_VARIANTS+=( ${BASE_PROFNAME} ) |
48 |
+int64_multilib_get_enabled_abis() { |
49 |
+ local MULTILIB_VARIANTS=( $(multilib_get_enabled_abis) ) |
50 |
+ local MULTILIB_INT64_VARIANTS=() |
51 |
+ for i in "${MULTILIB_VARIANTS[@]}"; do |
52 |
+ if use int64 && [[ "${i}" =~ 64$ ]]; then |
53 |
+ MULTILIB_INT64_VARIANTS+=( "${i}_${INT64_SUFFIX}" ) |
54 |
+ fi |
55 |
+ MULTILIB_INT64_VARIANTS+=( "${i}" ) |
56 |
+ done |
57 |
+ local MULTIBUILD_VARIANTS=() |
58 |
+ for j in "${MULTILIB_INT64_VARIANTS[@]}"; do |
59 |
+ use static-libs && MULTIBUILD_VARIANTS+=( "${j}_${STATIC_SUFFIX}" ) |
60 |
+ MULTIBUILD_VARIANTS+=( "${j}" ) |
61 |
+ done |
62 |
+ echo "${MULTIBUILD_VARIANTS[@]}" |
63 |
+} |
64 |
+ |
65 |
+# @FUNCTION: _int64_multilib_multibuild_wrapper |
66 |
+# @USAGE: <argv>... |
67 |
+# @INTERNAL |
68 |
+# @DESCRIPTION: |
69 |
+# Initialize the environment for ABI selected for multibuild. |
70 |
+_int64_multilib_multibuild_wrapper() { |
71 |
+ debug-print-function ${FUNCNAME} "${@}" |
72 |
+ local v="${MULTIBUILD_VARIANT/_${INT64_SUFFIX}/}" |
73 |
+ local ABI="${v/_${STATIC_SUFFIX}/}" |
74 |
+ multilib_toolchain_setup "${ABI}" |
75 |
+ export FC="$(tc-getFC) $(get_abi_CFLAGS)" |
76 |
+ export F77="$(tc-getF77) $(get_abi_CFLAGS)" |
77 |
+ "${@}" |
78 |
} |
79 |
|
80 |
src_prepare() { |
81 |
+ local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) ) |
82 |
if use int64; then |
83 |
local blas_int64_profname=$(get_blas_profname "${BASE_PROFNAME}-${INT64_SUFFIX}") |
84 |
pkg-config --exists "${blas_int64_profname}" || die "Use int64 requires ${blas_int64_profname}" |
85 |
@@ -109,11 +132,11 @@ src_prepare() { |
86 |
} |
87 |
|
88 |
src_configure() { |
89 |
+ local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) ) |
90 |
my_src_configure() { |
91 |
local profname=$(get_profname) |
92 |
local libname="${profname//-/_}" |
93 |
local blas_profname=$(get_blas_profname) |
94 |
- echo "profname: ${profname}, blas_profname: ${blas_profname}" |
95 |
local mycmakeargs=( |
96 |
-DPROFNAME="${profname}" |
97 |
-DBLAS_PROFNAME="${blas_profname}" |
98 |
@@ -135,10 +158,6 @@ src_configure() { |
99 |
-DLAPACK_PKGCONFIG_FFLAGS="" |
100 |
) |
101 |
fi |
102 |
- mycmakeargs+=( |
103 |
- -DCMAKE_C_FLAGS="$($(tc-getPKG_CONFIG) --cflags ${blas_profname}) ${CFLAGS}" |
104 |
- -DCMAKE_CXX_FLAGS="$($(tc-getPKG_CONFIG) --cflags ${blas_profname}) ${CXXFLAGS}" |
105 |
- ) |
106 |
if [[ "${MULTIBUILD_ID}" =~ "_${STATIC_SUFFIX}" ]]; then |
107 |
mycmakeargs+=( |
108 |
-DBUILD_SHARED_LIBS=OFF |
109 |
@@ -150,20 +169,27 @@ src_configure() { |
110 |
-DBUILD_STATIC_LIBS=OFF |
111 |
) |
112 |
fi |
113 |
+ mycmakeargs+=( |
114 |
+ -DCMAKE_C_FLAGS="$($(tc-getPKG_CONFIG) --cflags ${blas_profname}) ${CFLAGS}" |
115 |
+ -DCMAKE_CXX_FLAGS="$($(tc-getPKG_CONFIG) --cflags ${blas_profname}) ${CXXFLAGS}" |
116 |
+ ) |
117 |
cmake-utils_src_configure |
118 |
} |
119 |
- multibuild_foreach_variant my_src_configure |
120 |
+ multibuild_foreach_variant _int64_multilib_multibuild_wrapper my_src_configure |
121 |
} |
122 |
|
123 |
src_compile() { |
124 |
- multibuild_foreach_variant cmake-utils_src_compile |
125 |
+ local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) ) |
126 |
+ multibuild_foreach_variant _int64_multilib_multibuild_wrapper cmake-utils_src_compile |
127 |
} |
128 |
|
129 |
src_test() { |
130 |
- multibuild_foreach_variant cmake-utils_src_test |
131 |
+ local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) ) |
132 |
+ multibuild_foreach_variant _int64_multilib_multibuild_wrapper cmake-utils_src_test |
133 |
} |
134 |
|
135 |
src_install() { |
136 |
+ local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) ) |
137 |
my_src_install() { |
138 |
cmake-utils_src_install |
139 |
if [[ ! "${MULTIBUILD_ID}" =~ "_${STATIC_SUFFIX}" ]]; then |
140 |
@@ -172,5 +198,5 @@ src_install() { |
141 |
/usr/$(get_libdir)/pkgconfig/lapack.pc ${profname}.pc |
142 |
fi |
143 |
} |
144 |
- multibuild_foreach_variant my_src_install |
145 |
+ multibuild_foreach_variant _int64_multilib_multibuild_wrapper my_src_install |
146 |
} |