font ports?
Andrea D'Amore
and.damore at macports.org
Mon Nov 30 00:58:01 PST 2015
On 30 November 2015 at 06:01, Ryan Schmidt <ryandesign at macports.org> wrote:
> /Library/Fonts is a location which users expect to be in control of. They expect to be able to install and uninstall files here, and not to have files there owned by MacPorts or other software.
I disagree with the reasoning here, the ability of installing and
uninstalling files from a path doesn't depend on the presence of
mp-owned files, with the obvious exception of an already taken file
path.
> What would happen if the user had already installed the font there, and then MacPorts tried to install it there? (MacPorts would fail with an activation error.)
> What would happen if the user tried to remove the font MacPorts installed there by dragging it to the trash? (The Finder would say they are not authorized to do that.)
> What would happen if the user's MacPorts registry becomes corrupted somehow and they have to follow the emergency uninstallation instructions? (These font files would not be uninstalled, because they were not installed in a directory MacPorts owns.)
The same things that would happen if, say, I manually copy
TextEdit.app as /Applications/MacPorts/MacVim.app and then try to
install the macvim port. The other two scenarios can happen even more
easily without explicit trickery.
> For these reasons, I would say no, you should not write a port that installs anything in /Library/Fonts. I'm not aware of any existing ports that do that.
Not for fonts, but there are standardized exceptions to writing in
$prefix, applications_dir and daemons/agents' plist files.
This is an use case of the same kind of the applications one, only
with a different target.
As it turns out the system (or Cocoa at least) recursively scan the
font folders, so adding system-wide port fonts in
/Library/Fonts/MacPorts doesn't seem anything different that what's
already being done.
> Maybe install the fonts in ${prefix}/Library/Fonts, or another directory inside the prefix where other ports already install fonts, and try to convince whatever port you're working on that requires that specific font to use it from that location.
This as a general rule seems worse than writing specific content in
/Library, I think the point is understanding why are the fonts shipped
in first place, i.e. if their intended use.
If they are meant to just be used by the application they are
accompanying then I'd go as you suggested by configuring the app for
looking somewhere in $prefix/share/$name , but for fonts meant to be
accessed by other applications I'd go in /Library/Fonts.
Think for example of a port that is just a collection of fonts without
a standalone application, how would you install that and then tell
your regular Cocoa apps about the fonts?
--
Andrea
More information about the macports-dev
mailing list