How to write homebrew formula that keep their files in the Cellar?

599 views Asked by At

I'm trying to write a formula for the Icon programming language (necessary for noweb), but its binary distribution contains TONS of files (almost 1000) in the lib/ directory. I'd like to leave them out of the symlink-to-/usr/local/lib process since I only need the dependency when building noweb.

Is there a way I can specify that an installation should be kept in its cellar only?

2

There are 2 answers

0
Will Robertson On BEST ANSWER

Aha, finally found the command. Something like:

keg_only "Icon has hundreds and hundreds of lib/ files so we leave them in the keg."

Alternatively, you may write

keg_only :provided_by_osx

to have it print the following as rationale: "This is because the formula is already provided by OS X."

0
Adam Vandenberg On

"keg_only" will keep everything from being linked in.

To keep "most" stuff from being linked in, you can install everything to "libexec" and then symlink from there to bin, or write shim-scripts to bin that call things out of libexec. Lots of Java brews use this method, see "ActiveMQ" or "Gant" for examples.