Python GUI app formula: core or cask


(Sebastiaan Lokhorst) #1

I am trying to create a formula for Gajim: an open-source GUI chat app written in Python.

I have created a basic formula which allows gajim to be launched from the terminal, and also builds an .app if it is installed with the --with-bundle option. This is mostly based on what I found in mpv.rb.

However, I just read the upcoming changes for Brew 2.0:

Homebrew 2.0.0 will not have any formulae with options in Homebrew/homebrew-core[1]

And also Acceptable Formulae[2], which states:

Don’t make your formula build an .app (native macOS Application); we don’t want those things in Homebrew.

So this seems to mean that the current mpv approach is no longer acceptable.

Can someone give some advice? Should I create a formula without the .app for homebrew-core? Or since Gajim is GUI-only, should it just be exclusively in homebrew-cask?


(Sebastiaan Lokhorst) #2

Since Discourse is being stupid about too many links in one post:

1: Homebrew 2.0.0 will not have any formulae with options in Homebrew/homebrew-core

2: Acceptable Formulae


(Sean Molenaar) #3

I’d actually suggest making both. A cask and a formula


(Sebastiaan Lokhorst) #4

So something like this?

  • core/gajim: the program itself, without the .app
  • cask/gajim: depends on core/gajim and contains just a wrapper .app which starts the program from core/gajim

Do you maybe know of another app that does this so I have an example?


(Sean Molenaar) #5

I’d just make the cask a seperate install completely, not depending on anything.


(Sebastiaan Lokhorst) #6

Alright… I’m currently using Language::Python::Virtualenv and virtualenv_install_with_resources as suggested by Python for Formula Authors

Applications should be installed into a Python virtualenv environment rooted in libexec . This prevents the app’s Python modules from contaminating the system site-packages and vice versa.

But I can’t find any other formula in cask that uses this method.

Is this method also suitable when using an .app? The executable created by that method contains hardcoded paths to #!/usr/local/Cellar/gajim/1.1/, and I’m not sure how portable/reliable this is when moving or updating the app.

Should I just abandon the suggestions in Python for Formula Authors and find some other method to create a self-contained .app?