7

I'm writing a homebrew formula for a project (https://www.cryfs.org). Since it is a file system, it depends on osxfuse, which is unfortunately only available as a cask. That is, the formula should have the cask as a dependency.

I tried the following

depends_on :cask => "osxfuse"

but I got the error message

Unsupported special dependency :cask

What is the syntax for adding casks as dependencies to a formula?

Heinzi
  • 5,793
  • 4
  • 40
  • 69

3 Answers3

2

Couldn't find an answer to this problem either.

But as a poor mans workaround this serves well for the time being:

def install
  # Resolve cask dependencies
  system "/usr/local/bin/brew", "cask", "install", "osxfuse"

The big disadvantage is obvious, its not a so much of dependency relation than an installation command. Which may lead to problems until you actually install the package.

Fabian Dörk
  • 323
  • 3
  • 9
-1

Based on other formulas it seems like it needs to be depends_on cask: instead of :cask. There are multiple places where modules depend on a specific cask/macosx version and are defined as such: depends_on macos: "". Example of an cask dependency inside a cask formula.

depends_on cask: => "osxfuse"

Give me an heads up if it worked!

Arnold Stoba
  • 368
  • 1
  • 8
  • Sorry didn't work. depends_on cask: "osxfuse" is just a shorthand in the ruby language for depends_on :cask => "osxfuse". The example you posted is creating a cask, not a formula. I'd like a formula to depend on a cask. – Heinzi Feb 17 '16 at 16:36
  • Oh i see. I do not really have any ruby knowledge at all so i think i'm not able to help you out with this one, sorry. – Arnold Stoba Feb 17 '16 at 16:37
-2

Have you tried:

depends_on "caskroom/cask/osxfuse"

Paul Cav
  • 50
  • 3