about QSP::RuntimeLocation and XDG_RUNTIME_DIR on OS X/MacPorts

René J. V. Bertin rjvbertin at gmail.com
Mon Nov 23 16:32:28 UTC 2015


Hi,

Freedesktop/XDG-compliant applications may use a user-specific location for 
runtime "stuff" like sockets. On Linux, this location usually is something like 
/run/user/uid. It is typically defined globally through the XDG_RUNTIME_DIR env. 
variable, with a fallback if that variable doesn't exist.

I'm not certain if MacPorts has some kind of policy for handling this particular 
location. The only beginning of an answer I have for now is the presence of a 
few ~/.cache/keyring-XXXXX directories, which may correspond to the similarly 
named keyring directories in /run/user/uid on my Linux rig.

Context: Qt5's QStandardPaths::RuntimeLocation return value. It defaults to 
~/Library/Application Support, which I think is fine for "Apple native mode" but 
not for an XDG-compliant mode like the one I intend to provide.
Alternatives I see:
- $TMPDIR/runtime-username (calculated using the QSP RuntimeLocation code used 
on other Unix hosts)
- ~/.cache (to align with what Gnome *may* use).

I tend to prefer the 1st alternative to stick closest to what happens on Linux, 
but only if Qt5-based and non-Qt5-based applications and libraries need NOT 
agree on the location.

Thoughts?
Thanks,
René



More information about the Kde-frameworks-devel mailing list