Formula for a c++ library with custom dependencies


(Peter Gusev) #1

I’m trying to figure out how to write a formula for the C++ library which has brew as well as non-brew dependencies. I have struggles understanding how these non-brew dependencies should be built using formula and where they must be placed so that the library can use them.
The install instructions are self-sufficient, meaning that they are designed in a way that allows user to build whole library and it’s dependencies in a subfolder from scratch. I just need to translate them into a homebrew formula and make library and it’s supporting CLI tools be available for the end user.

For example, there’s one dependency which is a C++ library that uses GNU autotools (configure and make). How shall I specify it as a dependency? depends_on won’t work in this case. Moreover, once make install is called, where will it be installed and how can my library find it?

Another dependency is quite large (WebRTC) and takes time to build, so I want to pre-compile it and just make brew to download them. However, I’m not sure where it must be installed so that my library find these precompiled libraries.

Finally, another dependency (OpenFEC) does not have github repo and must be wget'ed and built using cmake. Again, how shall I go about making compiled binaries “findable” by my library compilation process and runtime?


(Sean Molenaar) #2

The easiest way would be to split them I guess. Docs.brew.sh can be a good resource for working on formula.

As for precompiled code, in homebrew terms that’s a bottle. And I think those are also documented on docs.brew.sh.