Bug 71715 - Defaulting <cachedir> to ~/Library/Caches/org.freedesktop.fontconfig for OSX build
Summary: Defaulting <cachedir> to ~/Library/Caches/org.freedesktop.fontconfig for OSX ...
Status: RESOLVED WONTFIX
Alias: None
Product: fontconfig
Classification: Unclassified
Component: conf (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Mac OS X (All)
: medium normal
Assignee: fontconfig-bugs
QA Contact: Behdad Esfahbod
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-18 01:43 UTC by Clayton Walker
Modified: 2014-09-25 02:19 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Defaulting to ~/Library/Caches/org.freedesktop.fontconfig (1.11 KB, text/plain)
2013-11-18 01:43 UTC, Clayton Walker
Details

Description Clayton Walker 2013-11-18 01:43:58 UTC
Created attachment 89379 [details]
Defaulting to ~/Library/Caches/org.freedesktop.fontconfig

Hi,

I package GIMP on OSX.

The fontconfig cachedir default is not set on OSX, and uses the default linux/unix directory, which isn't what osx users expect.
This patch enables checking for osx, and changing the cachedir to "~/Library/Caches/org.freedesktop.fontconfig".
Comment 1 Akira TAGOH 2013-11-18 06:34:53 UTC
it is supposed to point to the system wide caches though, do you not want to share the cache with users on your box?

Even though it was the proposal, you could build fontconfig with --with-cache-dir=/Library/Caches/path/to/fontconfig/cachedir. win32's case is a bit special since they require the virtual path and the code to deal with.

I don't want to mess up configure script with default paths for each platforms. we has enough facility to change it for you. please use it.

Thanks,
Comment 2 Clayton Walker 2013-11-18 22:13:56 UTC
The thing about OSX is that using non-global Caches _is_ was OSX expects. As per the documentation [1], ~/Library/Caches should be used for bundled applications, as it is the norm.

On OSX, Applications are installed as normal users (installed meaning drag'n'drop dmg or using an installer pkg) and there is no location to write a global cache.

Also, each OSX user has their own individual ~/Library/Fonts folder that they install fonts to. This folder should not be visible from another user, hence the reliance on a local cache makes more sense on osx.

I agree that for MacPorts, Fink, and Brew users it might make sense to simply use the global location (using the default /var directory), but even so, it would be just as beneficial to them as it is to us to have per-user font caches on OSX.

I urge you to reconsider. :)

[1] https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html
Comment 3 Akira TAGOH 2013-11-19 04:11:26 UTC
(In reply to comment #2)
> The thing about OSX is that using non-global Caches _is_ was OSX expects. As
> per the documentation [1], ~/Library/Caches should be used for bundled
> applications, as it is the norm.

Ask for vendors for those applications to build fontconfig with --with-cache-dir=~/Liberary/Caches/path/to/cache then. again, this option is to change the cache dir location. I don't see any reasons to support the default location for each platforms at all.

Another way to specify the user-based cache directory, setting up XDG_CACHE_HOME=~/Library/Caches is an option.
Comment 4 Akira TAGOH 2013-11-19 07:05:17 UTC
(In reply to comment #2)
> I agree that for MacPorts, Fink, and Brew users it might make sense to
> simply use the global location (using the default /var directory), but even
> so, it would be just as beneficial to them as it is to us to have per-user
> font caches on OSX.

I'm not sure if you are aware there are two cache directory locations by default. one is for the system wide (which is able to determine at the build time with --with-cache-dir) and the user specific where is $HOME/.cache/fontconfig on popular Un*x systems and it could be customized by $XDG_CACHE_HOME as I said in the previous comment. for the user own fonts, the user specific cache directory would be better place to store those caches because it can't be picked up by another user as you said. but not that good for the system wide fonts since it takes some disk spaces and having same cache per users is redundant, waste of the disk spaces 
 and CPU load to create caches.
So generally speaking configuring the system-wide cache directory at the user space (at least by default as upstream) makes no sense.
Comment 5 Michael Natterer 2014-09-24 20:12:32 UTC
Yes I can set XDG_CACHE_HOME=~/Library/Caches but that will
result in ~/Library/Caches/fontconfig, when
~/Library/Caches/org.freedesktop.fontconfig would be
more correct. Is there a way to configure the directory
that us used inside XDG_CACHE_HOME?
Comment 6 Akira TAGOH 2014-09-25 02:19:50 UTC
(In reply to comment #5)
> Yes I can set XDG_CACHE_HOME=~/Library/Caches but that will
> result in ~/Library/Caches/fontconfig, when
> ~/Library/Caches/org.freedesktop.fontconfig would be
> more correct. Is there a way to configure the directory
> that us used inside XDG_CACHE_HOME?

You could modify the following line in fonts.conf if you like then:

        <cachedir prefix="xdg">fontconfig</cachedir>

To:
        <cachedir prefix="xdg">org.freedesktop.fontconfig</cachedir>

I'm not quite sure if it is correct since there are no such applications using that java-like namespace schema in the cache directory.

Anyway, hope that helps.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.