unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Guix and $XDG_DATA_DIRS
@ 2019-04-11 17:06 HiPhish
  2019-04-11 17:58 ` Luther Thompson
  0 siblings, 1 reply; 7+ messages in thread
From: HiPhish @ 2019-04-11 17:06 UTC (permalink / raw)
  To: help-guix

Hello everyone,

I noticed that when I use Guix to install an application that has a desktop 
entry, such as Gimp, Inkscape or Krita, that application does not show up in 
my applications menu (using KDE on Kubuntu). After some digging I have found 
that the environment variable $XDG_DATA_DIRS is responsible for this.

From what I understand, Guix should set all the necessary environment 
variables by modifying the file $GUIX_PROFILE/etc/profile, which I then need to 
source in my .profile file. Here are its contents:

export PATH="${GUIX_PROFILE:-/gnu/store/83b17pr7rdyng48443iqn0f1z18dkpzk-
profile}/bin${PATH:+:}$PATH"
export GUILE_LOAD_PATH="${GUIX_PROFILE:-/gnu/store/
83b17pr7rdyng48443iqn0f1z18dkpzk-profile}/share/guile/site/2.2$
{GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
export GUILE_LOAD_COMPILED_PATH="${GUIX_PROFILE:-/gnu/store/
83b17pr7rdyng48443iqn0f1z18dkpzk-profile}/lib/guile/2.2/site-ccache$
{GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"

As you can see, $XDG_DATA_DIRS is not being modified. I have added the 
following line to my .profile file:

    export XDG_DATA_DIRS="$GUIX_PROFILE/share/":$XDG_DATA_DIRS

Now all the applications do show up in my menu after a reboot. Is this an 
oversight or am I supposed to set that variable myself? And if it is the 
latter, where is the best place to set that variable so it picks it up when I 
install a new application without rebooting?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Guix and $XDG_DATA_DIRS
  2019-04-11 17:06 Guix and $XDG_DATA_DIRS HiPhish
@ 2019-04-11 17:58 ` Luther Thompson
  2019-04-11 18:56   ` HiPhish
  0 siblings, 1 reply; 7+ messages in thread
From: Luther Thompson @ 2019-04-11 17:58 UTC (permalink / raw)
  To: HiPhish; +Cc: help-guix

On Thu, 11 Apr 2019 19:06:03 +0200
HiPhish <hiphish@posteo.de> wrote:

> From what I understand, Guix should set all the necessary environment 
> variables by modifying the file $GUIX_PROFILE/etc/profile, which I
> then need to source in my .profile file. Here are its contents:
> 
> export
> PATH="${GUIX_PROFILE:-/gnu/store/83b17pr7rdyng48443iqn0f1z18dkpzk-
> profile}/bin${PATH:+:}$PATH" export
> GUILE_LOAD_PATH="${GUIX_PROFILE:-/gnu/store/
> 83b17pr7rdyng48443iqn0f1z18dkpzk-profile}/share/guile/site/2.2$
> {GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" export
> GUILE_LOAD_COMPILED_PATH="${GUIX_PROFILE:-/gnu/store/
> 83b17pr7rdyng48443iqn0f1z18dkpzk-profile}/lib/guile/2.2/site-ccache$
> {GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
> 
> As you can see, $XDG_DATA_DIRS is not being modified. I have added
> the following line to my .profile file:
> 
>     export XDG_DATA_DIRS="$GUIX_PROFILE/share/":$XDG_DATA_DIRS
> 
> Now all the applications do show up in my menu after a reboot. Is
> this an oversight or am I supposed to set that variable myself? And
> if it is the latter, where is the best place to set that variable so
> it picks it up when I install a new application without rebooting?

On my system ~/.guix-profile/etc/profile has all the important
environment variables, including XDG_DATA_DIRS. When I run `guix
package --search-paths=prefix`, I see a list of the same variables.
What do you see when you run that command?

Luther

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Guix and $XDG_DATA_DIRS
  2019-04-11 17:58 ` Luther Thompson
@ 2019-04-11 18:56   ` HiPhish
  2019-04-11 23:04     ` Luther Thompson
  0 siblings, 1 reply; 7+ messages in thread
From: HiPhish @ 2019-04-11 18:56 UTC (permalink / raw)
  To: Luther Thompson; +Cc: help-guix

On Thursday, 11 April 2019 19:58:56 CEST Luther Thompson wrote:
> On my system ~/.guix-profile/etc/profile has all the important
> environment variables, including XDG_DATA_DIRS. When I run `guix
> package --search-paths=prefix`, I see a list of the same variables.
> What do you see when you run that command?
> 
> Luther

I get the the same as what my profile file says:

$ guix package --search-paths
export PATH="/home/aleksandar/.guix-profile/bin"
export GUILE_LOAD_PATH="/home/aleksandar/.guix-profile/share/guile/site/2.2"
export GUILE_LOAD_COMPILED_PATH="/home/aleksandar/.guix-profile/lib/guile/2.2/
site-ccache"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Guix and $XDG_DATA_DIRS
  2019-04-11 18:56   ` HiPhish
@ 2019-04-11 23:04     ` Luther Thompson
  2019-04-12  6:11       ` HiPhish
  0 siblings, 1 reply; 7+ messages in thread
From: Luther Thompson @ 2019-04-11 23:04 UTC (permalink / raw)
  To: HiPhish; +Cc: help-guix

On Thu, 11 Apr 2019 20:56:31 +0200
HiPhish <hiphish@posteo.de> wrote:

> On Thursday, 11 April 2019 19:58:56 CEST Luther Thompson wrote:
> > On my system ~/.guix-profile/etc/profile has all the important
> > environment variables, including XDG_DATA_DIRS. When I run `guix
> > package --search-paths=prefix`, I see a list of the same variables.
> > What do you see when you run that command?
> > 
> > Luther  
> 
> I get the the same as what my profile file says:
> 
> $ guix package --search-paths
> export PATH="/home/aleksandar/.guix-profile/bin"
> export
> GUILE_LOAD_PATH="/home/aleksandar/.guix-profile/share/guile/site/2.2"
> export
> GUILE_LOAD_COMPILED_PATH="/home/aleksandar/.guix-profile/lib/guile/2.2/
> site-ccache"

Ok, so the profile and search-paths both have the same problem. I'll
have to dig into the source code to see if I can find a root cause.
Hopefully in the meantime, someone who knows about this stuff can come
up with an answer.

Luther

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Guix and $XDG_DATA_DIRS
  2019-04-11 23:04     ` Luther Thompson
@ 2019-04-12  6:11       ` HiPhish
  2019-04-12  9:11         ` Ricardo Wurmus
  0 siblings, 1 reply; 7+ messages in thread
From: HiPhish @ 2019-04-12  6:11 UTC (permalink / raw)
  To: Luther Thompson; +Cc: help-guix

On Friday, 12 April 2019 01:04:02 CEST Luther Thompson wrote:
> Ok, so the profile and search-paths both have the same problem. I'll
> have to dig into the source code to see if I can find a root cause.
> Hopefully in the meantime, someone who knows about this stuff can come
> up with an answer.
> 
> Luther

Now that I have looked into it, there are other variables that haven't been 
defined as well that I had to define in my .profile file:

export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"
export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"
export CPATH="$HOME/.guix-profile/include/":$CPATH
export LD_LIBRARY_PATH="$HOME/.guix-profile/lib/":$LD_LIBRARY_PATH
export XDG_DATA_DIRS="$GUIX_PROFILE/share/":$XDG_DATA_DIRS
# SSL certificates (after installing 'nss-certs')
export SSL_CERT_DIR="$GUIX_PROFILE/etc/ssl/certs"
export SSL_CERT_FILE="$GUIX_PROFILE/etc/ssl/certs/ca-certificates.crt"
export GIT_SSL_CAINFO="$SSL_CERT_FILE"

I don't know if all of these should have been defined by Guix, but I have 
listed them anyway. I could live with $XDG_DATA_DIRS not always being up to 
date, but now I noticed that `guix environment --ad-hoc whatever` does not 
make C libraries available for working on local projects because $CPATH AND 
$LD_LIBRARY_PATH are not set.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Guix and $XDG_DATA_DIRS
  2019-04-12  6:11       ` HiPhish
@ 2019-04-12  9:11         ` Ricardo Wurmus
  2019-04-12 12:20           ` HiPhish
  0 siblings, 1 reply; 7+ messages in thread
From: Ricardo Wurmus @ 2019-04-12  9:11 UTC (permalink / raw)
  To: HiPhish; +Cc: help-guix


HiPhish <hiphish@posteo.de> writes:

> On Friday, 12 April 2019 01:04:02 CEST Luther Thompson wrote:
>> Ok, so the profile and search-paths both have the same problem. I'll
>> have to dig into the source code to see if I can find a root cause.
>> Hopefully in the meantime, someone who knows about this stuff can come
>> up with an answer.
>> 
>> Luther
>
> Now that I have looked into it, there are other variables that haven't been 
> defined as well that I had to define in my .profile file:
>
> export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"
> export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"
> export CPATH="$HOME/.guix-profile/include/":$CPATH
> export LD_LIBRARY_PATH="$HOME/.guix-profile/lib/":$LD_LIBRARY_PATH

You shouldn’t set this one.  If you’re concerned about GCC not finding
libraries you should use LIBRARY_PATH, not LD_LIBRARY_PATH.

When installing gcc-toolchain, however, CPATH and LIBRARY_PATH should be
set automatically.

Generally, the search path variables are set automatically when an
installed package declares a search path.

GUIX_LOCPATH, SSL_CERT_DIR, SSL_CERT_FILE, and GIT_SSL_CAINFO are not
search paths and are thus not set automatically.

-- 
Ricardo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Guix and $XDG_DATA_DIRS
  2019-04-12  9:11         ` Ricardo Wurmus
@ 2019-04-12 12:20           ` HiPhish
  0 siblings, 0 replies; 7+ messages in thread
From: HiPhish @ 2019-04-12 12:20 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix

On Friday, 12 April 2019 11:11:31 CEST Ricardo Wurmus wrote:
> HiPhish <hiphish@posteo.de> writes:
> 
> You shouldn’t set this one.  If you’re concerned about GCC not finding
> libraries you should use LIBRARY_PATH, not LD_LIBRARY_PATH.
> 
> When installing gcc-toolchain, however, CPATH and LIBRARY_PATH should be
> set automatically.
> 
> Generally, the search path variables are set automatically when an
> installed package declares a search path.
> 
> GUIX_LOCPATH, SSL_CERT_DIR, SSL_CERT_FILE, and GIT_SSL_CAINFO are not
> search paths and are thus not set automatically.

Thank you, installing gcc-toolchain did the trick for C libraries. I was using 
the GCC that cam with my distro, but I might as well use GCC from Guix now. 
That still leaves $XDG_DATA_DIRS open, there is probably another package that 
I would have to install.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-04-12 12:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-11 17:06 Guix and $XDG_DATA_DIRS HiPhish
2019-04-11 17:58 ` Luther Thompson
2019-04-11 18:56   ` HiPhish
2019-04-11 23:04     ` Luther Thompson
2019-04-12  6:11       ` HiPhish
2019-04-12  9:11         ` Ricardo Wurmus
2019-04-12 12:20           ` HiPhish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).