sportngin / brew-gem

Install gems as homebrew formulas
MIT License
195 stars 22 forks source link

How to define ruby dependencies in brew? #18

Closed brejoc closed 8 years ago

brejoc commented 9 years ago

Would it be possible to tell homebrew to treat e.g. fpm (a rubygem) as a dependency that can only be statisfied through brew-gem? Normally dependencies would be defined with depends_on, but I'm not sure how this should work.

anfleene commented 9 years ago

Do you mean list a brew-gem as a dependency of a non brew-gem package? We've never looked into that. brew-gem will install all of a gem's dependencies it just use the gemspec. But as a dep of a non brew-gem package my assumption is that it wouldn't work without work since thats a use case we've never tried.

brejoc commented 9 years ago

@anfleene That is right what I had in Mind. With basalt we are making use of invoke (Python) and fpm (Ruby). It would be really nice, if we could sort of create a meta-recipe with dependencies into the python and ruby world.

anfleene commented 9 years ago

I'm not seeing an easy way to do this inside of brew gem. Did you try specifying a ruby dep?

class Foo < Formula
  depends_on "mg" => :ruby
  depends_on "json" => :python
  depends_on "Authen::NTLM" => :perl
end
brejoc commented 9 years ago

If everything else fails, this would be the way to go. But I'd like to avoid having dependencies that need manual interaction with two different installers. Wouldn't it be possible to place the (brew gem) recipe for fpm in the tap and define both brew-gem and fpm as dependencies?

UPDATE: But it seems like it is not possible to tell brew that the already via brew-gem installed fpm statisfies the depends_on "fpm" - right?

anfleene commented 9 years ago

Yeah, I think that would work. But because the formulas are dynamically generated at install time, if that dep wasn't met it wouldn't know where to get it.