Introducing the app portgroup

Ryan Schmidt ryandesign at macports.org
Wed Aug 17 05:35:14 PDT 2011


The new "app" portgroup makes it much easier to create a Mac OS X application bundle. This is for ports that already install programs that have proper Mac OS X GUIs, but that install a plain executable ${prefix}/bin and not an application bundle in ${applications_dir}.

For now, the portgroup file itself is the documentation, but I have tried to comment it well. If you want to use this portgroup, please read the comments thoroughly, as they explain all the options and what you can do with them. If anything is unclear, please let me know so I can reword it.

https://trac.macports.org/browser/trunk/dports/_resources/port1.0/group/app-1.0.tcl

In the simplest case, where the port name matches the executable name that gets installed in ${prefix}/bin and the app name is the same as the port name, all you need to do is include the portgroup. In other cases, you can specify the app.name and/or app.executable. You can also specify an app.icon; if you specify a graphic that is not an .icns file it will be converted for you. The hope is that most projects will ship with a suitable icon graphic in some format, and that we can thus avoid littering the ports tree with .icns files.

We've of course had these features in many ports already, but each port implemented it manually, sometimes taking a dozen or more lines of code to do so. Here are examples of converting the old manual app bundle creation method to the new app portgroup method:

https://trac.macports.org/search?q=%22use+app+portgroup%22&changeset=on

This portgroup is designed to be useful in many common cases but does not solve every problem. If your port needs to install more than one app bundle, this portgroup will not help you. If your port installs programs which do not have proper Mac OS X GUIs (and do not have an icon that stays in the Dock while it is running -- for example X11 apps), this portgroup will not help you. If you need to insert custom keys into the app bundle's Info.plist, the portgroup doesn't do that today, but could perhaps be enhanced to accommodate this; if this need arises, please bring it up with me or on the list.





More information about the macports-dev mailing list