Passing Options to dependencies #3702

Closed
staticfloat opened this Issue Dec 24, 2010 · 18 comments

Projects

None yet

8 participants

@staticfloat

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?

Thanks,

@MikeMcQuaid
Member

Not yet possible but definitely should be. Not sure if this is a duplicate.

@adamv adamv was assigned Apr 13, 2011
@slayoo
slayoo commented May 4, 2011

Would be very useful! (e.g. to require the --with-magick-plus-plus option for imagemagick)

@adamv
adamv commented Jun 19, 2011

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.

@MikeMcQuaid
Member

Sounds good to me. Presumably if a formula is already installed with incorrect options it'll be reinstalled?

@adamv
adamv commented Jun 20, 2011

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.

@adamv
adamv commented Jun 20, 2011

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.

@MikeMcQuaid
Member

Yeh, it should probably just fail and shout at the user then.

@dtest
dtest commented Nov 1, 2011

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!

@jacknagel

Still not possible, but also still planned.

@adamv
adamv commented Mar 12, 2012

Now that "improved dependencies" have landed, I'm working on this one.

@adamv
adamv commented Mar 22, 2012

I have a patch which enables this; is there an example in core or an external repo that I can use to test it?

@jondavidjohn

Status on this change?

does this allow multiple options? or just one per package?

@jondavidjohn

After looking through the source it looks like this should be handled fine like this

https://github.com/mxcl/homebrew/blob/master/Library/Homebrew/dependencies.rb

depends_on 'php' => ['--with-mysql', '--with-suhosin', '--with-fpm']

This isn't working for me, do I have the syntax correct?

@adamv
adamv commented May 7, 2012

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.

@samueljohn

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?

@jacknagel jacknagel was assigned Aug 25, 2012
@samueljohn

Awesome.

@jacknagel

Closing since this is implemented in #14456.

@jacknagel jacknagel closed this Aug 30, 2012
@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.