Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 444568

Summary: [Future EAPI] Export XDG_* variables in ebuild environment
Product: Gentoo Hosted Projects Reporter: Arfrever Frehtes Taifersar Arahesis <arfrever.fta>
Component: PMS/EAPIAssignee: PMS/EAPI <pms>
Status: RESOLVED WONTFIX    
Severity: normal CC: esigra, floppym, freedesktop-bugs, gnome, gstreamer, pacho
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
URL: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
See Also: https://bugs.gentoo.org/show_bug.cgi?id=499288
https://bugs.gentoo.org/show_bug.cgi?id=567192
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 174380    

Description Arfrever Frehtes Taifersar Arahesis 2012-11-24 13:28:17 UTC
Package managers set HOME, but it is insufficient for many packages. Currently multiple eclasses and ebuilds set XDG_* variables. I suggest that package managers automatically set XDG_* variables to reasonable values.

The following variables should be set (and exported) by package managers:
- XDG_CACHE_HOME      (example value: ${HOME}/.cache)
- XDG_CONFIG_HOME     (example value: ${HOME}/.config)
- XDG_DATA_HOME       (example value: ${HOME}/.local/share)
- XDG_RUNTIME_DIR     (example value: ${HOME}/.run)

Package managers should create directories referenced by these variables.

Directory referenced by XDG_RUNTIME_DIR variable should have 0700 permission bits.

http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Comment 1 Gilles Dartiguelongue (RETIRED) gentoo-dev 2012-11-24 14:07:45 UTC
We (gnome/gst/some fdo team members) were planning on having a new fdo/xdg eclass handle this much like the gnome2-utils function: gnome2_reset_environment.

I know this is needed for almost any ebuild using glib nowadays, most likely qt/kde as well but is it really something up for PM ?
Comment 2 Zac Medico gentoo-dev 2012-11-24 21:33:43 UTC
(In reply to comment #1)
> We (gnome/gst/some fdo team members) were planning on having a new fdo/xdg
> eclass handle this much like the gnome2-utils function:
> gnome2_reset_environment.
> 
> I know this is needed for almost any ebuild using glib nowadays, most likely
> qt/kde as well but is it really something up for PM ?

I prefer the idea of using an eclass, for the sake of keeping things modular / encapsulated. If at some point we have a "set of eclasses provided by the package manager", then an xdg eclass might be a good candidate for inclusion in that set.
Comment 3 Mike Gilbert gentoo-dev 2014-01-26 00:16:59 UTC
*** Bug 499288 has been marked as a duplicate of this bug. ***
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-01-26 07:32:33 UTC
Wouldn't it be enough to scrub those variables as part of sanitizing the environment? I think then the default paths with ${HOME} (== ${T}) would apply.
Comment 5 Gilles Dartiguelongue (RETIRED) gentoo-dev 2015-05-25 16:56:58 UTC
Hi guys,

I finally got some time to implement this: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=6f14db878539ac475c7edd9a05d9f55cc21d8778

Unsetting these variables does not always work as some packages (like orc) would start having sandbox issues, see bug #534582.
Comment 6 Arfrever Frehtes Taifersar Arahesis 2015-05-26 21:32:08 UTC
(In reply to Gilles Dartiguelongue from comment #5)
> I finally got some time to implement this:
> https://gitweb.gentoo.org/proj/gnome.git/commit/
> ?id=6f14db878539ac475c7edd9a05d9f55cc21d8778

That xdg.eclass is not appropriate for packages not needing dev-util/desktop-file-utils and x11-misc/shared-mime-info.
Comment 7 Gilles Dartiguelongue (RETIRED) gentoo-dev 2015-05-26 22:59:44 UTC
How do you propose to make these dependencies optional.
I had no intention to make them optional to start with because they really are small packages used in a lot of packages.
Comment 8 Gilles Dartiguelongue (RETIRED) gentoo-dev 2015-05-26 23:01:11 UTC
I can move the actual dir creation and export to a function in xdg-utils so that it can be called when not wanting the rest of the support.
Comment 9 Gilles Dartiguelongue (RETIRED) gentoo-dev 2015-12-15 15:03:24 UTC
FTR, eclass work has been merged as xdg.eclass and xdg-utils.eclass and is now used in gnome and gstreamer eclasses.
Comment 10 Ulrich Müller gentoo-dev 2016-02-28 13:10:34 UTC
*** Bug 575890 has been marked as a duplicate of this bug. ***
Comment 11 Ulrich Müller gentoo-dev 2018-04-14 09:35:34 UTC
EAPI 7 has a mechanism for blacklisting environment variables, see bug 499288. Also, most XDG_* variables are exported by xdg-utils.eclass.

So I think that PMS specifying these vars won't happen. Closing.