I have been a homebrew user for about 5 years, and this is the first time I have felt the need to create a formula… but I think I need to help to make it happen.
I read through the Formula Cookbook pages, but I’m still fuzzy on how to go about this for the specific thing I want to add.
My goal is to create a tap for the Vulkan SDK for Mac, which is a next-generation graphics API designed by the Khronos Group (the same industry group that manages the OpenGL and OpenCL spec).
First, I apologize if I confuse the homebrew terminology. Basically, LunarG is releasing pre-compiled libraries for Mac at their site: https://vulkan.lunarg.com/sdk/home. The latest release for mac is:
This release is already compiled and the docs say that it can be run on El Capitan and later. Since there is no compilation necessary, is “brew create …” the right way to get started with this?
In the autogenerated boilerplate created by brew create, there are sections for installation and testing. Do these sections apply when the code is already compiled?
Since there is no compilation, what do I need to do to get the files installed in the Cellar somewhere? Is there something automated, or do I need to put “system” commands into the formula? Would the name of the cellar follow the name of the forumla and version (or the name from the tarball file)?
Additionally, in order to properly run vulkan programs, a few environment variables have to be defined. Does homebrew support adding such environment variables, or are such variables just enumerated as “Caveats”?
As far as I can tell, just to run vulkan programs these variables must be defined at a minimum:
And to do development work, like compiling programs and linking them with the vulkan sdk libraries, the variables should also be defined:
Maybe the DYLD_LIBRARY_PATH doesn’t need to be defined if the installation puts symlinks to libvulkan.dylib that points to Cellar location of the file. I’m not sure what the right way of doing that is either.
Also, I noticed that when I ran “brew create”, it automatically generated a name for the tap (vulkansdk-macos.rb). What is the proper name to renaming that to “vulkansdk” or just “vulkan”.
I’d really appreciate help with someone with experience with creating these formulas.