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 <mare...@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 )"
                        ;;
-- 
2.31.1


  • [gentoo-dev] Mike Kaliman
    • [gentoo-dev] Marek Szuba
      • [gentoo-dev] [PATCH] fortran-2.eclass: use BDEPEND o... Marek Szuba

Reply via email to