unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Use GUIX installed packages / libraries in Guile
@ 2019-01-12 12:18 Zelphir Kaltstahl
  2019-01-12 12:49 ` swedebugia
  2019-01-12 16:29 ` Catonano
  0 siblings, 2 replies; 7+ messages in thread
From: Zelphir Kaltstahl @ 2019-01-12 12:18 UTC (permalink / raw)
  To: Guile User

Hi,

A while ago I installed Guix, initially only to be able to install
GNUTLS, to be able to make HTTPS requests with the standard library's
web client procedures http-get and similar.

Now I have Guix and I installed GNUTLS, but Guile does not know where it
is to find GNUTLS. For example the following code will tell me that
GNUTLS is required:

~~~
(use-modules (web client)
             #;(ice-9 receive))

(call-with-values
    (lambda ()
      (http-get "https://duckduckgo.com"
                #:port (open-socket-for-uri "https://duckduckgo.com")
                #:version '(1 . 1)
                #:keep-alive? #f
                #:headers '()
                #:decode-body? #t
                #:streaming? #f))
  (lambda (response response-text)
    (display response)
    (display response-text)))
~~~

Output:

~~~
(… some backtrace here …)

web/client.scm:105:2: In procedure tls-wrap:
Throw to key `gnutls-not-available' with args `("(gnutls) module not available")'.
~~~

I located something at:

/gnu/store/z0g1wsiw2n5d1hspbj7xkhj6vnc2qlvp-gnutls-3.5.18/share/guile/site/2.2/gnutls.scm

Also I found:

~~~
ll /gnu/store/ | grep gnutls
-r--r--r--   2 root root           735 Jan  1  1970 259dacgq58awd2l8zq7i2p16l7j6a283-gnutls-3.5.18.tar.xz.drv
-r--r--r--   2 root root          2834 Jan  1  1970 7iajc4kiddris32jdkfn28gykvs25g1w-gnutls-3.5.18.tar.xz-builder
-r--r--r--   2 root root          3656 Jan  1  1970 csji08kzw1rswy13jm7xk7f0rp130d55-gnutls-3.5.18.drv
-r--r--r--   2 root root          1315 Jan  1  1970 ivyr33ppfcwkdmkyhk1p6ky7mijanhjj-gnutls-3.5.18.tar.xz.drv
-r--r--r--   2 root root          4414 Jan  1  1970 kd0x57fwwvqqx8jircvs4bcawxskqzmh-gnutls-3.5.18-guile-builder
-r--r--r--   4 root root           579 Jan  1  1970 l8ap56kw9nan13lkgrg8v8ayzfrn2gc5-gnutls-skip-trust-store-test.patch
-r--r--r--   4 root root          1008 Jan  1  1970 sfg2p3l0363yk3s7hrzs1032fl0dga64-gnutls-skip-pkgconfig-test.patch
~~~

For this and other libraries: How do I make Guile automatically use
libraries installed through Guix?


Here is some more technical detail:

- I am using a Xubuntu 18.04 (lsb_release -d: Description:    Ubuntu
18.04.1 LTS)
- Guile version: 2.2.4
- Guix version: 0.16.0 (installed binary distribution using the install
script from the website)
- I have the following in my ~/.bashrc related to Guile and Guix:

~~~
# Guile Scheme Load Path
export GUILE_LOAD_PATH=/home/xiaolong/development/Guile/libs  # (this is where I put manually built and installed libraries)
# GNU GUIX locales
export GUIX_LOCPATH="${HOME}/.guix-profile/lib/locale"
export PATH="${HOME}/.guix-profile/bin${PATH:+:}$PATH"
~~~

- I have the following in my ~/.profile relating to Guile / Guix:

~~~
# changes for GNU GUIX
export GUIX_PROFILE="$HOME/.guix-profile"
source "$GUIX_PROFILE/etc/profile"
export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"
export LC_ALL="en_US.UTF-8"
~~~

Regards,

Zelphir



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

* Re: Use GUIX installed packages / libraries in Guile
  2019-01-12 12:18 Use GUIX installed packages / libraries in Guile Zelphir Kaltstahl
@ 2019-01-12 12:49 ` swedebugia
  2019-01-12 16:19   ` Zelphir Kaltstahl
  2019-01-12 16:29 ` Catonano
  1 sibling, 1 reply; 7+ messages in thread
From: swedebugia @ 2019-01-12 12:49 UTC (permalink / raw)
  To: Zelphir Kaltstahl, Guile User

[-- Attachment #1: Type: text/plain, Size: 3165 bytes --]

   Zelphir Kaltstahl <zelphirkaltstahl@gmail.com> skrev: (12 januari 2019
   13:18:49 CET)

Hi,
A while ago I installed Guix, initially only to be able to install
GNUTLS, to be able to make HTTPS requests with the standard library's
web client procedures http-get and similar.
Now I have Guix and I installed GNUTLS, but Guile does not know where it
is to find GNUTLS. For example the following code will tell me that
GNUTLS is required:
~~~
(use-modules (web client)
             #;(ice-9 receive))
(call-with-values
    (lambda ()
      (http-get "https://duckduckgo.com"
                #:port (open-socket-for-uri "https://duckduckgo.com")
                #:version '(1 . 1)
                #:keep-alive? #f
                #:headers '()
                #:decode-body? #t
                #:streaming? #f))
  (lambda (response response-text)
    (display response)
    (display response-text)))
~~~
Output:
~~~
(aEUR| some backtrace here aEUR|)
web/client.scm:105:2: In procedure tls-wrap:
Throw to key `gnutls-not-available' with args `("(gnutls) module not available")
'.
~~~
I located something at:
/gnu/store/z0g1wsiw2n5d1hspbj7xkhj6vnc2qlvp-gnutls-3.5.18/share/guile/site/2.2/g
nutls.scm
Also I found:
~~~
ll /gnu/store/ | grep gnutls
-r--r--r--   2 root root           735 Jan  1  1970 259dacgq58awd2l8zq7i2p16l7j6
a283-gnutls-3.5.18.tar.xz.drv
-r--r--r--   2 root root          2834 Jan  1  1970 7iajc4kiddris32jdkfn28gykvs2
5g1w-gnutls-3.5.18.tar.xz-builder
-r--r--r--   2 root root          3656 Jan  1  1970 csji08kzw1rswy13jm7xk7f0rp13
0d55-gnutls-3.5.18.drv
-r--r--r--   2 root root          1315 Jan  1  1970 ivyr33ppfcwkdmkyhk1p6ky7mija
nhjj-gnutls-3.5.18.tar.xz.drv
-r--r--r--   2 root root          4414 Jan  1  1970 kd0x57fwwvqqx8jircvs4bcawxsk
qzmh-gnutls-3.5.18-guile-builder
-r--r--r--   4 root root           579 Jan  1  1970 l8ap56kw9nan13lkgrg8v8ayzfrn
2gc5-gnutls-skip-trust-store-test.patch
-r--r--r--   4 root root          1008 Jan  1  1970 sfg2p3l0363yk3s7hrzs1032fl0d
ga64-gnutls-skip-pkgconfig-test.patch
~~~
For this and other libraries: How do I make Guile automatically use
libraries installed through Guix?
Here is some more technical detail:
- I am using a Xubuntu 18.04 (lsb_release -d: Description:    Ubuntu
18.04.1 LTS)
- Guile version: 2.2.4
- Guix version: 0.16.0 (installed binary distribution using the install
script from the website)
- I have the following in my ~/.bashrc related to Guile and Guix:
~~~
# Guile Scheme Load Path
export GUILE_LOAD_PATH=/home/xiaolong/development/Guile/libs  # (this is where I
 put manually built and installed libraries)
# GNU GUIX locales
export GUIX_LOCPATH="${HOME}/.guix-profile/lib/locale"
export PATH="${HOME}/.guix-profile/bin${PATH:+:}$PATH"
~~~
- I have the following in my ~/.profile relating to Guile / Guix:
~~~
# changes for GNU GUIX
export GUIX_PROFILE="$HOME/.guix-profile"
source "$GUIX_PROFILE/etc/profile"
export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"
export LC_ALL="en_US.UTF-8"
~~~
Regards,
Zelphir

   Your path is probably wrong.
   Try installing guile in your profile and guix will tell you which path
   to set.
   --
   Sent from my pa 0/00!p for Android.

[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 3825 bytes --]

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

* Re: Use GUIX installed packages / libraries in Guile
  2019-01-12 12:49 ` swedebugia
@ 2019-01-12 16:19   ` Zelphir Kaltstahl
  2019-01-12 16:52     ` Catonano
  0 siblings, 1 reply; 7+ messages in thread
From: Zelphir Kaltstahl @ 2019-01-12 16:19 UTC (permalink / raw)
  To: swedebugia, Guile User

On 1/12/19 1:49 PM, swedebugia wrote:
> Zelphir Kaltstahl <zelphirkaltstahl@gmail.com> skrev: (12 januari 2019
> 13:18:49 CET)
>
>     Hi,
>
>     A while ago I installed Guix, initially only to be able to install
>     GNUTLS, to be able to make HTTPS requests with the standard library's
>     web client procedures http-get and similar.
>
>     Now I have Guix and I installed GNUTLS, but Guile does not know where it
>     is to find GNUTLS. For example the following code will tell me that
>     GNUTLS is required:
>
>     ~~~
>     (use-modules (web client)
>                  #;(ice-9 receive))
>
>     (call-with-values
>         (lambda ()
>           (http-get "https://duckduckgo.com"
>                     #:port (open-socket-for-uri "https://duckduckgo.com")
>                     #:version '(1 . 1)
>                     #:keep-alive? #f
>                     #:headers '()
>                     #:decode-body? #t
>                     #:streaming? #f))
>       (lambda (response response-text)
>         (display response)
>         (display response-text)))
>     ~~~
>
>     Output:
>
>     ~~~
>     (… some backtrace here …)
>
>     web/client.scm:105:2: In procedure tls-wrap:
>     Throw to key `gnutls-not-available' with args `("(gnutls) module not available")'.
>     ~~~
>
>     I located something at:
>
>     /gnu/store/z0g1wsiw2n5d1hspbj7xkhj6vnc2qlvp-gnutls-3.5.18/share/guile/site/2.2/gnutls.scm
>
>     Also I found:
>
>     ~~~
>     ll /gnu/store/ | grep gnutls
>     -r--r--r--   2 root root           735 Jan  1  1970 259dacgq58awd2l8zq7i2p16l7j6a283-gnutls-3.5.18.tar.xz.drv
>     -r--r--r--   2 root root          2834 Jan  1  1970 7iajc4kiddris32jdkfn28gykvs25g1w-gnutls-3.5.18.tar.xz-builder
>     -r--r--r--   2 root root          3656 Jan  1  1970 csji08kzw1rswy13jm7xk7f0rp130d55-gnutls-3.5.18.drv
>     -r--r--r--   2 root root          1315 Jan  1  1970 ivyr33ppfcwkdmkyhk1p6ky7mijanhjj-gnutls-3.5.18.tar.xz.drv
>     -r--r--r--   2 root root          4414 Jan  1  1970 kd0x57fwwvqqx8jircvs4bcawxskqzmh-gnutls-3.5.18-guile-builder
>     -r--r--r--   4 root root           579 Jan  1  1970 l8ap56kw9nan13lkgrg8v8ayzfrn2gc5-gnutls-skip-trust-store-test.patch
>     -r--r--r--   4 root root          1008 Jan  1  1970 sfg2p3l0363yk3s7hrzs1032fl0dga64-gnutls-skip-pkgconfig-test.patch
>     ~~~
>
>     For this and other libraries: How do I make Guile automatically use
>     libraries installed through Guix?
>
>
>     Here is some more technical detail:
>
>     - I am using a Xubuntu 18.04 (lsb_release -d: Description:    Ubuntu
>     18.04.1 LTS)
>     - Guile version: 2.2.4
>     - Guix version: 0.16.0 (installed binary distribution using the install
>     script from the website)
>     - I have the following in my ~/.bashrc related to Guile and Guix:
>
>     ~~~
>     # Guile Scheme Load Path
>     export GUILE_LOAD_PATH=/home/xiaolong/development/Guile/libs  # (this is where I put manually built and installed libraries)
>     # GNU GUIX locales
>     export GUIX_LOCPATH="${HOME}/.guix-profile/lib/locale"
>     export PATH="${HOME}/.guix-profile/bin${PATH:+:}$PATH"
>     ~~~
>
>     - I have the following in my ~/.profile relating to Guile / Guix:
>
>     ~~~
>     # changes for GNU GUIX
>     export GUIX_PROFILE="$HOME/.guix-profile"
>     source "$GUIX_PROFILE/etc/profile"
>     export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"
>     export LC_ALL="en_US.UTF-8"
>     ~~~
>
>     Regards,
>
>     Zelphir
>
>
> Your path is probably wrong.
> Try installing guile in your profile and guix will tell you which path
> to set.
> -- 
> Sent from my p≡p for Android.


Hey,

Thanks for your quick response. I have a few questions:

* What do you mean by "install it in your profile"? Do you mean I should
add the lines for Guile in my ~/.profile?

* How or where does Guix tell me which path I have to set? I moved the
Guile stuff to my ~/.profile and ran a few Guix commands (install a
package, upgrade packages, pull), but it did not mention anything about
my path.

Thanks for you help,

Zelphir



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

* Re: Use GUIX installed packages / libraries in Guile
  2019-01-12 12:18 Use GUIX installed packages / libraries in Guile Zelphir Kaltstahl
  2019-01-12 12:49 ` swedebugia
@ 2019-01-12 16:29 ` Catonano
  1 sibling, 0 replies; 7+ messages in thread
From: Catonano @ 2019-01-12 16:29 UTC (permalink / raw)
  To: Zelphir Kaltstahl; +Cc: Guile User

Il giorno sab 12 gen 2019 alle ore 13:27 Zelphir Kaltstahl <
zelphirkaltstahl@gmail.com> ha scritto:

> Hi,
>
> A while ago I installed Guix, initially only to be able to install
>

Hi Zelphir,

you would probably post your question on the guix help mailing list,
because this has more to do with Guix than with Guile

That said, I happened to have your exact same need: a build of Gnutls that
carried the Guile bindings. The Gnutls provided by Debian and Ubuntu don't

I am on Ubuntu 18.04.1 too

So I built Gnutls myself

This initiative was successful. In fact I have managed to build Guix and to
use guile-hall (it uses https to download some bits)

That's a path you could go through

If you are interested in this option, there are a couple of threads I
opened on the Gnutls-help mailing list

First:
https://lists.gnutls.org/pipermail/gnutls-help/2019-January/004473.html

Second (this second thread contains the exact call to the configure script
that I used):
https://lists.gnutls.org/pipermail/gnutls-help/2019-January/004477.html

As for allowing Guile to find the right version of Gnutls, on Ubunt setting
the LD_LIBRARY_PATH in your environment won't do (usually setting it in
your ~/.bashrc file or your ~/.profile file)

You have to put a file in /etc/ld.so.conf.d containing the path to your
custom lib directory

I put a /etc/ld.so.conf.d/nettle.conf file containing:
/home/catonano/opt/lib

I called such file nettle.conf" because Nettle is a dependency for Gnutls
but the one provided by Ubuntu is a bit too old, so I built Nettle 3.4.1
too, before building Gnutls of course

It may seem cluncky and laboroius, but it works !

I hope this helps !


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

* Re: Use GUIX installed packages / libraries in Guile
  2019-01-12 16:19   ` Zelphir Kaltstahl
@ 2019-01-12 16:52     ` Catonano
  2019-01-13 23:56       ` Zelphir Kaltstahl
  0 siblings, 1 reply; 7+ messages in thread
From: Catonano @ 2019-01-12 16:52 UTC (permalink / raw)
  To: Zelphir Kaltstahl; +Cc: Guile User

Il giorno sab 12 gen 2019 alle ore 17:20 Zelphir Kaltstahl <
zelphirkaltstahl@gmail.com> ha scritto:

> On 1/12/19 1:49 PM, swedebugia wrote:
> > Zelphir Kaltstahl <zelphirkaltstahl@gmail.com> skrev: (12 januari 2019
> > 13:18:49 CET)
> >
> >     Hi,
> >
> >     A while ago I installed Guix, initially only to be able to install
> >     GNUTLS, to be able to make HTTPS requests with the standard library's
> >     web client procedures http-get and similar.
> >
> >     Now I have Guix and I installed GNUTLS, but Guile does not know
> where it
> >     is to find GNUTLS. For example the following code will tell me that
> >     GNUTLS is required:
> >
> >     ~~~
> >     (use-modules (web client)
> >                  #;(ice-9 receive))
> >
> >     (call-with-values
> >         (lambda ()
> >           (http-get "https://duckduckgo.com"
> >                     #:port (open-socket-for-uri "https://duckduckgo.com
> ")
> >                     #:version '(1 . 1)
> >                     #:keep-alive? #f
> >                     #:headers '()
> >                     #:decode-body? #t
> >                     #:streaming? #f))
> >       (lambda (response response-text)
> >         (display response)
> >         (display response-text)))
> >     ~~~
> >
> >     Output:
> >
> >     ~~~
> >     (… some backtrace here …)
> >
> >     web/client.scm:105:2: In procedure tls-wrap:
> >     Throw to key `gnutls-not-available' with args `("(gnutls) module not
> available")'.
> >     ~~~
> >
> >     I located something at:
> >
> >
>  /gnu/store/z0g1wsiw2n5d1hspbj7xkhj6vnc2qlvp-gnutls-3.5.18/share/guile/site/2.2/gnutls.scm
> >
> >     Also I found:
> >
> >     ~~~
> >     ll /gnu/store/ | grep gnutls
> >     -r--r--r--   2 root root           735 Jan  1  1970
> 259dacgq58awd2l8zq7i2p16l7j6a283-gnutls-3.5.18.tar.xz.drv
> >     -r--r--r--   2 root root          2834 Jan  1  1970
> 7iajc4kiddris32jdkfn28gykvs25g1w-gnutls-3.5.18.tar.xz-builder
> >     -r--r--r--   2 root root          3656 Jan  1  1970
> csji08kzw1rswy13jm7xk7f0rp130d55-gnutls-3.5.18.drv
> >     -r--r--r--   2 root root          1315 Jan  1  1970
> ivyr33ppfcwkdmkyhk1p6ky7mijanhjj-gnutls-3.5.18.tar.xz.drv
> >     -r--r--r--   2 root root          4414 Jan  1  1970
> kd0x57fwwvqqx8jircvs4bcawxskqzmh-gnutls-3.5.18-guile-builder
> >     -r--r--r--   4 root root           579 Jan  1  1970
> l8ap56kw9nan13lkgrg8v8ayzfrn2gc5-gnutls-skip-trust-store-test.patch
> >     -r--r--r--   4 root root          1008 Jan  1  1970
> sfg2p3l0363yk3s7hrzs1032fl0dga64-gnutls-skip-pkgconfig-test.patch
> >     ~~~
> >
> >     For this and other libraries: How do I make Guile automatically use
> >     libraries installed through Guix?
> >
> >
> >     Here is some more technical detail:
> >
> >     - I am using a Xubuntu 18.04 (lsb_release -d: Description:    Ubuntu
> >     18.04.1 LTS)
> >     - Guile version: 2.2.4
> >     - Guix version: 0.16.0 (installed binary distribution using the
> install
> >     script from the website)
> >     - I have the following in my ~/.bashrc related to Guile and Guix:
> >
> >     ~~~
> >     # Guile Scheme Load Path
> >     export GUILE_LOAD_PATH=/home/xiaolong/development/Guile/libs  #
> (this is where I put manually built and installed libraries)
> >     # GNU GUIX locales
> >     export GUIX_LOCPATH="${HOME}/.guix-profile/lib/locale"
> >     export PATH="${HOME}/.guix-profile/bin${PATH:+:}$PATH"
> >     ~~~
> >
> >     - I have the following in my ~/.profile relating to Guile / Guix:
> >
> >     ~~~
> >     # changes for GNU GUIX
> >     export GUIX_PROFILE="$HOME/.guix-profile"
> >     source "$GUIX_PROFILE/etc/profile"
> >     export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"
> >     export LC_ALL="en_US.UTF-8"
> >     ~~~
> >
> >     Regards,
> >
> >     Zelphir
> >
> >
> > Your path is probably wrong.
> > Try installing guile in your profile and guix will tell you which path
> > to set.
> > --
> > Sent from my p≡p for Android.
>
>
> Hey,
>
> Thanks for your quick response. I have a few questions:
>
> * What do you mean by "install it in your profile"? Do you mean I should
> add the lines for Guile in my ~/.profile?
>


Disclaimer: I'm not sure how things go on Guix (without the final SD) and I
haven't been using Guix for some time now so I don't remember well

In GuixSD (please notice the final SD) the user profile and the root
profile are distinct
I don't remember if they are distinct in Guix too

But when I used GuixSD I experienced this fact: Guile libraries installed
in your user profile were not accessible to the Guix root profile Guile. I
had to install Guile in my user profile along with some Guile based
packages.

If you installed Gnutls in your user profile (that is, if you installed
gnutls with the line: "guix package -i gnutls" as a normal user) then the
Guile in the Guix root profile may be not able to acces your gnutls
installation

So, I guess Swedebugia means installing Guile through Guix, along with
Gnutls

Like this:

guix package -i guile

If you don't do this, it's possible that you are using the Guile provided
by Ubuntu

Or that you are using the Guile provided by the Guix root profile (again: I
don't remember if this distinction applies to Guix too)

In fact I'm inclined to think this is what is happening because you
reported that you are using Guile 2.2.4 but I'm pretty sure that the Guile
in Ubuntu is Guile 2.2.3.
I know because I am using that one, I haven't got Guix on my machine

Was that helpful ?


> * How or where does Guix tell me which path I have to set? I moved the
> Guile stuff to my ~/.profile and ran a few Guix commands (install a
> package, upgrade packages, pull), but it did not mention anything about
> my path.
>

I haven't been using Guix for a while now so I'll pass on this one

But please consider asking these questions on the guix-help mailing list !


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

* Re: Use GUIX installed packages / libraries in Guile
       [not found] <CAABPU6-p+T0dWrX5gFdUdhD_oyQf=e3T9uO_8_LZfOOZM6kDhg@mail.gmail.com>
@ 2019-01-13 23:52 ` Zelphir Kaltstahl
  0 siblings, 0 replies; 7+ messages in thread
From: Zelphir Kaltstahl @ 2019-01-13 23:52 UTC (permalink / raw)
  To: daniel szmulewicz; +Cc: Guile User

Hello,

On 1/12/19 7:58 PM, daniel szmulewicz wrote:
> > >     A while ago I installed Guix, initially only to be able to install
> > >     GNUTLS, to be able to make HTTPS requests with the standard
> library's
> > >     web client procedures http-get and similar.
>
> I did the same last week, and for the same reason. It worked out of
> the box. Other people have given you good recommendations, I just
> wanted to chime in in order to confirm that what you tried to do makes
> sense. I'd just make sure to install guile with guix first.
>
> guix package -i guile
> guix package -i gnutls
>
> Daniel

Thank you Daniel!

I did install Guile by building it manually, so I dared an experiment
following your advice and installed it in Guix, simply hoping for the
best: "everything to simply work magically" :D

When installing Guile using Guix, it then printed some recommendation of
what to put in my ~/.profile. This is probably what swedebugia meant,
only that I did not get it at first, because I did not install Guile via
Guix and cannot remember having installed any Guix packages with
environment variable hints after installation being shown before
installing Guix.

Then I fumbled around with my ~/.bashrc and ~/.profile, and in the end
everything was in ~/.profile. Here is the result, in case anyone needs it:

~~~ my ~/.profile:

# ============
# GUIX & GUILE
# ============

# GUIX profile
# (1. Why is this needed? 2. What is it needed for?)
export GUIX_PROFILE="$HOME/.guix-profile"
source "$GUIX_PROFILE/etc/profile"

# Set the locales path, so that Guix can find the locales.
export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"

# Add directory of Guix to path, so that we can use Guix.
export PATH="${GUIX_PROFILE}/bin${PATH:+:}$PATH"¬

# Guile load path
# The load path points to where Guix installs packages.
export GUILE_LOAD_PATH="${HOME}/.guix-profile/share/guile/site/2.2${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"

# The load compiled path points to where compiled libraries, installed by Guix, are.
export GUILE_LOAD_COMPILED_PATH="${HOME}/.guix-profile/lib/guile/2.2/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"

# This might be required by guile-colorized, according to post-installation information displayed by Guix.
export TERMINFO_DIRS="${HOME}/.guix-profile/share/terminfo${TERMINFO_DIRS:+:}$TERMINFO_DIRS"

# ======
# LOCALE
# ======
# change locale to US English
export LC_ALL="en_US.UTF-8"

~~~

This, followed by a:

source ~/.profile

Did the trick!

Then I installed readline (maybe unnecessary, only did it because I
forgot to type guile- in front of it), guile-readline and, because my
guile would complain about not finding any code for colorized,
guile-colorized and voilá, my Guile works just like before. However, the
most important question was, whether it would pick up GNUTLS, which is
also installed via Guix … So I went into my example code directory and
tried running that code:

~~~ requests with https example code:

(use-modules (web client)
             #;(ice-9 receive))

(call-with-values
    (lambda ()
      (http-get "https://duckduckgo.com"
                #:port (open-socket-for-uri "https://duckduckgo.com")
                #:version '(1 . 1)
                #:keep-alive? #f
                #:headers '()
                #:decode-body? #t
                #:streaming? #f))
  (lambda (response response-text)
    (display response)
    (display response-text)))

~~~

And that worked as well! This is great! Now I can use GNUTLS it seems!

If this had not worked I would have written on the Guix list as was
suggested. Initially I was not sure which list would be best, Guile or
Guix and decided to go for the Guile list, as I already wrote there
before and had good experience. After this problem being solved, it is
also clear to me, that it would have been better on the Guix help list.
Sorry for that!

I want to relate to what Catonano wrote as well, as I read their mail:

> […] So I built Gnutls myself. […]

This is what someone else also mentioned here on the Guile user list
before, but which I wanted to avoid, because I don't want to keep
security relevant libraries up to date manually.

> […] there are a couple of threads I opened on the Gnutls-help mailing
list […]

Not sure I was aware of there being a mailing list specifically for
Gnutls, good to know!

> […] You have to put a file in /etc/ld.so.conf.d containing the path to
your custom lib directory […]

When I read that, I felt uncomfortable, because I would add something
somewhere, that I do not understand currently how it works. Maybe this
would have worked too, but I am quite happy that everything works
currently afaik, so I would rather not risk anything to try.

Thanks everyone for your help and advice!

Regards,

Zelphir



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

* Re: Use GUIX installed packages / libraries in Guile
  2019-01-12 16:52     ` Catonano
@ 2019-01-13 23:56       ` Zelphir Kaltstahl
  0 siblings, 0 replies; 7+ messages in thread
From: Zelphir Kaltstahl @ 2019-01-13 23:56 UTC (permalink / raw)
  To: Catonano; +Cc: Guile User


On 1/12/19 5:52 PM, Catonano wrote:
>
>
> Il giorno sab 12 gen 2019 alle ore 17:20 Zelphir Kaltstahl
> <zelphirkaltstahl@gmail.com <mailto:zelphirkaltstahl@gmail.com>> ha
> scritto:
>
>     On 1/12/19 1:49 PM, swedebugia wrote:
>     > Zelphir Kaltstahl <zelphirkaltstahl@gmail.com
>     <mailto:zelphirkaltstahl@gmail.com>> skrev: (12 januari 2019
>     > 13:18:49 CET)
>     >
>     >     Hi,
>     >
>     >     A while ago I installed Guix, initially only to be able to
>     install
>     >     GNUTLS, to be able to make HTTPS requests with the standard
>     library's
>     >     web client procedures http-get and similar.
>     >
>     >     Now I have Guix and I installed GNUTLS, but Guile does not
>     know where it
>     >     is to find GNUTLS. For example the following code will tell
>     me that
>     >     GNUTLS is required:
>     >
>     >     ~~~
>     >     (use-modules (web client)
>     >                  #;(ice-9 receive))
>     >
>     >     (call-with-values
>     >         (lambda ()
>     >           (http-get "https://duckduckgo.com"
>     >                     #:port (open-socket-for-uri
>     "https://duckduckgo.com")
>     >                     #:version '(1 . 1)
>     >                     #:keep-alive? #f
>     >                     #:headers '()
>     >                     #:decode-body? #t
>     >                     #:streaming? #f))
>     >       (lambda (response response-text)
>     >         (display response)
>     >         (display response-text)))
>     >     ~~~
>     >
>     >     Output:
>     >
>     >     ~~~
>     >     (… some backtrace here …)
>     >
>     >     web/client.scm:105:2: In procedure tls-wrap:
>     >     Throw to key `gnutls-not-available' with args `("(gnutls)
>     module not available")'.
>     >     ~~~
>     >
>     >     I located something at:
>     >
>     >   
>      /gnu/store/z0g1wsiw2n5d1hspbj7xkhj6vnc2qlvp-gnutls-3.5.18/share/guile/site/2.2/gnutls.scm
>     >
>     >     Also I found:
>     >
>     >     ~~~
>     >     ll /gnu/store/ | grep gnutls
>     >     -r--r--r--   2 root root           735 Jan  1  1970
>     259dacgq58awd2l8zq7i2p16l7j6a283-gnutls-3.5.18.tar.xz.drv
>     >     -r--r--r--   2 root root          2834 Jan  1  1970
>     7iajc4kiddris32jdkfn28gykvs25g1w-gnutls-3.5.18.tar.xz-builder
>     >     -r--r--r--   2 root root          3656 Jan  1  1970
>     csji08kzw1rswy13jm7xk7f0rp130d55-gnutls-3.5.18.drv
>     >     -r--r--r--   2 root root          1315 Jan  1  1970
>     ivyr33ppfcwkdmkyhk1p6ky7mijanhjj-gnutls-3.5.18.tar.xz.drv
>     >     -r--r--r--   2 root root          4414 Jan  1  1970
>     kd0x57fwwvqqx8jircvs4bcawxskqzmh-gnutls-3.5.18-guile-builder
>     >     -r--r--r--   4 root root           579 Jan  1  1970
>     l8ap56kw9nan13lkgrg8v8ayzfrn2gc5-gnutls-skip-trust-store-test.patch
>     >     -r--r--r--   4 root root          1008 Jan  1  1970
>     sfg2p3l0363yk3s7hrzs1032fl0dga64-gnutls-skip-pkgconfig-test.patch
>     >     ~~~
>     >
>     >     For this and other libraries: How do I make Guile
>     automatically use
>     >     libraries installed through Guix?
>     >
>     >
>     >     Here is some more technical detail:
>     >
>     >     - I am using a Xubuntu 18.04 (lsb_release -d:
>     Description:    Ubuntu
>     >     18.04.1 LTS)
>     >     - Guile version: 2.2.4
>     >     - Guix version: 0.16.0 (installed binary distribution using
>     the install
>     >     script from the website)
>     >     - I have the following in my ~/.bashrc related to Guile and
>     Guix:
>     >
>     >     ~~~
>     >     # Guile Scheme Load Path
>     >     export
>     GUILE_LOAD_PATH=/home/xiaolong/development/Guile/libs  # (this is
>     where I put manually built and installed libraries)
>     >     # GNU GUIX locales
>     >     export GUIX_LOCPATH="${HOME}/.guix-profile/lib/locale"
>     >     export PATH="${HOME}/.guix-profile/bin${PATH:+:}$PATH"
>     >     ~~~
>     >
>     >     - I have the following in my ~/.profile relating to Guile /
>     Guix:
>     >
>     >     ~~~
>     >     # changes for GNU GUIX
>     >     export GUIX_PROFILE="$HOME/.guix-profile"
>     >     source "$GUIX_PROFILE/etc/profile"
>     >     export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"
>     >     export LC_ALL="en_US.UTF-8"
>     >     ~~~
>     >
>     >     Regards,
>     >
>     >     Zelphir
>     >
>     >
>     > Your path is probably wrong.
>     > Try installing guile in your profile and guix will tell you
>     which path
>     > to set.
>     > --
>     > Sent from my p≡p for Android.
>
>
>     Hey,
>
>     Thanks for your quick response. I have a few questions:
>
>     * What do you mean by "install it in your profile"? Do you mean I
>     should
>     add the lines for Guile in my ~/.profile?
>
>
>
> Disclaimer: I'm not sure how things go on Guix (without the final SD)
> and I haven't been using Guix for some time now so I don't remember well
>
> In GuixSD (please notice the final SD) the user profile and the root
> profile are distinct
> I don't remember if they are distinct in Guix too
Not sure either, but so far I've only noticed one environment / profile
/ thingy that my Guix (not on GuixSD but Xubuntu) uses. If there is a
root profile, I am not aware of it.
>
> But when I used GuixSD I experienced this fact: Guile libraries
> installed in your user profile were not accessible to the Guix root
> profile Guile. I had to install Guile in my user profile along with
> some Guile based packages.
>
> If you installed Gnutls in your user profile (that is, if you
> installed gnutls with the line: "guix package -i gnutls" as a normal
> user) then the Guile in the Guix root profile may be not able to acces
> your gnutls installation
>
> So, I guess Swedebugia means installing Guile through Guix, along with
> Gnutls
Yes, thanks for that clarification!
>
> Like this:
>
> guix package -i guile
>
> If you don't do this, it's possible that you are using the Guile
> provided by Ubuntu
I was using the manually built one, git clone + the usual configure,
make, make install build process.
>
> Or that you are using the Guile provided by the Guix root profile
> (again: I don't remember if this distinction applies to Guix too)
>
> In fact I'm inclined to think this is what is happening because you
> reported that you are using Guile 2.2.4 but I'm pretty sure that the
> Guile in Ubuntu is Guile 2.2.3.
> I know because I am using that one, I haven't got Guix on my machine
>
> Was that helpful ?
Yep, thanks, a few things cleared up.
>
>
>     * How or where does Guix tell me which path I have to set? I moved the
>     Guile stuff to my ~/.profile and ran a few Guix commands (install a
>     package, upgrade packages, pull), but it did not mention anything
>     about
>     my path.
>
>
> I haven't been using Guix for a while now so I'll pass on this one
>
> But please consider asking these questions on the guix-help mailing list !
Yep, next time with such case will do : )


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

end of thread, other threads:[~2019-01-13 23:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-12 12:18 Use GUIX installed packages / libraries in Guile Zelphir Kaltstahl
2019-01-12 12:49 ` swedebugia
2019-01-12 16:19   ` Zelphir Kaltstahl
2019-01-12 16:52     ` Catonano
2019-01-13 23:56       ` Zelphir Kaltstahl
2019-01-12 16:29 ` Catonano
     [not found] <CAABPU6-p+T0dWrX5gFdUdhD_oyQf=e3T9uO_8_LZfOOZM6kDhg@mail.gmail.com>
2019-01-13 23:52 ` Zelphir Kaltstahl

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).