commit:     b40ddb4f450aa66f3021f31991dafc1fd1e97733
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 16 11:53:57 2021 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Tue Jul 20 16:36:33 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b40ddb4f

fortran-2.eclass: use BDEPEND on EAPI 7+

For FORTRAN_NEEDED=test we need both the compiler and the test binaries
to run on the build host only, hence new EAPIs only set BDEPEND here;

For other modes (other than "no", of course), we need a Fortran compiler
running on the build host as well as the runtime libraries built for the
target arch, necessitating the use of both DEPEND and BDEPEND on newer
EAPIs.

Closes: https://bugs.gentoo.org/802153
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 eclass/fortran-2.eclass | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/eclass/fortran-2.eclass b/eclass/fortran-2.eclass
index 9d0c71703e4..2409cfcda5b 100644
--- a/eclass/fortran-2.eclass
+++ b/eclass/fortran-2.eclass
@@ -69,6 +69,9 @@ if [[ ! ${_FORTRAN_2_CLASS} ]]; then
 for _f_use in ${FORTRAN_NEEDED}; do
        case ${_f_use} in
                always)
+                       if [[ ${EAPI} != [56] ]]; then
+                               BDEPEND+=" virtual/fortran"
+                       fi
                        DEPEND+=" virtual/fortran"
                        RDEPEND+=" virtual/fortran"
                        break
@@ -77,9 +80,16 @@ for _f_use in ${FORTRAN_NEEDED}; do
                        break
                        ;;
                test)
-                       DEPEND+=" ${_f_use}? ( virtual/fortran )"
+                       if [[ ${EAPI} != [56] ]]; then
+                               BDEPEND+=" ${_f_use}? ( virtual/fortran )"
+                       else
+                               DEPEND+=" ${_f_use}? ( virtual/fortran )"
+                       fi
                        ;;
                *)
+                       if [[ ${EAPI} != [56] ]]; then
+                               BDEPEND+=" ${_f_use}? ( virtual/fortran )"
+                       fi
                        DEPEND+=" ${_f_use}? ( virtual/fortran )"
                        RDEPEND+=" ${_f_use}? ( virtual/fortran )"
                        ;;

Reply via email to