At present the eclass only adds virtual/fortran to DEPEND if FORTRAN_NEEDED=test, or to DEPEND and RDEPEND for all other modes (except "no", of course). This should be extended to cover BDEPEND if used in EAPI-7, and soon EAPI-8, ebuilds.
My take on this as follows: - for FORTRAN_NEEDED=test we clearly need both the compiler and the test executables to run on the build host, therefore newer EAPIS should set BDEPEND only in this mode; - for other modes, as things stand we need virtual/fortran in both BDEPEND (so that the compiler can run) and DEPEND (so that binaries we build for the target system can link against appropriate libraries). On a related note, question to our resident gfortran experts: is it possible to have a binary compiled from Fortran source code which does NOT link against libgfortran? If it is, we might want to think about extending the eclass logic so that it is possible to add virtual/fortran to BDEPEND but not DEPEND.
(In reply to Marek Szuba from comment #1) > On a related note, question to our resident gfortran experts: is it possible > to have a binary compiled from Fortran source code which does NOT link > against libgfortran? If it is, we might want to think about extending the > eclass logic so that it is possible to add virtual/fortran to BDEPEND but > not DEPEND. Unless you compile static, I have no idea how you would perform such a trick.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b40ddb4f450aa66f3021f31991dafc1fd1e97733 commit b40ddb4f450aa66f3021f31991dafc1fd1e97733 Author: Marek Szuba <marecki@gentoo.org> AuthorDate: 2021-07-16 11:53:57 +0000 Commit: Marek Szuba <marecki@gentoo.org> CommitDate: 2021-07-20 16:36:33 +0000 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@gentoo.org> eclass/fortran-2.eclass | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)