If I have a dependency, but I need a specific option engaged on that dependency, how can I tell homebrew to enable that option?
I'm looking for something along the lines of:
depends_on "qt", "--with-qt3support"
or something like that. Is this possible?
Not yet possible but definitely should be. Not sure if this is a duplicate.
Would be very useful! (e.g. to require the --with-magick-plus-plus option for imagemagick)
The syntax being proposed, as part of a set of connected changes, is:
depends_on "myformula" -> "--option-name"
The options used to compile a formula are going to be stored in the formulae prefixes, and used to do these option checks as well as maintaining options between formula upgrades.
Though we will still want to keep the amount of options and complicated dependencies to a minimum.
Sounds good to me. Presumably if a formula is already installed with incorrect options it'll be reinstalled?
Probably, though I haven't gotten that far yet; the other option is to tell the user to do it and show the commands, and how come, but automatic is usually better. Unless I think of some reason why doing it automatically would be bad.
I guess one bad reason is that automatically reinstalling boost or qt as "--universal" is an hour gone from your life. Though I think Qt universal took about 3 hours on my old laptop. Ouch.
Yeh, it should probably just fail and shout at the user then.
Just checking for an update if there is one. The original request for qt3support option is exactly what I had in mind when searching for this issue!
Still not possible, but also still planned.
Now that "improved dependencies" have landed, I'm working on this one.
I have a patch which enables this; is there an example in core or an external repo that I can use to test it?
Status on this change?
does this allow multiple options? or just one per package?
After looking through the source it looks like this should be handled fine like this
depends_on 'php' => ['--with-mysql', '--with-suhosin', '--with-fpm']
This isn't working for me, do I have the syntax correct?
This code is in my branch: https://github.com/adamv/homebrew/commits/ops
The behavior you're looking for isn't fully implemented yet though.
This seems to be a hard nut.
What we can do right now is to write a Requirement which queries the options of a particular formula and prints a a message, right?
@samueljohn https://github.com/jacknagel/homebrew/compare/deps ;)
Closing since this is implemented in #14456.