unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* SLIB and ice-9 slib module
@ 2008-03-18 23:30 Sebastian Tennant
  2008-03-27  8:26 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Tennant @ 2008-03-18 23:30 UTC (permalink / raw)
  To: guile-user

Hi all,

A Debian box with an apt-installed guile-1.8:

 /usr/share/guile/1.8

An apt-installed slib:

 /usr/share/slib

Created symlink:

 /usr/share/guile/1.8/slib -> /usr/share/slib

Set environment variables:

 export GUILE_IMPLEMENTATION_PATH="/usr/share/guile/1.8/"
 export SCHEME_LIBRARY_PATH="/usr/share/slib/" 

(also tried not setting SCHEME_LIBRARY_PATH, and setting it to
 /usr/share/guile/1.8/slib)

but I get this every time:

 guile> (use-modules (ice-9 slib))
 ERROR: Unbound variable: slib:features
 ABORT: (unbound-variable)

SLIB works fine with:

 $ slib guile

or

 $ guile -l /usr/share/slib/guile.init

Upon inspection, ice-9's documentation is wrong in saying:

 2. Define the `SCHEME_LIBRARY_PATH' environment variable:

          $ SCHEME_LIBRARY_PATH=/usr/local/lib/slib
          $ export SCHEME_LIBRARY_PATH

->   Alternatively, you can create a symlink in the Guile directory to
     SLIB, e.g.:

          ln -s /usr/local/lib/slib /usr/local/share/guile/1.8/slib

because the function slib-parent-dir (upon which slib's 'vicinities' are
based) searches the %load-path and uses substring, in which case only a
symlink will do.

 (define slib-parent-dir
   (let* ((path (%search-load-path "slib/require.scm")))
     (if path
         (substring path 0 (- (string-length path) 17))
         (error "Could not find slib/require.scm in " %load-path))))

Having said that, even with the symlink it still fails, so I give up.

Sebastian





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

* Re: SLIB and ice-9 slib module
  2008-03-18 23:30 SLIB and ice-9 slib module Sebastian Tennant
@ 2008-03-27  8:26 ` Ludovic Courtès
  2008-03-27 14:52   ` Sebastian Tennant
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2008-03-27  8:26 UTC (permalink / raw)
  To: guile-user

Hi,

Sorry for the delay...

Sebastian Tennant <sebyte@smolny.plus.com> writes:

> An apt-installed slib:
>
>  /usr/share/slib

IIRC, the layout of the Debian `slib' package does not match the layout
of an installed-from-source SLIB, which may explain why the symlink
trick doesn't work.

> Having said that, even with the symlink it still fails, so I give up.

The documentation available in Guile 1.8.3 or later also mentions that
you must create a catalog.

Thanks,
Ludovic.





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

* Re: SLIB and ice-9 slib module
  2008-03-27  8:26 ` Ludovic Courtès
@ 2008-03-27 14:52   ` Sebastian Tennant
  2008-03-30 16:06     ` Sebastian Tennant
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Tennant @ 2008-03-27 14:52 UTC (permalink / raw)
  To: guile-user

ludo@gnu.org (Ludovic Courtès) writes:
> Sorry for the delay...

No problem.  Thanks for your reply.

> Sebastian Tennant <sebyte@smolny.plus.com> writes:
>
>> An apt-installed slib:
>>
>>  /usr/share/slib
>
> IIRC, the layout of the Debian `slib' package does not match the layout
> of an installed-from-source SLIB, 

Indeed.  Debian installs SLIB under /usr/share/slib.

> which may explain why the symlink trick doesn't work.

>> Having said that, even with the symlink it still fails, so I give up.
>
> The documentation available in Guile 1.8.3 or later also mentions that
> you must create a catalog.

Previously noted.  If I start guile like so:

 $ slib guile
 guile> (require 'new-catalog)
 guile>

this creates the catalog in SLIB's implementation vicinity:

 /usr/share/guile/1.8/slibcat

but if I then run guile normally, I encounter the following error when
calling the (ice-9 slib) module:

 $ guile
 guile> (use-modules (ice-9 slib))
 ERROR: Unbound variable: slib:features
 ABORT: (unbound-variable)
 guile> 

I set the following variables in my .profile:

 # guile-lib, guile-www & guile-pg (when I get it to build)
 [ -d /usr/local/share/guile/site ] && \
     export GUILE_LOAD_PATH="/usr/local/share/guile/site"

 # SLIB's 'library-vicinity'
 [ -d /usr/share/slib ] && \
     export SCHEME_LIBRARY_PATH="/usr/share/slib/"

 # SLIB's 'implementation vicinity'
 [ -d /usr/share/guile/1.8 ] && \
     export GUILE_IMPLEMENTATION_PATH="/usr/share/guile/1.8/"

and /usr/share/guile/1.8/ looks like this:

 /usr/share/guile/1.8:
 total used in directory 308 available 2752472
 drwxr-xr-x 7 root root    116 Mar 27 14:22 .
 drwxr-xr-x 3 root root     16 Feb 28 23:59 ..
 -rw-r--r-- 1 root root 291463 Mar  5  2007 guile-procedures.txt
 drwxr-xr-x 3 root root   4096 Mar 18 23:25 ice-9
 drwxr-xr-x 3 root root     18 Feb 28 23:59 lang
 drwxr-xr-x 3 root root     34 Feb 28 23:59 oop
 drwxr-xr-x 2 root root   4096 Mar 15 20:14 scripts
 lrwxrwxrwx 1 root root     15 Mar 18 23:01 slib -> /usr/share/slib
 -rw-r--r-- 1 root root   7818 Mar 27 14:22 slibcat
 drwxr-xr-x 2 root root   4096 Mar 18 21:59 srfi


This is all just for your/the list's information really, given that
I'm using stock Debian versions of guile and slib.

I'm still able to use SLIB in scripts thanks to SLIB's guile.init:

 #!/usr/bin/guile \
 -l /usr/share/slib/guile.init -s
 !#

but

 (use-modules (ice-9 slib))

wouls be nice :-)

Seb





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

* Re: SLIB and ice-9 slib module
  2008-03-27 14:52   ` Sebastian Tennant
@ 2008-03-30 16:06     ` Sebastian Tennant
  2008-03-30 16:34       ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Tennant @ 2008-03-30 16:06 UTC (permalink / raw)
  To: guile-user

Sebastian Tennant <sebyte@smolny.plus.com> writes:
>  /usr/share/guile/1.8/ looks like this:
>
>  /usr/share/guile/1.8:
>  total used in directory 308 available 2752472
>  drwxr-xr-x 7 root root    116 Mar 27 14:22 .
>  drwxr-xr-x 3 root root     16 Feb 28 23:59 ..
>  -rw-r--r-- 1 root root 291463 Mar  5  2007 guile-procedures.txt
>  drwxr-xr-x 3 root root   4096 Mar 18 23:25 ice-9
>  drwxr-xr-x 3 root root     18 Feb 28 23:59 lang
>  drwxr-xr-x 3 root root     34 Feb 28 23:59 oop
>  drwxr-xr-x 2 root root   4096 Mar 15 20:14 scripts
>  lrwxrwxrwx 1 root root     15 Mar 18 23:01 slib -> /usr/share/slib
>  -rw-r--r-- 1 root root   7818 Mar 27 14:22 slibcat
>  drwxr-xr-x 2 root root   4096 Mar 18 21:59 srfi

I have since discovered that if the symbolic link is placed in
/usr/share/guile, and NOT a version directory then

 (use-modules (ice-9 slib))

works as intended.  (The catalog 'slibcat' _is_ created in the current
version directory).

The documentation reads:

  2. Define the `SCHEME_LIBRARY_PATH' environment variable:

          $ SCHEME_LIBRARY_PATH=/usr/local/lib/slib/
          $ export SCHEME_LIBRARY_PATH

     Alternatively, you can create a symlink in the Guile directory to
     SLIB, e.g.:

          ln -s /usr/local/lib/slib /usr/local/share/guile/1.8/slib

In my experience ONLY the symlink trick works, provided the
directory

 /usr/share/guile

is used, and not a version directory, such as

 /usr/share/guile/1.8

Setting SCHEME_LIBRARY_PATH doesn't seem to do anything.

Sebastian





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

* Re: SLIB and ice-9 slib module
  2008-03-30 16:06     ` Sebastian Tennant
@ 2008-03-30 16:34       ` Ludovic Courtès
  2008-03-30 17:54         ` Sebastian Tennant
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2008-03-30 16:34 UTC (permalink / raw)
  To: guile-user

Hi,

Sebastian Tennant <sebyte@smolny.plus.com> writes:

> The documentation reads:
>
>   2. Define the `SCHEME_LIBRARY_PATH' environment variable:
>
>           $ SCHEME_LIBRARY_PATH=/usr/local/lib/slib/
>           $ export SCHEME_LIBRARY_PATH
>
>      Alternatively, you can create a symlink in the Guile directory to
>      SLIB, e.g.:
>
>           ln -s /usr/local/lib/slib /usr/local/share/guile/1.8/slib
>
> In my experience ONLY the symlink trick works

The details escape me right now, but I remember that Debian's `slib'
package has a different layout than a "make install" with prefix=/usr of
upstream SLIB.  This may explain why the `SCHEME_LIBRARY_PATH' trick
didn't work.

Thanks,
Ludovic.





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

* Re: SLIB and ice-9 slib module
  2008-03-30 16:34       ` Ludovic Courtès
@ 2008-03-30 17:54         ` Sebastian Tennant
  0 siblings, 0 replies; 6+ messages in thread
From: Sebastian Tennant @ 2008-03-30 17:54 UTC (permalink / raw)
  To: guile-user

Quoth ludo@gnu.org (Ludovic Courtès):
> Hi,
>
> Sebastian Tennant <sebyte@smolny.plus.com> writes:
>
>> The documentation reads:
>>
>>   2. Define the `SCHEME_LIBRARY_PATH' environment variable:
>>
>>           $ SCHEME_LIBRARY_PATH=/usr/local/lib/slib/
>>           $ export SCHEME_LIBRARY_PATH
>>
>>      Alternatively, you can create a symlink in the Guile directory to
>>      SLIB, e.g.:
>>
>>           ln -s /usr/local/lib/slib /usr/local/share/guile/1.8/slib
>>
>> In my experience ONLY the symlink trick works
>
> The details escape me right now, but I remember that Debian's `slib'
> package has a different layout than a "make install" with prefix=/usr of
> upstream SLIB.

Sound like Debian :-)

> This may explain why the `SCHEME_LIBRARY_PATH' trick didn't work.

Fair enough.  Just trying to help.

Sebastian





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

end of thread, other threads:[~2008-03-30 17:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-18 23:30 SLIB and ice-9 slib module Sebastian Tennant
2008-03-27  8:26 ` Ludovic Courtès
2008-03-27 14:52   ` Sebastian Tennant
2008-03-30 16:06     ` Sebastian Tennant
2008-03-30 16:34       ` Ludovic Courtès
2008-03-30 17:54         ` Sebastian Tennant

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