cosmo0920 / homebrew-mingw_w64

unofficial mingw-w64 Homebrew sub-command and Formulae. These formulae have been superseded by homebrew's mingw-w64.rb.
MIT License
50 stars 14 forks source link

Add the formula to the main Homebrew repository #1

Closed Luthaf closed 7 years ago

Luthaf commented 9 years ago

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 ?

cosmo0920 commented 9 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.

Luthaf commented 9 years ago

OK, I'll try to take some time for that.

cosmo0920 commented 9 years ago

Thanks. I'm looking for your work!

tkelman commented 9 years ago

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.

cosmo0920 commented 9 years ago

Ideally these formulas could be modified so they're acceptable with upstream homebrew though.

Yes, I think ideally so.

cosmo0920 commented 9 years ago

Here is a few strategies to adopt Homebrew rules:

Luthaf commented 9 years ago

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?

cosmo0920 commented 9 years ago

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.

Luthaf commented 9 years ago

And what is the difference between gcc-cross-mingw32.rb and gcc-mingw32.rb?

cosmo0920 commented 9 years ago

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.

cosmo0920 commented 8 years ago

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

cosmo0920 commented 8 years ago

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.

cosmo0920 commented 8 years ago

I'll abandon formulae which uses unusual way to install cross compiler and migrate sub-command base installation. Anyone-else against this breakage?

Luthaf commented 8 years ago

Do you think that homebrew maintainers will accept this script-based formula? This would be awesome!

cosmo0920 commented 8 years ago

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!)

cosmo0920 commented 8 years ago

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.

tkelman commented 8 years ago

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.

cosmo0920 commented 8 years ago

Yeah, you are right. But homebrew has binary only formula.

cosmo0920 commented 8 years ago

@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.

tkelman commented 8 years ago

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.

staticfloat commented 8 years ago

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.

cosmo0920 commented 8 years ago

OK, I reopen this issue. But this is not doing right now.

cosmo0920 commented 8 years ago

Theoretically, mingw-w64 cross compilers can build with fully adopted Formula and get bottle. But, I noticed that it is several difficulties:

So, I decided to cut out three part of formulae to adopt Homebrew prefix conventions.

And x86_64 version of formulae have same hierarchy.

Does anymore has any objection above formulae plan? Comments are welcome!

staticfloat commented 8 years ago

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.

cosmo0920 commented 8 years ago

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}!

cosmo0920 commented 8 years ago

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.

cosmo0920 commented 7 years ago

mingw-w64-binutils is already merged in Homebrew-core. mingw-w64 is already pull requested now.

tkelman commented 7 years ago

wonderful news!

cosmo0920 commented 7 years ago

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"

cosmo0920 commented 7 years ago

I've added conflicts_with and caveat. So, I close this issue. Thanks for your great works @stephengroat and @fxcoudert !