Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/strings.nix: fixes & additions #40048

Closed

Conversation

matthewbauer
Copy link
Member

Adds 3 new functions:

-makeXdgPath
-makeInfoPath
-makeManPath

Also allows you to put null in a search path. So something like this will work:

lib.makeSearchPath "lib" [ libxml2 libintl ]

(notice that libintl will be null on Glibc systems).

This makes things match ‘buildInputs’ where inputs are allowed to be
null.
This adds the following to lib/strings.nix:

- makeXdgPath
- makeManPath
- makeInfoPath
@matthewbauer matthewbauer requested review from edolstra and nbp as code owners May 6, 2018 20:52
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels May 6, 2018
@@ -126,6 +126,18 @@ rec {
*/
makePerlPath = makeSearchPathOutput "lib" "lib/perl5/site_perl";

/* Construct an XDG path. Suitable to use as XDG_DATA_DIRS.
*/
makeXdgPath = makeSearchPathOutput "xdg" "share";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be named makeDatadirPath. I would expect XDG path to be etc/xdg or share/xdg. Also why are you using the xdg output, datadir is usually in out?

Copy link
Member Author

@matthewbauer matthewbauer May 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That might be a better name. Do packages come with /etc/xdg files though? My understanding is that the user supplies them. For this to make sense we would definitely need to define the xdg output. The idea was to put all of the FreeDesktop standardized directories there are like /share/applications, /share/icons, /share/mime, and /share/menus in one place.

Anyway the FreeDesktop directories are useful in free systems like Linux but not so useful on my Mac where the Applications directory is used instead. Having an output for just the XDG stuff would be useful, I think. icons especially can add up in closure size.

https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
https://standards.freedesktop.org/menu-spec/menu-spec-latest.html
https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
https://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do packages come with /etc/xdg files though?

e.g polkit_gnome

For this to make sense we would definitely need to define the xdg output. The idea was to put all of the FreeDesktop standardized directories there are like /share/applications, /share/icons, /share/mime, and /share/menus in one place.

If we modify the setup hooks and everything (we rely on environment.pathsToLink to get these to the environment), sure. Icons should probably stay, since they are often used by the app itself.

@matthewbauer matthewbauer added the 2.status: work-in-progress This PR isn't done label May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: work-in-progress This PR isn't done 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants