all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: Tom Willemse <tom@ryuslash.org>
Cc: help-guix@gnu.org
Subject: Re: SCSH libraries search path
Date: Thu, 16 Feb 2023 17:42:17 +0200	[thread overview]
Message-ID: <Y+5O2WlnwaMWtOyK@3900XT> (raw)
In-Reply-To: <87leo06el4.fsf@ryuslash.org>

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

On Wed, Nov 23, 2022 at 10:39:35PM -0800, Tom Willemse wrote:
> Hey Efraim,
> 
> Efraim Flashner <efraim@flashner.co.il> writes:
> 
> > On Sun, Nov 13, 2022 at 04:49:05PM -0800, Tom Willemse wrote:
> >> Hey Efraim,
> >> 
> >> Efraim Flashner <efraim@flashner.co.il> writes:
> >> 
> >> > On Mon, Oct 31, 2022 at 12:18:50AM -0700, Tom Willemse wrote:
> >> >> Hey Guix \o/
> >> >> 
> >> >> I've been wanting to package one of my little scripts in Guix Home and
> >> >> it uses a little library I wrote for SCSH. I've been looking at how
> >> >> Search Paths work and I'm having trouble figuring out how to make this
> >> >> work.
> >> >> 
> >> >> Search paths seem easy enough generally, I was able to add a simple
> >> >> addition to my configuration by just adding this to the scsh package
> >> >> definition:
> >> >> 
> >> >>     (native-search-paths
> >> >>      (list (search-path-specification
> >> >>             (variable "SCSH_LIB_DIRS")
> >> >>             (files '("share/scsh/site")))))
> >> >
> >> > Try adding the 'separator' field, so it would look like this:
> >> >
> >> >      (native-search-paths
> >> >       (list (search-path-specification
> >> >              (variable "SCSH_LIB_DIRS")
> >> >              (separator " ")
> >> >              (files '("share/scsh/site")))))
> >> 
> >> Thanks for the suggestion! Unfortunately this gets me a value of
> >> `SCSH_LIB_DIRS' like
> >> 
> >>     /home/chelys/.guix-home/profile/share/scsh-0.7
> >> 
> >> which, when I try the command `scsh -ll mpd.scm -o mpd' causes the
> >> following error to appear:
> >> 
> >>     error: Illegal path element in $SCSH_LIB_DIRS
> >>     $SCSH_LIB_DIRS: /home/chelys/.guix-home/profile/share/scsh-0.7
> >>     The following element is not a string or #f: /home/chelys/.guix-home/profile/share/scsh-0.7
> >> 
> >> It's because SCSH treats the contents of `SCSH_LIB_DIRS' as "a sequence
> >> of of s-expressions, which are `read' from the string"[1] and supports
> >> either string values or the value #f. So `SCSH_LIB_DIRS' would have to
> >> be in this case:
> >> 
> >>     "/home/chelys/.guix-home/profile/share/scsh-0.7"
> >> 
> >> I guess this just isn't supported as yet in Guix?
> >> 
> >
> > I played around with a bunch of different options, and I wasn't able to
> > get the search-path-specification to pass the directories as strings. If
> > we change the file-type to 'string then it looks for strings, but it
> > really means it's looking for individual files or for directories, so
> > that's not the right change.
> >
> > IMO the easiest way to work around it (from scsh, not from guix) would
> > be to use 'stringify' from (scheme utilities) in (scheme lib-dirs) (for
> > the syntactic sugar around symbol->string) to make all the items in the
> > search path into strings if they aren't already.
> 
> I've tried out your changes and it seems to work just great for my
> little module so far, thank you!
> 
> > Actually I have a simple diff I'll send upstream that should take care
> > of it. If you could help test it that'd be great. I haven't been able to
> > create a scenario where I had more than one path in the SCSH_LIB_DIRS.
> 
> I don't know how I would get more than one value in there with Guix, but
> manually adding another path in there works fine:
> 
> > 22:36 ~ [1]> export SCSH_LIB_DIRS="\"${HOME}/usr/share/scsh/\" ${SCSH_LIB_DIRS}"
> > 22:37 ~ [130]> echo $SCSH_LIB_DIRS                                                
> > "/home/chelys/usr/share/scsh/" /home/chelys/.guix-home/profile/share/scsh-0.7
> > 22:37 ~ > scsh -ll mpd.scm -o mpd -ll herbstluft.scm -o herbstluft 
> > Welcome to scsh 0.7
> > Type ,? for help.
> > > (query (and (= artist "Danko Jones") (= album "Garage Rock")))
> > "((artist == \"Danko Jones\") AND (album == \"Garage Rock\"))"
> > > (hc get_attr "my_wallpaper")
> > /home/chelys/pictures/wallpaper/5120x1440/nfbq2nw3rsm81.jpg
> > 0

I was waiting for upstream to apply the patch and then I realized it had
been a while and figured I'd just add it here also.

Patch finally applied, scsh now uses the search path SCSH_LIB_DIRS.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2023-02-16 15:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31  7:18 SCSH libraries search path Tom Willemse
2022-11-06 10:13 ` Efraim Flashner
2022-11-14  0:49   ` Tom Willemse
2022-11-14 12:47     ` Efraim Flashner
2022-11-24  6:39       ` Tom Willemse
2023-02-16 15:42         ` Efraim Flashner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+5O2WlnwaMWtOyK@3900XT \
    --to=efraim@flashner.co.il \
    --cc=help-guix@gnu.org \
    --cc=tom@ryuslash.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.