Closed Luthaf closed 7 years ago
Sorry for late response. I have no plan to migrate to the main homebrew repository. Because these formulae contain non-standard installation rules such as cross compilers compilation phase.
Main Homebrew repository formulae requires to install softwear in /usr/local/Cellar/
or /usr/local/opt/
.
But, this repo's formulae uses /usr/local/mingw
, though.
It has deviated from the main homebrew repository formula guidelines.
If you send pull request to fix above problem, it is welcome.
OK, I'll try to take some time for that.
Thanks. I'm looking for your work!
I think it would also be super useful to have this in a tap somewhere that could provide binary bottles, to make installation that much faster and easier. We have a buildbot that makes bottles for JuliaLang packages, we could maybe use that if needed. Ideally these formulas could be modified so they're acceptable with upstream homebrew though.
Ideally these formulas could be modified so they're acceptable with upstream homebrew though.
Yes, I think ideally so.
Here is a few strategies to adopt Homebrew rules:
bintutils
, winpthread
, runtime
and mingw-headers
HOMEBREW_PREFIX/local/mingw
That is what I was thinking to do, but I do not fully understand yet the process of compiling a cross-compiler. The same tools are compiled more than once, for different targets and hosts I guess. Do you have any link which explain how to compile a cross-compiler?
Here is a link which explains how to compile cross-compilers: http://sourceforge.net/p/mingw-w64/wiki2/Cross%20Win32%20and%20Win64%20compiler/
The same tools are compiled more than once, for different targets and hosts I guess.
Yes, you are right. This repo's formulae compile same tools but different targets which are i686-w64-mingw32 and x86_64-w64-mingw32.
And what is the difference between gcc-cross-mingw32.rb
and gcc-mingw32.rb
?
gcc-mingw32.rb
or gcc-mingw64.rb
are used for generating compiler for building cross compiler. They are intermediate products.
And gcc-cross-mingw32.rb
or gcc-cross-mingw64.rb
are used for building final artifacts which are mingw32 cross compilers.
I've found another solution to build mingw-w64 cross compiler with Homebrew sub-command mechanism: https://github.com/cosmo0920/homebrew-mingw_w64/commit/590328f46e42eb85110d73f38d01f0b8f399358d, https://github.com/cosmo0920/homebrew-mingw_w64/commit/5a2c095399c8c9c08712beb2eb3a1d299cdc5ba1, https://github.com/cosmo0920/homebrew-mingw_w64/commit/8be22916a3c6f9110b03b028095f026b5b6df59d, https://github.com/cosmo0920/homebrew-mingw_w64/commit/4a3263e27c0c39ef494392c09167fc2aba2fda70, and https://github.com/cosmo0920/homebrew-mingw_w64/commit/645101538b950905e5e744ff93abacf7458ce400.
This sub-command is written in bash and you can uninstall with brew uninstall mingw-w64
.
Homebrew permits executing sub-command written in shell script. see: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/External-Commands.md#shell-scripts
Above solution is inspired from: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Tips-N'-Tricks.md#install-into-homebrew-without-formulae.
But for now, brew-install-mingw-w64
causes conflicts against homebrewed software. I didn't create symlink with brew link
in mingw-w64 keg.
I'll abandon formulae which uses unusual way to install cross compiler and migrate sub-command base installation. Anyone-else against this breakage?
Do you think that homebrew maintainers will accept this script-based formula? This would be awesome!
I think that homebrew maintainers will not accept script-based sub-command, sadly. In fact, osx-cross repo's avr-gcc formulae do not accept homebrew upstream.
And I investigated other way (e.g. concatenate all-in-one formula strategy) which did not work.
concatenate all-in-one formula strategy
pseudo-code is committed here: https://github.com/cosmo0920/homebrew-mingw_w64/commit/9f4b48296ee0bbd02e865b661d8218a5aac5dfbe (Note that these formulae do not work!)
Other idea is ... to make binary installation Formula for mingw-w64 cross compiler toolchain. I think that there is a several possibility will be accepted in homebrew-bin repository.
Most source-build formulas in mainline homebrew have binary "bottles" getting built for them, I don't think this formula would be any different if it were eventually accepted upstream. The difficulty is how to get there.
Yeah, you are right. But homebrew has binary only formula.
@tkelman @Luthaf Thanks for you so much comments and pay attention into this issue but I decided this issue is marked wontfix
.
I hope anyone-else will find suitable cross compiler formula contributing way into homebrew.
I'm disappointed but understand where you're coming from. I do think that this is generically useful enough that @staticfloat might be willing to accept it and build bottles for it in his homebrew-juliadeps tap?
Thanks anyway for your work putting this formula together. It is good to have one strong central source formula for this so people can share work and have a common starting point. If someone comes along who is especially motivated to get this upstreamed I hope you'd be able to give some technical input.
I agree that you've got a good resource here, and if you are interested in getting bottles built, I'm willing to help you get them into shape for that. I think there is a little bit of work that should be done before bottles actually get built (Things like: I'd like to make these formula keg_only
and then give the user instructions on adding to their PATH
variables etc.. to access them, instead of installing to prefix+"/mingw"
)
If you're not interested in pushing forward on this, that's totally fine, I am also completely strapped for time right now with a million other projects going on, so if anyone else reading this is interested in tackling these projects, feel free to contact me via @staticfloat if you have questions on how to do things.
OK, I reopen this issue. But this is not doing right now.
Theoretically, mingw-w64 cross compilers can build with fully adopted Formula and get bottle. But, I noticed that it is several difficulties:
#{prefix}/mingw
in build processPATH
when building time.So, I decided to cut out three part of formulae to adopt Homebrew prefix
conventions.
mingw headers installation
, building stage 1 gcc
, building mingw runtime
, and building cross compilers
formulae.And x86_64 version of formulae have same hierarchy.
Does anymore has any objection above formulae plan? Comments are welcome!
Sounds good to me. I should note that if mingw
really wants to install into #{prefix}/mingw
that's fine; just install to the prefix folder that is inside of the Cellar
, and we can make our own links back into the global Homebrew folder.
I've commited: https://github.com/cosmo0920/homebrew-mingw_w64/commit/a8c5eea21f9941883e4de37af3413076ea91f831
Now, we can install binaries which are built with Formula, into ordinary #{prefix}
!
I've also found that the way to bundle winpthread
into (i686|x86-86)-w64-mingw32-gcc formulae.
It makes more convenient. :smiley:
Now, to fix this issue, it should fix audit warnings and write test to verify installation.
mingw-w64-binutils is already merged in Homebrew-core. mingw-w64 is already pull requested now.
wonderful news!
https://github.com/Homebrew/homebrew-core/commit/8c21ae13ef118f8df65916b7a712761234294277 solves this issue.
But this repository should be added conflicts_with
for mingw-w64
formula.
So, this issue should be closed after adding conflicts_with "mingw-w64"
I've added conflicts_with
and caveat.
So, I close this issue.
Thanks for your great works @stephengroat and @fxcoudert !
Hi ! These formula are very great, given the difficulty to build a cross-compiler without prior knowlegde.
I spent lot of time looking for them, so it would be nice to add these formula to the main homebrew repository. Do you have any plan doing so ?