GNU bug report logs - #54090
[PATCH 0/2] gnu: Add tessen.

Previous Next

Package: guix-patches;

Reported by: Tanguy Le Carrour <tanguy <at> bioneland.org>

Date: Mon, 21 Feb 2022 17:45:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Tanguy LE CARROUR <tanguy <at> bioneland.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 54090 <at> debbugs.gnu.org
Subject: [bug#54090] [PATCH 0/2] gnu: Add tessen.
Date: Sun, 06 Mar 2022 19:40:45 +0100
Hi Ludo’

Thanks for reviewing!


Quoting Ludovic Courtès (2022-03-03 23:30:23)
> Tanguy Le Carrour <tanguy <at> bioneland.org> skribis:
> 
> > * gnu/packages/password-utils.scm (tessen): New variable.
> 
> [...]
> 
> > +     (origin
> > +       (method url-fetch)
> > +       (uri
> > +        (string-append "https://raw.githubusercontent.com/ayushnix/tessen/"
> > +                       "v" version "/tessen"))
> 
> Is this a stable URL?

As stable as it can get, nowadays?! ^_^'
Anyway, might not be a problem any more once you've reached the end of
this email…


> > +       #:builder
> > +       (begin
> > +         (use-modules (guix build utils))
> > +         (let ((source (string-append (assoc-ref %build-inputs "source")))
> > +               (script "tessen")
> > +               (out (assoc-ref %outputs "out")))
> 
> Could you change that to use a gexp, along these lines:
> 
>   #:builder #~(begin
>                 …
>                 (let ((source #$(package-source this-package))
>                       (out    #$output)
>                       …)
>                   …))

Mmmm… I tried, but could not get anything to work! I ended up with:

```
#:builder #~(begin
             (use-modules (guix build utils))
             (let ((source #$(package-source this-package))
                   (out    #$output)
                   (wtype  #$(this-package-input "wtype"))
                   (script "tessen"))
               (copy-file source script)
               (chmod script #o555)
               (substitute* script
                 (("wtype") (string-append wtype "/bin/wtype")))
               (install-file script (string-append out "/bin"))))
```

But it failed with:

```
ERROR: In procedure %resolve-variable:
Unbound variable: gexp
```


> > +    (propagated-inputs
> > +     (list wtype))
> 
> Could you substitute* the absolute file name of ‘wtype’ in the script
> instead of propagating?

This, at least, I think I did properly! Without the Gexp, I wrote
something that works:

```
(begin
 (use-modules (guix build utils))
 (let ((source (string-append (assoc-ref %build-inputs "source")))
       (script "tessen")
       (out (assoc-ref %outputs "out")))
       (out    (assoc-ref %outputs "out"))
       (wtype  (assoc-ref %build-inputs "wtype"))
       (script "tessen"))
   (copy-file source script)
   (chmod script #o555)
   (install-file script (string-append out "/bin"))))))
```

But actually, I figured out that Tessen was not "just" a Bash script and
could be "properly" `make install`-ed. So, I'll try to rewrite a proper
package definition, fetching the source from Git and installing it the
good old way! I can then use a more familiar `modify-phases` to
substitute `wtype` in the script.

Sounds like a plan to you?!

Regards,

-- 
Tanguy




This bug report was last modified 3 years and 57 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.