When Jack's "modify ENV" change gets in for Requirements, we should convert ENV.fortran to depends_on :fortran.
Sounds great to me. This has been at the top of my TODO list for a bit.
Will rebase and push that change soonish.
Pushed; Requirements can now define modify_build_environment, which will be called by the build script.
I am still able to set FC=... and use the gfortran-4.7 from dupes/gcc.rb, right? Just asking.
Yeah, from a user's perspective this is pretty much just a cosmetic change.
This seems good. Will it pull in gfortran by default rather than printing the message if there's no other Fortran compiler found?
Can I have it to find gfortran-4.7 from the dupes/gcc.rb formula if installed and no gfortran found?
That would be great and I woudn't need to set FC and --fortran-default-flags for some formulae that use gfortran. The brew gfortran was not working for my numpy/scipy builds (tested a week ago or so).
If it is necessary for formula that should be in core I think.
Well, the numpy and scipy formulae are in my homebrew-python fork and not in the core.
But I found the dupes/gcc formula to be the only way to get a decent gfortran (the current brew install gfortran sucks because it's just a downloader of binaries.
brew install gfortran
Working on this now. The only incompatibility is that calling ENV.fortran after something else that modifies build flags, such as ENV.m64 or ENV.Og will work out as expected. Moving to depends_on :fortran won't behave in the same way.
I guess I could add FCFLAGS and FFFLAGS to the cc_flag_vars that are touched by the ENV methods, but then this creates an implicit assumption that the Fortran compiler is GCC or Clang compatible and there isn't a built-in override like the current setup has.
Still think we need depends_on :fotran or env :fortran, but I'm not actually working on this feature.
See #15103 and 4a554dd
We need depends_on otherwise fortran behaves differently to pretty much everything else in Homebrew.
Well, even with depends_on, fortran is going to behave differently to everything else.
It installs a compiler but also needs to allow for overrides if a user has a different compiler that they prefer. It also needs to modify the build environment---but after things such as ENV.Og have been called in the install block.
With #15103, the gfortran situation is starting to merge with a discussion we had the other week on the dev list about how to bring alternate GCC installs into superenv.
with the new style requirements and env do ... end blocks to change the env this should be straight forward to implement this as a Requirement. I see that ENV.fortran operates on FCFLAGS and FFLAGS but not on any of the ENV.cc_flag_vars. How does ENV.Og interfere with ENV.fortran? (No rhetorical question, bperhaps I am lost in the many indirections and jumps in the codebase).
env do ... end
@Sharpie you are assigned. If you don't have the time to do, assign me, and I'll make an attempt.
@samueljohn take assignment if you want
Alright, next free resources will be dedicated here.