delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2021/04/20/04:44:01

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20161025;
h=from:date:to:subject:message-id:mail-followup-to:references
:mime-version:content-disposition:in-reply-to;
bh=PeE8FWpKo43/CQGr1xpUwiVjpUtsqlmk6YASa0OOr98=;
b=SmUcuqskEod7CsrhNKSeTBMwhd5odei+iRYGfokVRrD8uMhRgbGYN6WrEQPtlsx5d4
6lsFeHlLOa/nSioqgFsB097adfQeE2NpAVf3Sz1sWBbgxeun+LPoM/J5xpN/UCIDKL44
rTQjADyb6K7WlZPD74sNzk+cwcweVcswF7EBwjCu4XpZ+94ahA0N4NezT666JfvSrr6h
ZmM3K24YSR3Fg9mmaMrirMnQ3+0Sd4o08bUWX4JlFnl5CIROtdnEHIemWoRp5GwWf3aT
wrr9scaNi3+zfMUDqEI1RLOJINPaMzKy2h2LmlOXUs4VUd6tSw/z9h3a+/Ykk0gogzEH
kPkw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:from:date:to:subject:message-id:mail-followup-to
:references:mime-version:content-disposition:in-reply-to;
bh=PeE8FWpKo43/CQGr1xpUwiVjpUtsqlmk6YASa0OOr98=;
b=sQGNOLN1PlNCT5ncVplkFTtzAB3kk3dprUzeAUZSoVa3utN4mG7TknaUqDxkaFxZiY
MlUBFqWkIZTpfmM9eKl0K3+VGXkm8wxCZWR5L5bXYyCZGncPRuW0DtDHjKKOkv2YkoVF
9GHnv7xeGFJzrO9UEEZJuCuAgxOKFXf2KDqHdwzHB75/L7AcXuj4fgBVy5a6uPTC2BnV
o+R+I11rsFUloG+BSDxLQCcxiaWxP5TbP8sxaW8pZrr8uokTZes2T/ygu3zKoZDUVu2D
tIme8s6VDa+CXeCdMPtfx1cUtM+RktEI59XjcerLe1DKE2zIiQqs2/CyImjqypTxxHLf
KQLg==
X-Gm-Message-State: AOAM532yAJcE+SxVEiOyd26YQ/YRksXED2i0B4IRfn4jdQETlHXtB+G9
NVUtdrXL9daEC/5F9Gbs8KsIHxEjFVQ=
X-Google-Smtp-Source: ABdhPJz7gBSlRY9qG5/R7YKrNK7IRFFN8D4YSs1sciMHtaq8CsG3YCzHIZ0dWTzxMnLsrJ0Ybnyizw==
X-Received: by 2002:ac2:5972:: with SMTP id h18mr3140715lfp.206.1618908137477;
Tue, 20 Apr 2021 01:42:17 -0700 (PDT)
From: "Vladimir Zhbanov (vzhbanov AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
X-Google-Original-From: Vladimir Zhbanov <vzh AT lepton>
Date: Tue, 20 Apr 2021 11:42:15 +0300
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] system wide config
Message-ID: <YH6T5zzhba9AqGX9@lepton>
Mail-Followup-To: geda-user AT delorie DOT com
References: <20210417120805 DOT 37DAA824EAA0 AT turkos DOT aspodata DOT se>
<YHrjzpKEMOvXREuY AT lepton>
<20210417144426 DOT E4238824EAA0 AT turkos DOT aspodata DOT se>
<YH4IPPe+k4MZJJkm AT lepton>
<20210420004032 DOT 30A6980770A6 AT turkos DOT aspodata DOT se>
MIME-Version: 1.0
In-Reply-To: <20210420004032.30A6980770A6@turkos.aspodata.se>
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Karl,

On Tue, Apr 20, 2021 at 02:40:32AM +0200, karl AT aspodata DOT se [via geda-user AT delorie DOT com] wrote:
> Vladimir:
> ...
> > You could do 'ln -s ../sym' in each of the subdirs and then
> > the commands in gafrc for sub-pages were superfluous.
> 
> Guess this is coming more and more offtopic, but one thing i did
> for makefiles, is having just one link in each dir (where it matters)
> and in the Makefile have:
> 
> INC := $(shell readlink -f Makefile | sed -e 's/\/Makefile//' )
> TOP := $(shell dirname $(INC))
> BIN := $(TOP)/bin/
> 
>  then I can include/run something from common places like
> 
> include $(INC)/Make_post.mk
> 
> %.small.sym:  %.sym
>         $(BIN)scale_sym.pl 0.5 $< > $@
> 
>  I guess something similar is possible in guile also.

Many different approaches can be used in Guile to achieve what you
want: using environment variables, system calls, pipes, writing
to/from files, etc.

E.g., I'll mimic getting of 'INC' above:

(use-modules (ice-9 popen)) ; for pipes
(use-modules (ice-9 rdelim)) ; for delimited reading
(let* ((port (open-input-pipe "readlink -f Makefile"))
             (str  (read-line port))) ; from (ice-9 rdelim)
       (close-pipe port)
       (dirname str))

=> "/some/absolute/dirname"

It's easy to get other variables then.

You could also use 'system' or 'system*' calls to run any scripts
like scale_sym.pl above.

Probably using of some predefined environment variable would be
even easier in your case since Lepton expands them in library
commands such as "component-library". 'setenv', 'putenv', 'getenv'
are available in Guile as well.

  Vladimir

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019